workflow.ts 6.9 KB

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