物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

667 lines
52 KiB

const e="aa85f1cb-f10a-4ca8-9377-a69d44fca6c6",t="custom-tricolor-light",a="三色灯",o=`<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="48.154167mm"
height="45.772919mm"
viewBox="0 0 48.154167 45.772919"
version="1.1"
id="svg785"
xml:space="preserve"
inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
sodipodi:docname="绿色灯1.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview787"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.74564394"
inkscape:cx="-123.38329"
inkscape:cy="306.44653"
inkscape:window-width="1397"
inkscape:window-height="1040"
inkscape:window-x="724"
inkscape:window-y="150"
inkscape:window-maximized="0"
inkscape:current-layer="layer1" /><defs
id="defs782"><style
id="style906">.cls-1{fill:#09ba1a;}.cls-2{fill:url(#未命名的渐变_9);}.cls-3{fill:url(#未命名的渐变_3);}.cls-4{fill:url(#未命名的渐变_3-2);}</style><linearGradient
id="未命名的渐变_9"
x1="84.449997"
y1="128.87"
x2="167.55"
y2="128.87"
gradientTransform="matrix(1,0,0,-1,0,252)"
gradientUnits="userSpaceOnUse"><stop
offset="0.01"
stop-color="#b3ffb7"
stop-opacity="0.72"
id="stop908" /><stop
offset="0.02"
stop-color="#93f299"
stop-opacity="0.77"
id="stop910" /><stop
offset="0.07"
stop-color="#49d455"
stop-opacity="0.9"
id="stop912" /><stop
offset="0.1"
stop-color="#1ac12a"
stop-opacity="0.97"
id="stop914" /><stop
offset="0.12"
stop-color="#09ba1a"
id="stop916" /><stop
offset="0.2"
stop-color="#1fc32e"
stop-opacity="0.96"
id="stop918" /><stop
offset="0.35"
stop-color="#57da62"
stop-opacity="0.87"
id="stop920" /><stop
offset="0.56"
stop-color="#b2ffb6"
stop-opacity="0.72"
id="stop922" /><stop
offset="0.57"
stop-color="#b3ffb7"
stop-opacity="0.72"
id="stop924" /><stop
offset="0.62"
stop-color="#a1f8a6"
stop-opacity="0.75"
id="stop926" /><stop
offset="0.72"
stop-color="#71e47a"
stop-opacity="0.83"
id="stop928" /><stop
offset="0.85"
stop-color="#24c533"
stop-opacity="0.96"
id="stop930" /><stop
offset="0.89"
stop-color="#09ba1a"
id="stop932" /><stop
offset="0.91"
stop-color="#0dbc1e"
id="stop934" /><stop
offset="0.93"
stop-color="#19c42a"
id="stop936" /><stop
offset="0.96"
stop-color="#2dd03e"
id="stop938" /><stop
offset="0.98"
stop-color="#4ae15b"
id="stop940" /><stop
offset="1"
stop-color="#69f47a"
id="stop942" /></linearGradient><linearGradient
id="未命名的渐变_3"
x1="51"
y1="59.779999"
x2="201"
y2="59.779999"
gradientTransform="matrix(1,0,0,-1,-34,225)"
gradientUnits="userSpaceOnUse"><stop
offset="0"
stop-color="#6b6b6b"
id="stop945" /><stop
offset="0.11"
stop-color="#767676"
id="stop947" /><stop
offset="0.3"
stop-color="#959595"
id="stop949" /><stop
offset="0.41"
stop-color="#aaa"
id="stop951" /><stop
offset="0.56"
stop-color="#ccc"
id="stop953" /><stop
offset="0.71"
stop-color="#eaeaea"
id="stop955" /><stop
offset="0.8"
stop-color="#f6f6f6"
id="stop957" /><stop
offset="0.83"
stop-color="#ededed"
id="stop959" /><stop
offset="0.87"
stop-color="#d4d4d4"
id="stop961" /><stop
offset="0.92"
stop-color="#ababab"
id="stop963" /><stop
offset="0.98"
stop-color="#737373"
id="stop965" /><stop
offset="0.99"
stop-color="#666"
id="stop967" /></linearGradient><linearGradient
id="未命名的渐变_3-2"
x1="79.360001"
y1="72.639999"
x2="172.64"
y2="72.639999"
xlink:href="#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_3" /><linearGradient
inkscape:collect="always"
xlink:href="#未命名的渐变_3"
id="linearGradient1038"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,-1,-34,225)"
x1="51"
y1="59.779999"
x2="201"
y2="59.779999" /></defs><g
inkscape:label="图层 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-91.600336,-67.242574)"><g
id="g1036"
transform="matrix(0.26458333,0,0,0.26458333,91.600336,67.242574)"><rect
class="cls-1"
x="88"
width="6"
height="30"
rx="3"
ry="3"
id="rect975"
y="0" /><rect
class="cls-1"
x="198"
y="103"
width="6"
height="30"
rx="3"
ry="3"
transform="rotate(90,197.5,87.5)"
id="rect977" /><rect
class="cls-1"
x="68.260002"
y="49.259998"
width="6"
height="30"
rx="3"
ry="3"
transform="rotate(-45,21.666977,91.805244)"
id="rect979" /><rect
class="cls-1"
x="46"
y="103"
width="6"
height="30"
rx="3"
ry="3"
transform="rotate(-90,18.5,121.5)"
id="rect981" /><rect
class="cls-1"
x="176.95"
y="49.759998"
width="6"
height="30"
rx="3"
ry="3"
transform="rotate(45,195.53533,10.223387)"
id="rect983" /><path
class="cls-2"
d="M 167.55,174.26 H 84.45 V 113.55 A 41.55,41.55 0 0 1 126,72 v 0 a 41.55,41.55 0 0 1 41.55,41.55 v 0 z"
transform="translate(-34,-27)"
id="path985"
style="fill:url(#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_9)" /><rect
class="cls-3"
x="17"
y="157.44"
width="150"
height="15.56"
rx="3.49"
ry="3.49"
id="rect987"
style="fill:url(#linearGradient1038)" /><rect
class="cls-4"
x="45.360001"
y="147.25999"
width="93.279999"
height="10.19"
id="rect989"
style="fill:url(#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_3-2)" /></g></g></svg>
`,n="svg",i="基础",s="常用",p=!1,c=!0,l="时间",r=`{"id":"u:270584784ce1","type":"page","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID&nbsp;&nbsp;&nbsp;&nbsp;","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-color","label":"前景色","name":"btnColor","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","inputClassName":"w-full","format":"rgba"}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor","id":"u:89afff5fd00d","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:7c903d9d40ab","md":6}],"id":"u:457970dd35bf","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"边宽","name":"strokeWidth","id":"u:8dcf62d3dab5","placeholder":"描边宽度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":1,"value":1,"suffix":"px","inputClassName":"w-full"}],"id":"u:d701217b85ef","md":6},{"body":[{"type":"input-text","label":"内容","name":"content","id":"u:bea5a408f98f","mode":"horizontal","size":"full","inputControlClassName":"inputControlClassName-bea5a408f98f"}],"id":"u:afc37bde0156","md":6}],"id":"u:235f153e5ad5","className":"m-b"},{"type":"switch","label":"显示文字","option":"","name":"showText","falseValue":false,"trueValue":true,"id":"u:0f0bea4f4383","value":false,"mode":"horizontal"},{"type":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"字体","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"select","id":"u:6f3470628b86","label":"字体类型","name":"fontFamily","mode":"horizontal","horizontal":{"leftFixed":"sm"},"size":"lg","options":[{},{"label":"宋体","value":"SimSun"},{"label":"微软雅黑","value":"Microsoft Yahei"},{"label":"苹方","value":"PingFang SC"},{"label":"Andale Mono","value":"andale mono,monospace"},{"label":"Arial","value":"arial,helvetica,sans-serif"},{"label":"Arial Black","value":"arial black,sans-serif"},{"label":"Book Antiqua","value":"book antiqua,palatino,serif"},{"label":"Comic Sans MS","value":"comic sans ms,sans-serif"},{"label":"Courier New","value":"courier new,courier,monospace"},{"label":"Georgia","value":"georgia,palatino,serif"},{"label":"Helvetica Neue","value":"Helvetica Neue"},{"label":"Helvetica","value":"helvetica,arial,sans-serif"},{"label":"Impact","value":"impact,sans-serif"},{"label":"Symbol","value":"symbol"},{"label":"Tahoma","value":"tahoma,arial,helvetica,sans-serif"},{"label":"Terminal","value":"terminal,monaco,monospace"},{"label":"Times New Roman","value":"times new roman,times,serif"},{"label":"Trebuchet MS","value":"trebuchet ms,geneva,sans-serif"},{"label":"Verdana","value":"verdana,geneva,sans-serif"}],"multiple":false,"className":"m-b","menuTpl":"<span style=font-family:\${value}>\${label}</span>","inputClassName":""},{"type":"input-color","label":"字体","name":"fontColor","id":"u:f398c821eda1","mode":"horizontal","size":"lg","className":"m-b","format":"rgba","placeholder":"字体颜色","horizontal":{"leftFixed":"sm"},"inputClassName":""},{"type":"input-number","id":"u:0063eed6ed66","label":"字体大小","name":"fontSize","min":12,"step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"className":"m-b","keyboard":true,"displayMode":"enhance","value":12,"max":100},{"type":"checkboxes","id":"u:b34f4c274416","className":"custom-checkbox-style m-b","label":"文字样式","name":"fontStyle","options":[{"label":"fa-bold fa","value":"bold"},{"label":"fa-italic fa","value":"italic"},{"label":"fa-underline fa","value":"underline"},{"label":"fa fa-strikethrough","value":"line-through"}],"checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"<span class='text-lg \${label}'></span>","inputClassName":"","multiple":true},{"type":"checkboxes","label":"文字位置","name":"fontAlign","multiple":false,"options":[{"label":"fa fa-align-left","value":"left"},{"label":"fa fa-align-center","value":"center"},{"label":"fa fa-align-right","value":"right"},{"label":"fa fa-align-justify","value":"justify"}],"id":"u:7e80e906ea14","checkAll":false,"joinValues":true,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"optionType":"button","menuTpl":"<span class='text-lg \${label}'></span>","inputClassName":"","className":"custom-checkbox-style m-b"},{"type":"input-number","label":"文字行高","name":"lineHeight","keyboard":true,"id":"u:0063eed6ed66","step":1,"mode":"horizontal","horizontal":{"leftFixed":"sm"},"displayMode":"enhance","className":"m-b"}],"style":{"position":"static","display":"block"},"wrapperBody":false}],"bodyClassName":"m-b"}],"id":"u:a5ebe5f02407","submitText":"","onEvent":{"change":{"weight":0,"actions":[]}},"debug":false,"mode":"normal","panelClassName":"p","labelAlign":"left","className":"","wrapWithPanel":true}],"id":"u:c309ae58472c","className":"p-none no-border"},{"title":"交互","icon":"fa fa-calendar-minus-o","body":[{"type":"service","body":[{"type":"collapse","key":"2","header":"数据/外观","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[]},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"uiDataPoint","multiple":false,"mode":"horizontal","size":"full","onEvent":{"focus":{"weight":0,"actions":[{"actionType":"dialog","dialog":{"type":"dialog","title":"请配置需要绑定的数据点","body":[{"type":"tabs","tabs":[{"title":"常规数据点","body":[{"type":"form","title":"","body":[{"type":"select","label":"数据源","name":"dataSource","id":"u:c273f087b8ed","multiple":false,"mode":"horizontal","size":"md","source":"\${apiDtoList || thingApiDTOList}","labelField":"name","valueField":"id","onEvent":{"change":{"actions":[{"actionType":"reload","componentId":"u:1cdb908c23a8"},{"actionType":"custom","script":"if (!event.data.value) { doAction({'actionType': 'setValue', 'componentId': 'u:1cdb908c23a8', 'args': {'value': ''} });\\r\\n doAction({'actionType': 'setValue', 'componentId': 'u:8147daea685d', 'args': {'value': ''} }); }"}]}},"clearable":true,"horizontal":{"leftFixed":"sm"},"actionType":"change","target":"u:1cdb908c23a8"},{"type":"combo","label":"设备属性","name":"deviceAttrs","id":"u:98559a2dd514","multiple":false,"mode":"horizontal","size":"full","horizontal":{"leftFixed":"sm"},"items":[{"type":"input-table","label":false,"id":"u:41dfc35c368c","name":"table","strictMode":false,"needConfirm":false,"addable":true,"removable":true,"columns":[{"type":"input-text","label":"序号","id":"u:434e22030bc6","name":"num","size":"sm","mode":"horizontal","quickEdit":{"mode":"popOver","id":"u:c6a294f5c93a"},"horizontal":{"left":2,"right":10},"placeholder":"例:A/B/C/AA/BB","width":200},{"type":"select","name":"devices","id":"u:1cdb908c23a8","label":"设备","multiple":false,"mode":"horizontal","quickEdit":true,"size":"sm","source":{"url":"/thing/v2/api/telemetryById?id=\${dataSource}","method":"get","messages":{},"headers":{"token":"\${myToken}","tenantCode":"\${myTenantCode}","companyId":"\${myCompanyId}"},"adaptor":"if (payload && payload.data && payload.data.result) {console.log('payload.data.result', payload.data.result); \\r\\n const list = []\\r\\n const devices = payload.data.result.info \\r\\n for (const key in devices) {\\r\\n const device_info = devices[key] \\r\\n list.push({\\r\\n label: device_info.entityName,\\r\\n value: device_info.entityId,\\r\\n deviceCode: device_info.entityCode,\\r\\n deviceInfo: device_info,\\r\\n attrs: device_info.attrs })\\r\\n }\\r\\n payload.data = list;\\r\\n return payload\\r\\n}","sendOn":"this.dataSource"},"onEvent":{"change":{"actions":[{"actionType":"custom","script":"if (!event.data.value) { doAction({'actionType': 'setValue', 'componentId': 'u:8147daea685d', 'args': {'value': ''} }); }"}]}},"responseData":{"&":"$$","list":"\${items}"},"clearable":true,"horizontal":{"left":2,"right":10},"checkAll":false},{"type":"select","name":"dataPoint","id":"u:8147daea685d","label":"数据点","multiple":false,"quickEdit":true,"mode":"horizontal","size":"sm","source":{"url":"/thing/v2/api/callDict?id=\${dataSource}&entityId=\${devices}","method":"get","messages":{},"headers":{"token":"\${myToken}","tenantCode":"\${myTenantCode}","companyId":"\${myCompanyId}"},"sendOn":"this.dataSource && this.devices","adaptor":"const list = payload.data.map(item => {\\r\\n item.dictName = item.dictName + ' - ' + item.dictCode\\r\\n return item\\r\\n})\\r\\npayload.data = list;\\r\\nreturn payload"},"labelField":"dictName","valueField":"dictCode","checkAll":false,"horizontal":{"left":2,"right":10},"overlay":{"width":"350px"},"searchable":true}]}],"strictMode":true,"syncFields":[],"tabsMode":false,"canAccessSuperData":true,"inputClassName":"w-full","className":"m-b-sm"},{"type":"checkbox","label":"数据处理","name":"enableDataHandle","id":"u:034ca60f2135","mode":"horizontal","horizontal":{"leftFixed":"normal"},"option":""},{"type":"combo","id":"u:a06125153fa6","name":"calcRules","label":"计算规则","mode":"horizontal","visibleOn":"this.enableDataHandle","multiple":true,"items":[{"name":"formular","label":"计算公式","type":"input-text","id":"u:318a7f0c6449","placeholder":"例: (A + B) / C","width":"50%","size":"full"},{"name":"resultAttr","label":"计算结果属性","type":"input-text","id":"u:1e6e491ccbaa","placeholder":"例:A8、B、C...","width":"50%"}],"strictMode":true,"syncFields":[],"hidden":false,"inputClassName":"w-full","multiLine":false,"className":"calcRules"},{"type":"input-text","label":"唯一数据点","name":"uniquePoint","id":"u:3b257b599c19","mode":"horizontal","visibleOn":"this.enableDataHandle","labelRemark":{"icon":"fa fa-question-circle","trigger":["hover"],"className":"Remark--warning","placement":"top","title":"场景:","content":"当有数据处理,并且只需绑定一个数据点作为 【实时/立即/最新数据】时,请填写所需数据点的序号或计算结果属性。"},"inputControlClassName":"m-b"}],"id":"u:51f0e51abd7c","data":{"attrs":[],"deviceCode":"\${deviceCode || ''}","devices":"\${devices || ''}","dataPoint":"\${dataPoint || ''}","dataSource":"\${dataSource || ''}","deviceAttrs":"\${deviceAttrs || []}"},"submitText":"","onEvent":{"inited":{"actions":{"actionType":"custom","script":"if(event.data.devices && event.data.dataPoint && event.data.deviceAttrs.length === 0) { const dataPoints = event.data.dataPoint.split(','); const newDeviceAttrs = dataPoints.map((point, idx) => ({ num: String.fromCharCode(65+idx), devices: event.data.devices, dataPoint: point }) ); doAction({ 'actionType': 'setValue', 'componentId': 'u:51f0e51abd7c', 'args': { value: {deviceAttrs: { table: newDeviceAttrs } }} }); }"}}}}],"id":"u:5505e7ef7cab"},{"title":"虚拟变量","body":[{"type":"tpl","tpl":"暂时无虚拟变量可配置","wrapperComponent":"","inline":false,"id":"u:722592249b31"}],"id":"u:b739cc6a6ed7"}],"id":"u:3b446450d643"}],"showCloseButton":true,"showErrorMsg":true,"showLoading":true,"id":"u:f46c2439c983","data":{"&":"\${dataPoint | toJson}","apiDtoList":"\${thingApiDTOList}","myToken":"\${myToken}","myTenantCode":"\${myTenantCode}","myCompanyId":"\${myCompanyId}"},"onEvent":{"confirm":{"actions":[{"actionType":"custom","script":"const tableData = event.data.deviceAttrs.table; let devices = ''; let dataPoint = ''; if(tableData) { tableData.forEach(item => { devices += (item.devices + ',');dataPoint += (item.dataPoint + ','); });}; if(tableData && tableData.length > 0) { devices = devices.substring(0, devices.length - 1); dataPoint = dataPoint.substring(0, dataPoint.length - 1); const newValue = {...event.data, devices: devices, dataPoint: dataPoint, dataSource: event.data.dataSource} ; doAction({ 'componentId': 'uiDataPoint', 'actionType': 'setValue', 'args': { value: JSON.stringify(newValue) } }) } else {doAction({ 'componentId': 'uiDataPoint', 'actionType': 'setValue', 'args': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true,"editorState":"default"},{"type":"combo","name":"conditionVariables","label":"","value":[{"type":"green"}],"multiLine":false,"multiple":true,"typeSwitchable":false,"conditions":[{"label":"绿色","test":"this.type === \\"green\\"","scaffold":{"type":"green","label":"绿色","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb","placeholder":"正常工作、可操作"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"绿色数值"}]},{"label":"黄色","test":"this.type === \\"yellow\\"","scaffold":{"type":"yellow","label":"黄色","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb","placeholder":"待机、准备或警戒状态"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"黄色数值"}]},{"label":"红色","test":"this.type === \\"red\\"","scaffold":{"type":"red","label":"红色","name":""},"items":[{"label":"标签","name":"valueLabel","type":"input-text","id":"u:6f9362ce0efb","placeholder":"停机、紧急停止或故障"},{"label":"数值","name":"value","type":"input-text","id":"u:32b3714b545b","placeholder":"红色数值"}]}],"id":"u:c92fdccb153e","deleteBtn":{"type":"icon","icon":"fa fa-trash","id":"u:4d4df8658829"}}],"name":"uiService","className":"p-none"}],"id":"u:7c5fc82d356f","headingClassName":"p-sm b-b b-light bg-white","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \\n2. service 是 Ajax 请求服务。\\n3. nodeId 是节点 id . \\n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}`,d={jsPlugin:'[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true}]',json:`{
"nodes": [
{
"id": "bcc712a7-461f-4eb5-8a74-1a0df96ec0ec",
"type": "custom-tricolor-light",
"x": 200,
"y": 200,
"text": {
"value": "",
"x": 200,
"y": 200
},
"properties": {
"id": "bcc712a7-461f-4eb5-8a74-1a0df96ec0ec",
"width": 200,
"height": 200,
"x": 200,
"y": 200,
"rotation": 0,
"strokeWidth": 1,
"showText": false,
"fontSize": 12,
"nodeAlias": "三色灯",
"opacity": 1,
"showDefaultValue": false,
"showUnit": false,
"valueColor": "rgba(245, 166, 35, 1)",
"dynamic": {
"eventsData": {
"eventCombo": [
{
"eventType": "click",
"enable": false,
"config": ""
},
{
"eventType": "dblClick",
"enable": false,
"config": ""
}
]
},
"uiData": {
"dataPoint": "",
"compareType": "",
"conditionVariables": [
{
"type": "green",
"label": "绿色",
"name": "",
"value": "1",
"valueLabel": "正常"
}
],
"showBlink": false,
"showLabel": true
}
}
}
}
]
}`,javascript:`
const { createApp, createVNode, render } = Vue;
const app = createApp({})
const TriColor = {
template: \`<div style="width: 100%; height: 100%; position: relative">
<svg class="tricolor-svg-root" v-if="defaultValue === 1" width="100%" height="100%" viewBox="0 0 48.154167 45.772919" version="1.1" id="svg785" xml:space="preserve" inkscape:version="1.2.2 (732a01da63, 2022-12-09)" sodipodi:docname="绿色灯1.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs id="defs782">
<linearGradient id="未命名的渐变_9" x1="84.449997" y1="128.87" x2="167.55" y2="128.87" gradientTransform="matrix(1,0,0,-1,0,252)" gradientUnits="userSpaceOnUse">
<stop offset="0.01" stop-color="#b3ffb7" stop-opacity="0.72" id="stop908" />
<stop offset="0.02" stop-color="#93f299" stop-opacity="0.77" id="stop910" />
<stop offset="0.07" stop-color="#49d455" stop-opacity="0.9" id="stop912" />
<stop offset="0.1" stop-color="#1ac12a" stop-opacity="0.97" id="stop914" />
<stop offset="0.12" stop-color="#09ba1a" id="stop916" />
<stop offset="0.2" stop-color="#1fc32e" stop-opacity="0.96" id="stop918" />
<stop offset="0.35" stop-color="#57da62" stop-opacity="0.87" id="stop920" />
<stop offset="0.56" stop-color="#b2ffb6" stop-opacity="0.72" id="stop922" />
<stop offset="0.57" stop-color="#b3ffb7" stop-opacity="0.72" id="stop924" />
<stop offset="0.62" stop-color="#a1f8a6" stop-opacity="0.75" id="stop926" />
<stop offset="0.72" stop-color="#71e47a" stop-opacity="0.83" id="stop928" />
<stop offset="0.85" stop-color="#24c533" stop-opacity="0.96" id="stop930" />
<stop offset="0.89" stop-color="#09ba1a" id="stop932" />
<stop offset="0.91" stop-color="#0dbc1e" id="stop934" />
<stop offset="0.93" stop-color="#19c42a" id="stop936" />
<stop offset="0.96" stop-color="#2dd03e" id="stop938" />
<stop offset="0.98" stop-color="#4ae15b" id="stop940" />
<stop offset="1" stop-color="#69f47a" id="stop942" />
</linearGradient>
<linearGradient id="未命名的渐变_3" x1="51" y1="59.779999" x2="201" y2="59.779999" gradientTransform="matrix(1,0,0,-1,-34,225)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#6b6b6b" id="stop945" />
<stop offset="0.11" stop-color="#767676" id="stop947" />
<stop offset="0.3" stop-color="#959595" id="stop949" />
<stop offset="0.41" stop-color="#aaa" id="stop951" />
<stop offset="0.56" stop-color="#ccc" id="stop953" />
<stop offset="0.71" stop-color="#eaeaea" id="stop955" />
<stop offset="0.8" stop-color="#f6f6f6" id="stop957" />
<stop offset="0.83" stop-color="#ededed" id="stop959" />
<stop offset="0.87" stop-color="#d4d4d4" id="stop961" />
<stop offset="0.92" stop-color="#ababab" id="stop963" />
<stop offset="0.98" stop-color="#737373" id="stop965" />
<stop offset="0.99" stop-color="#666" id="stop967" />
</linearGradient>
<linearGradient id="未命名的渐变_3-2" x1="79.360001" y1="72.639999" x2="172.64" y2="72.639999" xlink:href="#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_3" />
<linearGradient inkscape:collect="always" xlink:href="#未命名的渐变_3" id="linearGradient1038" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,-1,-34,225)" x1="51" y1="59.779999" x2="201" y2="59.779999" />
</defs>
<g inkscape:label="图层 1" inkscape:groupmode="layer" id="layer1" transform="translate(-91.600336,-67.242574)">
<g id="g1036" transform="matrix(0.26458333,0,0,0.26458333,91.600336,67.242574)">
<rect class="tricolor-cls-1" x="88" width="6" height="30" rx="3" ry="3" id="rect975" y="0">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tricolor-cls-1" x="198" y="103" width="6" height="30" rx="3" ry="3" transform="rotate(90,197.5,87.5)" id="rect977">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tricolor-cls-1" x="68.260002" y="49.259998" width="6" height="30" rx="3" ry="3" transform="rotate(-45,21.666977,91.805244)" id="rect979">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tricolor-cls-1" x="46" y="103" width="6" height="30" rx="3" ry="3" transform="rotate(-90,18.5,121.5)" id="rect981">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tricolor-cls-1" x="176.95" y="49.759998" width="6" height="30" rx="3" ry="3" transform="rotate(45,195.53533,10.223387)" id="rect983">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<path class="tricolor-cls-2" d="M 167.55,174.26 H 84.45 V 113.55 A 41.55,41.55 0 0 1 126,72 v 0 a 41.55,41.55 0 0 1 41.55,41.55 v 0 z" transform="translate(-34,-27)" id="path985" style="fill:url(#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_9)" />
<rect class="tricolor-cls-3" x="17" y="157.44" width="150" height="15.56" rx="3.49" ry="3.49" id="rect987" style="fill:url(#linearGradient1038)" />
<rect class="tricolor-cls-4" x="45.360001" y="147.25999" width="93.279999" height="10.19" id="rect989" style="fill:url(#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_3-2)" />
</g>
</g>
</svg>
<svg class="tricolor-svg-root" v-else-if="defaultValue === 2" width="100%" height="100%" viewBox="0 0 48.154167 46.037498" version="1.1" id="svg442" xml:space="preserve"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs id="defs439">
<linearGradient id="未命名的渐变_6" x1="83.449997" y1="127.87" x2="166.55" y2="127.87" gradientTransform="matrix(1,0,0,-1,0,252)" gradientUnits="userSpaceOnUse">
<stop offset="0.01" stop-color="#fff1ca" stop-opacity="0.72" id="stop565" />
<stop offset="0.05" stop-color="#f4e57c" stop-opacity="0.87" id="stop567" />
<stop offset="0.09" stop-color="#eddc48" stop-opacity="0.96" id="stop569" />
<stop offset="0.12" stop-color="#ead934" id="stop571" />
<stop offset="0.21" stop-color="#eddd4d" stop-opacity="0.95" id="stop573" />
<stop offset="0.4" stop-color="#f6e78c" stop-opacity="0.84" id="stop575" />
<stop offset="0.57" stop-color="#fff1ca" stop-opacity="0.72" id="stop577" />
<stop offset="0.63" stop-color="#fceeb6" stop-opacity="0.76" id="stop579" />
<stop offset="0.75" stop-color="#f5e57f" stop-opacity="0.86" id="stop581" />
<stop offset="0.89" stop-color="#ead934" id="stop583" />
<stop offset="0.91" stop-color="#ebda3b" stop-opacity="0.99" id="stop585" />
<stop offset="0.93" stop-color="#eedd4e" stop-opacity="0.95" id="stop587" />
<stop offset="0.96" stop-color="#f2e26e" stop-opacity="0.89" id="stop589" />
<stop offset="0.98" stop-color="#f9ea9c" stop-opacity="0.81" id="stop591" />
<stop offset="1" stop-color="#fff1ca" stop-opacity="0.72" id="stop593" />
</linearGradient>
<linearGradient id="未命名的渐变_3" x1="50" y1="58.779999" x2="200" y2="58.779999" gradientTransform="matrix(1,0,0,-1,-34,225)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#6b6b6b" id="stop596" />
<stop offset="0.11" stop-color="#767676" id="stop598" />
<stop offset="0.3" stop-color="#959595" id="stop600" />
<stop offset="0.41" stop-color="#aaa" id="stop602" />
<stop offset="0.56" stop-color="#ccc" id="stop604" />
<stop offset="0.71" stop-color="#eaeaea" id="stop606" />
<stop offset="0.8" stop-color="#f6f6f6" id="stop608" />
<stop offset="0.83" stop-color="#ededed" id="stop610" />
<stop offset="0.87" stop-color="#d4d4d4" id="stop612" />
<stop offset="0.92" stop-color="#ababab" id="stop614" />
<stop offset="0.98" stop-color="#737373" id="stop616" />
<stop offset="0.99" stop-color="#666" id="stop618" />
</linearGradient>
<linearGradient id="未命名的渐变_3-2" x1="78.360001" y1="71.639999" x2="171.64" y2="71.639999" xlink:href="#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_3" />
<linearGradient xlink:href="#未命名的渐变_3" id="linearGradient688" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,-1,-34,225)" x1="50" y1="58.779999" x2="200" y2="58.779999" />
</defs>
<g id="layer1" transform="translate(-70.310014,-41.561895)">
<g id="g686" transform="matrix(0.26458333,0,0,0.26458333,70.310014,41.561895)">
<rect class="tri-yellow-cls-1" x="88" width="6" height="30" rx="3" ry="3" id="rect626" y="0">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tri-yellow-cls-1" x="198" y="103" width="6" height="30" rx="3" ry="3" transform="rotate(90,197.5,87.5)" id="rect628">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tri-yellow-cls-1" x="68.260002" y="49.259998" width="6" height="30" rx="3" ry="3" transform="rotate(-45,21.666977,91.805244)" id="rect630">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tri-yellow-cls-1" x="46" y="103" width="6" height="30" rx="3" ry="3" transform="rotate(-90,18.5,121.5)" id="rect632">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tri-yellow-cls-1" x="176.95" y="49.759998" width="6" height="30" rx="3" ry="3" transform="rotate(45,195.53533,10.223387)" id="rect634">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<g id="Light-_yellow_黄灯_" data-name="Light- yellow 黄灯 ">
<path class="tri-yellow-cls-2" d="M 166.55,175.26 H 83.45 V 114.55 A 41.55,41.55 0 0 1 125,73 v 0 a 41.55,41.55 0 0 1 41.55,41.55 v 0 z" transform="translate(-34,-27)" id="path636" style="fill:url(#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_6)" />
<rect class="tri-yellow-cls-3" x="16" y="158.44" width="150" height="15.56" rx="3.49" ry="3.49" id="rect638" style="fill:url(#linearGradient688)" />
<rect class="tri-yellow-cls-4" x="44.360001" y="148.25999" width="93.279999" height="10.19" id="rect640" style="fill:url(#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_3-2)" />
</g>
</g>
</g>
</svg>
<svg class="tricolor-svg-root" v-else-if="defaultValue === 3" width="100%" height="100%" viewBox="0 0 48.154167 46.037498" version="1.1" id="svg5" xml:space="preserve" inkscape:version="1.2.2 (732a01da63, 2022-12-09)" sodipodi:docname="红色灯1.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs id="defs2">
<linearGradient id="未命名的渐变_4" x1="83.449997" y1="127.87" x2="166.55" y2="127.87" gradientTransform="matrix(1,0,0,-1,0,252)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#fbb" stop-opacity="0.72" id="stop184" />
<stop offset="0.01" stop-color="#f6aaaa" stop-opacity="0.76" id="stop186" />
<stop offset="0.04" stop-color="#dc7878" stop-opacity="0.86" id="stop188" />
<stop offset="0.07" stop-color="#c95555" stop-opacity="0.94" id="stop190" />
<stop offset="0.09" stop-color="#be3f3f" stop-opacity="0.98" id="stop192" />
<stop offset="0.12" stop-color="#ba3838" id="stop194" />
<stop offset="0.18" stop-color="#c04343" id="stop196" />
<stop offset="0.29" stop-color="#d06161" id="stop198" />
<stop offset="0.42" stop-color="#e99191" id="stop200" />
<stop offset="0.53" stop-color="#fbb" id="stop202" />
<stop offset="0.58" stop-color="#fcb6b6" id="stop204" />
<stop offset="0.65" stop-color="#f5a7a7" id="stop206" />
<stop offset="0.72" stop-color="#e88f8f" id="stop208" />
<stop offset="0.8" stop-color="#d66c6c" id="stop210" />
<stop offset="0.87" stop-color="#bf4141" id="stop212" />
<stop offset="0.89" stop-color="#ba3838" id="stop214" />
<stop offset="0.91" stop-color="#be3f3f" stop-opacity="0.99" id="stop216" />
<stop offset="0.94" stop-color="#c85353" stop-opacity="0.94" id="stop218" />
<stop offset="0.96" stop-color="#da7575" stop-opacity="0.87" id="stop220" />
<stop offset="0.99" stop-color="#f3a4a4" stop-opacity="0.77" id="stop222" />
<stop offset="1" stop-color="#fbb" stop-opacity="0.72" id="stop224" />
</linearGradient>
<linearGradient id="未命名的渐变_3" x1="50" y1="58.779999" x2="200" y2="58.779999" gradientTransform="matrix(1,0,0,-1,-34,225)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#6b6b6b" id="stop227" />
<stop offset="0.11" stop-color="#767676" id="stop229" />
<stop offset="0.3" stop-color="#959595" id="stop231" />
<stop offset="0.41" stop-color="#aaa" id="stop233" />
<stop offset="0.56" stop-color="#ccc" id="stop235" />
<stop offset="0.71" stop-color="#eaeaea" id="stop237" />
<stop offset="0.8" stop-color="#f6f6f6" id="stop239" />
<stop offset="0.83" stop-color="#ededed" id="stop241" />
<stop offset="0.87" stop-color="#d4d4d4" id="stop243" />
<stop offset="0.92" stop-color="#ababab" id="stop245" />
<stop offset="0.98" stop-color="#737373" id="stop247" />
<stop offset="0.99" stop-color="#666" id="stop249" />
</linearGradient>
<linearGradient id="未命名的渐变_3-2" x1="78.360001" y1="71.639999" x2="171.64" y2="71.639999" xlink:href="#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_3" />
<linearGradient inkscape:collect="always" xlink:href="#未命名的渐变_3" id="linearGradient383" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,-1,-34,225)" x1="50" y1="58.779999" x2="200" y2="58.779999" />
</defs>
<g inkscape:label="图层 1" inkscape:groupmode="layer" id="layer1" transform="translate(-43.697111,-54.690927)">
<g id="g327" transform="matrix(0.26458333,0,0,0.26458333,43.697111,54.690927)">
<g id="图层_2" data-name="图层 2">
<g id="图层_20" data-name="图层 20">
<g id="Light-_red_红灯_" data-name="Light- red 红灯 ">
<path class="tri-red-cls-1" d="M 166.55,175.26 H 83.45 V 114.55 A 41.55,41.55 0 0 1 125,73 v 0 a 41.55,41.55 0 0 1 41.55,41.55 v 0 z" transform="translate(-34,-27)" id="path257" style="fill:url(#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_4)" />
<rect class="tri-red-cls-2" x="16" y="158.44" width="150" height="15.56" rx="3.49" ry="3.49" id="rect259" style="fill:url(#linearGradient383)" />
<rect class="tri-red-cls-3" x="44.360001" y="148.25999" width="93.279999" height="10.19" id="rect261" style="fill:url(#%E6%9C%AA%E5%91%BD%E5%90%8D%E7%9A%84%E6%B8%90%E5%8F%98_3-2)" />
</g>
</g>
</g>
<rect class="tri-red-cls-4" x="88" width="6" height="30" rx="3" ry="3" id="rect266" y="0">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tri-red-cls-4" x="198" y="103" width="6" height="30" rx="3" ry="3" transform="rotate(90,197.5,87.5)" id="rect268">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tri-red-cls-4" x="68.260002" y="49.259998" width="6" height="30" rx="3" ry="3" transform="rotate(-45,21.666977,91.805244)" id="rect270">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tri-red-cls-4" x="46" y="103" width="6" height="30" rx="3" ry="3" transform="rotate(-90,18.5,121.5)" id="rect272">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
<rect class="tri-red-cls-4" x="176.95" y="49.759998" width="6" height="30" rx="3" ry="3" transform="rotate(45,195.53533,10.223387)" id="rect274">
<animate id='ani1' attributeName='fill-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0.1' fill='freeze'/>
<animate id='ani2' attributeName='fill-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0.1' to='1' fill='freeze'/>
</rect>
</g>
</g>
</svg>
</div>\`,
props: {
defaultValue: {
type: Number,
default: 1
},
labelName: {
type: String,
default: ''
},
},
}
class CustomTriColorLightNode extends HtmlResize.view {
setHtml(rootEl) {
const { properties, width, height, } = this.props.model;
const el = document.createElement('div');
rootEl.innerHTML = '';
let labelName = '正常';
let defaultValue = 1
const { uiData } = properties.dynamic || {};
if (uiData) {
const realValue = window.resolveScadaNewValue(uiData.defaultValue)
if (realValue !== '') {
uiData.conditionVariables.forEach((item) => {
if (item.type === 'green') {
if(Number(realValue) === Number(item.value)) {
labelName = item.valueLabel;
defaultValue = 1;
}
} else if (item.type === 'yellow') {
if (Number(realValue) === Number(item.value)) {
labelName = item.valueLabel;
defaultValue = 2;
}
} else if (item.type === 'red') {
if (Number(realValue) === Number(item.value)) {
labelName = item.valueLabel;
defaultValue = 3;
}
}
})
}
const instance = createVNode(TriColor, {
labelName,
width,
height,
defaultValue
})
instance.appContext = app._context
render(instance, el)
rootEl.appendChild(el);
}
}
}
class CustomTriColorLightModel extends HtmlResize.model {
initNodeData(data) {
// 自定义组件,需最开始重置一下text 。
data.text = {
value: "",
x: data.x,
y: data.y,
};
super.initNodeData(data);
const { properties } = this;
this.width = properties.width || 80;
this.height = properties.height || 35;
this.text.editable = false; // 不允许文本被编辑
}
setAttributes() {
// 自定义组件需重置 text
const { x, y, properties } = this;
const { textHorizontalMove = 0, textVerticalMove = 0 } = properties;
this.text = {
...this.text,
x: x + textHorizontalMove,
y: y + textVerticalMove,
value: "",
}
}
}
lf.register({
type: 'custom-tricolor-light',
view: CustomTriColorLightNode,
model: CustomTriColorLightModel,
})`,css:`.tricolor-svg-root {\r
stroke: none;\r
}\r
.tricolor-cls-1{\r
fill:#09ba1a;\r
}\r
.tricolor-cls-2{\r
fill:url(#未命名的渐变_9);\r
}\r
.tricolor-cls-3{\r
fill:url(#未命名的渐变_3);\r
}\r
.tricolor-cls-4{\r
fill:url(#未命名的渐变_3-2);\r
}\r
\r
.tri-yellow-cls-1{\r
fill:#ead934;\r
}\r
.tri-yellow-cls-2{\r
fill:url(#未命名的渐变_6);\r
}\r
.tri-yellow-cls-3{\r
fill:url(#未命名的渐变_3);\r
}\r
.tri-yellow-cls-4{\r
fill:url(#未命名的渐变_3-2);\r
}\r
\r
.tri-red-cls-1{\r
fill: url(#未命名的渐变_4);\r
}\r
.tri-red-cls-2{\r
fill:url(#未命名的渐变_3);\r
}\r
.tri-red-cls-3{\r
fill:url(#未命名的渐变_3-2);\r
}\r
.tri-red-cls-4{\r
fill: #ba3838;\r
}\r
\r
`,fakeData:""},f={id:e,name:t,aliasName:a,image:o,imageType:n,groupName:i,groupType:s,isRemote:!1,isDefault:!0,sectionType:l,config:r,files:d};export{a as aliasName,r as config,f as default,d as files,i as groupName,s as groupType,e as id,o as image,n as imageType,c as isDefault,p as isRemote,t as name,l as sectionType};