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.
388 lines
45 KiB
388 lines
45 KiB
const e="b9d619e9-45dc-4ff3-835e-aa3e88d8965b",t="vertical-oval-tank",a="垂直圆桶形水箱",n=`<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 233 201" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<rect class="tb-shape-stroke" opacity="0.1" x="139.5" y="48.5" width="80" height="125" rx="40" fill="#6216FF" fill-opacity="0.02" stroke="#242770" stroke-width="2"/>
|
|
<mask id="mask0_3572_10305" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="17" y="51" width="200" height="120">
|
|
<mask id="path-2-inside-1_3572_10305" fill="white">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.5 51.5133C33.5277 52.0432 17.5 68.3999 17.5 88.5V133.5C17.5 153.6 33.5278 169.957 53.5 170.487V170.5H54.476C54.484 170.5 54.492 170.5 54.5 170.5C54.508 170.5 54.516 170.5 54.524 170.5H179.462L179.5 170.5C199.935 170.5 216.5 153.935 216.5 133.5V88.5C216.5 68.0655 199.935 51.5 179.5 51.5L54.5239 51.5C54.5159 51.5 54.508 51.5 54.5 51.5C54.492 51.5 54.4841 51.5 54.4761 51.5L53.5 51.5V51.5133Z"/>
|
|
</mask>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.5 51.5133C33.5277 52.0432 17.5 68.3999 17.5 88.5V133.5C17.5 153.6 33.5278 169.957 53.5 170.487V170.5H54.476C54.484 170.5 54.492 170.5 54.5 170.5C54.508 170.5 54.516 170.5 54.524 170.5H179.462L179.5 170.5C199.935 170.5 216.5 153.935 216.5 133.5V88.5C216.5 68.0655 199.935 51.5 179.5 51.5L54.5239 51.5C54.5159 51.5 54.508 51.5 54.5 51.5C54.492 51.5 54.4841 51.5 54.4761 51.5L53.5 51.5V51.5133Z" fill="#7F84FB"/>
|
|
<path class="tb-shape-fill" d="M53.5 51.5133L53.553 53.5125L55.5 53.4609V51.5133H53.5ZM53.5 170.487H55.5V168.539L53.553 168.487L53.5 170.487ZM53.5 170.5H51.5V172.5H53.5V170.5ZM179.462 170.5L179.463 168.5H179.462V170.5ZM179.5 170.5L179.499 172.5H179.5V170.5ZM179.5 51.5V49.5V51.5ZM54.5239 51.5L54.5227 53.5H54.5239V51.5ZM54.4761 51.5V53.5L54.4773 53.5L54.4761 51.5ZM53.5 51.5V49.5L51.5 49.5V51.5H53.5ZM19.5 88.5C19.5 69.4867 34.6614 54.0138 53.553 53.5125L53.4469 49.514C32.3941 50.0726 15.5 67.313 15.5 88.5H19.5ZM19.5 133.5V88.5H15.5V133.5H19.5ZM53.553 168.487C34.6614 167.986 19.5 152.513 19.5 133.5H15.5C15.5 154.687 32.3941 171.927 53.447 172.486L53.553 168.487ZM51.5 170.487V170.5H55.5V170.487H51.5ZM53.5 172.5H54.476V168.5H53.5V172.5ZM54.5 168.5C54.4966 168.5 54.493 168.5 54.4889 168.5C54.485 168.5 54.4805 168.5 54.476 168.5V172.5C54.4794 172.5 54.483 172.5 54.487 172.5C54.491 172.5 54.4954 172.5 54.5 172.5V168.5ZM54.524 168.5C54.5195 168.5 54.515 168.5 54.5111 168.5C54.507 168.5 54.5034 168.5 54.5 168.5V172.5C54.5046 172.5 54.509 172.5 54.513 172.5C54.517 172.5 54.5206 172.5 54.524 172.5V168.5ZM54.524 172.5H179.462V168.5H54.524V172.5ZM179.461 172.5L179.499 172.5L179.501 168.5L179.463 168.5L179.461 172.5ZM179.5 172.5C201.039 172.5 218.5 155.039 218.5 133.5H214.5C214.5 152.83 198.83 168.5 179.5 168.5V172.5ZM218.5 133.5V88.5H214.5V133.5H218.5ZM218.5 88.5C218.5 66.9609 201.039 49.5 179.5 49.5V53.5C198.83 53.5 214.5 69.17 214.5 88.5H218.5ZM179.5 49.5L54.5239 49.5V53.5L179.5 53.5V49.5ZM54.5 53.5C54.5075 53.5 54.5151 53.5 54.5227 53.5L54.5252 49.5C54.5168 49.5 54.5084 49.5 54.5 49.5V53.5ZM54.4773 53.5C54.4849 53.5 54.4924 53.5 54.5 53.5V49.5C54.4916 49.5 54.4832 49.5 54.4748 49.5L54.4773 53.5ZM54.4761 49.5H53.5V53.5H54.4761V49.5ZM51.5 51.5V51.5133H55.5V51.5H51.5Z" fill="#242770" mask="url(#path-2-inside-1_3572_10305)"/>
|
|
</mask>
|
|
<g mask="url(#mask0_3572_10305)">
|
|
<rect class="tb-liquid-fill tb-liquid" x="17.5" y="118.5" width="199" height="120" fill="#7A8BFF"/>
|
|
<rect class="tb-liquid-surface tb-liquid" x="17.5" y="118.5" width="199" height="1" fill="#7A8BFF"/>
|
|
<rect class="tb-liquid-surface" x="17.5" y="118.5" width="199" height="1" fill="white" fill-opacity="0.1"/>
|
|
</g>
|
|
<mask id="path-6-inside-2_3572_10305" fill="white">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.5 47.512C31.3183 48.0429 13.5 66.1906 13.5 88.5L13.5 133.5C13.5 155.809 31.3183 173.957 53.5 174.488L53.5 174.5L54.4716 174.5C54.4811 174.5 54.4905 174.5 54.5 174.5C54.5094 174.5 54.5189 174.5 54.5283 174.5L179.472 174.5L179.5 174.5C202.144 174.5 220.5 156.144 220.5 133.5L220.5 88.5C220.5 65.8563 202.144 47.5 179.5 47.5L54.5 47.5L53.5 47.5L53.5 47.512Z"/>
|
|
</mask>
|
|
<path class="tb-shape-fill" d="M13.5 88.5L11.5 88.5L13.5 88.5ZM53.5 47.512L53.5479 49.5114L55.5 49.4647L55.5 47.512L53.5 47.512ZM13.5 133.5L15.5 133.5L13.5 133.5ZM53.5 174.488L55.5 174.488L55.5 172.535L53.5479 172.489L53.5 174.488ZM53.5 174.5L51.5 174.5L51.5 176.5L53.5 176.5L53.5 174.5ZM54.4716 174.5L54.473 172.5L54.4716 172.5L54.4716 174.5ZM54.5 174.5L54.5 176.5L54.5 174.5ZM54.5283 174.5L54.5283 172.5L54.527 172.5L54.5283 174.5ZM179.472 174.5L179.472 172.5L179.472 174.5ZM179.5 174.5L179.5 172.5L179.5 174.5ZM220.5 133.5L222.5 133.5L220.5 133.5ZM220.5 88.5L218.5 88.5L220.5 88.5ZM179.5 47.5L179.5 45.5L179.5 47.5ZM54.5 47.5L54.5 49.5L54.5 49.5L54.5 47.5ZM53.5 47.5L53.5 45.5L51.5 45.5L51.5 47.5L53.5 47.5ZM15.5 88.5C15.5 67.2792 32.4492 50.0164 53.5479 49.5114L53.4521 45.5125C30.1875 46.0694 11.5 65.1021 11.5 88.5L15.5 88.5ZM15.5 133.5L15.5 88.5L11.5 88.5L11.5 133.5L15.5 133.5ZM53.5479 172.489C32.4492 171.984 15.5 154.721 15.5 133.5L11.5 133.5C11.5 156.898 30.1875 175.931 53.4521 176.487L53.5479 172.489ZM51.5 174.488L51.5 174.5L55.5 174.5L55.5 174.488L51.5 174.488ZM53.5 176.5L54.4716 176.5L54.4716 172.5L53.5 172.5L53.5 176.5ZM54.5 172.5C54.491 172.5 54.482 172.5 54.473 172.5L54.4703 176.5C54.4802 176.5 54.4901 176.5 54.5 176.5L54.5 172.5ZM54.527 172.5C54.518 172.5 54.509 172.5 54.5 172.5L54.5 176.5C54.5099 176.5 54.5198 176.5 54.5297 176.5L54.527 172.5ZM54.5283 176.5L179.472 176.5L179.472 172.5L54.5283 172.5L54.5283 176.5ZM179.472 176.5L179.5 176.5L179.5 172.5L179.472 172.5L179.472 176.5ZM179.5 176.5C203.248 176.5 222.5 157.248 222.5 133.5L218.5 133.5C218.5 155.039 201.039 172.5 179.5 172.5L179.5 176.5ZM222.5 133.5L222.5 88.5L218.5 88.5L218.5 133.5L222.5 133.5ZM222.5 88.5C222.5 64.7518 203.248 45.5 179.5 45.5L179.5 49.5C201.039 49.5 218.5 66.9609 218.5 88.5L222.5 88.5ZM179.5 45.5L54.5 45.5L54.5 49.5L179.5 49.5L179.5 45.5ZM54.5 45.5L53.5 45.5L53.5 49.5L54.5 49.5L54.5 45.5ZM51.5 47.5L51.5 47.512L55.5 47.512L55.5 47.5L51.5 47.5Z" fill="#242770" mask="url(#path-6-inside-2_3572_10305)"/>
|
|
<rect class="tb-shape-stroke" x="14.5" y="48.5" width="80" height="125" rx="40" stroke="#242770" stroke-width="2"/>
|
|
<mask id="path-9-inside-3_3572_10305" fill="white">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M141.5 30.5H112.5V48.5C112.5 50.1569 118.992 51.5 127 51.5C135.008 51.5 141.5 50.1569 141.5 48.5V30.5Z"/>
|
|
</mask>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M141.5 30.5H112.5V48.5C112.5 50.1569 118.992 51.5 127 51.5C135.008 51.5 141.5 50.1569 141.5 48.5V30.5Z"/>
|
|
<path class="tb-shape-fill" d="M112.5 30.5V28.5H110.5V30.5H112.5ZM141.5 30.5H143.5V28.5H141.5V30.5ZM112.5 32.5H141.5V28.5H112.5V32.5ZM114.5 48.5V30.5H110.5V48.5H114.5ZM127 49.5C123.09 49.5 119.607 49.1707 117.152 48.6628C115.908 48.4055 115.034 48.1232 114.518 47.8712C114.257 47.7431 114.191 47.6721 114.217 47.6982C114.248 47.7304 114.5 48.0048 114.5 48.5H110.5C110.5 49.4095 110.954 50.0882 111.373 50.511C111.785 50.9277 112.289 51.2334 112.761 51.4643C113.713 51.9301 114.962 52.2943 116.342 52.5798C119.135 53.1577 122.902 53.5 127 53.5V49.5ZM139.5 48.5C139.5 48.0048 139.752 47.7304 139.783 47.6982C139.809 47.6721 139.743 47.7431 139.482 47.8712C138.966 48.1232 138.092 48.4055 136.848 48.6628C134.393 49.1707 130.91 49.5 127 49.5V53.5C131.098 53.5 134.865 53.1577 137.658 52.5798C139.038 52.2943 140.287 51.9301 141.239 51.4643C141.711 51.2334 142.215 50.9277 142.627 50.511C143.046 50.0882 143.5 49.4095 143.5 48.5H139.5ZM139.5 30.5V48.5H143.5V30.5H139.5Z" fill="#242770" mask="url(#path-9-inside-3_3572_10305)"/>
|
|
<path class="tb-shape-stroke" d="M141.541 31.3323C141.541 31.3323 141.54 31.3332 141.539 31.3349C141.54 31.3332 141.541 31.3323 141.541 31.3323ZM140.866 31.2416C141.077 31.338 141.231 31.4258 141.341 31.5C141.231 31.5742 141.077 31.662 140.866 31.7584C140.187 32.0692 139.141 32.3742 137.77 32.6395C135.045 33.167 131.236 33.5 127 33.5C122.764 33.5 118.955 33.167 116.23 32.6395C114.859 32.3742 113.813 32.0692 113.134 31.7584C112.923 31.662 112.769 31.5742 112.659 31.5C112.769 31.4258 112.923 31.338 113.134 31.2416C113.813 30.9308 114.859 30.6258 116.23 30.3605C118.955 29.833 122.764 29.5 127 29.5C131.236 29.5 135.045 29.833 137.77 30.3605C139.141 30.6258 140.187 30.9308 140.866 31.2416ZM112.461 31.3323C112.461 31.3323 112.461 31.3332 112.461 31.3349C112.461 31.3332 112.461 31.3323 112.461 31.3323ZM112.461 31.6677C112.461 31.6677 112.461 31.6668 112.461 31.6651C112.461 31.6668 112.461 31.6677 112.461 31.6677ZM141.539 31.6651C141.54 31.6668 141.541 31.6677 141.541 31.6677C141.541 31.6677 141.54 31.6668 141.539 31.6651Z" stroke="#242770" stroke-width="2"/>
|
|
<path class="tb-shape-stroke" d="M141.541 28.3323C141.541 28.3323 141.54 28.3332 141.539 28.3349C141.54 28.3332 141.541 28.3323 141.541 28.3323ZM140.866 28.2416C141.077 28.338 141.231 28.4258 141.341 28.5C141.231 28.5742 141.077 28.662 140.866 28.7584C140.187 29.0692 139.141 29.3742 137.77 29.6395C135.045 30.167 131.236 30.5 127 30.5C122.764 30.5 118.955 30.167 116.23 29.6395C114.859 29.3742 113.813 29.0692 113.134 28.7584C112.923 28.662 112.769 28.5742 112.659 28.5C112.769 28.4258 112.923 28.338 113.134 28.2416C113.813 27.9308 114.859 27.6258 116.23 27.3605C118.955 26.833 122.764 26.5 127 26.5C131.236 26.5 135.045 26.833 137.77 27.3605C139.141 27.6258 140.187 27.9308 140.866 28.2416ZM112.461 28.3323C112.461 28.3323 112.461 28.3332 112.461 28.3349C112.461 28.3332 112.461 28.3323 112.461 28.3323ZM112.461 28.6677C112.461 28.6677 112.461 28.6668 112.461 28.6651C112.461 28.6668 112.461 28.6677 112.461 28.6677ZM141.539 28.6651C141.54 28.6668 141.541 28.6677 141.541 28.6677C141.541 28.6677 141.54 28.6668 141.539 28.6651Z" stroke="#242770" stroke-width="2"/>
|
|
</svg>
|
|
`,l="svg",i="大屏",o="水位",u=!1,c=!0,s="时间",r=`{"type":"page","id":"u:270584784ce1","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","mode":"horizontal","format":"rgba","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","id":"u:678a2c313b7f","label":"值类型","name":"valueType","options":[{"label":"百分比","value":"ratio"},{"label":"常规值","value":"normal"}],"multiple":false,"mode":"horizontal","inputClassName":"w-full"},{"type":"grid","id":"u:94b0e20f05da","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"}]},{"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","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": "764cf33f-51f9-49d4-8a98-137e9fa878d9",
|
|
"type": "vertical-oval-tank",
|
|
"x": 200,
|
|
"y": 200,
|
|
"text": {
|
|
"value": "",
|
|
"x": 200,
|
|
"y": 200
|
|
},
|
|
"properties": {
|
|
"id": "764cf33f-51f9-49d4-8a98-137e9fa878d9",
|
|
"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)",
|
|
"nodeAlias": "垂直圆桶形水箱",
|
|
"showDefaultValue": false,
|
|
"fontSize": 12,
|
|
"strokeColor": "#242770",
|
|
"liquidColor": "#7A8BFF",
|
|
"valueType": "ratio",
|
|
"valueFontSize": 16,
|
|
"maxValue": 100,
|
|
"warnValue": 75,
|
|
"seriousValue": 90,
|
|
"unitFontSize": 12,
|
|
"dynamic": {
|
|
"normalData": {
|
|
"dataPoint": "",
|
|
"compareType": "",
|
|
"conditionVariables": [],
|
|
"defaultValue": "",
|
|
"unit": ""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}`,javascript:`const { createApp, createVNode, render } = Vue;
|
|
const app = createApp({})
|
|
|
|
const defaultVal = 62;
|
|
|
|
const VerticalOvalTank = {
|
|
template: \`<div>
|
|
<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 233 201" fill="none"
|
|
xmlns="http://www.w3.org/2000/svg" style="stroke: none">
|
|
<rect class="tb-shape-stroke" opacity="0.1" x="139.5" y="48.5" width="80" height="125" rx="40" fill="#6216FF" fill-opacity="0.02" :stroke="finalStrokeColor" stroke-width="2"/>
|
|
<mask id="mask0_3572_10305" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="17" y="51" width="200" height="120">
|
|
<mask id="path-2-inside-1_3572_10305" fill="white">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.5 51.5133C33.5277 52.0432 17.5 68.3999 17.5 88.5V133.5C17.5 153.6 33.5278 169.957 53.5 170.487V170.5H54.476C54.484 170.5 54.492 170.5 54.5 170.5C54.508 170.5 54.516 170.5 54.524 170.5H179.462L179.5 170.5C199.935 170.5 216.5 153.935 216.5 133.5V88.5C216.5 68.0655 199.935 51.5 179.5 51.5L54.5239 51.5C54.5159 51.5 54.508 51.5 54.5 51.5C54.492 51.5 54.4841 51.5 54.4761 51.5L53.5 51.5V51.5133Z"/>
|
|
</mask>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.5 51.5133C33.5277 52.0432 17.5 68.3999 17.5 88.5V133.5C17.5 153.6 33.5278 169.957 53.5 170.487V170.5H54.476C54.484 170.5 54.492 170.5 54.5 170.5C54.508 170.5 54.516 170.5 54.524 170.5H179.462L179.5 170.5C199.935 170.5 216.5 153.935 216.5 133.5V88.5C216.5 68.0655 199.935 51.5 179.5 51.5L54.5239 51.5C54.5159 51.5 54.508 51.5 54.5 51.5C54.492 51.5 54.4841 51.5 54.4761 51.5L53.5 51.5V51.5133Z" fill="#7F84FB"/>
|
|
<path class="tb-shape-fill" d="M53.5 51.5133L53.553 53.5125L55.5 53.4609V51.5133H53.5ZM53.5 170.487H55.5V168.539L53.553 168.487L53.5 170.487ZM53.5 170.5H51.5V172.5H53.5V170.5ZM179.462 170.5L179.463 168.5H179.462V170.5ZM179.5 170.5L179.499 172.5H179.5V170.5ZM179.5 51.5V49.5V51.5ZM54.5239 51.5L54.5227 53.5H54.5239V51.5ZM54.4761 51.5V53.5L54.4773 53.5L54.4761 51.5ZM53.5 51.5V49.5L51.5 49.5V51.5H53.5ZM19.5 88.5C19.5 69.4867 34.6614 54.0138 53.553 53.5125L53.4469 49.514C32.3941 50.0726 15.5 67.313 15.5 88.5H19.5ZM19.5 133.5V88.5H15.5V133.5H19.5ZM53.553 168.487C34.6614 167.986 19.5 152.513 19.5 133.5H15.5C15.5 154.687 32.3941 171.927 53.447 172.486L53.553 168.487ZM51.5 170.487V170.5H55.5V170.487H51.5ZM53.5 172.5H54.476V168.5H53.5V172.5ZM54.5 168.5C54.4966 168.5 54.493 168.5 54.4889 168.5C54.485 168.5 54.4805 168.5 54.476 168.5V172.5C54.4794 172.5 54.483 172.5 54.487 172.5C54.491 172.5 54.4954 172.5 54.5 172.5V168.5ZM54.524 168.5C54.5195 168.5 54.515 168.5 54.5111 168.5C54.507 168.5 54.5034 168.5 54.5 168.5V172.5C54.5046 172.5 54.509 172.5 54.513 172.5C54.517 172.5 54.5206 172.5 54.524 172.5V168.5ZM54.524 172.5H179.462V168.5H54.524V172.5ZM179.461 172.5L179.499 172.5L179.501 168.5L179.463 168.5L179.461 172.5ZM179.5 172.5C201.039 172.5 218.5 155.039 218.5 133.5H214.5C214.5 152.83 198.83 168.5 179.5 168.5V172.5ZM218.5 133.5V88.5H214.5V133.5H218.5ZM218.5 88.5C218.5 66.9609 201.039 49.5 179.5 49.5V53.5C198.83 53.5 214.5 69.17 214.5 88.5H218.5ZM179.5 49.5L54.5239 49.5V53.5L179.5 53.5V49.5ZM54.5 53.5C54.5075 53.5 54.5151 53.5 54.5227 53.5L54.5252 49.5C54.5168 49.5 54.5084 49.5 54.5 49.5V53.5ZM54.4773 53.5C54.4849 53.5 54.4924 53.5 54.5 53.5V49.5C54.4916 49.5 54.4832 49.5 54.4748 49.5L54.4773 53.5ZM54.4761 49.5H53.5V53.5H54.4761V49.5ZM51.5 51.5V51.5133H55.5V51.5H51.5Z" :fill="finalStrokeColor" mask="url(#path-2-inside-1_3572_10305)"/>
|
|
</mask>
|
|
<g mask="url(#mask0_3572_10305)">
|
|
<g clip-path="url(#clip0_3572_10305)" :id="chartId" style="transform: translateY(42%); transition: all 0.35s ease-in-out;" >
|
|
<rect class="tb-liquid-fill tb-liquid" x="17.5" y="118.5" width="199" height="120" :fill="finalLiquidColor"/>
|
|
<rect class="tb-liquid-surface tb-liquid" x="17.5" y="118.5" width="199" height="1" :fill="finalLiquidColor"/>
|
|
<rect class="tb-liquid-surface" x="17.5" y="118.5" width="199" height="1" fill="white" fill-opacity="0.1"/>
|
|
</g>
|
|
</g>
|
|
<mask id="path-6-inside-2_3572_10305" fill="white">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M53.5 47.512C31.3183 48.0429 13.5 66.1906 13.5 88.5L13.5 133.5C13.5 155.809 31.3183 173.957 53.5 174.488L53.5 174.5L54.4716 174.5C54.4811 174.5 54.4905 174.5 54.5 174.5C54.5094 174.5 54.5189 174.5 54.5283 174.5L179.472 174.5L179.5 174.5C202.144 174.5 220.5 156.144 220.5 133.5L220.5 88.5C220.5 65.8563 202.144 47.5 179.5 47.5L54.5 47.5L53.5 47.5L53.5 47.512Z"/>
|
|
</mask>
|
|
<path class="tb-shape-fill" d="M13.5 88.5L11.5 88.5L13.5 88.5ZM53.5 47.512L53.5479 49.5114L55.5 49.4647L55.5 47.512L53.5 47.512ZM13.5 133.5L15.5 133.5L13.5 133.5ZM53.5 174.488L55.5 174.488L55.5 172.535L53.5479 172.489L53.5 174.488ZM53.5 174.5L51.5 174.5L51.5 176.5L53.5 176.5L53.5 174.5ZM54.4716 174.5L54.473 172.5L54.4716 172.5L54.4716 174.5ZM54.5 174.5L54.5 176.5L54.5 174.5ZM54.5283 174.5L54.5283 172.5L54.527 172.5L54.5283 174.5ZM179.472 174.5L179.472 172.5L179.472 174.5ZM179.5 174.5L179.5 172.5L179.5 174.5ZM220.5 133.5L222.5 133.5L220.5 133.5ZM220.5 88.5L218.5 88.5L220.5 88.5ZM179.5 47.5L179.5 45.5L179.5 47.5ZM54.5 47.5L54.5 49.5L54.5 49.5L54.5 47.5ZM53.5 47.5L53.5 45.5L51.5 45.5L51.5 47.5L53.5 47.5ZM15.5 88.5C15.5 67.2792 32.4492 50.0164 53.5479 49.5114L53.4521 45.5125C30.1875 46.0694 11.5 65.1021 11.5 88.5L15.5 88.5ZM15.5 133.5L15.5 88.5L11.5 88.5L11.5 133.5L15.5 133.5ZM53.5479 172.489C32.4492 171.984 15.5 154.721 15.5 133.5L11.5 133.5C11.5 156.898 30.1875 175.931 53.4521 176.487L53.5479 172.489ZM51.5 174.488L51.5 174.5L55.5 174.5L55.5 174.488L51.5 174.488ZM53.5 176.5L54.4716 176.5L54.4716 172.5L53.5 172.5L53.5 176.5ZM54.5 172.5C54.491 172.5 54.482 172.5 54.473 172.5L54.4703 176.5C54.4802 176.5 54.4901 176.5 54.5 176.5L54.5 172.5ZM54.527 172.5C54.518 172.5 54.509 172.5 54.5 172.5L54.5 176.5C54.5099 176.5 54.5198 176.5 54.5297 176.5L54.527 172.5ZM54.5283 176.5L179.472 176.5L179.472 172.5L54.5283 172.5L54.5283 176.5ZM179.472 176.5L179.5 176.5L179.5 172.5L179.472 172.5L179.472 176.5ZM179.5 176.5C203.248 176.5 222.5 157.248 222.5 133.5L218.5 133.5C218.5 155.039 201.039 172.5 179.5 172.5L179.5 176.5ZM222.5 133.5L222.5 88.5L218.5 88.5L218.5 133.5L222.5 133.5ZM222.5 88.5C222.5 64.7518 203.248 45.5 179.5 45.5L179.5 49.5C201.039 49.5 218.5 66.9609 218.5 88.5L222.5 88.5ZM179.5 45.5L54.5 45.5L54.5 49.5L179.5 49.5L179.5 45.5ZM54.5 45.5L53.5 45.5L53.5 49.5L54.5 49.5L54.5 45.5ZM51.5 47.5L51.5 47.512L55.5 47.512L55.5 47.5L51.5 47.5Z" :fill="finalStrokeColor" mask="url(#path-6-inside-2_3572_10305)"/>
|
|
<rect class="tb-shape-stroke" x="14.5" y="48.5" width="80" height="125" rx="40" :stroke="finalStrokeColor" stroke-width="2"/>
|
|
<mask id="path-9-inside-3_3572_10305" fill="white">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M141.5 30.5H112.5V48.5C112.5 50.1569 118.992 51.5 127 51.5C135.008 51.5 141.5 50.1569 141.5 48.5V30.5Z"/>
|
|
</mask>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M141.5 30.5H112.5V48.5C112.5 50.1569 118.992 51.5 127 51.5C135.008 51.5 141.5 50.1569 141.5 48.5V30.5Z"/>
|
|
<path class="tb-shape-fill" d="M112.5 30.5V28.5H110.5V30.5H112.5ZM141.5 30.5H143.5V28.5H141.5V30.5ZM112.5 32.5H141.5V28.5H112.5V32.5ZM114.5 48.5V30.5H110.5V48.5H114.5ZM127 49.5C123.09 49.5 119.607 49.1707 117.152 48.6628C115.908 48.4055 115.034 48.1232 114.518 47.8712C114.257 47.7431 114.191 47.6721 114.217 47.6982C114.248 47.7304 114.5 48.0048 114.5 48.5H110.5C110.5 49.4095 110.954 50.0882 111.373 50.511C111.785 50.9277 112.289 51.2334 112.761 51.4643C113.713 51.9301 114.962 52.2943 116.342 52.5798C119.135 53.1577 122.902 53.5 127 53.5V49.5ZM139.5 48.5C139.5 48.0048 139.752 47.7304 139.783 47.6982C139.809 47.6721 139.743 47.7431 139.482 47.8712C138.966 48.1232 138.092 48.4055 136.848 48.6628C134.393 49.1707 130.91 49.5 127 49.5V53.5C131.098 53.5 134.865 53.1577 137.658 52.5798C139.038 52.2943 140.287 51.9301 141.239 51.4643C141.711 51.2334 142.215 50.9277 142.627 50.511C143.046 50.0882 143.5 49.4095 143.5 48.5H139.5ZM139.5 30.5V48.5H143.5V30.5H139.5Z" :fill="finalStrokeColor" mask="url(#path-9-inside-3_3572_10305)"/>
|
|
<path class="tb-shape-stroke" d="M141.541 31.3323C141.541 31.3323 141.54 31.3332 141.539 31.3349C141.54 31.3332 141.541 31.3323 141.541 31.3323ZM140.866 31.2416C141.077 31.338 141.231 31.4258 141.341 31.5C141.231 31.5742 141.077 31.662 140.866 31.7584C140.187 32.0692 139.141 32.3742 137.77 32.6395C135.045 33.167 131.236 33.5 127 33.5C122.764 33.5 118.955 33.167 116.23 32.6395C114.859 32.3742 113.813 32.0692 113.134 31.7584C112.923 31.662 112.769 31.5742 112.659 31.5C112.769 31.4258 112.923 31.338 113.134 31.2416C113.813 30.9308 114.859 30.6258 116.23 30.3605C118.955 29.833 122.764 29.5 127 29.5C131.236 29.5 135.045 29.833 137.77 30.3605C139.141 30.6258 140.187 30.9308 140.866 31.2416ZM112.461 31.3323C112.461 31.3323 112.461 31.3332 112.461 31.3349C112.461 31.3332 112.461 31.3323 112.461 31.3323ZM112.461 31.6677C112.461 31.6677 112.461 31.6668 112.461 31.6651C112.461 31.6668 112.461 31.6677 112.461 31.6677ZM141.539 31.6651C141.54 31.6668 141.541 31.6677 141.541 31.6677C141.541 31.6677 141.54 31.6668 141.539 31.6651Z" :stroke="finalStrokeColor" stroke-width="2"/>
|
|
<path class="tb-shape-stroke" d="M141.541 28.3323C141.541 28.3323 141.54 28.3332 141.539 28.3349C141.54 28.3332 141.541 28.3323 141.541 28.3323ZM140.866 28.2416C141.077 28.338 141.231 28.4258 141.341 28.5C141.231 28.5742 141.077 28.662 140.866 28.7584C140.187 29.0692 139.141 29.3742 137.77 29.6395C135.045 30.167 131.236 30.5 127 30.5C122.764 30.5 118.955 30.167 116.23 29.6395C114.859 29.3742 113.813 29.0692 113.134 28.7584C112.923 28.662 112.769 28.5742 112.659 28.5C112.769 28.4258 112.923 28.338 113.134 28.2416C113.813 27.9308 114.859 27.6258 116.23 27.3605C118.955 26.833 122.764 26.5 127 26.5C131.236 26.5 135.045 26.833 137.77 27.3605C139.141 27.6258 140.187 27.9308 140.866 28.2416ZM112.461 28.3323C112.461 28.3323 112.461 28.3332 112.461 28.3349C112.461 28.3332 112.461 28.3323 112.461 28.3323ZM112.461 28.6677C112.461 28.6677 112.461 28.6668 112.461 28.6651C112.461 28.6668 112.461 28.6677 112.461 28.6677ZM141.539 28.6651C141.54 28.6668 141.541 28.6677 141.541 28.6677C141.541 28.6677 141.54 28.6668 141.539 28.6651Z" :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(26 - (realValue / maxValue * 60));
|
|
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 VerticalOvalTankNode 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(VerticalOvalTank, {
|
|
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 VerticalOvalTankModel 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-oval-tank',
|
|
view: VerticalOvalTankNode,
|
|
model: VerticalOvalTankModel,
|
|
})
|
|
|
|
`,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};
|