qgb-process 0.2.3 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (502) hide show
  1. package/.env +2 -2
  2. package/.env.development +70 -70
  3. package/.env.pre +60 -60
  4. package/.env.production +48 -48
  5. package/.env.test +48 -48
  6. package/.eslintignore +4 -4
  7. package/.eslintrc.js +302 -302
  8. package/README.md +66 -66
  9. package/babel.config.js +5 -5
  10. package/commitlint.config.js +30 -30
  11. package/config/dev.env.js +7 -7
  12. package/config/index.js +82 -82
  13. package/config/prod.env.js +4 -4
  14. package/debug.log +4 -4
  15. package/index.js +6 -6
  16. package/jsconfig.json +9 -9
  17. package/lib/qgb-process.common.js +7666 -5069
  18. package/lib/qgb-process.umd.js +7666 -5069
  19. package/lib/qgb-process.umd.min.js +108 -108
  20. package/package.json +148 -148
  21. package/packages/index.js +26 -26
  22. package/public/index.html +47 -47
  23. package/public/js/qykf.js +21 -21
  24. package/src/App.vue +37 -37
  25. package/src/api/ApiExAndapp.js +24 -24
  26. package/src/api/EnterpriseAssociation.js +8 -8
  27. package/src/api/Notice.js +31 -31
  28. package/src/api/apiAcceptance/apiAcceptance.js +37 -37
  29. package/src/api/apiAddress.js +9 -9
  30. package/src/api/apiApprovalConfig.js +13 -13
  31. package/src/api/apiApprove.js +18 -18
  32. package/src/api/apiArrears/apiArrears.js +41 -41
  33. package/src/api/apiArrears/apiProjectArrears.js +16 -16
  34. package/src/api/apiArrears/index.js +15 -15
  35. package/src/api/apiAssets.js +19 -19
  36. package/src/api/apiAssociate.js +42 -42
  37. package/src/api/apiAudit/apiAudit.js +32 -32
  38. package/src/api/apiAuth.js +25 -25
  39. package/src/api/apiAuthentication.js +35 -35
  40. package/src/api/apiBankAccount/index.js +12 -12
  41. package/src/api/apiBudget/apiBudget.js +30 -30
  42. package/src/api/apiBudget/apiBudgets.js +105 -105
  43. package/src/api/apiCarRecord.js +48 -48
  44. package/src/api/apiCart.js +202 -202
  45. package/src/api/apiChangeTel.js +13 -13
  46. package/src/api/apiCheckingIn.js +95 -95
  47. package/src/api/apiCollection/index.js +13 -13
  48. package/src/api/apiContract/apiContract.js +21 -21
  49. package/src/api/apiContract/index.js +3 -3
  50. package/src/api/apiContract/quill-config.js +122 -122
  51. package/src/api/apiContractManage/apiContractManage.js +57 -57
  52. package/src/api/apiContractManage/index.js +2 -2
  53. package/src/api/apiContractManage/quill-config.js +121 -121
  54. package/src/api/apiCoping.js +22 -22
  55. package/src/api/apiCost/index.js +31 -31
  56. package/src/api/apiCreditManagement.js +16 -16
  57. package/src/api/apiCustomer/apiCustomer.js +12 -12
  58. package/src/api/apiDivisional.js +9 -9
  59. package/src/api/apiDivisionalManagementList.js +17 -17
  60. package/src/api/apiEmployeeRegularization.js +73 -73
  61. package/src/api/apiEquipmentRental.js +50 -50
  62. package/src/api/apiFormBuilder/menu.js +65 -65
  63. package/src/api/apiFormBuilder/reissueRule.js +15 -15
  64. package/src/api/apiFund/index.js +16 -16
  65. package/src/api/apiHelp.js +43 -43
  66. package/src/api/apiHome.js +24 -24
  67. package/src/api/apiIminfo.js +39 -39
  68. package/src/api/apiInventory.js +52 -52
  69. package/src/api/apiInventorySetting.js +9 -9
  70. package/src/api/apiInvoice.js +29 -29
  71. package/src/api/apiJobManage.js +15 -15
  72. package/src/api/apiLease/apiLease.js +12 -12
  73. package/src/api/apiLogisticsTransportation/apiLogisticsTransportation.js +34 -34
  74. package/src/api/apiLostPassword.js +9 -9
  75. package/src/api/apiMachine/api.js +3 -3
  76. package/src/api/apiMachine/apiCategory.js +18 -18
  77. package/src/api/apiMachine/apiHire.js +19 -19
  78. package/src/api/apiMachine/apiLease.js +27 -27
  79. package/src/api/apiMachine/apiLocation.js +4 -4
  80. package/src/api/apiMachine/apiRentInfo.js +107 -107
  81. package/src/api/apiMachine/apiRentPublish.js +14 -14
  82. package/src/api/apiMachine/apiStore.js +15 -15
  83. package/src/api/apiMachine/index.js +3 -3
  84. package/src/api/apiManagementStore/api.js +3 -3
  85. package/src/api/apiManagementStore/apiManagementStore.js +25 -25
  86. package/src/api/apiMaterCheckAndAccept/apiMaterCheckAndAccept.js +47 -47
  87. package/src/api/apiMaterCheckAndAccept/apiMechanicalSourcing.js +16 -16
  88. package/src/api/apiMaterCheckAndAccept/index.js +3 -3
  89. package/src/api/apiMaterials/aaaaaaaaaaaaaa.js +9 -9
  90. package/src/api/apiMaterials/api.js +3 -3
  91. package/src/api/apiMaterials/apiAddress.js +116 -116
  92. package/src/api/apiMaterials/apiBalanceData.js +188 -188
  93. package/src/api/apiMaterials/apiCommercialConcrete.js +36 -36
  94. package/src/api/apiMaterials/apiCommodity.js +70 -70
  95. package/src/api/apiMaterials/apiDownload.js +26 -26
  96. package/src/api/apiMaterials/apiHome.js +44 -44
  97. package/src/api/apiMaterials/apiItemBrand.js +9 -9
  98. package/src/api/apiMaterials/apiLogistics.js +72 -72
  99. package/src/api/apiMaterials/apiLogisticsReceipt.js +94 -94
  100. package/src/api/apiMaterials/apiMaterials.js +8 -8
  101. package/src/api/apiMaterials/apiMySalesOrder.js +21 -21
  102. package/src/api/apiMaterials/apiOfflineOrder.js +18 -18
  103. package/src/api/apiMaterials/apiOrder.js +183 -183
  104. package/src/api/apiMaterials/apiReceipt.js +45 -45
  105. package/src/api/apiMaterials/quill-config.js +122 -122
  106. package/src/api/apiMemberSelection.js +39 -39
  107. package/src/api/apiMessage.js +10 -10
  108. package/src/api/apiMock/mockOrder.js +98 -98
  109. package/src/api/apiMonthPlan/apiMonthPlan.js +47 -47
  110. package/src/api/apiMyBidding.js +8 -8
  111. package/src/api/apiMyMember/apiComInfo.js +17 -17
  112. package/src/api/apiMyMember/apiInviteJoin.js +24 -24
  113. package/src/api/apiMyMember/apiMember.js +24 -24
  114. package/src/api/apiMyMember/apiMemberApply.js +36 -36
  115. package/src/api/apiMyMember/apiMemberChance.js +40 -40
  116. package/src/api/apiOffer.js +40 -40
  117. package/src/api/apiOffice.js +19 -19
  118. package/src/api/apiPact.js +26 -26
  119. package/src/api/apiPassword.js +7 -7
  120. package/src/api/apiPay/apiPay.js +25 -25
  121. package/src/api/apiPaying.js +21 -21
  122. package/src/api/apiPayment/apiPayment.js +13 -13
  123. package/src/api/apiPayment/apiProjectPayment.js +13 -13
  124. package/src/api/apiPrint.js +23 -0
  125. package/src/api/apiProcess.js +65 -65
  126. package/src/api/apiProject/apiBaseList.js +29 -29
  127. package/src/api/apiProject/apiGoodsOffer.js +11 -11
  128. package/src/api/apiProject/apiInventory.js +116 -116
  129. package/src/api/apiProject/apiOfferOrder.js +12 -12
  130. package/src/api/apiProject/apiOfferQuery.js +18 -18
  131. package/src/api/apiProject/apiPlan.js +21 -21
  132. package/src/api/apiProject/apiProject.js +158 -158
  133. package/src/api/apiProjectProcurement/apiProjectProcurement.js +88 -88
  134. package/src/api/apiPurchase/apiPurchase.js +67 -67
  135. package/src/api/apiPurchaseApply.js +15 -15
  136. package/src/api/apiPurchasePay.js +16 -16
  137. package/src/api/apiRankManagement.js +24 -24
  138. package/src/api/apiRecruit.js +37 -37
  139. package/src/api/apiReimbursement/apiReimbursement.js +15 -15
  140. package/src/api/apiRisk/index.js +11 -11
  141. package/src/api/apiRoleManagement.js +15 -15
  142. package/src/api/apiRules/apiRules.js +11 -11
  143. package/src/api/apiSchedule/apiSchedule.js +17 -17
  144. package/src/api/apiSealRecord.js +52 -52
  145. package/src/api/apiSign.js +8 -8
  146. package/src/api/apiSolution/apiSolution.js +9 -9
  147. package/src/api/apiSubcontract.js +35 -35
  148. package/src/api/apiSystem/index.js +40 -40
  149. package/src/api/apiTask.js +76 -76
  150. package/src/api/apiTeam/api.js +3 -3
  151. package/src/api/apiTeam/apiUtils.js +11 -11
  152. package/src/api/apiTender.js +127 -127
  153. package/src/api/apiUser.js +24 -24
  154. package/src/api/apiUserEnterprise/api.js +3 -3
  155. package/src/api/apiUserEnterprise/apiUserEn.js +15 -15
  156. package/src/api/apiVolunteerTeam.js +11 -11
  157. package/src/api/apiWorkarea.js +33 -33
  158. package/src/api/apiXzqh.js +8 -8
  159. package/src/api/common/api.js +3 -3
  160. package/src/api/common/apiUtils.js +9 -9
  161. package/src/api/customer.js +21 -21
  162. package/src/api/evection.js +19 -19
  163. package/src/api/guide.js +9 -9
  164. package/src/api/sociaManageApi.js +30 -30
  165. package/src/assets/Area.json +1773 -1773
  166. package/src/assets/css/quill.bubble.css +952 -952
  167. package/src/assets/css/quill.core.css +397 -397
  168. package/src/assets/css/quill.snow.css +945 -945
  169. package/src/assets/data.js +284 -284
  170. package/src/assets/fonts/Read Me.txt +7 -7
  171. package/src/assets/fonts/demo-files/demo.css +155 -155
  172. package/src/assets/fonts/demo-files/demo.js +30 -30
  173. package/src/assets/fonts/demo.html +951 -951
  174. package/src/assets/fonts/fonts/icomoon.svg +130 -130
  175. package/src/assets/fonts/style.css +563 -563
  176. package/src/assets/icons/checkbox.svg +12 -12
  177. package/src/assets/icons/columns-3.svg +12 -12
  178. package/src/assets/icons/columns.svg +12 -12
  179. package/src/assets/icons/custom-table.svg +12 -12
  180. package/src/assets/icons/date.svg +19 -19
  181. package/src/assets/icons/daterange.svg +12 -12
  182. package/src/assets/icons/fuzhi.svg +11 -11
  183. package/src/assets/icons/fuzhi_03.svg +5 -5
  184. package/src/assets/icons/gaojizujian.svg +12 -12
  185. package/src/assets/icons/groupSummary.svg +12 -12
  186. package/src/assets/icons/groupTitle.svg +12 -12
  187. package/src/assets/icons/image-uploader.svg +12 -12
  188. package/src/assets/icons/input-number.svg +12 -12
  189. package/src/assets/icons/input.svg +12 -12
  190. package/src/assets/icons/quill-editor.svg +12 -12
  191. package/src/assets/icons/radio.svg +12 -12
  192. package/src/assets/icons/select.svg +12 -12
  193. package/src/assets/icons/switch.svg +12 -12
  194. package/src/assets/icons/textarea.svg +12 -12
  195. package/src/assets/icons/upload-file.svg +12 -12
  196. package/src/assets/marketplace.js +289 -289
  197. package/src/components/ComAduitNew.vue +477 -477
  198. package/src/components/CommonAduit.vue +512 -512
  199. package/src/components/CommonAduitNew.vue +906 -906
  200. package/src/components/CommonAduitNews.vue +753 -753
  201. package/src/components/CommonUEditer.vue +63 -63
  202. package/src/components/PersonCenter/Mess.vue +59 -59
  203. package/src/components/PersonCenter/Title.vue +80 -80
  204. package/src/components/SvgIcon.vue +57 -57
  205. package/src/components/XmCommonAduit.vue +761 -761
  206. package/src/components/feiyCommon.vue +713 -713
  207. package/src/components/form/card.js +5 -5
  208. package/src/components/form/chinese.js +6 -6
  209. package/src/components/form/chinessstring.js +5 -5
  210. package/src/components/form/hunhe.js +8 -8
  211. package/src/components/form/hunhecq.js +8 -8
  212. package/src/components/form/hunheh.js +8 -8
  213. package/src/components/form/num.js +12 -12
  214. package/src/components/form/numstring.js +5 -5
  215. package/src/components/form/user.js +7 -7
  216. package/src/components/form/validate.js +42 -42
  217. package/src/components/form/validcredit.js +5 -5
  218. package/src/components/fundCommonAduit.vue +661 -661
  219. package/src/components/public/BaseCustomTable.vue +71 -71
  220. package/src/components/public/BaseDialog.vue +144 -144
  221. package/src/components/public/BaseEmptyData.vue +73 -73
  222. package/src/components/public/BaseFormTitle.vue +39 -39
  223. package/src/components/public/BasePagination.vue +55 -55
  224. package/src/components/public/BaseRouter.vue +14 -14
  225. package/src/components/public/BaseUpload.vue +185 -185
  226. package/src/components/public/Bottom.vue +62 -62
  227. package/src/components/public/Footer.vue +412 -412
  228. package/src/components/public/Header.vue +30 -30
  229. package/src/components/public/LeftMenu.vue +170 -170
  230. package/src/components/public/MemberSelection coby.vue +444 -444
  231. package/src/components/public/MemberSelection.vue +487 -487
  232. package/src/components/public/NewLeftMenu.vue +418 -418
  233. package/src/components/public/PicturesPreview.vue +62 -62
  234. package/src/components/public/Popout.vue +147 -147
  235. package/src/components/public/TagLine.vue +353 -353
  236. package/src/components/public/components/BaseImageUploadDrag.vue +320 -320
  237. package/src/components/public/components/HeadBar.vue +315 -315
  238. package/src/components/public/components/MenuList.vue +110 -110
  239. package/src/components/public/components/NewHeadBar.vue +936 -936
  240. package/src/components/public/components/QuickGoods.vue +273 -273
  241. package/src/components/public/components/Search.vue +164 -164
  242. package/src/components/public/components/Userinfo.vue +383 -383
  243. package/src/components/utils/pdf.js +254 -254
  244. package/src/components/xmfyCommonAduit.vue +752 -752
  245. package/src/filters/index.js +619 -619
  246. package/src/fnc/arr.js +102 -102
  247. package/src/fnc/quill-config.js +121 -121
  248. package/src/fnc/unit.js +102 -102
  249. package/src/fnc/verify.js +187 -187
  250. package/src/fnc/verifyStatus.js +24 -24
  251. package/src/formBuilder/apiBusiness.js +67 -67
  252. package/src/formBuilder/business.js +1039 -1039
  253. package/src/formBuilder/component/components/data.js +719 -719
  254. package/src/formBuilder/component/components/purchaseIndex.vue +1109 -1109
  255. package/src/formBuilder/component/purchase.vue +35 -35
  256. package/src/formBuilder/components/app-main/components/components/GroupSummary.vue +33 -33
  257. package/src/formBuilder/components/app-main/components/components/GroupTitle.vue +33 -33
  258. package/src/formBuilder/components/app-main/components/components/bank.vue +226 -226
  259. package/src/formBuilder/components/app-main/components/components/bankFormHeard.vue +298 -298
  260. package/src/formBuilder/components/app-main/components/components/builder.vue +718 -718
  261. package/src/formBuilder/components/app-main/components/components/columns.vue +393 -393
  262. package/src/formBuilder/components/app-main/components/components/customTable.vue +1758 -1758
  263. package/src/formBuilder/components/app-main/components/components/formDep.vue +105 -105
  264. package/src/formBuilder/components/app-main/components/components/handleCode.vue +39 -39
  265. package/src/formBuilder/components/app-main/components/components/itemOption.vue +116 -116
  266. package/src/formBuilder/components/app-main/components/components/linkForm.vue +116 -116
  267. package/src/formBuilder/components/app-main/components/components/listDesign.vue +772 -772
  268. package/src/formBuilder/components/app-main/components/components/optionSolt.js +78 -78
  269. package/src/formBuilder/components/app-main/components/components/person.vue +104 -104
  270. package/src/formBuilder/components/app-main/components/components/postman.vue +40 -40
  271. package/src/formBuilder/components/app-main/components/components/previewDialog.vue +391 -391
  272. package/src/formBuilder/components/app-main/components/components/tableIndex.vue +51 -51
  273. package/src/formBuilder/components/app-main/components/components/tableList.vue +561 -561
  274. package/src/formBuilder/components/app-main/components/components/twoColumns.vue +52 -52
  275. package/src/formBuilder/components/app-main/components/main-center.vue +187 -187
  276. package/src/formBuilder/components/app-main/components/main-header.vue +351 -351
  277. package/src/formBuilder/components/app-main/components/main-left.vue +179 -179
  278. package/src/formBuilder/components/app-main/components/main-right/components/components/calculateDialog.vue +914 -914
  279. package/src/formBuilder/components/app-main/components/main-right/components/components/curTextArea.vue +338 -338
  280. package/src/formBuilder/components/app-main/components/main-right/components/components/form-item-rules.vue +190 -190
  281. package/src/formBuilder/components/app-main/components/main-right/components/components/linkageDialog.vue +25 -25
  282. package/src/formBuilder/components/app-main/components/main-right/components/components/searchMixin.js +26 -26
  283. package/src/formBuilder/components/app-main/components/main-right/components/form-config.vue +284 -284
  284. package/src/formBuilder/components/app-main/components/main-right/components/form-item-attrs.vue +407 -407
  285. package/src/formBuilder/components/app-main/components/main-right/components/form-item-config.vue +478 -478
  286. package/src/formBuilder/components/app-main/components/main-right/index.vue +203 -203
  287. package/src/formBuilder/components/app-main/index.vue +329 -329
  288. package/src/formBuilder/comps.js +283 -283
  289. package/src/formBuilder/config/button.js +63 -63
  290. package/src/formBuilder/config/cascader-panel.js +224 -224
  291. package/src/formBuilder/config/cascader.js +306 -306
  292. package/src/formBuilder/config/checkbox.js +67 -67
  293. package/src/formBuilder/config/color.js +42 -42
  294. package/src/formBuilder/config/columns.js +30 -30
  295. package/src/formBuilder/config/custom-table.js +49 -49
  296. package/src/formBuilder/config/date.js +107 -107
  297. package/src/formBuilder/config/daterange.js +47 -47
  298. package/src/formBuilder/config/datetime.js +78 -78
  299. package/src/formBuilder/config/datetimerange.js +111 -111
  300. package/src/formBuilder/config/formDep.js +37 -37
  301. package/src/formBuilder/config/groupSummary.js +23 -23
  302. package/src/formBuilder/config/groupTitle.js +23 -23
  303. package/src/formBuilder/config/handleCode.js +23 -23
  304. package/src/formBuilder/config/image-uploader.js +113 -113
  305. package/src/formBuilder/config/input.js +162 -162
  306. package/src/formBuilder/config/json-editor.js +31 -31
  307. package/src/formBuilder/config/linkForm.js +69 -69
  308. package/src/formBuilder/config/number.js +49 -49
  309. package/src/formBuilder/config/password.js +82 -82
  310. package/src/formBuilder/config/person.js +37 -37
  311. package/src/formBuilder/config/postman.js +23 -23
  312. package/src/formBuilder/config/purchase.js +19 -19
  313. package/src/formBuilder/config/quill-editor.js +66 -66
  314. package/src/formBuilder/config/radio-button.js +44 -44
  315. package/src/formBuilder/config/radio.js +69 -69
  316. package/src/formBuilder/config/rate.js +93 -93
  317. package/src/formBuilder/config/select.js +105 -105
  318. package/src/formBuilder/config/slider.js +92 -92
  319. package/src/formBuilder/config/switch.js +35 -35
  320. package/src/formBuilder/config/tag.js +79 -79
  321. package/src/formBuilder/config/text.js +18 -18
  322. package/src/formBuilder/config/textarea.js +129 -129
  323. package/src/formBuilder/config/time.js +60 -60
  324. package/src/formBuilder/config/timerange.js +94 -94
  325. package/src/formBuilder/config/tree-select.js +100 -100
  326. package/src/formBuilder/config/upload-file.js +100 -100
  327. package/src/formBuilder/config/yesno.js +39 -39
  328. package/src/formBuilder/config.js +16 -16
  329. package/src/formBuilder/extend/index.js +20 -20
  330. package/src/formBuilder/index.js +39 -39
  331. package/src/formBuilder/menuConfig.js +36 -36
  332. package/src/formBuilder/mixins/index.js +215 -215
  333. package/src/formBuilder/tool.js +101 -101
  334. package/src/function/base.js +13 -13
  335. package/src/function/findCompanyTree.js +94 -94
  336. package/src/function/formulaAnalysis.js +44 -44
  337. package/src/function/verify.js +23 -23
  338. package/src/http/index.js +219 -219
  339. package/src/http/type.js +82 -82
  340. package/src/library/AddType/Index.js +17 -17
  341. package/src/library/AddType/Index.vue +201 -201
  342. package/src/library/AreaChange/regionCascader/regionCascader.vue +155 -155
  343. package/src/library/BigImg/BigImage1/Index.js +17 -17
  344. package/src/library/BigImg/BigImage1/Index.vue +125 -125
  345. package/src/library/Button/Button1/Index.js +17 -17
  346. package/src/library/Button/Button1/Index.vue +60 -60
  347. package/src/library/Button/Button2/Index.js +17 -17
  348. package/src/library/Button/Button2/Index.vue +52 -52
  349. package/src/library/Button/Button3/Index.js +17 -17
  350. package/src/library/Button/Button3/Index.vue +56 -56
  351. package/src/library/Button/Button4/Index.js +17 -17
  352. package/src/library/Button/Button4/Index.vue +56 -56
  353. package/src/library/Button/Button5/Index.js +17 -17
  354. package/src/library/Button/Button5/Index.vue +55 -55
  355. package/src/library/Button/Button6/Index.js +17 -17
  356. package/src/library/Button/Button6/Index.vue +74 -74
  357. package/src/library/Button/Button7/Index.js +17 -17
  358. package/src/library/Button/Button7/Index.vue +56 -56
  359. package/src/library/ConfirmPlaugin/ConfirmPlaugin1/Index.js +17 -17
  360. package/src/library/ConfirmPlaugin/ConfirmPlaugin1/Index.vue +147 -147
  361. package/src/library/ConfirmPlaugin/ConfirmPlaugin2/Index.js +17 -17
  362. package/src/library/ConfirmPlaugin/ConfirmPlaugin2/Index.vue +137 -137
  363. package/src/library/ConfirmPlaugin/ConfirmPlaugin3/Index.vue +142 -142
  364. package/src/library/ConfirmPlaugin/ConfirmPlaugin4/Index.vue +141 -141
  365. package/src/library/ConfirmPlaugin/ConfirmPlaugin5/Index.vue +121 -121
  366. package/src/library/ConfirmPlaugin/ConfirmPlaugin6/Index.vue +142 -142
  367. package/src/library/Input/Input1/Index.js +17 -17
  368. package/src/library/Input/Input1/Index.vue +66 -66
  369. package/src/library/NoMessage/NoMessage0/Index.js +17 -17
  370. package/src/library/NoMessage/NoMessage0/Index.vue +60 -60
  371. package/src/library/NoMessage/NoMessage1/Index.js +17 -17
  372. package/src/library/NoMessage/NoMessage1/Index.vue +66 -66
  373. package/src/library/NoMessage/NoMessage2/Index.js +17 -17
  374. package/src/library/NoMessage/NoMessage2/Index.vue +66 -66
  375. package/src/library/Tab/Tab1/TabBox1/Index.vue +36 -36
  376. package/src/library/Tab/Tab1/TabInner1/Index.vue +70 -70
  377. package/src/library/Tab/Tab2/TabBox2/Index.vue +36 -36
  378. package/src/library/Tab/Tab2/TabInner2/Index.vue +66 -66
  379. package/src/library/Table/Table1/Td1/Index.js +17 -17
  380. package/src/library/Table/Table1/Td1/Index.vue +110 -110
  381. package/src/library/Table/Table1/Tr1/Index.js +17 -17
  382. package/src/library/Table/Table1/Tr1/Index.vue +53 -53
  383. package/src/library/Table/Table2/Td2/Index.js +17 -17
  384. package/src/library/Table/Table2/Td2/Index.vue +90 -90
  385. package/src/library/Table/Table2/Tr2/Index.js +17 -17
  386. package/src/library/Table/Table2/Tr2/Index.vue +66 -66
  387. package/src/library/Table/Table3/Td3/Index.js +17 -17
  388. package/src/library/Table/Table3/Td3/Index.vue +109 -109
  389. package/src/library/Table/Table3/Tr3/Index.js +17 -17
  390. package/src/library/Table/Table3/Tr3/Index.vue +128 -128
  391. package/src/library/Table/Table4/Td4/Index.js +17 -17
  392. package/src/library/Table/Table4/Td4/Index.vue +114 -114
  393. package/src/library/Table/Table4/Tr4/Index.js +17 -17
  394. package/src/library/Table/Table4/Tr4/Index.vue +53 -53
  395. package/src/library/Title/Title1/Index.js +17 -17
  396. package/src/library/Title/Title1/Index.vue +80 -80
  397. package/src/library/toast/Index.js +17 -17
  398. package/src/library/toast/Index.vue +86 -86
  399. package/src/main.js +161 -161
  400. package/src/mixins/Export2Excel.js +207 -207
  401. package/src/mixins/chartOption.js +110 -110
  402. package/src/mixins/companyMixins.js +84 -84
  403. package/src/mixins/quillOptions.js +15 -15
  404. package/src/mixins/validate/deviceManage.js +211 -211
  405. package/src/mixins/validate/systemConfig.js +117 -117
  406. package/src/mixins/validate/validate.js +25 -25
  407. package/src/public/apiUser/apiUser.js +10 -10
  408. package/src/public/areaFunction.js +26 -26
  409. package/src/public/link.js +91 -91
  410. package/src/public/stageData.js +495 -495
  411. package/src/public/topmenu.js +68 -68
  412. package/src/router/index.js +225 -225
  413. package/src/router/setting/BaseRoutes.js +1639 -1639
  414. package/src/router/setting/MenuDevMock.js +1570 -1570
  415. package/src/router/setting/modules/login.js +45 -45
  416. package/src/router/setting/noAuthRouter.js +109 -109
  417. package/src/router/setting/routes.js +55 -55
  418. package/src/static/css/flex.css +75 -75
  419. package/src/static/css/switch.scss +31 -31
  420. package/src/storage/cookies.js +37 -37
  421. package/src/storage/localStorage.js +36 -36
  422. package/src/storage/sessionStorage.js +25 -25
  423. package/src/store/formBuilder/formAttrDefault.js +28 -28
  424. package/src/store/formBuilder/index.js +40 -40
  425. package/src/store/index.js +553 -553
  426. package/src/styles/color.scss +24 -24
  427. package/src/styles/offer.scss +39 -39
  428. package/src/styles/s-reset.scss +52 -52
  429. package/src/styles/static-style.scss +797 -797
  430. package/src/styles/talent.scss +26 -26
  431. package/src/styles/variable.scss +69 -69
  432. package/src/styles/workflow/workflow.css +1308 -1308
  433. package/src/utils/TableFormTypeList.js +26 -26
  434. package/src/utils/allRouter.js +5579 -5579
  435. package/src/utils/auditUtil.js +535 -535
  436. package/src/utils/commonComponents.js +34 -34
  437. package/src/utils/commonFunc.js +213 -213
  438. package/src/utils/deepCopyArray.js +9 -9
  439. package/src/utils/dict.js +49 -49
  440. package/src/utils/directive.js +26 -26
  441. package/src/utils/emoji.js +16 -16
  442. package/src/utils/flator.js +18 -18
  443. package/src/utils/imMeeting.js +1180 -1180
  444. package/src/utils/index.js +105 -105
  445. package/src/utils/initRouter.js +94 -94
  446. package/src/utils/map.js +23 -23
  447. package/src/utils/passwordStrength.js +177 -177
  448. package/src/utils/style.js +30 -30
  449. package/src/utils/validate.js +30 -30
  450. package/src/views/404.vue +53 -53
  451. package/src/views/Login/Login.vue +50 -50
  452. package/src/views/Login/Passfind.vue +347 -347
  453. package/src/views/Login/Passfindnext.vue +146 -146
  454. package/src/views/Login/Sign.vue +55 -55
  455. package/src/views/Login/SignSuccessfully.vue +132 -132
  456. package/src/views/Login/appDownload.vue +224 -224
  457. package/src/views/Login/clientDownload.vue +201 -201
  458. package/src/views/Login/components/Background.vue +153 -153
  459. package/src/views/Login/components/FormLogin.vue +1001 -1001
  460. package/src/views/Login/components/FormPassFind.vue +395 -395
  461. package/src/views/Login/components/FormSign.vue +493 -493
  462. package/src/views/Login/components/Title.vue +301 -301
  463. package/src/views/Login/components/agreeMent.vue +111 -111
  464. package/src/views/Login/components/companysign.vue +1296 -1296
  465. package/src/views/Login/components/guideLogin.vue +984 -984
  466. package/src/views/formBuilder/components/addNode.vue +119 -119
  467. package/src/views/formBuilder/components/approverSelector.vue +493 -493
  468. package/src/views/formBuilder/components/baseRoute.vue +315 -315
  469. package/src/views/formBuilder/components/builderHeader.vue +106 -106
  470. package/src/views/formBuilder/components/conditionConfig.js +588 -588
  471. package/src/views/formBuilder/components/conditionNode.vue +191 -191
  472. package/src/views/formBuilder/components/dataDefault.js +147 -147
  473. package/src/views/formBuilder/components/depFormNode.vue +583 -583
  474. package/src/views/formBuilder/components/linkForm.vue +566 -566
  475. package/src/views/formBuilder/components/linkFormList.vue +821 -821
  476. package/src/views/formBuilder/components/menuConfig.vue +1752 -1752
  477. package/src/views/formBuilder/components/newNodeForm.vue +426 -426
  478. package/src/views/formBuilder/components/newsection.vue +424 -424
  479. package/src/views/formBuilder/components/nodeConditionConfig cody.vue +376 -376
  480. package/src/views/formBuilder/components/nodeConditionConfig.vue +603 -603
  481. package/src/views/formBuilder/components/nodeForm.vue +355 -355
  482. package/src/views/formBuilder/components/nodeMenu.vue +147 -147
  483. package/src/views/formBuilder/components/personNode.vue +566 -566
  484. package/src/views/formBuilder/components/planNode.vue +269 -269
  485. package/src/views/formBuilder/designListPage.vue +457 -457
  486. package/src/views/formBuilder/formDataDetail.vue +565 -565
  487. package/src/views/formBuilder/formGeneration.vue +904 -904
  488. package/src/views/formBuilder/index.vue +242 -242
  489. package/src/views/formBuilder/process-1.vue +976 -976
  490. package/src/views/formBuilder/process-2.vue +1323 -1323
  491. package/src/views/formBuilder/process.vue +662 -431
  492. package/src/views/formBuilder/processList.vue +877 -877
  493. package/src/views/formBuilder/service/ProcessBuilder.js +136 -136
  494. package/src/views/formBuilder/service/RsxzFieldCollection.js +199 -0
  495. package/src/views/formBuilder/workflow/addNode.vue +95 -95
  496. package/src/views/formBuilder/workflow/initData.js +205 -205
  497. package/src/views/formBuilder/workflow/nodeWrap.vue +731 -731
  498. package/src/views/guide.vue +227 -227
  499. package/src/views/guideIndex.vue +284 -284
  500. package/tests/unit/.eslintrc.js +5 -5
  501. package/tests/unit/example.spec.js +13 -13
  502. package/vue.config.js +287 -287
