物管理前端
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.
 
 
 
 

436 lines
44 KiB

const e="0677d751-8a3b-40d8-ba76-02fef3a5ee62",t="custom-gauge-chart",a="仪表图",n='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1695020298267" class="icon" viewBox="0 0 1286 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6072" xmlns:xlink="http://www.w3.org/1999/xlink" width="251.171875" height="200"><path d="M792.260975 437.207122a56.22205 56.22205 0 0 0-29.32832 8.153046l-2.09488-3.453721-141.319474 141.772421c-1.981643 0.113237-4.076523 0.056618-5.888311 0.169855-48.012385 0-87.135685 39.010063-87.192303 87.022448 0 48.069004 39.1233 87.192303 87.192303 87.192304s87.192303-39.1233 87.135685-86.343028a45.464558 45.464558 0 0 0 0.283092-6.228022l131.467876-131.128165a56.618379 56.618379 0 0 0 16.645803-40.255668 56.278669 56.278669 0 0 0-16.702422-40.199049 56.505142 56.505142 0 0 0-40.199049-16.702421z" fill="#4DA1FF" p-id="6073"></path><path d="M1164.979763 284.733827C970.21254-3.623576 577.337609-79.775296 288.866969 114.822072 0.566184 309.532677-75.642154 702.520845 119.068451 991.048104c9.625124 13.814884 25.081942 22.36426 41.784363 23.156916l0.905894 0.396329h2.491209a53.900697 53.900697 0 0 0 46.540307-80.171624l-1.981643-3.566958a519.303771 519.303771 0 0 1-88.834236-259.708504l57.920601-0.056618c28.139334-1.981643 50.843304-24.742232 52.881566-52.881566a57.184563 57.184563 0 0 0-53.617605-60.921376h-52.994802a520.492757 520.492757 0 0 1 93.420325-227.152936l30.913635 30.857017c21.231892 18.457592 53.334513 18.570828 74.679642 0.33971 23.892956-20.439235 26.723875-56.618379 5.718456-81.190755l-33.857791-34.197501a526.154595 526.154595 0 0 1 289.999337-128.863431l-0.056619 1.641933 0.056619 72.811236c1.981643 28.252571 24.79885 51.013159 53.051421 53.051421a55.54263 55.54263 0 0 0 41.444653-13.871503 57.184563 57.184563 0 0 0 19.589959-39.915957V119.125069l-0.056618-1.472078a524.682517 524.682517 0 0 1 287.904456 126.881787l-36.292381 36.292381c-18.51421 21.684839-18.400973 53.051421 0.283092 74.566405a56.844852 56.844852 0 0 0 81.134137 5.208891l32.442331-32.102621a517.831693 517.831693 0 0 1 95.401969 228.681632l-55.655867 0.056619a57.354418 57.354418 0 0 0-52.881566 52.881566 56.901471 56.901471 0 0 0 53.617605 60.921375h59.789008a519.303771 519.303771 0 0 1-86.116554 255.405507 53.730842 53.730842 0 0 0 54.919827 81.360611 53.504368 53.504368 0 0 0 34.93354-22.307642 629.143426 629.143426 0 0 0-3.566958-700.765675z" fill="#4DA1FF" p-id="6074"></path></svg>',i="svg",l="动态",o="图表组件",u=!1,c=!0,d="时序",s=`{"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&nbsp;&nbsp;&nbsp;&nbsp;","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":"fieldset","id":"u:2a93d8eee7a9","className":"","title":"布局","collapsable":true,"body":[{"type":"container","id":"u:1606d0ad8360","body":[{"type":"grid","columns":[{"body":[{"type":"input-text","label":"左边距","name":"grid.left","id":"u:1778e7d54c41","mode":"horizontal","size":"full"}],"id":"u:720608fd274b"},{"body":[{"type":"input-text","label":"右边距","name":"grid.right","id":"u:41e8804639dd","mode":"horizontal","size":"full","body":[{"type":"input-text","label":"右边距","name":"right","id":"u:175b96654696","mode":"horizontal","size":"full"}]}],"id":"u:fb776ace0e8b"}],"id":"u:aea0c21b7ba2","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-text","label":"上边距","name":"grid.top","id":"u:8f1e65861eca","mode":"horizontal","size":"full"}],"id":"u:97a259e6edde"},{"body":[{"type":"input-text","label":"下边距","name":"grid.bottom","id":"u:1774c755f248","mode":"horizontal","size":"full","body":[{"type":"input-text","label":"右边距","name":"right","id":"u:e1d3e5e47502","mode":"horizontal","size":"full"}]}],"id":"u:4699288ff76c"}],"id":"u:a580952c96bd","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"背景","name":"grid.backgroundColor","id":"u:f398c821eda1","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"背景","inputClassName":"w-full"}],"id":"u:e14008b58dcb"},{"body":[{"type":"switch","label":"显示","option":"","name":"grid.show","falseValue":false,"trueValue":true,"id":"u:97eb082723ff","value":false,"mode":"horizontal"}],"id":"u:a013d4bd2004"}],"id":"u:94acb2282c6c","className":"m-b"}],"style":{"position":"static","display":"block"},"data":{"grid":{}},"wrapperBody":false}],"bodyClassName":"m-b"},{"type":"fieldset","id":"u:0685657fe4bc","className":"","title":"范围","collapsable":true,"body":[{"type":"container","id":"u:73fcc93013bb","body":[{"type":"grid","columns":[],"id":"u:5fafefdb95b3","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"开始角度","name":"range.startAngle","id":"u:c0774249b76c","mode":"horizontal","size":"full","keyboard":true,"step":1,"value":180}],"id":"u:ce7604a06386"},{"body":[{"type":"input-number","label":"结束角度","name":"range.endAngle","id":"u:ba7437e94ec2","mode":"horizontal","size":"full","value":"0"}],"id":"u:0b1a46c451fb"}],"id":"u:d5f5d7d1f821","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-number","label":"最低值","name":"range.min","id":"u:26039411388d","mode":"horizontal","size":"full","keyboard":true,"step":1,"value":0},{"type":"input-number","label":"分割数量","name":"range.splitNumber","id":"u:a5b3389d2a59","mode":"horizontal","size":"full","keyboard":true,"step":1,"value":12}],"id":"u:f02a179a6a50"},{"body":[{"type":"input-number","label":"最大值","name":"range.max","id":"u:54a0ef638b7d","mode":"horizontal","size":"full","value":"240"}],"id":"u:1989abb0a053"}],"id":"u:aa3c4bbe6aa5","className":"m-b"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"data":{"range":{}}},{"type":"fieldset","id":"u:4a7ac0579e1c","title":"数据项","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"itemStyle.color","id":"u:570bce4701ea","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full"}],"id":"u:3b84bfb2ac84"}],"id":"u:47c4b60e2f0a"}],"id":"u:26e7e01f73a1"}],"id":"u:1f93884d7cab"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:94fc9c2c1ee3","data":{"itemStyle":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:59ab87adfd75","title":"进度条","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[],"id":"u:0d621d3be681"},{"type":"switch","label":"显示","option":"","name":"progress.show","falseValue":false,"trueValue":true,"id":"u:df022f46d389","value":false,"mode":"horizontal"}],"id":"u:71f9b0a29020"},{"body":[{"type":"input-number","label":"宽度","name":"progress.width","keyboard":true,"id":"u:45254e823aa5","step":1,"mode":"horizontal"}],"id":"u:2b83b036ad67"}],"id":"u:56360480f045"}],"id":"u:94cf077e3c1d"}],"id":"u:01f6a42e0699"}],"id":"u:ba54607832fa"}],"id":"u:1b1c26acfb3b"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:b37f7cb5a688","data":{"progress":{}}}],"bodyClassName":""},{"type":"grid","columns":[{"body":[{"type":"switch","label":"圆帽头","option":"","name":"progress.roundCap","falseValue":false,"trueValue":true,"id":"u:fe6e3772b08e","value":false,"mode":"horizontal"}],"id":"u:a12c15de92bc"},{"body":[],"id":"u:0289491d53f7"}],"id":"u:e2658d21a5dc"},{"type":"fieldset","id":"u:5634ef10b528","title":"指针","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"id":"u:877cbeb25bde","type":"switch","label":"显示","option":"","name":"pointer.show","falseValue":false,"trueValue":true,"value":false,"mode":"horizontal"}],"id":"u:c902dbef0b74"},{"body":[{"type":"input-number","label":"宽度","name":"pointer.width","keyboard":true,"id":"u:53456d1d1c24","step":1,"mode":"horizontal"}],"id":"u:8720741678e0"}],"id":"u:d6376bca6bb8","className":"m-b"},{"type":"grid","columns":[{"body":[{"type":"input-text","label":"长度","name":"pointer.length","id":"u:7de9bfcda3b3","mode":"horizontal"}],"id":"u:7852c90f0a49"}],"id":"u:ca49688783d6","className":"m-b"},{"type":"input-text","label":"指针图标","name":"pointer.icon","id":"u:919f2a4901d5","mode":"horizontal"}],"id":"u:cfdcf4ef7c28"}],"id":"u:bb12fb4471be"}],"id":"u:770e9b54fe82"}],"id":"u:313e202f2c59"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:5dcb1482e7d7","data":{"pointer":{}}}],"bodyClassName":""}],"bodyClassName":"m-b","headingClassName":""},{"type":"fieldset","id":"u:907187f7e2a1","title":"轴线","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示","option":"","name":"axisLine.show","falseValue":false,"trueValue":true,"id":"u:66db89183c8d","value":false,"mode":"horizontal"}],"id":"u:0f88558b09bc"},{"body":[{"type":"switch","label":"圆帽头","option":"","name":"axisLine.roundCap","falseValue":false,"trueValue":true,"id":"u:1e9e200d0253","value":false,"mode":"horizontal"}],"id":"u:4a6c1060216a"}],"id":"u:61782c2ddf57"},{"type":"fieldset","id":"u:118aba12cec1","title":"轴线风格","collapsable":true,"body":[{"type":"container","body":[{"type":"combo","id":"u:3ea1bf97482c","label":"颜色","name":"axisLine.lineStyle.color","multiple":true,"addable":true,"removable":true,"removableMode":"icon","addBtn":{"label":"新增","icon":"fa fa-plus","level":"primary","size":"sm","id":"u:7075032bb6da"},"items":[{"type":"input-text","name":"ratio","placeholder":"文本","id":"u:d9626e780c85"},{"type":"input-color","name":"color","placeholder":"颜色","id":"u:04cbb808bdec"}]},{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-number","label":"宽度","name":"axisLine.lineStyle.width","keyboard":true,"id":"u:41934b04ff67","step":1,"mode":"horizontal"}],"id":"u:d7abe8fad5ca"}],"id":"u:893ab7d1ed57"}],"id":"u:227994a18fe9"}],"id":"u:6262674c1c5c"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:85847be141b3","data":{"lineStyle":{}}}],"bodyClassName":""}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:92c4666bcef8","data":{"axisLine":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:75c8b571aac0","title":"轴刻度","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"switch","label":"显示","option":"","name":"axisTick.show","falseValue":false,"trueValue":true,"id":"u:3ae45d99e549","value":false,"mode":"horizontal"}],"id":"u:6cccb24a07b1"},{"body":[{"type":"input-number","label":"分割数量","name":"axisTick.splitNumber","keyboard":true,"id":"u:667148843726","step":1,"mode":"horizontal"}],"id":"u:9d90409718c4"}],"id":"u:262da10ce695"},{"type":"fieldset","id":"u:0fd48ddb098a","title":"轴刻度风格","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"axisTick.lineStyle.color","id":"u:e5fca7b0b79b","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:f9e6ec4896c4"},{"body":[{"type":"input-number","label":"宽度","name":"xAxis.axisTick.lineStyle.width","keyboard":true,"id":"u:1571934a432c","step":1,"mode":"horizontal"}],"id":"u:17179e81c729"}],"id":"u:ef9eaed28557"}],"id":"u:d9f5024d9671"}],"id":"u:1b3520d785a5"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:e7dfac0e99fd","data":{"lineStyle":{}}}],"bodyClassName":""}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:19673ccefa01","data":{"axisTick":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:a1e52778791f","title":"轴分割线","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","id":"u:bb778b2ab45b","columns":[{"body":[{"type":"switch","label":"显示","option":"","name":"splitLine.show","falseValue":false,"trueValue":true,"id":"u:566019456d8a","value":false,"mode":"horizontal"}],"id":"u:e63b8ab8c1b7"},{"body":[{"type":"input-number","label":"分割线长度","name":"splitLine.length","keyboard":true,"id":"u:88c01a074d74","step":1,"mode":"horizontal"}],"id":"u:81c6d7e1b3c6"}]},{"type":"fieldset","id":"u:66c502dea7a7","title":"轴分割线风格","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[{"body":[{"type":"grid","columns":[],"id":"u:af693bef6c01"},{"type":"input-color","id":"u:3a618618dae0","label":"颜色","name":"splitLine.lineStyle.color","mode":"horizontal","size":"full","className":"m-b","format":"rgba","placeholder":"请选择","inputClassName":"w-full myColorPick"}],"id":"u:f46d328a3f22"},{"body":[{"type":"input-number","label":"宽度","name":"splitLine.lineStyle.width","keyboard":true,"id":"u:a3ee7bf1223d","step":1,"mode":"horizontal"}],"id":"u:309b42de5f47"}],"id":"u:7c58df9998ec"}],"id":"u:8dd911474f86"}],"id":"u:824a429f7da1"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:6aa6764ef192","data":{"lineStyle":{}}}],"bodyClassName":""}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:3a6bddcca5ee","data":{"splitLine":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:12b7317e6ea6","title":"轴标签","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","id":"u:73d49b751235","columns":[{"body":[{"type":"switch","label":"显示","option":"","name":"axisLabel.show","falseValue":false,"trueValue":true,"id":"u:c114899e1e4c","value":false,"mode":"horizontal"},{"type":"grid","columns":[],"id":"u:25c988d6559f"}],"id":"u:03524a342eb1"},{"body":[{"type":"input-number","label":"轴标签距离","name":"axisLabel.distance","keyboard":true,"id":"u:a4cca1d898e4","step":1,"mode":"horizontal"}],"id":"u:3db7aab96aa6"}]},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"axisLabel.color","id":"u:174767c36fb8","format":"rgba","mode":"horizontal"}],"id":"u:85d0631a988b"},{"body":[{"type":"input-number","label":"字体大小","name":"axisLabel.fontSize","keyboard":true,"id":"u:aeba820770b6","step":1,"mode":"horizontal"}],"id":"u:dddd48e64703"}],"id":"u:17f0a56de9e2"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:fa350f5071bd","data":{"axisLabel":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:790d9c0150ed","title":"标题","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","id":"u:ebdf6c980e14","columns":[{"body":[{"type":"switch","label":"显示","option":"","name":"title.show","falseValue":false,"trueValue":true,"id":"u:92104d9bafa0","value":false,"mode":"horizontal"},{"type":"grid","columns":[],"id":"u:392f8b101c0e"}],"id":"u:d942d217921b"}]},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"title.color","id":"u:8577cf2abdd3","format":"rgba","mode":"horizontal"}],"id":"u:10f31e0344a5"},{"body":[{"type":"input-number","label":"字体大小","name":"title.fontSize","keyboard":true,"id":"u:dec5404b85b8","step":1,"mode":"horizontal"}],"id":"u:45a630d5f6cc"}],"id":"u:2ee20d63a615"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:6a4800e0bbe2","data":{"title":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:f585c61a8237","title":"值","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","id":"u:c6c36f8c0d07","columns":[]},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"valueConfig.color","id":"u:4ddbe6f3a357","format":"rgba","mode":"horizontal"}],"id":"u:63b4e650350b"},{"body":[{"type":"input-number","label":"字体大小","name":"valueConfig.fontSize","keyboard":true,"id":"u:e0def39e9dff","step":1,"mode":"horizontal"}],"id":"u:0d50d6f9919b"}],"id":"u:86e16bb8e6ad"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:d4beaacf1e42","data":{"valueConfig":{}}}],"bodyClassName":""},{"type":"fieldset","id":"u:4287dc2288d2","title":"单位","collapsable":true,"body":[{"type":"container","body":[{"type":"grid","id":"u:ae12e0e5d9ed","columns":[]},{"type":"grid","columns":[{"body":[{"type":"input-color","label":"颜色","name":"unit.color","id":"u:8972ef3c0429","format":"rgba","mode":"horizontal"}],"id":"u:38b83b3bc510"},{"body":[{"type":"input-number","label":"字体大小","name":"unit.fontSize","keyboard":true,"id":"u:6fb5d369d34f","step":1,"mode":"horizontal"}],"id":"u:09693db6db2c"}],"id":"u:e753d12193ad"}],"style":{"position":"static","display":"block"},"wrapperBody":false,"id":"u:309c1f76cdd2","data":{"unit":{}}}],"bodyClassName":""},{"type":"fieldset","title":"代码配置","collapsable":true,"body":[{"type":"editor","label":"function (option, datas) {","name":"codeConfig","id":"u:689625dc5d7d","language":"javascript","value":"return option","labelClassName":"text-left","inputClassName":"text-left","className":"m-b-xs"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:f533d43d9ee4","className":"m-t-xs p-t-xs"}],"id":"u:cf0267c9669d","headingClassName":""}],"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","editorState":"default","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":"默认值","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":"单位 &nbsp&nbsp","name":"unit","id":"u:0f606558e8c7","mode":"horizontal","size":"full","className":"m-b-sm"}],"name":"normalService","className":"p-none"},{"type":"service","body":[],"id":"u:0dd069ac163f"}],"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-sm"},{"title":"脚本解析","icon":"fa fa-star","body":[{"type":"flex","id":"u:edef8e21c1e3","justify":"flex-end","items":[{"type":"button","id":"u:f6d8d837a48d","label":"导入","onEvent":{"click":{"actions":[]}},"icon":"fa fa-download","level":"primary","className":"mr-2"},{"type":"button","id":"u:23f988f98a28","label":"保存","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":true}}}]}},"icon":"fa fa-save"}]},{"type":"service","id":"u:6dc2a126004a","body":[{"type":"tpl","id":"u:c77724a2f3b3","tpl":"function (context, service, nodeId) {","inline":true,"wrapperComponent":"","style":{"fontFamily":"","fontSize":16}},{"type":"editor","label":"","name":"script","id":"u:55ceb80e58a7","language":"javascript","size":"xxl","className":"m-b-none","onEvent":{"focus":{"actions":[{"actionType":"setValue","componentId":"u:6dc2a126004a","args":{"value":{"save":false}}}]}},"description":"参数提示:\\n1. context 是整个看板上下文,可以获取看板所有元素节点和连线节点,也可以访问 context.globalDatas 获取全局socket 数据。 \\n2. service 是 Ajax 请求服务。\\n3. nodeId 是节点 id . \\n4. 如果返回一个函数,则可以当socket 数据更新时,调用此函数,此函数入参分别是 context, service, nodeId, globalDatas ;,以满足多样化的业务需求。"},{"type":"tpl","tpl":"}","inline":true,"wrapperComponent":"","id":"u:fa21aebb859b","style":{"fontFamily":"","fontSize":16}}],"name":"scriptService","data":{"script":"","save":false},"className":"text-left"}],"id":"u:dc8d331cbe5e"}],"id":"u:178107498966","tabsMode":"radio","className":"p-none w-full","contentClassName":"p-none"}],"className":""}`,r={jsPlugin:'[{"url":"./logicflow/core.umd.js","isModule":false,"disabled":true},{"url":"./logicflow/extensionLib/NodeResize.js","isModule":false,"disabled":true},{"url":"./plugins/echarts.min.js","isModule":false,"disabled":false}]',json:`{
"nodes": [
{
"id": "f7ceb814-b019-489f-8678-7ec0e3a11dec",
"type": "custom-gauge-chart",
"x": 200,
"y": 200,
"text": {
"value": "",
"x": 200,
"y": 200
},
"properties": {
"id": "f7ceb814-b019-489f-8678-7ec0e3a11dec",
"width": 500,
"height": 500,
"x": 200,
"y": 200,
"rotation": 0,
"opacity": 1,
"grid": {
"show": false,
"left": "20",
"top": "20",
"right": "20",
"bottom": "20"
},
"range": {
"startAngle": 180,
"endAngle": 0,
"min": 0,
"splitNumber": 6,
"max": 240
},
"progress": {
"show": true,
"roundCap": true,
"width": 18
},
"pointer": {
"show": true,
"width": 12,
"length": "75%",
"icon": "path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z"
},
"axisLine": {
"show": true,
"roundCap": true,
"lineStyle": {
"color": [
{
"ratio": "0.3",
"color": "#67e0e3"
},
{
"ratio": "0.7",
"color": "#37a2da"
},
{
"ratio": "1",
"color": "#fd666d"
}
],
"width": 18
}
},
"axisTick": {
"show": true,
"splitNumber": 2,
"lineStyle": {
"color": "#999"
}
},
"splitLine": {
"show": true,
"length": 13,
"lineStyle": {
"width": 3,
"color": "#999"
}
},
"axisLabel": {
"show": true,
"distance": 30,
"fontSize": 20,
"color": "#999"
},
"title": {
"show": true,
"color": "#50e3c2",
"fontSize": 16
},
"codeConfig": "return option;",
"showDefaultValue": false,
"showUnit": false,
"nodeAlias": "仪表图",
"fontSize": 0,
"itemStyle": {
"color": "#7ed321"
},
"value": {
"color": "#50e3c2",
"fontSize": 14
},
"unit": {
"color": "#50e3c2",
"fontSize": 12
},
"valueConfig": {
"color": "#50e3c2",
"fontSize": 14
},
"dynamic": {
"normalData": {
"dataPoint": "",
"compareType": "",
"conditionVariables": [],
"defaultValue": "",
"unit": "kWh"
}
}
}
}
]
}`,javascript:`const { createApp, createVNode, render } = Vue;
const app = createApp({})
const defaultValue = 100
const GaugeChart = {
template: '<div :id="chartId" :style="getStyle"></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: {
getStyle() {
return {
width: \`\${this.width}px\`,
height: \`\${this.height}px\`
}
}
},
setup(props) {
const { onMounted, nextTick, toRefs, watch } = Vue;
const { chartProps, currentData, thingName, attr, width, height } = toRefs(props);
let myChart = null;
const initChart = (data, pros) => {
// 基于准备好的dom,初始化echarts实例
const dom = document.getElementById(props.chartId);
if (dom) {
if(!myChart) {
myChart = echarts.init(dom);
}
// 由于实时推送时候不会重复创建实例,但是需更新画布大小。
myChart.resize({
width: width.value,
height: height.value,
})
if (data) {
const { grid, codeConfig, range, progress, pointer, axisLine, axisTick, splitLine, axisLabel, itemStyle, title, valueConfig, unit } = pros;
// 指定图表的配置项和数据
// 轴线底色拼装
// 发现图表一直渲染的情况。就要注意图表数据多层对象嵌套的引用问题。
const newAxisLine = window._.cloneDeep(axisLine);
const Colors = []
const oldColor = newAxisLine.lineStyle.color
if (oldColor && oldColor.length > 0) {
oldColor.forEach((item) => {
Colors.push([item.ratio, item.color])
})
newAxisLine.lineStyle.color = Colors;
} else if(oldColor && oldColor.length === 0) {
delete newAxisLine.lineStyle.color
}
var option = {
grid,
tooltip: {
formatter: '{a} <br/>{b} : {c}%'
},
series: [
{
name: thingName.value,
title,
type: 'gauge',
...range,
progress,
pointer,
axisLine: newAxisLine,
axisTick,
splitLine,
axisLabel,
itemStyle,
detail: {
backgroundColor: 'transparent',
borderColor: '#999',
borderWidth: 0,
width: '100%',
lineHeight: 16,
height: 16,
borderRadius: 8,
offsetCenter: [0, '35%'],
valueAnimation: false,
formatter: function (value) {
return '{value|' + value.toFixed(2) + '}{unit|' + props.unit + '}';
},
rich: {
value: {
fontSize: valueConfig.fontSize,
fontWeight: 'bolder',
color: valueConfig.color,
},
unit: {
fontSize: unit.fontSize,
color: unit.color,
padding: [0, 0, 0, 10]
}
}
},
data: [
{
value: data,
name: attr.value
}
]
}
]
};
const func = new Function('option', 'datas', codeConfig);
const opt = func(window._.cloneDeep(option), data);
// console.log('opt', opt);
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(opt);
}
}
}
watch([currentData, chartProps, width, height], ([val, pros]) => {
if (val) {
nextTick(() => {
initChart(val, pros)
})
}
}, {
immediate: true,
deep: true,
})
}
}
class CustomGaugeChartNode extends HtmlResize.view {
realValue = defaultValue
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: \`gauge-\${properties.id}\`,
currentData: this.realValue,
width,
height,
chartProps: properties,
thingName,
attr,
unit: normalData.unit || 'km/h'
})
return
}
const el = document.createElement('div');
rootEl.innerHTML = '';
const instance = createVNode(GaugeChart, {
name: properties.nodeAlias,
chartId: \`gauge-\${properties.id}\`,
currentData: this.realValue,
width,
height,
chartProps: properties,
thingName,
attr,
unit: normalData.unit || 'km/h'
})
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 = defaultValue;
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() {
if (this.shouldUpdate()) {
this.setHtml(this.rootEl);
}
// 防止拖动时候频繁渲染图表
this.updateHtmlDebounced = window._.debounce(this.updateHtml.bind(this), 500);
}
componentDidUpdate() {
if (this.shouldUpdate()) {
this.updateHtmlDebounced();
}
}
}
class CustomGaugeChartModel 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-gauge-chart',
view: CustomGaugeChartNode,
model: CustomGaugeChartModel,
})`,css:"",fakeData:""},p={id:e,name:t,aliasName:a,image:n,imageType:i,groupName:l,groupType:o,isRemote:!1,isDefault:!0,sectionType:d,config:s,files:r};export{a as aliasName,s as config,p as default,r as files,l as groupName,o as groupType,e as id,n as image,i as imageType,c as isDefault,u as isRemote,t as name,d as sectionType};