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.
386 lines
48 KiB
386 lines
48 KiB
const e="860e1ac2-4f2d-4cc0-b2a7-f4779e0c221b",t="vertical-cylinder-tank",a="垂直圆柱水箱",n=`<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 233 201" fill="none"
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
<mask id="mask0_3572_1305" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="39" y="57" width="155" height="121">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M39.5 57.6724V161.738C39.5 170 73.5 177.5 116.5 177.5C173.5 177.5 193.5 167 193.5 161.738V57.6724C184.016 65.6521 153.134 71.5001 116.5 71.5001C79.8664 71.5001 48.9838 65.6521 39.5 57.6724Z" fill="#7A8BFF"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M39.5 57.6724V161.738C39.5 170 73.5 177.5 116.5 177.5C173.5 177.5 193.5 167 193.5 161.738V57.6724C184.016 65.6521 153.134 71.5001 116.5 71.5001C79.8664 71.5001 48.9838 65.6521 39.5 57.6724Z" fill="white" fill-opacity="0.1"/>
|
|
</mask>
|
|
<g mask="url(#mask0_3572_1305)">
|
|
<g clip-path="url(#clip0_3572_1305)">
|
|
<rect class="tb-liquid-fill tb-liquid" x="39.5" y="109.5" width="154" height="122" fill="#7A8BFF"/>
|
|
<ellipse class="tb-liquid-surface tb-liquid" cx="116.5" cy="109.5" rx="77" ry="16" fill="#7A8BFF"/>
|
|
<ellipse class="tb-liquid-surface" cx="116.5" cy="109.5" rx="77" ry="16" fill="white" fill-opacity="0.1"/>
|
|
</g>
|
|
</g>
|
|
<mask id="path-4-inside-1_3572_1305" fill="white">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M195.5 162.5V51.5H197.5V162.5C197.5 164.064 196.791 165.507 195.614 166.8C194.443 168.088 192.763 169.283 190.683 170.389C186.521 172.603 180.564 174.566 173.288 176.204C158.72 179.481 138.643 181.5 116.5 181.5C94.3574 181.5 74.2803 179.481 59.7119 176.204C52.4358 174.566 46.4792 172.603 42.3172 170.389C40.237 169.283 38.5568 168.088 37.3855 166.8C36.209 165.507 35.5 164.064 35.5 162.5V51.5H37.5V162.5C37.5 163.421 37.9103 164.405 38.8651 165.455C39.8251 166.51 41.2884 167.577 43.2564 168.624C47.1909 170.717 52.9499 172.632 60.151 174.252C74.5369 177.489 94.4598 179.5 116.5 179.5C138.54 179.5 158.463 177.489 172.849 174.252C180.05 172.632 185.809 170.717 189.744 168.624C191.712 167.577 193.175 166.51 194.135 165.455C195.09 164.405 195.5 163.421 195.5 162.5Z"/>
|
|
</mask>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M195.5 162.5V51.5H197.5V162.5C197.5 164.064 196.791 165.507 195.614 166.8C194.443 168.088 192.763 169.283 190.683 170.389C186.521 172.603 180.564 174.566 173.288 176.204C158.72 179.481 138.643 181.5 116.5 181.5C94.3574 181.5 74.2803 179.481 59.7119 176.204C52.4358 174.566 46.4792 172.603 42.3172 170.389C40.237 169.283 38.5568 168.088 37.3855 166.8C36.209 165.507 35.5 164.064 35.5 162.5V51.5H37.5V162.5C37.5 163.421 37.9103 164.405 38.8651 165.455C39.8251 166.51 41.2884 167.577 43.2564 168.624C47.1909 170.717 52.9499 172.632 60.151 174.252C74.5369 177.489 94.4598 179.5 116.5 179.5C138.54 179.5 158.463 177.489 172.849 174.252C180.05 172.632 185.809 170.717 189.744 168.624C191.712 167.577 193.175 166.51 194.135 165.455C195.09 164.405 195.5 163.421 195.5 162.5Z" fill="#6216FF" fill-opacity="0.02"/>
|
|
<path class="tb-shape-fill" d="M195.5 51.5V49.5H193.5V51.5H195.5ZM197.5 51.5H199.5V49.5H197.5V51.5ZM195.614 166.8L197.094 168.146L195.614 166.8ZM190.683 170.389L189.744 168.624V168.624L190.683 170.389ZM173.288 176.204L172.849 174.252L173.288 176.204ZM59.7119 176.204L60.151 174.252L59.7119 176.204ZM42.3172 170.389L43.2564 168.624L43.2564 168.624L42.3172 170.389ZM37.3855 166.8L35.9059 168.146H35.9059L37.3855 166.8ZM35.5 51.5V49.5H33.5V51.5H35.5ZM37.5 51.5H39.5V49.5H37.5V51.5ZM38.8651 165.455L40.3447 164.109H40.3447L38.8651 165.455ZM43.2564 168.624L42.3172 170.389H42.3172L43.2564 168.624ZM60.151 174.252L60.59 172.301L60.151 174.252ZM172.849 174.252L172.41 172.301L172.849 174.252ZM189.744 168.624L190.683 170.389L189.744 168.624ZM194.135 165.455L195.614 166.8V166.8L194.135 165.455ZM193.5 51.5V162.5H197.5V51.5H193.5ZM197.5 49.5H195.5V53.5H197.5V49.5ZM199.5 162.5V51.5H195.5V162.5H199.5ZM197.094 168.146C198.491 166.61 199.5 164.709 199.5 162.5H195.5C195.5 163.42 195.091 164.404 194.135 165.455L197.094 168.146ZM191.622 172.155C193.814 170.989 195.711 169.666 197.094 168.146L194.135 165.455C193.175 166.51 191.712 167.577 189.744 168.624L191.622 172.155ZM173.727 178.155C181.078 176.501 187.233 174.49 191.622 172.155L189.744 168.624C185.809 170.717 180.05 172.632 172.849 174.252L173.727 178.155ZM116.5 183.5C138.745 183.5 158.976 181.474 173.727 178.155L172.849 174.252C158.463 177.489 138.54 179.5 116.5 179.5V183.5ZM59.2729 178.155C74.0238 181.474 94.2551 183.5 116.5 183.5V179.5C94.4598 179.5 74.5369 177.489 60.151 174.252L59.2729 178.155ZM41.3779 172.155C45.7674 174.49 51.9217 176.501 59.2729 178.155L60.151 174.252C52.95 172.632 47.1909 170.717 43.2564 168.624L41.3779 172.155ZM35.9059 168.146C37.2885 169.666 39.1856 170.989 41.3779 172.155L43.2564 168.624C41.2884 167.577 39.8252 166.51 38.8651 165.455L35.9059 168.146ZM33.5 162.5C33.5 164.709 34.5086 166.61 35.9059 168.146L38.8651 165.455C37.9095 164.404 37.5 163.42 37.5 162.5H33.5ZM37.5 162.5V51.5H33.5V162.5H37.5ZM35.5 53.5H37.5V49.5H35.5V53.5ZM35.5 51.5V162.5H39.5V51.5H35.5ZM40.3447 164.109C39.6126 163.304 39.5 162.779 39.5 162.5H35.5C35.5 164.063 36.2079 165.506 37.3855 166.8L40.3447 164.109ZM44.1957 166.858C42.3397 165.87 41.0934 164.932 40.3447 164.109L37.3855 166.8C38.5569 168.088 40.2371 169.283 42.3172 170.389L44.1957 166.858ZM60.59 172.301C53.464 170.698 47.9026 168.83 44.1957 166.858L42.3172 170.389C46.4792 172.603 52.4359 174.566 59.7119 176.204L60.59 172.301ZM116.5 177.5C94.5621 177.5 74.7935 175.497 60.59 172.301L59.7119 176.204C74.2803 179.481 94.3574 181.5 116.5 181.5V177.5ZM172.41 172.301C158.207 175.497 138.438 177.5 116.5 177.5V181.5C138.643 181.5 158.72 179.481 173.288 176.204L172.41 172.301ZM188.804 166.858C185.097 168.83 179.536 170.698 172.41 172.301L173.288 176.204C180.564 174.566 186.521 172.603 190.683 170.389L188.804 166.858ZM192.655 164.109C191.907 164.932 190.66 165.87 188.804 166.858L190.683 170.389C192.763 169.283 194.443 168.088 195.614 166.8L192.655 164.109ZM193.5 162.5C193.5 162.779 193.387 163.304 192.655 164.109L195.614 166.8C196.792 165.506 197.5 164.063 197.5 162.5H193.5Z" fill="#242770" mask="url(#path-4-inside-1_3572_1305)"/>
|
|
<path class="tb-shape-stroke" opacity="0.1" d="M196.5 51.5C196.5 42 159 33.5 116.5 33.5C72.3172 33.5 36.5 42.5 36.5 51.5" stroke="#242770" stroke-width="2"/>
|
|
<path class="tb-shape-stroke" d="M116.5 71.5C62.5 71.5 36.5 61.9457 36.5 51.6607C36.5 41.3757 91.0039 29.0147 97.4253 27.5" stroke="#242770" stroke-width="2"/>
|
|
<path class="tb-shape-stroke" d="M116.5 71.5C170.5 71.5 196.5 61.9457 196.5 51.6607C196.5 41.3757 141.996 29.0147 135.575 27.5" stroke="#242770" stroke-width="2"/>
|
|
<mask id="path-9-inside-2_3572_1305" fill="white">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M98.5 23.5V27.3153C98.6396 27.4221 98.906 27.5678 99.3428 27.7309C100.212 28.0553 101.527 28.3661 103.221 28.6336C106.593 29.1661 111.289 29.5 116.5 29.5C121.711 29.5 126.407 29.1661 129.779 28.6336C131.473 28.3661 132.788 28.0553 133.657 27.7309C134.094 27.5678 134.36 27.4221 134.5 27.3153V23.5H136.5V27.5C136.5 28.1673 136.073 28.6278 135.725 28.8963C135.357 29.1798 134.878 29.41 134.357 29.6046C133.303 29.998 131.835 30.3337 130.091 30.6091C126.587 31.1624 121.782 31.5 116.5 31.5C111.218 31.5 106.413 31.1624 102.909 30.6091C101.165 30.3337 99.6972 29.998 98.6434 29.6046C98.1221 29.41 97.6426 29.1798 97.2751 28.8963C96.9271 28.6278 96.5 28.1673 96.5 27.5V23.5H98.5Z"/>
|
|
</mask>
|
|
<path class="tb-shape-fill" d="M98.5 27.3153H96.5V28.3031L97.2845 28.9035L98.5 27.3153ZM98.5 23.5H100.5V21.5H98.5V23.5ZM99.3428 27.7309L98.6434 29.6046L98.6434 29.6046L99.3428 27.7309ZM103.221 28.6336L103.533 26.658V26.658L103.221 28.6336ZM129.779 28.6336L130.091 30.6091L129.779 28.6336ZM133.657 27.7309L134.357 29.6046L134.357 29.6046L133.657 27.7309ZM134.5 27.3153L135.716 28.9035L136.5 28.3031V27.3153H134.5ZM134.5 23.5V21.5H132.5V23.5H134.5ZM136.5 23.5H138.5V21.5H136.5V23.5ZM135.725 28.8963L136.947 30.4797L136.947 30.4797L135.725 28.8963ZM134.357 29.6046L135.056 31.4783V31.4783L134.357 29.6046ZM130.091 30.6091L129.779 28.6336L130.091 30.6091ZM102.909 30.6091L103.221 28.6336H103.221L102.909 30.6091ZM98.6434 29.6046L97.9439 31.4783H97.9439L98.6434 29.6046ZM97.2751 28.8963L98.4969 27.3129L97.2751 28.8963ZM96.5 23.5V21.5H94.5V23.5H96.5ZM100.5 27.3153V23.5H96.5V27.3153H100.5ZM100.042 25.8572C99.8798 25.7965 99.7737 25.7482 99.713 25.7175C99.6453 25.6832 99.6579 25.6829 99.7155 25.7271L97.2845 28.9035C97.6501 29.1833 98.1257 29.4114 98.6434 29.6046L100.042 25.8572ZM103.533 26.658C101.889 26.3984 100.727 26.1126 100.042 25.8572L98.6434 29.6046C99.6973 29.998 101.165 30.3337 102.909 30.6091L103.533 26.658ZM116.5 27.5C111.36 27.5 106.774 27.1698 103.533 26.658L102.909 30.6091C106.413 31.1624 111.218 31.5 116.5 31.5V27.5ZM129.467 26.658C126.226 27.1698 121.64 27.5 116.5 27.5V31.5C121.782 31.5 126.587 31.1624 130.091 30.6091L129.467 26.658ZM132.958 25.8572C132.273 26.1126 131.111 26.3984 129.467 26.658L130.091 30.6091C131.835 30.3337 133.303 29.998 134.357 29.6046L132.958 25.8572ZM133.284 25.727C133.342 25.6829 133.355 25.6832 133.287 25.7175C133.226 25.7482 133.12 25.7965 132.958 25.8572L134.357 29.6046C134.874 29.4114 135.35 29.1833 135.716 28.9035L133.284 25.727ZM136.5 27.3153V23.5H132.5V27.3153H136.5ZM134.5 25.5H136.5V21.5H134.5V25.5ZM134.5 23.5V27.5H138.5V23.5H134.5ZM136.947 30.4797C137.476 30.0714 138.5 29.0945 138.5 27.5H134.5C134.5 27.4496 134.509 27.3969 134.524 27.3488C134.539 27.3029 134.556 27.2733 134.564 27.2607C134.572 27.249 134.572 27.2506 134.56 27.2632C134.548 27.2758 134.529 27.2929 134.503 27.3129L136.947 30.4797ZM135.056 31.4783C135.659 31.2532 136.351 30.9395 136.947 30.4797L134.503 27.3129C134.364 27.4202 134.097 27.5668 133.657 27.7309L135.056 31.4783ZM130.403 32.5846C132.197 32.3013 133.818 31.9406 135.056 31.4783L133.657 27.7309C132.788 28.0553 131.473 28.3661 129.779 28.6336L130.403 32.5846ZM116.5 33.5C121.853 33.5 126.767 33.1587 130.403 32.5846L129.779 28.6336C126.407 29.1661 121.711 29.5 116.5 29.5V33.5ZM102.597 32.5846C106.233 33.1587 111.147 33.5 116.5 33.5V29.5C111.289 29.5 106.593 29.1661 103.221 28.6336L102.597 32.5846ZM97.9439 31.4783C99.1825 31.9406 100.803 32.3013 102.597 32.5846L103.221 28.6336C101.527 28.3661 100.212 28.0553 99.3428 27.7309L97.9439 31.4783ZM96.0533 30.4797C96.6492 30.9395 97.3408 31.2532 97.9439 31.4783L99.3428 27.7309C98.9033 27.5668 98.6359 27.4202 98.4969 27.3129L96.0533 30.4797ZM94.5 27.5C94.5 29.0945 95.5241 30.0714 96.0533 30.4797L98.4969 27.3129C98.471 27.2929 98.4521 27.2758 98.4399 27.2632C98.4276 27.2506 98.4283 27.249 98.4359 27.2607C98.4441 27.2733 98.4611 27.3029 98.4759 27.3488C98.4914 27.3969 98.5 27.4496 98.5 27.5H94.5ZM94.5 23.5V27.5H98.5V23.5H94.5ZM98.5 21.5H96.5V25.5H98.5V21.5Z" fill="#242770" mask="url(#path-9-inside-2_3572_1305)"/>
|
|
<path class="tb-shape-stroke" d="M135.395 23.409C135.434 23.4472 135.46 23.4775 135.477 23.5C135.46 23.5225 135.434 23.5528 135.395 23.591C135.239 23.7432 134.956 23.9378 134.501 24.153C133.596 24.5808 132.223 24.9925 130.446 25.3478C126.909 26.0553 121.978 26.5 116.5 26.5C111.022 26.5 106.091 26.0553 102.554 25.3478C100.777 24.9925 99.404 24.5808 98.4992 24.153C98.0442 23.9378 97.761 23.7432 97.6053 23.591C97.5662 23.5528 97.5402 23.5225 97.5231 23.5C97.5402 23.4775 97.5662 23.4472 97.6053 23.409C97.761 23.2568 98.0442 23.0622 98.4992 22.847C99.404 22.4192 100.777 22.0075 102.554 21.6522C106.091 20.9447 111.022 20.5 116.5 20.5C121.978 20.5 126.909 20.9447 130.446 21.6522C132.223 22.0075 133.596 22.4192 134.501 22.847C134.956 23.0622 135.239 23.2568 135.395 23.409Z" stroke="#242770" stroke-width="2"/>
|
|
</svg>
|
|
`,l="svg",i="大屏",o="水位",u=!1,c=!0,s="时间",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:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","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":"高度","name":"height","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:da449a94908a","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:29852d093d9d","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:1b561d652acc","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:dc8c1daed8ed","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:9672575193ac","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-number","label":"透明","name":"opacity","id":"u:cf80f59d8d42","placeholder":"组件透明度","mode":"horizontal","size":"full","className":"m-b","keyboard":true,"step":0,"suffix":"","value":1,"inputClassName":"w-full","precision":2}],"id":"u:51ddf54ac749","md":6}],"gap":""},{"type":"grid","columns":[],"id":"u:235f153e5ad5","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"描边颜色","name":"strokeColor","id":"u:7783b65d58a9","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"液体颜色","name":"liquidColor","id":"u:76fa4643d6bd","format":"rgba","mode":"horizontal","inputClassName":"w-full"},{"type":"switch","label":"显示值","option":"","name":"showValue","falseValue":false,"trueValue":true,"id":"u:b52d7cc4b201","value":false,"mode":"horizontal","className":"m-b"}],"id":"u:83905272eb76"}],"id":"u:19e1ffafeb70","className":"m-b"},{"type":"select","label":"值类型","name":"valueType","options":[{"label":"百分比","value":"ratio"},{"label":"常规值","value":"normal"}],"id":"u:678a2c313b7f","multiple":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"值颜色","name":"valueColor","id":"u:9b5b55cac08a","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"值字体大小","name":"valueFontSize","keyboard":true,"id":"u:06950e120b0a","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"最大值","name":"maxValue","keyboard":true,"id":"u:683b1f856544","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-number","label":"告警值","name":"warnValue","keyboard":true,"id":"u:a8ad2a11c88b","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"告警颜色","name":"warnColor","id":"u:e99642a0f118","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"严重值","name":"seriousValue","keyboard":true,"id":"u:2401d1c7a03e","step":1,"mode":"horizontal","inputClassName":"w-full"},{"type":"input-color","label":"严重颜色","name":"seriousColor","id":"u:ca0bc3e7cd7b","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"}],"id":"u:ac26ae965c66"}],"id":"u:94b0e20f05da"},{"type":"switch","label":"显示单位","option":"","name":"showUnit","falseValue":false,"trueValue":true,"id":"u:92b92507de26","value":false,"mode":"horizontal","className":"m-b m-t"},{"type":"input-text","label":"单位","name":"unit","id":"u:e545f00b0967","editorState":"default","mode":"horizontal"},{"type":"input-color","label":"单位颜色","name":"unitColor","id":"u:ba117b6e3f6f","format":"rgba","mode":"horizontal","value":"rgba(245, 166, 35, 1)","className":"m-b","inputClassName":"w-full"},{"type":"input-number","label":"单位字体大小","name":"unitFontSize","keyboard":true,"id":"u:73f9e15b38a9","step":1,"mode":"horizontal","inputClassName":"w-full"}],"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":"1","active":true,"header":"常规","body":[{"type":"service","id":"u:6cb6d200ede2","data":{"dataPoint":"","compareType":"","conditionVariables":[],"defaultValue":"","unit":""},"body":[{"type":"input-text","label":"数据点","name":"dataPoint","id":"normalDataPoint","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","mode":"horizontal","multiple":false,"size":"md","horizontal":{"leftFixed":"sm"},"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,"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': 'normalDataPoint', 'actionType': 'setValue', 'args': { value: JSON.stringify(newValue) } }) } else {doAction({ 'componentId': 'normalDataPoint', 'actionType': 'setValue', 'args': { value: JSON.stringify(event.data) } }) };"}]}},"closeOnEsc":false,"size":"lg"}}]}},"className":"w-full m-b-sm","inputClassName":"w-full","clearable":true},{"type":"input-text","label":"默认值","placeholder":"[{ \\"val\\": 0.00 }]","clearable":true,"name":"defaultValue","id":"u:13ccbc565f5e","mode":"horizontal","size":"full","inputControlClassName":"mb-sm","labelClassName":"mb-sm","className":"m-b-sm"},{"type":"input-text","label":"单位   ","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"}],"id":"u:7b021709614e","headingClassName":"p-sm bg-white b-b b-light","className":"m-b r-3x","bodyClassName":"p-none"}],"id":"u:3eb6b9a42dcb","name":"dynamicService"}],"id":"u:043251c106af","className":"p"},{"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": "438f6162-0d90-44bc-8504-a3fdc34df80d",
|
|
"type": "vertical-cylinder-tank",
|
|
"x": 200,
|
|
"y": 200,
|
|
"text": {
|
|
"value": "",
|
|
"x": 200,
|
|
"y": 200
|
|
},
|
|
"properties": {
|
|
"id": "438f6162-0d90-44bc-8504-a3fdc34df80d",
|
|
"width": 200,
|
|
"height": 200,
|
|
"x": 200,
|
|
"y": 200,
|
|
"rotation": 0,
|
|
"opacity": 1,
|
|
"showValue": true,
|
|
"valueColor": "rgba(74, 144, 226, 1)",
|
|
"warnColor": "rgba(245, 166, 35, 1)",
|
|
"seriousColor": "rgba(208, 2, 27, 1)",
|
|
"showUnit": true,
|
|
"unitColor": "rgba(74, 144, 226, 1)",
|
|
"showDefaultValue": false,
|
|
"nodeAlias": "垂直圆柱水箱",
|
|
"fontSize": 12,
|
|
"valueType": "ratio",
|
|
"valueFontSize": 16,
|
|
"maxValue": 100,
|
|
"warnValue": 75,
|
|
"seriousValue": 90,
|
|
"unitFontSize": 12,
|
|
"unit": "",
|
|
"strokeColor": "#242770",
|
|
"liquidColor": "#7A8BFF",
|
|
"dynamic": {
|
|
"normalData": {
|
|
"dataPoint": "",
|
|
"compareType": "",
|
|
"conditionVariables": [],
|
|
"defaultValue": "",
|
|
"unit": ""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}`,javascript:`const { createApp, createVNode, render } = Vue;
|
|
const app = createApp({})
|
|
|
|
const defaultVal = 62;
|
|
|
|
const VerticalCylinderTank = {
|
|
template: \`<div>
|
|
<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 233 201" fill="none"
|
|
xmlns="http://www.w3.org/2000/svg" style="stroke: none">
|
|
<mask id="mask0_3572_1305" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="39" y="57" width="155" height="121">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M39.5 57.6724V161.738C39.5 170 73.5 177.5 116.5 177.5C173.5 177.5 193.5 167 193.5 161.738V57.6724C184.016 65.6521 153.134 71.5001 116.5 71.5001C79.8664 71.5001 48.9838 65.6521 39.5 57.6724Z" fill="#7A8BFF"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M39.5 57.6724V161.738C39.5 170 73.5 177.5 116.5 177.5C173.5 177.5 193.5 167 193.5 161.738V57.6724C184.016 65.6521 153.134 71.5001 116.5 71.5001C79.8664 71.5001 48.9838 65.6521 39.5 57.6724Z" fill="white" fill-opacity="0.1"/>
|
|
</mask>
|
|
<g mask="url(#mask0_3572_1305)">
|
|
<g clip-path="url(#clip0_3572_1305)" :id="chartId" style="transform: translateY(42%); transition: all 0.35s ease-in-out;" >
|
|
<rect class="tb-liquid-fill tb-liquid" x="39.5" y="109.5" width="154" height="122" :fill="finalLiquidColor"/>
|
|
<ellipse class="tb-liquid-surface tb-liquid" cx="116.5" cy="109.5" rx="77" ry="16" :fill="finalLiquidColor"/>
|
|
<ellipse class="tb-liquid-surface" cx="116.5" cy="109.5" rx="77" ry="16" fill="white" fill-opacity="0.1"/>
|
|
</g>
|
|
</g>
|
|
<mask id="path-4-inside-1_3572_1305" fill="white">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M195.5 162.5V51.5H197.5V162.5C197.5 164.064 196.791 165.507 195.614 166.8C194.443 168.088 192.763 169.283 190.683 170.389C186.521 172.603 180.564 174.566 173.288 176.204C158.72 179.481 138.643 181.5 116.5 181.5C94.3574 181.5 74.2803 179.481 59.7119 176.204C52.4358 174.566 46.4792 172.603 42.3172 170.389C40.237 169.283 38.5568 168.088 37.3855 166.8C36.209 165.507 35.5 164.064 35.5 162.5V51.5H37.5V162.5C37.5 163.421 37.9103 164.405 38.8651 165.455C39.8251 166.51 41.2884 167.577 43.2564 168.624C47.1909 170.717 52.9499 172.632 60.151 174.252C74.5369 177.489 94.4598 179.5 116.5 179.5C138.54 179.5 158.463 177.489 172.849 174.252C180.05 172.632 185.809 170.717 189.744 168.624C191.712 167.577 193.175 166.51 194.135 165.455C195.09 164.405 195.5 163.421 195.5 162.5Z"/>
|
|
</mask>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M195.5 162.5V51.5H197.5V162.5C197.5 164.064 196.791 165.507 195.614 166.8C194.443 168.088 192.763 169.283 190.683 170.389C186.521 172.603 180.564 174.566 173.288 176.204C158.72 179.481 138.643 181.5 116.5 181.5C94.3574 181.5 74.2803 179.481 59.7119 176.204C52.4358 174.566 46.4792 172.603 42.3172 170.389C40.237 169.283 38.5568 168.088 37.3855 166.8C36.209 165.507 35.5 164.064 35.5 162.5V51.5H37.5V162.5C37.5 163.421 37.9103 164.405 38.8651 165.455C39.8251 166.51 41.2884 167.577 43.2564 168.624C47.1909 170.717 52.9499 172.632 60.151 174.252C74.5369 177.489 94.4598 179.5 116.5 179.5C138.54 179.5 158.463 177.489 172.849 174.252C180.05 172.632 185.809 170.717 189.744 168.624C191.712 167.577 193.175 166.51 194.135 165.455C195.09 164.405 195.5 163.421 195.5 162.5Z" fill="#6216FF" fill-opacity="0.02"/>
|
|
<path class="tb-shape-fill" d="M195.5 51.5V49.5H193.5V51.5H195.5ZM197.5 51.5H199.5V49.5H197.5V51.5ZM195.614 166.8L197.094 168.146L195.614 166.8ZM190.683 170.389L189.744 168.624V168.624L190.683 170.389ZM173.288 176.204L172.849 174.252L173.288 176.204ZM59.7119 176.204L60.151 174.252L59.7119 176.204ZM42.3172 170.389L43.2564 168.624L43.2564 168.624L42.3172 170.389ZM37.3855 166.8L35.9059 168.146H35.9059L37.3855 166.8ZM35.5 51.5V49.5H33.5V51.5H35.5ZM37.5 51.5H39.5V49.5H37.5V51.5ZM38.8651 165.455L40.3447 164.109H40.3447L38.8651 165.455ZM43.2564 168.624L42.3172 170.389H42.3172L43.2564 168.624ZM60.151 174.252L60.59 172.301L60.151 174.252ZM172.849 174.252L172.41 172.301L172.849 174.252ZM189.744 168.624L190.683 170.389L189.744 168.624ZM194.135 165.455L195.614 166.8V166.8L194.135 165.455ZM193.5 51.5V162.5H197.5V51.5H193.5ZM197.5 49.5H195.5V53.5H197.5V49.5ZM199.5 162.5V51.5H195.5V162.5H199.5ZM197.094 168.146C198.491 166.61 199.5 164.709 199.5 162.5H195.5C195.5 163.42 195.091 164.404 194.135 165.455L197.094 168.146ZM191.622 172.155C193.814 170.989 195.711 169.666 197.094 168.146L194.135 165.455C193.175 166.51 191.712 167.577 189.744 168.624L191.622 172.155ZM173.727 178.155C181.078 176.501 187.233 174.49 191.622 172.155L189.744 168.624C185.809 170.717 180.05 172.632 172.849 174.252L173.727 178.155ZM116.5 183.5C138.745 183.5 158.976 181.474 173.727 178.155L172.849 174.252C158.463 177.489 138.54 179.5 116.5 179.5V183.5ZM59.2729 178.155C74.0238 181.474 94.2551 183.5 116.5 183.5V179.5C94.4598 179.5 74.5369 177.489 60.151 174.252L59.2729 178.155ZM41.3779 172.155C45.7674 174.49 51.9217 176.501 59.2729 178.155L60.151 174.252C52.95 172.632 47.1909 170.717 43.2564 168.624L41.3779 172.155ZM35.9059 168.146C37.2885 169.666 39.1856 170.989 41.3779 172.155L43.2564 168.624C41.2884 167.577 39.8252 166.51 38.8651 165.455L35.9059 168.146ZM33.5 162.5C33.5 164.709 34.5086 166.61 35.9059 168.146L38.8651 165.455C37.9095 164.404 37.5 163.42 37.5 162.5H33.5ZM37.5 162.5V51.5H33.5V162.5H37.5ZM35.5 53.5H37.5V49.5H35.5V53.5ZM35.5 51.5V162.5H39.5V51.5H35.5ZM40.3447 164.109C39.6126 163.304 39.5 162.779 39.5 162.5H35.5C35.5 164.063 36.2079 165.506 37.3855 166.8L40.3447 164.109ZM44.1957 166.858C42.3397 165.87 41.0934 164.932 40.3447 164.109L37.3855 166.8C38.5569 168.088 40.2371 169.283 42.3172 170.389L44.1957 166.858ZM60.59 172.301C53.464 170.698 47.9026 168.83 44.1957 166.858L42.3172 170.389C46.4792 172.603 52.4359 174.566 59.7119 176.204L60.59 172.301ZM116.5 177.5C94.5621 177.5 74.7935 175.497 60.59 172.301L59.7119 176.204C74.2803 179.481 94.3574 181.5 116.5 181.5V177.5ZM172.41 172.301C158.207 175.497 138.438 177.5 116.5 177.5V181.5C138.643 181.5 158.72 179.481 173.288 176.204L172.41 172.301ZM188.804 166.858C185.097 168.83 179.536 170.698 172.41 172.301L173.288 176.204C180.564 174.566 186.521 172.603 190.683 170.389L188.804 166.858ZM192.655 164.109C191.907 164.932 190.66 165.87 188.804 166.858L190.683 170.389C192.763 169.283 194.443 168.088 195.614 166.8L192.655 164.109ZM193.5 162.5C193.5 162.779 193.387 163.304 192.655 164.109L195.614 166.8C196.792 165.506 197.5 164.063 197.5 162.5H193.5Z" :fill="finalStrokeColor" mask="url(#path-4-inside-1_3572_1305)"/>
|
|
<path class="tb-shape-stroke" opacity="0.1" d="M196.5 51.5C196.5 42 159 33.5 116.5 33.5C72.3172 33.5 36.5 42.5 36.5 51.5" :stroke="finalStrokeColor" stroke-width="2"/>
|
|
<path class="tb-shape-stroke" d="M116.5 71.5C62.5 71.5 36.5 61.9457 36.5 51.6607C36.5 41.3757 91.0039 29.0147 97.4253 27.5" :stroke="finalStrokeColor" stroke-width="2"/>
|
|
<path class="tb-shape-stroke" d="M116.5 71.5C170.5 71.5 196.5 61.9457 196.5 51.6607C196.5 41.3757 141.996 29.0147 135.575 27.5" :stroke="finalStrokeColor" stroke-width="2"/>
|
|
<mask id="path-9-inside-2_3572_1305" fill="white">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M98.5 23.5V27.3153C98.6396 27.4221 98.906 27.5678 99.3428 27.7309C100.212 28.0553 101.527 28.3661 103.221 28.6336C106.593 29.1661 111.289 29.5 116.5 29.5C121.711 29.5 126.407 29.1661 129.779 28.6336C131.473 28.3661 132.788 28.0553 133.657 27.7309C134.094 27.5678 134.36 27.4221 134.5 27.3153V23.5H136.5V27.5C136.5 28.1673 136.073 28.6278 135.725 28.8963C135.357 29.1798 134.878 29.41 134.357 29.6046C133.303 29.998 131.835 30.3337 130.091 30.6091C126.587 31.1624 121.782 31.5 116.5 31.5C111.218 31.5 106.413 31.1624 102.909 30.6091C101.165 30.3337 99.6972 29.998 98.6434 29.6046C98.1221 29.41 97.6426 29.1798 97.2751 28.8963C96.9271 28.6278 96.5 28.1673 96.5 27.5V23.5H98.5Z"/>
|
|
</mask>
|
|
<path class="tb-shape-fill" d="M98.5 27.3153H96.5V28.3031L97.2845 28.9035L98.5 27.3153ZM98.5 23.5H100.5V21.5H98.5V23.5ZM99.3428 27.7309L98.6434 29.6046L98.6434 29.6046L99.3428 27.7309ZM103.221 28.6336L103.533 26.658V26.658L103.221 28.6336ZM129.779 28.6336L130.091 30.6091L129.779 28.6336ZM133.657 27.7309L134.357 29.6046L134.357 29.6046L133.657 27.7309ZM134.5 27.3153L135.716 28.9035L136.5 28.3031V27.3153H134.5ZM134.5 23.5V21.5H132.5V23.5H134.5ZM136.5 23.5H138.5V21.5H136.5V23.5ZM135.725 28.8963L136.947 30.4797L136.947 30.4797L135.725 28.8963ZM134.357 29.6046L135.056 31.4783V31.4783L134.357 29.6046ZM130.091 30.6091L129.779 28.6336L130.091 30.6091ZM102.909 30.6091L103.221 28.6336H103.221L102.909 30.6091ZM98.6434 29.6046L97.9439 31.4783H97.9439L98.6434 29.6046ZM97.2751 28.8963L98.4969 27.3129L97.2751 28.8963ZM96.5 23.5V21.5H94.5V23.5H96.5ZM100.5 27.3153V23.5H96.5V27.3153H100.5ZM100.042 25.8572C99.8798 25.7965 99.7737 25.7482 99.713 25.7175C99.6453 25.6832 99.6579 25.6829 99.7155 25.7271L97.2845 28.9035C97.6501 29.1833 98.1257 29.4114 98.6434 29.6046L100.042 25.8572ZM103.533 26.658C101.889 26.3984 100.727 26.1126 100.042 25.8572L98.6434 29.6046C99.6973 29.998 101.165 30.3337 102.909 30.6091L103.533 26.658ZM116.5 27.5C111.36 27.5 106.774 27.1698 103.533 26.658L102.909 30.6091C106.413 31.1624 111.218 31.5 116.5 31.5V27.5ZM129.467 26.658C126.226 27.1698 121.64 27.5 116.5 27.5V31.5C121.782 31.5 126.587 31.1624 130.091 30.6091L129.467 26.658ZM132.958 25.8572C132.273 26.1126 131.111 26.3984 129.467 26.658L130.091 30.6091C131.835 30.3337 133.303 29.998 134.357 29.6046L132.958 25.8572ZM133.284 25.727C133.342 25.6829 133.355 25.6832 133.287 25.7175C133.226 25.7482 133.12 25.7965 132.958 25.8572L134.357 29.6046C134.874 29.4114 135.35 29.1833 135.716 28.9035L133.284 25.727ZM136.5 27.3153V23.5H132.5V27.3153H136.5ZM134.5 25.5H136.5V21.5H134.5V25.5ZM134.5 23.5V27.5H138.5V23.5H134.5ZM136.947 30.4797C137.476 30.0714 138.5 29.0945 138.5 27.5H134.5C134.5 27.4496 134.509 27.3969 134.524 27.3488C134.539 27.3029 134.556 27.2733 134.564 27.2607C134.572 27.249 134.572 27.2506 134.56 27.2632C134.548 27.2758 134.529 27.2929 134.503 27.3129L136.947 30.4797ZM135.056 31.4783C135.659 31.2532 136.351 30.9395 136.947 30.4797L134.503 27.3129C134.364 27.4202 134.097 27.5668 133.657 27.7309L135.056 31.4783ZM130.403 32.5846C132.197 32.3013 133.818 31.9406 135.056 31.4783L133.657 27.7309C132.788 28.0553 131.473 28.3661 129.779 28.6336L130.403 32.5846ZM116.5 33.5C121.853 33.5 126.767 33.1587 130.403 32.5846L129.779 28.6336C126.407 29.1661 121.711 29.5 116.5 29.5V33.5ZM102.597 32.5846C106.233 33.1587 111.147 33.5 116.5 33.5V29.5C111.289 29.5 106.593 29.1661 103.221 28.6336L102.597 32.5846ZM97.9439 31.4783C99.1825 31.9406 100.803 32.3013 102.597 32.5846L103.221 28.6336C101.527 28.3661 100.212 28.0553 99.3428 27.7309L97.9439 31.4783ZM96.0533 30.4797C96.6492 30.9395 97.3408 31.2532 97.9439 31.4783L99.3428 27.7309C98.9033 27.5668 98.6359 27.4202 98.4969 27.3129L96.0533 30.4797ZM94.5 27.5C94.5 29.0945 95.5241 30.0714 96.0533 30.4797L98.4969 27.3129C98.471 27.2929 98.4521 27.2758 98.4399 27.2632C98.4276 27.2506 98.4283 27.249 98.4359 27.2607C98.4441 27.2733 98.4611 27.3029 98.4759 27.3488C98.4914 27.3969 98.5 27.4496 98.5 27.5H94.5ZM94.5 23.5V27.5H98.5V23.5H94.5ZM98.5 21.5H96.5V25.5H98.5V21.5Z" :fill="finalStrokeColor" mask="url(#path-9-inside-2_3572_1305)"/>
|
|
<path class="tb-shape-stroke" d="M135.395 23.409C135.434 23.4472 135.46 23.4775 135.477 23.5C135.46 23.5225 135.434 23.5528 135.395 23.591C135.239 23.7432 134.956 23.9378 134.501 24.153C133.596 24.5808 132.223 24.9925 130.446 25.3478C126.909 26.0553 121.978 26.5 116.5 26.5C111.022 26.5 106.091 26.0553 102.554 25.3478C100.777 24.9925 99.404 24.5808 98.4992 24.153C98.0442 23.9378 97.761 23.7432 97.6053 23.591C97.5662 23.5528 97.5402 23.5225 97.5231 23.5C97.5402 23.4775 97.5662 23.4472 97.6053 23.409C97.761 23.2568 98.0442 23.0622 98.4992 22.847C99.404 22.4192 100.777 22.0075 102.554 21.6522C106.091 20.9447 111.022 20.5 116.5 20.5C121.978 20.5 126.909 20.9447 130.446 21.6522C132.223 22.0075 133.596 22.4192 134.501 22.847C134.956 23.0622 135.239 23.2568 135.395 23.409Z" :stroke="finalStrokeColor" stroke-width="2"/>
|
|
</svg>
|
|
<div :style="getTitleStyle">
|
|
<div>
|
|
<span :style="valueStyle">{{valueStr}}</span><span :style="unitStyle">{{unitStr}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
\`,
|
|
props: {
|
|
chartId: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
currentData: {
|
|
type: Number,
|
|
default: 100
|
|
},
|
|
width: {
|
|
type: Number,
|
|
default: 350
|
|
},
|
|
height: {
|
|
type: Number,
|
|
default: 150
|
|
},
|
|
chartProps: {
|
|
type: Object,
|
|
default: () => { }
|
|
},
|
|
thingName: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
attr: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
unit: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
},
|
|
computed: {
|
|
getTitleStyle() {
|
|
return {
|
|
position: 'absolute',
|
|
top: '0px',
|
|
bottom: \`0px\`,
|
|
width: '100%',
|
|
zIndex: 100,
|
|
display: 'flex',
|
|
justifyContent: 'center',
|
|
alignItems: 'center'
|
|
}
|
|
}
|
|
},
|
|
setup(props) {
|
|
const { computed, ref, watch, toRefs, nextTick } = Vue;
|
|
const { chartProps, currentData, thingName, attr, width, height } = toRefs(props);
|
|
|
|
let valueStr = ref('');
|
|
let unitStr = ref('');
|
|
let finalLiquidColor = ref('#7A8BFF');
|
|
let finalStrokeColor = ref("#242770");
|
|
|
|
const updateChart = (realValue, properties) => {
|
|
const { warnValue, seriousValue, maxValue, warnColor, seriousColor, showValue, valueType, showUnit, unit, liquidColor, strokeColor } = properties;
|
|
const ratio = (realValue / maxValue * 100).toFixed(2);
|
|
if (showValue) {
|
|
if (valueType === 'ratio') {
|
|
valueStr.value = ratio + ''
|
|
showUnit && (unitStr.value = '%')
|
|
} else {
|
|
valueStr.value = realValue + ''
|
|
showUnit && (unitStr.value = unit)
|
|
}
|
|
}
|
|
finalLiquidColor.value = liquidColor;
|
|
finalStrokeColor.value = strokeColor;
|
|
if (seriousValue && realValue >= seriousValue) {
|
|
finalLiquidColor.value = seriousColor
|
|
} else if (warnValue && realValue >= warnValue) {
|
|
finalLiquidColor.value = warnColor
|
|
}
|
|
setTimeout(() => {
|
|
const tankNode = document.getElementById(props.chartId);
|
|
const liquidLevel = Math.round(42 - (realValue / maxValue * 69));
|
|
tankNode.style.transform = \`translateY(\${liquidLevel}%)\`;
|
|
}, 50)
|
|
}
|
|
|
|
watch([currentData, chartProps], ([val, properties]) => {
|
|
nextTick(() => {
|
|
updateChart(val, properties)
|
|
})
|
|
}, {
|
|
immediate: true,
|
|
deep: true,
|
|
})
|
|
|
|
const valueStyle = computed(() => {
|
|
return {
|
|
color: chartProps.value.valueColor,
|
|
fontSize: chartProps.value.valueFontSize + 'px'
|
|
}
|
|
})
|
|
|
|
const unitStyle = computed(() => {
|
|
return {
|
|
color: chartProps.value.unitColor,
|
|
fontSize: chartProps.value.unitFontSize + 'px',
|
|
marginLeft: '3px'
|
|
}
|
|
})
|
|
|
|
return {
|
|
valueStyle,
|
|
unitStyle,
|
|
valueStr,
|
|
unitStr,
|
|
finalLiquidColor,
|
|
finalStrokeColor,
|
|
}
|
|
}
|
|
}
|
|
|
|
class VerticalCylinderTankNode extends HtmlResize.view {
|
|
realValue = defaultVal
|
|
oldProperties = {}
|
|
chartRendered = false
|
|
instance = null
|
|
|
|
setHtml(rootEl) {
|
|
if (!rootEl) return;
|
|
const { properties, width, height } = this.props.model;
|
|
const { normalData } = properties.dynamic || {}
|
|
let thingName = 'pressure';
|
|
let attr = 'score';
|
|
if (normalData && normalData.dataPoint) {
|
|
const dataPointStrParsed = JSON.parse(normalData.dataPoint || '{}')
|
|
const { deviceCode, dataPoint } = dataPointStrParsed;
|
|
thingName = deviceCode;
|
|
attr = dataPoint.split(',')[0];
|
|
}
|
|
if (this.instance) {
|
|
// 实时数据不能推送一次就创建一次图表,可以在原有实例基础之上更改数据。
|
|
Object.assign(this.instance.component.props, {
|
|
name: properties.nodeAlias,
|
|
chartId: \`liquidlevel-\${properties.id}\`,
|
|
currentData: this.realValue,
|
|
width,
|
|
height,
|
|
chartProps: properties,
|
|
thingName,
|
|
attr,
|
|
})
|
|
return
|
|
}
|
|
const el = document.createElement('div');
|
|
rootEl.innerHTML = '';
|
|
const instance = createVNode(VerticalCylinderTank, {
|
|
name: properties.nodeAlias,
|
|
chartId: \`liquidLevel-\${properties.id}\`,
|
|
currentData: this.realValue,
|
|
width,
|
|
height,
|
|
chartProps: properties,
|
|
thingName,
|
|
attr,
|
|
})
|
|
instance.appContext = app._context
|
|
render(instance, el)
|
|
rootEl.appendChild(el);
|
|
this.instance = instance;
|
|
}
|
|
|
|
sameProps(properties) {
|
|
const isSame = window._.isEqual(this.oldProperties, properties);
|
|
if (isSame) return true;
|
|
this.oldProperties = properties;
|
|
return false
|
|
}
|
|
|
|
// 生命周期 支持重写内容, 但格式需一致
|
|
shouldUpdate() {
|
|
const { properties } = this.props.model;
|
|
const { normalData } = properties.dynamic || {};
|
|
|
|
if (normalData && !normalData.dataPoint && !normalData.defaultValue) {
|
|
this.realValue = defaultVal;
|
|
return true
|
|
}
|
|
|
|
if (normalData) {
|
|
const { defaultValue } = normalData || {};
|
|
if (defaultValue) {
|
|
const realValue = window.resolveScadaNewValue(defaultValue)
|
|
if (this.realValue !== Number(realValue)) {
|
|
this.realValue = Number(realValue);
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
const propertiesBack = window._.cloneDeep(properties);
|
|
if (propertiesBack.dynamic.normalData) {
|
|
const isSameProps = this.sameProps(propertiesBack);
|
|
if (isSameProps && this.chartRendered) {
|
|
return false
|
|
} else {
|
|
if (!this.chartRendered) {
|
|
this.chartRendered = true
|
|
return true
|
|
}
|
|
if (!isSameProps) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
updateHtml() {
|
|
this.setHtml(this.rootEl);
|
|
}
|
|
|
|
componentDidMount() {
|
|
// 防止拖动时候频繁渲染图表
|
|
this.updateHtmlDebounced = window._.debounce(this.updateHtml.bind(this), 500);
|
|
if (this.shouldUpdate()) {
|
|
this.setHtml(this.rootEl);
|
|
}
|
|
}
|
|
|
|
componentDidUpdate() {
|
|
if (this.shouldUpdate()) {
|
|
this.updateHtmlDebounced();
|
|
}
|
|
}
|
|
}
|
|
|
|
class VerticalCylinderTankModel 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: 'vertical-cylinder-tank',
|
|
view: VerticalCylinderTankNode,
|
|
model: VerticalCylinderTankModel,
|
|
})
|
|
|
|
`,css:"",fakeData:""},p={id:e,name:t,aliasName:a,image:n,imageType:l,groupName:i,groupType:o,isRemote:!1,isDefault:!0,sectionType:s,config:r,files:d};export{a as aliasName,r as config,p as default,d as files,i as groupName,o as groupType,e as id,n as image,l as imageType,c as isDefault,u as isRemote,t as name,s as sectionType};
|