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

536 lines
53 KiB

  1. const e="0134f363-6673-4443-a165-53d5c6cbea75",a="custom-progress-node",t="进度条",n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA5EAAAC7CAYAAAD8DRpyAAAAAXNSR0IArs4c6QAAIABJREFUeF7t3X/sXXV9x/H3F5DOpjCHw6VlihObNTRDUYNDSExsy49CtYkITYyYOCgplrloJgFtK9WUwDL9Yy2NtN0SGAnFuaSWFrS2kdgJGp2ggXUizKr0i1k3KAy6ltHvcj4/zvl8zvmccz73fu6939uep4kp/facc895nNPe+7rvz+fznhCRKeF/CCCAAAIIIIAAAggggAACCEQITBAiI5TYBAEEEEAAAQQQQAABBBBAQAkQInkQEEAAAQQQQAABBBBAAAEEogUIkdFUbIgAAggggAACCCCAAAIIIECI5BlAAAEEEEAAAQQQQAABBBCIFiBERlOxIQIIIIAAAggggAACCCCAACGSZwABBBBAAAEEEEAAAQQQQCBagBAZTcWGCCCAAAIIIIAAAggggAAChEieAQQQQAABBBBAAAEEEEAAgWgBQmQ0FRsigAACCCCAAAIIIIAAAggQInkGEEAAAQQQQAABBBBAAAEEogUIkdFUbIgAAggggAACCCCAAAIIIECI5BlAAAEEEEAAAQQQQAABBBCIFiBERlOxIQIIIIAAAggggAACCCCAACGSZwABBBBAAAEEEEAAAQQQQCBagBAZTcWGCCCAAAIIIIAAAggggAAChEieAQQQQAABBBBAAAEEEEAAgWgBQmQ0FRsigAACCCCAAAIIIIAAAggQInkGEEAAAQQQQAABBBBAAAEEogUIkdFUbIgAAggggAACCCCAAAIIIECI5BlAAAEEEEAAAQQQQAABBBCIFiBERlOxIQIIIIAAAggggAACCCCAACGSZwABBBBAAAEEEEAAAQQQQCBagBAZTcWGCCCAAAIIIIAAAggggAAChEieAQQQQAABBBBAAAEEEEAAgWgBQmQ0FRsigAACCCCAAAIIIIAAAggQInkGEEAAAQQQQAABBBBAAAEEogUIkdFUbIgAAggggAACCCCAAAIIIECI5BlAAAEEEEAAAQQQQAABBBCIFiBERlOxIQIIIIAAAggggAACCCCAACGSZwABBBBAAAEEEEAAAQQQQCBagBAZTcWGCCCAAAIIIIAAAggggAAChEieAQQQQAABBBBAAAEEEEAAgWgBQmQ0FRsigAACCCCAAAIIIIAAAggQInkGEEAAAQQQQAABBBBAAAEEogUIkdFUbIgAAggggAACCCCAAAIIIECI5BlAAAEEEEAAAQQQQAABBBCIFiBERlOxIQIIIIAAAggggAACCCCAACGSZwABBBBAAAEEEEAAAQQQQCBagBAZTcWGCCCAAAIIIIAAAggggAAChEieAQQQQAABBBBAAAEEEEAAgWgBQmQ0FRsigAACCCCAAAIIIIAAAggQInkGEEAAAQQQQAABBBBAAAEEogUIkdFUbIgAAggggAACCCCAAAIIIECI5BlAAAEEEEAAAQQQQAABBBCIFiBERlOxIQIIIIAAAggggAACCCCAACGSZwABBBBAAAEEEEAAAQQQQCBagBAZTcWGCCCAAAIIIIAAAggggAAChEieAQQQQAABBBBAAAEEEEAAgWgBQmQ0FRsigAACCCCAAAIIIIAAAggQInkGEEAAAQQQQAABBBBAAAEEogUIkdFUbIgAAggggAACCCCAAAIIIECI5BlAAAEEEEAAAQQQQAABBBCIFiBERlOxIQIIIIAAAggggAACCCCAACGSZwABBBBAAAEEEEAAAQQQQCBagBAZTcWGCCCAAAIIIIAAAggggAAChEieAQQQQAABBBBAAAEEEEAAgWgBQmQ0FRsigAACCCCAAAIIIIAAAggQInkGEEAAAQQQQAABBBBAAAEEogUIkdFUbIgAAggggAACCCCAAAIIIECI5BlAAAEEEEAAAQQQQAABBBCIFiBERlOFNzz94msTj8DuCCCAAAIIIIAAAgggMEqBl/beM8qXO+FeixCZeEsJkYmA7I4AAggggAACCCCAwIgFCJFp4ITIND8hRCYCsjsCCCCAAAIIIIAAAiMWIESmgRMi0/wIkYl+7I4AAggggAACCCCAwKgFCJFp4oTIND9CZKIfuyOAAAIIIIAAAgggMGoBQmSaOCEyzU9k45RMZIpifxWZevA2ddSTP7zG/Fwz6+2k9Gvdz+12U6J2m3D2U793fu4dc0ptPDGR/Vp+rez3+udHn9glr/37D9V/n7bsi+qc9Ov4x1Wv6/7cHtP+XF1X4vXVukzI7/5hnTq3k2eeJmcuW5l7TsiUNrE2+a91P3c8G16vep/iru/ZDXeqc/mjyz4ss+bOc+yb7nu9m70+ew+L66y/Pu1R/Hn+vJn7d3jyeXnmH+9T5/lnN3+ueA5j7nvQuu15yXaKe57MI6Tcntp8v/zPb59X//3+VX8lMjWR3RZ9r/Xjq39vfp7/3v55eXuzT/boT6nj6OPZ/xfHzX4+VT1u/pr+eez92t+qlz5z7p/KvMuv1H9Ja4+rKPzzV9tnJ1W6PrNddp76fItz1Q5mP/N6leNmx3P2eeTv71S/vfBjN8qMmbOK6w8e1/Xt09u5P1OZp3XJf26Pa657SmT/L34kv3hit3rxSz56i3EM3/fMy/wzVnirR7HFpfb+FM9Tvbd22fntr+j7ISKLF67Sz0vL89R8viHvuufBPgf6DIrn2fm5OZ9vPabfg+affYmcM/tC8yLj9cvhoy/Jrn/9mjqpD/959l45nv/78dPfkAP/9dTAz/NLP/uMHHrtxfG8aM4KgY4IECLTbjQhMs3PCZFFYDt2g36TP2XTsRGEnJhwpC/SDbFHHt8lL6y9Umacv0jevGZ75c91mOo35KiPv60hzw/V4dc7sP4WObh1vcy5aZ28RYXIQAhX6ckJa2qjQAi3PzefwNSHv7aQY8JTca7hkP7YkovklV/ukwt37JVZ75xXhPL8XMyHzZ6/TIgLsVWX6nNxeHJStp33Hpk5Z7Ys/flPGr7UiLt/5RBf/jKlen+rz6H3nJlw9OSWrbL7+s/L/E8tkwVf1+Fch8cidPhhsvTndnsnjLnb6wBqj2dCnPlQXg2p+n57IdYcd9uNy2Xfju2y9K5NMu/yJc6H+h5Dan6+JsSWQpd/vkWwK8JjjYvxXHfJ2+XIKy/LFx7eLzNmnpYH2Sx0eSEv92rxrgtNTtiuhLyW8JuFyA2rFsjZcy+QlbftKXmbf4fU+daFavMPub23zv1V4dJ5JopQbu6Tvfct9yG7pixE7tz1ZVm8aJVcsSgLke6XEdUvBfzzbfoyxHnOnC9Kii8N6r/0CH3Jsm7rB+SZyUfl1qt/MNYhcuXG35c3nnq6rF9xKPWdeGj7ZyFy486r5X1zPyYrFj8wsNchRA6MkgMh0LcAIbJvOv153PmuOe1IXd1747FK2Dp2w0lKIwuR6kOyF2qc6pmtYHrhxq38hUKOCSMt4cd+gLcf9P0QpCuRL6xdIjPevUjOWLPdVCj98FCEguFVGtsqtJPrb5WDD6yXOSvXOZXIahhpr9Rlny5D12cCZ8/hzg9pjy25WIfIB/eaSmS/4S9iv0o12FaYmyvQhw9MyrZ3vbcIkX2E6Ur117rllWnjYp/PYOW95nkyH+Kf3HK/7Fl+swmRd7RUIksfvt1Kpa3kBSuAoQ/lNRVOrxJZVJ62rVgu+3Zul49suFuHyNpwVVSOeg2/rSHvWHuF9vZLdYi89aFf6RBZE4rzCqcJXcEKp+drKruhCqAX2tpDtQqRq22I3O1VIm0A9MNfWwUwrvKrQl5NpbmoVBcVzixEPmRC5OKFXywq4u4XF/kXEqXKaMuXG/6XAuHr0+fbFIr1fuseIEQO6iMJIXJQkhwHgfETIESm3RNCZJpfoBI5JX6I1B+qhxtyeg95Rx7/jg6RjZXIalhrq1DaUBgeZlpT4VJBI1xJ9CqR16wMVDfrhktGDs+tDNMshfTg8N2iGqpy2IRIXok0ITJmmO2oQ3p8JXKaQnqW
  2. "nodes": [
  3. {
  4. "id": "f0bb3636-d4a4-4437-a37d-b1eda804a5d9",
  5. "type": "custom-progress-node",
  6. "x": 200,
  7. "y": 200,
  8. "text": {
  9. "value": "",
  10. "x": 200,
  11. "y": 200
  12. },
  13. "properties": {
  14. "id": "f0bb3636-d4a4-4437-a37d-b1eda804a5d9",
  15. "width": 500,
  16. "height": 100,
  17. "x": 200,
  18. "y": 200,
  19. "rotation": 0,
  20. "opacity": 1,
  21. "showCategoryName": true,
  22. "showMaxValue": true,
  23. "showRectSplit": true,
  24. "splitMargin": 2,
  25. "showToolTip": true,
  26. "showToolTipBack": true,
  27. "xOffset": -35,
  28. "yOffset": -12,
  29. "codeConfig": "return option",
  30. "fontSize": 12,
  31. "showRightValue": true,
  32. "nodeAlias": "进度条",
  33. "showDefaultValue": false,
  34. "showUnit": false,
  35. "valueColor": "rgba(245, 166, 35, 1)",
  36. "categoryName": "A29",
  37. "categoryNameColor": "#03fcfe",
  38. "categoryFontSize": 12,
  39. "maxValue": 10000,
  40. "maxValueColor": "#0097ff",
  41. "maxValueFontSize": 12,
  42. "innerBarWidth": 18,
  43. "innerBarBack": [
  44. {
  45. "offset": 0,
  46. "color": "#0097ff"
  47. },
  48. {
  49. "offset": 0.4,
  50. "color": "#6dffe1"
  51. },
  52. {
  53. "offset": 0.8,
  54. "color": "#9d6fff"
  55. }
  56. ],
  57. "outerBarWidth": 25,
  58. "outerBarBack": "#0e3c5e",
  59. "canvasBack": "rgb(24, 20, 50)",
  60. "tooltipBackUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAAZCAYAAAB6v90+AAAA2klEQVRYhe2YMUoDQRhG32zAwsKkyRGCHmE9hE3uuSkNSqogaOEBcgzXDVg+i2xhEdKYn2GWefDX33vlDCjoCu3QHrXQ68eGFUpC74EPYME0+ALahHbAOrfNldkktAfucptcmWNCzW0RQZNbIIoaVho1rDRqWGnUsNKoYaUx6bDv3BIBHBtgl9sigNeEPgDvTOsF/dgAB6AFNsCQVel/DJwaWuDA+JkTcTfo9sLnS4fOwvYDw0Bv0f2ZqJcxPG47OAx0jn7+iXobg0N306kunCXwDPwAT0AfPfgLAvYRIEVmrDQAAAAASUVORK5CYII=",
  61. "tooltipFontColor": "#ffffff",
  62. "tooltipFontSize": 12,
  63. "innerBarRadius": 0,
  64. "outerBarRadius": 0,
  65. "dynamic": {
  66. "normalData": {
  67. "dataPoint": "",
  68. "compareType": "",
  69. "conditionVariables": [],
  70. "defaultValue": "",
  71. "unit": ""
  72. }
  73. }
  74. }
  75. }
  76. ]
  77. }`,javascript:`const { createApp, createVNode, render } = Vue;
  78. const app = createApp({})
  79. const Progress = {
  80. template: '<div :id="chartId" style="width: 100%; height: 100%"></div>',
  81. props: {
  82. realValue: {
  83. type: String,
  84. default: ''
  85. },
  86. unit: {
  87. type: String,
  88. default: ''
  89. },
  90. chartId: {
  91. type: String,
  92. default: ''
  93. },
  94. fontColor: {
  95. type: String,
  96. default: '#ffffff'
  97. },
  98. fontSize: {
  99. type: Number,
  100. default: 14
  101. },
  102. fontFamily: {
  103. type: String,
  104. default: '宋体'
  105. },
  106. fontStyle: {
  107. type: String,
  108. default: 'normal'
  109. },
  110. width: {
  111. type: Number,
  112. default: 80
  113. },
  114. height: {
  115. type: Number,
  116. default: 35
  117. },
  118. showCategoryName: {
  119. type: Boolean,
  120. default: true
  121. },
  122. showMaxValue: {
  123. type: Boolean,
  124. default: true
  125. },
  126. showRectSplit: {
  127. type: Boolean,
  128. default: true
  129. },
  130. splitMargin: {
  131. type: Number,
  132. default: 2,
  133. },
  134. showToolTip: {
  135. type: Boolean,
  136. default: true
  137. },
  138. showToolTipBack: {
  139. type: Boolean,
  140. default: true
  141. },
  142. tooltipBackUrl: {
  143. type: String,
  144. default: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAAZCAYAAAB6v90+AAAA2klEQVRYhe2YMUoDQRhG32zAwsKkyRGCHmE9hE3uuSkNSqogaOEBcgzXDVg+i2xhEdKYn2GWefDX33vlDCjoCu3QHrXQ68eGFUpC74EPYME0+ALahHbAOrfNldkktAfucptcmWNCzW0RQZNbIIoaVho1rDRqWGnUsNKoYaUx6bDv3BIBHBtgl9sigNeEPgDvTOsF/dgAB6AFNsCQVel/DJwaWuDA+JkTcTfo9sLnS4fOwvYDw0Bv0f2ZqJcxPG47OAx0jn7+iXobg0N306kunCXwDPwAT0AfPfgLAvYRIEVmrDQAAAAASUVORK5CYII='
  145. },
  146. xOffset: {
  147. type: Number,
  148. default: -35,
  149. },
  150. yOffset: {
  151. type: Number,
  152. default: -12,
  153. },
  154. categoryName: {
  155. type: String,
  156. default: "A29"
  157. },
  158. categoryNameColor: {
  159. type: String,
  160. default: "#03fcfe"
  161. },
  162. categoryFontSize: {
  163. type: Number,
  164. default: 12
  165. },
  166. tooltipFontColor:{
  167. type: String,
  168. default: "#fff"
  169. },
  170. tooltipFontSize:{
  171. type: Number,
  172. default: 12
  173. },
  174. maxValue: {
  175. type: Number,
  176. default: 10000
  177. },
  178. maxValueColor: {
  179. type: String,
  180. default: "#0097ff"
  181. },
  182. maxValueFontSize: {
  183. type: Number,
  184. default: 12
  185. },
  186. innerBarWidth: {
  187. type: Number,
  188. default: 18
  189. },
  190. innerBarBack: {
  191. type: Array,
  192. default: () => [
  193. {
  194. "offset":
  195. 0,
  196. "color":
  197. "#0097ff"
  198. },
  199. {
  200. "offset":
  201. 0.4,
  202. "color":
  203. "#6dffe1"
  204. },
  205. {
  206. "offset":
  207. 0.8,
  208. "color":
  209. "#9d6fff"
  210. }
  211. ]
  212. },
  213. outerBarWidth: {
  214. type: Number,
  215. default: 25
  216. },
  217. outerBarBack: {
  218. type: String,
  219. default: "#0e3c5e"
  220. },
  221. canvasBack: {
  222. type: String,
  223. default: "rgb(24, 20, 50)"
  224. },
  225. innerBarRadius: {
  226. type: Number,
  227. default: 0
  228. },
  229. outerBarRadius: {
  230. type: Number,
  231. default: 0
  232. }
  233. },
  234. setup(props) {
  235. const { watch, nextTick, toRefs } = Vue;
  236. const { canvasBack, tooltipBackUrl, showCategoryName, showMaxValue, showRectSplit, splitMargin, tooltipFontColor, tooltipFontSize,
  237. showToolTip, showToolTipBack, xOffset, yOffset, categoryName, categoryNameColor, categoryFontSize,innerBarRadius, outerBarRadius, unit,
  238. maxValue, maxValueColor, maxValueFontSize, innerBarWidth, innerBarBack, outerBarWidth, outerBarBack } = toRefs(props)
  239. let myChart = null;
  240. const initChart = (val) => {
  241. // 基于准备好的dom,初始化echarts实例
  242. const dom = document.getElementById(props.chartId);
  243. if (dom && !myChart) {
  244. if (!myChart) {
  245. myChart = echarts.init(dom);
  246. }
  247. if (val) {
  248. let category = [{
  249. name: categoryName.value,
  250. value: Number(val)
  251. }
  252. ]; //类别
  253. let total = maxValue.value; //数据总数
  254. let datas = [];
  255. var rich = {
  256. white: {
  257. backgroundColor: {
  258. image: tooltipBackUrl.value
  259. },
  260. padding: [5, 0, 5, 5],
  261. align: 'center',
  262. },
  263. };
  264. let rightValues = []
  265. category.forEach(value => {
  266. datas.push(value.value);
  267. });
  268. var option = {
  269. backgroundColor: canvasBack.value,
  270. xAxis: {
  271. max: total,
  272. splitLine: {
  273. show: false
  274. },
  275. axisLine: {
  276. show: false
  277. },
  278. axisLabel: {
  279. show: false
  280. },
  281. axisTick: {
  282. show: false
  283. }
  284. },
  285. grid: {
  286. left: 80,
  287. top: 20, //设置条形图的边距
  288. right: 80,
  289. bottom: 20
  290. },
  291. yAxis: [{
  292. type: 'category',
  293. inverse: true,
  294. axisLabel: {
  295. show: showCategoryName.value,
  296. textStyle: {
  297. fontSize: categoryFontSize.value,
  298. color: categoryNameColor.value,
  299. },
  300. },
  301. splitLine: {
  302. show: false,
  303. },
  304. axisTick: {
  305. show: false,
  306. },
  307. axisLine: {
  308. show: false,
  309. },
  310. data: [categoryName.value],
  311. }],
  312. series: [{
  313. //内
  314. type: "bar",
  315. barWidth: innerBarWidth.value,
  316. legendHoverLink: false,
  317. silent: true,
  318. itemStyle: {
  319. barBorderRadius: innerBarRadius.value,
  320. color: {
  321. type: "linear",
  322. x: 0,
  323. y: 0,
  324. x2: 1,
  325. y2: 0,
  326. colorStops: innerBarBack.value
  327. }
  328. },
  329. label: {
  330. normal: {
  331. show: showToolTip.value,
  332. textStyle: {
  333. color: tooltipFontColor.value,
  334. fontSize: tooltipFontSize.value
  335. },
  336. position: 'right',
  337. offset: [xOffset.value, yOffset.value],
  338. formatter: function (data) {
  339. const ratio = (data.value / total * 100).toFixed(2)
  340. return '{white|' + ratio + '%' + '}';
  341. },
  342. verticalAlign: 'bottom',
  343. rich: showToolTipBack.value ? rich : {}
  344. }
  345. },
  346. data: category,
  347. z: 1,
  348. },
  349. {
  350. //外边框
  351. type: "pictorialBar",
  352. symbol: "rect",
  353. symbolBoundingData: total,
  354. itemStyle: {
  355. normal: {
  356. color: "none"
  357. }
  358. },
  359. label: {
  360. normal: {
  361. show: showMaxValue.value,
  362. position: "right",
  363. offset: [0, 0], //设置右边数据位置
  364. textStyle: {
  365. color: maxValueColor.value,
  366. fontSize: maxValueFontSize.value,
  367. fontWeight: 600
  368. },
  369. formatter(value) {
  370. const v = value.value >= 10000 ? value.value / 10000 + '万' + ' ' + unit.value : value.value + ' ' + unit.value;
  371. return v
  372. }
  373. }
  374. },
  375. data: datas,
  376. z: 0,
  377. },
  378. {
  379. name: "外框",
  380. type: "bar",
  381. barGap: "-120%", //设置外框粗细
  382. data: [total, total, total],
  383. barWidth: outerBarWidth.value,
  384. itemStyle: {
  385. normal: {
  386. color: outerBarBack.value, //填充色
  387. barBorderColor: outerBarBack.value, //边框色
  388. barBorderWidth: 1, //边框宽度
  389. barBorderRadius: outerBarRadius.value, //圆角半径
  390. label: {
  391. //标签显示位置
  392. show: false,
  393. position: "top" //insideTop 或者横向的 insideLeft
  394. }
  395. }
  396. },
  397. z: 0
  398. }
  399. ]
  400. };
  401. if (showRectSplit.value) {
  402. option.series.splice(1, 0, {
  403. //分隔
  404. type: "pictorialBar",
  405. itemStyle: {
  406. color: "#000"
  407. },
  408. symbolRepeat: "fixed",
  409. symbolMargin: splitMargin.value,
  410. symbol: "rect",
  411. symbolClip: true,
  412. symbolSize: [2, 21],
  413. symbolPosition: "start",
  414. symbolOffset: [0, 0],
  415. symbolBoundingData: total,
  416. data: category,
  417. z: 2,
  418. })
  419. }
  420. // 使用刚指定的配置项和数据显示图表。
  421. myChart.setOption(option);
  422. }
  423. }
  424. }
  425. watch(() => props.realValue, (val) => {
  426. if (val) {
  427. console.log('val', val)
  428. nextTick(() => {
  429. initChart(val)
  430. })
  431. }
  432. }, {
  433. immediate: true
  434. })
  435. }
  436. }
  437. class CustomProgressNode extends HtmlResize.view {
  438. setHtml(rootEl) {
  439. const { properties, width, height, } = this.props.model;
  440. const { id, fontColor, fontSize, fontFamily, fontStyle,
  441. showCategoryName, showMaxValue, showRectSplit, splitMargin, tooltipFontColor, tooltipFontSize,innerBarRadius, outerBarRadius,
  442. showToolTip, showToolTipBack, xOffset, yOffset, categoryName, categoryNameColor, categoryFontSize,
  443. maxValue, maxValueColor, maxValueFontSize, innerBarWidth, innerBarBack, outerBarWidth, outerBarBack, canvasBack
  444. } = properties;
  445. const { model } = this.props;
  446. const { normalData } = properties.dynamic || {};
  447. let realValue = "";
  448. let unit = '';
  449. if (normalData) {
  450. realValue = window.resolveScadaNewValue(normalData.defaultValue);
  451. unit = normalData.unit;
  452. }
  453. const el = document.createElement('div');
  454. el.style.height = "100%";
  455. rootEl.innerHTML = '';
  456. const instance = createVNode(Progress, {
  457. realValue: realValue || '2500',
  458. unit,
  459. chartId: 'progress_' + id,
  460. fontColor,
  461. fontSize, fontFamily, fontStyle, width, height,
  462. showCategoryName, showMaxValue, showRectSplit, splitMargin, tooltipFontColor, tooltipFontSize,innerBarRadius, outerBarRadius,
  463. showToolTip, showToolTipBack, xOffset, yOffset, categoryName, categoryNameColor, categoryFontSize,
  464. maxValue, maxValueColor, maxValueFontSize, innerBarWidth, innerBarBack, outerBarWidth, outerBarBack, canvasBack
  465. })
  466. instance.appContext = app._context
  467. render(instance, el)
  468. rootEl.appendChild(el);
  469. }
  470. // 生命周期 支持重写内容, 但格式需一致
  471. // shouldUpdate() {
  472. // if (this.preProperties && this.preProperties === this.currentProperties) return;
  473. // this.preProperties = this.currentProperties;
  474. // return true;
  475. // }
  476. // componentDidMount() {
  477. // if (this.shouldUpdate()) {
  478. // this.setHtml(this.rootEl);
  479. // }
  480. // }
  481. // componentDidUpdate() {
  482. // if (this.shouldUpdate()) {
  483. // this.setHtml(this.rootEl);
  484. // }
  485. // }
  486. }
  487. class CustomProgressModel extends HtmlResize.model {
  488. initNodeData(data) {
  489. // 自定义组件,需最开始重置一下text 。
  490. data.text = {
  491. value: "",
  492. x: data.x,
  493. y: data.y,
  494. };
  495. super.initNodeData(data);
  496. const { properties } = this;
  497. this.width = properties.width || 80;
  498. this.height = properties.height || 35;
  499. }
  500. setAttributes() {
  501. // 自定义组件需重置 text
  502. const { x, y, properties } = this;
  503. const { textHorizontalMove = 0, textVerticalMove = 0 } = properties;
  504. this.text = {
  505. ...this.text,
  506. x: x + textHorizontalMove,
  507. y: y + textVerticalMove,
  508. value: "",
  509. }
  510. }
  511. }
  512. lf.register({
  513. type: 'custom-progress-node',
  514. view: CustomProgressNode,
  515. model: CustomProgressModel,
  516. })
  517. `,css:"",fakeData:""},c={id:e,name:a,aliasName:t,image:n,imageType:l,groupName:o,groupType:i,isRemote:!1,isDefault:!0,sectionType:A,config:r,files:s};export{t as aliasName,r as config,c as default,s as files,o as groupName,i as groupType,e as id,n as image,l as imageType,u as isDefault,d as isRemote,a as name,A as sectionType};