cloud-web-corejs 1.0.54-dev.8 → 1.0.54-dev.800

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 (804) hide show
  1. package/package.json +203 -177
  2. package/src/App.vue +73 -75
  3. package/src/api/user.js +85 -40
  4. package/src/components/Qrcode/fileParse.vue +0 -1
  5. package/src/components/Tinymce/index.vue +112 -71
  6. package/src/components/VabUpload/fileLibraryDialog.vue +296 -0
  7. package/src/components/VabUpload/image-viewer.vue +2 -2
  8. package/src/components/VabUpload/index.js +69 -1
  9. package/src/components/VabUpload/index.vue +242 -230
  10. package/src/components/VabUpload/mixins/fileLibraryDialog.js +1112 -0
  11. package/src/components/VabUpload/mixins.js +1971 -9
  12. package/src/components/VabUpload/privateProfileDialog.vue +2 -2
  13. package/src/components/VabUpload/propertiesDialog.vue +1 -1
  14. package/src/components/VabUpload/view.vue +209 -119
  15. package/src/components/advancedSearchDialog/mixins.js +28 -1
  16. package/src/components/base-textarea/index.vue +104 -0
  17. package/src/components/baseAlert/index.js +44 -1
  18. package/src/components/baseAlert/index.vue +24 -20
  19. package/src/components/baseAlert/mixins.js +61 -1
  20. package/src/components/baseArea/index.vue +1628 -0
  21. package/src/components/baseAttachment/index.vue +49 -40
  22. package/src/components/baseAttachment/install.js +21 -5
  23. package/src/components/baseAttachment/mixins.js +310 -1
  24. package/src/components/baseInputBatch/mixins.js +58 -1
  25. package/src/components/baseInputExport/index.vue +21 -14
  26. package/src/components/baseInputExport/mixins.js +415 -8
  27. package/src/components/baseInputNumber/index.vue +9 -9
  28. package/src/components/baseTabs/index.vue +16 -8
  29. package/src/components/baseTabs/mixins.js +176 -1
  30. package/src/components/bizTab/BizBillActions.vue +129 -0
  31. package/src/components/bizTab/BizTabListPage.vue +391 -0
  32. package/src/components/bizTab/README.md +378 -0
  33. package/src/components/bizTab/billTableUtil.js +48 -0
  34. package/src/components/bizTab/billValidators.js +136 -0
  35. package/src/components/bizTab/bizBillDetailMixin.js +687 -0
  36. package/src/components/bizTab/index.js +24 -0
  37. package/src/components/cnPrint/index.js +44 -1
  38. package/src/components/cnPrint/mixins.js +189 -1
  39. package/src/components/code-editor/async.js +29 -0
  40. package/src/components/code-editor/index.vue +190 -62
  41. package/src/components/confirmDialog/index.js +41 -1
  42. package/src/components/confirmDialog/index.vue +24 -17
  43. package/src/components/confirmDialog/mixins.js +31 -1
  44. package/src/components/errorMsg/index.js +47 -3
  45. package/src/components/errorMsg/index.vue +78 -70
  46. package/src/components/errorMsg/mixins.js +103 -5
  47. package/src/components/excelExport/button.vue +86 -24
  48. package/src/components/excelExport/exportFieldDialog.vue +373 -113
  49. package/src/components/excelExport/exportType.js +49 -0
  50. package/src/components/excelExport/index.js +43 -9
  51. package/src/components/excelExport/index.vue +113 -28
  52. package/src/components/excelExport/mixins.js +1153 -722
  53. package/src/components/excelImport/index.js +75 -13
  54. package/src/components/excelImport/index.vue +2 -1
  55. package/src/components/excelImport/mixins.js +841 -8
  56. package/src/components/fileLibrary/categoryMoveDialog.vue +109 -109
  57. package/src/components/fileLibrary/fileHistoryDialog.vue +1 -1
  58. package/src/components/fileLibrary/fileObjAuthDialog.vue +297 -186
  59. package/src/components/fileLibrary/fileObjAuthEdit.vue +1 -1
  60. package/src/components/fileLibrary/fileObjAuthEditDialog.vue +7 -1
  61. package/src/components/fileLibrary/fileObjNotifyEdit.vue +192 -0
  62. package/src/components/fileLibrary/filterDialog.vue +454 -0
  63. package/src/components/fileLibrary/index.vue +1109 -687
  64. package/src/components/fileLibrary/mixins/categoryMoveDialogMixins.js +1 -1
  65. package/src/components/fileLibrary/mixins/fileCategoryDialogMixins.js +1 -1
  66. package/src/components/fileLibrary/mixins/fileHistoryDialogMixins.js +2 -2
  67. package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +341 -207
  68. package/src/components/fileLibrary/mixins/fileObjAuthEditDialogMixin.js +33 -26
  69. package/src/components/fileLibrary/mixins/fileObjAuthEditMixin.js +5 -5
  70. package/src/components/fileLibrary/mixins/indexMixins.js +255 -112
  71. package/src/components/fileLibrary/mixins/propertiesDialogMixins.js +64 -4
  72. package/src/components/fileLibrary/mixins/recycleBinDialogMixins.js +3 -3
  73. package/src/components/fileLibrary/propertiesDialog.vue +190 -145
  74. package/src/components/fileLibrary/recycleBinDialog.vue +237 -236
  75. package/src/components/fileLibrary/shareDialog.vue +1 -1
  76. package/src/components/formDialog/README.md +371 -0
  77. package/src/components/formDialog/actionButtons.js +90 -0
  78. package/src/components/formDialog/index.js +48 -0
  79. package/src/components/formDialog/index.vue +802 -0
  80. package/src/components/formDrawer/drawer.vue +722 -0
  81. package/src/components/formDrawer/index.js +50 -0
  82. package/src/components/formOplog/mixins.js +85 -4
  83. package/src/components/hiprint/css/bootstrap.min.css +6 -0
  84. package/src/components/hiprint/fonts/glyphicons-halflings-regular.eot +0 -0
  85. package/src/components/hiprint/fonts/glyphicons-halflings-regular.svg +288 -0
  86. package/src/components/hiprint/fonts/glyphicons-halflings-regular.ttf +0 -0
  87. package/src/components/hiprint/fonts/glyphicons-halflings-regular.woff +0 -0
  88. package/src/components/hiprint/fonts/glyphicons-halflings-regular.woff2 +0 -0
  89. package/src/components/hiprint/hiprint.bundle.js +15 -3
  90. package/src/components/hiprint/view/design/index.vue +146 -48
  91. package/src/components/hiprint/view/design/mixins.js +611 -1
  92. package/src/components/hiprint/view/design/preview.vue +75 -52
  93. package/src/components/hiprint/view/json-view.vue +31 -31
  94. package/src/components/jdPrint/index.js +44 -1
  95. package/src/components/jdPrint/mixins.js +208 -1
  96. package/src/components/jsonImport/exportUtil.js +106 -0
  97. package/src/components/jsonImport/index.js +212 -17
  98. package/src/components/jsonImport/mixins.js +350 -16
  99. package/src/components/langImport/index.js +80 -1
  100. package/src/components/langImport/mixins.js +487 -1
  101. package/src/components/langTag/mixins/addButton.js +51 -5
  102. package/src/components/langTag/mixins/deleteButton.js +55 -5
  103. package/src/components/langTag/mixins/view.js +47 -5
  104. package/src/components/luckysheet/dialog.vue +159 -0
  105. package/src/components/luckysheet/export.js +595 -0
  106. package/src/components/luckysheet/fileUtils.js +147 -0
  107. package/src/components/luckysheet/index.js +72 -0
  108. package/src/components/luckysheet/templateJson.js +12078 -0
  109. package/src/components/luckysheet/view.vue +210 -0
  110. package/src/components/micro-view-host/contract.js +66 -0
  111. package/src/components/micro-view-host/index.vue +148 -0
  112. package/src/components/mobile/file/index.vue +10 -0
  113. package/src/components/mobile/wf/mixins/wfModifyDialogMixin.js +51 -47
  114. package/src/components/obsUpload/index.js +34 -0
  115. package/src/components/obsUpload/index.vue +234 -0
  116. package/src/components/obsUpload/mixins.js +1542 -0
  117. package/src/components/onlineTalk/index.vue +328 -6
  118. package/src/components/onlineTalk/mixins.js +852 -1
  119. package/src/components/onlineTalk/talkUserDialog.vue +280 -0
  120. package/src/components/oplogTable/mixins.js +83 -4
  121. package/src/components/pddPrint/index.js +44 -1
  122. package/src/components/pddPrint/mixins.js +252 -1
  123. package/src/components/projectTag/mixins/addButton.js +52 -1
  124. package/src/components/projectTag/mixins/deleteButton.js +52 -1
  125. package/src/components/projectTag/mixins/view.js +43 -1
  126. package/src/components/scriptDescription/button.vue +12 -4
  127. package/src/components/scriptDescription/mixins.js +30 -1
  128. package/src/components/scriptTest/mixins.js +90 -1
  129. package/src/components/statusTag/mixins.js +66 -1
  130. package/src/components/table/CellSlot.vue +12 -9
  131. package/src/components/table/config.js +74 -1
  132. package/src/components/table/index.js +1220 -10
  133. package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js +11028 -0
  134. package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css +200 -0
  135. package/src/components/table/tableForm.vue +102 -64
  136. package/src/components/table/tableFormMixin.js +285 -1
  137. package/src/components/table/util/index.js +337 -0
  138. package/src/components/table/vxeFilter/index.js +153 -1
  139. package/src/components/table/vxeFilter/mixin.js +310 -6
  140. package/src/components/tempStorage/index.vue +76 -55
  141. package/src/components/tempStorage/tempStorageDialog.vue +179 -54
  142. package/src/components/vb-tabs/x-tabs.vue +167 -112
  143. package/src/components/vipPrint/index.js +44 -1
  144. package/src/components/vipPrint/mixins.js +268 -1
  145. package/src/components/wf/addOpinionButton.vue +57 -0
  146. package/src/components/wf/addTaskUserdialog.vue +1 -1
  147. package/src/components/wf/content.vue +834 -362
  148. package/src/components/wf/content2.vue +4 -2
  149. package/src/components/wf/mixins/addOpinionButton.js +53 -0
  150. package/src/components/wf/mixins/setCandidateButton.js +161 -0
  151. package/src/components/wf/mixins/setCandidateDialog.js +217 -5
  152. package/src/components/wf/mixins/setCandidateDialog2.js +252 -0
  153. package/src/components/wf/mixins/wfFlowEleScriptDialog.js +131 -0
  154. package/src/components/wf/mixins/wfTaskUserRangeDialog.js +69 -0
  155. package/src/components/wf/setCandidateButton.vue +40 -0
  156. package/src/components/wf/setCandidateDialog.vue +10 -0
  157. package/src/components/wf/setCandidateDialog2.vue +105 -0
  158. package/src/components/wf/wf.js +2242 -30
  159. package/src/components/wf/wfButtonName.js +60 -0
  160. package/src/components/wf/wfFlowEleScriptDialog.vue +89 -0
  161. package/src/components/wf/wfStartDialog.vue +66 -42
  162. package/src/components/wf/wfTaskUserRangeDialog.vue +65 -0
  163. package/src/components/wf/wfUtil.js +327 -13
  164. package/src/components/xform/XFormTabContainer//346/226/260/345/242/236/351/241/265/347/255/276/346/250/241/345/274/217-/346/234/200/347/273/210/345/256/236/347/216/260.md +195 -0
  165. package/src/components/xform/docs/2026-07 table/344/270/216excelExport/344/277/256/345/244/215/345/217/212/345/257/274/345/207/272/344/274/230/345/214/226.md" +57 -0
  166. package/src/components/xform/docs/2026-07 /346/216/222/346/237/245/344/277/256/345/244/215/350/256/260/345/275/225.md" +73 -0
  167. package/src/components/xform/docs/2026-08 /345/210/227/350/241/250/345/257/274/345/207/272/350/204/261/346/225/217/345/210/227/345/211/224/351/231/244/350/220/275/345/234/260/346/226/207/346/241/243.md" +173 -0
  168. package/src/components/xform/docs/autocomplete /350/207/252/345/212/250/345/256/214/346/210/220/347/273/204/344/273/266/350/257/264/346/230/216.md" +126 -0
  169. package/src/components/xform/docs//345/220/216/345/217/260/345/255/227/346/256/265/357/274/210/345/212/250/346/200/201/347/224/237/346/210/220/357/274/211JSON /350/257/264/346/230/216.md" +1286 -0
  170. package/src/components/xform/docs//345/257/271/346/257/224/345/212/237/350/203/275/350/220/275/345/234/260/346/226/271/346/241/210.md +986 -0
  171. package/src/components/xform/docs//346/225/260/346/215/256/350/241/250/346/240/274/345/212/250/346/200/201/345/210/227 JSON /350/257/264/346/230/216.md" +657 -0
  172. package/src/components/xform/docs//346/240/221/350/241/250rowField/346/224/266/346/225/233-/350/220/275/345/234/260/346/226/207/346/241/243.md +1427 -0
  173. package/src/components/xform/form-designer/designer.js +2080 -29
  174. package/src/components/xform/form-designer/form-widget/components/gantt/index.vue +434 -0
  175. package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +108 -1
  176. package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +291 -8
  177. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +15 -2
  178. package/src/components/xform/form-designer/form-widget/container-widget/detail-pane-widget.vue +3 -2
  179. package/src/components/xform/form-designer/form-widget/container-widget/detail-plain-widget.vue +76 -0
  180. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +62 -8
  181. package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +971 -0
  182. package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog.vue +971 -0
  183. package/src/components/xform/form-designer/form-widget/dialog/exportDialog.vue +13 -0
  184. package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +320 -0
  185. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +209 -50
  186. package/src/components/xform/form-designer/form-widget/dialog/formFieldDialog.vue +3 -3
  187. package/src/components/xform/form-designer/form-widget/dialog/formulaDialog.vue +799 -0
  188. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +38 -7
  189. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1774 -17
  190. package/src/components/xform/form-designer/form-widget/dialog/preformDialog.vue +2 -2
  191. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +224 -77
  192. package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +3 -3
  193. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +67 -54
  194. package/src/components/xform/form-designer/form-widget/field-widget/a-text-widget.vue +1 -1
  195. package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +272 -0
  196. package/src/components/xform/form-designer/form-widget/field-widget/autocomplete-widget.vue +119 -0
  197. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +273 -180
  198. package/src/components/xform/form-designer/form-widget/field-widget/button-widget.vue +76 -66
  199. package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +209 -90
  200. package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +41 -35
  201. package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +18 -7
  202. package/src/components/xform/form-designer/form-widget/field-widget/color-widget.vue +4 -1
  203. package/src/components/xform/form-designer/form-widget/field-widget/copy_button-widget.vue +104 -0
  204. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +15 -3
  205. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +70 -7
  206. package/src/components/xform/form-designer/form-widget/field-widget/download-button-widget.vue +133 -0
  207. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +86 -0
  208. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +170 -0
  209. package/src/components/xform/form-designer/form-widget/field-widget/echart-bar-widget.vue +1 -1
  210. package/src/components/xform/form-designer/form-widget/field-widget/echart-category-widget.vue +1 -1
  211. package/src/components/xform/form-designer/form-widget/field-widget/echart-pie-widget.vue +1 -1
  212. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1977 -16
  213. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +608 -108
  214. package/src/components/xform/form-designer/form-widget/field-widget/gantt-widget.vue +964 -0
  215. package/src/components/xform/form-designer/form-widget/field-widget/html-text-widget.vue +6 -2
  216. package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +22 -11
  217. package/src/components/xform/form-designer/form-widget/field-widget/import2-button-widget.vue +90 -0
  218. package/src/components/xform/form-designer/form-widget/field-widget/input-widget.vue +7 -2
  219. package/src/components/xform/form-designer/form-widget/field-widget/mixins/autocomplete-mixin.js +451 -0
  220. package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +222 -0
  221. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-bar-mixin.js +52 -17
  222. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-category-mixin.js +64 -97
  223. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-pie-mixin.js +16 -9
  224. package/src/components/xform/form-designer/form-widget/field-widget/mixins/time-limit-mixin.js +92 -0
  225. package/src/components/xform/form-designer/form-widget/field-widget/mixins/utc-transform-mixin.js +75 -0
  226. package/src/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin.js +192 -0
  227. package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +53 -0
  228. package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +119 -81
  229. package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +186 -0
  230. package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +55 -28
  231. package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +119 -0
  232. package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +156 -54
  233. package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +26 -6
  234. package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +115 -0
  235. package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +149 -0
  236. package/src/components/xform/form-designer/form-widget/field-widget/search_button-widget.vue +2 -2
  237. package/src/components/xform/form-designer/form-widget/field-widget/select-export-button-widget.vue +86 -0
  238. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +120 -0
  239. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +24 -9
  240. package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +53 -0
  241. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +145 -0
  242. package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +16 -1
  243. package/src/components/xform/form-designer/form-widget/field-widget/static-text-widget.vue +8 -3
  244. package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +93 -49
  245. package/src/components/xform/form-designer/form-widget/field-widget/switch-widget.vue +9 -1
  246. package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +42 -37
  247. package/src/components/xform/form-designer/form-widget/field-widget/tempStorage-widget.vue +147 -0
  248. package/src/components/xform/form-designer/form-widget/field-widget/text-widget.vue +111 -34
  249. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +4 -3
  250. package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +45 -5
  251. package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +3 -171
  252. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +338 -172
  253. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +753 -0
  254. package/src/components/xform/form-designer/form-widget/field-widget/vue-page-widget.vue +231 -0
  255. package/src/components/xform/form-designer/form-widget/index.vue +6 -1
  256. package/src/components/xform/form-designer/form-widget/indexMixin.js +184 -2
  257. package/src/components/xform/form-designer/index.vue +194 -191
  258. package/src/components/xform/form-designer/indexMixin.js +856 -24
  259. package/src/components/xform/form-designer/refMixinDesign.js +27 -28
  260. package/src/components/xform/form-designer/setting-panel/action-button-config-dialog.vue +241 -0
  261. package/src/components/xform/form-designer/setting-panel/dataSource-setting.vue +397 -397
  262. package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +602 -0
  263. package/src/components/xform/form-designer/setting-panel/form-setting.vue +1772 -626
  264. package/src/components/xform/form-designer/setting-panel/index.vue +313 -305
  265. package/src/components/xform/form-designer/setting-panel/indexMixin.js +370 -12
  266. package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +519 -236
  267. package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +5 -5
  268. package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +4 -4
  269. package/src/components/xform/form-designer/setting-panel/property-editor/alignType-editor.vue +1 -1
  270. package/src/components/xform/form-designer/setting-panel/property-editor/autoValueEnabled-editor.vue +38 -0
  271. package/src/components/xform/form-designer/setting-panel/property-editor/buttonIcon-editor.vue +14 -15
  272. package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +7 -1
  273. package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +28 -0
  274. package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +41 -0
  275. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +124 -0
  276. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +737 -625
  277. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/edit-tree-button-group-config-dialog.vue +281 -0
  278. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +432 -0
  279. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/onCheckboxChange-editor.vue +1 -1
  280. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +1632 -579
  281. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +96 -74
  282. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-pane/detail-pane-editor.vue +3 -3
  283. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-plain/detail-plain-editor.vue +75 -0
  284. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/colHeight-editor.vue +1 -1
  285. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +1 -1
  286. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-height-editor.vue +1 -1
  287. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +2 -2
  288. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +2 -2
  289. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +2 -2
  290. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue +4 -4
  291. package/src/components/xform/form-designer/setting-panel/property-editor/container-h5-card/h5-card-editor.vue +124 -124
  292. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +34 -46
  293. package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/height-editor.vue +1 -1
  294. package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/width-editor.vue +1 -1
  295. package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue +119 -119
  296. package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tabClass-editor.vue +45 -45
  297. package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +344 -0
  298. package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue +1 -1
  299. package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue +1 -1
  300. package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +32 -3
  301. package/src/components/xform/form-designer/setting-panel/property-editor/container-tree-pane/tree-pane-editor.vue +1 -1
  302. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/cancelButtonLabel-editor.vue +1 -1
  303. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/okButtonLabel-editor.vue +1 -1
  304. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/title-editor.vue +1 -1
  305. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/width-editor.vue +1 -1
  306. package/src/components/xform/form-designer/setting-panel/property-editor/containerClass-editor.vue +1 -1
  307. package/src/components/xform/form-designer/setting-panel/property-editor/copyButton-editor.vue +36 -0
  308. package/src/components/xform/form-designer/setting-panel/property-editor/customClass-editor.vue +1 -1
  309. package/src/components/xform/form-designer/setting-panel/property-editor/defaultValue-editor.vue +1 -1
  310. package/src/components/xform/form-designer/setting-panel/property-editor/descriptionsItems-editor.vue +4 -4
  311. package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +32 -0
  312. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +133 -0
  313. package/src/components/xform/form-designer/setting-panel/property-editor/dsName-editor.vue +1 -1
  314. package/src/components/xform/form-designer/setting-panel/property-editor/echartHeight-editor.vue +1 -1
  315. package/src/components/xform/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue +1 -1
  316. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin.js +2 -2
  317. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onAfterConfirmFile-editor.vue +32 -0
  318. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +22 -7
  319. package/src/components/xform/form-designer/setting-panel/property-editor/field-accessUrl/accessUrl-editor.vue +2 -2
  320. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +25 -0
  321. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -0
  322. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +20 -0
  323. package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +199 -0
  324. package/src/components/xform/form-designer/setting-panel/property-editor/field-baseAttachment/baseAttachment-fileTypes-editor.vue +23 -0
  325. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/addTableData-event-editor.vue +84 -85
  326. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue +1 -1
  327. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindActions.js +262 -0
  328. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +97 -73
  329. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/form-host-event-editor.vue +188 -0
  330. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/icon-editor.vue +14 -15
  331. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +237 -161
  332. package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/cascader-multiple-editor.vue +8 -3
  333. package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/checkStrictly-editor.vue +11 -13
  334. package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/showAllLevels-editor.vue +21 -0
  335. package/src/components/xform/form-designer/setting-panel/property-editor/field-common/keyName-editor.vue +74 -67
  336. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +179 -0
  337. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +21 -3
  338. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue +1 -1
  339. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue +1 -1
  340. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue +1 -1
  341. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +27 -0
  342. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +1 -1
  343. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue +1 -1
  344. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue +1 -1
  345. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue +1 -1
  346. package/src/components/xform/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue +1 -1
  347. package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-item-editor.vue +21 -0
  348. package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -0
  349. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +187 -71
  350. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +190 -88
  351. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +91 -46
  352. package/src/components/xform/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue +44 -44
  353. package/src/components/xform/form-designer/setting-panel/property-editor/field-gantt/gantt-editor.vue +36 -0
  354. package/src/components/xform/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue +29 -29
  355. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +79 -22
  356. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +96 -0
  357. package/src/components/xform/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue +1 -1
  358. package/src/components/xform/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue +44 -44
  359. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +115 -86
  360. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -0
  361. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue +1 -1
  362. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue +1 -1
  363. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +2 -2
  364. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue +1 -1
  365. package/src/components/xform/form-designer/setting-panel/property-editor/field-script/script-editor.vue +4 -4
  366. package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +55 -0
  367. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/fontSize-editor.vue +1 -1
  368. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/preWrap-editor.vue +23 -0
  369. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +2 -2
  370. package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +67 -41
  371. package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue +1 -1
  372. package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/inactiveText-editor.vue +1 -1
  373. package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue +1 -1
  374. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +56 -0
  375. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +74 -0
  376. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +28 -9
  377. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +21 -3
  378. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue +1 -1
  379. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-timeLimit-editor.vue +53 -0
  380. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +1 -1
  381. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue +1 -1
  382. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchField-editor.vue +2 -2
  383. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +15 -3
  384. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +33 -1
  385. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/vabUpload-fileTypes-editor.vue +23 -0
  386. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +66 -0
  387. package/src/components/xform/form-designer/setting-panel/property-editor/field-vue-page/vue-page-editor.vue +48 -0
  388. package/src/components/xform/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue +1 -1
  389. package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesEditorMixin.js +116 -0
  390. package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -0
  391. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +108 -19
  392. package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +137 -0
  393. package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +972 -717
  394. package/src/components/xform/form-designer/setting-panel/property-editor/iconClass-editor.vue +1 -1
  395. package/src/components/xform/form-designer/setting-panel/property-editor/label-editor.vue +1 -1
  396. package/src/components/xform/form-designer/setting-panel/property-editor/labelAlign-editor.vue +1 -1
  397. package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +21 -12
  398. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconClass-editor.vue +17 -16
  399. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +26 -26
  400. package/src/components/xform/form-designer/setting-panel/property-editor/labelTooltip-editor.vue +67 -13
  401. package/src/components/xform/form-designer/setting-panel/property-editor/labelWidth-editor.vue +1 -1
  402. package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +2 -2
  403. package/src/components/xform/form-designer/setting-panel/property-editor/max-editor.vue +1 -1
  404. package/src/components/xform/form-designer/setting-panel/property-editor/maxLength-editor.vue +1 -1
  405. package/src/components/xform/form-designer/setting-panel/property-editor/min-editor.vue +1 -1
  406. package/src/components/xform/form-designer/setting-panel/property-editor/minLength-editor.vue +1 -1
  407. package/src/components/xform/form-designer/setting-panel/property-editor/multiple-editor.vue +19 -14
  408. package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +2 -2
  409. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +178 -101
  410. package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +31 -0
  411. package/src/components/xform/form-designer/setting-panel/property-editor/placeholder-editor.vue +2 -2
  412. package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +2 -2
  413. package/src/components/xform/form-designer/setting-panel/property-editor/prefixIcon-editor.vue +14 -15
  414. package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +349 -0
  415. package/src/components/xform/form-designer/setting-panel/property-editor/required-editor.vue +10 -6
  416. package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +4 -4
  417. package/src/components/xform/form-designer/setting-panel/property-editor/rows-editor.vue +1 -1
  418. package/src/components/xform/form-designer/setting-panel/property-editor/showRuleFlag-editor.vue +1 -1
  419. package/src/components/xform/form-designer/setting-panel/property-editor/showViewButton-editor.vue +29 -0
  420. package/src/components/xform/form-designer/setting-panel/property-editor/space-editor-editor.vue +1 -1
  421. package/src/components/xform/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue +1 -1
  422. package/src/components/xform/form-designer/setting-panel/property-editor/step-editor.vue +1 -1
  423. package/src/components/xform/form-designer/setting-panel/property-editor/styleTableClass-editor.vue +1 -1
  424. package/src/components/xform/form-designer/setting-panel/property-editor/styleTitClass-editor.vue +1 -1
  425. package/src/components/xform/form-designer/setting-panel/property-editor/suffixIcon-editor.vue +14 -15
  426. package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +42 -0
  427. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +304 -19
  428. package/src/components/xform/form-designer/setting-panel/property-editor/type-editor.vue +1 -1
  429. package/src/components/xform/form-designer/setting-panel/property-editor/uploadTip-editor.vue +1 -1
  430. package/src/components/xform/form-designer/setting-panel/property-editor/uploadURL-editor.vue +1 -1
  431. package/src/components/xform/form-designer/setting-panel/property-editor/urlValueEnabled-editor.vue +91 -0
  432. package/src/components/xform/form-designer/setting-panel/property-editor/utcTransformEnabled-editor.vue +19 -0
  433. package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +3 -3
  434. package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +3 -3
  435. package/src/components/xform/form-designer/setting-panel/property-editor/wfFlag-editor.vue +372 -50
  436. package/src/components/xform/form-designer/setting-panel/property-editor/widgetShowRuleFlag-editor.vue +263 -0
  437. package/src/components/xform/form-designer/setting-panel/property-editor/widgetWidth-editor.vue +1 -1
  438. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +372 -322
  439. package/src/components/xform/form-designer/setting-panel/widgetPropertyDialogMixin.js +186 -0
  440. package/src/components/xform/form-designer/toolbar-panel/index.vue +267 -103
  441. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +655 -24
  442. package/src/components/xform/form-designer/widget-panel/index.vue +391 -321
  443. package/src/components/xform/form-designer/widget-panel/indexMixin.js +335 -2
  444. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +4609 -3092
  445. package/src/components/xform/form-render/compareDelList.vue +83 -0
  446. package/src/components/xform/form-render/compareView.vue +76 -0
  447. package/src/components/xform/form-render/container-item/containerItemMixin.js +404 -11
  448. package/src/components/xform/form-render/container-item/data-table-item.vue +221 -202
  449. package/src/components/xform/form-render/container-item/data-table-mixin copy.js +5910 -0
  450. package/src/components/xform/form-render/container-item/data-table-mixin.js +5846 -12
  451. package/src/components/xform/form-render/container-item/detail-h5-item.vue +173 -172
  452. package/src/components/xform/form-render/container-item/detail-item.vue +450 -158
  453. package/src/components/xform/form-render/container-item/detail-pane-item.vue +17 -3
  454. package/src/components/xform/form-render/container-item/detail-plain-item.vue +92 -0
  455. package/src/components/xform/form-render/container-item/dynamicFieldEngine.js +285 -0
  456. package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +416 -0
  457. package/src/components/xform/form-render/container-item/grid-col-item.vue +10 -3
  458. package/src/components/xform/form-render/container-item/grid-item.vue +1 -1
  459. package/src/components/xform/form-render/container-item/list-h5-item.vue +1198 -419
  460. package/src/components/xform/form-render/container-item/sub-form-item.vue +10 -2
  461. package/src/components/xform/form-render/container-item/tab-item.vue +129 -88
  462. package/src/components/xform/form-render/container-item/table-cell-item.vue +38 -32
  463. package/src/components/xform/form-render/container-item/table-item.vue +7 -7
  464. package/src/components/xform/form-render/container-item/table2-cell-item.vue +53 -34
  465. package/src/components/xform/form-render/container-item/table2-item.vue +198 -99
  466. package/src/components/xform/form-render/container-item/tree-item.vue +32 -11
  467. package/src/components/xform/form-render/dynamicDialogRender.js +238 -3
  468. package/src/components/xform/form-render/dynamicDrawerRender.js +229 -0
  469. package/src/components/xform/form-render/formDynamicFieldMixin.js +131 -0
  470. package/src/components/xform/form-render/index.vue +79 -21
  471. package/src/components/xform/form-render/indexMixin.js +5295 -59
  472. package/src/components/xform/form-render/refMixin.js +34 -3
  473. package/src/components/xform/icon-picker/icons.json +284 -0
  474. package/src/components/xform/icon-picker/index.vue +145 -0
  475. package/src/components/xform/lang/en-US.js +470 -438
  476. package/src/components/xform/lang/en-US_extension.js +4 -0
  477. package/src/components/xform/lang/zh-CN.js +643 -593
  478. package/src/components/xform/mixins/defaultHandle.js +689 -2
  479. package/src/components/xform/mixins/scriptHttp.js +179 -3
  480. package/src/components/xform/utils/attachmentValueUtil.js +239 -0
  481. package/src/components/xform/utils/dynamicSchemaUtil.js +361 -0
  482. package/src/components/xform/utils/emitter.js +4 -4
  483. package/src/components/xform/utils/formHttp.js +162 -0
  484. package/src/components/xform/utils/format.js +205 -172
  485. package/src/components/xform/utils/formula-util.js +969 -0
  486. package/src/components/xform/utils/queryParamUtil.js +84 -0
  487. package/src/components/xform/utils/sfc-generator.js +2 -2
  488. package/src/components/xform/utils/smart-vue-i18n/index.js +2 -1
  489. package/src/components/xform/utils/tableCellValidateUtil.js +148 -0
  490. package/src/components/xform/utils/tableColumnHelper.js +155 -0
  491. package/src/components/xform/utils/textMaskUtil.js +179 -0
  492. package/src/components/xform/utils/treeTableUtil.js +1265 -0
  493. package/src/components/xform/utils/util.js +1640 -1
  494. package/src/components/xform/utils/validators.js +185 -4
  495. package/src/components/xform/utils/vue2js-generator.js +2 -2
  496. package/src/components/xhsPrint/index.js +44 -1
  497. package/src/components/xhsPrint/mixins.js +269 -1
  498. package/src/directive/LimitNumber/index.js +144 -1
  499. package/src/directive/el-dialog-center/index.js +34 -1
  500. package/src/directive/el-drag-dialog/drag.js +86 -1
  501. package/src/directive/el-readonly/index.js +15 -1
  502. package/src/directive/permission/hasPermi.js +34 -1
  503. package/src/index.js +403 -85
  504. package/src/lang/index.js +56 -51
  505. package/src/lang/locale/en/login.js +27 -0
  506. package/src/lang/locale/zh/login.js +26 -0
  507. package/src/layout/components/AppMain.vue +147 -111
  508. package/src/layout/components/Sidebar/default.vue +1655 -1222
  509. package/src/layout/components/Sidebar/index.vue +6 -1
  510. package/src/layout/components/TagsView/index.vue +57 -15
  511. package/src/layout/components/createCompany/createCompanyDialog.vue +157 -0
  512. package/src/layout/components/extractedCode/createDialog.vue +92 -0
  513. package/src/layout/components/extractedCode/queryDialog.vue +103 -0
  514. package/src/layout/components/extractedCode/viewDialog.vue +207 -0
  515. package/src/layout/components/langTool.vue +128 -120
  516. package/src/layout/components/watermark/index.vue +83 -0
  517. package/src/layout/defaultLayout.vue +170 -150
  518. package/src/microRouter/index.js +447 -0
  519. package/src/mixins/selectDialog/index.js +266 -1
  520. package/src/mixins/tableTree/index.js +262 -4
  521. package/src/mixins/wf/index.js +40 -6
  522. package/src/permission.js +158 -16
  523. package/src/public-path.js +38 -0
  524. package/src/resources/js/base/common.js +109 -109
  525. package/src/router/index.js +4 -7
  526. package/src/router/modules/customer.js +72 -4
  527. package/src/router/modules/system.js +4 -0
  528. package/src/store/config/index.js +945 -3
  529. package/src/store/getters.js +4 -1
  530. package/src/store/modules/micro.js +57 -0
  531. package/src/store/modules/permission.js +517 -23
  532. package/src/store/modules/settings.js +26 -1
  533. package/src/store/modules/tagsView.js +208 -5
  534. package/src/store/modules/user.js +418 -28
  535. package/src/utils/aes.js +21 -1
  536. package/src/utils/auth.js +27 -1
  537. package/src/utils/componentDialog.js +339 -0
  538. package/src/utils/global.js +370 -8
  539. package/src/utils/index.js +579 -7
  540. package/src/utils/keepAlive.js +185 -1
  541. package/src/utils/lazyPlugin.js +66 -0
  542. package/src/utils/menuAdapter.js +277 -0
  543. package/src/utils/pddLog.js +92 -0
  544. package/src/utils/pdfUtil.js +71 -0
  545. package/src/utils/repeatOpen.js +48 -0
  546. package/src/utils/request.js +403 -14
  547. package/src/utils/resolveViewComponent.js +203 -0
  548. package/src/utils/scrollUtil.js +25 -0
  549. package/src/utils/vab.js +1279 -27
  550. package/src/utils/validate.js +104 -1
  551. package/src/views/bd/project/branch/bd_branch/edit.vue +145 -0
  552. package/src/views/bd/project/branch/bd_branch/list.vue +72 -0
  553. package/src/views/bd/project/branch/bd_branch/menuKindDialog.vue +106 -0
  554. package/src/views/bd/project/branch/bd_branch/mixins/edit.js +189 -0
  555. package/src/views/bd/project/branch/bd_branch/mixins/list.js +124 -0
  556. package/src/views/bd/project/branch/bd_branch/mixins/menuKindDialog.js +85 -0
  557. package/src/views/bd/project/branch/form_script/list.vue +31 -0
  558. package/src/views/bd/project/branch/form_template/list.vue +30 -0
  559. package/src/views/bd/project/branch/menu_kind/list.vue +31 -0
  560. package/src/views/bd/project/common/form_script/list.vue +16 -0
  561. package/src/views/bd/project/common/form_template/list.vue +15 -0
  562. package/src/views/bd/project/common/menu_kind/list.vue +15 -0
  563. package/src/views/bd/project/core/branchContext.js +100 -0
  564. package/src/views/bd/project/core/branchPage.js +78 -0
  565. package/src/views/bd/project/core/branchPageWrap.vue +225 -0
  566. package/src/views/bd/project/core/branchScope.js +44 -0
  567. package/src/views/bd/project/core/branchSearchPage.js +285 -0
  568. package/src/views/bd/project/core/branchSelect.vue +85 -0
  569. package/src/views/bd/project/core/branchTreeBar.vue +81 -0
  570. package/src/views/bd/project/core/httpBranchPatch.js +58 -0
  571. package/src/views/bd/project/datatable/menu_kind/list.vue +15 -0
  572. package/src/views/bd/project/datatable/table_model/list.vue +15 -0
  573. package/src/views/bd/setting/bd_attach_setting/dialog.vue +1 -1
  574. package/src/views/bd/setting/bd_attach_setting/edit.vue +5 -5
  575. package/src/views/bd/setting/bd_attach_setting/list.vue +28 -55
  576. package/src/views/bd/setting/bd_attach_setting/mixins/dialog.js +84 -1
  577. package/src/views/bd/setting/bd_attach_setting/mixins/edit.js +116 -5
  578. package/src/views/bd/setting/bd_attach_setting/mixins/list.js +239 -1
  579. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -0
  580. package/src/views/bd/setting/bd_company_env/edit.vue +193 -0
  581. package/src/views/bd/setting/bd_company_env/list.vue +175 -0
  582. package/src/views/bd/setting/config_manage/list.vue +83 -0
  583. package/src/views/bd/setting/formVersion/button.vue +60 -0
  584. package/src/views/bd/setting/formVersion/compareBasicSection.vue +125 -0
  585. package/src/views/bd/setting/formVersion/compareCodeSection.vue +539 -0
  586. package/src/views/bd/setting/formVersion/compareContMixin.scss +65 -0
  587. package/src/views/bd/setting/formVersion/compareContent.vue +63 -0
  588. package/src/views/bd/setting/formVersion/compareDialog.vue +88 -0
  589. package/src/views/bd/setting/formVersion/compareMixin.js +93 -0
  590. package/src/views/bd/setting/formVersion/fieldCompare.vue +54 -0
  591. package/src/views/bd/setting/formVersion/formScriptCompareView.vue +94 -0
  592. package/src/views/bd/setting/formVersion/formTemplateCompareView.vue +74 -0
  593. package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +501 -0
  594. package/src/views/bd/setting/formVersion/link.vue +63 -0
  595. package/src/views/bd/setting/formVersion/preformDialog.vue +87 -0
  596. package/src/views/bd/setting/formVersion/reverButton.vue +82 -0
  597. package/src/views/bd/setting/formVersion/tableDetailDiff.js +99 -0
  598. package/src/views/bd/setting/formVersion/tableModelCompareView.vue +514 -0
  599. package/src/views/bd/setting/formVersion/textDiff.js +102 -0
  600. package/src/views/bd/setting/form_import_log/edit.vue +130 -0
  601. package/src/views/bd/setting/form_import_log/list.vue +211 -0
  602. package/src/views/bd/setting/form_script/dialog.vue +1 -1
  603. package/src/views/bd/setting/form_script/edit.vue +197 -74
  604. package/src/views/bd/setting/form_script/edit1.vue +411 -187
  605. package/src/views/bd/setting/form_script/form_list.vue +175 -85
  606. package/src/views/bd/setting/form_script/list.vue +96 -21
  607. package/src/views/bd/setting/form_script/list1.vue +207 -118
  608. package/src/views/bd/setting/form_script/mixins/dialog.js +130 -1
  609. package/src/views/bd/setting/form_script/mixins/edit.js +265 -7
  610. package/src/views/bd/setting/form_script/mixins/edit1.js +259 -9
  611. package/src/views/bd/setting/form_script/mixins/form_list.js +320 -4
  612. package/src/views/bd/setting/form_script/mixins/list.js +307 -4
  613. package/src/views/bd/setting/form_script/mixins/list1.js +512 -14
  614. package/src/views/bd/setting/form_script/mixins/list2.js +10 -1
  615. package/src/views/bd/setting/form_script/mixins/otherAuthDialog.js +194 -0
  616. package/src/views/bd/setting/form_script/mixins/preformDialog.js +34 -1
  617. package/src/views/bd/setting/form_script/otherAuthDialog.vue +83 -0
  618. package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +105 -0
  619. package/src/views/bd/setting/form_template/dialog.vue +1 -1
  620. package/src/views/bd/setting/form_template/edit.vue +356 -184
  621. package/src/views/bd/setting/form_template/editWfObjConfigDialog.vue +2 -2
  622. package/src/views/bd/setting/form_template/formDesignerDialog.vue +172 -0
  623. package/src/views/bd/setting/form_template/ftHistoryDialog.vue +1 -1
  624. package/src/views/bd/setting/form_template/itemList.vue +1 -1
  625. package/src/views/bd/setting/form_template/list.vue +303 -212
  626. package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +282 -0
  627. package/src/views/bd/setting/form_template/mixins/dialog.js +103 -1
  628. package/src/views/bd/setting/form_template/mixins/edit.js +280 -9
  629. package/src/views/bd/setting/form_template/mixins/editWfObjConfigDialog.js +92 -1
  630. package/src/views/bd/setting/form_template/mixins/ftHistoryDialog.js +91 -1
  631. package/src/views/bd/setting/form_template/mixins/itemEdit.js +104 -1
  632. package/src/views/bd/setting/form_template/mixins/itemList.js +234 -1
  633. package/src/views/bd/setting/form_template/mixins/list.js +721 -22
  634. package/src/views/bd/setting/form_template/mixins/list2.js +411 -0
  635. package/src/views/bd/setting/form_template/mixins/otherAuthDialog.js +193 -0
  636. package/src/views/bd/setting/form_template/mixins/preformDialog.js +28 -3
  637. package/src/views/bd/setting/form_template/mixins/wf_list.js +430 -0
  638. package/src/views/bd/setting/form_template/otherAuthDialog.vue +83 -0
  639. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +253 -0
  640. package/src/views/bd/setting/form_template/wf_list.vue +161 -0
  641. package/src/views/bd/setting/logic_param/edit.vue +146 -0
  642. package/src/views/bd/setting/logic_param/edit1.vue +106 -0
  643. package/src/views/bd/setting/logic_param/edit2.vue +139 -0
  644. package/src/views/bd/setting/logic_param/list.vue +74 -0
  645. package/src/views/bd/setting/logic_param/list1.vue +12 -0
  646. package/src/views/bd/setting/logic_param/list2.vue +12 -0
  647. package/src/views/bd/setting/logic_param/mixins/edit.js +93 -0
  648. package/src/views/bd/setting/logic_param/mixins/list.js +376 -0
  649. package/src/views/bd/setting/menu_kind/authDialog.vue +1 -1
  650. package/src/views/bd/setting/menu_kind/dialog.vue +1 -1
  651. package/src/views/bd/setting/menu_kind/list.vue +172 -83
  652. package/src/views/bd/setting/menu_kind/mixins/authDialog.js +300 -7
  653. package/src/views/bd/setting/menu_kind/mixins/dialog.js +139 -1
  654. package/src/views/bd/setting/menu_kind/mixins/list.js +201 -1
  655. package/src/views/bd/setting/push_data/edit.vue +139 -0
  656. package/src/views/bd/setting/push_data/list.vue +283 -0
  657. package/src/views/bd/setting/push_data_h/edit.vue +153 -0
  658. package/src/views/bd/setting/push_data_h/list.vue +293 -0
  659. package/src/views/bd/setting/request_async_setting/edit.vue +320 -0
  660. package/src/views/bd/setting/request_async_setting/list.vue +372 -0
  661. package/src/views/bd/setting/request_setting/edit.vue +300 -0
  662. package/src/views/bd/setting/request_setting/list.vue +301 -0
  663. package/src/views/bd/setting/table_model/dialog.vue +1 -1
  664. package/src/views/bd/setting/table_model/edit.vue +1080 -426
  665. package/src/views/bd/setting/table_model/list.vue +219 -126
  666. package/src/views/bd/setting/table_model/mixins/dialog.js +71 -1
  667. package/src/views/bd/setting/table_model/mixins/edit.js +1309 -13
  668. package/src/views/bd/setting/table_model/mixins/list.js +475 -14
  669. package/src/views/bd/setting/table_model/mixins/otherAuthDialog.js +201 -0
  670. package/src/views/bd/setting/table_model/mixins/zdDialog.js +114 -3
  671. package/src/views/bd/setting/table_model/otherAuthDialog.vue +83 -0
  672. package/src/views/bd/setting/table_model/zdDialog.vue +1 -1
  673. package/src/views/bd/setting/utils/index.js +75 -1
  674. package/src/views/demo/bizTab/bill/billConfig.js +41 -0
  675. package/src/views/demo/bizTab/bill/detail.vue +436 -0
  676. package/src/views/demo/bizTab/bill/list.vue +288 -0
  677. package/src/views/demo/bizTab/bill/productDialog.vue +176 -0
  678. package/src/views/demo/bizTab/simple/billApi.js +123 -0
  679. package/src/views/demo/bizTab/simple/detail.vue +407 -0
  680. package/src/views/demo/bizTab/simple/list.vue +217 -0
  681. package/src/views/demo/bizTab/standalone/index.vue +121 -0
  682. package/src/views/demo/bizTab/wf/billConfig.js +44 -0
  683. package/src/views/demo/bizTab/wf/detail.vue +661 -0
  684. package/src/views/demo/bizTab/wf/list.vue +242 -0
  685. package/src/views/support/export_template/list.vue +1 -1
  686. package/src/views/support/form-dialog-demo/demoPickerDialog.vue +72 -0
  687. package/src/views/support/form-dialog-demo/index.vue +537 -0
  688. package/src/views/user/access_log/list.vue +418 -349
  689. package/src/views/user/access_log/list2.vue +1 -1
  690. package/src/views/user/api_request/list.vue +1 -1
  691. package/src/views/user/area/dialog.vue +235 -116
  692. package/src/views/user/area/list.vue +318 -0
  693. package/src/views/user/bill_setting/edit.vue +1 -1
  694. package/src/views/user/bill_setting/list.vue +2 -2
  695. package/src/views/user/bill_setting/userDialog.vue +1 -1
  696. package/src/views/user/code_rules/list.vue +1 -1
  697. package/src/views/user/commMenu/index.vue +2 -2
  698. package/src/views/user/common_attribute/itemEdit.vue +2 -2
  699. package/src/views/user/common_attribute/list.vue +7 -4
  700. package/src/views/user/common_script/edit.vue +1 -1
  701. package/src/views/user/common_script/list.vue +2 -2
  702. package/src/views/user/company_info/dialog.vue +195 -154
  703. package/src/views/user/company_info/edit.vue +149 -88
  704. package/src/views/user/country/dialog.vue +1 -1
  705. package/src/views/user/country/list.vue +1 -1
  706. package/src/views/user/data_type_setting/dialog.vue +1 -1
  707. package/src/views/user/extend_datasource/dialog.vue +5 -1
  708. package/src/views/user/extend_datasource/edit.vue +5 -1
  709. package/src/views/user/extend_datasource/list.vue +6 -2
  710. package/src/views/user/fieldTranslation/editDialog.vue +8 -8
  711. package/src/views/user/fieldTranslation/list.vue +34 -34
  712. package/src/views/user/field_values_invisible/list.vue +1 -1
  713. package/src/views/user/file_type/edit.vue +30 -1
  714. package/src/views/user/file_type/list.vue +29 -1
  715. package/src/views/user/file_view_area/list.vue +1 -1
  716. package/src/views/user/file_view_ins/list.vue +22 -1
  717. package/src/views/user/form/form_template/dialog.vue +1 -1
  718. package/src/views/user/form/form_template/itemList.vue +1 -1
  719. package/src/views/user/form/form_template/list.vue +1 -1
  720. package/src/views/user/form/form_template_field/dialog.vue +1 -1
  721. package/src/views/user/form/form_type/dialog.vue +1 -1
  722. package/src/views/user/form/form_type/list.vue +1 -1
  723. package/src/views/user/form/report_requestaccess/dialog.vue +1 -1
  724. package/src/views/user/form/report_requestaccess/list.vue +1 -1
  725. package/src/views/user/form/vform/designer.vue +821 -749
  726. package/src/views/user/form/vform/formFieldMapping.js +2 -3
  727. package/src/views/user/form/vform/out_render.vue +1 -1
  728. package/src/views/user/form/vform/render.vue +80 -52
  729. package/src/views/user/form/view/edit.vue +56 -37
  730. package/src/views/user/form/view/list.vue +475 -54
  731. package/src/views/user/groups/dialog.vue +1 -1
  732. package/src/views/user/groups/edit.vue +2 -0
  733. package/src/views/user/groups/list.vue +2 -1
  734. package/src/views/user/home/default.vue +1117 -979
  735. package/src/views/user/home/default2.vue +1158 -0
  736. package/src/views/user/home/dev.vue +29 -0
  737. package/src/views/user/home/index.vue +20 -16
  738. package/src/views/user/lang_tag/dialog.vue +1 -1
  739. package/src/views/user/lang_tag/list.vue +1 -1
  740. package/src/views/user/language_setting/list.vue +1 -1
  741. package/src/views/user/login/default.vue +167 -44
  742. package/src/views/user/login/index.vue +4 -6
  743. package/src/views/user/login/indexMixin.js +582 -380
  744. package/src/views/user/menu/list.vue +51 -2
  745. package/src/views/user/menuFallback/index.vue +123 -0
  746. package/src/views/user/mobile_menu/list.vue +1 -1
  747. package/src/views/user/notify_message/dialog.vue +65 -22
  748. package/src/views/user/notify_message/list.vue +1 -1
  749. package/src/views/user/notify_template/edit.vue +188 -187
  750. package/src/views/user/notify_template/edit2.vue +176 -0
  751. package/src/views/user/notify_template/list.vue +5 -2
  752. package/src/views/user/notify_template/list2.vue +190 -0
  753. package/src/views/user/oplog/list.vue +1 -1
  754. package/src/views/user/outLink/cc_form_view.vue +185 -0
  755. package/src/views/user/outLink/form_view.vue +202 -184
  756. package/src/views/user/outLink/index.vue +72 -11
  757. package/src/views/user/outLink/view.vue +37 -19
  758. package/src/views/user/position/dialog.vue +1 -1
  759. package/src/views/user/position/list.vue +5 -5
  760. package/src/views/user/project_tag/dialog.vue +10 -5
  761. package/src/views/user/project_tag/edit.vue +2 -2
  762. package/src/views/user/project_tag/list.vue +10 -5
  763. package/src/views/user/push_setting/list.vue +3 -3
  764. package/src/views/user/request_setting/edit.vue +258 -0
  765. package/src/views/user/request_setting/list.vue +248 -0
  766. package/src/views/user/role/authConfig.vue +89 -0
  767. package/src/views/user/role/dialog.vue +70 -48
  768. package/src/views/user/role/edit.vue +609 -429
  769. package/src/views/user/role/list.vue +5 -5
  770. package/src/views/user/sale_org/dialog.vue +2 -2
  771. package/src/views/user/sale_org/list.vue +5 -2
  772. package/src/views/user/system_notice/infoDialog.vue +61 -1
  773. package/src/views/user/system_notice/list.vue +1 -1
  774. package/src/views/user/system_parameter/list.vue +1 -1
  775. package/src/views/user/user/dialog.vue +47 -24
  776. package/src/views/user/user/edit.vue +1485 -1021
  777. package/src/views/user/user/form_dialog.vue +158 -0
  778. package/src/views/user/user/form_edit.vue +117 -49
  779. package/src/views/user/user/form_info.vue +210 -0
  780. package/src/views/user/user/form_list.vue +2 -1
  781. package/src/views/user/user/info.vue +253 -140
  782. package/src/views/user/user/list.vue +652 -570
  783. package/src/views/user/user/modifyPasswordDialog.vue +64 -53
  784. package/src/views/user/user_log_classify/list.vue +1 -1
  785. package/src/views/user/wf/iframe/index.vue +6 -1
  786. package/src/views/user/wf/iframe/index2.vue +6 -1
  787. package/src/views/user/wf/wfReport/index.vue +648 -0
  788. package/src/views/user/wf/wf_auto_submit_data/list.vue +4 -2
  789. package/src/views/user/wf/wf_manage/list.vue +683 -256
  790. package/src/views/user/wf/wf_manage/list2.vue +875 -0
  791. package/src/views/user/wf/wf_manage/wfContentDialog.vue +47 -22
  792. package/src/views/user/wf/wf_obj_config/dialog.vue +1 -1
  793. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +109 -0
  794. package/src/views/user/wf/wf_obj_config/itemEdit.vue +25 -1
  795. package/src/views/user/wf/wf_obj_config/list.vue +139 -6
  796. package/src/views/user/wf/wf_obj_config/list_form.vue +1 -1
  797. package/src/views/user/wf/wf_obj_config/wfBizDataSettingDialog.vue +292 -0
  798. package/src/views/user/wf/wf_transfer_setting/edit.vue +282 -0
  799. package/src/views/user/wf/wf_transfer_setting/list.vue +319 -0
  800. package/src/views/user/workbench_menu/list.vue +555 -0
  801. package/src/components/excelExport/export-panel.js +0 -458
  802. package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +0 -206
  803. package/src/components/xform/form-render/container-item/list-h5-item2.vue +0 -1347
  804. package/src/utils/wf.js +0 -21
