workflow.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. const data = {
  2. nodes: [
  3. {
  4. id: '742356ea-762b-4899-b96a-bd567e3c4361',
  5. type: 'start',
  6. x: 220,
  7. y: 170,
  8. properties: {},
  9. baseType: 'node',
  10. },
  11. {
  12. id: 'dacda6b6-48d3-4dff-911d-287704eb23d8',
  13. type: 'rect',
  14. x: 350,
  15. y: 170,
  16. properties: {},
  17. baseType: 'node',
  18. text: {
  19. x: 350,
  20. y: 170,
  21. value: '基础节点',
  22. },
  23. },
  24. {
  25. id: '49106603-2b88-4b2c-b1e8-723c1f2210bd',
  26. type: 'user',
  27. x: 530,
  28. y: 170,
  29. properties: {},
  30. baseType: 'node',
  31. text: {
  32. x: 530,
  33. y: 220,
  34. value: '自定义节点',
  35. },
  36. },
  37. {
  38. id: '647fa2bc-98ee-40cf-99c5-4756c0bc130d',
  39. type: 'push',
  40. x: 690,
  41. y: 170,
  42. properties: {},
  43. baseType: 'node',
  44. text: {
  45. x: 690,
  46. y: 220,
  47. value: '可添加下一个节点/节点组',
  48. },
  49. },
  50. {
  51. id: '37e7bac3-8804-4237-abe9-7b6065c207e9',
  52. type: 'download',
  53. x: 690,
  54. y: 320,
  55. properties: {},
  56. baseType: 'node',
  57. },
  58. {
  59. id: '6bb4396f-54c9-4b1c-b34c-87ef004f2e29',
  60. type: 'user',
  61. x: 840,
  62. y: 320,
  63. properties: {},
  64. baseType: 'node',
  65. },
  66. {
  67. id: 'abf76937-63b8-493c-a978-a4a58bc4f6b8',
  68. type: 'push',
  69. x: 840,
  70. y: 470,
  71. properties: {},
  72. baseType: 'node',
  73. },
  74. {
  75. id: 'b119f24f-2669-4a90-a837-afd853b2ffcc',
  76. type: 'end',
  77. x: 990,
  78. y: 320,
  79. properties: {},
  80. baseType: 'node',
  81. },
  82. {
  83. id: '60326ad9-cae2-4a85-ae98-d340fb7bd67f',
  84. type: 'end',
  85. x: 990,
  86. y: 470,
  87. properties: {},
  88. baseType: 'node',
  89. },
  90. {
  91. id: '414fe028-3609-4450-b0f4-e5aca7705e8c',
  92. type: 'download',
  93. x: 860,
  94. y: 170,
  95. properties: {},
  96. baseType: 'node',
  97. text: {
  98. x: 860,
  99. y: 220,
  100. value: '自定义节点-设置颜色',
  101. },
  102. },
  103. ],
  104. edges: [
  105. {
  106. id: '00f55245-513e-43a2-9cb0-adb61b01adc8',
  107. type: 'polyline',
  108. sourceNodeId: '742356ea-762b-4899-b96a-bd567e3c4361',
  109. targetNodeId: 'dacda6b6-48d3-4dff-911d-287704eb23d8',
  110. startPoint: {
  111. x: 240,
  112. y: 170,
  113. },
  114. endPoint: {
  115. x: 300,
  116. y: 170,
  117. },
  118. properties: {},
  119. pointsList: [
  120. {
  121. x: 240,
  122. y: 170,
  123. },
  124. {
  125. x: 300,
  126. y: 170,
  127. },
  128. ],
  129. },
  130. {
  131. id: 'bbf9754f-603e-48e4-85fe-84ed44459a6a',
  132. type: 'polyline',
  133. sourceNodeId: 'dacda6b6-48d3-4dff-911d-287704eb23d8',
  134. targetNodeId: '49106603-2b88-4b2c-b1e8-723c1f2210bd',
  135. startPoint: {
  136. x: 400,
  137. y: 170,
  138. },
  139. endPoint: {
  140. x: 495,
  141. y: 170,
  142. },
  143. properties: {},
  144. pointsList: [
  145. {
  146. x: 400,
  147. y: 170,
  148. },
  149. {
  150. x: 495,
  151. y: 170,
  152. },
  153. ],
  154. },
  155. {
  156. id: '12bb443b-4070-4a08-ad4d-2755ee856f0d',
  157. type: 'polyline',
  158. sourceNodeId: '49106603-2b88-4b2c-b1e8-723c1f2210bd',
  159. targetNodeId: '647fa2bc-98ee-40cf-99c5-4756c0bc130d',
  160. startPoint: {
  161. x: 565,
  162. y: 170,
  163. },
  164. endPoint: {
  165. x: 655,
  166. y: 170,
  167. },
  168. properties: {},
  169. pointsList: [
  170. {
  171. x: 565,
  172. y: 170,
  173. },
  174. {
  175. x: 655,
  176. y: 170,
  177. },
  178. ],
  179. },
  180. {
  181. id: '33fa3c09-9c29-4cb7-8373-67d537b8b623',
  182. type: 'polyline',
  183. sourceNodeId: '647fa2bc-98ee-40cf-99c5-4756c0bc130d',
  184. targetNodeId: '37e7bac3-8804-4237-abe9-7b6065c207e9',
  185. startPoint: {
  186. x: 690,
  187. y: 205,
  188. },
  189. endPoint: {
  190. x: 690,
  191. y: 295,
  192. },
  193. properties: {},
  194. pointsList: [
  195. {
  196. x: 690,
  197. y: 205,
  198. },
  199. {
  200. x: 690,
  201. y: 295,
  202. },
  203. ],
  204. },
  205. {
  206. id: '2b5a5e89-005e-4fda-9a44-dc795050534f',
  207. type: 'polyline',
  208. sourceNodeId: '37e7bac3-8804-4237-abe9-7b6065c207e9',
  209. targetNodeId: '6bb4396f-54c9-4b1c-b34c-87ef004f2e29',
  210. startPoint: {
  211. x: 715,
  212. y: 320,
  213. },
  214. endPoint: {
  215. x: 805,
  216. y: 320,
  217. },
  218. properties: {},
  219. pointsList: [
  220. {
  221. x: 715,
  222. y: 320,
  223. },
  224. {
  225. x: 805,
  226. y: 320,
  227. },
  228. ],
  229. },
  230. {
  231. id: '62b54f8a-bcfd-494b-9144-5aeb09ca77a1',
  232. type: 'polyline',
  233. sourceNodeId: '6bb4396f-54c9-4b1c-b34c-87ef004f2e29',
  234. targetNodeId: 'b119f24f-2669-4a90-a837-afd853b2ffcc',
  235. startPoint: {
  236. x: 875,
  237. y: 320,
  238. },
  239. endPoint: {
  240. x: 970,
  241. y: 320,
  242. },
  243. properties: {},
  244. text: {
  245. x: 920,
  246. y: 310,
  247. value: 'Y',
  248. },
  249. pointsList: [
  250. {
  251. x: 875,
  252. y: 320,
  253. },
  254. {
  255. x: 970,
  256. y: 320,
  257. },
  258. ],
  259. },
  260. {
  261. id: 'ba816d4a-5785-4911-9f78-03933f1463a1',
  262. type: 'polyline',
  263. sourceNodeId: '6bb4396f-54c9-4b1c-b34c-87ef004f2e29',
  264. targetNodeId: 'abf76937-63b8-493c-a978-a4a58bc4f6b8',
  265. startPoint: {
  266. x: 840,
  267. y: 355,
  268. },
  269. endPoint: {
  270. x: 840,
  271. y: 435,
  272. },
  273. properties: {},
  274. text: {
  275. x: 850,
  276. y: 400,
  277. value: 'N',
  278. },
  279. pointsList: [
  280. {
  281. x: 840,
  282. y: 355,
  283. },
  284. {
  285. x: 840,
  286. y: 435,
  287. },
  288. ],
  289. },
  290. {
  291. id: '2b3007ed-7a13-4db7-a1ea-6691d7564c34',
  292. type: 'polyline',
  293. sourceNodeId: 'abf76937-63b8-493c-a978-a4a58bc4f6b8',
  294. targetNodeId: '60326ad9-cae2-4a85-ae98-d340fb7bd67f',
  295. startPoint: {
  296. x: 875,
  297. y: 470,
  298. },
  299. endPoint: {
  300. x: 970,
  301. y: 470,
  302. },
  303. properties: {},
  304. pointsList: [
  305. {
  306. x: 875,
  307. y: 470,
  308. },
  309. {
  310. x: 970,
  311. y: 470,
  312. },
  313. ],
  314. },
  315. {
  316. id: '262e2263-6c8c-4a38-b223-97848e9b5767',
  317. type: 'polyline',
  318. sourceNodeId: '647fa2bc-98ee-40cf-99c5-4756c0bc130d',
  319. targetNodeId: '414fe028-3609-4450-b0f4-e5aca7705e8c',
  320. startPoint: {
  321. x: 725,
  322. y: 170,
  323. },
  324. endPoint: {
  325. x: 835,
  326. y: 170,
  327. },
  328. properties: {},
  329. pointsList: [
  330. {
  331. x: 725,
  332. y: 170,
  333. },
  334. {
  335. x: 835,
  336. y: 170,
  337. },
  338. ],
  339. },
  340. ],
  341. }
  342. module.exports = [
  343. {
  344. url: '/workflow/getList',
  345. type: 'get',
  346. response: () => {
  347. return {
  348. code: 200,
  349. msg: 'success',
  350. data,
  351. }
  352. },
  353. },
  354. {
  355. url: '/workflow/doEdit',
  356. type: 'post',
  357. response: () => {
  358. return {
  359. code: 200,
  360. msg: '模拟保存成功',
  361. }
  362. },
  363. },
  364. ]