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

184 lines
65 KiB

  1. const e="222222222222",a="rect-node-radius",t="圆角矩形",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="1681453142728" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3193" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M885.333333 938.666667H138.666667a53.393333 53.393333 0 0 1-53.333334-53.333334V138.666667a53.393333 53.393333 0 0 1 53.333334-53.333334h746.666666a53.393333 53.393333 0 0 1 53.333334 53.333334v746.666666a53.393333 53.393333 0 0 1-53.333334 53.333334zM138.666667 128a10.666667 10.666667 0 0 0-10.666667 10.666667v746.666666a10.666667 10.666667 0 0 0 10.666667 10.666667h746.666666a10.666667 10.666667 0 0 0 10.666667-10.666667V138.666667a10.666667 10.666667 0 0 0-10.666667-10.666667z" fill="#5C5C66" p-id="3194"></path></svg>',l="svg",i="基础",o="基础图形",r=!1,u=!0,d="基础图形",s=`{"id":"u:270584784ce1","type":"page","name":"page1","asideResizor":false,"style":{"boxShadow":" 0px 0px 0px 0px transparent"},"pullRefresh":{"disabled":true},"body":[{"type":"tabs","name":"tab","tabs":[{"title":"样式","icon":"fa fa-th-large","body":[{"type":"form","title":"","name":"basicPropForm","body":[{"type":"input-text","label":"名称","name":"nodeAlias","id":"u:6b126f0520cb","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"input-text","label":"ID&nbsp;&nbsp;&nbsp;&nbsp;","name":"id","id":"u:6232710ac003","size":"full","mode":"horizontal","inputControlClassName":"w-100","className":"m-b"},{"type":"grid","id":"u:1954dc15dd5b","className":"m-b","columns":[{"body":[{"type":"input-number","label":"宽度","name":"width","keyboard":true,"id":"u:656efdb758ad","step":1,"suffix":"px","placeholder":"组件宽度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelClassName":"w-8","labelAlign":"left","precision":2,"inputClassName":"w-full"}],"id":"u:4274c47a4ef5","md":6},{"body":[{"type":"input-number","label":"高度","name":"height","keyboard":true,"id":"u:1ed6dcd98c1a","step":1,"suffix":"px","placeholder":"组件高度","size":"full","mode":"horizontal","className":"m-b","value":100,"labelAlign":"left","labelClassName":"w-8","precision":2,"inputClassName":"w-full"}],"id":"u:3e9d1e71a69f","md":6}]},{"type":"grid","id":"u:c605398a724c","className":"m-b","columns":[{"body":[{"type":"input-number","label":"X 轴","name":"x","keyboard":true,"id":"u:dcc0c21d16f6","step":1,"suffix":"px","placeholder":"组件左边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:14cc19d6ffb0","md":6},{"body":[{"type":"input-number","label":"Y 轴","name":"y","keyboard":true,"id":"u:cd6fdff9ca88","step":1,"suffix":"px","placeholder":"组件上边距","size":"full","mode":"horizontal","className":"m-b","value":200,"labelAlign":"left","precision":2,"inputClassName":"w-full","labelClassName":"w-8"}],"id":"u:4931801ca9b8","md":6}]},{"type":"grid","id":"u:a332a7bf83c1","className":"m-b","columns":[{"body":[{"type":"input-number","label":"旋转","name":"rotation","id":"u:f6a2dbb518f9","placeholder":"组件旋转角度","mode":"horizontal","size":"full","className":"","keyboard":true,"step":1,"suffix":"deg","value":0,"labelAlign":"left","inputClassName":"w-full"}],"id":"u:646cd98b7955","md":6},{"body":[{"type":"input-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":[{"body":[{"type":"input-color","label":"填充","name":"fill","id":"u:0d19ed3e2bdc","placeholder":"","mode":"horizontal","size":"full","className":"m-b","format":"rgba","inputClassName":"w-full"}],"id":"u:facc5c90e990","md":6},{"body":[{"type":"input-color","label":"描边","name":"strokeColor
  2. "nodes": [
  3. {
  4. "id": "22222",
  5. "type": "rect-node-radius",
  6. "x": 200,
  7. "y": 200,
  8. "text": {
  9. "value": "",
  10. "x": 200,
  11. "y": 200
  12. },
  13. "properties": {
  14. "id": "22222",
  15. "width": 100,
  16. "height": 100,
  17. "x": 200,
  18. "y": 200,
  19. "rotation": 0,
  20. "opacity": 1,
  21. "strokeWidth": 1,
  22. "showDefaultValue": false,
  23. "showUnit": false,
  24. "fontSize": 12,
  25. "nodeAlias": "圆角矩形",
  26. "dynamic": {
  27. "normalData": {
  28. "dataPoint": "",
  29. "compareType": "",
  30. "conditionVariables": [],
  31. "defaultValue": "[]",
  32. "unit": ""
  33. },
  34. "uiData": {
  35. "dataPoint": "",
  36. "compareType": "",
  37. "conditionVariables": [],
  38. "defaultValue": "[]"
  39. },
  40. "animationData": {
  41. "animationCombo": [
  42. {
  43. "dataPoint": "",
  44. "min": "",
  45. "max": "",
  46. "animationName": "旋转",
  47. "defaultValue": "[]"
  48. }
  49. ]
  50. },
  51. "hiddenData": {
  52. "hiddenCombo": [
  53. {
  54. "dataPoint": "",
  55. "min": "",
  56. "max": "",
  57. "showOrHiddenName": "隐藏",
  58. "defaultValue": "[]"
  59. }
  60. ]
  61. }
  62. }
  63. }
  64. }
  65. ]
  66. }`,javascript:`\r
  67. class RectNodeRadiusView extends RectResize.view { }\r
  68. class RectNodeRadiusModel extends RectResize.model {\r
  69. realValue = ''\r
  70. \r
  71. initNodeData(data) {\r
  72. super.initNodeData(data);\r
  73. const { properties } = this;\r
  74. this.width = properties.width || 150;\r
  75. this.height = properties.height || 80;\r
  76. window.nodeEventsListeners(this);\r
  77. this.text.editable = false; // 不允许文本被编辑\r
  78. this.radius = 20\r
  79. }\r
  80. \r
  81. setAttributes() {\r
  82. const { x, y, properties } = this;\r
  83. const { textHorizontalMove = 0, textVerticalMove = 0, dynamic } = properties;\r
  84. const { normalData } = dynamic || {};\r
  85. \r
  86. let textValue = properties.content || '';\r
  87. if (normalData) {\r
  88. const { defaultValue } = normalData || {}\r
  89. const realValue = window.resolveScadaNewValue(defaultValue)\r
  90. this.realValue = realValue\r
  91. textValue += realValue\r
  92. }\r
  93. this.text = {\r
  94. ...this.text,\r
  95. x: x + textHorizontalMove,\r
  96. y: y + textVerticalMove,\r
  97. value: textValue,\r
  98. }\r
  99. }\r
  100. \r
  101. getNodeStyle() {\r
  102. const style = super.getNodeStyle();\r
  103. const { properties } = this;\r
  104. \r
  105. style.fill = properties.fill || style.fill;\r
  106. \r
  107. const { uiData } = properties.dynamic;\r
  108. if (uiData) {\r
  109. const realValue = window.resolveScadaNewValue(uiData.defaultValue)\r
  110. uiData.conditionVariables.forEach((item) => {\r
  111. if (item.type === 'rangeColor') {\r
  112. let from = item.from;\r
  113. let to = item.to;\r
  114. if (item.from >= item.to) {\r
  115. from = item.to;\r
  116. to = item.from;\r
  117. }\r
  118. if (item.color && Number(realValue) >= from && Number(realValue) <= to) {\r
  119. style.fill = item.color\r
  120. }\r
  121. }\r
  122. })\r
  123. }\r
  124. \r
  125. style.stroke = properties.strokeColor || style.stroke;\r
  126. style.strokeWidth = properties.strokeWidth || style.strokeWidth;\r
  127. style.opacity = properties.opacity || 1;\r
  128. return style;\r
  129. }\r
  130. \r
  131. getTextStyle() {\r
  132. const style = super.getTextStyle();\r
  133. const { properties } = this;\r
  134. style.color = properties.fontColor || style.color;\r
  135. style.fontSize = properties.fontSize || style.fontSize;\r
  136. style.fontFamily = properties.fontFamily || style.fontFamily;\r
  137. style.textAlign = properties.fontAlign || style.textAlign;\r
  138. style.lineHeight = properties.lineHeight || style.lineHeight;\r
  139. const fontStyle = properties.fontStyle;\r
  140. if(fontStyle) {\r
  141. if (fontStyle.includes('bold')) {\r
  142. style.fontWeight = 'bolder';\r
  143. }\r
  144. if(fontStyle.includes('italic')) {\r
  145. style.fontStyle = 'italic'\r
  146. }\r
  147. if (fontStyle.includes('underline,line-through')) {\r
  148. style.textDecoration = 'underline line-through'\r
  149. } else if (fontStyle.includes('line-through,underline')) {\r
  150. style.textDecoration = 'line-through underline'\r
  151. } else if (fontStyle.includes('underline')) {\r
  152. style.textDecoration = 'underline'\r
  153. } else if (fontStyle.includes('line-through')) {\r
  154. style.textDecoration = 'line-through'\r
  155. }\r
  156. }\r
  157. return style;\r
  158. }\r
  159. \r
  160. getResizeOutlineStyle() {\r
  161. return {\r
  162. stroke: "#00ffff",\r
  163. strokeWidth: 1,\r
  164. strokeDasharray: "none",\r
  165. };\r
  166. }\r
  167. }\r
  168. \r
  169. \r
  170. lf.register({\r
  171. type: 'rect-node-radius',\r
  172. view: RectNodeRadiusView,\r
  173. model: RectNodeRadiusModel,\r
  174. })\r
  175. \r
  176. `,css:"",fakeData:` // 数据处理, 返回格式如下
  177. return {
  178. normalData: [],
  179. uiData: [],
  180. animationData: [[]], // 多级
  181. hiddenData: [[]], // 多级
  182. } `},m={id:e,name:a,aliasName:t,image:n,imageType:l,groupName:i,groupType:o,isRemote:!1,isDefault:!0,sectionType:d,config:s,files:c};export{t as aliasName,s as config,m as default,c as files,i as groupName,o as groupType,e as id,n as image,l as imageType,u as isDefault,r as isRemote,a as name,d as sectionType};