@@ -1,976 +1,976 @@
1
- <template>
2
- <div v-if="easyFlowVisible">
3
- <el-row>
4
- <el-col :span="24" class="right-plan">
5
- <div class="process-heard">
6
- <template v-if="$route.query.name">
7
- <div v-if="isEdit">
8
- <span class="process-title">{{name}}</span>
9
- <!-- <i class="el-icon-edit" @click.stop="isEdit = false; conName = name"></i> -->
10
- </div>
11
- <div v-else>
12
- <el-input autofocus v-model="conName" placeholder="请输入内容" @blur="changeName"></el-input>
13
- </div>
14
- </template>
15
- <div v-else></div>
16
- <div>
17
- <div class="switch">
18
- <span>是否开启审批: </span>
19
- <el-switch
20
- v-model="isFlg">
21
- </el-switch>
22
- </div>
23
- <el-button @click="cancal">取消</el-button>
24
- <el-button type="primary" @click="save">保存</el-button>
25
- </div>
26
- </div>
27
- <el-row>
28
- <!--画布-->
29
- <el-col :span="24">
30
- <div id="flowContainer" class="container">
31
- <template v-for="(node,index) in data.nodeList">
32
- <flow-node
33
- :key="index"
34
- :node="node"
35
- @deleteNode="deleteNode"
36
- @changeNodeSite="changeNodeSite"
37
- @nodeRightMenu="nodeRightMenu"
38
- @editNode="editNode"
39
- @showForm="showForm"
40
- @changeName="changeNodeName"
41
- ></flow-node>
42
- </template>
43
- <flow-node-condition :formData="connection" :title="title" @edit="editName" v-show="conditionVisible" @save="setCondition" @cancal="conditionVisible = false" ref="conditionForm"></flow-node-condition>
44
- <add-node-box v-if="showAddNode" :info="addNodeInfo" @close="()=>{showAddNode = false}" @addNode="addNode"></add-node-box>
45
- </div>
46
- </el-col>
47
- </el-row>
48
- </el-col>
49
- </el-row>
50
- <!-- 流程数据表单 -->
51
- <flow-node-form :formData="nodeInfo" v-if="nodeVisible" @close="nodeVisible = false" @save="setNode" ref="nodeForm"></flow-node-form>
52
- </div>
53
- </template>
54
-
55
- <script>
56
- // import draggable from "vuedraggable";
57
- import jsPlumb from "jsplumb";
58
- import flowNode from "./components/planNode";
59
- // import nodeMenu from "./components/nodeMenu";
60
- import FlowNodeForm from "./components/nodeForm";
61
- import FlowNodeCondition from "./components/nodeConditionConfig";
62
- import addNodeBox from "./components/addNode";
63
- import lodash from "lodash";
64
- import * as config from "./components/dataDefault";
65
- import * as api from "@/api/apiProcess";
66
-
67
- export default {
68
- data() {
69
- return {
70
- // jsPlumb 实例
71
- jsPlumb: null,
72
- easyFlowVisible: true,
73
- // 控制流程数据显示与隐藏
74
- flowInfoVisible: false,
75
- // 控制表单显示与隐藏
76
- nodeVisible: false,
77
- conditionVisible: false,
78
- loadEasyFlowFinish: false,
79
- // 数据
80
- data: {},
81
- maxId: 0,
82
- maxUserTask: 0,
83
- maxCondition: 0,
84
- activeNode: "",
85
- activeConditions: {},
86
- activeLine: {
87
- sourceId: "",
88
- targetId: "",
89
- isCondition: false
90
- },
91
- connection: {},
92
- title: "",
93
- nodeInfo: {},
94
- isEdit: true,
95
- name: "",
96
- conName: "",
97
- desc: "",
98
- processId: "",
99
- isFlg: true,
100
- type: "",
101
- label: [
102
- "Label",
103
- {
104
- // 连接点的可配置标签
105
- location: 0.5,
106
- id: "label",
107
- label: "",
108
- cssClass: "aLabel",
109
- events: {
110
- click: (e, event) => {
111
- const label = e.getElement();
112
- const top = parseFloat(label.style.top) - 35;
113
- const left = parseFloat(label.style.left) + 30;
114
- this.showAddNode = true;
115
- this.addNodeInfo = {
116
- top: top,
117
- left: left
118
- };
119
- event.stopPropagation();
120
- }
121
- }
122
- }
123
- ],
124
- showAddNode: false,
125
- addNodeInfo: {
126
- top: "0",
127
- left: "0",
128
- isShwo: true
129
- }
130
- };
131
- },
132
- components: {
133
- flowNode,
134
- FlowNodeForm,
135
- FlowNodeCondition,
136
- addNodeBox
137
- },
138
- computed: {
139
- user() {
140
- return this.$store.state.user;
141
- }
142
- },
143
- created() {
144
- if (this.$route.query.type) {
145
- this.type = this.$route.query.type;
146
- } else if (this.$route.path == "/formBuilder") {
147
- this.type = "customForm_" + this.$store.state.formBuilder.formDesId;
148
- }
149
- },
150
- mounted() {
151
- this.$nextTick(async() => {
152
- // this.jsPlumb = jsPlumb.jsPlumb.getInstance();
153
- this.jsPlumb = jsPlumb.jsPlumb
154
- ? jsPlumb.jsPlumb.getInstance()
155
- : jsPlumb.getInstance();
156
- // 默认加载流程A的数据、在这里可以根据具体的业务返回符合流程数据格式的数据即可
157
- const id = this.$route.params.id;
158
- if (id) {
159
- // this.processId = this.$route.params.id
160
- this.processId = "5e7af90cf7b2ed3ef17c4216";
161
- const res = await api.getProcessDetail({
162
- id: "5e7af90cf7b2ed3ef17c4216"
163
- });
164
- if (res.data.state == "ok") {
165
- this.processId = res.data.data._id;
166
- const content = JSON.parse(res.data.data.content);
167
- this.data = {
168
- nodeList: content.nodeList,
169
- lineList: content.lineList
170
- };
171
- this.$nextTick(() => {
172
- // this.jsPlumb = jsPlumb.jsPlumb.getInstance();
173
- this.jsPlumb = jsPlumb.jsPlumb
174
- ? jsPlumb.jsPlumb.getInstance()
175
- : jsPlumb.getInstance();
176
- this.$nextTick(() => {
177
- this.jsPlumbInit();
178
- });
179
- });
180
- }
181
- } else {
182
- // this.dataReload(config.dataDefault)
183
- this.queryProcessByCompanyAndUser();
184
- }
185
- });
186
- },
187
- methods: {
188
- // 修改题目
189
- changeName() {
190
- if (this.conName) {
191
- this.name = this.conName;
192
- } else {
193
- this.conName = this.name;
194
- }
195
- this.isEdit = true;
196
- },
197
- // 设置节点条件
198
- setCondition(data) {
199
- const conditions = Object.entries(data.form).map(([key, val]) => {
200
- if (Array.isArray(val.value)) {
201
- return {
202
- ...val,
203
- variable: key,
204
- value: val.value.join(","),
205
- opt: "=",
206
- isArray: true
207
- };
208
- } else {
209
- return {
210
- ...val,
211
- variable: key,
212
- isArray: false
213
- };
214
- }
215
- });
216
- this.data.nodeList.forEach((item, index) => {
217
- if (item.id == this.activeNode) {
218
- item.conditions = conditions;
219
- item.desc = data.desc.join(" 并且 ");
220
- }
221
- });
222
- this.conditionVisible = false;
223
- },
224
- // 设置节点信息
225
- setNode(data) {
226
- // this.data
227
- this.data.nodeList.forEach((item, index) => {
228
- if (item.id == this.activeNode) {
229
- item.approverType = data.approverType;
230
- item.approvers = data.approvers;
231
- item.notifiers = data.notifiers;
232
- }
233
- });
234
- },
235
- // 点击节点事件
236
- showForm(node) {
237
- this.activeNode = node.id;
238
- if (node.type == "condition") {
239
- this.conditionVisible = true;
240
- let condition = this.data.nodeList.filter((item, index) => {
241
- return item.id == node.id;
242
- });
243
- condition = lodash.cloneDeep(condition);
244
- const json = {};
245
- condition[0].conditions.forEach((item, index) => {
246
- if (item.isArray) {
247
- item.value = item.value.split(",");
248
- }
249
- json[item.variable] = item;
250
- });
251
- this.connection = json;
252
- this.title = node.name;
253
- } else if (node.type == "userTask") {
254
- const nodeInfo = this.data.nodeList.filter((item, index) => {
255
- return item.id == node.id;
256
- });
257
- const json = {
258
- approverType: nodeInfo[0].approverType || "",
259
- approvers: nodeInfo[0].approvers || [],
260
- notifiers: nodeInfo[0].notifiers || []
261
- };
262
- this.nodeInfo = json;
263
- this.nodeVisible = true;
264
- }
265
- },
266
- // 修改条件名称
267
- editName(data) {
268
- this.title = data;
269
- this.data.nodeList.forEach((item, index) => {
270
- if (item.id == this.activeNode) {
271
- item.name = data;
272
- }
273
- });
274
- },
275
- // 初始化数据
276
- jsPlumbInit() {
277
- const _this = this;
278
- this.jsPlumb.ready(() => {
279
- // 导入默认配置
280
- const defaultConfig = _.cloneDeep(config.DefaultConfig);
281
- defaultConfig.ConnectionOverlays.push(this.label);
282
- this.jsPlumb.importDefaults(defaultConfig);
283
- // 会使整个jsPlumb立即重绘。
284
- this.jsPlumb.setSuspendDrawing(false, true);
285
- // 初始化节点
286
- this.loadEasyFlow();
287
- // 单点击了连接线,
288
- this.jsPlumb.bind("click", (conn, originalEvent) => {
289
- const endSource = conn.endpoints[0].getUuid();
290
- const endTarget = conn.endpoints[1].getUuid();
291
- const sourceId = conn.sourceId.substring(15);
292
- const targetId = conn.targetId.substring(15);
293
- this.activeLine.sourceId = sourceId;
294
- this.activeLine.targetId = targetId;
295
- this.activeLine.sourceUUid =
296
- endSource.indexOf("BottomCenter") > -1
297
- ? "BottomCenter"
298
- : "RightMiddle";
299
- this.activeLine.targetUUid =
300
- endTarget.indexOf("TopCenter") > -1 ? "TopCenter" : "RightMiddle";
301
- this.addNodeInfo.isShow = true;
302
- this.activeLine.isCondition = false;
303
- this.data.nodeList.forEach((item) => {
304
- if (
305
- (item.id == sourceId || item.id == targetId) &&
306
- item.type == "condition"
307
- ) {
308
- this.addNodeInfo.isShow = false;
309
- }
310
- if (item.id == sourceId && item.type == "condition") {
311
- this.activeLine.isCondition = true;
312
- }
313
- });
314
- });
315
- // 连线
316
- this.jsPlumb.bind("connection", (evt) => {
317
- const from = evt.sourceId;
318
- const to = evt.targetId;
319
- const nodeFrom = evt.sourceId.substring(15);
320
- const nodeTo = evt.targetId.substring(15);
321
- const uuid0 = evt.connection.endpoints[0].getUuid();
322
- const uuid1 = evt.connection.endpoints[1].getUuid();
323
- if (this.loadEasyFlowFinish) {
324
- const line = {
325
- sourceId: from,
326
- targetId: to,
327
- nodeFrom: nodeFrom,
328
- nodeTo: nodeTo,
329
- condName: "",
330
- uuid0: uuid0,
331
- uuid1: uuid1
332
- };
333
- this.data.nodeList.forEach((item, index) => {
334
- if (
335
- item.id == nodeFrom &&
336
- evt.sourceEndpoint.anchor.type == "RightMiddle"
337
- ) {
338
- item.ifNo = nodeTo;
339
- } else if (item.id == nodeFrom) {
340
- item.to = nodeTo;
341
- }
342
- if (item.id == nodeTo) {
343
- item.from = nodeFrom;
344
- }
345
- });
346
- this.data.lineList.push(line);
347
- }
348
- });
349
-
350
- // 删除连线回调
351
- this.jsPlumb.bind("connectionDetached", (evt) => {
352
- this.deleteLine(evt.sourceId, evt.targetId, evt);
353
- });
354
-
355
- // 改变线的连接节点
356
- this.jsPlumb.bind("connectionMoved", (evt) => {
357
- this.changeLine(evt.originalSourceId, evt.originalTargetId);
358
- });
359
-
360
- // contextmenu
361
- this.jsPlumb.bind("contextmenu", (evt) => {
362
- // console.log("contextmenu", evt);
363
- });
364
-
365
- // 连线
366
- this.jsPlumb.bind("beforeDrop", (evt) => {
367
- const from = evt.sourceId;
368
- const to = evt.targetId;
369
- if (from === to) {
370
- this.$message.error("不能连接自己");
371
- return false;
372
- }
373
- if (this.hasLine(from, to)) {
374
- this.$message.error("不能重复连线");
375
- return false;
376
- }
377
- if (this.hashOppositeLine(from, to)) {
378
- this.$message.error("不能回环");
379
- return false;
380
- }
381
- return true;
382
- });
383
-
384
- // beforeDetach
385
- this.jsPlumb.bind("beforeDetach", (evt) => {
386
- this.deleteLine(evt.sourceId, evt.targetId);
387
- });
388
- });
389
- },
390
- // 加载流程图
391
- loadEasyFlow() {
392
- // 初始化节点
393
- const _this = this;
394
- this.maxId = 0;
395
- this.maxUserTask = 1;
396
- this.maxCondition = 0;
397
- for (let i = 0; i < this.data.nodeList.length; i++) {
398
- const node = this.data.nodeList[i];
399
- _this.maxId =
400
- parseFloat(node.id) > parseFloat(_this.maxId)
401
- ? parseFloat(node.id)
402
- : _this.maxId;
403
-
404
- if (node.type == "start") {
405
- _this._addEndpoints("Window" + node.id + "", ["BottomCenter"], []);
406
- } else if (node.type == "end") {
407
- _this._addEndpoints(
408
- "Window" + node.id + "",
409
- [],
410
- ["TopCenter", "LeftMiddle", "RightMiddle"]
411
- );
412
- } else if (node.type == "condition") {
413
- const sort = node.name.substring(4);
414
- _this.maxCondition =
415
- parseFloat(sort) > parseFloat(_this.maxCondition)
416
- ? parseFloat(sort)
417
- : _this.maxCondition;
418
- _this._addEndpoints(
419
- "Window" + node.id + "",
420
- ["BottomCenter", "RightMiddle"],
421
- ["TopCenter"]
422
- );
423
- } else {
424
- const sort2 = node.name.substring(4);
425
- _this.maxUserTask =
426
- parseFloat(sort2) > parseFloat(_this.maxUserTask)
427
- ? parseFloat(sort2)
428
- : _this.maxUserTask;
429
- _this._addEndpoints(
430
- "Window" + node.id + "",
431
- ["BottomCenter"],
432
- ["TopCenter"]
433
- );
434
- }
435
- _this.jsPlumb.draggable("flowchartWindow" + node.id, {
436
- grid: [20, 20]
437
- });
438
- }
439
-
440
- // 初始化连线
441
- for (let i = 0; i < this.data.lineList.length; i++) {
442
- const line = this.data.lineList[i];
443
- _this.jsPlumb.connect({ uuids: [line.uuid0, line.uuid1] });
444
- }
445
- this.$nextTick(function() {
446
- this.loadEasyFlowFinish = true;
447
- });
448
- },
449
- // 删除线
450
- deleteLine(from, to, evt) {
451
- const _this = this;
452
- const fromId = from.substring(15);
453
- const toId = to.substring(15);
454
- this.data.lineList = this.data.lineList.filter(function(line) {
455
- if (line.sourceId == from && line.targetId == to) {
456
- return false;
457
- }
458
- return true;
459
- });
460
- },
461
- // 改变连线
462
- changeLine(oldFrom, oldTo) {
463
- this.deleteLine(oldFrom, oldTo);
464
- },
465
- // 改变节点的位置
466
- changeNodeSite(data) {
467
- for (var i = 0; i < this.data.nodeList.length; i++) {
468
- const node = this.data.nodeList[i];
469
- if (node.id === data.id) {
470
- node.left = data.left;
471
- node.top = data.top;
472
- }
473
- }
474
- },
475
- // 修改节点名称
476
- changeNodeName(data) {
477
- console.log(data);
478
- this.data.nodeList.forEach((item) => {
479
- if (item.id == data.id) {
480
- item.name = data.name;
481
- }
482
- });
483
- },
484
- /**
485
- * 拖拽结束后添加新的节点
486
- * @param evt
487
- * @param nodeMenu 被添加的节点对象
488
- * @param mousePosition 鼠标拖拽结束的坐标
489
- */
490
- addNode(nodeMenu) {
491
- this.showAddNode = false;
492
- const nodeId = this.maxId + 1;
493
- let left, top, from, to;
494
- let nextTo = this.activeLine.targetId;
495
- let fromNode;
496
- let frist = true;
497
- let isRight = false;
498
- let oldTop = "";
499
- // 循环修改下面节点的位置
500
- while (nextTo !== "end") {
501
- this.data.nodeList.forEach((item) => {
502
- // 添加ifNo下添加节点
503
- if (
504
- frist &&
505
- item.id == this.activeLine.sourceId &&
506
- this.activeLine.isCondition
507
- ) {
508
- frist = false;
509
- if (this.activeLine.sourceUUid == "RightMiddle") {
510
- left = parseFloat(item.left) + 300 + "px";
511
- top = parseFloat(item.top) + 170 + "px";
512
- nextTo = item.ifNo == "5" ? "end" : item.ifNo;
513
- isRight = true;
514
- } else {
515
- const nodeInfo = this.data.nodeList.filter(
516
- (i) => i.id == this.activeLine.sourceId
517
- );
518
- left = nodeInfo[0].left;
519
- top = parseFloat(nodeInfo[0].top) + 170 + "px";
520
- nextTo = item.to;
521
- }
522
- oldTop = top;
523
- }
524
- // 普通添加
525
- if (frist && item.id == nextTo && !this.activeLine.isCondition) {
526
- frist = false;
527
- const nodeInfo = this.data.nodeList.filter(
528
- (i) => i.id == this.activeLine.sourceId
529
- );
530
- left = nodeInfo[0].left;
531
- top = parseFloat(nodeInfo[0].top) + 170 + "px";
532
- oldTop = top;
533
- }
534
- if (item.id == nextTo) {
535
- item.top =
536
- parseFloat(item.top) - parseFloat(oldTop) < 170
537
- ? parseFloat(item.top) + 170 + "px"
538
- : item.top;
539
- oldTop = item.top;
540
- nextTo = item.to;
541
- return;
542
- }
543
- });
544
- }
545
- // 修改新增上下节点from to
546
- this.data.nodeList.forEach((item, index) => {
547
- if (
548
- item.id == this.activeLine.sourceId &&
549
- !this.activeLine.isCondition
550
- ) {
551
- from = item.id;
552
- item.to = nodeId;
553
- }
554
- if (
555
- item.id == this.activeLine.sourceId &&
556
- this.activeLine.isCondition
557
- ) {
558
- from = item.id;
559
- if (this.activeLine.sourceUUid == "RightMiddle") {
560
- item.ifNo = nodeId;
561
- } else {
562
- item.to = nodeId;
563
- }
564
- }
565
- if (item.id == this.activeLine.targetId) {
566
- to = item.id;
567
- item.from = nodeId;
568
- }
569
- });
570
- // 添加新节点
571
- const sort =
572
- nodeMenu.type == "condition"
573
- ? this.maxCondition + 1
574
- : this.maxUserTask + 1;
575
- const node = {
576
- id: nodeId,
577
- type: nodeMenu.type,
578
- name: nodeMenu.name + sort,
579
- left: left,
580
- top: top,
581
- from: from,
582
- to: to
583
- };
584
- if (nodeMenu.type == "condition") {
585
- node.conditions = [];
586
- node.ifNo = "5"; // 连接到结束
587
- node.desc = "";
588
- this.maxCondition = sort;
589
- // 条件节点新增连接到结束的连线
590
- this.data.lineList.push({
591
- nodeFrom: nodeId,
592
- nodeTo: "5",
593
- sourceId: "flowchartWindow" + nodeId,
594
- targetId: "flowchartWindow5",
595
- uuid0: "Window" + nodeId + "RightMiddle",
596
- uuid1: "Window5RightMiddle"
597
- });
598
- } else if (nodeMenu.type == "userTask") {
599
- node.approverType = "";
600
- node.approvers = [];
601
- node.notifiers = [];
602
- this.maxUserTask = sort;
603
- }
604
- this.data.nodeList.push(node);
605
- // 添加新增连线
606
- this.data.lineList.forEach((item, index) => {
607
- if (
608
- item.nodeFrom == this.activeLine.sourceId &&
609
- item.nodeTo == this.activeLine.targetId &&
610
- item.uuid0.indexOf(this.activeLine.sourceUUid) > -1 &&
611
- item.uuid1.indexOf(this.activeLine.targetUUid) > -1
612
- ) {
613
- this.data.lineList.splice(index, 1);
614
- }
615
- });
616
- this.data.lineList.push({
617
- nodeFrom: this.activeLine.sourceId,
618
- nodeTo: nodeId,
619
- sourceId: "flowchartWindow" + this.activeLine.sourceId,
620
- targetId: "flowchartWindow" + nodeId,
621
- uuid0: "Window" + this.activeLine.sourceId + this.activeLine.sourceUUid,
622
- uuid1: "Window" + nodeId + "TopCenter"
623
- });
624
- this.data.lineList.push({
625
- nodeFrom: nodeId,
626
- nodeTo: this.activeLine.targetId,
627
- sourceId: "flowchartWindow" + nodeId,
628
- targetId: "flowchartWindow" + this.activeLine.targetId,
629
- uuid0: "Window" + nodeId + "BottomCenter",
630
- uuid1: "Window" + this.activeLine.targetId + this.activeLine.targetUUid
631
- });
632
- this.maxId = nodeId;
633
- const _this = this;
634
- this.dataReload({
635
- nodeList: this.data.nodeList,
636
- lineList: this.data.lineList
637
- });
638
- },
639
- /**
640
- * 删除节点
641
- * @param nodeId 被删除节点的ID
642
- */
643
- deleteNode(nodeId, type) {
644
- console.log(nodeId, type);
645
- const _this = this;
646
- const userTasknode = this.data.nodeList.filter(
647
- (item) => item.type == "userTask"
648
- );
649
- if (userTasknode.length < 2 && type == "userTask") {
650
- this.$message.error("至少保留一个流程节点");
651
- return;
652
- }
653
- this.$confirm("确定要删除节点" + nodeId + "?", "提示", {
654
- confirmButtonText: "确定",
655
- cancelButtonText: "取消",
656
- type: "warning",
657
- closeOnClickModal: false
658
- })
659
- .then(() => {
660
- this.jsPlumb.removeAllEndpoints("flowchartWindow" + nodeId);
661
- this.$nextTick(function() {
662
- this.jsPlumb.remove("flowchartWindow" + nodeId);
663
- var list = [];
664
- const nodeInfo = this.data.nodeList.filter(
665
- (item) => item.id == nodeId
666
- );
667
- const fromId = nodeInfo[0].from;
668
- const toId = nodeInfo[0].to;
669
- var nextTo = nodeInfo[0].to;
670
- let ifNo = false;
671
- // 循环修改下面节点的位置
672
- while (nextTo !== "end" && nextTo) {
673
- this.data.nodeList.forEach((item) => {
674
- if (item.id == nextTo) {
675
- item.top =
676
- nextTo != 5 ? parseFloat(item.top) - 170 + "px" : item.top;
677
- nextTo = item.to;
678
- }
679
- });
680
- }
681
- this.data.nodeList.forEach((item, index) => {
682
- if (item.id == fromId && item.to == nodeId) {
683
- item.to = toId;
684
- }
685
- if (item.id == fromId && item.ifNo == nodeId) {
686
- item.ifNo = toId;
687
- ifNo = true;
688
- }
689
- if (item.id == toId) {
690
- item.from = fromId;
691
- }
692
- if (item.id !== nodeId) {
693
- list.push(item);
694
- }
695
- });
696
- // 删除条件分支
697
- if (nodeInfo[0].type == "condition") {
698
- list = this.removeCondition(nodeInfo[0], list);
699
- }
700
- const fromLocal = ifNo ? "RightMiddle" : "BottomCenter";
701
- const toLocal =
702
- toId == 5 &&
703
- parseFloat(nodeInfo[0].left) >
704
- document.getElementById("flowchartWindow5").offsetLeft
705
- ? "RightMiddle"
706
- : "TopCenter";
707
- this.data.lineList.push({
708
- nodeFrom: fromId,
709
- nodeTo: toId,
710
- sourceId: "flowchartWindow" + fromId,
711
- targetId: "flowchartWindow" + toId,
712
- uuid0: "Window" + fromId + fromLocal,
713
- uuid1: "Window" + toId + toLocal
714
- });
715
- this.dataReload({ nodeList: list, lineList: this.data.lineList });
716
- });
717
- })
718
- .catch((err) => {});
719
- return true;
720
- },
721
- removeCondition(nodeInfo, list) {
722
- const _this = this;
723
- var arr = [];
724
- var removeId = nodeInfo.ifNo;
725
- while (removeId != 5 && removeId) {
726
- arr.push(removeId);
727
- var removeNode = _this.data.nodeList.filter((i) => i.id == removeId);
728
- removeId = removeNode[0].to;
729
- if (removeNode[0].type == "condition") {
730
- _this.removeCondition(removeNode[0], list);
731
- }
732
- }
733
- list = list.filter((no) => arr.indexOf(no.id) == -1);
734
- arr.forEach((item, index, a) => {
735
- var removeA = a[index];
736
- var removeB = a[index + 1] || "5";
737
- if (removeA && removeB) {
738
- _this.data.lineList = _this.data.lineList.filter(
739
- (line) => !(line.nodeFrom == removeA && line.nodeTo == removeB)
740
- );
741
- }
742
- });
743
- return list;
744
- },
745
- /**
746
- * 编辑节点
747
- * @param nodeId 被点击编辑的节点的ID
748
- */
749
- editNode(nodeId) {
750
- this.nodeFormVisible = true;
751
- this.$nextTick(function() {
752
- this.$refs.nodeForm.init(this.data, nodeId);
753
- });
754
- },
755
- // 是否具有该线
756
- hasLine(from, to) {
757
- for (var i = 0; i < this.data.lineList.length; i++) {
758
- var line = this.data.lineList[i];
759
- if (line.from === from && line.to === to) {
760
- return true;
761
- }
762
- }
763
- return false;
764
- },
765
- // 是否含有相反的线
766
- hashOppositeLine(from, to) {
767
- return this.hasLine(to, from);
768
- },
769
- nodeRightMenu(nodeId, evt) {
770
- this.menu.show = true;
771
- this.menu.curNodeId = nodeId;
772
- this.menu.left = evt.x + "px";
773
- this.menu.top = evt.y + "px";
774
- },
775
- // 加载流程图
776
- dataReload(data) {
777
- this.easyFlowVisible = false;
778
- this.data.nodeList = [];
779
- this.data.lineList = [];
780
- this.$nextTick(() => {
781
- data = lodash.cloneDeep(data);
782
- this.easyFlowVisible = true;
783
- this.data = data;
784
- this.$nextTick(() => {
785
- // this.jsPlumb = jsPlumb.jsPlumb.getInstance();
786
- this.jsPlumb = jsPlumb.jsPlumb
787
- ? jsPlumb.jsPlumb.getInstance()
788
- : jsPlumb.getInstance();
789
- this.$nextTick(() => {
790
- this.jsPlumbInit();
791
- });
792
- });
793
- });
794
- },
795
- _addEndpoints(toId, sourceAnchors, targetAnchors) {
796
- for (var i = 0; i < sourceAnchors.length; i++) {
797
- var sourceUUID = toId + sourceAnchors[i];
798
- this.jsPlumb.addEndpoint("flowchart" + toId, config.sourceEndpoint, {
799
- anchor: sourceAnchors[i],
800
- uuid: sourceUUID
801
- });
802
- }
803
- for (var j = 0; j < targetAnchors.length; j++) {
804
- var targetUUID = toId + targetAnchors[j];
805
- this.jsPlumb.addEndpoint("flowchart" + toId, config.targetEndpoint, {
806
- anchor: targetAnchors[j],
807
- uuid: targetUUID
808
- });
809
- }
810
- },
811
- // 保存
812
- async save() {
813
- const user = this.$store.state.user;
814
- let flg = false;
815
- if (this.type == "") return;
816
- this.data.nodeList.forEach((item) => {
817
- if (item.type == "condition" && item.ifNo == "") {
818
- this.$message.error(`条件节点: ${item.name} 没有闭合,请检查`);
819
- flg = true;
820
- return false;
821
- }
822
- if ((item.to == "" || item.from == "") && item.type != "end") {
823
- this.$message.error(`节点: ${item.name} 流程未闭合,请检查`);
824
- flg = true;
825
- return false;
826
- }
827
- if (
828
- item.type == "userTask" &&
829
- item.approvers.length < 1 &&
830
- item.notifiers.length < 1
831
- ) {
832
- this.$message.error(`节点: ${item.name} 申请人和抄送人不能为空`);
833
- flg = true;
834
- return false;
835
- }
836
- });
837
- if (flg) {
838
- return false;
839
- }
840
- const param = {
841
- name: this.name,
842
- desc: "",
843
- creator: user.no + "",
844
- processId: this.processId,
845
- startId: "1",
846
- endId: "5",
847
- companyId: user.cno + "",
848
- type: this.type,
849
- switchOn: this.isFlg ? "1" : "0",
850
- nodeList: this.data.nodeList,
851
- lineList: this.data.lineList
852
- };
853
- if (this.$route.path == "/formBuilder") {
854
- param.menuId = this.$store.state.formBuilder.menuId;
855
- }
856
- let res;
857
- if (this.processId) {
858
- const data = {
859
- id: this.processId + "",
860
- content: JSON.stringify(param)
861
- };
862
- res = await api.updateProcess(data);
863
- } else {
864
- const data = {
865
- content: JSON.stringify(param)
866
- };
867
- res = await api.saveProcess(data);
868
- }
869
- if (res.data.state == "ok") {
870
- this.$message.success({
871
- message: this.processId ? "编辑成功" : "保存成功",
872
- duration: 1500
873
- });
874
- this.processId = res.data.data;
875
- this.type.indexOf("customForm_") == -1 &&
876
- this.$removeTag("/processList");
877
- } else {
878
- this.$message.error({
879
- message: res.data.msg ? res.data.msg : "保存失败",
880
- duration: 1500
881
- });
882
- }
883
- },
884
- cancal() {
885
- this.$confirm("有修改的内容未保存,确认离开吗?", "提示", {
886
- confirmButtonText: "确定",
887
- cancelButtonText: "取消",
888
- type: "warning"
889
- })
890
- .then(() => {
891
- this.$removeTag("/processList");
892
- })
893
- .catch(() => {});
894
- },
895
- async queryProcessByCompanyAndUser() {
896
- const param = {
897
- userId: this.user.no + "",
898
- companyId: this.user.cno + "",
899
- type: this.type
900
- };
901
- const res = await api.queryProcessByCompanyAndUser(param);
902
- if (res.data.data) {
903
- this.processId = res.data.data._id;
904
- const content = JSON.parse(res.data.data.content);
905
- this.data = { nodeList: content.nodeList, lineList: content.lineList };
906
- this.name = content.name;
907
- this.isFlg = content.switchOn != 0;
908
- this.$nextTick(() => {
909
- this.jsPlumb = jsPlumb.jsPlumb
910
- ? jsPlumb.jsPlumb.getInstance()
911
- : jsPlumb.getInstance();
912
- this.$nextTick(() => {
913
- this.jsPlumbInit();
914
- });
915
- });
916
- } else {
917
- this.name = this.$route.query.name
918
- ? this.$route.query.name + "流程"
919
- : this.$store.state.formBuilder.name + "流程";
920
- this.dataReload(config.dataDefault);
921
- }
922
- }
923
- }
924
- };
925
- </script>
926
- <style>
927
- .right-plan {
928
- height: calc(100vh - 100px);
929
- overflow-y: auto;
930
- }
931
- .process-heard {
932
- padding: 10px 20px;
933
- display: flex;
934
- align-items: center;
935
- justify-content: space-between;
936
- }
937
- .process-heard .el-icon-edit {
938
- cursor: pointer;
939
- }
940
- .process-heard .process-title {
941
- font-size: 18px;
942
- margin-right: 10px;
943
- }
944
- #flowContainer {
945
- height: 10000px;
946
- /* background-color: rgb(251, 251, 251); */
947
- /*background-color: #42b983;*/
948
- position: relative;
949
- }
950
-
951
- .labelClass {
952
- background-color: white;
953
- padding: 5px;
954
- opacity: 0.7;
955
- border: 1px solid #346789;
956
- /*border-radius: 10px;*/
957
- cursor: pointer;
958
- -webkit-user-select: none;
959
- -moz-user-select: none;
960
- -ms-user-select: none;
961
- user-select: none;
962
- }
963
- .aLabel {
964
- width: 30px;
965
- height: 30px;
966
- background: url("../../assets/process/jia.png") center center no-repeat;
967
- cursor: pointer;
968
- }
969
- .switch {
970
- display: inline-block;
971
- margin-right: 30px;
972
- }
973
- .switch > span {
974
- margin-right: 10px;
975
- }
976
- </style>
1
+ <template>
2
+ <div v-if="easyFlowVisible">
3
+ <el-row>
4
+ <el-col :span="24" class="right-plan">
5
+ <div class="process-heard">
6
+ <template v-if="$route.query.name">
7
+ <div v-if="isEdit">
8
+ <span class="process-title">{{name}}</span>
9
+ <!-- <i class="el-icon-edit" @click.stop="isEdit = false; conName = name"></i> -->
10
+ </div>
11
+ <div v-else>
12
+ <el-input autofocus v-model="conName" placeholder="请输入内容" @blur="changeName"></el-input>
13
+ </div>
14
+ </template>
15
+ <div v-else></div>
16
+ <div>
17
+ <div class="switch">
18
+ <span>是否开启审批: </span>
19
+ <el-switch
20
+ v-model="isFlg">
21
+ </el-switch>
22
+ </div>
23
+ <el-button @click="cancal">取消</el-button>
24
+ <el-button type="primary" @click="save">保存</el-button>
25
+ </div>
26
+ </div>
27
+ <el-row>
28
+ <!--画布-->
29
+ <el-col :span="24">
30
+ <div id="flowContainer" class="container">
31
+ <template v-for="(node,index) in data.nodeList">
32
+ <flow-node
33
+ :key="index"
34
+ :node="node"
35
+ @deleteNode="deleteNode"
36
+ @changeNodeSite="changeNodeSite"
37
+ @nodeRightMenu="nodeRightMenu"
38
+ @editNode="editNode"
39
+ @showForm="showForm"
40
+ @changeName="changeNodeName"
41
+ ></flow-node>
42
+ </template>
43
+ <flow-node-condition :formData="connection" :title="title" @edit="editName" v-show="conditionVisible" @save="setCondition" @cancal="conditionVisible = false" ref="conditionForm"></flow-node-condition>
44
+ <add-node-box v-if="showAddNode" :info="addNodeInfo" @close="()=>{showAddNode = false}" @addNode="addNode"></add-node-box>
45
+ </div>
46
+ </el-col>
47
+ </el-row>
48
+ </el-col>
49
+ </el-row>
50
+ <!-- 流程数据表单 -->
51
+ <flow-node-form :formData="nodeInfo" v-if="nodeVisible" @close="nodeVisible = false" @save="setNode" ref="nodeForm"></flow-node-form>
52
+ </div>
53
+ </template>
54
+
55
+ <script>
56
+ // import draggable from "vuedraggable";
57
+ import jsPlumb from "jsplumb";
58
+ import flowNode from "./components/planNode";
59
+ // import nodeMenu from "./components/nodeMenu";
60
+ import FlowNodeForm from "./components/nodeForm";
61
+ import FlowNodeCondition from "./components/nodeConditionConfig";
62
+ import addNodeBox from "./components/addNode";
63
+ import lodash from "lodash";
64
+ import * as config from "./components/dataDefault";
65
+ import * as api from "@/api/apiProcess";
66
+
67
+ export default {
68
+ data() {
69
+ return {
70
+ // jsPlumb 实例
71
+ jsPlumb: null,
72
+ easyFlowVisible: true,
73
+ // 控制流程数据显示与隐藏
74
+ flowInfoVisible: false,
75
+ // 控制表单显示与隐藏
76
+ nodeVisible: false,
77
+ conditionVisible: false,
78
+ loadEasyFlowFinish: false,
79
+ // 数据
80
+ data: {},
81
+ maxId: 0,
82
+ maxUserTask: 0,
83
+ maxCondition: 0,
84
+ activeNode: "",
85
+ activeConditions: {},
86
+ activeLine: {
87
+ sourceId: "",
88
+ targetId: "",
89
+ isCondition: false
90
+ },
91
+ connection: {},
92
+ title: "",
93
+ nodeInfo: {},
94
+ isEdit: true,
95
+ name: "",
96
+ conName: "",
97
+ desc: "",
98
+ processId: "",
99
+ isFlg: true,
100
+ type: "",
101
+ label: [
102
+ "Label",
103
+ {
104
+ // 连接点的可配置标签
105
+ location: 0.5,
106
+ id: "label",
107
+ label: "",
108
+ cssClass: "aLabel",
109
+ events: {
110
+ click: (e, event) => {
111
+ const label = e.getElement();
112
+ const top = parseFloat(label.style.top) - 35;
113
+ const left = parseFloat(label.style.left) + 30;
114
+ this.showAddNode = true;
115
+ this.addNodeInfo = {
116
+ top: top,
117
+ left: left
118
+ };
119
+ event.stopPropagation();
120
+ }
121
+ }
122
+ }
123
+ ],
124
+ showAddNode: false,
125
+ addNodeInfo: {
126
+ top: "0",
127
+ left: "0",
128
+ isShwo: true
129
+ }
130
+ };
131
+ },
132
+ components: {
133
+ flowNode,
134
+ FlowNodeForm,
135
+ FlowNodeCondition,
136
+ addNodeBox
137
+ },
138
+ computed: {
139
+ user() {
140
+ return this.$store.state.user;
141
+ }
142
+ },
143
+ created() {
144
+ if (this.$route.query.type) {
145
+ this.type = this.$route.query.type;
146
+ } else if (this.$route.path == "/formBuilder") {
147
+ this.type = "customForm_" + this.$store.state.formBuilder.formDesId;
148
+ }
149
+ },
150
+ mounted() {
151
+ this.$nextTick(async() => {
152
+ // this.jsPlumb = jsPlumb.jsPlumb.getInstance();
153
+ this.jsPlumb = jsPlumb.jsPlumb
154
+ ? jsPlumb.jsPlumb.getInstance()
155
+ : jsPlumb.getInstance();
156
+ // 默认加载流程A的数据、在这里可以根据具体的业务返回符合流程数据格式的数据即可
157
+ const id = this.$route.params.id;
158
+ if (id) {
159
+ // this.processId = this.$route.params.id
160
+ this.processId = "5e7af90cf7b2ed3ef17c4216";
161
+ const res = await api.getProcessDetail({
162
+ id: "5e7af90cf7b2ed3ef17c4216"
163
+ });
164
+ if (res.data.state == "ok") {
165
+ this.processId = res.data.data._id;
166
+ const content = JSON.parse(res.data.data.content);
167
+ this.data = {
168
+ nodeList: content.nodeList,
169
+ lineList: content.lineList
170
+ };
171
+ this.$nextTick(() => {
172
+ // this.jsPlumb = jsPlumb.jsPlumb.getInstance();
173
+ this.jsPlumb = jsPlumb.jsPlumb
174
+ ? jsPlumb.jsPlumb.getInstance()
175
+ : jsPlumb.getInstance();
176
+ this.$nextTick(() => {
177
+ this.jsPlumbInit();
178
+ });
179
+ });
180
+ }
181
+ } else {
182
+ // this.dataReload(config.dataDefault)
183
+ this.queryProcessByCompanyAndUser();
184
+ }
185
+ });
186
+ },
187
+ methods: {
188
+ // 修改题目
189
+ changeName() {
190
+ if (this.conName) {
191
+ this.name = this.conName;
192
+ } else {
193
+ this.conName = this.name;
194
+ }
195
+ this.isEdit = true;
196
+ },
197
+ // 设置节点条件
198
+ setCondition(data) {
199
+ const conditions = Object.entries(data.form).map(([key, val]) => {
200
+ if (Array.isArray(val.value)) {
201
+ return {
202
+ ...val,
203
+ variable: key,
204
+ value: val.value.join(","),
205
+ opt: "=",
206
+ isArray: true
207
+ };
208
+ } else {
209
+ return {
210
+ ...val,
211
+ variable: key,
212
+ isArray: false
213
+ };
214
+ }
215
+ });
216
+ this.data.nodeList.forEach((item, index) => {
217
+ if (item.id == this.activeNode) {
218
+ item.conditions = conditions;
219
+ item.desc = data.desc.join(" 并且 ");
220
+ }
221
+ });
222
+ this.conditionVisible = false;
223
+ },
224
+ // 设置节点信息
225
+ setNode(data) {
226
+ // this.data
227
+ this.data.nodeList.forEach((item, index) => {
228
+ if (item.id == this.activeNode) {
229
+ item.approverType = data.approverType;
230
+ item.approvers = data.approvers;
231
+ item.notifiers = data.notifiers;
232
+ }
233
+ });
234
+ },
235
+ // 点击节点事件
236
+ showForm(node) {
237
+ this.activeNode = node.id;
238
+ if (node.type == "condition") {
239
+ this.conditionVisible = true;
240
+ let condition = this.data.nodeList.filter((item, index) => {
241
+ return item.id == node.id;
242
+ });
243
+ condition = lodash.cloneDeep(condition);
244
+ const json = {};
245
+ condition[0].conditions.forEach((item, index) => {
246
+ if (item.isArray) {
247
+ item.value = item.value.split(",");
248
+ }
249
+ json[item.variable] = item;
250
+ });
251
+ this.connection = json;
252
+ this.title = node.name;
253
+ } else if (node.type == "userTask") {
254
+ const nodeInfo = this.data.nodeList.filter((item, index) => {
255
+ return item.id == node.id;
256
+ });
257
+ const json = {
258
+ approverType: nodeInfo[0].approverType || "",
259
+ approvers: nodeInfo[0].approvers || [],
260
+ notifiers: nodeInfo[0].notifiers || []
261
+ };
262
+ this.nodeInfo = json;
263
+ this.nodeVisible = true;
264
+ }
265
+ },
266
+ // 修改条件名称
267
+ editName(data) {
268
+ this.title = data;
269
+ this.data.nodeList.forEach((item, index) => {
270
+ if (item.id == this.activeNode) {
271
+ item.name = data;
272
+ }
273
+ });
274
+ },
275
+ // 初始化数据
276
+ jsPlumbInit() {
277
+ const _this = this;
278
+ this.jsPlumb.ready(() => {
279
+ // 导入默认配置
280
+ const defaultConfig = _.cloneDeep(config.DefaultConfig);
281
+ defaultConfig.ConnectionOverlays.push(this.label);
282
+ this.jsPlumb.importDefaults(defaultConfig);
283
+ // 会使整个jsPlumb立即重绘。
284
+ this.jsPlumb.setSuspendDrawing(false, true);
285
+ // 初始化节点
286
+ this.loadEasyFlow();
287
+ // 单点击了连接线,
288
+ this.jsPlumb.bind("click", (conn, originalEvent) => {
289
+ const endSource = conn.endpoints[0].getUuid();
290
+ const endTarget = conn.endpoints[1].getUuid();
291
+ const sourceId = conn.sourceId.substring(15);
292
+ const targetId = conn.targetId.substring(15);
293
+ this.activeLine.sourceId = sourceId;
294
+ this.activeLine.targetId = targetId;
295
+ this.activeLine.sourceUUid =
296
+ endSource.indexOf("BottomCenter") > -1
297
+ ? "BottomCenter"
298
+ : "RightMiddle";
299
+ this.activeLine.targetUUid =
300
+ endTarget.indexOf("TopCenter") > -1 ? "TopCenter" : "RightMiddle";
301
+ this.addNodeInfo.isShow = true;
302
+ this.activeLine.isCondition = false;
303
+ this.data.nodeList.forEach((item) => {
304
+ if (
305
+ (item.id == sourceId || item.id == targetId) &&
306
+ item.type == "condition"
307
+ ) {
308
+ this.addNodeInfo.isShow = false;
309
+ }
310
+ if (item.id == sourceId && item.type == "condition") {
311
+ this.activeLine.isCondition = true;
312
+ }
313
+ });
314
+ });
315
+ // 连线
316
+ this.jsPlumb.bind("connection", (evt) => {
317
+ const from = evt.sourceId;
318
+ const to = evt.targetId;
319
+ const nodeFrom = evt.sourceId.substring(15);
320
+ const nodeTo = evt.targetId.substring(15);
321
+ const uuid0 = evt.connection.endpoints[0].getUuid();
322
+ const uuid1 = evt.connection.endpoints[1].getUuid();
323
+ if (this.loadEasyFlowFinish) {
324
+ const line = {
325
+ sourceId: from,
326
+ targetId: to,
327
+ nodeFrom: nodeFrom,
328
+ nodeTo: nodeTo,
329
+ condName: "",
330
+ uuid0: uuid0,
331
+ uuid1: uuid1
332
+ };
333
+ this.data.nodeList.forEach((item, index) => {
334
+ if (
335
+ item.id == nodeFrom &&
336
+ evt.sourceEndpoint.anchor.type == "RightMiddle"
337
+ ) {
338
+ item.ifNo = nodeTo;
339
+ } else if (item.id == nodeFrom) {
340
+ item.to = nodeTo;
341
+ }
342
+ if (item.id == nodeTo) {
343
+ item.from = nodeFrom;
344
+ }
345
+ });
346
+ this.data.lineList.push(line);
347
+ }
348
+ });
349
+
350
+ // 删除连线回调
351
+ this.jsPlumb.bind("connectionDetached", (evt) => {
352
+ this.deleteLine(evt.sourceId, evt.targetId, evt);
353
+ });
354
+
355
+ // 改变线的连接节点
356
+ this.jsPlumb.bind("connectionMoved", (evt) => {
357
+ this.changeLine(evt.originalSourceId, evt.originalTargetId);
358
+ });
359
+
360
+ // contextmenu
361
+ this.jsPlumb.bind("contextmenu", (evt) => {
362
+ // console.log("contextmenu", evt);
363
+ });
364
+
365
+ // 连线
366
+ this.jsPlumb.bind("beforeDrop", (evt) => {
367
+ const from = evt.sourceId;
368
+ const to = evt.targetId;
369
+ if (from === to) {
370
+ this.$message.error("不能连接自己");
371
+ return false;
372
+ }
373
+ if (this.hasLine(from, to)) {
374
+ this.$message.error("不能重复连线");
375
+ return false;
376
+ }
377
+ if (this.hashOppositeLine(from, to)) {
378
+ this.$message.error("不能回环");
379
+ return false;
380
+ }
381
+ return true;
382
+ });
383
+
384
+ // beforeDetach
385
+ this.jsPlumb.bind("beforeDetach", (evt) => {
386
+ this.deleteLine(evt.sourceId, evt.targetId);
387
+ });
388
+ });
389
+ },
390
+ // 加载流程图
391
+ loadEasyFlow() {
392
+ // 初始化节点
393
+ const _this = this;
394
+ this.maxId = 0;
395
+ this.maxUserTask = 1;
396
+ this.maxCondition = 0;
397
+ for (let i = 0; i < this.data.nodeList.length; i++) {
398
+ const node = this.data.nodeList[i];
399
+ _this.maxId =
400
+ parseFloat(node.id) > parseFloat(_this.maxId)
401
+ ? parseFloat(node.id)
402
+ : _this.maxId;
403
+
404
+ if (node.type == "start") {
405
+ _this._addEndpoints("Window" + node.id + "", ["BottomCenter"], []);
406
+ } else if (node.type == "end") {
407
+ _this._addEndpoints(
408
+ "Window" + node.id + "",
409
+ [],
410
+ ["TopCenter", "LeftMiddle", "RightMiddle"]
411
+ );
412
+ } else if (node.type == "condition") {
413
+ const sort = node.name.substring(4);
414
+ _this.maxCondition =
415
+ parseFloat(sort) > parseFloat(_this.maxCondition)
416
+ ? parseFloat(sort)
417
+ : _this.maxCondition;
418
+ _this._addEndpoints(
419
+ "Window" + node.id + "",
420
+ ["BottomCenter", "RightMiddle"],
421
+ ["TopCenter"]
422
+ );
423
+ } else {
424
+ const sort2 = node.name.substring(4);
425
+ _this.maxUserTask =
426
+ parseFloat(sort2) > parseFloat(_this.maxUserTask)
427
+ ? parseFloat(sort2)
428
+ : _this.maxUserTask;
429
+ _this._addEndpoints(
430
+ "Window" + node.id + "",
431
+ ["BottomCenter"],
432
+ ["TopCenter"]
433
+ );
434
+ }
435
+ _this.jsPlumb.draggable("flowchartWindow" + node.id, {
436
+ grid: [20, 20]
437
+ });
438
+ }
439
+
440
+ // 初始化连线
441
+ for (let i = 0; i < this.data.lineList.length; i++) {
442
+ const line = this.data.lineList[i];
443
+ _this.jsPlumb.connect({ uuids: [line.uuid0, line.uuid1] });
444
+ }
445
+ this.$nextTick(function() {
446
+ this.loadEasyFlowFinish = true;
447
+ });
448
+ },
449
+ // 删除线
450
+ deleteLine(from, to, evt) {
451
+ const _this = this;
452
+ const fromId = from.substring(15);
453
+ const toId = to.substring(15);
454
+ this.data.lineList = this.data.lineList.filter(function(line) {
455
+ if (line.sourceId == from && line.targetId == to) {
456
+ return false;
457
+ }
458
+ return true;
459
+ });
460
+ },
461
+ // 改变连线
462
+ changeLine(oldFrom, oldTo) {
463
+ this.deleteLine(oldFrom, oldTo);
464
+ },
465
+ // 改变节点的位置
466
+ changeNodeSite(data) {
467
+ for (var i = 0; i < this.data.nodeList.length; i++) {
468
+ const node = this.data.nodeList[i];
469
+ if (node.id === data.id) {
470
+ node.left = data.left;
471
+ node.top = data.top;
472
+ }
473
+ }
474
+ },
475
+ // 修改节点名称
476
+ changeNodeName(data) {
477
+ console.log(data);
478
+ this.data.nodeList.forEach((item) => {
479
+ if (item.id == data.id) {
480
+ item.name = data.name;
481
+ }
482
+ });
483
+ },
484
+ /**
485
+ * 拖拽结束后添加新的节点
486
+ * @param evt
487
+ * @param nodeMenu 被添加的节点对象
488
+ * @param mousePosition 鼠标拖拽结束的坐标
489
+ */
490
+ addNode(nodeMenu) {
491
+ this.showAddNode = false;
492
+ const nodeId = this.maxId + 1;
493
+ let left, top, from, to;
494
+ let nextTo = this.activeLine.targetId;
495
+ let fromNode;
496
+ let frist = true;
497
+ let isRight = false;
498
+ let oldTop = "";
499
+ // 循环修改下面节点的位置
500
+ while (nextTo !== "end") {
501
+ this.data.nodeList.forEach((item) => {
502
+ // 添加ifNo下添加节点
503
+ if (
504
+ frist &&
505
+ item.id == this.activeLine.sourceId &&
506
+ this.activeLine.isCondition
507
+ ) {
508
+ frist = false;
509
+ if (this.activeLine.sourceUUid == "RightMiddle") {
510
+ left = parseFloat(item.left) + 300 + "px";
511
+ top = parseFloat(item.top) + 170 + "px";
512
+ nextTo = item.ifNo == "5" ? "end" : item.ifNo;
513
+ isRight = true;
514
+ } else {
515
+ const nodeInfo = this.data.nodeList.filter(
516
+ (i) => i.id == this.activeLine.sourceId
517
+ );
518
+ left = nodeInfo[0].left;
519
+ top = parseFloat(nodeInfo[0].top) + 170 + "px";
520
+ nextTo = item.to;
521
+ }
522
+ oldTop = top;
523
+ }
524
+ // 普通添加
525
+ if (frist && item.id == nextTo && !this.activeLine.isCondition) {
526
+ frist = false;
527
+ const nodeInfo = this.data.nodeList.filter(
528
+ (i) => i.id == this.activeLine.sourceId
529
+ );
530
+ left = nodeInfo[0].left;
531
+ top = parseFloat(nodeInfo[0].top) + 170 + "px";
532
+ oldTop = top;
533
+ }
534
+ if (item.id == nextTo) {
535
+ item.top =
536
+ parseFloat(item.top) - parseFloat(oldTop) < 170
537
+ ? parseFloat(item.top) + 170 + "px"
538
+ : item.top;
539
+ oldTop = item.top;
540
+ nextTo = item.to;
541
+ return;
542
+ }
543
+ });
544
+ }
545
+ // 修改新增上下节点from to
546
+ this.data.nodeList.forEach((item, index) => {
547
+ if (
548
+ item.id == this.activeLine.sourceId &&
549
+ !this.activeLine.isCondition
550
+ ) {
551
+ from = item.id;
552
+ item.to = nodeId;
553
+ }
554
+ if (
555
+ item.id == this.activeLine.sourceId &&
556
+ this.activeLine.isCondition
557
+ ) {
558
+ from = item.id;
559
+ if (this.activeLine.sourceUUid == "RightMiddle") {
560
+ item.ifNo = nodeId;
561
+ } else {
562
+ item.to = nodeId;
563
+ }
564
+ }
565
+ if (item.id == this.activeLine.targetId) {
566
+ to = item.id;
567
+ item.from = nodeId;
568
+ }
569
+ });
570
+ // 添加新节点
571
+ const sort =
572
+ nodeMenu.type == "condition"
573
+ ? this.maxCondition + 1
574
+ : this.maxUserTask + 1;
575
+ const node = {
576
+ id: nodeId,
577
+ type: nodeMenu.type,
578
+ name: nodeMenu.name + sort,
579
+ left: left,
580
+ top: top,
581
+ from: from,
582
+ to: to
583
+ };
584
+ if (nodeMenu.type == "condition") {
585
+ node.conditions = [];
586
+ node.ifNo = "5"; // 连接到结束
587
+ node.desc = "";
588
+ this.maxCondition = sort;
589
+ // 条件节点新增连接到结束的连线
590
+ this.data.lineList.push({
591
+ nodeFrom: nodeId,
592
+ nodeTo: "5",
593
+ sourceId: "flowchartWindow" + nodeId,
594
+ targetId: "flowchartWindow5",
595
+ uuid0: "Window" + nodeId + "RightMiddle",
596
+ uuid1: "Window5RightMiddle"
597
+ });
598
+ } else if (nodeMenu.type == "userTask") {
599
+ node.approverType = "";
600
+ node.approvers = [];
601
+ node.notifiers = [];
602
+ this.maxUserTask = sort;
603
+ }
604
+ this.data.nodeList.push(node);
605
+ // 添加新增连线
606
+ this.data.lineList.forEach((item, index) => {
607
+ if (
608
+ item.nodeFrom == this.activeLine.sourceId &&
609
+ item.nodeTo == this.activeLine.targetId &&
610
+ item.uuid0.indexOf(this.activeLine.sourceUUid) > -1 &&
611
+ item.uuid1.indexOf(this.activeLine.targetUUid) > -1
612
+ ) {
613
+ this.data.lineList.splice(index, 1);
614
+ }
615
+ });
616
+ this.data.lineList.push({
617
+ nodeFrom: this.activeLine.sourceId,
618
+ nodeTo: nodeId,
619
+ sourceId: "flowchartWindow" + this.activeLine.sourceId,
620
+ targetId: "flowchartWindow" + nodeId,
621
+ uuid0: "Window" + this.activeLine.sourceId + this.activeLine.sourceUUid,
622
+ uuid1: "Window" + nodeId + "TopCenter"
623
+ });
624
+ this.data.lineList.push({
625
+ nodeFrom: nodeId,
626
+ nodeTo: this.activeLine.targetId,
627
+ sourceId: "flowchartWindow" + nodeId,
628
+ targetId: "flowchartWindow" + this.activeLine.targetId,
629
+ uuid0: "Window" + nodeId + "BottomCenter",
630
+ uuid1: "Window" + this.activeLine.targetId + this.activeLine.targetUUid
631
+ });
632
+ this.maxId = nodeId;
633
+ const _this = this;
634
+ this.dataReload({
635
+ nodeList: this.data.nodeList,
636
+ lineList: this.data.lineList
637
+ });
638
+ },
639
+ /**
640
+ * 删除节点
641
+ * @param nodeId 被删除节点的ID
642
+ */
643
+ deleteNode(nodeId, type) {
644
+ console.log(nodeId, type);
645
+ const _this = this;
646
+ const userTasknode = this.data.nodeList.filter(
647
+ (item) => item.type == "userTask"
648
+ );
649
+ if (userTasknode.length < 2 && type == "userTask") {
650
+ this.$message.error("至少保留一个流程节点");
651
+ return;
652
+ }
653
+ this.$confirm("确定要删除节点" + nodeId + "?", "提示", {
654
+ confirmButtonText: "确定",
655
+ cancelButtonText: "取消",
656
+ type: "warning",
657
+ closeOnClickModal: false
658
+ })
659
+ .then(() => {
660
+ this.jsPlumb.removeAllEndpoints("flowchartWindow" + nodeId);
661
+ this.$nextTick(function() {
662
+ this.jsPlumb.remove("flowchartWindow" + nodeId);
663
+ var list = [];
664
+ const nodeInfo = this.data.nodeList.filter(
665
+ (item) => item.id == nodeId
666
+ );
667
+ const fromId = nodeInfo[0].from;
668
+ const toId = nodeInfo[0].to;
669
+ var nextTo = nodeInfo[0].to;
670
+ let ifNo = false;
671
+ // 循环修改下面节点的位置
672
+ while (nextTo !== "end" && nextTo) {
673
+ this.data.nodeList.forEach((item) => {
674
+ if (item.id == nextTo) {
675
+ item.top =
676
+ nextTo != 5 ? parseFloat(item.top) - 170 + "px" : item.top;
677
+ nextTo = item.to;
678
+ }
679
+ });
680
+ }
681
+ this.data.nodeList.forEach((item, index) => {
682
+ if (item.id == fromId && item.to == nodeId) {
683
+ item.to = toId;
684
+ }
685
+ if (item.id == fromId && item.ifNo == nodeId) {
686
+ item.ifNo = toId;
687
+ ifNo = true;
688
+ }
689
+ if (item.id == toId) {
690
+ item.from = fromId;
691
+ }
692
+ if (item.id !== nodeId) {
693
+ list.push(item);
694
+ }
695
+ });
696
+ // 删除条件分支
697
+ if (nodeInfo[0].type == "condition") {
698
+ list = this.removeCondition(nodeInfo[0], list);
699
+ }
700
+ const fromLocal = ifNo ? "RightMiddle" : "BottomCenter";
701
+ const toLocal =
702
+ toId == 5 &&
703
+ parseFloat(nodeInfo[0].left) >
704
+ document.getElementById("flowchartWindow5").offsetLeft
705
+ ? "RightMiddle"
706
+ : "TopCenter";
707
+ this.data.lineList.push({
708
+ nodeFrom: fromId,
709
+ nodeTo: toId,
710
+ sourceId: "flowchartWindow" + fromId,
711
+ targetId: "flowchartWindow" + toId,
712
+ uuid0: "Window" + fromId + fromLocal,
713
+ uuid1: "Window" + toId + toLocal
714
+ });
715
+ this.dataReload({ nodeList: list, lineList: this.data.lineList });
716
+ });
717
+ })
718
+ .catch((err) => {});
719
+ return true;
720
+ },
721
+ removeCondition(nodeInfo, list) {
722
+ const _this = this;
723
+ var arr = [];
724
+ var removeId = nodeInfo.ifNo;
725
+ while (removeId != 5 && removeId) {
726
+ arr.push(removeId);
727
+ var removeNode = _this.data.nodeList.filter((i) => i.id == removeId);
728
+ removeId = removeNode[0].to;
729
+ if (removeNode[0].type == "condition") {
730
+ _this.removeCondition(removeNode[0], list);
731
+ }
732
+ }
733
+ list = list.filter((no) => arr.indexOf(no.id) == -1);
734
+ arr.forEach((item, index, a) => {
735
+ var removeA = a[index];
736
+ var removeB = a[index + 1] || "5";
737
+ if (removeA && removeB) {
738
+ _this.data.lineList = _this.data.lineList.filter(
739
+ (line) => !(line.nodeFrom == removeA && line.nodeTo == removeB)
740
+ );
741
+ }
742
+ });
743
+ return list;
744
+ },
745
+ /**
746
+ * 编辑节点
747
+ * @param nodeId 被点击编辑的节点的ID
748
+ */
749
+ editNode(nodeId) {
750
+ this.nodeFormVisible = true;
751
+ this.$nextTick(function() {
752
+ this.$refs.nodeForm.init(this.data, nodeId);
753
+ });
754
+ },
755
+ // 是否具有该线
756
+ hasLine(from, to) {
757
+ for (var i = 0; i < this.data.lineList.length; i++) {
758
+ var line = this.data.lineList[i];
759
+ if (line.from === from && line.to === to) {
760
+ return true;
761
+ }
762
+ }
763
+ return false;
764
+ },
765
+ // 是否含有相反的线
766
+ hashOppositeLine(from, to) {
767
+ return this.hasLine(to, from);
768
+ },
769
+ nodeRightMenu(nodeId, evt) {
770
+ this.menu.show = true;
771
+ this.menu.curNodeId = nodeId;
772
+ this.menu.left = evt.x + "px";
773
+ this.menu.top = evt.y + "px";
774
+ },
775
+ // 加载流程图
776
+ dataReload(data) {
777
+ this.easyFlowVisible = false;
778
+ this.data.nodeList = [];
779
+ this.data.lineList = [];
780
+ this.$nextTick(() => {
781
+ data = lodash.cloneDeep(data);
782
+ this.easyFlowVisible = true;
783
+ this.data = data;
784
+ this.$nextTick(() => {
785
+ // this.jsPlumb = jsPlumb.jsPlumb.getInstance();
786
+ this.jsPlumb = jsPlumb.jsPlumb
787
+ ? jsPlumb.jsPlumb.getInstance()
788
+ : jsPlumb.getInstance();
789
+ this.$nextTick(() => {
790
+ this.jsPlumbInit();
791
+ });
792
+ });
793
+ });
794
+ },
795
+ _addEndpoints(toId, sourceAnchors, targetAnchors) {
796
+ for (var i = 0; i < sourceAnchors.length; i++) {
797
+ var sourceUUID = toId + sourceAnchors[i];
798
+ this.jsPlumb.addEndpoint("flowchart" + toId, config.sourceEndpoint, {
799
+ anchor: sourceAnchors[i],
800
+ uuid: sourceUUID
801
+ });
802
+ }
803
+ for (var j = 0; j < targetAnchors.length; j++) {
804
+ var targetUUID = toId + targetAnchors[j];
805
+ this.jsPlumb.addEndpoint("flowchart" + toId, config.targetEndpoint, {
806
+ anchor: targetAnchors[j],
807
+ uuid: targetUUID
808
+ });
809
+ }
810
+ },
811
+ // 保存
812
+ async save() {
813
+ const user = this.$store.state.user;
814
+ let flg = false;
815
+ if (this.type == "") return;
816
+ this.data.nodeList.forEach((item) => {
817
+ if (item.type == "condition" && item.ifNo == "") {
818
+ this.$message.error(`条件节点: ${item.name} 没有闭合,请检查`);
819
+ flg = true;
820
+ return false;
821
+ }
822
+ if ((item.to == "" || item.from == "") && item.type != "end") {
823
+ this.$message.error(`节点: ${item.name} 流程未闭合,请检查`);
824
+ flg = true;
825
+ return false;
826
+ }
827
+ if (
828
+ item.type == "userTask" &&
829
+ item.approvers.length < 1 &&
830
+ item.notifiers.length < 1
831
+ ) {
832
+ this.$message.error(`节点: ${item.name} 申请人和抄送人不能为空`);
833
+ flg = true;
834
+ return false;
835
+ }
836
+ });
837
+ if (flg) {
838
+ return false;
839
+ }
840
+ const param = {
841
+ name: this.name,
842
+ desc: "",
843
+ creator: user.no + "",
844
+ processId: this.processId,
845
+ startId: "1",
846
+ endId: "5",
847
+ companyId: user.cno + "",
848
+ type: this.type,
849
+ switchOn: this.isFlg ? "1" : "0",
850
+ nodeList: this.data.nodeList,
851
+ lineList: this.data.lineList
852
+ };
853
+ if (this.$route.path == "/formBuilder") {
854
+ param.menuId = this.$store.state.formBuilder.menuId;
855
+ }
856
+ let res;
857
+ if (this.processId) {
858
+ const data = {
859
+ id: this.processId + "",
860
+ content: JSON.stringify(param)
861
+ };
862
+ res = await api.updateProcess(data);
863
+ } else {
864
+ const data = {
865
+ content: JSON.stringify(param)
866
+ };
867
+ res = await api.saveProcess(data);
868
+ }
869
+ if (res.data.state == "ok") {
870
+ this.$message.success({
871
+ message: this.processId ? "编辑成功" : "保存成功",
872
+ duration: 1500
873
+ });
874
+ this.processId = res.data.data;
875
+ this.type.indexOf("customForm_") == -1 &&
876
+ this.$removeTag("/processList");
877
+ } else {
878
+ this.$message.error({
879
+ message: res.data.msg ? res.data.msg : "保存失败",
880
+ duration: 1500
881
+ });
882
+ }
883
+ },
884
+ cancal() {
885
+ this.$confirm("有修改的内容未保存,确认离开吗?", "提示", {
886
+ confirmButtonText: "确定",
887
+ cancelButtonText: "取消",
888
+ type: "warning"
889
+ })
890
+ .then(() => {
891
+ this.$removeTag("/processList");
892
+ })
893
+ .catch(() => {});
894
+ },
895
+ async queryProcessByCompanyAndUser() {
896
+ const param = {
897
+ userId: this.user.no + "",
898
+ companyId: this.user.cno + "",
899
+ type: this.type
900
+ };
901
+ const res = await api.queryProcessByCompanyAndUser(param);
902
+ if (res.data.data) {
903
+ this.processId = res.data.data._id;
904
+ const content = JSON.parse(res.data.data.content);
905
+ this.data = { nodeList: content.nodeList, lineList: content.lineList };
906
+ this.name = content.name;
907
+ this.isFlg = content.switchOn != 0;
908
+ this.$nextTick(() => {
909
+ this.jsPlumb = jsPlumb.jsPlumb
910
+ ? jsPlumb.jsPlumb.getInstance()
911
+ : jsPlumb.getInstance();
912
+ this.$nextTick(() => {
913
+ this.jsPlumbInit();
914
+ });
915
+ });
916
+ } else {
917
+ this.name = this.$route.query.name
918
+ ? this.$route.query.name + "流程"
919
+ : this.$store.state.formBuilder.name + "流程";
920
+ this.dataReload(config.dataDefault);
921
+ }
922
+ }
923
+ }
924
+ };
925
+ </script>
926
+ <style>
927
+ .right-plan {
928
+ height: calc(100vh - 100px);
929
+ overflow-y: auto;
930
+ }
931
+ .process-heard {
932
+ padding: 10px 20px;
933
+ display: flex;
934
+ align-items: center;
935
+ justify-content: space-between;
936
+ }
937
+ .process-heard .el-icon-edit {
938
+ cursor: pointer;
939
+ }
940
+ .process-heard .process-title {
941
+ font-size: 18px;
942
+ margin-right: 10px;
943
+ }
944
+ #flowContainer {
945
+ height: 10000px;
946
+ /* background-color: rgb(251, 251, 251); */
947
+ /*background-color: #42b983;*/
948
+ position: relative;
949
+ }
950
+
951
+ .labelClass {
952
+ background-color: white;
953
+ padding: 5px;
954
+ opacity: 0.7;
955
+ border: 1px solid #346789;
956
+ /*border-radius: 10px;*/
957
+ cursor: pointer;
958
+ -webkit-user-select: none;
959
+ -moz-user-select: none;
960
+ -ms-user-select: none;
961
+ user-select: none;
962
+ }
963
+ .aLabel {
964
+ width: 30px;
965
+ height: 30px;
966
+ background: url("../../assets/process/jia.png") center center no-repeat;
967
+ cursor: pointer;
968
+ }
969
+ .switch {
970
+ display: inline-block;
971
+ margin-right: 30px;
972
+ }
973
+ .switch > span {
974
+ margin-right: 10px;
975
+ }
976
+ </style>