@@ -1,1021 +1,1485 @@
1
- <template>
2
- <div class="detail-wrap">
3
- <el-form ref="editForm" :model="user">
4
- <div class="d-header clearfix">
5
- <div class="fl">
6
- <i class="el-icon-info"/>
7
- {{ dataId ? $t1('查看用户') : $t1('新增用户') }}
8
- </div>
9
- <div class="fr">
10
- <!-- <temp-storage-button :option="tempStorageOption" v-if="!dataId"></temp-storage-button>-->
11
- <base-input-export :option="exportOption" :parent-target="_self" v-if="dataId"/>
12
- <el-button type="primary" plain class="button-sty" icon="el-icon-unlock" @click="unlock" v-if="user.locked"
13
- v-hasPermi="'user:unlock'">{{ $t1('解锁') }}
14
- </el-button>
15
- <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">
16
- {{ $t1('重置') }}
17
- </el-button>
18
- <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
19
- </el-button>
20
- </div>
21
- </div>
22
- <baseTabs>
23
- <baseTabPane :label="$t1('基本信息')">
24
- <template #default>
25
- <table class="table-detail">
26
- <tbody>
27
- <tr>
28
- <th>
29
- <em class="f-red">*</em>
30
- {{ $t1('登录名') }}
31
- </th>
32
- <td colspan="3">
33
- <el-form-item prop="loginAccount" :rules="[{ required: true, trigger: 'blur' }]">
34
- <template v-if="dataId">
35
- <el-input size="small" v-model="user.loginAccount" maxlength="255" autocomplete="off"
36
- lay-verify="required" required="" :readonly="true"/>
37
- </template>
38
- <template v-else>
39
- <el-input size="small" v-model="user.loginAccount" maxlength="255" autocomplete="off"
40
- lay-verify="required" required="" clearable/>
41
- </template>
42
- </el-form-item>
43
- </td>
44
-
45
- <th>
46
- <em class="f-red">*</em>
47
- {{ $t1('姓名') }}
48
- </th>
49
- <td colspan="3">
50
- <el-form-item prop="nickName" :rules="[{ required: true, trigger: 'blur' }]">
51
- <el-input size="small" v-model="user.nickName" maxlength="200" lay-verify="required" required=""
52
- clearable/>
53
- </el-form-item>
54
- </td>
55
- </tr>
56
- <tr>
57
-
58
- <th>
59
- <em class="f-red" v-if="!dataId">*</em>
60
- {{ $t1('密码') }}
61
- </th>
62
- <td>
63
- <el-form-item prop="password" :rules="passRules">
64
- <el-input size="small" type="password" v-model="user.password" show-password maxlength="255"
65
- autocomplete="off" auto-complete="new-password" clearable/>
66
- </el-form-item>
67
- </td>
68
- <th>
69
- <em class="f-red" v-if="!dataId">*</em>
70
- {{ $t1('确认密码') }}
71
- </th>
72
- <td>
73
- <el-form-item prop="rePassword" :rules="pass2Rules">
74
- <el-input
75
- size="small"
76
- type="password"
77
- v-model="user.rePassword"
78
- show-password
79
- maxlength="255"
80
- autocomplete="off"
81
- auto-complete="new-password"
82
- lay-verify="confirmPass"
83
- clearable
84
- />
85
- </el-form-item>
86
- </td>
87
-
88
-
89
- <th>{{ $t1('性别') }}</th>
90
- <td>
91
- <el-radio-group v-model="user.gender">
92
- <el-radio :label="1">{{ $t1('男') }}</el-radio>
93
- <el-radio :label="2">{{ $t1('女') }}</el-radio>
94
- </el-radio-group>
95
- </td>
96
- <th>
97
- {{ $t1('员工编码') }}
98
- </th>
99
- <td>
100
- <el-form-item prop="empNo" :rules="[{ required: false, trigger: 'blur' }]">
101
- <el-input size="small" v-model="user.empNo" maxlength="200" clearable/>
102
- </el-form-item>
103
- </td>
104
- </tr>
105
-
106
- <tr>
107
- <th>{{ $t1('出生日期') }}</th>
108
- <td>
109
- <el-date-picker size="small" v-model="user.birth" type="date" :placeholder="$t1('选择日期')"
110
- value-format="yyyy-MM-dd" clearable/>
111
- </td>
112
- <th>{{ $t1('邮编') }}</th>
113
- <td>
114
- <el-input size="small" v-model="user.zipCode" maxlength="255" clearable/>
115
- </td>
116
- <th>{{ $t1('手机') }}</th>
117
- <td>
118
- <el-form-item prop="mobile" :rules="[{ required: false, trigger: 'blur' }]">
119
- <el-input size="small" v-model="user.mobile" type="text" maxlength="255" autocomplete="off"
120
- lay-verify="required|phone" clearable/>
121
- </el-form-item>
122
- </td>
123
- <th>{{ $t1('设置') }}</th>
124
- <td>
125
- <el-checkbox :label="$t1('是否启用')" v-model="user.enabled"></el-checkbox>
126
- </td>
127
-
128
- </tr>
129
-
130
- <tr>
131
- <th>
132
- {{ $t1('邮箱') }}
133
- </th>
134
- <td>
135
- <el-form-item prop="email" :rules="[{ required: false, trigger: 'blur' }]">
136
- <el-input size="small" v-model="user.email" maxlength="200" clearable/>
137
- </el-form-item>
138
- </td>
139
- <th v-if="flag!=='2'">
140
- GUID
141
- </th>
142
- <td v-if="flag!=='2'">
143
- <el-form-item prop="guid" :rules="[{ required: false, trigger: 'blur' }]">
144
- <el-input size="small" v-model="user.guid" maxlength="200" clearable/>
145
- </el-form-item>
146
- </td>
147
- <th>{{ $t1('地址') }}</th>
148
- <td colspan="3">
149
- <el-input size="small" v-model="user.address" class="b" maxlength="255" clearable/>
150
- </td>
151
-
152
- </tr>
153
- <tr>
154
- <th>
155
- {{ $t1('国家') }}
156
- </th>
157
- <td colspan="3">
158
- <el-form-item prop="countryName" :rules="[{ required: false, trigger: 'blur' }]">
159
- <el-input
160
- class="search-input"
161
- v-model="user.countryName"
162
- clearable
163
- @clear="
164
- user.countryName = null;
165
- user.countryCode = null;
166
- "
167
- v-el-readonly
168
- >
169
- <i slot="suffix" class="el-input__icon el-icon-search"
170
- @click="showCountryDialog=true"></i>
171
- </el-input>
172
- </el-form-item>
173
- </td>
174
- <th>
175
- {{ $t1('是否锁定') }}
176
- </th>
177
- <td>
178
- {{ user.locked ? $t1('是') : $t1('') }}
179
- </td>
180
- </tr>
181
- <tr>
182
- <th>{{ $t1('头像') }}</th>
183
- <td colspan="7">
184
- <baseUpload :limit="1" accept="image/png, image/jpeg" multi="false" :file.sync="user.headPhotoUrl"
185
- dataType="medium"></baseUpload>
186
- </td>
187
- </tr>
188
- <tr>
189
- <th>{{ $t1('创建人') }}</th>
190
- <td>{{ user.createBy }}</td>
191
- <th>{{ $t1('创建时间') }}</th>
192
- <td>{{ user.createDate }}</td>
193
- <th>{{ $t1('更新人') }}</th>
194
- <td>{{ user.modifyBy }}</td>
195
- <th>{{ $t1('更新时间') }}</th>
196
- <td>{{ user.modifyDate }}</td>
197
- </tr>
198
- </tbody>
199
- </table>
200
- </template>
201
- </baseTabPane>
202
- <baseTabPane :label="$t1('组织信息')">
203
- <template #button>
204
- <el-button class="button-sty" @click="addCurrentCompany()" icon="el-icon-search" v-if="!hasCurrentCompany">
205
- {{ $t1('新增组织权限') }}
206
- </el-button>
207
- </template>
208
- <template #default>
209
- <div class="style1">
210
- <div class="d-item" v-for="(item,index1) in user.userCompanyInfoDTOs" :key="index1">
211
- <div class="title">
212
- <b>{{ item.companyName }}</b>
213
- <el-button class="button-sty" icon="el-icon-delete" v-if="isCurrentCompany(item.companyCode)"
214
- @click="deleteCompany(item,index1)">{{ $t1('删除') }}
215
- </el-button>
216
- </div>
217
- <div class="title-form">
218
- <span v-if="flag==='2'">
219
- <el-form-item label="GUID" :prop="'userCompanyInfoDTOs.'+index1+'.guid'"
220
- :rules="[{ required: false, trigger: 'blur' }]">
221
- <el-input size="small" v-model="item.guid" maxlength="200" clearable/>
222
- </el-form-item>
223
- </span>
224
- </div>
225
- <div class="m-2">
226
- <div class="d-item" style="width: 65%;">
227
- <div class="title">
228
- <b>{{ $t1('机构信息') }}</b>
229
- <el-button class="button-sty" icon="el-icon-search" @click="showSaleOrgDialog = true"
230
- v-if="isCurrentCompany(item.companyCode)">{{ $t1('选择机构') }}
231
- </el-button>
232
- </div>
233
- <div class="grid-h">
234
- <vxe-grid
235
- :ref="'saleOrgGrid-'+item.companyCode"
236
- :data="gridSaleOrgDataMap[item.companyCode]"
237
- v-bind="vxeOptionMap['saleOrgGridOption-'+item.companyCode]"
238
- @resizable-change="$vxeTableUtil.onColumnWitchChange"
239
- @custom="$vxeTableUtil.customHandle">
240
- <template #position="{row,rowIndex,$table}">
241
- <el-input
242
- class="search-input"
243
- :value="getSelectPositionName(row)"
244
- clearable
245
- @clear="
246
- row.userSaleOrgPositionDTOs = [];
247
- $forceUpdate();
248
- "
249
- v-el-readonly
250
- v-if="companyInfo.companyCode == row.companyCode"
251
- >
252
- <i slot="suffix" class="el-input__icon el-icon-search"
253
- @click="openSelectPositionDialog(row, rowIndex, $table)"></i>
254
- </el-input>
255
- <template v-else>
256
- {{ getSelectPositionName(row) }}
257
- </template>
258
- </template>
259
- </vxe-grid>
260
- </div>
261
- </div>
262
- <div class="d-item" style="width: 35%;">
263
- <div class="title">
264
- <b>{{ $t1('角色信息') }}</b>
265
- <el-button class="button-sty" icon="el-icon-search" @click="showRoleDialog = true"
266
- v-if="isCurrentCompany(item.companyCode)">{{ $t1('选择角色') }}
267
- </el-button>
268
- </div>
269
- <div class="grid-h">
270
- <vxe-grid
271
- :ref="'userRoleGrid-'+item.companyCode"
272
- :data="gridRoleDataMap[item.companyCode]"
273
- v-bind="vxeOptionMap['userRoleGridOption-'+item.companyCode]"
274
- @resizable-change="$vxeTableUtil.onColumnWitchChange"
275
- @custom="$vxeTableUtil.customHandle"
276
- ></vxe-grid>
277
- </div>
278
- </div>
279
- </div>
280
- </div>
281
- </div>
282
- </template>
283
- </baseTabPane>
284
- </baseTabs>
285
- </el-form>
286
- <roleDialog v-if="showRoleDialog" :visiable.sync="showRoleDialog" @confirm="confirmRole"
287
- :param="roleDialogParam"/>
288
- <companyDialog v-if="showCompanyDialog" :visiable.sync="showCompanyDialog" @confirm="confirmInsertCompany"/>
289
- <saleOrgDialog v-if="showSaleOrgDialog" :visiable.sync="showSaleOrgDialog" @confirm="confirmInsertSaleOrg"
290
- :param="{ queryAll: true }"/>
291
- <positionDialog v-if="showPositionDialog" :visiable.sync="showPositionDialog" :rows="positionDialogDatas"
292
- @confirm="confirmInsertPosition" :param="{ queryAll: true }"/>
293
- <countryDialog v-if="showCountryDialog" :visiable.sync="showCountryDialog"
294
- @confirm="confirmCountry" multi="false"/>
295
- </div>
296
- </template>
297
-
298
- <script>
299
- import xeUtils from "xe-utils";
300
- /*import tempStorageButton from "@base/components/tempStorage/index.vue";*/
301
-
302
-
303
- export default {
304
- name: 'UserEdit',
305
- components: {
306
- roleDialog: () => import('../../../views/user/role/dialog.vue'),
307
- companyDialog: () => import('../../../views/user/company_info/dialog.vue'),
308
- saleOrgDialog: () => import('../../../views/user/sale_org/dialog.vue'),
309
- positionDialog: () => import('../../../views/user/position/dialog.vue'),
310
- countryDialog: () => import('../../../views/user/country/dialog.vue')/*,
311
- tempStorageButton*/
312
- },
313
- props: ['_dataId', 'userType', 'flag'],
314
- data() {
315
- var validatePass = (rule, value, callback) => {
316
- const isPassRequired = !this.dataId;
317
- if (isPassRequired && (value == '' || value == undefined)) {
318
- callback(new Error(this.$t1('密码不能为空')));
319
- } else {
320
- callback();
321
- }
322
- this.$refs.editForm.validateField('rePassword');
323
- };
324
- var validatePass2 = (rule, value, callback) => {
325
- const isPassRequired = !this.dataId;
326
- const rePassword = value != undefined ? value : '';
327
- const password = this.user.password != undefined ? this.user.password : '';
328
-
329
- if (isPassRequired && rePassword == '') {
330
- callback(new Error(this.$t1('确认密码不能为空')));
331
- } else if (rePassword != password) {
332
- callback(new Error(this.$t1('两次输入密码不一致!')));
333
- } else {
334
- callback();
335
- }
336
- };
337
-
338
- return {
339
- dataId: '',
340
- hBtn: true,
341
- user: {
342
- userCompanyInfoDTOs: [],
343
- userSaleOrgDTOs: [],
344
- userRoleDTOs: [],
345
- gender: null,
346
- enabled: true,
347
- userType: null,
348
- countryName: null,
349
- countryCode: null
350
- },
351
- vxeOption: {},
352
- companyInfoOption: {},
353
- userRoleOption: {},
354
- showRoleDialog: false,
355
- showCompanyDialog: false,
356
- showSaleOrgDialog: false,
357
- showPositionDialog: false,
358
- saleOrgPositionIndex: 0,
359
- passRules: [{validator: validatePass, trigger: 'blur', required: false}],
360
- pass2Rules: [{validator: validatePass2, trigger: 'blur', required: false}],
361
- activeName: 'first',
362
- userCustomerListDTO: {
363
- userCustomerDTOs: []
364
- },
365
- customerOption: {},
366
- showCustomerDialog: false,
367
- exportOption: {
368
- prefix: USER_PREFIX,
369
- title: this.$t1('用户'),
370
- codes: ["USEREXCEL", "USERPDF", "USERPRINT", "USERHIPRINT"],
371
- param: () => {
372
- return [{id: this.dataId}];
373
- }
374
- },
375
- showExtendedProperties: false,
376
- radio1: '0',
377
- companyInfo: {},
378
- vxeOptionMap: {},
379
- gridRoleDataMap: {},
380
- gridSaleOrgDataMap: {},
381
- distributorCode: 'distributor',
382
- distributorRole: null,
383
- outUserCodes: [],
384
- roleDialogParam: {queryAll: true},
385
- tempStorageOption: {
386
- storageType: "user",
387
- data: () => {
388
- this.handleData();
389
- return this.user;
390
- },
391
- chooseConfirm: (tempStorageData) => {
392
- this.user = tempStorageData;
393
- this.gridSaleOrgDataMap = xeUtils.groupBy(this.user.userSaleOrgDTOs, 'companyCode');
394
- this.gridRoleDataMap = xeUtils.groupBy(this.user.userRoleDTOs, 'companyCode');
395
- },
396
- saveConfirm: () => {
397
- }
398
- },
399
- showCountryDialog: false
400
- };
401
- },
402
- computed: {
403
- hasCurrentCompany() {
404
- return this.user.userCompanyInfoDTOs.find(item => item.companyCode == this.companyInfo.companyCode) != null;
405
- }
406
- },
407
- created() {
408
- if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
409
- },
410
- async mounted() {
411
-
412
- // this.getEainsGroupDTO();
413
- await this.initOutUserRoleCode();
414
- await this.initDistributorRole();
415
- this.getData();
416
- this.getConpanyInfo()
417
- },
418
- methods: {
419
- getData() {
420
- if (this.dataId && !isNaN(this.dataId)) {
421
- this.isEdit = true;
422
- this.$commonHttp({
423
- url: USER_PREFIX + `/user/get`,
424
- method: `post`,
425
- data: {
426
- id: this.dataId
427
- },
428
- isLoading: true,
429
- modalStrictly: true,
430
- success: res => {
431
- let user = res.objx || {};
432
- user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs;
433
- user.userSaleOrgDTOs = this.user.userSaleOrgDTOs;
434
- user.userRoleDTOs = this.user.userRoleDTOs;
435
- this.user = user;
436
- this.user.password = '';
437
-
438
- this.showExtendedProperties = true;
439
- }
440
- });
441
- } else {
442
- this.user.gender = 1;
443
- this.isEdit = false;
444
- this.showExtendedProperties = true;
445
- }
446
- },
447
- saveData() {
448
- let companyCode = this.companyInfo.companyCode;
449
- this.handleData();
450
- if (this.userType == 2) {
451
- //外部用户
452
- let currentUserCompanyInfo = this.user.userCompanyInfoDTOs.find(item => item.companyCode == companyCode)
453
- if (currentUserCompanyInfo) {
454
- let rows = this.user.userRoleDTOs.filter(item => item.companyCode == companyCode);
455
- if (!rows.length) {
456
- this.$baseAlert(this.$t1('请维护角色'));
457
- return
458
- }
459
- }
460
-
461
- }
462
- this.$refs.editForm.$baseValidate(valid => {
463
- if (valid) {
464
- this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
465
- var url = USER_PREFIX + (this.isEdit ? '/user/update' : '/user/save');
466
- this.$http({
467
- url: url,
468
- method: `post`,
469
- data: this.user,
470
- isLoading: true,
471
- success: res => {
472
- this.$message({
473
- message: res.content,
474
- type: 'success',
475
- duration: 500,
476
- onClose: t => {
477
- if (this.isEdit) {
478
- this.$baseReload();
479
- } else {
480
- this.$baseReload({
481
- updateParam: {
482
- _dataId: res.objx
483
- }
484
- });
485
- }
486
- }
487
- });
488
- }
489
- });
490
- });
491
- }
492
- });
493
- },
494
- getSaleOrgData() {
495
- if (this.dataId) {
496
- this.$http({
497
- url: USER_PREFIX + '/user/getUserSaleOrg',
498
- method: `post`,
499
- data: {id: this.dataId},
500
- isLoading: true,
501
- modalStrictly: true,
502
- success: res => {
503
- // this.$refs.saleOrgGrid.loadData(res.objx || []);
504
- let rows = res.objx || [];
505
- if (rows.length) {
506
- // this.gridSaleOrgDataMap = xeUtils.groupBy(rows, 'companyCode');
507
- Object.assign(this.gridSaleOrgDataMap, xeUtils.groupBy(rows, 'companyCode'));
508
- }
509
- this.user.userSaleOrgDTOs = rows;
510
- }
511
- });
512
- }
513
- },
514
- getUserRoleData() {
515
- if (this.dataId) {
516
- this.$http({
517
- url: USER_PREFIX + '/user/getUserRole',
518
- method: `post`,
519
- data: {id: this.dataId},
520
- isLoading: true,
521
- modalStrictly: true,
522
- success: res => {
523
- let rows = res.objx || [];
524
- if (rows.length) {
525
- // this.gridRoleDataMap = xeUtils.groupBy(rows, 'companyCode');
526
- Object.assign(this.gridRoleDataMap, xeUtils.groupBy(rows, 'companyCode'));
527
- }
528
- this.user.userRoleDTOs = rows;
529
- }
530
- });
531
- }
532
- },
533
- deleteSaleOrgItem(row, index, $table) {
534
- $table.remove(row);
535
- this.gridSaleOrgDataMap[row.companyCode].splice(index, 1);
536
- },
537
- getCompanyInfoData(callback) {
538
- if (this.dataId) {
539
- this.$http({
540
- url: USER_PREFIX + '/user/getUserCompanyInfo',
541
- method: `post`,
542
- data: {id: this.dataId},
543
- isLoading: true,
544
- modalStrictly: true,
545
- success: res => {
546
- let rows = res.objx || [];
547
- rows.forEach(row => {
548
- this.gridRoleDataMap[row.companyCode] = [];
549
- this.gridSaleOrgDataMap[row.companyCode] = [];
550
- })
551
- this.user.userCompanyInfoDTOs = rows;
552
- callback && callback();
553
- }
554
- });
555
- }
556
- },
557
- initSaleOrg(companyCode) {
558
- if (this.vxeOptionMap['saleOrgGridOption-' + companyCode]) {
559
- return;
560
- }
561
- let tableRef = 'saleOrgGrid-' + companyCode;
562
- const tableOption = {
563
- vue: this,
564
- tableRef: tableRef,
565
- tableName: 'editUser-saleOrgGrid-' + companyCode,
566
- columns: [
567
- {type: 'checkbox', fixed: 'left', width: 48, resizable: false},
568
- {title: this.$t1('机构名称'), field: 'saleOrgName', width: 200},
569
- {title: this.$t1('机构编码'), field: 'sn', width: 200},
570
- {title: this.$t1('上级机构'), field: 'treePathName', width: 200},
571
- {
572
- title: this.$t1('岗位'),
573
- field: 'position',
574
- width: 150,
575
- slots: {
576
- default: 'position'
577
- }
578
- },
579
- {
580
- title: this.$t1('是否默认'),
581
- field: 'defaults',
582
- width: 120,
583
- slots: {
584
- default: ({row, $table, rowIndex}) => {
585
- var isDefault = row.defaults || false;
586
- let disabled = this.companyInfo.companyCode != row.companyCode;
587
- return [
588
- <el-checkbox
589
- v-model={isDefault}
590
- disabled={disabled}
591
- onchange={() => {
592
- this.gridSaleOrgDataMap[row.companyCode].forEach((item, index) => {
593
- if (index == rowIndex) {
594
- item.defaults = true;
595
- } else {
596
- item.defaults = false;
597
- }
598
- });
599
- }}
600
- />
601
- ];
602
- }
603
- }
604
- },
605
- {
606
- width: 47,
607
- fixed: 'right',
608
- title: '',
609
- sortable: false,
610
- slots: {
611
- default: ({row, rowIndex, $table}) => {
612
- if (this.companyInfo.companyCode == row.companyCode) {
613
- return [
614
- <a
615
- href="javascript:void(0);"
616
- class="a-link"
617
- onclick={() => {
618
- this.deleteSaleOrgItem(row, rowIndex, $table);
619
- }}
620
- >
621
- <el-tooltip enterable={false} effect="dark" content={this.$t1('删除')} placement="top"
622
- popper-class="tooltip-skin">
623
- <i class="el-icon-delete"/>
624
- </el-tooltip>
625
- </a>
626
- ];
627
- }
628
- }
629
- }
630
- }
631
- ]
632
- };
633
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
634
- // this.vxeOptionMap['saleOrgGridOption-'+companyCode] = opts;
635
- this.$set(this.vxeOptionMap, 'saleOrgGridOption-' + companyCode, opts);
636
- });
637
-
638
- },
639
- initUserRole(companyCode) {
640
- if (this.vxeOptionMap['userRoleGridOption-' + companyCode]) {
641
- return;
642
- }
643
- let userType = this.userType;
644
- const tableOption = {
645
- vue: this,
646
- tableRef: 'userRoleGrid-' + companyCode,
647
- tableName: 'editUser-userRoleGrid-' + companyCode,
648
- columns: [
649
- {type: 'checkbox', fixed: 'left', width: 48, resizable: false},
650
- {
651
- title: this.$t1('角色名称'),
652
- field: 'name',
653
- width: 200,
654
- slots: {
655
- default: ({row}) => {
656
- if (!row.isAdd) {
657
- return row.roleName;
658
- } else {
659
- return row.name;
660
- }
661
- }
662
- }
663
- },
664
- {
665
- width: 47,
666
- fixed: 'right',
667
- title: '',
668
- sortable: false,
669
- slots: {
670
- default: ({row, rowIndex, $table}) => {
671
- if (this.companyInfo.companyCode == row.companyCode) {
672
- return [
673
- <a
674
- href="javascript:void(0);"
675
- class="a-link"
676
- onclick={() => {
677
- this.deleteRoleItem(row, rowIndex, $table);
678
- }}
679
- >
680
- <el-tooltip enterable={false} effect="dark" content={this.$t1('删除')} placement="top"
681
- popper-class="tooltip-skin">
682
- <i class="el-icon-delete"/>
683
- </el-tooltip>
684
- </a>
685
- ];
686
- }
687
- }
688
- }
689
- }
690
- ]
691
- };
692
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
693
- // this.vxeOptionMap['userRoleGridOption-'+companyCode] = opts;
694
- this.$set(this.vxeOptionMap, 'userRoleGridOption-' + companyCode, opts);
695
- });
696
- },
697
- confirmRole(rows) {
698
- if (rows.length > 0) {
699
- let outUserCodes = this.outUserCodes;
700
- if (this.userType === 1) {
701
- //企业用户
702
- rows = rows.filter(row => !outUserCodes.includes(row.code));
703
- } else if (this.userType === 2) {
704
- //外部用户
705
- rows = rows.filter(row => outUserCodes.includes(row.code));
706
- }
707
- let companyCode = this.companyInfo.companyCode;
708
- const $grid = this.$refs['userRoleGrid-' + companyCode][0];
709
- const tableData = this.gridRoleDataMap[companyCode];
710
- const map = {};
711
- tableData.forEach(function (item) {
712
- map[item.roleId] = 1;
713
- });
714
- var items = [];
715
- rows.forEach(row => {
716
- const item = {
717
- roleId: row.id,
718
- roleName: row.name,
719
- companyCode: companyCode,
720
- companyName: row.companyName
721
- };
722
- if (!map[item.roleId]) {
723
- items.push(item);
724
- }
725
- });
726
- // $grid.insertAt(items, -1);
727
- // this.user.userRoleDTOs = this.user.userRoleDTOs.concat(items);
728
- this.gridRoleDataMap[companyCode] = tableData.concat(items)
729
- $grid.loadData(this.gridRoleDataMap[companyCode])
730
- }
731
- },
732
- deleteRole(tableRef) {
733
- this.$baseConfirm(this.$t1('您确定要删除吗?')).then(() => {
734
- /*const $grid = this.$refs.userRoleGrid;
735
- $grid.removeCheckboxRow();
736
- this.user.userRoleDTOs = $grid.getTableData().fullData;*/
737
- let companyCode = this.companyInfo.companyCode;
738
- const $grid = this.$refs[tableRef][0];
739
- $grid.removeCheckboxRow();
740
- this.gridRoleDataMap[companyCode] = $grid.getTableData().fullData;
741
-
742
- });
743
- },
744
- deleteRoleItem(row, index, $table) {
745
- $table.remove(row);
746
- this.gridRoleDataMap[row.companyCode].splice(index, 1);
747
- },
748
- confirmInsertCompany(rows, callback) {
749
- if (rows.length > 0) {
750
- const tableData = this.user.userCompanyInfoDTOs;
751
- const map = {};
752
- tableData.forEach(function (item) {
753
- map[item.companyCode] = 1;
754
- });
755
- var items = [];
756
- rows.forEach(row => {
757
- const item = {companyCode: row.companyCode, companyName: row.companyName, guid: null};
758
- if (!map[item.companyCode]) {
759
- items.push(item);
760
- }
761
- this.gridRoleDataMap[item.companyCode] = []
762
- this.gridSaleOrgDataMap[item.companyCode] = []
763
- });
764
- // $grid.insertAt(items, -1);
765
- this.user.userCompanyInfoDTOs.splice(0, 0, ...items);
766
- // this.user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs.concat(items);
767
- }
768
- callback && callback();
769
- },
770
- deleteCompany(row, index) {
771
- let companyCode = row.companyCode;
772
- this.user.userCompanyInfoDTOs.splice(index, 1);
773
- this.gridSaleOrgDataMap[row.companyCode] = [];
774
- this.gridRoleDataMap[row.companyCode] = [];
775
- this.user.userSaleOrgDTOs = this.user.userSaleOrgDTOs.filter(item => item.companyCode != companyCode);
776
- this.user.userRoleDTOs = this.user.userRoleDTOs.filter(item => item.companyCode != companyCode);
777
- },
778
- confirmInsertSaleOrg(rows) {
779
- if (rows.length > 0) {
780
- let companyCode = this.companyInfo.companyCode;
781
- const $grid = this.$refs['saleOrgGrid-' + companyCode][0];
782
- const tableData = this.gridSaleOrgDataMap[companyCode] || [];
783
- const map = {};
784
- tableData.forEach(function (item) {
785
- map[item.saleOrgId] = 1;
786
- });
787
-
788
- let roleMap = {};
789
- let newUserRoleDTOs = [];
790
- var items = [];
791
-
792
- rows.forEach((row, index) => {
793
- const item = {
794
- companyCode: companyCode,
795
- companyName: row.companyName,
796
- defaults: false,
797
- saleOrgName: row.name,
798
- treePathName: row.treePathName,
799
- userSaleOrgPositionDTOs: [],
800
- saleOrgId: row.id,
801
- sn: row.sn
802
- };
803
-
804
- if (!map[item.saleOrgId]) {
805
- items.push(item);
806
- if (row.roleId && !roleMap[row.roleId]) {
807
- const roleItem = {
808
- id: row.roleId,
809
- name: row.roleName,
810
- companyCode: companyCode,
811
- companyName: row.companyName
812
- };
813
- roleMap[row.roleId] = true;
814
- newUserRoleDTOs.push(roleItem);
815
- }
816
- }
817
- });
818
- if (items.length > 0 && tableData.length == 0) {
819
- items[0].defaults = true;
820
- }
821
- // this.user.userSaleOrgDTOs.push(...items);
822
- this.gridSaleOrgDataMap[companyCode] = tableData.concat(items)
823
- $grid.loadData(this.gridSaleOrgDataMap[companyCode])
824
- this.confirmRole(newUserRoleDTOs);
825
- }
826
- },
827
- openSelectPositionDialog(row, rowIndex, $table) {
828
- const userSaleOrgPositionDTOs = row.userSaleOrgPositionDTOs || [];
829
- const items = [];
830
- userSaleOrgPositionDTOs.forEach(userSaleOrgPositionDTO => {
831
- const item = {
832
- companyCode: userSaleOrgPositionDTO.companyCode,
833
- companyName: userSaleOrgPositionDTO.companyName,
834
- name: userSaleOrgPositionDTO.positionName,
835
- code: userSaleOrgPositionDTO.code,
836
- id: userSaleOrgPositionDTO.positionId
837
- };
838
- items.push(item);
839
- });
840
-
841
- this.positionDialogDatas = items;
842
- this.saleOrgPositionIndex = rowIndex;
843
- this.showPositionDialog = true;
844
- },
845
- confirmInsertPosition(rows) {
846
- let companyCode = this.companyInfo.companyCode;
847
- const saleOrgPositionIndex = this.saleOrgPositionIndex;
848
- const tableData = this.gridSaleOrgDataMap[companyCode];
849
- if (rows.length > 0) {
850
- const oldPositions = tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs || [];
851
- const map = {};
852
- oldPositions.forEach(function (item) {
853
- map[item.positionId] = item;
854
- });
855
- var oItems = [];
856
- var items = [];
857
- rows.forEach(row => {
858
- const item = {
859
- companyCode: row.companyCode,
860
- companyName: row.companyName,
861
- positionName: row.name,
862
- code: row.code,
863
- positionId: row.id
864
- };
865
-
866
- if (!map[item.positionId]) {
867
- items.push(item);
868
- } else {
869
- oItems.push(map[item.positionId]);
870
- }
871
- });
872
- tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs = oItems.concat(items);
873
- } else {
874
- tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs = [];
875
- }
876
- this.$forceUpdate();
877
- },
878
- getSelectPositionName(row) {
879
- var userSaleOrgPositions = row.userSaleOrgPositionDTOs || [];
880
- var allName = '';
881
- userSaleOrgPositions.forEach(function (pItem, pIndex) {
882
- allName = allName + ',' + pItem.positionName;
883
- });
884
- if (allName) {
885
- allName = allName.substr(1);
886
- }
887
- return allName;
888
- },
889
- getConpanyInfo() {
890
- this.$http({
891
- url: USER_PREFIX + '/company_info/getCurrent',
892
- method: `post`,
893
- isLoading: true,
894
- success: res => {
895
- this.companyInfo = res.objx || {};
896
- let companyCode = this.companyInfo.companyCode;
897
- if (!this.isEdit) {
898
- this.addCurrentCompany();
899
- } else {
900
- this.getCompanyInfoData(() => {
901
- this.getUserRoleData();
902
- this.getSaleOrgData();
903
- setTimeout(() => {
904
- this.user.userCompanyInfoDTOs.forEach(userCompanyInfoDTO => {
905
- this.initSaleOrg(userCompanyInfoDTO.companyCode);
906
- this.initUserRole(userCompanyInfoDTO.companyCode);
907
- })
908
- }, 100)
909
- });
910
- }
911
- }
912
- });
913
- },
914
- isCurrentCompany(companyCode) {
915
- return this.companyInfo.companyCode == companyCode;
916
- },
917
- addCurrentCompany(callback) {
918
- this.confirmInsertCompany([this.companyInfo], callback);
919
- setTimeout(() => {
920
- this.initSaleOrg(this.companyInfo.companyCode);
921
- this.initUserRole(this.companyInfo.companyCode);
922
- setTimeout(() => {
923
- if (this.userType === 2) {
924
- //经销商
925
- if (this.distributorRole) {
926
- this.confirmRole([this.distributorRole]);
927
- }
928
- }
929
- }, 100)
930
- }, 100)
931
-
932
-
933
- },
934
- handleData() {
935
- let saleOrgs = [];
936
- Object.keys(this.gridSaleOrgDataMap).forEach(companyCode => {
937
- saleOrgs.push(...this.gridSaleOrgDataMap[companyCode])
938
- });
939
- let roles = [];
940
- Object.keys(this.gridRoleDataMap).forEach(companyCode => {
941
- roles.push(...this.gridRoleDataMap[companyCode])
942
- });
943
- this.user.userRoleDTOs = roles;
944
- this.user.userSaleOrgDTOs = saleOrgs
945
- },
946
- initDistributorRole() {
947
- if (this.outUserCodes && this.outUserCodes.length == 1) {
948
- return this.$http({
949
- url: USER_PREFIX + '/role/list',
950
- method: 'post',
951
- success: res => {
952
- let roleList = res.objx || [];
953
- let distributorCode = this.outUserCodes[0];
954
- this.distributorRole = roleList.find(item => item.code == distributorCode);
955
- }
956
- });
957
- }
958
- },
959
- async initOutUserRoleCode() {
960
- //初始化外部用户编码
961
- return this.$http({
962
- url: USER_PREFIX + '/system_parameter/getByCode',
963
- method: 'post',
964
- data: {"code": "outUserRoleCode"},
965
- success: res => {
966
- let value = (!res.objx || !res.objx.value) ? "distributor" : res.objx.value;
967
- let codes = value.split(',');
968
- this.outUserCodes = codes;//外部用户编码
969
- this.initRoleDialogParam();//初始化角色弹框的查询参数
970
- }
971
- });
972
- },
973
- initRoleDialogParam() {
974
- //初始化角色弹框的查询参数
975
- if (this.userType == 1) {
976
- //企业用户
977
- this.roleDialogParam = {
978
- queryAll: true,
979
- neCodes: [...this.outUserCodes]
980
- };
981
- } else if (this.userType == 2) {
982
- //外部用户
983
- this.roleDialogParam = {
984
- queryAll: true,
985
- eqCodes: [...this.outUserCodes]
986
- };
987
- }
988
- },
989
- unlock() {
990
- this.$baseConfirm(this.$t1('您确定要解锁吗?')).then(() => {
991
- var url = USER_PREFIX + '/user/unlockLoginAccount';
992
- this.$http({
993
- url: url,
994
- method: `post`,
995
- data: {
996
- id: this.user.id
997
- },
998
- isLoading: true,
999
- success: res => {
1000
- this.$message({
1001
- message: res.content,
1002
- type: 'success',
1003
- duration: 500,
1004
- onClose: t => {
1005
- this.$baseReload();
1006
- }
1007
- });
1008
- }
1009
- });
1010
- });
1011
- },
1012
- confirmCountry(rows) {
1013
- if (rows.length) {
1014
- let row = rows[0];
1015
- this.user.countryName = row.countryName;
1016
- this.user.countryCode = row.countryCode;
1017
- }
1018
- }
1019
- }
1020
- };
1021
- </script>
1
+ <template>
2
+ <div class="detail-wrap">
3
+ <el-form ref="editForm" :model="user">
4
+ <div class="d-header clearfix">
5
+ <div class="fl">
6
+ <i class="el-icon-info" />
7
+ {{ dataId ? $t1("查看用户") : $t1("新增用户") }}
8
+ </div>
9
+ <div class="fr">
10
+ <temp-storage-button
11
+ :option="tempStorageOption"
12
+ v-if="!dataId"
13
+ ></temp-storage-button>
14
+ <base-input-export
15
+ :option="exportOption"
16
+ :parent-target="_self"
17
+ v-if="dataId"
18
+ />
19
+ <el-button
20
+ type="primary"
21
+ plain
22
+ class="button-sty"
23
+ icon="el-icon-unlock"
24
+ @click="unlock"
25
+ v-if="user.locked"
26
+ v-hasPermi="'user:unlock'"
27
+ >{{ $t1("解锁") }}
28
+ </el-button>
29
+ <el-button
30
+ type="primary"
31
+ plain
32
+ class="button-sty"
33
+ @click="$baseReload()"
34
+ icon="el-icon-refresh-right"
35
+ >
36
+ {{ $t1("重置") }}
37
+ </el-button>
38
+ <el-button
39
+ type="primary"
40
+ class="button-sty"
41
+ icon="el-icon-check"
42
+ @click="saveData"
43
+ >{{ $t1("保存") }}
44
+ </el-button>
45
+ </div>
46
+ </div>
47
+ <baseTabs>
48
+ <baseTabPane :label="$t1('基本信息')">
49
+ <template #default>
50
+ <table class="table-detail">
51
+ <tbody>
52
+ <tr>
53
+ <th>
54
+ <em class="f-red">*</em>
55
+ {{ $t1("登录名") }}
56
+ </th>
57
+ <td colspan="3">
58
+ <el-form-item
59
+ prop="loginAccount"
60
+ :rules="[{ required: true, trigger: 'blur' }]"
61
+ >
62
+ <template v-if="dataId">
63
+ <el-input
64
+ size="small"
65
+ v-model="user.loginAccount"
66
+ maxlength="255"
67
+ autocomplete="off"
68
+ lay-verify="required"
69
+ required=""
70
+ :readonly="true"
71
+ />
72
+ </template>
73
+ <template v-else>
74
+ <el-input
75
+ size="small"
76
+ v-model="user.loginAccount"
77
+ maxlength="255"
78
+ autocomplete="off"
79
+ lay-verify="required"
80
+ required=""
81
+ clearable
82
+ />
83
+ </template>
84
+ </el-form-item>
85
+ </td>
86
+
87
+ <th>
88
+ <em class="f-red">*</em>
89
+ {{ $t1("姓名") }}
90
+ </th>
91
+ <td colspan="3">
92
+ <el-form-item
93
+ prop="nickName"
94
+ :rules="[{ required: true, trigger: 'blur' }]"
95
+ >
96
+ <el-input
97
+ size="small"
98
+ v-model="user.nickName"
99
+ maxlength="200"
100
+ lay-verify="required"
101
+ required=""
102
+ clearable
103
+ />
104
+ </el-form-item>
105
+ </td>
106
+ </tr>
107
+ <tr>
108
+ <th>
109
+ <em class="f-red" v-if="!dataId">*</em>
110
+ {{ $t1("密码") }}
111
+ </th>
112
+ <td>
113
+ <el-form-item prop="password" :rules="passRules">
114
+ <el-input
115
+ size="small"
116
+ type="password"
117
+ v-model="user.password"
118
+ show-password
119
+ maxlength="255"
120
+ autocomplete="off"
121
+ auto-complete="new-password"
122
+ clearable
123
+ />
124
+ </el-form-item>
125
+ </td>
126
+ <th>
127
+ <em class="f-red" v-if="!dataId">*</em>
128
+ {{ $t1("确认密码") }}
129
+ </th>
130
+ <td>
131
+ <el-form-item prop="rePassword" :rules="pass2Rules">
132
+ <el-input
133
+ size="small"
134
+ type="password"
135
+ v-model="user.rePassword"
136
+ show-password
137
+ maxlength="255"
138
+ autocomplete="off"
139
+ auto-complete="new-password"
140
+ lay-verify="confirmPass"
141
+ clearable
142
+ />
143
+ </el-form-item>
144
+ </td>
145
+
146
+ <th>{{ $t1("性别") }}</th>
147
+ <td>
148
+ <el-radio-group v-model="user.gender">
149
+ <el-radio :label="1">{{ $t1("") }}</el-radio>
150
+ <el-radio :label="2">{{ $t1("女") }}</el-radio>
151
+ </el-radio-group>
152
+ </td>
153
+ <th>
154
+ {{ $t1("员工编码") }}
155
+ </th>
156
+ <td>
157
+ <el-form-item
158
+ prop="empNo"
159
+ :rules="[{ required: false, trigger: 'blur' }]"
160
+ >
161
+ <el-input
162
+ size="small"
163
+ v-model="user.empNo"
164
+ maxlength="200"
165
+ clearable
166
+ />
167
+ </el-form-item>
168
+ </td>
169
+ </tr>
170
+
171
+ <tr>
172
+ <th>{{ $t1("出生日期") }}</th>
173
+ <td>
174
+ <el-date-picker
175
+ size="small"
176
+ v-model="user.birth"
177
+ type="date"
178
+ :placeholder="$t1('选择日期')"
179
+ value-format="yyyy-MM-dd"
180
+ clearable
181
+ />
182
+ </td>
183
+ <th>{{ $t1("邮编") }}</th>
184
+ <td>
185
+ <el-input
186
+ size="small"
187
+ v-model="user.zipCode"
188
+ maxlength="255"
189
+ clearable
190
+ />
191
+ </td>
192
+ <th>{{ $t1("手机") }}</th>
193
+ <td>
194
+ <el-form-item
195
+ prop="mobile"
196
+ :rules="[{ required: false, trigger: 'blur' }]"
197
+ >
198
+ <el-input
199
+ size="small"
200
+ v-model="user.mobile"
201
+ type="text"
202
+ maxlength="255"
203
+ autocomplete="off"
204
+ lay-verify="required|phone"
205
+ clearable
206
+ />
207
+ </el-form-item>
208
+ </td>
209
+ <th>{{ $t1("设置") }}</th>
210
+ <td>
211
+ <el-checkbox
212
+ :label="$t1('是否启用')"
213
+ v-model="user.enabled"
214
+ ></el-checkbox>
215
+ </td>
216
+ </tr>
217
+
218
+ <tr>
219
+ <th>
220
+ {{ $t1("邮箱") }}
221
+ </th>
222
+ <td>
223
+ <el-form-item
224
+ prop="email"
225
+ :rules="[{ required: false, trigger: 'blur' }]"
226
+ >
227
+ <el-input
228
+ size="small"
229
+ v-model="user.email"
230
+ maxlength="200"
231
+ clearable
232
+ />
233
+ </el-form-item>
234
+ </td>
235
+ <!-- <th v-if="flag!=='2'">
236
+ GUID
237
+ </th>
238
+ <td v-if="flag!=='2'">
239
+ <el-form-item prop="guid" :rules="[{ required: false, trigger: 'blur' }]">
240
+ <el-input size="small" v-model="user.guid" maxlength="200" clearable/>
241
+ </el-form-item>
242
+ </td>-->
243
+ <th>{{ $t1("地址") }}</th>
244
+ <td colspan="3">
245
+ <el-input
246
+ size="small"
247
+ v-model="user.address"
248
+ class="b"
249
+ maxlength="255"
250
+ clearable
251
+ />
252
+ </td>
253
+ </tr>
254
+ <tr>
255
+ <th>
256
+ {{ $t1("国家") }}
257
+ </th>
258
+ <td colspan="3">
259
+ <el-form-item
260
+ prop="countryName"
261
+ :rules="[{ required: false, trigger: 'blur' }]"
262
+ >
263
+ <el-input
264
+ class="search-input"
265
+ v-model="user.countryName"
266
+ clearable
267
+ @clear="
268
+ user.countryName = null;
269
+ user.countryCode = null;
270
+ "
271
+ v-el-readonly
272
+ >
273
+ <i
274
+ slot="suffix"
275
+ class="el-input__icon el-icon-search"
276
+ @click="showCountryDialog = true"
277
+ ></i>
278
+ </el-input>
279
+ </el-form-item>
280
+ </td>
281
+ <th>
282
+ {{ $t1("是否锁定") }}
283
+ </th>
284
+ <td>
285
+ {{ user.locked ? $t1("是") : $t1("否") }}
286
+ </td>
287
+ </tr>
288
+ <tr>
289
+ <th>
290
+ {{ $t1("地区") }}
291
+ </th>
292
+ <td colspan="3">
293
+ <el-form-item
294
+ prop="areaName"
295
+ :rules="[{ required: false, trigger: 'blur' }]"
296
+ >
297
+ <el-input
298
+ class="search-input"
299
+ v-model="user.areaName"
300
+ clearable
301
+ @clear="
302
+ user.areaName = null;
303
+ user.areaId = null;
304
+ "
305
+ v-el-readonly
306
+ >
307
+ <i
308
+ slot="suffix"
309
+ class="el-input__icon el-icon-search"
310
+ @click="showAreaDialog = true"
311
+ ></i>
312
+ </el-input>
313
+ </el-form-item>
314
+ </td>
315
+ </tr>
316
+ <tr v-if="userType == 2">
317
+ <th>
318
+ {{ $t1("签约人") }}
319
+ </th>
320
+ <td>
321
+ <el-form-item
322
+ prop="signatoryName"
323
+ :rules="[{ required: false, trigger: 'blur' }]"
324
+ >
325
+ <el-input
326
+ size="small"
327
+ v-model="user.signatoryName"
328
+ maxlength="200"
329
+ clearable
330
+ />
331
+ </el-form-item>
332
+ </td>
333
+ <th>
334
+ {{ $t1("签约人电话") }}
335
+ </th>
336
+ <td>
337
+ <el-form-item
338
+ prop="signatoryMobile"
339
+ :rules="[{ required: false, trigger: 'blur' }]"
340
+ >
341
+ <el-input
342
+ size="small"
343
+ v-model="user.signatoryMobile"
344
+ maxlength="200"
345
+ clearable
346
+ />
347
+ </el-form-item>
348
+ </td>
349
+ </tr>
350
+ <tr>
351
+ <th>{{ $t1("坐席ID") }}</th>
352
+ <td>
353
+ <el-input
354
+ size="small"
355
+ v-model="user.agentId"
356
+ maxlength="200"
357
+ clearable
358
+ />
359
+ </td>
360
+ <th>{{ $t1("技能组ID") }}</th>
361
+ <td>
362
+ <el-input
363
+ size="small"
364
+ v-model="user.groupId"
365
+ maxlength="200"
366
+ clearable
367
+ />
368
+ </td>
369
+ <th>{{ $t1("手机/sip号") }}</th>
370
+ <td>
371
+ <el-input
372
+ size="small"
373
+ v-model="user.voipAccount"
374
+ maxlength="200"
375
+ clearable
376
+ />
377
+ </td>
378
+ <th>{{ $t1("登录方式") }}</th>
379
+ <td>
380
+ <el-select
381
+ size="small"
382
+ v-model="user.callWay"
383
+ maxlength="200"
384
+ clearable
385
+ >
386
+ <el-option label="sip话机" value="2"></el-option>
387
+ <el-option label="手机" value="3"></el-option>
388
+ </el-select>
389
+ </td>
390
+ </tr>
391
+ <tr>
392
+ <th>{{ $t1("头像") }}</th>
393
+ <td colspan="7">
394
+ <baseUpload
395
+ :limit="1"
396
+ accept="image/png, image/jpeg"
397
+ multi="false"
398
+ :file.sync="user.headPhotoUrl"
399
+ dataType="medium"
400
+ ></baseUpload>
401
+ </td>
402
+ </tr>
403
+ <tr>
404
+ <th>{{ $t1("创建人") }}</th>
405
+ <td>{{ user.createBy }}</td>
406
+ <th>{{ $t1("创建时间") }}</th>
407
+ <td>{{ user.createDate }}</td>
408
+ <th>{{ $t1("更新人") }}</th>
409
+ <td>{{ user.modifyBy }}</td>
410
+ <th>{{ $t1("更新时间") }}</th>
411
+ <td>{{ user.modifyDate }}</td>
412
+ </tr>
413
+ </tbody>
414
+ </table>
415
+ </template>
416
+ </baseTabPane>
417
+ <baseTabPane :label="$t1('组织信息')">
418
+ <template #button>
419
+ <el-button
420
+ class="button-sty"
421
+ @click="addCurrentCompany()"
422
+ icon="el-icon-search"
423
+ v-if="!hasCurrentCompany"
424
+ >
425
+ {{ $t1("新增组织权限") }}
426
+ </el-button>
427
+ </template>
428
+ <template #default>
429
+ <div class="style1">
430
+ <div
431
+ class="d-item"
432
+ v-for="(item, index1) in user.userCompanyInfoDTOs"
433
+ :key="item.companyCode"
434
+ >
435
+ <div class="title">
436
+ <b>{{ item.companyName }}</b>
437
+ <el-button
438
+ class="button-sty"
439
+ icon="el-icon-delete"
440
+ v-if="isCurrentCompany(item.companyCode)"
441
+ @click="deleteCompany(item)"
442
+ >{{ $t1("删除") }}
443
+ </el-button>
444
+ </div>
445
+ <div class="title-form">
446
+ <span>
447
+ <el-form-item
448
+ label="GUID"
449
+ :prop="'userCompanyInfoDTOs.' + index1 + '.guid'"
450
+ :rules="[{ required: false, trigger: 'blur' }]"
451
+ >
452
+ <el-input
453
+ size="small"
454
+ v-model="item.guid"
455
+ maxlength="200"
456
+ clearable
457
+ />
458
+ </el-form-item>
459
+ </span>
460
+ <span>
461
+ <el-form-item
462
+ label="是否默认组织"
463
+ :prop="'userCompanyInfoDTOs.' + index1 + '.defaults'"
464
+ :rules="[{ required: false, trigger: 'blur' }]"
465
+ >
466
+ <el-checkbox
467
+ v-model="item.defaults"
468
+ @change="changeCompanyDefault(item)"
469
+ ></el-checkbox>
470
+ </el-form-item>
471
+ </span>
472
+ </div>
473
+ <div class="m-2">
474
+ <div class="d-item" style="width: 65%">
475
+ <div class="title">
476
+ <b>{{ $t1("机构信息") }}</b>
477
+ <el-button
478
+ class="button-sty"
479
+ icon="el-icon-search"
480
+ @click="showSaleOrgDialog = true"
481
+ v-if="isCurrentCompany(item.companyCode)"
482
+ >{{ $t1("选择机构") }}
483
+ </el-button>
484
+ </div>
485
+ <div class="grid-h">
486
+ <vxe-grid
487
+ :ref="'saleOrgGrid-' + item.companyCode"
488
+ :data="item.saleOrgData"
489
+ v-bind="item.saleOrgGridOption"
490
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
491
+ @custom="$vxeTableUtil.customHandle"
492
+ >
493
+ <template #position="{ row }">
494
+ <el-input
495
+ class="search-input"
496
+ :value="getSelectPositionName(row)"
497
+ clearable
498
+ @clear="clearSaleOrgPosition(row)"
499
+ v-el-readonly
500
+ v-if="companyInfo.companyCode == row.companyCode"
501
+ >
502
+ <i
503
+ slot="suffix"
504
+ class="el-input__icon el-icon-search"
505
+ @click="openSelectPositionDialog(row)"
506
+ ></i>
507
+ </el-input>
508
+ <template v-else>
509
+ {{ getSelectPositionName(row) }}
510
+ </template>
511
+ </template>
512
+ </vxe-grid>
513
+ </div>
514
+ </div>
515
+ <div class="d-item" style="width: 35%">
516
+ <div class="title">
517
+ <b>{{ $t1("角色信息") }}</b>
518
+ <el-button
519
+ class="button-sty"
520
+ icon="el-icon-search"
521
+ @click="showRoleDialog = true"
522
+ v-if="isCurrentCompany(item.companyCode)"
523
+ >{{ $t1("选择角色") }}
524
+ </el-button>
525
+ </div>
526
+ <div class="grid-h">
527
+ <vxe-grid
528
+ :ref="'userRoleGrid-' + item.companyCode"
529
+ :data="item.roleData"
530
+ v-bind="item.roleGridOption"
531
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
532
+ @custom="$vxeTableUtil.customHandle"
533
+ ></vxe-grid>
534
+ </div>
535
+ </div>
536
+ </div>
537
+ </div>
538
+ </div>
539
+ </template>
540
+ </baseTabPane>
541
+ </baseTabs>
542
+ </el-form>
543
+ <roleDialog
544
+ v-if="showRoleDialog"
545
+ :visiable.sync="showRoleDialog"
546
+ @confirm="confirmRole"
547
+ :param="roleDialogParam"
548
+ />
549
+ <saleOrgDialog
550
+ v-if="showSaleOrgDialog"
551
+ :visiable.sync="showSaleOrgDialog"
552
+ @confirm="confirmInsertSaleOrg"
553
+ :param="{ queryAll: true }"
554
+ />
555
+ <positionDialog
556
+ v-if="showPositionDialog"
557
+ :visiable.sync="showPositionDialog"
558
+ :rows="positionDialogDatas"
559
+ @confirm="confirmInsertPosition"
560
+ :param="{ queryAll: true }"
561
+ />
562
+ <countryDialog
563
+ v-if="showCountryDialog"
564
+ :visiable.sync="showCountryDialog"
565
+ @confirm="confirmCountry"
566
+ multi="false"
567
+ />
568
+ <areaDialog
569
+ v-if="showAreaDialog"
570
+ :visiable.sync="showAreaDialog"
571
+ @confirm="confirmArea"
572
+ multi="false"
573
+ />
574
+ </div>
575
+ </template>
576
+
577
+ <script>
578
+ import tempStorageButton from "@base/components/tempStorage/index.vue";
579
+
580
+ export default {
581
+ name: "UserEdit",
582
+ components: {
583
+ roleDialog: () => import("../../../views/user/role/dialog.vue"),
584
+ saleOrgDialog: () => import("../../../views/user/sale_org/dialog.vue"),
585
+ positionDialog: () => import("../../../views/user/position/dialog.vue"),
586
+ countryDialog: () => import("../../../views/user/country/dialog.vue"),
587
+ areaDialog: () => import("../../../views/user/area/dialog.vue"),
588
+ tempStorageButton,
589
+ },
590
+ props: ["_dataId", "userType", "flag"],
591
+ data() {
592
+ var validatePass = (rule, value, callback) => {
593
+ const isPassRequired = !this.dataId;
594
+ if (isPassRequired && (value == "" || value == undefined)) {
595
+ callback(new Error(this.$t1("密码不能为空")));
596
+ } else {
597
+ callback();
598
+ }
599
+ this.$refs.editForm.validateField("rePassword");
600
+ };
601
+ var validatePass2 = (rule, value, callback) => {
602
+ const isPassRequired = !this.dataId;
603
+ const rePassword = value != undefined ? value : "";
604
+ const password =
605
+ this.user.password != undefined ? this.user.password : "";
606
+
607
+ if (isPassRequired && rePassword == "") {
608
+ callback(new Error(this.$t1("确认密码不能为空")));
609
+ } else if (rePassword != password) {
610
+ callback(new Error(this.$t1("两次输入密码不一致!")));
611
+ } else {
612
+ callback();
613
+ }
614
+ };
615
+
616
+ return {
617
+ dataId: "",
618
+ isEdit: false,
619
+ user: {
620
+ userCompanyInfoDTOs: [],
621
+ userSaleOrgDTOs: [],
622
+ userRoleDTOs: [],
623
+ gender: null,
624
+ enabled: true,
625
+ userType: null,
626
+ countryName: null,
627
+ countryCode: null,
628
+ areaName: null,
629
+ areaId: null,
630
+ },
631
+ showRoleDialog: false,
632
+ showSaleOrgDialog: false,
633
+ showPositionDialog: false,
634
+ positionDialogDatas: [],
635
+ positionDialogRow: null,
636
+ passRules: [
637
+ { validator: validatePass, trigger: "blur", required: false },
638
+ ],
639
+ pass2Rules: [
640
+ { validator: validatePass2, trigger: "blur", required: false },
641
+ ],
642
+ exportOption: {
643
+ prefix: USER_PREFIX,
644
+ title: this.$t1("用户"),
645
+ codes: ["USEREXCEL", "USERPDF", "USERPRINT", "USERHIPRINT"],
646
+ param: () => {
647
+ return [{ id: this.dataId }];
648
+ },
649
+ },
650
+ companyInfo: {},
651
+ distributorRole: null,
652
+ unassignedTipShown: false,
653
+ outUserCodes: [],
654
+ roleDialogParam: { queryAll: true },
655
+ tempStorageOption: {
656
+ storageType: "user",
657
+ data: () => {
658
+ this.handleData();
659
+ return this.getReqFormData();
660
+ },
661
+ chooseConfirm: (tempStorageData) => {
662
+ this.user = tempStorageData;
663
+ // 暂存时 getReqFormData 把表格数据和表格配置都置空了,这里必须整体还原,
664
+ // 否则机构信息丢失、表格无列,且保存时 handleData 展开 null 会直接报错
665
+ this.restoreCompanyGrids();
666
+ },
667
+ saveConfirm: () => {},
668
+ },
669
+ showCountryDialog: false,
670
+ showAreaDialog: false,
671
+ };
672
+ },
673
+ computed: {
674
+ hasCurrentCompany() {
675
+ return (
676
+ this.user.userCompanyInfoDTOs.find(
677
+ (item) => item.companyCode == this.companyInfo.companyCode
678
+ ) != null
679
+ );
680
+ },
681
+ },
682
+ created() {
683
+ if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
684
+ },
685
+ async mounted() {
686
+ // this.getEainsGroupDTO();
687
+ await this.initOutUserRoleCode();
688
+ await this.initDistributorRole();
689
+ this.getData();
690
+ this.getConpanyInfo();
691
+ },
692
+ methods: {
693
+ getData() {
694
+ if (this.dataId && !isNaN(this.dataId)) {
695
+ this.isEdit = true;
696
+ this.$commonHttp({
697
+ url: USER_PREFIX + `/user/get`,
698
+ method: `post`,
699
+ data: {
700
+ id: this.dataId,
701
+ },
702
+ isLoading: true,
703
+ modalStrictly: true,
704
+ success: (res) => {
705
+ let user = res.objx || {};
706
+ user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs;
707
+ user.userSaleOrgDTOs = this.user.userSaleOrgDTOs;
708
+ user.userRoleDTOs = this.user.userRoleDTOs;
709
+ this.user = user;
710
+ this.user.password = "";
711
+ },
712
+ });
713
+ } else {
714
+ this.user.gender = 1;
715
+ this.isEdit = false;
716
+ }
717
+ },
718
+ getReqFormData() {
719
+ let userCompanyInfoDTOs = this.user.userCompanyInfoDTOs.map((item) => {
720
+ return {
721
+ ...item,
722
+ saleOrgGridOption: null,
723
+ roleGridOption: null,
724
+ saleOrgData: null,
725
+ roleData: null,
726
+ };
727
+ });
728
+ let formData = {
729
+ ...this.user,
730
+ userCompanyInfoDTOs,
731
+ };
732
+ //编辑态不修改密码时不下发密码字段,避免被空值覆盖
733
+ if (this.isEdit && !formData.password) {
734
+ delete formData.password;
735
+ delete formData.rePassword;
736
+ }
737
+ return formData;
738
+ },
739
+ saveData() {
740
+ let companyCode = this.companyInfo.companyCode;
741
+ this.handleData();
742
+ if (this.userType == 2) {
743
+ //外部用户
744
+ let currentUserCompanyInfo = this.user.userCompanyInfoDTOs.find(
745
+ (item) => item.companyCode == companyCode
746
+ );
747
+ if (currentUserCompanyInfo) {
748
+ let rows = this.user.userRoleDTOs.filter(
749
+ (item) => item.companyCode == companyCode
750
+ );
751
+ if (!rows.length) {
752
+ this.$baseAlert(this.$t1("请维护角色"));
753
+ return;
754
+ }
755
+ }
756
+ }
757
+ this.$refs.editForm.$baseValidate((valid) => {
758
+ if (valid) {
759
+ this.$baseConfirm(this.$t1("您确定要保存吗?")).then(() => {
760
+ var url =
761
+ USER_PREFIX + (this.isEdit ? "/user/update" : "/user/save");
762
+ let formData = this.getReqFormData();
763
+ this.$http({
764
+ url: url,
765
+ method: `post`,
766
+ data: formData,
767
+ isLoading: true,
768
+ success: (res) => {
769
+ this.$message({
770
+ message: res.content,
771
+ type: "success",
772
+ duration: 500,
773
+ onClose: (t) => {
774
+ if (this.isEdit) {
775
+ this.$baseReload();
776
+ } else {
777
+ this.$baseReload({
778
+ updateParam: {
779
+ _dataId: res.objx,
780
+ },
781
+ });
782
+ }
783
+ },
784
+ });
785
+ },
786
+ });
787
+ });
788
+ }
789
+ });
790
+ },
791
+ getSaleOrgData() {
792
+ if (this.dataId) {
793
+ this.$http({
794
+ url: USER_PREFIX + "/user/getUserSaleOrg",
795
+ method: `post`,
796
+ data: { id: this.dataId },
797
+ isLoading: true,
798
+ modalStrictly: true,
799
+ success: (res) => {
800
+ this.user.userSaleOrgDTOs = res.objx || [];
801
+ this.initCompanyGrids(this.syncCompanyGrids());
802
+ },
803
+ });
804
+ }
805
+ },
806
+ getUserRoleData() {
807
+ if (this.dataId) {
808
+ this.$http({
809
+ url: USER_PREFIX + "/user/getUserRole",
810
+ method: `post`,
811
+ data: { id: this.dataId },
812
+ isLoading: true,
813
+ modalStrictly: true,
814
+ success: (res) => {
815
+ this.user.userRoleDTOs = res.objx || [];
816
+ this.initCompanyGrids(this.syncCompanyGrids());
817
+ },
818
+ });
819
+ }
820
+ },
821
+ deleteSaleOrgItem(row) {
822
+ const companyDTO = this.getCompanyDTO(row.companyCode);
823
+ const rows = (companyDTO && companyDTO.saleOrgData) || [];
824
+ // 用行对象定位,rowIndex 是渲染序,排序/过滤后会删错行
825
+ const index = rows.indexOf(row);
826
+ if (index > -1) {
827
+ rows.splice(index, 1);
828
+ }
829
+ },
830
+ getCompanyInfoData(callback) {
831
+ if (this.dataId) {
832
+ this.$http({
833
+ url: USER_PREFIX + "/user/getUserCompanyInfo",
834
+ method: `post`,
835
+ data: { id: this.dataId },
836
+ isLoading: true,
837
+ modalStrictly: true,
838
+ success: (res) => {
839
+ let rows = res.objx || [];
840
+ rows.forEach((row) => {
841
+ Object.assign(row, {
842
+ saleOrgGridOption: {},
843
+ roleGridOption: {},
844
+ saleOrgData: [],
845
+ roleData: [],
846
+ });
847
+ });
848
+
849
+ this.user.userCompanyInfoDTOs = rows;
850
+ callback && callback();
851
+ },
852
+ });
853
+ }
854
+ },
855
+ initSaleOrg(companyCode) {
856
+ let companyDTO = this.getCompanyDTO(companyCode);
857
+ if (!companyDTO) {
858
+ return;
859
+ }
860
+ if (Object.keys(companyDTO.saleOrgGridOption || {}).length) {
861
+ return;
862
+ }
863
+ let tableRef = "saleOrgGrid-" + companyCode;
864
+ const tableOption = {
865
+ vue: this,
866
+ tableRef: tableRef,
867
+ tableName: "editUser-saleOrgGrid-" + companyCode,
868
+ columns: [
869
+ { type: "checkbox", fixed: "left", width: 48, resizable: false },
870
+ { title: this.$t1("机构名称"), field: "saleOrgName", width: 200 },
871
+ { title: this.$t1("机构编码"), field: "sn", width: 200 },
872
+ { title: this.$t1("上级机构"), field: "treePathName", width: 200 },
873
+ {
874
+ title: this.$t1("岗位"),
875
+ field: "position",
876
+ width: 150,
877
+ slots: {
878
+ default: "position",
879
+ },
880
+ },
881
+ {
882
+ title: this.$t1("是否默认"),
883
+ field: "defaults",
884
+ width: 120,
885
+ slots: {
886
+ default: ({ row }) => {
887
+ let disabled = this.companyInfo.companyCode != row.companyCode;
888
+ return [
889
+ <el-checkbox
890
+ value={!!row.defaults}
891
+ disabled={disabled}
892
+ onchange={(checked) => {
893
+ this.changeSaleOrgDefault(row, checked);
894
+ }}
895
+ />,
896
+ ];
897
+ },
898
+ },
899
+ },
900
+ {
901
+ width: 47,
902
+ fixed: "right",
903
+ title: "",
904
+ sortable: false,
905
+ slots: {
906
+ default: ({ row }) => {
907
+ if (this.companyInfo.companyCode == row.companyCode) {
908
+ return [
909
+ <a
910
+ href="javascript:void(0);"
911
+ class="a-link"
912
+ onclick={() => {
913
+ this.deleteSaleOrgItem(row);
914
+ }}
915
+ >
916
+ <el-tooltip
917
+ enterable={false}
918
+ effect="dark"
919
+ content={this.$t1("删除")}
920
+ placement="top"
921
+ popper-class="tooltip-skin"
922
+ >
923
+ <i class="el-icon-delete" />
924
+ </el-tooltip>
925
+ </a>,
926
+ ];
927
+ }
928
+ },
929
+ },
930
+ },
931
+ ],
932
+ };
933
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
934
+ companyDTO.saleOrgGridOption = opts;
935
+ });
936
+ },
937
+ initUserRole(companyCode) {
938
+ let companyDTO = this.getCompanyDTO(companyCode);
939
+ if (!companyDTO) {
940
+ return;
941
+ }
942
+ if (Object.keys(companyDTO.roleGridOption || {}).length) {
943
+ return;
944
+ }
945
+ const tableOption = {
946
+ vue: this,
947
+ tableRef: "userRoleGrid-" + companyCode,
948
+ tableName: "editUser-userRoleGrid-" + companyCode,
949
+ columns: [
950
+ { type: "checkbox", fixed: "left", width: 48, resizable: false },
951
+ {
952
+ title: this.$t1("角色名称"),
953
+ field: "name",
954
+ width: 200,
955
+ slots: {
956
+ default: ({ row }) => row.roleName || row.name,
957
+ },
958
+ },
959
+ {
960
+ width: 47,
961
+ fixed: "right",
962
+ title: "",
963
+ sortable: false,
964
+ slots: {
965
+ default: ({ row }) => {
966
+ if (this.companyInfo.companyCode == row.companyCode) {
967
+ return [
968
+ <a
969
+ href="javascript:void(0);"
970
+ class="a-link"
971
+ onclick={() => {
972
+ this.deleteRoleItem(row);
973
+ }}
974
+ >
975
+ <el-tooltip
976
+ enterable={false}
977
+ effect="dark"
978
+ content={this.$t1("删除")}
979
+ placement="top"
980
+ popper-class="tooltip-skin"
981
+ >
982
+ <i class="el-icon-delete" />
983
+ </el-tooltip>
984
+ </a>,
985
+ ];
986
+ }
987
+ },
988
+ },
989
+ },
990
+ ],
991
+ };
992
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
993
+ companyDTO.roleGridOption = opts;
994
+ });
995
+ },
996
+ confirmRole(rows) {
997
+ if (rows.length > 0) {
998
+ let companyCode = this.companyInfo.companyCode;
999
+ let companyDTO = this.getCompanyDTO(companyCode);
1000
+ if (!companyDTO) {
1001
+ return;
1002
+ }
1003
+ let outUserCodes = this.outUserCodes;
1004
+ // 由机构带出的角色没有 code,不参与内外部过滤,否则会被整批丢弃
1005
+ if (this.userType == 1) {
1006
+ //组织用户
1007
+ rows = rows.filter(
1008
+ (row) => !row.code || !outUserCodes.includes(row.code)
1009
+ );
1010
+ } else if (this.userType == 2) {
1011
+ //外部用户
1012
+ rows = rows.filter(
1013
+ (row) => !row.code || outUserCodes.includes(row.code)
1014
+ );
1015
+ }
1016
+
1017
+ const tableData = companyDTO.roleData || [];
1018
+ const map = {};
1019
+ tableData.forEach(function (item) {
1020
+ map[item.roleId] = 1;
1021
+ });
1022
+ var items = [];
1023
+ rows.forEach((row) => {
1024
+ const item = {
1025
+ roleId: row.id,
1026
+ roleName: row.name,
1027
+ companyCode: companyCode,
1028
+ companyName: row.companyName,
1029
+ };
1030
+ if (!map[item.roleId]) {
1031
+ items.push(item);
1032
+ }
1033
+ });
1034
+
1035
+ tableData.push(...items);
1036
+ companyDTO.roleData = tableData;
1037
+ }
1038
+ },
1039
+ deleteRoleItem(row) {
1040
+ const companyDTO = this.getCompanyDTO(row.companyCode);
1041
+ const rows = (companyDTO && companyDTO.roleData) || [];
1042
+ const index = rows.indexOf(row);
1043
+ if (index > -1) {
1044
+ rows.splice(index, 1);
1045
+ }
1046
+ },
1047
+ confirmInsertCompany(rows, callback) {
1048
+ const items = [];
1049
+ if (rows.length > 0) {
1050
+ const tableData = this.user.userCompanyInfoDTOs;
1051
+ const map = {};
1052
+ tableData.forEach(function (item) {
1053
+ map[item.companyCode] = 1;
1054
+ });
1055
+ rows.forEach((row) => {
1056
+ const item = {
1057
+ companyCode: row.companyCode,
1058
+ companyName: row.companyName,
1059
+ guid: null,
1060
+ defaults: false,
1061
+ saleOrgGridOption: {},
1062
+ roleGridOption: {},
1063
+ saleOrgData: [],
1064
+ roleData: [],
1065
+ };
1066
+ if (!map[item.companyCode]) {
1067
+ items.push(item);
1068
+ }
1069
+ });
1070
+ this.user.userCompanyInfoDTOs.splice(0, 0, ...items);
1071
+ if (this.user.userCompanyInfoDTOs.length == 1) {
1072
+ this.user.userCompanyInfoDTOs[0].defaults = true;
1073
+ }
1074
+ // 该企业可能已经加载过角色/机构(组织数据缺失时尤其如此),需要回填,
1075
+ // 否则新建的卡片是两张空表,保存时 handleData 会把已有数据清掉
1076
+ items.forEach((item) => this.fillCompanyGrids(item));
1077
+ }
1078
+ callback && callback();
1079
+ return items;
1080
+ },
1081
+ deleteCompany(row) {
1082
+ let companyCode = row.companyCode;
1083
+ let index = this.user.userCompanyInfoDTOs.indexOf(row);
1084
+ if (index > -1) {
1085
+ this.user.userCompanyInfoDTOs.splice(index, 1);
1086
+ }
1087
+ row.roleData = [];
1088
+ row.saleOrgData = [];
1089
+ this.user.userSaleOrgDTOs = (this.user.userSaleOrgDTOs || []).filter(
1090
+ (item) => item.companyCode != companyCode
1091
+ );
1092
+ this.user.userRoleDTOs = (this.user.userRoleDTOs || []).filter(
1093
+ (item) => item.companyCode != companyCode
1094
+ );
1095
+ },
1096
+ confirmInsertSaleOrg(rows) {
1097
+ if (rows.length > 0) {
1098
+ let companyCode = this.companyInfo.companyCode;
1099
+ let companyDTO = this.getCompanyDTO(companyCode);
1100
+ if (!companyDTO) {
1101
+ return;
1102
+ }
1103
+ const tableData = companyDTO.saleOrgData || [];
1104
+ const map = {};
1105
+ tableData.forEach(function (item) {
1106
+ map[item.saleOrgId] = 1;
1107
+ });
1108
+
1109
+ let roleMap = {};
1110
+ let newUserRoleDTOs = [];
1111
+ var items = [];
1112
+
1113
+ rows.forEach((row) => {
1114
+ const item = {
1115
+ companyCode: companyCode,
1116
+ companyName: row.companyName,
1117
+ defaults: false,
1118
+ saleOrgName: row.name,
1119
+ treePathName: row.treePathName,
1120
+ userSaleOrgPositionDTOs: [],
1121
+ saleOrgId: row.id,
1122
+ sn: row.sn,
1123
+ };
1124
+
1125
+ if (!map[item.saleOrgId]) {
1126
+ items.push(item);
1127
+ if (row.roleId && !roleMap[row.roleId]) {
1128
+ const roleItem = {
1129
+ id: row.roleId,
1130
+ name: row.roleName,
1131
+ companyCode: companyCode,
1132
+ companyName: row.companyName,
1133
+ };
1134
+ roleMap[row.roleId] = true;
1135
+ newUserRoleDTOs.push(roleItem);
1136
+ }
1137
+ }
1138
+ });
1139
+ if (items.length > 0 && tableData.length == 0) {
1140
+ items[0].defaults = true;
1141
+ }
1142
+
1143
+ tableData.push(...items);
1144
+ companyDTO.saleOrgData = tableData;
1145
+ this.confirmRole(newUserRoleDTOs);
1146
+ }
1147
+ },
1148
+ openSelectPositionDialog(row) {
1149
+ const userSaleOrgPositionDTOs = row.userSaleOrgPositionDTOs || [];
1150
+ const items = [];
1151
+ userSaleOrgPositionDTOs.forEach((userSaleOrgPositionDTO) => {
1152
+ const item = {
1153
+ companyCode: userSaleOrgPositionDTO.companyCode,
1154
+ companyName: userSaleOrgPositionDTO.companyName,
1155
+ name: userSaleOrgPositionDTO.positionName,
1156
+ code: userSaleOrgPositionDTO.code,
1157
+ id: userSaleOrgPositionDTO.positionId,
1158
+ };
1159
+ items.push(item);
1160
+ });
1161
+
1162
+ this.positionDialogDatas = items;
1163
+ // 保存行对象而不是 rowIndex,避免排序/过滤后岗位写到别的机构上
1164
+ this.positionDialogRow = row;
1165
+ this.showPositionDialog = true;
1166
+ },
1167
+ confirmInsertPosition(rows) {
1168
+ const saleOrgRow = this.positionDialogRow;
1169
+ if (!saleOrgRow) {
1170
+ return;
1171
+ }
1172
+ if (rows.length > 0) {
1173
+ const oldPositions = saleOrgRow.userSaleOrgPositionDTOs || [];
1174
+ const map = {};
1175
+ oldPositions.forEach(function (item) {
1176
+ map[item.positionId] = item;
1177
+ });
1178
+ var oItems = [];
1179
+ var items = [];
1180
+ rows.forEach((row) => {
1181
+ const item = {
1182
+ companyCode: row.companyCode,
1183
+ companyName: row.companyName,
1184
+ positionName: row.name,
1185
+ code: row.code,
1186
+ positionId: row.id,
1187
+ };
1188
+
1189
+ if (!map[item.positionId]) {
1190
+ items.push(item);
1191
+ } else {
1192
+ oItems.push(map[item.positionId]);
1193
+ }
1194
+ });
1195
+ this.$set(saleOrgRow, "userSaleOrgPositionDTOs", oItems.concat(items));
1196
+ } else {
1197
+ this.$set(saleOrgRow, "userSaleOrgPositionDTOs", []);
1198
+ }
1199
+ this.$forceUpdate();
1200
+ },
1201
+ getSelectPositionName(row) {
1202
+ const userSaleOrgPositions = row.userSaleOrgPositionDTOs || [];
1203
+ return userSaleOrgPositions.map((item) => item.positionName).join(",");
1204
+ },
1205
+ getConpanyInfo() {
1206
+ this.$http({
1207
+ url: USER_PREFIX + "/company_info/getCurrent",
1208
+ method: `post`,
1209
+ isLoading: true,
1210
+ success: (res) => {
1211
+ this.companyInfo = res.objx || {};
1212
+ if (!this.isEdit) {
1213
+ this.addCurrentCompany();
1214
+ } else {
1215
+ this.getCompanyInfoData(() => {
1216
+ this.getUserRoleData();
1217
+ this.getSaleOrgData();
1218
+ this.initCompanyGrids(this.user.userCompanyInfoDTOs);
1219
+ });
1220
+ }
1221
+ },
1222
+ });
1223
+ },
1224
+ isCurrentCompany(companyCode) {
1225
+ return this.companyInfo.companyCode == companyCode;
1226
+ },
1227
+ addCurrentCompany(callback) {
1228
+ const items = this.confirmInsertCompany([this.companyInfo], callback);
1229
+ if (this.userType == 2 && this.distributorRole) {
1230
+ //经销商,默认带出经销商角色
1231
+ this.confirmRole([this.distributorRole]);
1232
+ }
1233
+ this.initCompanyGrids(items);
1234
+ },
1235
+ handleData() {
1236
+ let saleOrgs = [];
1237
+ let roles = [];
1238
+ this.user.userCompanyInfoDTOs.forEach((companyDTO) => {
1239
+ saleOrgs.push(...(companyDTO.saleOrgData || []));
1240
+ roles.push(...(companyDTO.roleData || []));
1241
+ });
1242
+
1243
+ this.user.userRoleDTOs = roles;
1244
+ this.user.userSaleOrgDTOs = saleOrgs;
1245
+ },
1246
+ initDistributorRole() {
1247
+ if (this.outUserCodes && this.outUserCodes.length == 1) {
1248
+ return this.$http({
1249
+ url: USER_PREFIX + "/role/list",
1250
+ method: "post",
1251
+ success: (res) => {
1252
+ let roleList = res.objx || [];
1253
+ let distributorCode = this.outUserCodes[0];
1254
+ this.distributorRole = roleList.find(
1255
+ (item) => item.code == distributorCode
1256
+ );
1257
+ },
1258
+ });
1259
+ }
1260
+ },
1261
+ async initOutUserRoleCode() {
1262
+ //初始化外部用户编码
1263
+ return this.$http({
1264
+ url: USER_PREFIX + "/system_parameter/getByCode",
1265
+ method: "post",
1266
+ data: { code: "outUserRoleCode" },
1267
+ success: (res) => {
1268
+ let value =
1269
+ !res.objx || !res.objx.value ? "distributor" : res.objx.value;
1270
+ let codes = value.split(",");
1271
+ this.outUserCodes = codes; //外部用户编码
1272
+ this.initRoleDialogParam(); //初始化角色弹框的查询参数
1273
+ },
1274
+ });
1275
+ },
1276
+ initRoleDialogParam() {
1277
+ //初始化角色弹框的查询参数
1278
+ if (this.userType == 1) {
1279
+ //组织用户
1280
+ this.roleDialogParam = {
1281
+ queryAll: true,
1282
+ neCodes: [...this.outUserCodes],
1283
+ };
1284
+ } else if (this.userType == 2) {
1285
+ //外部用户
1286
+ this.roleDialogParam = {
1287
+ queryAll: true,
1288
+ eqCodes: [...this.outUserCodes],
1289
+ };
1290
+ }
1291
+ },
1292
+ unlock() {
1293
+ this.$baseConfirm(this.$t1("您确定要解锁吗?")).then(() => {
1294
+ var url = USER_PREFIX + "/user/unlockLoginAccount";
1295
+ this.$http({
1296
+ url: url,
1297
+ method: `post`,
1298
+ data: {
1299
+ id: this.user.id,
1300
+ },
1301
+ isLoading: true,
1302
+ success: (res) => {
1303
+ this.$message({
1304
+ message: res.content,
1305
+ type: "success",
1306
+ duration: 500,
1307
+ onClose: (t) => {
1308
+ this.$baseReload();
1309
+ },
1310
+ });
1311
+ },
1312
+ });
1313
+ });
1314
+ },
1315
+ confirmCountry(rows) {
1316
+ if (rows.length) {
1317
+ let row = rows[0];
1318
+ this.user.countryName = row.countryName;
1319
+ this.user.countryCode = row.countryCode;
1320
+ }
1321
+ },
1322
+ changeCompanyDefault(item) {
1323
+ let companyCode = item.companyCode;
1324
+ if (item.defaults) {
1325
+ this.user.userCompanyInfoDTOs.forEach((row) => {
1326
+ row.defaults = row.companyCode == companyCode;
1327
+ });
1328
+ } else {
1329
+ // 至少保留一个默认组织,取消唯一的默认项时回填
1330
+ let hasDefault = this.user.userCompanyInfoDTOs.some(
1331
+ (row) => row.defaults
1332
+ );
1333
+ if (!hasDefault) {
1334
+ item.defaults = true;
1335
+ }
1336
+ }
1337
+ },
1338
+ changeSaleOrgDefault(row, checked) {
1339
+ const companyDTO = this.getCompanyDTO(row.companyCode);
1340
+ const rows = (companyDTO && companyDTO.saleOrgData) || [];
1341
+ rows.forEach((item) => {
1342
+ if (item === row) {
1343
+ this.$set(item, "defaults", !!checked);
1344
+ } else if (checked) {
1345
+ this.$set(item, "defaults", false);
1346
+ }
1347
+ });
1348
+ },
1349
+ clearSaleOrgPosition(row) {
1350
+ this.$set(row, "userSaleOrgPositionDTOs", []);
1351
+ this.$forceUpdate();
1352
+ },
1353
+ normalizeSaleOrgRow(row) {
1354
+ //后端返回的机构行可能缺字段,先补齐保证响应式
1355
+ if (row.defaults === undefined) {
1356
+ this.$set(row, "defaults", false);
1357
+ }
1358
+ if (!row.userSaleOrgPositionDTOs) {
1359
+ this.$set(row, "userSaleOrgPositionDTOs", []);
1360
+ }
1361
+ return row;
1362
+ },
1363
+ // userRoleDTOs / userSaleOrgDTOs 是唯一事实源,这里统一分发到各组织卡片。
1364
+ // handleData 保存时只认组织卡片里的数据,所以任何没有归属组织的行都必须
1365
+ // 补出一张组织卡片,否则用户点一次保存就被静默删掉了。
1366
+ // 返回本次补建的组织卡片,交给调用方决定何时初始化表格。
1367
+ syncCompanyGrids() {
1368
+ this.dropUnassignedRows();
1369
+ const items = this.getLackCompanyCodes().map((companyCode) => {
1370
+ return {
1371
+ companyCode: companyCode,
1372
+ companyName: this.getRowCompanyName(companyCode),
1373
+ guid: null,
1374
+ defaults: false,
1375
+ saleOrgGridOption: {},
1376
+ roleGridOption: {},
1377
+ saleOrgData: [],
1378
+ roleData: [],
1379
+ };
1380
+ });
1381
+ if (items.length) {
1382
+ this.user.userCompanyInfoDTOs.push(...items);
1383
+ }
1384
+ this.user.userCompanyInfoDTOs.forEach((companyDTO) =>
1385
+ this.fillCompanyGrids(companyDTO)
1386
+ );
1387
+ return items;
1388
+ },
1389
+ fillCompanyGrids(companyDTO) {
1390
+ const companyCode = companyDTO.companyCode;
1391
+ const saleOrgData = (this.user.userSaleOrgDTOs || []).filter(
1392
+ (row) => row.companyCode == companyCode
1393
+ );
1394
+ saleOrgData.forEach((row) => this.normalizeSaleOrgRow(row));
1395
+ this.$set(companyDTO, "saleOrgData", saleOrgData);
1396
+ this.$set(
1397
+ companyDTO,
1398
+ "roleData",
1399
+ (this.user.userRoleDTOs || []).filter(
1400
+ (row) => row.companyCode == companyCode
1401
+ )
1402
+ );
1403
+ },
1404
+ getLackCompanyCodes() {
1405
+ //有角色/机构数据、但没有对应组织的企业编码
1406
+ const rows = (this.user.userSaleOrgDTOs || []).concat(
1407
+ this.user.userRoleDTOs || []
1408
+ );
1409
+ const codes = [];
1410
+ rows.forEach((row) => {
1411
+ const companyCode = row.companyCode;
1412
+ if (codes.includes(companyCode) || this.getCompanyDTO(companyCode)) {
1413
+ return;
1414
+ }
1415
+ codes.push(companyCode);
1416
+ });
1417
+ return codes;
1418
+ },
1419
+ getRowCompanyName(companyCode) {
1420
+ const rows = (this.user.userSaleOrgDTOs || []).concat(
1421
+ this.user.userRoleDTOs || []
1422
+ );
1423
+ const row = rows.find(
1424
+ (item) => item.companyCode == companyCode && item.companyName
1425
+ );
1426
+ return row ? row.companyName : companyCode;
1427
+ },
1428
+ dropUnassignedRows() {
1429
+ //companyCode 为空的行补不出有效组织,保留会往提交体里塞一条空组织关系
1430
+ const isUnassigned = (row) => {
1431
+ const code = row.companyCode;
1432
+ return code === null || code === undefined || code === "";
1433
+ };
1434
+ const roles = this.user.userRoleDTOs || [];
1435
+ const saleOrgs = this.user.userSaleOrgDTOs || [];
1436
+ const badRows = roles.filter(isUnassigned).concat(
1437
+ saleOrgs.filter(isUnassigned)
1438
+ );
1439
+ if (!badRows.length) {
1440
+ return;
1441
+ }
1442
+ this.user.userRoleDTOs = roles.filter((row) => !isUnassigned(row));
1443
+ this.user.userSaleOrgDTOs = saleOrgs.filter((row) => !isUnassigned(row));
1444
+ console.warn("[UserEdit] 忽略未归属组织的角色/机构数据", badRows);
1445
+ if (this.unassignedTipShown) {
1446
+ return;
1447
+ }
1448
+ this.unassignedTipShown = true;
1449
+ this.$baseAlert(this.$t1("存在未归属组织的角色/机构数据,已忽略"));
1450
+ },
1451
+ initCompanyGrids(companyDTOs) {
1452
+ if (!companyDTOs || !companyDTOs.length) {
1453
+ return;
1454
+ }
1455
+ this.$nextTick(() => {
1456
+ companyDTOs.forEach((companyDTO) => {
1457
+ this.initSaleOrg(companyDTO.companyCode);
1458
+ this.initUserRole(companyDTO.companyCode);
1459
+ });
1460
+ });
1461
+ },
1462
+ restoreCompanyGrids() {
1463
+ //暂存恢复:表格配置被置空过,需要连同表格一起重建
1464
+ (this.user.userCompanyInfoDTOs || []).forEach((companyDTO) => {
1465
+ this.$set(companyDTO, "saleOrgGridOption", {});
1466
+ this.$set(companyDTO, "roleGridOption", {});
1467
+ });
1468
+ this.syncCompanyGrids();
1469
+ this.initCompanyGrids(this.user.userCompanyInfoDTOs);
1470
+ },
1471
+ getCompanyDTO(companyCode) {
1472
+ return this.user.userCompanyInfoDTOs.find(
1473
+ (item) => item.companyCode == companyCode
1474
+ );
1475
+ },
1476
+ confirmArea(rows) {
1477
+ if (rows.length) {
1478
+ let row = rows[0];
1479
+ this.user.areaId = row.id;
1480
+ this.user.areaName = row.fullName;
1481
+ }
1482
+ },
1483
+ },
1484
+ };
1485
+ </script>