FUXA源码添加自定义资源-svg

本文介绍了如何在FUXA的组态模拟中通过上传源码实现SVG资源的集成,包括使用开源项目中的Pipes和Tanks,以及如何从iconfont阿里巴巴矢量图标库获取SVG并进行测试,无需重启FUXAServer。
摘要由CSDN通过智能技术生成

        在FUXA进行组态模拟时,通常需要根据工控业务中使用不同的模型,在FUXA中可以通过上传图片或者源码上传资源实现,源码上传SVG实现的好处是直接集成到FUXA项目的服务端,不用每次都从文件夹上传。

1、源码添加SVG

其中Pipes和Tanks是开源项目中自带的,文件夹的名称将作为下拉菜单的名称,对应的SVG将会显示在其中。可以新建目录,每个目录下可以添加多个svg文件(一定是.svg文件)。

源码HTML代码:

FUXA\client\src\app\resources\lib-images\lib-images.component.html

<div>
    <h1 mat-dialog-title style="display:inline-block; cursor:move;" mat-dialog-draggable>{{'resources.lib-images' | translate}}</h1>
    <mat-icon (click)="onNoClick()" style="float:right;margin-right:-10px;margin-top:-10px;cursor:pointer;color:gray;">clear</mat-icon>
    <div mat-dialog-content>
        <mat-accordion multi="true">
            <mat-expansion-panel *ngFor="let grpImages of resImages" class="my-expansion-panel lib-image-panel">
                <mat-expansion-panel-header class="header" [collapsedHeight]="'40px'" [expandedHeight]="'40px'">
                    <mat-panel-title>
                        {{grpImages.name}}
                    </mat-panel-title>
                    <mat-panel-description>

                    </mat-panel-description>
                </mat-expansion-panel-header>
                <div *ngFor="let item of grpImages.items" (click)="onSelect(item.path)" class="lib-image-item" matTooltip="{{item.name}}">
                    <img src="{{item.path}}" id="{{item.path}}">
                </div>

            </mat-expansion-panel>
            <!-- <mat-expansion-panel class="my-expansion-panel">
                <mat-expansion-panel-header class="header" [collapsedHeight]="'40px'" [expandedHeight]="'40px'">
                    <mat-panel-title>
                        Page editor
                    </mat-panel-title>
                    <mat-panel-description>

                    </mat-panel-description>
                </mat-expansion-panel-header>
                Page editor content
            </mat-expansion-panel> -->
        </mat-accordion>
        <div style="display: block;width: 660px; padding-bottom: 20px;">

        </div>
    </div>
    <div mat-dialog-actions class="dialog-action">
        <button mat-raised-button (click)="onNoClick()">{{'dlg.cancel' | translate}}</button>
    </div>
</div>

2、ifconfont

可以从iconfont-阿里巴巴矢量图标库icon-default.png?t=N7T8https://www.iconfont.cn/?spm=a313x.home_index.i3.d4d0a486a.36113a81yPSjfa获取SVG,进行测试,期间FUXA Server 不需要重新启动。

  • 11
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值