flow.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. export default {
  2. namespaced: true,
  3. state: {
  4. // 网格
  5. showGrid: false,
  6. type: 'mesh',
  7. size: 10,
  8. color: '#e5e5e5',
  9. thickness: 1,
  10. colorSecond: '#d0d0d0',
  11. thicknessSecond: 1,
  12. factor: 4,
  13. bgColor: '#e5e5e5',
  14. showImage: false,
  15. repeat: 'watermark',
  16. angle: 30,
  17. position: 'center',
  18. bgSize: JSON.stringify({ width: 150, height: 150 }),
  19. opacity: 0.9,
  20. // 线条
  21. strokeWidth: 1,
  22. outStrokeWidth: 1,
  23. stroke: '#cfe7f2',
  24. outStroke: '#456d89',
  25. strokeDasharray: 1,
  26. animation: 0,
  27. connector: 'normal',
  28. edgeRouter: 'metro',
  29. edgeOffset: 32,
  30. edgeDirection: 'H',
  31. label:'',
  32. endArrow: true,
  33. // 节点属性
  34. nodeStroke: '#5F95FF',
  35. nodeStrokeWidth: 1,
  36. nodeFill: '#ffffff',
  37. // nodeImageWidth: 60,
  38. // nodeImageHeight: 60,
  39. portId: '',
  40. portX: 0,
  41. portY: 0,
  42. portColor: '#5F95FF',
  43. portFill: '#FFF',
  44. ZIndex: 0,
  45. nodeFontSize: 12,
  46. nodeColor: '#080808',
  47. // 业务数据
  48. nodeStatus: 0,
  49. nodePointCode: '52',
  50. nodeFieldName: 'fieldName1',
  51. nodeType: '' // 节点类型(text、image)
  52. },
  53. mutations: {
  54. updateshowGrid(state, showGrid) {
  55. state.showGrid = showGrid
  56. },
  57. updatetype(state, type) {
  58. state.type = type
  59. },
  60. updatesize(state, size) {
  61. state.size = size
  62. },
  63. updatecolor(state, color) {
  64. state.color = color
  65. },
  66. updatethickness(state, thickness) {
  67. state.thickness = thickness
  68. },
  69. updatecolorSecond(state, colorSecond) {
  70. state.colorSecond = colorSecond
  71. },
  72. updatethicknessSecond(state, thicknessSecond) {
  73. state.thicknessSecond = thicknessSecond
  74. },
  75. updatefactor(state, factor) {
  76. state.factor = factor
  77. },
  78. updatebgColor(state, bgColor) {
  79. state.bgColor = bgColor
  80. },
  81. updateshowImage(state, showImage) {
  82. state.showImage = showImage
  83. },
  84. updaterepeat(state, repeat) {
  85. state.repeat = repeat
  86. },
  87. updateangle(state, angle) {
  88. state.angle = angle
  89. },
  90. updateposition(state, position) {
  91. state.position = position
  92. },
  93. updatebgSize(state, bgSize) {
  94. state.bgSize = bgSize
  95. },
  96. updateopacity(state, opacity) {
  97. state.opacity = opacity
  98. },
  99. updatestrokeWidth(state, strokeWidth) {
  100. state.strokeWidth = strokeWidth
  101. },
  102. updateoutStrokeWidth(state, outStrokeWidth) {
  103. state.outStrokeWidth = outStrokeWidth
  104. },
  105. updatestroke(state, stroke) {
  106. state.stroke = stroke
  107. },
  108. updateoutStroke(state, outStroke) {
  109. state.outStroke = outStroke
  110. },
  111. updatestrokeDasharray(state, strokeDasharray) {
  112. state.strokeDasharray = strokeDasharray
  113. },
  114. updateanimation(state, animation) {
  115. state.animation = animation
  116. },
  117. updateconnector(state, connector) {
  118. state.connector = connector
  119. },
  120. updateedgeRouter(state, edgeRouter) {
  121. state.edgeRouter = edgeRouter
  122. },
  123. updateedgeOffset(state, edgeOffset) {
  124. state.edgeOffset = edgeOffset
  125. },
  126. updateedgeDirection(state, edgeDirection) {
  127. state.edgeDirection = edgeDirection
  128. },
  129. updatelabel(state, label) {
  130. state.label = label
  131. },
  132. updatenodeStroke(state, nodeStroke) {
  133. state.nodeStroke = nodeStroke
  134. },
  135. updatenodeStrokeWidth(state, nodeStrokeWidth) {
  136. state.nodeStrokeWidth = nodeStrokeWidth
  137. },
  138. updatenodeFill(state, nodeFill) {
  139. state.nodeFill = nodeFill
  140. },
  141. // updatenodeImageWidth(state, nodeImageWidth) {
  142. // state.nodeImageWidth = nodeImageWidth
  143. // },
  144. // updatenodeImageHeight(state, nodeImageHeight) {
  145. // state.nodeImageHeight = nodeImageHeight
  146. // },
  147. updateportId(state, portId) {
  148. state.portId = portId
  149. },
  150. updateportX(state, portX) {
  151. state.portX = portX
  152. },
  153. updateportY(state, portY) {
  154. state.portY = portY
  155. },
  156. updateportColor(state, portColor) {
  157. state.portColor = portColor
  158. },
  159. updateportFill(state, portFill) {
  160. state.portFill = portFill
  161. },
  162. updateZIndex(state, ZIndex) {
  163. state.ZIndex = ZIndex
  164. },
  165. updatenodeFontSize(state, nodeFontSize) {
  166. state.nodeFontSize = nodeFontSize
  167. },
  168. updatenodeColor(state, nodeColor) {
  169. state.nodeColor = nodeColor
  170. },
  171. updatenodeStatus(state, nodeStatus) {
  172. state.nodeStatus = nodeStatus
  173. },
  174. updatenodePointCode(state, nodePointCode) {
  175. state.nodePointCode = nodePointCode
  176. },
  177. updatenodeFieldName(state, nodeFieldName) {
  178. state.nodeFieldName = nodeFieldName
  179. },
  180. updatenodeType(state, nodeType) {
  181. state.nodeType = nodeType
  182. }
  183. }
  184. }