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,1323 +1,1323 @@
1
- <template>
2
- <div v-if="easyFlowVisible">
3
- <el-row v-if="tools">
4
- <el-col :span="24" class="right-plan">
5
- <div class="process-heard">
6
- <template v-if="queryName">
7
- <div v-if="isEdit">
8
- <span class="process-title">{{queryName}}流程</span>
9
- <!-- <i class="el-icon-edit" @click.stop="isEdit = false; conName = name"></i> -->
10
- </div>
11
- <div v-else>
12
- <el-input
13
- autofocus
14
- v-model="conName"
15
- placeholder="请输入内容"
16
- @blur="changeName"
17
- ></el-input>
18
- </div>
19
- </template>
20
- <div v-else></div>
21
- <div>
22
- <div class="switch">
23
- <span>是否开启审批:</span>
24
- <el-switch v-model="isFlg"> </el-switch>
25
- </div>
26
- <el-button @click="cancal">取消</el-button>
27
- <el-button type="primary" @click="save">保存</el-button>
28
- </div>
29
- </div>
30
- </el-col>
31
- </el-row>
32
- <!--画布-->
33
- <el-col :span="24">
34
- <div id="flowContainer" class="container-process">
35
- <!-- {{data.nodeList}} -->
36
- <template v-for="(node, index) in data.nodeList">
37
- <flow-node
38
- ref="flowNode"
39
- v-if="node.item.type !== 'addCondition'"
40
- :key="index"
41
- :node="node.item"
42
- :level="node.level"
43
- @deleteNode="deleteNode"
44
- @changeNodeSite="changeNodeSite"
45
- @nodeRightMenu="nodeRightMenu"
46
- @editNode="editNode"
47
- @showForm="showForm"
48
- @changeName="changeNodeName"
49
- ></flow-node>
50
- <div
51
- :id="'flowchartWindow' + node.item.id"
52
- @click="addExtraCondition($event)"
53
- class="add-condition"
54
- :style="{ top: node.item.top, left: node.item.left }"
55
- v-else
56
- :key="node.item.id + '_add'"
57
- >
58
- 添加条件
59
- </div>
60
- </template>
61
- <flow-node-condition
62
- :formData="connection"
63
- :title="title"
64
- @edit="editName"
65
- v-show="conditionVisible"
66
- @save="setCondition"
67
- @cancal="conditionVisible = false"
68
- ref="conditionForm"
69
- ></flow-node-condition>
70
- <add-node-box
71
- v-if="showAddNode"
72
- :info="addNodeInfo"
73
- @close="
74
- () => {
75
- showAddNode = false;
76
- }
77
- "
78
- @addNode="addNode"
79
- ></add-node-box>
80
- </div>
81
- </el-col>
82
-
83
- <!-- <el-row>
84
- <div id="start" style="border:1px solid #000;width:200px;height:300;margin-bottom:150px">开始</div>
85
- <div id="end" style="border:1px solid #000;width:200px;height:300;margin-bottom:150px">结束</div>
86
- </el-row> -->
87
- <approver-selector
88
- :approverList="approverSelectorData.approverList"
89
- :notifierList="approverSelectorData.notifierList"
90
- v-model="selectorVisible"
91
- @save="setNode"
92
- ref="approverSelector"
93
- ></approver-selector>
94
- </div>
95
- </template>
96
-
97
- <script>
98
- // import draggable from "vuedraggable";
99
- import jsPlumb from "jsplumb";
100
- import flowNode from "./components/planNode";
101
- // import nodeMenu from "./components/nodeMenu";
102
- import FlowNodeCondition from "./components/nodeConditionConfig";
103
- import addNodeBox from "./components/addNode";
104
- import approverSelector from "./components/approverSelector";
105
- import lodash from "lodash";
106
- import * as api from "../../api/apiProcess";
107
- import * as ProcessBuilder from "../../views/formBuilder/service/ProcessBuilder";
108
- export default {
109
- props: ["queryInfo","tools","path","userInfo"],
110
- data() {
111
- return {
112
- approverSelectorData: {
113
- approverList: [],
114
- notifierList: []
115
- },
116
- memberSelectorType: 0,
117
- selectorVisible: false,
118
- jsPlumb: null,
119
- isFlg: true,
120
- isEdit: true,
121
- easyFlowVisible: true,
122
- nodeVisible: false,
123
- nodeInfo: {},
124
- data: {
125
- nodeList: [],
126
- lineList: []
127
- },
128
- connection: {},
129
- title: "",
130
- conditionVisible: false,
131
- showAddNode: false,
132
- addNodeInfo: {
133
- top: "0",
134
- left: "0",
135
- isShwo: true
136
- },
137
- root: new ProcessBuilder.Node(
138
- ProcessBuilder.createItem(
139
- "0",
140
- "根节点",
141
- "root",
142
- "320px",
143
- "20px",
144
- "1",
145
- "2"
146
- )
147
- ),
148
- currentChooseItem: {},
149
- currentNode: {
150
- sourceId: "",
151
- targetId: ""
152
- },
153
- id: 0,
154
- params: {},
155
- processId: "",
156
- isFlg: true,
157
- isClick: true,
158
- name: "",
159
- version: 1,
160
- indexFlg: 1
161
- };
162
- },
163
- components: {
164
- flowNode,
165
- // FlowNodeForm,
166
- FlowNodeCondition,
167
- addNodeBox,
168
- approverSelector
169
- },
170
- computed: {
171
- user: function() {
172
- // this.$store.state.user
173
- return "";
174
- },
175
- orgSelectorList() {
176
- return this.memberSelectorType === 0
177
- ? this.nodeInfo.approvers
178
- : this.nodeInfo.notifiers;
179
- }
180
- },
181
- created() {
182
- this.type = this.queryInfo.type
183
- },
184
- mounted() {
185
- this.jsPlumbInit();
186
- },
187
- methods: {
188
- async save() {
189
- // const user = this.$store.state.user;
190
- const user = this.userInfo;
191
- const flg = false;
192
- if (this.path == "/index") {
193
- // this.params.menuId = this.$store.state.formBuilder.menuId;
194
- this.params.menuId = ""
195
- }
196
- this.params.switchOn = this.isFlg ? "1" : "0";
197
- let res;
198
-
199
- if (this.processId) {
200
- const data = {
201
- id: this.processId + "",
202
- content: JSON.stringify(this.params)
203
- };
204
- res = await api.updateProcess(data);
205
- } else {
206
- const data = {
207
- content: JSON.stringify(this.params)
208
- };
209
- res = await api.saveProcess(data);
210
- }
211
-
212
- for (let i = 0; i < this.params.nodeList.length; i++) {
213
- if (
214
- this.params.nodeList[i].item.type == "userTask" &&
215
- this.params.nodeList[i].item.approvers.length == 0 &&
216
- this.params.nodeList[i].item.directorType &&
217
- this.params.nodeList[i].item.directorType.type == 1
218
- ) {
219
- this.$message.error(
220
- "当前审批流程中【" +
221
- this.params.nodeList[i].item.name +
222
- "】节点审批人不能为空"
223
- );
224
- return;
225
- }
226
- }
227
- if (res.data.state == "ok") {
228
- this.$message.success({
229
- message: this.processId ? "编辑成功" : "保存成功",
230
- duration: 1500
231
- });
232
- this.processId = res.data.data;
233
- if (this.type.indexOf("customForm_") == -1) {
234
- this.$removeTag1(this.$route);
235
- this.$router.go(-1);
236
- }
237
- } else {
238
- this.$message.error({
239
- message: res.data.msg ? res.data.msg : "保存失败",
240
- duration: 1500
241
- });
242
- }
243
- },
244
- cancal() {
245
- this.$confirm("有修改的内容未保存,确认离开吗?", "提示", {
246
- confirmButtonText: "确定",
247
- cancelButtonText: "取消",
248
- type: "warning"
249
- })
250
- .then(() => {
251
- this.$removeTag1(this.$route);
252
- this.$router.go(-1);
253
- })
254
- .catch(() => {});
255
- },
256
- initProcess() {
257
- this.easyFlowVisible = false;
258
- const start = new ProcessBuilder.Node(
259
- ProcessBuilder.createItem(
260
- "1",
261
- "开始",
262
- "start",
263
- "320px",
264
- "20px",
265
- "1",
266
- "2"
267
- )
268
- );
269
- const userTask = new ProcessBuilder.Node(
270
- ProcessBuilder.createItem(
271
- "2",
272
- // "用户任务",
273
- "审批人",
274
- "userTask",
275
- "320px",
276
- "200px",
277
- "1",
278
- "3"
279
- )
280
- );
281
-
282
-
283
-
284
- // const userTask1 = new ProcessBuilder.Node(
285
- // ProcessBuilder.createItem(
286
- // "8",
287
- // // "用户任务",
288
- // "审批人",
289
- // "userTask",
290
- // "320px",
291
- // "400px",
292
- // "7",
293
- // "5"
294
- // )
295
- // );
296
-
297
- const ccTask = new ProcessBuilder.Node(
298
- ProcessBuilder.createItem(
299
- "3",
300
- // "用户任务",
301
- "抄送人",
302
- "ccTask",
303
- "320px",
304
- "350px",
305
- "7",
306
- "5"
307
- )
308
- );
309
-
310
- const end = new ProcessBuilder.Node(
311
- ProcessBuilder.createItem(
312
- "5",
313
- "结束",
314
- "end",
315
- "320px",
316
- "330px",
317
- "2",
318
- "5"
319
- )
320
- );
321
- this.root.add(start);
322
- start.add(userTask);
323
- userTask.add(ccTask);
324
- ccTask.add(end)
325
- // this.root.scan()
326
- this.refresh();
327
- },
328
- refresh() {
329
- this.jsPlumb.reset();
330
- const result = this.root.lists;
331
- const temp1 = result[0];
332
- var nodeList = ProcessBuilder.treeToListLocal(result);
333
-
334
- const self = this;
335
- // 计算结束和开始标签相关的位置坐标
336
- let left = 0;
337
- const top = 0;
338
- let end;
339
- let start;
340
- let addCondition;
341
- let addConditionLeft = 0;
342
- let maxLevel = 0;
343
- for (let i = 0; i < nodeList.length; i++) {
344
- const each = nodeList[i];
345
- if (parseFloat(each.item.left) > left) {
346
- left = parseFloat(each.item.left);
347
- }
348
- if (maxLevel < each.level && each.item.type != "end") {
349
- maxLevel = each.level;
350
- }
351
- if (each.item.type == "end") {
352
- end = each;
353
- }
354
- if (each.item.type == "start") {
355
- start = each;
356
- }
357
-
358
- if (each.item.type == "addCondition") {
359
- addCondition = each;
360
- const min = addCondition.lists[0];
361
- const max = addCondition.lists[addCondition.lists.length - 1];
362
- const sum = parseFloat(min.item.left) + parseFloat(max.item.left);
363
- if (addConditionLeft < sum / 2) {
364
- addConditionLeft = sum / 2;
365
- }
366
- addCondition.item.left = sum / 2 + "px";
367
- }
368
- }
369
- console.log(maxLevel);
370
- const postion =
371
- addConditionLeft > 0 ? addConditionLeft : (left + 320) / 2;
372
- end.item.left = postion + "px";
373
- end.level = maxLevel + 1;
374
- end.item.top = 200 * (end.level - 1) + 20 + "px";
375
- start.item.left = postion + "px";
376
-
377
- this.data.nodeList = nodeList;
378
- this.easyFlowVisible = true;
379
- var label = [
380
- "Label",
381
- {
382
- location: 0.0,
383
- label: "",
384
- cssClass: "aLabel",
385
- events: {
386
- click: function(e, originalEvent) {
387
- const label = e.getElement();
388
- const top = parseFloat(label.style.top) - 35;
389
- const left = parseFloat(label.style.left) + 30;
390
- self.showAddNode = true;
391
- self.addNodeInfo = {
392
- top: top,
393
- left: left
394
- };
395
- var obj = e.component;
396
- const sourceId = obj.sourceId.replace("flowchartWindow", "");
397
- const targetId = obj.targetId.replace("flowchartWindow", "");
398
- self.currentNode.sourceId = sourceId;
399
- self.currentNode.targetId = targetId;
400
- }
401
- }
402
- }
403
- ];
404
- var lineConnector = {
405
- endpoint: ["Dot", { radius: 3 }],
406
- connector: ["Flowchart"],
407
- anchors: ["Bottom", "Top"],
408
- overlays: [
409
- [
410
- "Arrow",
411
- {
412
- width: 10,
413
- length: 10,
414
- location: 1
415
- }
416
- ],
417
- label
418
- ]
419
- };
420
-
421
- var noLabelLineConn = {
422
- endpoint: ["Dot", { radius: 3 }],
423
- connector: ["Flowchart"],
424
- anchors: ["Bottom", "Top"],
425
- overlays: [
426
- [
427
- "Arrow",
428
- {
429
- width: 10,
430
- length: 10,
431
- location: 1
432
- }
433
- ]
434
- ]
435
- };
436
- this.$nextTick(function() {
437
- const gateWayList = [];
438
- const _this = this;
439
- for (let i = 0; i < this.data.nodeList.length; i++) {
440
- const node = this.data.nodeList[i];
441
-
442
- // 禁止移动开始节点
443
- this.jsPlumb.draggable("flowchartWindow" + node.item.id, {
444
- grid: [20, 20],
445
- containment: "parent", // 设置只能在父级范围内拖动节点
446
- stop: function(event) {
447
- _this.isClick = false;
448
- setTimeout(() => {
449
- _this.isClick = true;
450
- }, 1000);
451
- event.e.preventDefault();
452
- }
453
- });
454
-
455
- if (node.item.type != "end") {
456
- if (node.lists.length > 0 && node.item.type == "addCondition") {
457
- for (let j = 0; j < node.lists.length; j++) {
458
- const each = node.lists[j];
459
- const gateWayItem = {
460
- id: each.item.id,
461
- type: "condition",
462
- name: each.item.name,
463
- left: each.item.left,
464
- top: each.item.top,
465
- from: each.item.from,
466
- gateWayKey: node.item.id,
467
- to: each.item.to,
468
- conditions: each.item.conditions,
469
- ifNo: 10,
470
- desc: each.item.desc,
471
- isCondition: each.item.isCondition
472
- };
473
- gateWayList.push(gateWayItem);
474
- this.jsPlumb.connect(
475
- {
476
- source: "flowchartWindow" + node.item.id,
477
- target: "flowchartWindow" + each.item.id
478
- },
479
- noLabelLineConn
480
- );
481
- }
482
- } else {
483
- this.jsPlumb.connect(
484
- {
485
- source: "flowchartWindow" + node.item.id,
486
- target: "flowchartWindow" + node.item.to
487
- },
488
- lineConnector
489
- );
490
- }
491
- }
492
- }
493
- this.loadEasyFlowFinish = true;
494
- // 拼凑指定的数据结构 供后台进行接收解析
495
-
496
- const params = {
497
- name: this.name,
498
- desc: "",
499
- creator: this.user.no,
500
- processId: this.processId,
501
- startId: "1",
502
- endId: "5",
503
- companyId: this.user.cno,
504
- type: this.type,
505
- switchOn: this.isFlg ? "1" : "0",
506
- gateWayList: gateWayList,
507
- nodeList: this.data.nodeList,
508
- lineList: [],
509
- version: this.version
510
- };
511
- this.params = params;
512
- // console.log("param----->", JSON.stringify(params));
513
- });
514
- },
515
- async jsPlumbInit() {
516
- // 初始化流程图实例信息
517
- const self = this;
518
- // this.jsPlumb = jsPlumb.getInstance();
519
- this.jsPlumb = jsPlumb.jsPlumb
520
- ? jsPlumb.jsPlumb.getInstance()
521
- : jsPlumb.getInstance();
522
- this.jsPlumb.importDefaults({
523
- ConnectionsDetachable: false
524
- });
525
- const param = {
526
- companyId: this.user.cno + "",
527
- type: this.type
528
- };
529
-
530
- const res = await api.queryProcessByType(param);
531
-
532
- if (res.data.data && res.data.data.gateWays) {
533
- const content = JSON.parse(res.data.data.content);
534
- this.data = { nodeList: content.nodeList, lineList: content.lineList };
535
- // todo:
536
- this.name = this.queryInfo.name
537
- ? this.queryInfo.name + "流程"
538
- : content.name;
539
- this.isFlg = content.switchOn != 0;
540
- this.processId = res.data.data._id;
541
- this.version = res.data.data.rootNode.version;
542
- this.root.add(content.nodeList[0]);
543
- // this.root.scan()
544
- this.refresh();
545
- const ids = content.nodeList.map((item) => parseFloat(item.item.id));
546
- this.id = Math.max.apply(null, ids);
547
- } else {
548
- if (res.data.data && res.data.data._id) {
549
- this.processId = res.data.data._id;
550
- const processList = JSON.parse(res.data.data.content);
551
- this.name = processList.name;
552
- this.name = this.queryInfo.name
553
- ? this.queryInfo.name + "流程"
554
- : processList.name;
555
-
556
- this.isFlg = processList.switchOn != 0;
557
- this.version = res.data.data.rootNode.version;
558
- const isflg = this.dataTonewList(processList.nodeList);
559
- if (isflg) {
560
- this.refresh();
561
- const ids = processList.nodeList.map((item) => parseFloat(item.id));
562
- this.id = Math.max.apply(null, ids);
563
- setTimeout(async() => {
564
- const data = {
565
- id: this.processId + "",
566
- content: JSON.stringify(this.params)
567
- };
568
- console.log(data);
569
- const res = await api.updateProcessToNew(data);
570
- }, 200);
571
- } else {
572
- this.name = this.queryInfo.name
573
- ? this.queryInfo.name + "流程"
574
- : "流程";
575
- this.initProcess();
576
- const result = ProcessBuilder.treeToListLocal(this.root.lists);
577
- this.id = result.length + 10;
578
- }
579
- } else {
580
- this.name = this.queryInfo.name
581
- ? this.queryInfo.name + "流程"
582
- : "流程";
583
- this.initProcess();
584
- const result = ProcessBuilder.treeToListLocal(this.root.lists);
585
- this.id = result.length + 10;
586
- }
587
- }
588
- },
589
- dataTonewList(processList) {
590
- let parent = this.root;
591
- let currentId = 1;
592
- let isflg = true;
593
- while (parent.item.type != "end" && isflg) {
594
- const currentNode = this.getCurrentNode(processList, currentId);
595
- if (!currentNode) {
596
- isflg = false;
597
- break;
598
- }
599
- const node = new ProcessBuilder.Node(
600
- ProcessBuilder.createItem(
601
- currentNode.id,
602
- currentNode.name,
603
- currentNode.type,
604
- currentNode.left,
605
- currentNode.top,
606
- currentNode.from,
607
- currentNode.to
608
- )
609
- );
610
- if (currentNode.type == "userTask") {
611
- node.item = Object.assign(node.item, {
612
- approverType: currentNode.approverType,
613
- approvers: currentNode.approvers,
614
- notifiers: currentNode.notifiers,
615
- passCopy: currentNode.passCopy
616
- // directorType: currentNode.directorType,
617
- });
618
- }
619
- if (currentNode.type == "condition") {
620
- currentId = currentNode.to;
621
- parent.item.to = currentNode.to;
622
- } else {
623
- parent.add(node);
624
- currentId = currentNode.to;
625
- parent = node;
626
- }
627
- }
628
- return isflg;
629
- },
630
- getCurrentNode(list, id) {
631
- const node = list.filter((item) => item.id == id);
632
- return node.length > 0 ? node[0] : null;
633
- },
634
- setNode(data) {
635
- console.log(data);
636
-
637
- const result = JSON.parse(data);
638
- this.activeNode.directorType = result.directorType;
639
- this.activeNode.approverType = result.approverType;
640
- this.activeNode.approvers = result.approvers;
641
- this.activeNode.notifiers = result.notifiers;
642
- this.activeNode.passCopy = result.passCopy;
643
-
644
- // 强制刷新子组件
645
- this.$refs.flowNode.map(item => {
646
- item.refreshFlowItem()
647
- })
648
- },
649
- deleteNode(e, current) {
650
- // 弹框提示是否需要继续进行当前操作.
651
- // if (e.type == "userTask") {
652
- // const approverNode = this.data.nodeList.filter(
653
- // (item) => item.item.type == "userTask"
654
- // );
655
- // if (approverNode.length < 2) {
656
- // this.$message.error("流程中必须保留一个审批节点");
657
- // return;
658
- // }
659
- // }
660
- // if (e.type == "ccTask") {
661
- // const approverNode = this.data.nodeList.filter(
662
- // (item) => item.item.type == "ccTask"
663
- // );
664
- // if (approverNode.length < 2) {
665
- // this.$message.error("流程中必须保留一个抄送节点");
666
- // return;
667
- // }
668
- // }
669
- if (this.data.nodeList.length == 3) {
670
- this.$message.error("流程中必须保留一个审批或抄送节点");
671
- return;
672
- }
673
- this.$confirm("确定需要删除当前节点?", "提示", {
674
- confirmButtonText: "确定",
675
- cancelButtonText: "取消",
676
- type: "warning"
677
- })
678
- .then(() => {
679
- let NextNode = null;
680
-
681
- this.findNodeById(this.root, e.id);
682
- const myself = _.cloneDeep(this.currentChooseItem);
683
-
684
- this.findNodeById(this.root, e.from);
685
-
686
- console.log(myself.item.type)
687
- if (myself.item.type == "userTask") {
688
- this.currentChooseItem.item.to = myself.item.to;
689
- this.currentChooseItem.lists = myself.lists;
690
- this.currentChooseItem.lists.forEach((item, index) => {
691
- item.item.from = this.currentChooseItem.item.id;
692
- });
693
-
694
- this.data.nodeList.map((value, index) => {
695
- const { type, from } = this.data.nodeList[index].item
696
- if (type == "condition" && from == this.currentChooseItem.item.from) {
697
- this.data.nodeList[index].item.to = myself.item.to
698
- }
699
- })
700
-
701
- } else if (myself.item.type == "ccTask") {
702
- this.currentChooseItem.item.to = myself.item.to;
703
- this.currentChooseItem.lists = myself.lists;
704
- this.currentChooseItem.lists.forEach((item, index) => {
705
- item.item.from = this.currentChooseItem.item.id;
706
- });
707
-
708
- this.data.nodeList.map((value, index) => {
709
- const { type, from } = this.data.nodeList[index].item
710
- if (type == "condition" && from == this.currentChooseItem.item.from) {
711
- this.data.nodeList[index].item.to = myself.item.to
712
- }
713
- })
714
-
715
- } else {
716
- const conditionLength = this.currentChooseItem.lists.length;
717
- if (conditionLength > 2) {
718
- this.currentChooseItem.lists.forEach((item, index) => {
719
- if (item.item.id == e.id) {
720
- this.currentChooseItem.lists.splice(index, 1);
721
- if (index == 0) {
722
- this.currentChooseItem.item.to = this.currentChooseItem.lists[1].item.id;
723
- NextNode = this.currentChooseItem.lists[1];
724
- }
725
- }
726
- });
727
- } else {
728
- const listsItem = _.cloneDeep(
729
- this.currentChooseItem.lists[0].lists[0]
730
- );
731
- const grandPaNodeNo = this.currentChooseItem.item.from;
732
- if (listsItem) {
733
- listsItem.item.from = grandPaNodeNo;
734
- listsItem.item.left = this.currentChooseItem.item.left;
735
- this.findNodeById(this.root, grandPaNodeNo);
736
- this.currentChooseItem.item.to = listsItem.item.id;
737
- // const end = new ProcessBuilder.Node(ProcessBuilder.createItem("5", "结束", "end", "320px", "380px", this.currentChooseItem.item.id, "5"));
738
- this.currentChooseItem.lists = [listsItem];
739
- this.data.nodeList.map((value, index) => {
740
- const { type, from } = this.data.nodeList[index].item
741
- if (type == "condition" && from == this.currentChooseItem.item.from) {
742
- this.data.nodeList[index].item.to = listsItem.item.id;
743
- }
744
- })
745
- } else {
746
- this.findNodeById(this.root, grandPaNodeNo);
747
- this.currentChooseItem.item.to = current.to
748
-
749
- this.currentChooseItem.lists = myself.lists;
750
- this.currentChooseItem.lists.forEach((item, index) => {
751
- item.item.from = this.currentChooseItem.item.id;
752
- });
753
-
754
- this.data.nodeList.map((value, index) => {
755
- const { type, from } = this.data.nodeList[index].item
756
- if (type == "condition" && from == this.currentChooseItem.item.from) {
757
- this.data.nodeList[index].item.to = current.to
758
- }
759
- })
760
- // const end = new ProcessBuilder.Node(
761
- // ProcessBuilder.createItem(
762
- // "5",
763
- // "测试结束",
764
- // "end",
765
- // "320px",
766
- // "380px",
767
- // this.currentChooseItem.item.id,
768
- // "5"
769
- // )
770
- // );
771
-
772
- // this.currentChooseItem.lists = [end];
773
-
774
- }
775
- }
776
- }
777
-
778
-
779
-
780
- const result = ProcessBuilder.treeToListLocal(this.root.lists);
781
- if (NextNode) {
782
- const node = result.filter((item) => item.item.type == "end");
783
- const end = new ProcessBuilder.Node(
784
- ProcessBuilder.createItem(
785
- "5",
786
- "结束",
787
- "end",
788
- "320px",
789
- "380px",
790
- "",
791
- "5"
792
- )
793
- );
794
- if (node.length < 1) {
795
- const list = this.getLastList(NextNode);
796
- list.push(end);
797
- }
798
- this.setResultToNode();
799
- }
800
- // TODO:记得抽取这个重新计算元素坐标的功能方法
801
- result.sort(ProcessBuilder.compare("level"));
802
- for (let i = 0; i < result.length; i++) {
803
- // 重新计算当前结果中每一个元素的坐标位置信息
804
- const each = result[i];
805
- const top = 200 * (each.level - 1) + 20;
806
- each.item.top = top + "px";
807
- }
808
- this.refresh();
809
- })
810
- .catch(() => {});
811
- },
812
- getLastList(node) {
813
- if (node.lists.length == 0) {
814
- return node.lists;
815
- } else {
816
- return this.getLastList(node.lists[0]);
817
- }
818
- },
819
- changeNodeSite() {},
820
- nodeRightMenu() {},
821
- addNode(nodeMenu) {
822
- this.showAddNode = false;
823
- this.findNodeById(this.root, this.currentNode.sourceId);
824
- this.id += 1;
825
- let t;
826
-
827
- if (nodeMenu.type == "condition") {
828
- console.log(this.currentNode)
829
- console.log(this.currentChooseItem)
830
-
831
- t = new ProcessBuilder.Node(
832
- ProcessBuilder.createItem(
833
- this.id,
834
- "条件" + this.id,
835
- "addCondition",
836
- this.currentChooseItem.item.left,
837
- "20px",
838
- this.currentNode.sourceId,
839
- this.currentNode.targetId
840
- )
841
- );
842
- this.currentChooseItem.item.isCondition = "1";
843
- this.currentChooseItem.item.to = t.item.id;
844
-
845
- let oldItem = null;
846
- if (this.currentChooseItem.lists.length > 0) {
847
- this.currentChooseItem.lists[0].item.from = t.item.id;
848
- oldItem = _.cloneDeep(this.currentChooseItem.lists[0]);
849
- }
850
- this.id += 1;
851
- const t1 = new ProcessBuilder.Node(
852
- ProcessBuilder.createItem(
853
- this.id,
854
- "条件" + 1,
855
- "condition",
856
- "320px",
857
- "20px",
858
- this.currentNode.sourceId,
859
- this.currentNode.targetId
860
- )
861
- );
862
- t.item.to = t1.item.id;
863
- t1.item.from = t.item.id;
864
- t1.item.to = oldItem ? oldItem.item.id : this.currentNode.targetId;
865
-
866
- if (oldItem && oldItem.item.type == "addCondition") {
867
- t1.item.isCondition = "1";
868
- }
869
- if (oldItem) {
870
- oldItem.item.from = t1.item.id;
871
- t1.lists.push(oldItem);
872
- }
873
- this.currentChooseItem.lists[0] = t;
874
- t.lists.push(t1);
875
- this.addExtraCondition(event, true);
876
- } else if (nodeMenu.type == "copyUser") {
877
-
878
- // 抄送人节点
879
- t = new ProcessBuilder.Node(
880
- ProcessBuilder.createItem(
881
- this.id,
882
- "抄送人",
883
- // + this.indexFlg
884
- "ccTask",
885
- "320px",
886
- "20px",
887
- this.currentNode.sourceId,
888
- this.currentNode.targetId
889
- )
890
- );
891
-
892
- this.currentChooseItem.item.isCondition = "0";
893
- this.currentChooseItem.item.to = t.item.id;
894
- t.item.left = this.currentChooseItem.item.left;
895
-
896
- if (this.currentChooseItem.lists && this.currentChooseItem.lists.length > 0) {
897
- this.currentChooseItem.lists[0].item.from = t.item.id;
898
- const oldItem = _.cloneDeep(this.currentChooseItem.lists[0]);
899
- this.currentChooseItem.lists[0] = t;
900
- t.lists.push(oldItem);
901
- } else {
902
- this.currentChooseItem.lists.push(t);
903
- }
904
-
905
- const result = ProcessBuilder.treeToListLocal(this.root.lists);
906
- result.sort(ProcessBuilder.compare("level"));
907
- for (let i = 0; i < result.length; i++) {
908
- // 重新计算当前结果中每一个元素的坐标位置信息
909
- const each = result[i];
910
- const top = 200 * (each.level - 1) + 20;
911
- each.item.top = top + "px";
912
- }
913
- } else {
914
- // debugger;
915
- // this.indexFlg =0;
916
-
917
- // if (this.currentChooseItem.item.name == "用户任务") {
918
- // index = Math.max.apply("", [parseFloat(1)]);
919
- // index++;
920
- // } else {
921
- // index = Math.max.apply("", [
922
- // parseFloat(this.currentChooseItem.item.name.substring(4)),
923
- // ]);
924
- // this.indexFlg += 1;
925
- // }
926
- // let itemsdh = Math.max.apply("", [parseFloat(index)]);
927
- // itemsdh++;
928
- // debugger;
929
- t = new ProcessBuilder.Node(
930
- ProcessBuilder.createItem(
931
- this.id,
932
- // "用户任务",
933
- "审批人",
934
- // + this.indexFlg
935
- "userTask",
936
- "320px",
937
- "20px",
938
- this.currentNode.sourceId,
939
- this.currentNode.targetId
940
- )
941
- );
942
- this.currentChooseItem.item.isCondition = "0";
943
- this.currentChooseItem.item.to = t.item.id;
944
- t.item.left = this.currentChooseItem.item.left;
945
- if (
946
- this.currentChooseItem.lists &&
947
- this.currentChooseItem.lists.length > 0
948
- ) {
949
- this.currentChooseItem.lists[0].item.from = t.item.id;
950
- const oldItem = _.cloneDeep(this.currentChooseItem.lists[0]);
951
- this.currentChooseItem.lists[0] = t;
952
- t.lists.push(oldItem);
953
- } else {
954
- this.currentChooseItem.lists.push(t);
955
- }
956
- const result = ProcessBuilder.treeToListLocal(this.root.lists);
957
- result.sort(ProcessBuilder.compare("level"));
958
- for (let i = 0; i < result.length; i++) {
959
- // 重新计算当前结果中每一个元素的坐标位置信息
960
- const each = result[i];
961
- const top = 200 * (each.level - 1) + 20;
962
- each.item.top = top + "px";
963
- }
964
- }
965
- this.refresh();
966
- },
967
- editNode() {},
968
- showForm(node) {
969
- console.log(this.data.nodeList, "showForm");
970
- console.log(node)
971
- this.activeNode = node;
972
- if (node.type == "condition") {
973
- const condition = lodash.cloneDeep(node);
974
- const json = {};
975
- condition.conditions.forEach((item, index) => {
976
- if (item.isArray && item.variable != "userId") {
977
- item.value = item.value.split(",");
978
- }
979
- json[item.variable] = item;
980
- });
981
- this.connection = json;
982
- this.title = node.name;
983
- this.conditionVisible = true;
984
- } else if (node.type == "ccTask") {
985
-
986
- // node.approvers.forEach((item) => {
987
- // item.name = item.userName;
988
- // item.memberNo = item.userId;
989
- // });
990
- // node.notifiers.forEach((item) => {
991
- // item.name = item.userName;
992
- // item.memberNo = item.userId;
993
- // });
994
- // console.log(node.directorType, "*****");
995
- // // console.log(node.director ,"****director****");
996
- // const jsList = {
997
- // approverType: node.approverType,
998
- // approvers: node.approvers || [],
999
- // notifiers: node.notifiers || [],
1000
-
1001
- // // director: node.director || {},
1002
- // passCopy: node.passCopy
1003
- // };
1004
- // this.nodeInfo = jsList;
1005
- // if (node.directorType) {
1006
- // jsList.directorType = node.directorType;
1007
- // } else {
1008
- // jsList.directorType = {
1009
- // typeName: "指定成员",
1010
- // type: 1,
1011
- // authType: "1"
1012
- // };
1013
- // }
1014
- // if (node.approvers.length != 0) {
1015
- // jsList.approvers = node.approvers;
1016
- // } else {
1017
- // jsList.approvers = [{ directorId: 0, directorName: "直接主管" }];
1018
- // }
1019
- // // if (json.directorType.type==) {
1020
- // //
1021
- // // }
1022
- console.log(node)
1023
- const jsList = {
1024
- approverType: "1",
1025
- approvers: node.approvers || [],
1026
- notifiers: node.notifiers || []
1027
- // director: node.director || {},
1028
- // passCopy: node.passCopy
1029
- };
1030
-
1031
- jsList.directorType = {
1032
- typeName: "指定成员",
1033
- type: 1,
1034
- authType: "1",
1035
- isCCTask: true // 是否抄送人
1036
- };
1037
-
1038
- console.log(jsList)
1039
-
1040
- this.$nextTick(() => {
1041
- this.$refs.approverSelector.init(jsList);
1042
- });
1043
-
1044
- } else if (node.type == "userTask") {
1045
- node.approvers.forEach((item) => {
1046
- item.name = item.userName;
1047
- item.memberNo = item.userId;
1048
- });
1049
- node.notifiers.forEach((item) => {
1050
- item.name = item.userName;
1051
- item.memberNo = item.userId;
1052
- });
1053
- console.log(node.directorType, "*****");
1054
- // console.log(node.director ,"****director****");
1055
- const jsList = {
1056
- approverType: node.approverType,
1057
- approvers: node.approvers || [],
1058
- notifiers: node.notifiers || [],
1059
-
1060
- // director: node.director || {},
1061
- passCopy: node.passCopy
1062
- };
1063
- this.nodeInfo = jsList;
1064
- if (node.directorType) {
1065
- jsList.directorType = node.directorType;
1066
- } else {
1067
- jsList.directorType = {
1068
- typeName: "指定成员",
1069
- type: 1,
1070
- authType: "1"
1071
- };
1072
- }
1073
- if (node.approvers.length != 0) {
1074
- jsList.approvers = node.approvers;
1075
- } else {
1076
- jsList.approvers = [{ directorId: 0, directorName: "直接主管" }];
1077
- }
1078
- // if (json.directorType.type==) {
1079
- //
1080
- // }
1081
-
1082
- this.$nextTick(() => {
1083
- this.$refs.approverSelector.init(jsList);
1084
- });
1085
- }
1086
- },
1087
- changeNodeName(data) {
1088
- if (data.node.type == "condition") {
1089
- this.params.gateWayList.forEach((item, index) => {
1090
- if (item.id == data.node.id) {
1091
- item.name = data.name;
1092
- }
1093
- });
1094
- }
1095
- data.node.name = data.name;
1096
- },
1097
- editName(data) {
1098
- this.title = data;
1099
- this.activeNode.name = data;
1100
- },
1101
- // 设置节点条件
1102
- setCondition(data) {
1103
- console.log(data);
1104
- const conditions = Object.entries(data.form).map(([key, val]) => {
1105
- if (Array.isArray(val.value)) {
1106
- return {
1107
- ...val,
1108
- variable: key,
1109
- value:
1110
- key == "userId" || key == data.SxyData ? "" : val.value.join(","),
1111
- opt: "=",
1112
- isArray: true,
1113
- sponsors:
1114
- key == "userId" || key == data.SxyData ? val.sponsors : []
1115
- };
1116
- } else {
1117
- return {
1118
- ...val,
1119
- variable: key,
1120
- isArray: false
1121
- };
1122
- }
1123
- });
1124
- this.activeNode.conditions = conditions;
1125
- this.activeNode.desc = data.desc.join(" 并且 ");
1126
- this.params.gateWayList.forEach((item) => {
1127
- if (item.id == this.activeNode.id) {
1128
- item.conditions = this.activeNode.conditions;
1129
- item.desc = this.activeNode.desc;
1130
- }
1131
- });
1132
- this.conditionVisible = false;
1133
- },
1134
- // 加载流程图
1135
- dataReload(data) {},
1136
- findNodeById(data, id) {
1137
- const self = this;
1138
- if (data.item.id == id) {
1139
- self.currentChooseItem = data;
1140
- return;
1141
- } else {
1142
- data.lists.forEach((each, index) => {
1143
- if (each.item.id == id) {
1144
- self.currentChooseItem = each;
1145
- return;
1146
- }
1147
- self.findNodeById(each, id);
1148
- });
1149
- }
1150
- },
1151
- addExtraCondition(event, flg) {
1152
- // 添加一个新的Condition条件信息
1153
- if (!this.isClick) return;
1154
- const obj = event.currentTarget;
1155
- let id = obj.id;
1156
-
1157
- if (id != "") {
1158
- id = id.replace("flowchartWindow", "");
1159
- this.findNodeById(this.root, parseInt(id));
1160
- }
1161
-
1162
- this.id += 1;
1163
- let index = flg
1164
- ? 1
1165
- : Math.max.apply(
1166
- "",
1167
- this.currentChooseItem.lists.map((item) =>
1168
- parseFloat(item.item.name.substring(2))
1169
- )
1170
- );
1171
- index++;
1172
- const t1 = new ProcessBuilder.Node(
1173
- ProcessBuilder.createItem(
1174
- this.id,
1175
- "条件" + index,
1176
- "condition",
1177
- "320px",
1178
- "20px",
1179
- this.currentNode.sourceId,
1180
- this.currentNode.targetId
1181
- )
1182
- );
1183
- let oldItem;
1184
- const num = 0;
1185
- if (id == "") {
1186
- oldItem = this.currentChooseItem.lists[0];
1187
- const num = this.currentChooseItem.lists[0].lists.length;
1188
- this.currentChooseItem.lists[0].lists.push(t1);
1189
- } else {
1190
- oldItem = this.currentChooseItem;
1191
- this.currentChooseItem.lists.push(t1);
1192
- }
1193
-
1194
- t1.item.from = oldItem.item.id;
1195
- t1.item.to = oldItem.lists[0].item.to;
1196
-
1197
- this.setResultToNode();
1198
- this.refresh();
1199
- },
1200
- setResultToNode() {
1201
- const result = ProcessBuilder.treeToListLocal(this.root.lists);
1202
- result.sort(ProcessBuilder.compare("level"));
1203
- console.log(result, "result");
1204
- const level = 0;
1205
- const levelSort = 0;
1206
- let maxWidth = 320;
1207
- for (let i = result.length; i > 0; i--) {
1208
- // 重新计算当前结果中每一个元素的坐标位置信息
1209
- const each = result[i - 1];
1210
- for (let j = 0; j < each.lists.length; j++) {
1211
- const e = each.lists[j];
1212
- if (j == 0) {
1213
- e.item.left = maxWidth / 2 + "px";
1214
- } else {
1215
- maxWidth += 320;
1216
- e.item.left = maxWidth + "px";
1217
- this.resetNodeLeft(e);
1218
- }
1219
- }
1220
- const top = 200 * (each.level - 1) + 20;
1221
- each.item.top = top + "px";
1222
- }
1223
- this.data.nodeList = result;
1224
- //
1225
- },
1226
- resetNodeLeft(e) {
1227
- if (e.item.type == "condition" || e.item.type == "userTask") {
1228
- if (e.lists.length > 0) {
1229
- e.lists.forEach((con) => {
1230
- con.item.left = e.item.left;
1231
- this.resetNodeLeft(con);
1232
- });
1233
- }
1234
- } else if (e.item.type == "addCondition") {
1235
- e.lists.forEach((con, index) => {
1236
- con.item.left = parseFloat(e.item.left) - 160 + index * 320 + "px";
1237
- this.resetNodeLeft(con);
1238
- });
1239
- }
1240
- }
1241
- }
1242
- };
1243
- </script>
1244
- <style>
1245
- .right-plan {
1246
- /* height: calc(100vh - 100px); */
1247
- overflow-y: auto;
1248
- }
1249
- .process-heard {
1250
- padding: 10px 20px;
1251
- display: flex;
1252
- align-items: center;
1253
- justify-content: space-between;
1254
- }
1255
- .process-heard .el-icon-edit {
1256
- cursor: pointer;
1257
- }
1258
- .process-heard .process-title {
1259
- font-size: 18px;
1260
- margin-right: 10px;
1261
- }
1262
- #flowContainer {
1263
- height: 10000px;
1264
- /* background-color: rgb(251, 251, 251); */
1265
- /*background-color: #42b983;*/
1266
- position: relative;
1267
- overflow: auto;
1268
- height: calc(100vh - 144px);
1269
- }
1270
- .container-process {
1271
- display: flex;
1272
- flex-direction: column;
1273
- align-items: center;
1274
- }
1275
- .labelClass {
1276
- background-color: white;
1277
- padding: 5px;
1278
- opacity: 0.7;
1279
- border: 1px solid #346789;
1280
- /*border-radius: 10px;*/
1281
- cursor: pointer;
1282
- -webkit-user-select: none;
1283
- -moz-user-select: none;
1284
- -ms-user-select: none;
1285
- user-select: none;
1286
- }
1287
- .aLabel {
1288
- width: 30px;
1289
- height: 30px;
1290
- margin-top: 25px;
1291
- background: url("../../assets/process/jia.png") center center no-repeat;
1292
- cursor: pointer;
1293
- }
1294
- .switch {
1295
- display: inline-block;
1296
- margin-right: 30px;
1297
- }
1298
- .switch > span {
1299
- margin-right: 10px;
1300
- }
1301
-
1302
- .add-condition {
1303
- color: #66a6e0;
1304
- font-size: 14px;
1305
- text-align: center;
1306
- padding: 10px 0;
1307
- border: 1px solid #66a6e0;
1308
- cursor: pointer;
1309
- position: absolute;
1310
- width: 200px;
1311
- }
1312
-
1313
- .condition-container {
1314
- display: flex;
1315
- }
1316
- .condition-item {
1317
- margin: 30px;
1318
- padding: 20px;
1319
- }
1320
- .gray-background-class {
1321
- background-color: #f4f4f8;
1322
- }
1323
- </style>
1
+ <template>
2
+ <div v-if="easyFlowVisible">
3
+ <el-row v-if="tools">
4
+ <el-col :span="24" class="right-plan">
5
+ <div class="process-heard">
6
+ <template v-if="queryName">
7
+ <div v-if="isEdit">
8
+ <span class="process-title">{{queryName}}流程</span>
9
+ <!-- <i class="el-icon-edit" @click.stop="isEdit = false; conName = name"></i> -->
10
+ </div>
11
+ <div v-else>
12
+ <el-input
13
+ autofocus
14
+ v-model="conName"
15
+ placeholder="请输入内容"
16
+ @blur="changeName"
17
+ ></el-input>
18
+ </div>
19
+ </template>
20
+ <div v-else></div>
21
+ <div>
22
+ <div class="switch">
23
+ <span>是否开启审批:</span>
24
+ <el-switch v-model="isFlg"> </el-switch>
25
+ </div>
26
+ <el-button @click="cancal">取消</el-button>
27
+ <el-button type="primary" @click="save">保存</el-button>
28
+ </div>
29
+ </div>
30
+ </el-col>
31
+ </el-row>
32
+ <!--画布-->
33
+ <el-col :span="24">
34
+ <div id="flowContainer" class="container-process">
35
+ <!-- {{data.nodeList}} -->
36
+ <template v-for="(node, index) in data.nodeList">
37
+ <flow-node
38
+ ref="flowNode"
39
+ v-if="node.item.type !== 'addCondition'"
40
+ :key="index"
41
+ :node="node.item"
42
+ :level="node.level"
43
+ @deleteNode="deleteNode"
44
+ @changeNodeSite="changeNodeSite"
45
+ @nodeRightMenu="nodeRightMenu"
46
+ @editNode="editNode"
47
+ @showForm="showForm"
48
+ @changeName="changeNodeName"
49
+ ></flow-node>
50
+ <div
51
+ :id="'flowchartWindow' + node.item.id"
52
+ @click="addExtraCondition($event)"
53
+ class="add-condition"
54
+ :style="{ top: node.item.top, left: node.item.left }"
55
+ v-else
56
+ :key="node.item.id + '_add'"
57
+ >
58
+ 添加条件
59
+ </div>
60
+ </template>
61
+ <flow-node-condition
62
+ :formData="connection"
63
+ :title="title"
64
+ @edit="editName"
65
+ v-show="conditionVisible"
66
+ @save="setCondition"
67
+ @cancal="conditionVisible = false"
68
+ ref="conditionForm"
69
+ ></flow-node-condition>
70
+ <add-node-box
71
+ v-if="showAddNode"
72
+ :info="addNodeInfo"
73
+ @close="
74
+ () => {
75
+ showAddNode = false;
76
+ }
77
+ "
78
+ @addNode="addNode"
79
+ ></add-node-box>
80
+ </div>
81
+ </el-col>
82
+
83
+ <!-- <el-row>
84
+ <div id="start" style="border:1px solid #000;width:200px;height:300;margin-bottom:150px">开始</div>
85
+ <div id="end" style="border:1px solid #000;width:200px;height:300;margin-bottom:150px">结束</div>
86
+ </el-row> -->
87
+ <approver-selector
88
+ :approverList="approverSelectorData.approverList"
89
+ :notifierList="approverSelectorData.notifierList"
90
+ v-model="selectorVisible"
91
+ @save="setNode"
92
+ ref="approverSelector"
93
+ ></approver-selector>
94
+ </div>
95
+ </template>
96
+
97
+ <script>
98
+ // import draggable from "vuedraggable";
99
+ import jsPlumb from "jsplumb";
100
+ import flowNode from "./components/planNode";
101
+ // import nodeMenu from "./components/nodeMenu";
102
+ import FlowNodeCondition from "./components/nodeConditionConfig";
103
+ import addNodeBox from "./components/addNode";
104
+ import approverSelector from "./components/approverSelector";
105
+ import lodash from "lodash";
106
+ import * as api from "../../api/apiProcess";
107
+ import * as ProcessBuilder from "../../views/formBuilder/service/ProcessBuilder";
108
+ export default {
109
+ props: ["queryInfo","tools","path","userInfo"],
110
+ data() {
111
+ return {
112
+ approverSelectorData: {
113
+ approverList: [],
114
+ notifierList: []
115
+ },
116
+ memberSelectorType: 0,
117
+ selectorVisible: false,
118
+ jsPlumb: null,
119
+ isFlg: true,
120
+ isEdit: true,
121
+ easyFlowVisible: true,
122
+ nodeVisible: false,
123
+ nodeInfo: {},
124
+ data: {
125
+ nodeList: [],
126
+ lineList: []
127
+ },
128
+ connection: {},
129
+ title: "",
130
+ conditionVisible: false,
131
+ showAddNode: false,
132
+ addNodeInfo: {
133
+ top: "0",
134
+ left: "0",
135
+ isShwo: true
136
+ },
137
+ root: new ProcessBuilder.Node(
138
+ ProcessBuilder.createItem(
139
+ "0",
140
+ "根节点",
141
+ "root",
142
+ "320px",
143
+ "20px",
144
+ "1",
145
+ "2"
146
+ )
147
+ ),
148
+ currentChooseItem: {},
149
+ currentNode: {
150
+ sourceId: "",
151
+ targetId: ""
152
+ },
153
+ id: 0,
154
+ params: {},
155
+ processId: "",
156
+ isFlg: true,
157
+ isClick: true,
158
+ name: "",
159
+ version: 1,
160
+ indexFlg: 1
161
+ };
162
+ },
163
+ components: {
164
+ flowNode,
165
+ // FlowNodeForm,
166
+ FlowNodeCondition,
167
+ addNodeBox,
168
+ approverSelector
169
+ },
170
+ computed: {
171
+ user: function() {
172
+ // this.$store.state.user
173
+ return "";
174
+ },
175
+ orgSelectorList() {
176
+ return this.memberSelectorType === 0
177
+ ? this.nodeInfo.approvers
178
+ : this.nodeInfo.notifiers;
179
+ }
180
+ },
181
+ created() {
182
+ this.type = this.queryInfo.type
183
+ },
184
+ mounted() {
185
+ this.jsPlumbInit();
186
+ },
187
+ methods: {
188
+ async save() {
189
+ // const user = this.$store.state.user;
190
+ const user = this.userInfo;
191
+ const flg = false;
192
+ if (this.path == "/index") {
193
+ // this.params.menuId = this.$store.state.formBuilder.menuId;
194
+ this.params.menuId = ""
195
+ }
196
+ this.params.switchOn = this.isFlg ? "1" : "0";
197
+ let res;
198
+
199
+ if (this.processId) {
200
+ const data = {
201
+ id: this.processId + "",
202
+ content: JSON.stringify(this.params)
203
+ };
204
+ res = await api.updateProcess(data);
205
+ } else {
206
+ const data = {
207
+ content: JSON.stringify(this.params)
208
+ };
209
+ res = await api.saveProcess(data);
210
+ }
211
+
212
+ for (let i = 0; i < this.params.nodeList.length; i++) {
213
+ if (
214
+ this.params.nodeList[i].item.type == "userTask" &&
215
+ this.params.nodeList[i].item.approvers.length == 0 &&
216
+ this.params.nodeList[i].item.directorType &&
217
+ this.params.nodeList[i].item.directorType.type == 1
218
+ ) {
219
+ this.$message.error(
220
+ "当前审批流程中【" +
221
+ this.params.nodeList[i].item.name +
222
+ "】节点审批人不能为空"
223
+ );
224
+ return;
225
+ }
226
+ }
227
+ if (res.data.state == "ok") {
228
+ this.$message.success({
229
+ message: this.processId ? "编辑成功" : "保存成功",
230
+ duration: 1500
231
+ });
232
+ this.processId = res.data.data;
233
+ if (this.type.indexOf("customForm_") == -1) {
234
+ this.$removeTag1(this.$route);
235
+ this.$router.go(-1);
236
+ }
237
+ } else {
238
+ this.$message.error({
239
+ message: res.data.msg ? res.data.msg : "保存失败",
240
+ duration: 1500
241
+ });
242
+ }
243
+ },
244
+ cancal() {
245
+ this.$confirm("有修改的内容未保存,确认离开吗?", "提示", {
246
+ confirmButtonText: "确定",
247
+ cancelButtonText: "取消",
248
+ type: "warning"
249
+ })
250
+ .then(() => {
251
+ this.$removeTag1(this.$route);
252
+ this.$router.go(-1);
253
+ })
254
+ .catch(() => {});
255
+ },
256
+ initProcess() {
257
+ this.easyFlowVisible = false;
258
+ const start = new ProcessBuilder.Node(
259
+ ProcessBuilder.createItem(
260
+ "1",
261
+ "开始",
262
+ "start",
263
+ "320px",
264
+ "20px",
265
+ "1",
266
+ "2"
267
+ )
268
+ );
269
+ const userTask = new ProcessBuilder.Node(
270
+ ProcessBuilder.createItem(
271
+ "2",
272
+ // "用户任务",
273
+ "审批人",
274
+ "userTask",
275
+ "320px",
276
+ "200px",
277
+ "1",
278
+ "3"
279
+ )
280
+ );
281
+
282
+
283
+
284
+ // const userTask1 = new ProcessBuilder.Node(
285
+ // ProcessBuilder.createItem(
286
+ // "8",
287
+ // // "用户任务",
288
+ // "审批人",
289
+ // "userTask",
290
+ // "320px",
291
+ // "400px",
292
+ // "7",
293
+ // "5"
294
+ // )
295
+ // );
296
+
297
+ const ccTask = new ProcessBuilder.Node(
298
+ ProcessBuilder.createItem(
299
+ "3",
300
+ // "用户任务",
301
+ "抄送人",
302
+ "ccTask",
303
+ "320px",
304
+ "350px",
305
+ "7",
306
+ "5"
307
+ )
308
+ );
309
+
310
+ const end = new ProcessBuilder.Node(
311
+ ProcessBuilder.createItem(
312
+ "5",
313
+ "结束",
314
+ "end",
315
+ "320px",
316
+ "330px",
317
+ "2",
318
+ "5"
319
+ )
320
+ );
321
+ this.root.add(start);
322
+ start.add(userTask);
323
+ userTask.add(ccTask);
324
+ ccTask.add(end)
325
+ // this.root.scan()
326
+ this.refresh();
327
+ },
328
+ refresh() {
329
+ this.jsPlumb.reset();
330
+ const result = this.root.lists;
331
+ const temp1 = result[0];
332
+ var nodeList = ProcessBuilder.treeToListLocal(result);
333
+
334
+ const self = this;
335
+ // 计算结束和开始标签相关的位置坐标
336
+ let left = 0;
337
+ const top = 0;
338
+ let end;
339
+ let start;
340
+ let addCondition;
341
+ let addConditionLeft = 0;
342
+ let maxLevel = 0;
343
+ for (let i = 0; i < nodeList.length; i++) {
344
+ const each = nodeList[i];
345
+ if (parseFloat(each.item.left) > left) {
346
+ left = parseFloat(each.item.left);
347
+ }
348
+ if (maxLevel < each.level && each.item.type != "end") {
349
+ maxLevel = each.level;
350
+ }
351
+ if (each.item.type == "end") {
352
+ end = each;
353
+ }
354
+ if (each.item.type == "start") {
355
+ start = each;
356
+ }
357
+
358
+ if (each.item.type == "addCondition") {
359
+ addCondition = each;
360
+ const min = addCondition.lists[0];
361
+ const max = addCondition.lists[addCondition.lists.length - 1];
362
+ const sum = parseFloat(min.item.left) + parseFloat(max.item.left);
363
+ if (addConditionLeft < sum / 2) {
364
+ addConditionLeft = sum / 2;
365
+ }
366
+ addCondition.item.left = sum / 2 + "px";
367
+ }
368
+ }
369
+ console.log(maxLevel);
370
+ const postion =
371
+ addConditionLeft > 0 ? addConditionLeft : (left + 320) / 2;
372
+ end.item.left = postion + "px";
373
+ end.level = maxLevel + 1;
374
+ end.item.top = 200 * (end.level - 1) + 20 + "px";
375
+ start.item.left = postion + "px";
376
+
377
+ this.data.nodeList = nodeList;
378
+ this.easyFlowVisible = true;
379
+ var label = [
380
+ "Label",
381
+ {
382
+ location: 0.0,
383
+ label: "",
384
+ cssClass: "aLabel",
385
+ events: {
386
+ click: function(e, originalEvent) {
387
+ const label = e.getElement();
388
+ const top = parseFloat(label.style.top) - 35;
389
+ const left = parseFloat(label.style.left) + 30;
390
+ self.showAddNode = true;
391
+ self.addNodeInfo = {
392
+ top: top,
393
+ left: left
394
+ };
395
+ var obj = e.component;
396
+ const sourceId = obj.sourceId.replace("flowchartWindow", "");
397
+ const targetId = obj.targetId.replace("flowchartWindow", "");
398
+ self.currentNode.sourceId = sourceId;
399
+ self.currentNode.targetId = targetId;
400
+ }
401
+ }
402
+ }
403
+ ];
404
+ var lineConnector = {
405
+ endpoint: ["Dot", { radius: 3 }],
406
+ connector: ["Flowchart"],
407
+ anchors: ["Bottom", "Top"],
408
+ overlays: [
409
+ [
410
+ "Arrow",
411
+ {
412
+ width: 10,
413
+ length: 10,
414
+ location: 1
415
+ }
416
+ ],
417
+ label
418
+ ]
419
+ };
420
+
421
+ var noLabelLineConn = {
422
+ endpoint: ["Dot", { radius: 3 }],
423
+ connector: ["Flowchart"],
424
+ anchors: ["Bottom", "Top"],
425
+ overlays: [
426
+ [
427
+ "Arrow",
428
+ {
429
+ width: 10,
430
+ length: 10,
431
+ location: 1
432
+ }
433
+ ]
434
+ ]
435
+ };
436
+ this.$nextTick(function() {
437
+ const gateWayList = [];
438
+ const _this = this;
439
+ for (let i = 0; i < this.data.nodeList.length; i++) {
440
+ const node = this.data.nodeList[i];
441
+
442
+ // 禁止移动开始节点
443
+ this.jsPlumb.draggable("flowchartWindow" + node.item.id, {
444
+ grid: [20, 20],
445
+ containment: "parent", // 设置只能在父级范围内拖动节点
446
+ stop: function(event) {
447
+ _this.isClick = false;
448
+ setTimeout(() => {
449
+ _this.isClick = true;
450
+ }, 1000);
451
+ event.e.preventDefault();
452
+ }
453
+ });
454
+
455
+ if (node.item.type != "end") {
456
+ if (node.lists.length > 0 && node.item.type == "addCondition") {
457
+ for (let j = 0; j < node.lists.length; j++) {
458
+ const each = node.lists[j];
459
+ const gateWayItem = {
460
+ id: each.item.id,
461
+ type: "condition",
462
+ name: each.item.name,
463
+ left: each.item.left,
464
+ top: each.item.top,
465
+ from: each.item.from,
466
+ gateWayKey: node.item.id,
467
+ to: each.item.to,
468
+ conditions: each.item.conditions,
469
+ ifNo: 10,
470
+ desc: each.item.desc,
471
+ isCondition: each.item.isCondition
472
+ };
473
+ gateWayList.push(gateWayItem);
474
+ this.jsPlumb.connect(
475
+ {
476
+ source: "flowchartWindow" + node.item.id,
477
+ target: "flowchartWindow" + each.item.id
478
+ },
479
+ noLabelLineConn
480
+ );
481
+ }
482
+ } else {
483
+ this.jsPlumb.connect(
484
+ {
485
+ source: "flowchartWindow" + node.item.id,
486
+ target: "flowchartWindow" + node.item.to
487
+ },
488
+ lineConnector
489
+ );
490
+ }
491
+ }
492
+ }
493
+ this.loadEasyFlowFinish = true;
494
+ // 拼凑指定的数据结构 供后台进行接收解析
495
+
496
+ const params = {
497
+ name: this.name,
498
+ desc: "",
499
+ creator: this.user.no,
500
+ processId: this.processId,
501
+ startId: "1",
502
+ endId: "5",
503
+ companyId: this.user.cno,
504
+ type: this.type,
505
+ switchOn: this.isFlg ? "1" : "0",
506
+ gateWayList: gateWayList,
507
+ nodeList: this.data.nodeList,
508
+ lineList: [],
509
+ version: this.version
510
+ };
511
+ this.params = params;
512
+ // console.log("param----->", JSON.stringify(params));
513
+ });
514
+ },
515
+ async jsPlumbInit() {
516
+ // 初始化流程图实例信息
517
+ const self = this;
518
+ // this.jsPlumb = jsPlumb.getInstance();
519
+ this.jsPlumb = jsPlumb.jsPlumb
520
+ ? jsPlumb.jsPlumb.getInstance()
521
+ : jsPlumb.getInstance();
522
+ this.jsPlumb.importDefaults({
523
+ ConnectionsDetachable: false
524
+ });
525
+ const param = {
526
+ companyId: this.user.cno + "",
527
+ type: this.type
528
+ };
529
+
530
+ const res = await api.queryProcessByType(param);
531
+
532
+ if (res.data.data && res.data.data.gateWays) {
533
+ const content = JSON.parse(res.data.data.content);
534
+ this.data = { nodeList: content.nodeList, lineList: content.lineList };
535
+ // todo:
536
+ this.name = this.queryInfo.name
537
+ ? this.queryInfo.name + "流程"
538
+ : content.name;
539
+ this.isFlg = content.switchOn != 0;
540
+ this.processId = res.data.data._id;
541
+ this.version = res.data.data.rootNode.version;
542
+ this.root.add(content.nodeList[0]);
543
+ // this.root.scan()
544
+ this.refresh();
545
+ const ids = content.nodeList.map((item) => parseFloat(item.item.id));
546
+ this.id = Math.max.apply(null, ids);
547
+ } else {
548
+ if (res.data.data && res.data.data._id) {
549
+ this.processId = res.data.data._id;
550
+ const processList = JSON.parse(res.data.data.content);
551
+ this.name = processList.name;
552
+ this.name = this.queryInfo.name
553
+ ? this.queryInfo.name + "流程"
554
+ : processList.name;
555
+
556
+ this.isFlg = processList.switchOn != 0;
557
+ this.version = res.data.data.rootNode.version;
558
+ const isflg = this.dataTonewList(processList.nodeList);
559
+ if (isflg) {
560
+ this.refresh();
561
+ const ids = processList.nodeList.map((item) => parseFloat(item.id));
562
+ this.id = Math.max.apply(null, ids);
563
+ setTimeout(async() => {
564
+ const data = {
565
+ id: this.processId + "",
566
+ content: JSON.stringify(this.params)
567
+ };
568
+ console.log(data);
569
+ const res = await api.updateProcessToNew(data);
570
+ }, 200);
571
+ } else {
572
+ this.name = this.queryInfo.name
573
+ ? this.queryInfo.name + "流程"
574
+ : "流程";
575
+ this.initProcess();
576
+ const result = ProcessBuilder.treeToListLocal(this.root.lists);
577
+ this.id = result.length + 10;
578
+ }
579
+ } else {
580
+ this.name = this.queryInfo.name
581
+ ? this.queryInfo.name + "流程"
582
+ : "流程";
583
+ this.initProcess();
584
+ const result = ProcessBuilder.treeToListLocal(this.root.lists);
585
+ this.id = result.length + 10;
586
+ }
587
+ }
588
+ },
589
+ dataTonewList(processList) {
590
+ let parent = this.root;
591
+ let currentId = 1;
592
+ let isflg = true;
593
+ while (parent.item.type != "end" && isflg) {
594
+ const currentNode = this.getCurrentNode(processList, currentId);
595
+ if (!currentNode) {
596
+ isflg = false;
597
+ break;
598
+ }
599
+ const node = new ProcessBuilder.Node(
600
+ ProcessBuilder.createItem(
601
+ currentNode.id,
602
+ currentNode.name,
603
+ currentNode.type,
604
+ currentNode.left,
605
+ currentNode.top,
606
+ currentNode.from,
607
+ currentNode.to
608
+ )
609
+ );
610
+ if (currentNode.type == "userTask") {
611
+ node.item = Object.assign(node.item, {
612
+ approverType: currentNode.approverType,
613
+ approvers: currentNode.approvers,
614
+ notifiers: currentNode.notifiers,
615
+ passCopy: currentNode.passCopy
616
+ // directorType: currentNode.directorType,
617
+ });
618
+ }
619
+ if (currentNode.type == "condition") {
620
+ currentId = currentNode.to;
621
+ parent.item.to = currentNode.to;
622
+ } else {
623
+ parent.add(node);
624
+ currentId = currentNode.to;
625
+ parent = node;
626
+ }
627
+ }
628
+ return isflg;
629
+ },
630
+ getCurrentNode(list, id) {
631
+ const node = list.filter((item) => item.id == id);
632
+ return node.length > 0 ? node[0] : null;
633
+ },
634
+ setNode(data) {
635
+ console.log(data);
636
+
637
+ const result = JSON.parse(data);
638
+ this.activeNode.directorType = result.directorType;
639
+ this.activeNode.approverType = result.approverType;
640
+ this.activeNode.approvers = result.approvers;
641
+ this.activeNode.notifiers = result.notifiers;
642
+ this.activeNode.passCopy = result.passCopy;
643
+
644
+ // 强制刷新子组件
645
+ this.$refs.flowNode.map(item => {
646
+ item.refreshFlowItem()
647
+ })
648
+ },
649
+ deleteNode(e, current) {
650
+ // 弹框提示是否需要继续进行当前操作.
651
+ // if (e.type == "userTask") {
652
+ // const approverNode = this.data.nodeList.filter(
653
+ // (item) => item.item.type == "userTask"
654
+ // );
655
+ // if (approverNode.length < 2) {
656
+ // this.$message.error("流程中必须保留一个审批节点");
657
+ // return;
658
+ // }
659
+ // }
660
+ // if (e.type == "ccTask") {
661
+ // const approverNode = this.data.nodeList.filter(
662
+ // (item) => item.item.type == "ccTask"
663
+ // );
664
+ // if (approverNode.length < 2) {
665
+ // this.$message.error("流程中必须保留一个抄送节点");
666
+ // return;
667
+ // }
668
+ // }
669
+ if (this.data.nodeList.length == 3) {
670
+ this.$message.error("流程中必须保留一个审批或抄送节点");
671
+ return;
672
+ }
673
+ this.$confirm("确定需要删除当前节点?", "提示", {
674
+ confirmButtonText: "确定",
675
+ cancelButtonText: "取消",
676
+ type: "warning"
677
+ })
678
+ .then(() => {
679
+ let NextNode = null;
680
+
681
+ this.findNodeById(this.root, e.id);
682
+ const myself = _.cloneDeep(this.currentChooseItem);
683
+
684
+ this.findNodeById(this.root, e.from);
685
+
686
+ console.log(myself.item.type)
687
+ if (myself.item.type == "userTask") {
688
+ this.currentChooseItem.item.to = myself.item.to;
689
+ this.currentChooseItem.lists = myself.lists;
690
+ this.currentChooseItem.lists.forEach((item, index) => {
691
+ item.item.from = this.currentChooseItem.item.id;
692
+ });
693
+
694
+ this.data.nodeList.map((value, index) => {
695
+ const { type, from } = this.data.nodeList[index].item
696
+ if (type == "condition" && from == this.currentChooseItem.item.from) {
697
+ this.data.nodeList[index].item.to = myself.item.to
698
+ }
699
+ })
700
+
701
+ } else if (myself.item.type == "ccTask") {
702
+ this.currentChooseItem.item.to = myself.item.to;
703
+ this.currentChooseItem.lists = myself.lists;
704
+ this.currentChooseItem.lists.forEach((item, index) => {
705
+ item.item.from = this.currentChooseItem.item.id;
706
+ });
707
+
708
+ this.data.nodeList.map((value, index) => {
709
+ const { type, from } = this.data.nodeList[index].item
710
+ if (type == "condition" && from == this.currentChooseItem.item.from) {
711
+ this.data.nodeList[index].item.to = myself.item.to
712
+ }
713
+ })
714
+
715
+ } else {
716
+ const conditionLength = this.currentChooseItem.lists.length;
717
+ if (conditionLength > 2) {
718
+ this.currentChooseItem.lists.forEach((item, index) => {
719
+ if (item.item.id == e.id) {
720
+ this.currentChooseItem.lists.splice(index, 1);
721
+ if (index == 0) {
722
+ this.currentChooseItem.item.to = this.currentChooseItem.lists[1].item.id;
723
+ NextNode = this.currentChooseItem.lists[1];
724
+ }
725
+ }
726
+ });
727
+ } else {
728
+ const listsItem = _.cloneDeep(
729
+ this.currentChooseItem.lists[0].lists[0]
730
+ );
731
+ const grandPaNodeNo = this.currentChooseItem.item.from;
732
+ if (listsItem) {
733
+ listsItem.item.from = grandPaNodeNo;
734
+ listsItem.item.left = this.currentChooseItem.item.left;
735
+ this.findNodeById(this.root, grandPaNodeNo);
736
+ this.currentChooseItem.item.to = listsItem.item.id;
737
+ // const end = new ProcessBuilder.Node(ProcessBuilder.createItem("5", "结束", "end", "320px", "380px", this.currentChooseItem.item.id, "5"));
738
+ this.currentChooseItem.lists = [listsItem];
739
+ this.data.nodeList.map((value, index) => {
740
+ const { type, from } = this.data.nodeList[index].item
741
+ if (type == "condition" && from == this.currentChooseItem.item.from) {
742
+ this.data.nodeList[index].item.to = listsItem.item.id;
743
+ }
744
+ })
745
+ } else {
746
+ this.findNodeById(this.root, grandPaNodeNo);
747
+ this.currentChooseItem.item.to = current.to
748
+
749
+ this.currentChooseItem.lists = myself.lists;
750
+ this.currentChooseItem.lists.forEach((item, index) => {
751
+ item.item.from = this.currentChooseItem.item.id;
752
+ });
753
+
754
+ this.data.nodeList.map((value, index) => {
755
+ const { type, from } = this.data.nodeList[index].item
756
+ if (type == "condition" && from == this.currentChooseItem.item.from) {
757
+ this.data.nodeList[index].item.to = current.to
758
+ }
759
+ })
760
+ // const end = new ProcessBuilder.Node(
761
+ // ProcessBuilder.createItem(
762
+ // "5",
763
+ // "测试结束",
764
+ // "end",
765
+ // "320px",
766
+ // "380px",
767
+ // this.currentChooseItem.item.id,
768
+ // "5"
769
+ // )
770
+ // );
771
+
772
+ // this.currentChooseItem.lists = [end];
773
+
774
+ }
775
+ }
776
+ }
777
+
778
+
779
+
780
+ const result = ProcessBuilder.treeToListLocal(this.root.lists);
781
+ if (NextNode) {
782
+ const node = result.filter((item) => item.item.type == "end");
783
+ const end = new ProcessBuilder.Node(
784
+ ProcessBuilder.createItem(
785
+ "5",
786
+ "结束",
787
+ "end",
788
+ "320px",
789
+ "380px",
790
+ "",
791
+ "5"
792
+ )
793
+ );
794
+ if (node.length < 1) {
795
+ const list = this.getLastList(NextNode);
796
+ list.push(end);
797
+ }
798
+ this.setResultToNode();
799
+ }
800
+ // TODO:记得抽取这个重新计算元素坐标的功能方法
801
+ result.sort(ProcessBuilder.compare("level"));
802
+ for (let i = 0; i < result.length; i++) {
803
+ // 重新计算当前结果中每一个元素的坐标位置信息
804
+ const each = result[i];
805
+ const top = 200 * (each.level - 1) + 20;
806
+ each.item.top = top + "px";
807
+ }
808
+ this.refresh();
809
+ })
810
+ .catch(() => {});
811
+ },
812
+ getLastList(node) {
813
+ if (node.lists.length == 0) {
814
+ return node.lists;
815
+ } else {
816
+ return this.getLastList(node.lists[0]);
817
+ }
818
+ },
819
+ changeNodeSite() {},
820
+ nodeRightMenu() {},
821
+ addNode(nodeMenu) {
822
+ this.showAddNode = false;
823
+ this.findNodeById(this.root, this.currentNode.sourceId);
824
+ this.id += 1;
825
+ let t;
826
+
827
+ if (nodeMenu.type == "condition") {
828
+ console.log(this.currentNode)
829
+ console.log(this.currentChooseItem)
830
+
831
+ t = new ProcessBuilder.Node(
832
+ ProcessBuilder.createItem(
833
+ this.id,
834
+ "条件" + this.id,
835
+ "addCondition",
836
+ this.currentChooseItem.item.left,
837
+ "20px",
838
+ this.currentNode.sourceId,
839
+ this.currentNode.targetId
840
+ )
841
+ );
842
+ this.currentChooseItem.item.isCondition = "1";
843
+ this.currentChooseItem.item.to = t.item.id;
844
+
845
+ let oldItem = null;
846
+ if (this.currentChooseItem.lists.length > 0) {
847
+ this.currentChooseItem.lists[0].item.from = t.item.id;
848
+ oldItem = _.cloneDeep(this.currentChooseItem.lists[0]);
849
+ }
850
+ this.id += 1;
851
+ const t1 = new ProcessBuilder.Node(
852
+ ProcessBuilder.createItem(
853
+ this.id,
854
+ "条件" + 1,
855
+ "condition",
856
+ "320px",
857
+ "20px",
858
+ this.currentNode.sourceId,
859
+ this.currentNode.targetId
860
+ )
861
+ );
862
+ t.item.to = t1.item.id;
863
+ t1.item.from = t.item.id;
864
+ t1.item.to = oldItem ? oldItem.item.id : this.currentNode.targetId;
865
+
866
+ if (oldItem && oldItem.item.type == "addCondition") {
867
+ t1.item.isCondition = "1";
868
+ }
869
+ if (oldItem) {
870
+ oldItem.item.from = t1.item.id;
871
+ t1.lists.push(oldItem);
872
+ }
873
+ this.currentChooseItem.lists[0] = t;
874
+ t.lists.push(t1);
875
+ this.addExtraCondition(event, true);
876
+ } else if (nodeMenu.type == "copyUser") {
877
+
878
+ // 抄送人节点
879
+ t = new ProcessBuilder.Node(
880
+ ProcessBuilder.createItem(
881
+ this.id,
882
+ "抄送人",
883
+ // + this.indexFlg
884
+ "ccTask",
885
+ "320px",
886
+ "20px",
887
+ this.currentNode.sourceId,
888
+ this.currentNode.targetId
889
+ )
890
+ );
891
+
892
+ this.currentChooseItem.item.isCondition = "0";
893
+ this.currentChooseItem.item.to = t.item.id;
894
+ t.item.left = this.currentChooseItem.item.left;
895
+
896
+ if (this.currentChooseItem.lists && this.currentChooseItem.lists.length > 0) {
897
+ this.currentChooseItem.lists[0].item.from = t.item.id;
898
+ const oldItem = _.cloneDeep(this.currentChooseItem.lists[0]);
899
+ this.currentChooseItem.lists[0] = t;
900
+ t.lists.push(oldItem);
901
+ } else {
902
+ this.currentChooseItem.lists.push(t);
903
+ }
904
+
905
+ const result = ProcessBuilder.treeToListLocal(this.root.lists);
906
+ result.sort(ProcessBuilder.compare("level"));
907
+ for (let i = 0; i < result.length; i++) {
908
+ // 重新计算当前结果中每一个元素的坐标位置信息
909
+ const each = result[i];
910
+ const top = 200 * (each.level - 1) + 20;
911
+ each.item.top = top + "px";
912
+ }
913
+ } else {
914
+ // debugger;
915
+ // this.indexFlg =0;
916
+
917
+ // if (this.currentChooseItem.item.name == "用户任务") {
918
+ // index = Math.max.apply("", [parseFloat(1)]);
919
+ // index++;
920
+ // } else {
921
+ // index = Math.max.apply("", [
922
+ // parseFloat(this.currentChooseItem.item.name.substring(4)),
923
+ // ]);
924
+ // this.indexFlg += 1;
925
+ // }
926
+ // let itemsdh = Math.max.apply("", [parseFloat(index)]);
927
+ // itemsdh++;
928
+ // debugger;
929
+ t = new ProcessBuilder.Node(
930
+ ProcessBuilder.createItem(
931
+ this.id,
932
+ // "用户任务",
933
+ "审批人",
934
+ // + this.indexFlg
935
+ "userTask",
936
+ "320px",
937
+ "20px",
938
+ this.currentNode.sourceId,
939
+ this.currentNode.targetId
940
+ )
941
+ );
942
+ this.currentChooseItem.item.isCondition = "0";
943
+ this.currentChooseItem.item.to = t.item.id;
944
+ t.item.left = this.currentChooseItem.item.left;
945
+ if (
946
+ this.currentChooseItem.lists &&
947
+ this.currentChooseItem.lists.length > 0
948
+ ) {
949
+ this.currentChooseItem.lists[0].item.from = t.item.id;
950
+ const oldItem = _.cloneDeep(this.currentChooseItem.lists[0]);
951
+ this.currentChooseItem.lists[0] = t;
952
+ t.lists.push(oldItem);
953
+ } else {
954
+ this.currentChooseItem.lists.push(t);
955
+ }
956
+ const result = ProcessBuilder.treeToListLocal(this.root.lists);
957
+ result.sort(ProcessBuilder.compare("level"));
958
+ for (let i = 0; i < result.length; i++) {
959
+ // 重新计算当前结果中每一个元素的坐标位置信息
960
+ const each = result[i];
961
+ const top = 200 * (each.level - 1) + 20;
962
+ each.item.top = top + "px";
963
+ }
964
+ }
965
+ this.refresh();
966
+ },
967
+ editNode() {},
968
+ showForm(node) {
969
+ console.log(this.data.nodeList, "showForm");
970
+ console.log(node)
971
+ this.activeNode = node;
972
+ if (node.type == "condition") {
973
+ const condition = lodash.cloneDeep(node);
974
+ const json = {};
975
+ condition.conditions.forEach((item, index) => {
976
+ if (item.isArray && item.variable != "userId") {
977
+ item.value = item.value.split(",");
978
+ }
979
+ json[item.variable] = item;
980
+ });
981
+ this.connection = json;
982
+ this.title = node.name;
983
+ this.conditionVisible = true;
984
+ } else if (node.type == "ccTask") {
985
+
986
+ // node.approvers.forEach((item) => {
987
+ // item.name = item.userName;
988
+ // item.memberNo = item.userId;
989
+ // });
990
+ // node.notifiers.forEach((item) => {
991
+ // item.name = item.userName;
992
+ // item.memberNo = item.userId;
993
+ // });
994
+ // console.log(node.directorType, "*****");
995
+ // // console.log(node.director ,"****director****");
996
+ // const jsList = {
997
+ // approverType: node.approverType,
998
+ // approvers: node.approvers || [],
999
+ // notifiers: node.notifiers || [],
1000
+
1001
+ // // director: node.director || {},
1002
+ // passCopy: node.passCopy
1003
+ // };
1004
+ // this.nodeInfo = jsList;
1005
+ // if (node.directorType) {
1006
+ // jsList.directorType = node.directorType;
1007
+ // } else {
1008
+ // jsList.directorType = {
1009
+ // typeName: "指定成员",
1010
+ // type: 1,
1011
+ // authType: "1"
1012
+ // };
1013
+ // }
1014
+ // if (node.approvers.length != 0) {
1015
+ // jsList.approvers = node.approvers;
1016
+ // } else {
1017
+ // jsList.approvers = [{ directorId: 0, directorName: "直接主管" }];
1018
+ // }
1019
+ // // if (json.directorType.type==) {
1020
+ // //
1021
+ // // }
1022
+ console.log(node)
1023
+ const jsList = {
1024
+ approverType: "1",
1025
+ approvers: node.approvers || [],
1026
+ notifiers: node.notifiers || []
1027
+ // director: node.director || {},
1028
+ // passCopy: node.passCopy
1029
+ };
1030
+
1031
+ jsList.directorType = {
1032
+ typeName: "指定成员",
1033
+ type: 1,
1034
+ authType: "1",
1035
+ isCCTask: true // 是否抄送人
1036
+ };
1037
+
1038
+ console.log(jsList)
1039
+
1040
+ this.$nextTick(() => {
1041
+ this.$refs.approverSelector.init(jsList);
1042
+ });
1043
+
1044
+ } else if (node.type == "userTask") {
1045
+ node.approvers.forEach((item) => {
1046
+ item.name = item.userName;
1047
+ item.memberNo = item.userId;
1048
+ });
1049
+ node.notifiers.forEach((item) => {
1050
+ item.name = item.userName;
1051
+ item.memberNo = item.userId;
1052
+ });
1053
+ console.log(node.directorType, "*****");
1054
+ // console.log(node.director ,"****director****");
1055
+ const jsList = {
1056
+ approverType: node.approverType,
1057
+ approvers: node.approvers || [],
1058
+ notifiers: node.notifiers || [],
1059
+
1060
+ // director: node.director || {},
1061
+ passCopy: node.passCopy
1062
+ };
1063
+ this.nodeInfo = jsList;
1064
+ if (node.directorType) {
1065
+ jsList.directorType = node.directorType;
1066
+ } else {
1067
+ jsList.directorType = {
1068
+ typeName: "指定成员",
1069
+ type: 1,
1070
+ authType: "1"
1071
+ };
1072
+ }
1073
+ if (node.approvers.length != 0) {
1074
+ jsList.approvers = node.approvers;
1075
+ } else {
1076
+ jsList.approvers = [{ directorId: 0, directorName: "直接主管" }];
1077
+ }
1078
+ // if (json.directorType.type==) {
1079
+ //
1080
+ // }
1081
+
1082
+ this.$nextTick(() => {
1083
+ this.$refs.approverSelector.init(jsList);
1084
+ });
1085
+ }
1086
+ },
1087
+ changeNodeName(data) {
1088
+ if (data.node.type == "condition") {
1089
+ this.params.gateWayList.forEach((item, index) => {
1090
+ if (item.id == data.node.id) {
1091
+ item.name = data.name;
1092
+ }
1093
+ });
1094
+ }
1095
+ data.node.name = data.name;
1096
+ },
1097
+ editName(data) {
1098
+ this.title = data;
1099
+ this.activeNode.name = data;
1100
+ },
1101
+ // 设置节点条件
1102
+ setCondition(data) {
1103
+ console.log(data);
1104
+ const conditions = Object.entries(data.form).map(([key, val]) => {
1105
+ if (Array.isArray(val.value)) {
1106
+ return {
1107
+ ...val,
1108
+ variable: key,
1109
+ value:
1110
+ key == "userId" || key == data.SxyData ? "" : val.value.join(","),
1111
+ opt: "=",
1112
+ isArray: true,
1113
+ sponsors:
1114
+ key == "userId" || key == data.SxyData ? val.sponsors : []
1115
+ };
1116
+ } else {
1117
+ return {
1118
+ ...val,
1119
+ variable: key,
1120
+ isArray: false
1121
+ };
1122
+ }
1123
+ });
1124
+ this.activeNode.conditions = conditions;
1125
+ this.activeNode.desc = data.desc.join(" 并且 ");
1126
+ this.params.gateWayList.forEach((item) => {
1127
+ if (item.id == this.activeNode.id) {
1128
+ item.conditions = this.activeNode.conditions;
1129
+ item.desc = this.activeNode.desc;
1130
+ }
1131
+ });
1132
+ this.conditionVisible = false;
1133
+ },
1134
+ // 加载流程图
1135
+ dataReload(data) {},
1136
+ findNodeById(data, id) {
1137
+ const self = this;
1138
+ if (data.item.id == id) {
1139
+ self.currentChooseItem = data;
1140
+ return;
1141
+ } else {
1142
+ data.lists.forEach((each, index) => {
1143
+ if (each.item.id == id) {
1144
+ self.currentChooseItem = each;
1145
+ return;
1146
+ }
1147
+ self.findNodeById(each, id);
1148
+ });
1149
+ }
1150
+ },
1151
+ addExtraCondition(event, flg) {
1152
+ // 添加一个新的Condition条件信息
1153
+ if (!this.isClick) return;
1154
+ const obj = event.currentTarget;
1155
+ let id = obj.id;
1156
+
1157
+ if (id != "") {
1158
+ id = id.replace("flowchartWindow", "");
1159
+ this.findNodeById(this.root, parseInt(id));
1160
+ }
1161
+
1162
+ this.id += 1;
1163
+ let index = flg
1164
+ ? 1
1165
+ : Math.max.apply(
1166
+ "",
1167
+ this.currentChooseItem.lists.map((item) =>
1168
+ parseFloat(item.item.name.substring(2))
1169
+ )
1170
+ );
1171
+ index++;
1172
+ const t1 = new ProcessBuilder.Node(
1173
+ ProcessBuilder.createItem(
1174
+ this.id,
1175
+ "条件" + index,
1176
+ "condition",
1177
+ "320px",
1178
+ "20px",
1179
+ this.currentNode.sourceId,
1180
+ this.currentNode.targetId
1181
+ )
1182
+ );
1183
+ let oldItem;
1184
+ const num = 0;
1185
+ if (id == "") {
1186
+ oldItem = this.currentChooseItem.lists[0];
1187
+ const num = this.currentChooseItem.lists[0].lists.length;
1188
+ this.currentChooseItem.lists[0].lists.push(t1);
1189
+ } else {
1190
+ oldItem = this.currentChooseItem;
1191
+ this.currentChooseItem.lists.push(t1);
1192
+ }
1193
+
1194
+ t1.item.from = oldItem.item.id;
1195
+ t1.item.to = oldItem.lists[0].item.to;
1196
+
1197
+ this.setResultToNode();
1198
+ this.refresh();
1199
+ },
1200
+ setResultToNode() {
1201
+ const result = ProcessBuilder.treeToListLocal(this.root.lists);
1202
+ result.sort(ProcessBuilder.compare("level"));
1203
+ console.log(result, "result");
1204
+ const level = 0;
1205
+ const levelSort = 0;
1206
+ let maxWidth = 320;
1207
+ for (let i = result.length; i > 0; i--) {
1208
+ // 重新计算当前结果中每一个元素的坐标位置信息
1209
+ const each = result[i - 1];
1210
+ for (let j = 0; j < each.lists.length; j++) {
1211
+ const e = each.lists[j];
1212
+ if (j == 0) {
1213
+ e.item.left = maxWidth / 2 + "px";
1214
+ } else {
1215
+ maxWidth += 320;
1216
+ e.item.left = maxWidth + "px";
1217
+ this.resetNodeLeft(e);
1218
+ }
1219
+ }
1220
+ const top = 200 * (each.level - 1) + 20;
1221
+ each.item.top = top + "px";
1222
+ }
1223
+ this.data.nodeList = result;
1224
+ //
1225
+ },
1226
+ resetNodeLeft(e) {
1227
+ if (e.item.type == "condition" || e.item.type == "userTask") {
1228
+ if (e.lists.length > 0) {
1229
+ e.lists.forEach((con) => {
1230
+ con.item.left = e.item.left;
1231
+ this.resetNodeLeft(con);
1232
+ });
1233
+ }
1234
+ } else if (e.item.type == "addCondition") {
1235
+ e.lists.forEach((con, index) => {
1236
+ con.item.left = parseFloat(e.item.left) - 160 + index * 320 + "px";
1237
+ this.resetNodeLeft(con);
1238
+ });
1239
+ }
1240
+ }
1241
+ }
1242
+ };
1243
+ </script>
1244
+ <style>
1245
+ .right-plan {
1246
+ /* height: calc(100vh - 100px); */
1247
+ overflow-y: auto;
1248
+ }
1249
+ .process-heard {
1250
+ padding: 10px 20px;
1251
+ display: flex;
1252
+ align-items: center;
1253
+ justify-content: space-between;
1254
+ }
1255
+ .process-heard .el-icon-edit {
1256
+ cursor: pointer;
1257
+ }
1258
+ .process-heard .process-title {
1259
+ font-size: 18px;
1260
+ margin-right: 10px;
1261
+ }
1262
+ #flowContainer {
1263
+ height: 10000px;
1264
+ /* background-color: rgb(251, 251, 251); */
1265
+ /*background-color: #42b983;*/
1266
+ position: relative;
1267
+ overflow: auto;
1268
+ height: calc(100vh - 144px);
1269
+ }
1270
+ .container-process {
1271
+ display: flex;
1272
+ flex-direction: column;
1273
+ align-items: center;
1274
+ }
1275
+ .labelClass {
1276
+ background-color: white;
1277
+ padding: 5px;
1278
+ opacity: 0.7;
1279
+ border: 1px solid #346789;
1280
+ /*border-radius: 10px;*/
1281
+ cursor: pointer;
1282
+ -webkit-user-select: none;
1283
+ -moz-user-select: none;
1284
+ -ms-user-select: none;
1285
+ user-select: none;
1286
+ }
1287
+ .aLabel {
1288
+ width: 30px;
1289
+ height: 30px;
1290
+ margin-top: 25px;
1291
+ background: url("../../assets/process/jia.png") center center no-repeat;
1292
+ cursor: pointer;
1293
+ }
1294
+ .switch {
1295
+ display: inline-block;
1296
+ margin-right: 30px;
1297
+ }
1298
+ .switch > span {
1299
+ margin-right: 10px;
1300
+ }
1301
+
1302
+ .add-condition {
1303
+ color: #66a6e0;
1304
+ font-size: 14px;
1305
+ text-align: center;
1306
+ padding: 10px 0;
1307
+ border: 1px solid #66a6e0;
1308
+ cursor: pointer;
1309
+ position: absolute;
1310
+ width: 200px;
1311
+ }
1312
+
1313
+ .condition-container {
1314
+ display: flex;
1315
+ }
1316
+ .condition-item {
1317
+ margin: 30px;
1318
+ padding: 20px;
1319
+ }
1320
+ .gray-background-class {
1321
+ background-color: #f4f4f8;
1322
+ }
1323
+ </style>