|
|
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 ","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":"","ti "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};
|