cloud-web-corejs 1.0.54-dev.63 → 1.0.54-dev.632

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 (501) hide show
  1. package/package.json +22 -14
  2. package/src/App.vue +30 -34
  3. package/src/api/user.js +64 -40
  4. package/src/components/Qrcode/fileParse.vue +0 -1
  5. package/src/components/Tinymce/index.vue +112 -71
  6. package/src/components/VabUpload/image-viewer.vue +2 -2
  7. package/src/components/VabUpload/index.js +49 -1
  8. package/src/components/VabUpload/mixins.js +1822 -2
  9. package/src/components/VabUpload/propertiesDialog.vue +1 -1
  10. package/src/components/VabUpload/view.vue +209 -120
  11. package/src/components/advancedSearchDialog/mixins.js +28 -1
  12. package/src/components/base-textarea/index.vue +104 -0
  13. package/src/components/baseAlert/index.js +44 -1
  14. package/src/components/baseAlert/index.vue +24 -20
  15. package/src/components/baseAlert/mixins.js +61 -1
  16. package/src/components/baseAttachment/index.vue +49 -40
  17. package/src/components/baseAttachment/install.js +21 -5
  18. package/src/components/baseAttachment/mixins.js +310 -1
  19. package/src/components/baseInputBatch/mixins.js +58 -1
  20. package/src/components/baseInputExport/index.vue +21 -14
  21. package/src/components/baseInputExport/mixins.js +391 -1
  22. package/src/components/baseTabs/index.vue +16 -8
  23. package/src/components/baseTabs/mixins.js +166 -1
  24. package/src/components/cnPrint/index.js +44 -1
  25. package/src/components/cnPrint/mixins.js +189 -1
  26. package/src/components/code-editor/index.vue +102 -63
  27. package/src/components/confirmDialog/index.js +41 -1
  28. package/src/components/confirmDialog/index.vue +24 -17
  29. package/src/components/confirmDialog/mixins.js +31 -1
  30. package/src/components/errorMsg/index.js +44 -1
  31. package/src/components/errorMsg/index.vue +78 -70
  32. package/src/components/errorMsg/mixins.js +101 -5
  33. package/src/components/excelExport/button.vue +86 -24
  34. package/src/components/excelExport/exportFieldDialog.vue +215 -81
  35. package/src/components/excelExport/index.js +6 -6
  36. package/src/components/excelExport/index.vue +108 -26
  37. package/src/components/excelExport/mixins.js +970 -2
  38. package/src/components/excelImport/index.js +13 -13
  39. package/src/components/excelImport/mixins.js +2 -1
  40. package/src/components/fileLibrary/fileObjAuthDialog.vue +179 -89
  41. package/src/components/fileLibrary/fileObjAuthEditDialog.vue +6 -0
  42. package/src/components/fileLibrary/filterDialog.vue +454 -0
  43. package/src/components/fileLibrary/index.vue +605 -262
  44. package/src/components/fileLibrary/mixins/categoryMoveDialogMixins.js +1 -1
  45. package/src/components/fileLibrary/mixins/fileCategoryDialogMixins.js +1 -1
  46. package/src/components/fileLibrary/mixins/fileHistoryDialogMixins.js +2 -2
  47. package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +339 -211
  48. package/src/components/fileLibrary/mixins/fileObjAuthEditDialogMixin.js +31 -27
  49. package/src/components/fileLibrary/mixins/fileObjAuthEditMixin.js +4 -4
  50. package/src/components/fileLibrary/mixins/indexMixins.js +220 -101
  51. package/src/components/fileLibrary/mixins/propertiesDialogMixins.js +64 -4
  52. package/src/components/fileLibrary/mixins/recycleBinDialogMixins.js +3 -3
  53. package/src/components/fileLibrary/propertiesDialog.vue +113 -74
  54. package/src/components/fileLibrary/shareDialog.vue +1 -1
  55. package/src/components/formOplog/mixins.js +85 -4
  56. package/src/components/hiprint/css/bootstrap.min.css +6 -0
  57. package/src/components/hiprint/fonts/glyphicons-halflings-regular.eot +0 -0
  58. package/src/components/hiprint/fonts/glyphicons-halflings-regular.svg +288 -0
  59. package/src/components/hiprint/fonts/glyphicons-halflings-regular.ttf +0 -0
  60. package/src/components/hiprint/fonts/glyphicons-halflings-regular.woff +0 -0
  61. package/src/components/hiprint/fonts/glyphicons-halflings-regular.woff2 +0 -0
  62. package/src/components/hiprint/hiprint.bundle.js +7 -2
  63. package/src/components/hiprint/view/design/index.vue +140 -47
  64. package/src/components/hiprint/view/design/mixins.js +611 -1
  65. package/src/components/hiprint/view/design/preview.vue +75 -52
  66. package/src/components/hiprint/view/json-view.vue +31 -31
  67. package/src/components/jdPrint/index.js +44 -1
  68. package/src/components/jdPrint/mixins.js +208 -1
  69. package/src/components/jsonImport/index.js +187 -17
  70. package/src/components/jsonImport/mixins.js +333 -1
  71. package/src/components/langImport/index.js +80 -1
  72. package/src/components/langImport/mixins.js +500 -16
  73. package/src/components/langTag/mixins/addButton.js +51 -5
  74. package/src/components/langTag/mixins/deleteButton.js +55 -5
  75. package/src/components/langTag/mixins/view.js +47 -5
  76. package/src/components/luckysheet/dialog.vue +159 -0
  77. package/src/components/luckysheet/export.js +595 -0
  78. package/src/components/luckysheet/fileUtils.js +147 -0
  79. package/src/components/luckysheet/index.js +72 -0
  80. package/src/components/luckysheet/templateJson.js +12078 -0
  81. package/src/components/luckysheet/view.vue +210 -0
  82. package/src/components/obsUpload/index.js +34 -0
  83. package/src/components/obsUpload/index.vue +231 -0
  84. package/src/components/obsUpload/mixins.js +1476 -0
  85. package/src/components/onlineTalk/index.vue +1 -1
  86. package/src/components/onlineTalk/mixins.js +852 -1
  87. package/src/components/onlineTalk/talkUserDialog.vue +280 -0
  88. package/src/components/oplogTable/mixins.js +83 -4
  89. package/src/components/pddPrint/index.js +44 -1
  90. package/src/components/pddPrint/mixins.js +252 -1
  91. package/src/components/projectTag/mixins/addButton.js +52 -1
  92. package/src/components/projectTag/mixins/deleteButton.js +52 -1
  93. package/src/components/projectTag/mixins/view.js +43 -1
  94. package/src/components/scriptDescription/button.vue +12 -4
  95. package/src/components/scriptDescription/mixins.js +30 -1
  96. package/src/components/scriptTest/mixins.js +90 -1
  97. package/src/components/statusTag/mixins.js +66 -1
  98. package/src/components/table/CellSlot.vue +1 -0
  99. package/src/components/table/config.js +74 -1
  100. package/src/components/table/index.js +1174 -11
  101. package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js +11028 -0
  102. package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css +200 -0
  103. package/src/components/table/tableForm.vue +99 -63
  104. package/src/components/table/tableFormMixin.js +285 -1
  105. package/src/components/table/util/index.js +339 -0
  106. package/src/components/table/vxeFilter/index.js +154 -1
  107. package/src/components/table/vxeFilter/mixin.js +308 -6
  108. package/src/components/tempStorage/index.vue +76 -55
  109. package/src/components/tempStorage/tempStorageDialog.vue +179 -54
  110. package/src/components/vb-tabs/x-tabs.vue +56 -30
  111. package/src/components/vipPrint/index.js +44 -1
  112. package/src/components/vipPrint/mixins.js +268 -1
  113. package/src/components/wf/addOpinionButton.vue +57 -0
  114. package/src/components/wf/content.vue +834 -362
  115. package/src/components/wf/mixins/addOpinionButton.js +53 -0
  116. package/src/components/wf/mixins/setCandidateButton.js +161 -0
  117. package/src/components/wf/mixins/setCandidateDialog.js +213 -1
  118. package/src/components/wf/mixins/setCandidateDialog2.js +252 -0
  119. package/src/components/wf/mixins/wfFlowEleScriptDialog.js +131 -0
  120. package/src/components/wf/mixins/wfTaskUserRangeDialog.js +69 -0
  121. package/src/components/wf/setCandidateButton.vue +40 -0
  122. package/src/components/wf/setCandidateDialog.vue +10 -0
  123. package/src/components/wf/setCandidateDialog2.vue +105 -0
  124. package/src/components/wf/wf.js +2156 -1
  125. package/src/components/wf/wfFlowEleScriptDialog.vue +89 -0
  126. package/src/components/wf/wfStartDialog.vue +66 -42
  127. package/src/components/wf/wfTaskUserRangeDialog.vue +65 -0
  128. package/src/components/wf/wfUtil.js +279 -1
  129. package/src/components/xform/form-designer/designer.js +1995 -9
  130. package/src/components/xform/form-designer/form-widget/components/gantt/index.vue +434 -0
  131. package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +1 -1
  132. package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +9 -8
  133. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +4 -1
  134. package/src/components/xform/form-designer/form-widget/container-widget/detail-pane-widget.vue +3 -2
  135. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +3 -3
  136. package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +971 -0
  137. package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog.vue +971 -0
  138. package/src/components/xform/form-designer/form-widget/dialog/exportDialog.vue +13 -0
  139. package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +301 -0
  140. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +85 -48
  141. package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +5 -1
  142. package/src/components/xform/form-designer/form-widget/dialog/formulaDialog.vue +799 -0
  143. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +30 -7
  144. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1762 -9
  145. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +222 -75
  146. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +2 -2
  147. package/src/components/xform/form-designer/form-widget/field-widget/a-text-widget.vue +1 -1
  148. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +32 -4
  149. package/src/components/xform/form-designer/form-widget/field-widget/button-widget.vue +1 -1
  150. package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +19 -1
  151. package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +40 -28
  152. package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +18 -7
  153. package/src/components/xform/form-designer/form-widget/field-widget/color-widget.vue +4 -1
  154. package/src/components/xform/form-designer/form-widget/field-widget/copy_button-widget.vue +95 -0
  155. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +13 -2
  156. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +30 -4
  157. package/src/components/xform/form-designer/form-widget/field-widget/download-button-widget.vue +133 -0
  158. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +86 -0
  159. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +170 -0
  160. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1654 -997
  161. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +705 -379
  162. package/src/components/xform/form-designer/form-widget/field-widget/gantt-widget.vue +964 -0
  163. package/src/components/xform/form-designer/form-widget/field-widget/html-text-widget.vue +6 -2
  164. package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +22 -11
  165. package/src/components/xform/form-designer/form-widget/field-widget/import2-button-widget.vue +90 -0
  166. package/src/components/xform/form-designer/form-widget/field-widget/input-widget.vue +7 -2
  167. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-bar-mixin.js +40 -10
  168. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-category-mixin.js +58 -91
  169. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-pie-mixin.js +8 -1
  170. package/src/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin.js +179 -0
  171. package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +53 -0
  172. package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +114 -81
  173. package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +186 -0
  174. package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +55 -28
  175. package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +119 -0
  176. package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +154 -47
  177. package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +26 -6
  178. package/src/components/xform/form-designer/form-widget/field-widget/search_button-widget.vue +2 -2
  179. package/src/components/xform/form-designer/form-widget/field-widget/select-export-button-widget.vue +86 -0
  180. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +92 -0
  181. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +24 -9
  182. package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +53 -0
  183. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +145 -0
  184. package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +12 -1
  185. package/src/components/xform/form-designer/form-widget/field-widget/static-text-widget.vue +8 -3
  186. package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +82 -49
  187. package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +38 -37
  188. package/src/components/xform/form-designer/form-widget/field-widget/tableexportbuttonwidget.vue +99 -0
  189. package/src/components/xform/form-designer/form-widget/field-widget/tempStorage-widget.vue +147 -0
  190. package/src/components/xform/form-designer/form-widget/field-widget/text-widget.vue +106 -33
  191. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +2 -2
  192. package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +3 -171
  193. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +191 -66
  194. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +753 -0
  195. package/src/components/xform/form-designer/form-widget/indexMixin.js +1 -1
  196. package/src/components/xform/form-designer/indexMixin.js +3 -772
  197. package/src/components/xform/form-designer/refMixinDesign.js +1 -28
  198. package/src/components/xform/form-designer/setting-panel/form-setting.vue +981 -172
  199. package/src/components/xform/form-designer/setting-panel/index.vue +4 -0
  200. package/src/components/xform/form-designer/setting-panel/indexMixin.js +1 -1
  201. package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +537 -302
  202. package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +4 -4
  203. package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +3 -3
  204. package/src/components/xform/form-designer/setting-panel/property-editor/autoValueEnabled-editor.vue +38 -0
  205. package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +6 -0
  206. package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +28 -0
  207. package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +41 -0
  208. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +125 -0
  209. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +956 -1042
  210. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +432 -0
  211. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/onCheckboxChange-editor.vue +1 -1
  212. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +1193 -520
  213. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +3 -3
  214. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-pane/detail-pane-editor.vue +3 -3
  215. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +1 -1
  216. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +1 -1
  217. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +1 -1
  218. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +0 -8
  219. package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +31 -2
  220. package/src/components/xform/form-designer/setting-panel/property-editor/copyButton-editor.vue +36 -0
  221. package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +32 -0
  222. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +133 -0
  223. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin.js +2 -2
  224. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onAfterConfirmFile-editor.vue +5 -3
  225. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +23 -8
  226. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +35 -20
  227. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +64 -5
  228. package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-item-editor.vue +21 -0
  229. package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -0
  230. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +25 -0
  231. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +5 -5
  232. package/src/components/xform/form-designer/setting-panel/property-editor/field-gantt/gantt-editor.vue +36 -0
  233. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +77 -20
  234. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +96 -0
  235. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +44 -15
  236. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -0
  237. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +1 -1
  238. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/preWrap-editor.vue +23 -0
  239. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +1 -1
  240. package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +67 -41
  241. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +56 -0
  242. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +71 -0
  243. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +24 -8
  244. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +13 -1
  245. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +33 -1
  246. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +66 -0
  247. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +89 -19
  248. package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +137 -0
  249. package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +721 -466
  250. package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +20 -11
  251. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconClass-editor.vue +1 -1
  252. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +1 -1
  253. package/src/components/xform/form-designer/setting-panel/property-editor/labelTooltip-editor.vue +1 -1
  254. package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +1 -1
  255. package/src/components/xform/form-designer/setting-panel/property-editor/multiple-editor.vue +19 -14
  256. package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +1 -1
  257. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +126 -50
  258. package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +31 -0
  259. package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +1 -1
  260. package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +349 -0
  261. package/src/components/xform/form-designer/setting-panel/property-editor/required-editor.vue +10 -6
  262. package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +3 -3
  263. package/src/components/xform/form-designer/setting-panel/property-editor/showRuleFlag-editor.vue +1 -1
  264. package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +42 -0
  265. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +305 -19
  266. package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +2 -2
  267. package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +2 -2
  268. package/src/components/xform/form-designer/setting-panel/property-editor/wfFlag-editor.vue +372 -50
  269. package/src/components/xform/form-designer/setting-panel/property-editor/widgetShowRuleFlag-editor.vue +263 -0
  270. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +33 -11
  271. package/src/components/xform/form-designer/toolbar-panel/index.vue +12 -11
  272. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +1 -1
  273. package/src/components/xform/form-designer/widget-panel/index.vue +21 -1
  274. package/src/components/xform/form-designer/widget-panel/indexMixin.js +19 -18
  275. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1729 -918
  276. package/src/components/xform/form-render/container-item/containerItemMixin.js +12 -11
  277. package/src/components/xform/form-render/container-item/data-table-item.vue +206 -198
  278. package/src/components/xform/form-render/container-item/data-table-mixin.js +3326 -1685
  279. package/src/components/xform/form-render/container-item/detail-item.vue +72 -48
  280. package/src/components/xform/form-render/container-item/detail-pane-item.vue +17 -3
  281. package/src/components/xform/form-render/container-item/grid-col-item.vue +10 -3
  282. package/src/components/xform/form-render/container-item/grid-item.vue +1 -1
  283. package/src/components/xform/form-render/container-item/list-h5-item.vue +1 -9
  284. package/src/components/xform/form-render/container-item/list-h5-item2.vue +1 -8
  285. package/src/components/xform/form-render/container-item/tab-item.vue +62 -25
  286. package/src/components/xform/form-render/container-item/table-cell-item.vue +38 -32
  287. package/src/components/xform/form-render/container-item/table-item.vue +4 -2
  288. package/src/components/xform/form-render/container-item/table2-cell-item.vue +53 -34
  289. package/src/components/xform/form-render/container-item/table2-item.vue +167 -92
  290. package/src/components/xform/form-render/container-item/tree-item.vue +32 -11
  291. package/src/components/xform/form-render/dynamicDialogRender.js +1 -1
  292. package/src/components/xform/form-render/index.vue +77 -20
  293. package/src/components/xform/form-render/indexMixin.js +3719 -12
  294. package/src/components/xform/form-render/refMixin.js +3 -3
  295. package/src/components/xform/lang/zh-CN.js +29 -4
  296. package/src/components/xform/mixins/defaultHandle.js +367 -2
  297. package/src/components/xform/mixins/scriptHttp.js +3 -1
  298. package/src/components/xform/utils/emitter.js +4 -4
  299. package/src/components/xform/utils/formHttp.js +162 -0
  300. package/src/components/xform/utils/format.js +41 -34
  301. package/src/components/xform/utils/formula-util.js +969 -0
  302. package/src/components/xform/utils/smart-vue-i18n/index.js +2 -1
  303. package/src/components/xform/utils/util.js +1475 -1
  304. package/src/components/xform/utils/validators.js +2 -5
  305. package/src/components/xform/utils/vue2js-generator.js +2 -2
  306. package/src/components/xhsPrint/index.js +44 -1
  307. package/src/components/xhsPrint/mixins.js +269 -1
  308. package/src/directive/LimitNumber/index.js +125 -1
  309. package/src/directive/el-dialog-center/index.js +34 -1
  310. package/src/directive/el-drag-dialog/drag.js +86 -1
  311. package/src/directive/el-readonly/index.js +15 -1
  312. package/src/directive/permission/hasPermi.js +34 -1
  313. package/src/index.js +215 -190
  314. package/src/lang/index.js +56 -51
  315. package/src/lang/locale/en/login.js +20 -0
  316. package/src/lang/locale/zh/login.js +20 -0
  317. package/src/layout/components/AppMain.vue +8 -1
  318. package/src/layout/components/Sidebar/default.vue +1577 -1222
  319. package/src/layout/components/Sidebar/index.vue +6 -1
  320. package/src/layout/components/TagsView/index.vue +43 -12
  321. package/src/layout/components/createCompany/createCompanyDialog.vue +157 -0
  322. package/src/layout/components/extractedCode/createDialog.vue +92 -0
  323. package/src/layout/components/extractedCode/queryDialog.vue +103 -0
  324. package/src/layout/components/extractedCode/viewDialog.vue +207 -0
  325. package/src/layout/components/langTool.vue +32 -29
  326. package/src/layout/components/watermark/index.vue +83 -0
  327. package/src/layout/defaultLayout.vue +17 -9
  328. package/src/mixins/selectDialog/index.js +266 -1
  329. package/src/mixins/tableTree/index.js +199 -4
  330. package/src/mixins/wf/index.js +33 -1
  331. package/src/permission.js +135 -18
  332. package/src/resources/js/base/common.js +109 -109
  333. package/src/router/modules/customer.js +0 -15
  334. package/src/router/modules/system.js +4 -0
  335. package/src/store/config/index.js +667 -1
  336. package/src/store/getters.js +4 -1
  337. package/src/store/modules/permission.js +46 -41
  338. package/src/store/modules/settings.js +1 -1
  339. package/src/store/modules/tagsView.js +5 -8
  340. package/src/store/modules/user.js +367 -16
  341. package/src/utils/aes.js +2 -1
  342. package/src/utils/auth.js +1 -1
  343. package/src/utils/global.js +1 -1
  344. package/src/utils/index.js +2 -3
  345. package/src/utils/keepAlive.js +1 -1
  346. package/src/utils/pddLog.js +92 -0
  347. package/src/utils/pdfUtil.js +71 -0
  348. package/src/utils/request.js +1 -1
  349. package/src/utils/vab.js +1268 -27
  350. package/src/utils/validate.js +1 -1
  351. package/src/utils/wf.js +4 -4
  352. package/src/views/bd/setting/bd_attach_setting/edit.vue +5 -5
  353. package/src/views/bd/setting/bd_attach_setting/list.vue +28 -55
  354. package/src/views/bd/setting/bd_attach_setting/mixins/dialog.js +84 -1
  355. package/src/views/bd/setting/bd_attach_setting/mixins/edit.js +116 -5
  356. package/src/views/bd/setting/bd_attach_setting/mixins/list.js +239 -1
  357. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -0
  358. package/src/views/bd/setting/bd_company_env/edit.vue +193 -0
  359. package/src/views/bd/setting/bd_company_env/list.vue +175 -0
  360. package/src/views/bd/setting/config_manage/list.vue +83 -0
  361. package/src/views/bd/setting/formVersion/button.vue +55 -0
  362. package/src/views/bd/setting/formVersion/compareDialog.vue +287 -0
  363. package/src/views/bd/setting/formVersion/fieldCompare.vue +54 -0
  364. package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +400 -0
  365. package/src/views/bd/setting/formVersion/link.vue +58 -0
  366. package/src/views/bd/setting/formVersion/preformDialog.vue +86 -0
  367. package/src/views/bd/setting/formVersion/reverButton.vue +82 -0
  368. package/src/views/bd/setting/form_import_log/edit.vue +130 -0
  369. package/src/views/bd/setting/form_import_log/list.vue +211 -0
  370. package/src/views/bd/setting/form_script/edit.vue +196 -74
  371. package/src/views/bd/setting/form_script/edit1.vue +410 -187
  372. package/src/views/bd/setting/form_script/form_list.vue +118 -37
  373. package/src/views/bd/setting/form_script/list.vue +90 -21
  374. package/src/views/bd/setting/form_script/list1.vue +200 -118
  375. package/src/views/bd/setting/form_script/mixins/dialog.js +130 -1
  376. package/src/views/bd/setting/form_script/mixins/edit.js +265 -7
  377. package/src/views/bd/setting/form_script/mixins/edit1.js +259 -9
  378. package/src/views/bd/setting/form_script/mixins/form_list.js +322 -14
  379. package/src/views/bd/setting/form_script/mixins/list.js +278 -4
  380. package/src/views/bd/setting/form_script/mixins/list1.js +480 -14
  381. package/src/views/bd/setting/form_script/mixins/list2.js +10 -1
  382. package/src/views/bd/setting/form_script/mixins/otherAuthDialog.js +194 -0
  383. package/src/views/bd/setting/form_script/mixins/preformDialog.js +34 -1
  384. package/src/views/bd/setting/form_script/otherAuthDialog.vue +83 -0
  385. package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +2 -2
  386. package/src/views/bd/setting/form_template/edit.vue +355 -184
  387. package/src/views/bd/setting/form_template/editWfObjConfigDialog.vue +2 -2
  388. package/src/views/bd/setting/form_template/formDesignerDialog.vue +171 -0
  389. package/src/views/bd/setting/form_template/list.vue +296 -214
  390. package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +11 -9
  391. package/src/views/bd/setting/form_template/mixins/dialog.js +103 -1
  392. package/src/views/bd/setting/form_template/mixins/edit.js +277 -9
  393. package/src/views/bd/setting/form_template/mixins/editWfObjConfigDialog.js +92 -1
  394. package/src/views/bd/setting/form_template/mixins/ftHistoryDialog.js +91 -1
  395. package/src/views/bd/setting/form_template/mixins/itemEdit.js +104 -1
  396. package/src/views/bd/setting/form_template/mixins/itemList.js +234 -1
  397. package/src/views/bd/setting/form_template/mixins/list.js +672 -22
  398. package/src/views/bd/setting/form_template/mixins/list2.js +411 -0
  399. package/src/views/bd/setting/form_template/mixins/otherAuthDialog.js +193 -0
  400. package/src/views/bd/setting/form_template/mixins/preformDialog.js +28 -3
  401. package/src/views/bd/setting/form_template/mixins/wf_list.js +3 -7
  402. package/src/views/bd/setting/form_template/otherAuthDialog.vue +83 -0
  403. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +4 -4
  404. package/src/views/bd/setting/form_template/wf_list.vue +161 -127
  405. package/src/views/bd/setting/logic_param/edit.vue +146 -0
  406. package/src/views/bd/setting/logic_param/edit1.vue +106 -0
  407. package/src/views/bd/setting/logic_param/edit2.vue +139 -0
  408. package/src/views/bd/setting/logic_param/list.vue +74 -0
  409. package/src/views/bd/setting/logic_param/list1.vue +12 -0
  410. package/src/views/bd/setting/logic_param/list2.vue +12 -0
  411. package/src/views/bd/setting/logic_param/mixins/edit.js +93 -0
  412. package/src/views/bd/setting/logic_param/mixins/list.js +376 -0
  413. package/src/views/bd/setting/menu_kind/list.vue +172 -83
  414. package/src/views/bd/setting/menu_kind/mixins/authDialog.js +300 -7
  415. package/src/views/bd/setting/menu_kind/mixins/dialog.js +139 -1
  416. package/src/views/bd/setting/menu_kind/mixins/list.js +201 -1
  417. package/src/views/bd/setting/push_data/edit.vue +139 -0
  418. package/src/views/bd/setting/push_data/list.vue +283 -0
  419. package/src/views/bd/setting/push_data_h/edit.vue +153 -0
  420. package/src/views/bd/setting/push_data_h/list.vue +293 -0
  421. package/src/views/bd/setting/request_async_setting/edit.vue +320 -0
  422. package/src/views/bd/setting/request_async_setting/list.vue +372 -0
  423. package/src/views/bd/setting/request_setting/edit.vue +300 -0
  424. package/src/views/bd/setting/request_setting/list.vue +311 -0
  425. package/src/views/bd/setting/table_model/edit.vue +1073 -426
  426. package/src/views/bd/setting/table_model/list.vue +213 -128
  427. package/src/views/bd/setting/table_model/mixins/dialog.js +71 -1
  428. package/src/views/bd/setting/table_model/mixins/edit.js +1284 -13
  429. package/src/views/bd/setting/table_model/mixins/list.js +441 -14
  430. package/src/views/bd/setting/table_model/mixins/otherAuthDialog.js +201 -0
  431. package/src/views/bd/setting/table_model/mixins/zdDialog.js +108 -1
  432. package/src/views/bd/setting/table_model/otherAuthDialog.vue +83 -0
  433. package/src/views/bd/setting/utils/index.js +60 -1
  434. package/src/views/user/access_log/list.vue +418 -349
  435. package/src/views/user/area/dialog.vue +223 -117
  436. package/src/views/user/area/list.vue +318 -0
  437. package/src/views/user/bill_setting/edit.vue +1 -1
  438. package/src/views/user/bill_setting/list.vue +1 -1
  439. package/src/views/user/common_attribute/itemEdit.vue +2 -2
  440. package/src/views/user/common_attribute/list.vue +5 -2
  441. package/src/views/user/common_script/edit.vue +1 -1
  442. package/src/views/user/common_script/list.vue +1 -1
  443. package/src/views/user/company_info/dialog.vue +195 -163
  444. package/src/views/user/company_info/edit.vue +1 -1
  445. package/src/views/user/extend_datasource/dialog.vue +3 -0
  446. package/src/views/user/extend_datasource/edit.vue +2 -1
  447. package/src/views/user/extend_datasource/list.vue +3 -0
  448. package/src/views/user/fieldTranslation/editDialog.vue +8 -8
  449. package/src/views/user/fieldTranslation/list.vue +33 -33
  450. package/src/views/user/form/vform/designer.vue +790 -749
  451. package/src/views/user/form/vform/out_render.vue +1 -1
  452. package/src/views/user/form/vform/render.vue +67 -37
  453. package/src/views/user/form/view/edit.vue +38 -37
  454. package/src/views/user/form/view/list.vue +270 -49
  455. package/src/views/user/home/default.vue +1026 -979
  456. package/src/views/user/home/dev.vue +29 -0
  457. package/src/views/user/home/index.vue +18 -7
  458. package/src/views/user/login/default.vue +165 -36
  459. package/src/views/user/login/index.vue +4 -6
  460. package/src/views/user/login/indexMixin.js +186 -9
  461. package/src/views/user/menu/list.vue +27 -1
  462. package/src/views/user/notify_message/dialog.vue +44 -22
  463. package/src/views/user/notify_template/edit.vue +188 -187
  464. package/src/views/user/notify_template/edit2.vue +176 -0
  465. package/src/views/user/notify_template/list.vue +4 -1
  466. package/src/views/user/notify_template/list2.vue +190 -0
  467. package/src/views/user/outLink/form_view.vue +211 -211
  468. package/src/views/user/outLink/index.vue +67 -11
  469. package/src/views/user/position/list.vue +112 -72
  470. package/src/views/user/project_tag/dialog.vue +9 -4
  471. package/src/views/user/project_tag/edit.vue +2 -2
  472. package/src/views/user/project_tag/list.vue +9 -4
  473. package/src/views/user/push_setting/list.vue +2 -2
  474. package/src/views/user/request_setting/edit.vue +258 -0
  475. package/src/views/user/request_setting/list.vue +248 -0
  476. package/src/views/user/role/authConfig.vue +89 -0
  477. package/src/views/user/role/dialog.vue +70 -48
  478. package/src/views/user/role/edit.vue +609 -429
  479. package/src/views/user/role/list.vue +4 -4
  480. package/src/views/user/sale_org/dialog.vue +1 -1
  481. package/src/views/user/sale_org/list.vue +4 -1
  482. package/src/views/user/system_notice/infoDialog.vue +2 -1
  483. package/src/views/user/user/dialog.vue +46 -23
  484. package/src/views/user/user/edit.vue +1338 -1021
  485. package/src/views/user/user/form_dialog.vue +158 -0
  486. package/src/views/user/user/form_info.vue +210 -0
  487. package/src/views/user/user/info.vue +253 -140
  488. package/src/views/user/user/list.vue +652 -563
  489. package/src/views/user/user/modifyPasswordDialog.vue +64 -53
  490. package/src/views/user/wf/wfReport/index.vue +619 -0
  491. package/src/views/user/wf/wf_auto_submit_data/list.vue +2 -0
  492. package/src/views/user/wf/wf_manage/list.vue +379 -250
  493. package/src/views/user/wf/wf_manage/wfContentDialog.vue +25 -22
  494. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +109 -0
  495. package/src/views/user/wf/wf_obj_config/itemEdit.vue +25 -1
  496. package/src/views/user/wf/wf_obj_config/list.vue +114 -9
  497. package/src/views/user/wf/wf_obj_config/wfBizDataSettingDialog.vue +2 -2
  498. package/src/views/user/wf/wf_transfer_setting/edit.vue +282 -0
  499. package/src/views/user/wf/wf_transfer_setting/list.vue +319 -0
  500. package/src/views/user/workbench_menu/list.vue +555 -0
  501. package/src/utils/renderUtils.js +0 -76
@@ -1,997 +1,1654 @@
1
- import {
2
- deepClone,
3
- translateOptionItems,
4
- getDSByName,
5
- overwriteObj,
6
- runDataSourceRequest,
7
- getReportGlobalMap,
8
- getAccessUrl
9
- } from "../../../../../components/xform/utils/util"
10
- import FormValidators from '../../../../../components/xform/utils/validators'
11
- import scriptHttpMixin from "../../../../../components/xform/mixins/scriptHttp";
12
- import defaultHandleMixin from "../../../../../components/xform/mixins/defaultHandle";
13
-
14
- let modules = {};
15
- const baseRefUtil = {
16
- deepClone,
17
- translateOptionItems,
18
- getDSByName,
19
- overwriteObj,
20
- runDataSourceRequest,
21
- FormValidators,
22
- getReportGlobalMap,
23
- getAccessUrl
24
- };
25
- modules = {
26
- mixins: [scriptHttpMixin, defaultHandleMixin],
27
- props: {
28
- columnConfig: {
29
- type: Object,
30
- default: null
31
- },
32
- tableParam: {
33
- type: Object,
34
- default: null
35
- },
36
- formItemProp: {
37
- type: String,
38
- default: null
39
- }
40
- },
41
- provide() {
42
- return {
43
- tableParam: this.tableParam,
44
- formItemProp: this.formItemProp
45
- };
46
- },
47
- inject: ["refList", "getFormConfig", "globalOptionData", "globalModel", "getOptionData", "getGlobalDsv",
48
- "getReadMode", "getSubFormFieldFlag", "getSubFormName", 'getReportTemplate', "getObjectFieldFlag", "getObjectName"
49
- ],
50
- data: function () {
51
- return {
52
- fieldReadonlyFlag: !1,
53
- requestAccess: null,
54
- extraAccessData: {},
55
- timerMap: {}
56
- }
57
- },
58
- beforeDestroy() {
59
- this.clearAllInterval();
60
- },
61
- created() {
62
- if (this.field.options.searchDialogConfig) {
63
- if (this.field.options.searchDialogConfig.multipleChoices === void 0) {
64
- if (this.field.type == 'vabsearch') {
65
- this.$set(this.field.options.searchDialogConfig, 'multipleChoices', false);
66
- } else {
67
- this.$set(this.field.options.searchDialogConfig, 'multipleChoices', true);
68
- }
69
- }
70
- }
71
- },
72
- mounted() {
73
-
74
- },
75
- watch: {
76
- currentValue(val) {
77
- this.initFieldModel(true)
78
- }
79
- },
80
- computed: {
81
- currentValue() {
82
- let currentData = this.tableParam && this.tableParam.row ? this.tableParam.row : this.formModel;
83
- let currentValue = currentData[this.fieldKeyName];
84
- return currentValue;
85
- },
86
- formConfig: function () {
87
- return this.getFormConfig();
88
- },
89
- subFormName: function () {
90
- return this.getSubFormName ? this.getSubFormName() : "";
91
- },
92
- subFormItemFlag: function () {
93
- return !!this.getSubFormFieldFlag && this.getSubFormFieldFlag();
94
- },
95
- formModel: {
96
- cache: !1,
97
- get: function () {
98
- return this.globalModel.formModel;
99
- }
100
- },
101
- isReadMode: function () {
102
- return !!this.getReadMode() || this.fieldReadonlyFlag;
103
- },
104
- optionLabel: function () {
105
- var e = this;
106
- if (null === this.fieldModel)
107
- return "--";
108
- var t = "--";
109
- return this.field.options.optionItems.forEach((function (i) {
110
- i.value !== e.fieldModel && -1 === e.findInArray(e.fieldModel, i.value) || (t = "--"
111
- === t ? i.label : t + " " + i.label);
112
- })),
113
- t;
114
- },
115
- tableRow() {
116
- let tableParam = this.tableParam;
117
- return tableParam && tableParam.row ? tableParam.row : null;
118
- },
119
- fieldKeyName() {
120
- let o = this.field.options.name;
121
- return (
122
- (this.field.options.keyNameEnabled
123
- && this.field.options.keyName)
124
- || o
125
- );
126
- },
127
- },
128
- methods: {
129
- initConfig() {
130
- let config = this.designer.getFieldWidgetByType(this.field.type);
131
- this.field.options = Object.assign({}, config.options, this.field.options);
132
- },
133
- findInArray: function (e, t) {
134
- if (!Array.isArray(e))
135
- return -1;
136
- var i = -1;
137
- return e.forEach((function (e, n) {
138
- e === t && (i = n);
139
- })),
140
- i;
141
- },
142
- getPropName: function () {
143
- if (this.formItemProp) {
144
- return this.formItemProp;
145
- } else {
146
- return this.subFormItemFlag && !this.designState
147
- ? this.subFormName
148
- + "."
149
- + this.subFormRowIndex
150
- + "."
151
- + this.fieldKeyName
152
- : this.getObjectFieldFlag() && !this.designState
153
- ? this.getObjectName() + "." + this.fieldKeyName
154
- : this.fieldKeyName;
155
- }
156
- },
157
- initFieldModel: function (flag) {
158
- var e = this;
159
- if (this.field.formItemFlag) {
160
- let currentData = this.tableParam && this.tableParam.row ? this.tableParam.row : this.formModel;
161
- /*if (this.subFormItemFlag && !this.designState) {
162
- var t = currentData[this.subFormName];
163
- return void 0 !== t && void 0 !== t[this.subFormRowIndex] && void 0 !== t[this.subFormRowIndex][
164
- this.fieldKeyName
165
- ] || void 0 === this.field.options.defaultValue ? void 0 === t[this.subFormRowIndex][this
166
- .fieldKeyName
167
- ] ? (this.fieldModel = null,
168
- t[this.subFormRowIndex][this.fieldKeyName] = null) : this.fieldModel = t[this
169
- .subFormRowIndex][this.fieldKeyName] : (this.fieldModel = this.field.options
170
- .defaultValue,
171
- t[this.subFormRowIndex][this.fieldKeyName] = this.field.options.defaultValue),
172
- setTimeout((function () {
173
- e.handleOnChangeForSubForm(e.fieldModel, e.oldFieldValue, t, e.subFormRowId)
174
- }), 800),
175
- this.oldFieldValue = baseRefUtil.deepClone(this.fieldModel),
176
- void this.initFileList();
177
- }*/
178
- let defaultValue = this.field.options.defaultValue;
179
- let dataId = this.getFormRef()?.dataId ?? null;
180
- if (void 0 === currentData[this.fieldKeyName]) {
181
- this.$set(currentData, this.fieldKeyName, null);
182
- }
183
- if (flag) {
184
- this.fieldModel = currentData[this.fieldKeyName];
185
- } else if (currentData[this.fieldKeyName] !== null) {
186
- this.fieldModel = currentData[this.fieldKeyName];
187
- } else {
188
- if (!dataId) {
189
- //新增
190
- if (!this.tableParam) {
191
- //主表
192
- if (this.isNotNullVal(defaultValue)) {
193
- this.setValue(defaultValue);
194
- }
195
- } else {
196
- //明细
197
- if (!this.tableParam.row.id && this.isNotNullVal(defaultValue)) {
198
- this.setValue(defaultValue);
199
- }
200
- }
201
- } else {
202
- //编辑
203
- if (!this.tableParam) {
204
- //主表
205
- } else {
206
- //明细
207
- if (!this.tableParam.row.id && this.isNotNullVal(defaultValue)) {
208
- this.setValue(defaultValue);
209
- }
210
- }
211
- }
212
- }
213
-
214
- /*if (this.fieldKeyName == "f_mobile" && !this.fieldModel) {
215
- debugger
216
- }*/
217
- /*void 0 === currentData[this.fieldKeyName] && void 0 !== this.field.options.defaultValue
218
- ? this.fieldModel = this.field.options.defaultValue :
219
- void 0 === currentData[this.fieldKeyName] ? currentData[this.fieldKeyName] = null : this.fieldModel = currentData[this.fieldKeyName];*/
220
- this.oldFieldValue = baseRefUtil.deepClone(this.fieldModel);
221
- /*if (this.fieldKeyName == "f_contract" && !this.fieldModel) {
222
- debugger
223
- }*/
224
- this.initFileList();
225
- }
226
- },
227
- isNotNullVal(val) {
228
- return val !== null && val !== undefined && val !== '';
229
- },
230
- initFileList: function () {
231
- "picture-upload" !== this.field.type && "file-upload" !== this.field.type || !0 === this.designState
232
- || this.fieldModel && (Array.isArray(this.fieldModel) ? this.fileList = baseRefUtil.deepClone(this
233
- .fieldModel) : this.fileList.splice(0, 0, baseRefUtil.deepClone(this.fieldModel)));
234
- },
235
- handleCreatedEnterEvent() {
236
- this.handleCustomEvent(this.field.options.onCreatedEnter);
237
- },
238
- initEventHandler() {
239
- this.designState
240
- || (this.$on("setFormData", (o) => {
241
- /*if (!this.subFormItemFlag)
242
- if (
243
- !!this.getObjectFieldFlag()
244
- && !this.designState
245
- ) {
246
- const e = this.getObjectModel();
247
- this.setValue(
248
- e === void 0
249
- ? null
250
- : e[this.fieldKeyName]
251
- );
252
- } else this.setValue(o[this.fieldKeyName]);*/
253
- this.subFormItemFlag || this.setValue(o[this.fieldKeyName]);
254
- }),
255
- this.$on("field-value-changed", (o) => {
256
- if (this.subFormItemFlag) {
257
- let e = this.formModel[this.subFormName];
258
- this.handleOnChangeForSubForm(
259
- o[0],
260
- o[1],
261
- e,
262
- this.subFormRowId
263
- );
264
- } else this.handleOnChange(o[0], o[1]);
265
- }),
266
- this.$on("field-value-changed", (function (e) {
267
- if (this.subFormItemFlag) {
268
- var t = this.formModel[this.subFormName];
269
- this.handleOnChangeForSubForm(e[0], e[1], t, this.subFormRowId);
270
- } else
271
- this.handleOnChange(e[0], e[1]);
272
- })),
273
- this.$on("sync-field-value", (o) => {
274
- const e = o[0],
275
- n = o[1];
276
- if (
277
- this.field.options.name === e
278
- || (!n && this.field.options.keyName !== e)
279
- || (!this.field.options.keyName
280
- && this.field.options.name !== n)
281
- || (!!this.field.options.keyName
282
- && !!n
283
- && this.field.options.keyName !== n)
284
- || o[5] !== this.getObjectName()
285
- )
286
- return;
287
- const s = o[2],
288
- c = o[3],
289
- u = o[4];
290
- !this.subFormName && !s
291
- ? this.setValue(u, !0)
292
- : this.subFormName === s
293
- && this.subFormRowId === c
294
- && this.setValue(u, !0);
295
- }),
296
- /*this.$on("calculate-formula", (o) => {
297
- if (
298
- !!this.field.options.formulaEnabled
299
- && !!this.field.options.formula
300
- ) {
301
- let e = o[1];
302
- const n = o[1].field.options.name;
303
- fieldIsUsedInFormula(
304
- n,
305
- this.field.options.formula,
306
- this.getFormRef()
307
- )
308
- && calculateFormula(
309
- this.getFormRef(),
310
- this.getGlobalDsv(),
311
- formulajs,
312
- this,
313
- e
314
- );
315
- }
316
- }),
317
- this.$on("calculate-formula-sfRowDeleted", (o) => {
318
- if (
319
- !!this.field.options.formulaEnabled
320
- && !!this.field.options.formula
321
- ) {
322
- const e = o[1];
323
- fieldIsUsedInFormula(
324
- e,
325
- this.field.options.formula,
326
- this.getFormRef()
327
- );
328
- }
329
- }),*/
330
- this.$on("loadOptionItemsFromDataSet", (o) => {
331
- this.loadOptionItemsFromDataSet(o),
332
- (this.dataSetLoadedFlag = !0);
333
- }),
334
- this.$on("reloadOptionItems", (o) => {
335
- (o.length === 0
336
- || o.indexOf(this.field.options.name) > -1)
337
- && this.initOptionItems(!0);
338
- }));
339
- },
340
- getEventParam() {
341
- let formRef = this.getFormRef();
342
- let dataId = formRef?.dataId;
343
- let formCode = formRef?.reportTemplate?.formCode;
344
- return {
345
- eventParamNames: ["dataId", "formCode"],
346
- eventParamValues: [dataId, formCode],
347
- }
348
- },
349
- handleCustomEvent(funtionStr, eventParamNames = [], eventParamValues = []) {
350
- if (!this.designState && funtionStr) {
351
- let eventParam = this.getEventParam();
352
- var e = new Function(...eventParam.eventParamNames, ...eventParamNames, funtionStr);
353
- return e.call(this, ...eventParam.eventParamValues, ...eventParamValues);
354
- }
355
- },
356
- handleOnCreated: function () {
357
- this.handleCustomEvent(this.field.options.onCreated);
358
- },
359
- handleOnMounted: function () {
360
- this.handleCustomEvent(this.field.options.onMounted);
361
- this.autoExcScript();
362
- },
363
- registerToRefList: function (e) {
364
- null !== this.refList && this.field.options.name && (this.tableParam && !this.designState ? (e
365
- && delete this.refList[e + "@row" + this.tableParam.rowIndex],
366
- this.refList[this.field.options.name + "@row" + this.tableParam.rowIndex] = this) : (e
367
- && delete this.refList[e],
368
- this.refList[this.field.options.name] = this));
369
- },
370
- unregisterFromRefList: function () {
371
- if (null !== this.refList && this.field.options.name) {
372
- var e = this.field.options.name;
373
- this.tableParam && !this.designState ? delete this.refList[e + "@row" + this.tableParam.rowIndex]
374
- : delete this.refList[e];
375
- }
376
- },
377
- async initOptionItems(keepSelected) {
378
- var t = this;
379
- if (this.designState) {
380
- return;
381
- }
382
-
383
- if ((this.field.type === 'radio') || (this.field.type === 'checkbox')
384
- || (this.field.type === 'select') || (this.field.type === 'cascader')) {
385
- if (t.field.options.isLoadDataByAccess && t.field.options.scriptUuid) {
386
- this.scriptHttp(
387
- {
388
- options: t.field.options,
389
- params: {},
390
- callback: (res) => {
391
- let rows = res && res.objx ? res.objx : [];
392
- t.loadOptions(rows);
393
- }
394
- });
395
- } else if (!t.field.options.dsEnabled) {
396
- /* 异步更新option-data之后globalOptionData不能获取到最新值,改用provide的getOptionData()方法 */
397
- const newOptionItems = this.getOptionData();
398
- if (!!newOptionItems && newOptionItems.hasOwnProperty(this.fieldKeyName)) {
399
- if (!!keepSelected) {
400
- this.reloadOptions(newOptionItems[this.fieldKeyName]);
401
- } else {
402
- this.loadOptions(newOptionItems[this.fieldKeyName]);
403
- }
404
- }
405
- } else {
406
- var n, a, l, s, r, d;
407
-
408
- await this.initAccess();
409
-
410
- let requestAccess = this.requestAccess;
411
- if (!requestAccess) {
412
- return;
413
- }
414
- return l = t.getGlobalDsv() || {},
415
- s = new Object({}),
416
- baseRefUtil.overwriteObj(s, l),
417
- s["widgetName"] = t.field.options.name,
418
- s.widgetKeyName = this.fieldKeyName,
419
- s["requestAccess"] = requestAccess,
420
- a = requestAccess.dsModel,
421
- // r = i.sent,
422
- baseRefUtil.runDataSourceRequest(a, s, t.getFormRef(), !1, t
423
- .$message).then(res => {
424
- t.loadOptions(res || []);
425
- });
426
- }
427
- }
428
- },
429
- refreshDefaultValue: function () {
430
- !0 === this.designState && void 0 !== this.field.options.defaultValue && (this.fieldModel = this.field
431
- .options.defaultValue);
432
- },
433
- clearFieldRules: function () {
434
- this.field.formItemFlag && this.rules.splice(0, this.rules.length);
435
- },
436
- buildFieldRules: function () {
437
- var e = this;
438
- if (this.field.formItemFlag) {
439
- if (this.rules.splice(0, this.rules.length),
440
- this.field.options.required && this.rules.push({
441
- required: !0,
442
- trigger: ["blur"],
443
- message: this.field.options.requiredHint || this.i18nt("render.hint.fieldRequired")
444
- }),
445
- this.field.options.validation) {
446
- var t = this.field.options.validation;
447
- a["a"][t] ? this.rules.push({
448
- validator: a["a"][t],
449
- trigger: ["blur", "change"],
450
- label: this.field.options.label,
451
- errorMsg: this.field.options.validationHint
452
- }) : this.rules.push({
453
- validator: a["a"]["regExp"],
454
- trigger: ["blur", "change"],
455
- regExp: t,
456
- label: this.field.options.label,
457
- errorMsg: this.field.options.validationHint
458
- });
459
- }
460
- if (this.field.options.onValidate) {
461
- var i = function (t, i, n) {
462
- var o = new Function("rule", "value", "callback", e.field.options.onValidate);
463
- return o.call(e, t, i, n);
464
- };
465
- this.rules.push({
466
- validator: i,
467
- trigger: ["blur", "change"],
468
- label: this.field.options.label
469
- });
470
- }
471
- }
472
- },
473
- disableChangeValidate: function () {
474
- this.rules && this.rules.forEach((function (e) {
475
- e.trigger && e.trigger.splice(0, e.trigger.length);
476
- }));
477
- },
478
- enableChangeValidate: function () {
479
- this.rules && this.rules.forEach((function (e) {
480
- e.trigger && (e.trigger.push("blur"),
481
- e.trigger.push("change"));
482
- }))
483
- },
484
- disableOptionOfList: function (e, t) {
485
- e && e.length > 0 && e.forEach((function (e) {
486
- e.value === t && (e.disabled = !0);
487
- }));
488
- },
489
- enableOptionOfList: function (e, t) {
490
- e && e.length > 0 && e.forEach((function (e) {
491
- e.value === t && (e.disabled = !1);
492
- }));
493
- },
494
- emitFieldDataChange(o, e) {
495
- this.$emit("field-value-changed", [o, e]),
496
- this.broadcast("FieldWidget", "sync-field-value", [
497
- this.field.options.name,
498
- this.field.options.keyName,
499
- this.subFormName,
500
- this.subFormRowId,
501
- o,
502
- this.getObjectName(),
503
- ]),
504
- /*this.getFormRef().broadcast(
505
- "FieldWidget",
506
- "calculate-formula",
507
- [o, this]
508
- ),*/
509
- this.dispatch("VFormRender", "fieldChange", [
510
- this.field.options.name,
511
- o,
512
- e,
513
- this.subFormName,
514
- this.subFormRowIndex,
515
- ]);
516
- },
517
- syncUpdateFormModel: function (e) {
518
- if (!this.designState)
519
- if (this.tableRow) {
520
- this.tableRow[this.fieldKeyName] = e;
521
- } else if (this.subFormItemFlag) {
522
- var t = this.formModel[this.subFormName] || [{}],
523
- i = t[this.subFormRowIndex];
524
- i[this.fieldKeyName] = e;
525
- } else
526
- this.formModel[this.fieldKeyName] = e;
527
- },
528
- handleChangeEvent: function (e) {
529
- this.syncUpdateFormModel(e),
530
- this.emitFieldDataChange(e, this.oldFieldValue),
531
- this.oldFieldValue = baseRefUtil.deepClone(e),
532
- this.dispatch("VFormRender", "fieldValidation", [this.getPropName()]);
533
- },
534
- handleFocusCustomEvent: function (e) {
535
- if (this.oldFieldValue = baseRefUtil.deepClone(this.fieldModel),
536
- this.field.options.onFocus) {
537
- var t = new Function("event", this.field.options.onFocus);
538
- t.call(this, e);
539
- }
540
- },
541
- handleBlurCustomEvent: function (e) {
542
- if (this.field.options.onBlur) {
543
- var t = new Function("event", this.field.options.onBlur);
544
- t.call(this, e);
545
- }
546
- },
547
- handleInputCustomEvent: function (e) {
548
- if (this.syncUpdateFormModel(e),
549
- this.dispatch("VFormRender", "fieldValidation", [this.getPropName()]),
550
- this.field.options.onInput) {
551
- var t = new Function("value", this.field.options.onInput);
552
- t.call(this, e);
553
- }
554
- },
555
- emitAppendButtonClick: function () {
556
- if (!this.designState) {
557
- if (this.field.options.onAppendButtonClick) {
558
- let tableParam = this.tableParam;
559
- let eventParamNames = [];
560
- let eventParamValues = [];
561
- if (tableParam) {
562
- eventParamNames = ['rowData', 'rowIndex'];
563
- eventParamValues = [tableParam.row, tableParam.rowIndex];
564
- }
565
-
566
- this.handleCustomEvent(this.field.options.onAppendButtonClick, eventParamNames, eventParamValues)
567
-
568
-
569
- // this.handleCustomEvent(this.field.options.onAppendButtonClick)
570
- } else {
571
- this.dispatch("VFormRender", "appendButtonClick", [this]);
572
- }
573
- this.handleCustomClickEvent();
574
- }
575
- },
576
- handleCustomClickEvent: function () {
577
- let tableParam = this.tableParam;
578
- let clickBindEvent = this.field.options.clickBindEvent;
579
- if (clickBindEvent == '1') {
580
- //打开选择弹框
581
- this.openSearchDialog(tableParam);
582
- } else if (clickBindEvent == '2') {
583
- //列表插入数据
584
- this.handleAddTableDataEvent();
585
- }
586
- },
587
- handleAddTableDataEvent() {
588
- let addTableDataConfig = this.field.options.addTableDataConfig || {};
589
- if (!addTableDataConfig.tableRef) return;
590
- let tableData = addTableDataConfig.tableData || {};
591
- this.getWidgetRef(addTableDataConfig.tableRef).addTableData([tableData]);
592
- },
593
- handleOnChange: function (e, t) {
594
- if (this.field.options.onChange) {
595
- var i = new Function("value", "oldValue", this.field.options.onChange);
596
- i.call(this, e, t);
597
- }
598
- },
599
- handleOnChangeForSubForm: function (e, t, i, n) {
600
- if (this.field.options.onChange) {
601
- var o = new Function("value", "oldValue", "subFormData", "rowId", this.field.options.onChange);
602
- o.call(this, e, t, i, n);
603
- }
604
- },
605
- handleButtonWidgetClick: function (event) {
606
- if (!this.designState) {
607
- if (this.field.options.onClick) {
608
- let tableParam = this.tableParam;
609
- let eventParamNames = ['event'];
610
- let eventParamValues = [event];
611
- if (tableParam) {
612
- eventParamNames = ['row', 'rowIndex', 'event'];
613
- eventParamValues = [tableParam.row, tableParam.rowIndex, event];
614
- }
615
- this.handleCustomEvent(this.field.options.onClick, eventParamNames, eventParamValues);
616
- } else {
617
- this.dispatch("VFormRender", "buttonClick", [this]);
618
- }
619
- this.handleCustomClickEvent();
620
- }
621
- },
622
- getSearchDialogSourceField(targetField) {
623
- let searchDialogConfig = this.field.options.searchDialogConfig || {};
624
- let tableData = searchDialogConfig.tableData || [];
625
- },
626
- openSearchDialog(tableParam) {
627
- let searchDialogConfig = this.field.options.searchDialogConfig || {};
628
- let formCode = searchDialogConfig.formCode;
629
- let tableData = searchDialogConfig.tableData || [];
630
- let formModel = this.formModel;
631
-
632
- let rows = []
633
- if (this.field.type == "vabsearch") {
634
- if (this.field.options.multipleChoices) {
635
- let fieldKeyName = this.fieldKeyName;
636
- let valueField = this.field.options.valueField || fieldKeyName;
637
- let vabSearchName = this.field.options.vabSearchName || fieldKeyName;
638
-
639
- rows = (this.fieldModel || []).map(row => {
640
- return {
641
- [searchDialogConfig.valueSourceField]: row[valueField],
642
- [searchDialogConfig.labelSourceField]: row[vabSearchName]
643
- }
644
- })
645
- }
646
- }
647
-
648
- this.getFormRef().openSearchDialog({
649
- formCode: formCode,
650
- rows,
651
- multiple: searchDialogConfig.multipleChoices || false,
652
- confirm: (rows) => {
653
- this.handleConfirmSearchDialog(rows, false);
654
- /*if(rows.length){
655
- let row = rows[0];
656
- if(this.field.type == "vabsearch"){
657
- let fieldKeyName = this.fieldKeyName;
658
- let vabSearchName = this.field.options.vabSearchName || fieldKeyName;
659
- if(tableParam){
660
- let rowData = tableParam.row;
661
- rowData[fieldKeyName] = row[searchDialogConfig.valueSourceField]
662
- if(searchDialogConfig.labelSourceField)rowData[vabSearchName] = row[searchDialogConfig.labelSourceField]
663
- tableData.forEach(item=>{
664
- rowData[item.targetField] = row[item.sourceField]
665
- })
666
- }else{
667
- this.fieldModel = row[searchDialogConfig.valueSourceField];
668
- if(searchDialogConfig.labelSourceField)this.showValue = row[searchDialogConfig.labelSourceField];
669
- tableData.forEach(item=>{
670
- // formModel[item.targetField] = row[item.sourceField]
671
- this.getWidgetRef(item.targetField).setValue(row[item.sourceField]??null)
672
- })
673
- }
674
- }else{
675
- if(searchDialogConfig.tableEnabled){
676
- if(!searchDialogConfig.tableRef || !tableData.length)return
677
- let addRows = rows.map(rowData=>{
678
- let itemData = {};
679
- tableData.forEach(item=>{
680
- itemData[item.targetField] = rowData[item.sourceField]
681
- })
682
- return itemData;
683
- });
684
- this.getWidgetRef(searchDialogConfig.tableRef).addTableData(addRows,searchDialogConfig.tableUniqueKey);
685
- }
686
- }
687
- }*/
688
- }
689
- });
690
- },
691
- handleClearSearchDialog() {
692
- let clickBindEvent = this.field.options.clickBindEvent;
693
- if (clickBindEvent == '1') {
694
- this.handleConfirmSearchDialog(null, true);
695
- }
696
- },
697
- getMultipleChoices() {
698
- let multipleChoices = this.field.options.multipleChoices
699
- return multipleChoices;
700
- },
701
- handleConfirmSearchDialog(rows, isClear) {
702
- if (!isClear && !rows.length) return;
703
- let tableParam = this.tableParam;
704
- let searchDialogConfig = this.field.options.searchDialogConfig || {};
705
- let formCode = searchDialogConfig.formCode;
706
- let tableData = searchDialogConfig.tableData || [];
707
- let formModel = this.formModel;
708
- let row = rows && rows.length ? rows[0] : null;
709
- let multipleChoices = this.field.options.searchDialogConfig.multipleChoices || false
710
- if (this.field.type == "vabsearch") {
711
- let fieldKeyName = this.fieldKeyName;
712
- let valueField = this.field.options.valueField || fieldKeyName;
713
- let vabSearchName = this.field.options.vabSearchName || fieldKeyName;
714
-
715
- if (tableParam) {
716
- let rowData = tableParam.row;
717
- if (multipleChoices) {
718
- if (isClear) {
719
- rowData[fieldKeyName] = []
720
- } else {
721
- rowData[fieldKeyName] = rows.map(item => {
722
- let newData = {};
723
- newData[valueField] = item[searchDialogConfig.valueSourceField] ?? null;
724
- newData[vabSearchName] = item[searchDialogConfig.labelSourceField] ?? null;
725
- tableData.forEach(item1 => {
726
- newData[item1.targetField] = item[item1.sourceField]
727
- })
728
- return newData
729
- })
730
- }
731
-
732
- } else {
733
- rowData[fieldKeyName] = !isClear ? row[searchDialogConfig.valueSourceField] : null;
734
- if (searchDialogConfig.labelSourceField) rowData[vabSearchName] = !isClear ? row[searchDialogConfig.labelSourceField] : null;
735
- tableData.forEach(item => {
736
- if (!isClear) {
737
- rowData[item.targetField] = row[item.sourceField]
738
- } else {
739
- rowData[item.targetField] = null;
740
- }
741
- })
742
- }
743
-
744
- } else {
745
- this.fieldModel = !isClear ? row[searchDialogConfig.valueSourceField] : null;
746
- if (searchDialogConfig.labelSourceField) {
747
- this.setShowValue(!isClear ? row[searchDialogConfig.labelSourceField] : null);
748
- }
749
- tableData.forEach(item => {
750
- // formModel[item.targetField] = row[item.sourceField]
751
- let value = !isClear ? (row[item.sourceField] ?? null) : null
752
- this.getWidgetRef(item.targetField).setValue(value)
753
- // formModel[item.targetField] = value;
754
- })
755
- // this.$forceUpdate();
756
- }
757
- } else {
758
- if (searchDialogConfig.tableEnabled) {
759
- if (!searchDialogConfig.tableRef || !tableData.length) return
760
- let addRows = rows.map(rowData => {
761
- let itemData = {};
762
- tableData.forEach(item => {
763
- itemData[item.targetField] = rowData[item.sourceField]
764
- })
765
- return itemData;
766
- });
767
- this.getWidgetRef(searchDialogConfig.tableRef).addTableData(addRows, searchDialogConfig.tableUniqueKey);
768
- } else if (!multipleChoices) {
769
- tableData.forEach(item => {
770
- let value = row[item.sourceField] ?? null
771
- // formModel[item.targetField] = value
772
- this.getWidgetRef(item.targetField).setValue(value)
773
- })
774
- // this.$forceUpdate();
775
- }
776
- }
777
- },
778
- remoteQuery: function (e) {
779
- if (this.field.options.onRemoteQuery) {
780
- var t = new Function("keyword", this.field.options.onRemoteQuery);
781
- t.call(this, e);
782
- }
783
- },
784
- getFormRef: function () {
785
- return this.refList ? this.refList["v_form_ref"] : null;
786
- },
787
- getWidgetRef: function (e, t) {
788
- var i = this.refList[e];
789
- return !i && t && this.$message.error(this.i18nt("render.hint.refNotFound") + e),
790
- i;
791
- },
792
- getFieldEditor: function () {
793
- return this.$refs["fieldEditor"];
794
- },
795
- setValue: function (e) {
796
- if (this.field.formItemFlag) {
797
- let value = e ?? null;
798
- var t = baseRefUtil.deepClone(this.fieldModel);
799
- this.fieldModel = value,
800
- this.initFileList(),
801
- this.syncUpdateFormModel(value),
802
- this.emitFieldDataChange(value, t);
803
- }
804
- },
805
- getValue: function () {
806
- return this.fieldModel;
807
- },
808
- resetField: function () {
809
- if (!this.subFormItemFlag) {
810
- var e = this.field.options.defaultValue;
811
- this.setValue(e),
812
- "picture-upload" !== this.field.type && "file-upload" !== this.field.type || (this.$refs[
813
- "fieldEditor"].clearFiles(),
814
- this.fileList.splice(0, this.fileList.length));
815
- }
816
- },
817
- setWidgetOption: function (e, t) {
818
- this.field.options.hasOwnProperty(e) && (this.field.options[e] = t);
819
- },
820
- setReadonly: function (e) {
821
- this.field.options.readonly = e;
822
- },
823
- setDisabled: function (e) {
824
- this.field.options.disabled = e;
825
- },
826
- setAppendButtonVisible: function (e) {
827
- this.field.options.appendButton = e;
828
- },
829
- setAppendButtonDisabled: function (e) {
830
- this.field.options.appendButtonDisabled = e;
831
- },
832
- setHidden: function (e) {
833
- this.field.options.hidden = e,
834
- e ? this.clearFieldRules() : this.buildFieldRules();
835
- },
836
- setRequired: function (e) {
837
- this.field.options.required = e,
838
- this.buildFieldRules();
839
- },
840
- setLabel: function (e) {
841
- this.field.options.label = e;
842
- },
843
- focus: function () {
844
- this.getFieldEditor() && this.getFieldEditor().focus && this.getFieldEditor().focus();
845
- },
846
- clearSelectedOptions: function () {
847
- "checkbox" !== this.field.type && "radio" !== this.field.type && "select" !== this.field.type || (
848
- "checkbox" === this.field.type || "select" === this.field.type && this.field.options.multiple
849
- ? this.fieldModel = [] : this.fieldModel = "");
850
- },
851
- loadOptions: function (e) {
852
- this.field.options.optionItems = baseRefUtil.translateOptionItems(e, this.field.type, this.field.options
853
- .labelKey
854
- || "label", this.field.options.valueKey || "value");
855
- },
856
- reloadOptions: function (e) {
857
- this.field.options.optionItems = baseRefUtil.translateOptionItems(e, this.field.type, this.field.options
858
- .labelKey
859
- || "label", this.field.options.valueKey || "value");
860
- },
861
- getOptions: function () {
862
- return this.field.options.optionItems;
863
- },
864
- disableOption: function (e) {
865
- this.disableOptionOfList(this.field.options.optionItems, e);
866
- },
867
- enableOption: function (e) {
868
- this.enableOptionOfList(this.field.options.optionItems, e);
869
- },
870
- getOptionItems: function () {
871
- return this.field.options.optionItems;
872
- },
873
- setUploadHeader: function (e, t) {
874
- this.$set(this.uploadHeaders, e, t);
875
- },
876
- setUploadData: function (e, t) {
877
- this.$set(this.uploadData, e, t);
878
- },
879
- setToolbar: function (e) {
880
- this.customToolbar = e;
881
- },
882
- isSubFormItem: function () {
883
- return this.subFormItemFlag;
884
- },
885
- isSubFormField: function () {
886
- return this.subFormItemFlag;
887
- },
888
- setReadMode: function () {
889
- var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
890
- this.fieldReadonlyFlag = e;
891
- },
892
- addCssClass: function (e) {
893
- this.field.options.customClass ? this.field.options.customClass.push(e) : this.field.options
894
- .customClass = [e];
895
- },
896
- removeCssClass: function (e) {
897
- if (this.field.options.customClass) {
898
- var t = -1;
899
- this.field.options.customClass.map((function (i, n) {
900
- i === e && (t = n);
901
- })),
902
- t > -1 && this.field.options.customClass.splice(t, 1);
903
- }
904
- },
905
- async initAccess() {
906
- if (this.field.options.accessCode) {
907
- return this.$http({
908
- url: SUPPORT_PREFIX + `/report_requestaccess/getByCode`,
909
- method: `post`,
910
- data: {
911
- stringOne: this.field.options.accessCode
912
- },
913
- isLoading: true,
914
- // modalStrictly: true,
915
- success: res => {
916
- let requestAccess = res.objx || {};
917
-
918
- let dsModel = {};
919
- if (requestAccess.accessViewContent) {
920
- dsModel = JSON.parse(requestAccess.accessViewContent);
921
- }
922
- if (!dsModel.headers) dsModel.headers = [];
923
- if (!dsModel.params) dsModel.params = [];
924
- if (!dsModel.data) dsModel.data = [];
925
- if (dsModel.dataHandlerCode == null) dsModel.dataHandlerCode = '';
926
- if (dsModel.configHandlerCode == null) dsModel.configHandlerCode = '';
927
- if (dsModel.errorHandlerCode == null) dsModel.errorHandlerCode = '';
928
-
929
- requestAccess.dsModel = dsModel;
930
- this.requestAccess = requestAccess;
931
- }
932
- });
933
- } else {
934
- return null;
935
- }
936
- },
937
- addExtraAccessData(data) {
938
- if (data) {
939
- Object.keys(data).forEach(field => {
940
- this.extraAccessData[field] = data[field];
941
- });
942
- }
943
- },
944
- clearExtraAccessData() {
945
- this.extraAccessData = {};
946
- },
947
- doAccess(accessCode, conditions, callback) {
948
- let path = baseRefUtil.getAccessUrl();
949
- let globalReqData = baseRefUtil.getReportGlobalMap(); //全局请求参数
950
- return this.$http({
951
- url: path,
952
- method: `post`,
953
- loadingTarget: document.body,
954
- data: {
955
- accessCode: accessCode,
956
- conditions: {
957
- ...conditions,
958
- ...globalReqData
959
- }
960
- },
961
- isLoading: true,
962
- success: res => {
963
- callback && callback(res)
964
- }
965
- });
966
- },
967
- autoExcScript() {
968
- if (!this.designState && this.field.options.accessAutoExc) {
969
- this.scriptHttp({
970
- options: this.field.options
971
- });
972
- }
973
- },
974
- addInterval(handler, timeout) {
975
- let timer = setInterval(handler, timeout);
976
- this.timerMap[timer] = timer;
977
- return timer;
978
- },
979
- clearAllInterval() {
980
- let timerMap = this.timerMap;
981
- for (let key in timerMap) {
982
- let timer = timerMap[key];
983
- clearInterval(timer);
984
- }
985
- this.timerMap = {};
986
- },
987
- getI18nLabel(label, path, param) {
988
- return !this.designState && label ? this.$t2(label, path, param) : label;
989
- },
990
- getParentTarget() {
991
- let name = this.parentWidget?.options?.name ?? null;
992
- return name ? this.getWidgetRef(name) : null;
993
- }
994
- }
995
- }
996
-
997
- export default modules;
1
+ import {
2
+ deepClone,
3
+ translateOptionItems,
4
+ getDSByName,
5
+ overwriteObj,
6
+ runDataSourceRequest,
7
+ getReportGlobalMap,
8
+ getAccessUrl,
9
+ generateId,
10
+ trim
11
+ } from "../../../../../components/xform/utils/util";
12
+ import FormValidators, {getRegExp} from "../../../../../components/xform/utils/validators";
13
+ import scriptHttpMixin from "../../../../../components/xform/mixins/scriptHttp";
14
+ import defaultHandleMixin from "../../../../../components/xform/mixins/defaultHandle";
15
+
16
+ import {
17
+ fieldIsUsedInFormula, calculateFormula, recalculateFormulaOnSubFormRowDelete,
18
+ } from '@base/components/xform/utils/formula-util'
19
+ import * as formulajs from '@formulajs/formulajs'
20
+ import settingConfig from "@/settings.js";
21
+
22
+ let modules = {};
23
+ const isDev = process.env.NODE_ENV === "development";
24
+ const baseRefUtil = {
25
+ deepClone,
26
+ translateOptionItems,
27
+ getDSByName,
28
+ overwriteObj,
29
+ runDataSourceRequest,
30
+ FormValidators,
31
+ getReportGlobalMap,
32
+ getAccessUrl,
33
+ };
34
+ modules = {
35
+ mixins: [scriptHttpMixin, defaultHandleMixin],
36
+ props: {
37
+ columnConfig: {
38
+ type: Object,
39
+ default: null,
40
+ },
41
+ tableParam: {
42
+ type: Object,
43
+ default: null,
44
+ },
45
+ formItemProp: {
46
+ type: String,
47
+ default: null,
48
+ }
49
+ },
50
+ provide() {
51
+ return {
52
+ tableParam: this.tableParam,
53
+ formItemProp: this.formItemProp,
54
+ };
55
+ },
56
+ inject: [
57
+ "refList",
58
+ "widgetKeyNameMap",
59
+ "getFormConfig",
60
+ "globalOptionData",
61
+ "globalModel",
62
+ "getOptionData",
63
+ "getGlobalDsv",
64
+ "getReadMode",
65
+ "getSubFormFieldFlag",
66
+ "getSubFormName",
67
+ "getReportTemplate",
68
+ "getObjectFieldFlag",
69
+ "getObjectName",
70
+ ],
71
+ data: function () {
72
+ return {
73
+ fieldReadonlyFlag: !1,
74
+ requestAccess: null,
75
+ extraAccessData: {},
76
+ timerMap: {},
77
+
78
+ disabled: false,
79
+ hidden: false,
80
+ readonly: false
81
+ };
82
+ },
83
+ beforeDestroy() {
84
+ this.clearAllInterval();
85
+ },
86
+ created() {
87
+ // this.initFieldAttrs();
88
+ this.initConfig();
89
+ this.initValueWatchEvent();
90
+ if (this.field.options.searchDialogConfig) {
91
+ if (this.field.options.searchDialogConfig.multipleChoices === void 0) {
92
+ if (this.hasVabsearchFlag()) {
93
+ this.$set(
94
+ this.field.options.searchDialogConfig,
95
+ "multipleChoices",
96
+ false
97
+ );
98
+ } else {
99
+ this.$set(
100
+ this.field.options.searchDialogConfig,
101
+ "multipleChoices",
102
+ true
103
+ );
104
+ }
105
+ }
106
+ }
107
+ },
108
+ mounted() {
109
+ },
110
+ /*watch: {
111
+ currentValue(val) {
112
+ this.initFieldModel(true);
113
+ },
114
+ },*/
115
+ computed: {
116
+ /* currentValue() {
117
+ let currentData =
118
+ this.tableParam && this.tableParam.row
119
+ ? this.tableParam.row
120
+ : this.formModel;
121
+ let currentValue = currentData[this.fieldKeyName];
122
+ return currentValue;
123
+ }, */
124
+ formConfig: function () {
125
+ return this.getFormConfig();
126
+ },
127
+ subFormName: function () {
128
+ return this.getSubFormName ? this.getSubFormName() : "";
129
+ },
130
+ subFormItemFlag: function () {
131
+ return !!this.getSubFormFieldFlag && this.getSubFormFieldFlag();
132
+ },
133
+ formModel: {
134
+ cache: !1,
135
+ get: function () {
136
+ return this.globalModel.formModel;
137
+ },
138
+ },
139
+ isReadMode: function () {
140
+ return !!this.getReadMode() || this.fieldReadonlyFlag;
141
+ },
142
+ optionLabel() {
143
+ return this.getOptionLabel();
144
+ },
145
+ tableRow() {
146
+ let tableParam = this.tableParam;
147
+ return tableParam && tableParam.row ? tableParam.row : null;
148
+ },
149
+ fieldKeyName() {
150
+ let o = this.field.options.name;
151
+ return (
152
+ (this.field.options.keyNameEnabled && this.field.options.keyName) || o
153
+ );
154
+ },
155
+ },
156
+ methods: {
157
+ getCurrentValue() {
158
+ let currentData =
159
+ this.tableParam && this.tableParam.row
160
+ ? this.tableParam.row
161
+ : this.formModel;
162
+ let currentValue = currentData[this.fieldKeyName];
163
+ return currentValue;
164
+ },
165
+ setFormScriptEnabled(value){
166
+ this.field.options.formScriptEnabled = value || false
167
+ },
168
+ getOptionLabel(){
169
+ if (this.fieldModel === null) {
170
+ return null
171
+ } else {
172
+ let resultList = []
173
+ let labelField = this.getOptionItemLabelKey();
174
+ let valueField = this.getOptionItemValueKey();
175
+ this.field.options.optionItems.forEach(oItem => {
176
+ if ((oItem[valueField] === this.fieldModel) || (this.findInArray(this.fieldModel, oItem[valueField])) !== -1) {
177
+ resultList.push(this.$t1(oItem[labelField]))
178
+ // resultContent = resultContent === '--' ? oItem.label : resultContent + ' ' + oItem.label
179
+ }
180
+ })
181
+ return resultList.join(",")
182
+ }
183
+ },
184
+ initValueWatchEvent() {
185
+ if (!this.designer) {
186
+ this.$watch(() => {
187
+ let currentData = this.tableParam && this.tableParam.row
188
+ ? this.tableParam.row
189
+ : this.formModel;
190
+ let currentValue = currentData[this.fieldKeyName];
191
+ return currentValue;
192
+ }, (newValue, oldValue) => {
193
+ if (oldValue !== undefined) {
194
+ this.initFieldModel(true);
195
+ }
196
+ })
197
+ }
198
+ },
199
+ initFieldAttrs() {
200
+ this.setDisabled(this.field.options.disabled)
201
+ this.setHidden(this.field.options.hidden)
202
+ this.setReadonly(this.field.options.readonly)
203
+ },
204
+ initConfig() {
205
+ /*if (this.designState) {
206
+ let config = this.designer.getFieldWidgetByType(this.field.type);
207
+ if(config){
208
+ let defaultOptions = config.options;
209
+ let options = this.field.options;
210
+ Object.keys(defaultOptions).forEach(function (k) {
211
+ if (!options.hasOwnProperty(k)) {
212
+ let val = defaultOptions[k]
213
+ if (Array.isArray(val)) {
214
+ options[k] = []
215
+ } else {
216
+ options[k] = null
217
+ }
218
+ }
219
+ })
220
+ }
221
+
222
+ }*/
223
+
224
+ /*this.field.options = Object.assign(
225
+ {},
226
+ config.options,
227
+ this.field.options
228
+ );*/
229
+ },
230
+ findInArray: function (e, t) {
231
+ if (!Array.isArray(e)) return -1;
232
+ let i = -1;
233
+ return (
234
+ e.forEach(function (e, n) {
235
+ e === t && (i = n);
236
+ }),
237
+ i
238
+ );
239
+ },
240
+ getPropName: function () {
241
+ if (this.formItemProp) {
242
+ return this.formItemProp;
243
+ } else {
244
+ return this.subFormItemFlag && !this.designState
245
+ ? this.subFormName +
246
+ "." +
247
+ this.subFormRowIndex +
248
+ "." +
249
+ this.fieldKeyName
250
+ : this.getObjectFieldFlag() && !this.designState
251
+ ? this.getObjectName() + "." + this.fieldKeyName
252
+ : this.fieldKeyName;
253
+ }
254
+ },
255
+ initFieldModel: function (flag) {
256
+ let e = this;
257
+ if (this.field.formItemFlag) {
258
+ let currentData =
259
+ this.tableParam && this.tableParam.row
260
+ ? this.tableParam.row
261
+ : this.formModel;
262
+ /*if (this.subFormItemFlag && !this.designState) {
263
+ let t = currentData[this.subFormName];
264
+ return void 0 !== t && void 0 !== t[this.subFormRowIndex] && void 0 !== t[this.subFormRowIndex][
265
+ this.fieldKeyName
266
+ ] || void 0 === this.field.options.defaultValue ? void 0 === t[this.subFormRowIndex][this
267
+ .fieldKeyName
268
+ ] ? (this.fieldModel = null,
269
+ t[this.subFormRowIndex][this.fieldKeyName] = null) : this.fieldModel = t[this
270
+ .subFormRowIndex][this.fieldKeyName] : (this.fieldModel = this.field.options
271
+ .defaultValue,
272
+ t[this.subFormRowIndex][this.fieldKeyName] = this.field.options.defaultValue),
273
+ setTimeout((function () {
274
+ e.handleOnChangeForSubForm(e.fieldModel, e.oldFieldValue, t, e.subFormRowId)
275
+ }), 800),
276
+ this.oldFieldValue = baseRefUtil.deepClone(this.fieldModel),
277
+ void this.initFileList();
278
+ }*/
279
+
280
+ let defaultValue = this.field.options.defaultValue;
281
+ let dataId = this.getFormRef()?.dataId ?? null;
282
+ let nullValue = null;
283
+ let widgetType = this.field.type;
284
+ if (widgetType === "number") {
285
+ nullValue = undefined;
286
+ } else if (widgetType === 'checkbox' || (widgetType === 'select' && this.field.options.multiple)) {
287
+ nullValue = [];
288
+ } else if (widgetType === "time-range" || widgetType === "date-range" || (widgetType === 'date' && this.field.options.type === "dates")) {
289
+ nullValue = [];
290
+ }
291
+ if (void 0 === currentData[this.fieldKeyName]) {
292
+ this.$set(currentData, this.fieldKeyName, nullValue);
293
+ }
294
+ if (flag) {
295
+ this.fieldModel = currentData[this.fieldKeyName];
296
+ } else if (currentData[this.fieldKeyName] !== null) {
297
+ this.fieldModel = currentData[this.fieldKeyName];
298
+ } else {
299
+ if (!dataId) {
300
+ //新增
301
+ if (!this.designState && this.hasVabsearchFlag() && !this.field.options.multipleChoices) {
302
+ let searchDialogConfig = this.field.options.searchDialogConfig || {};
303
+ if (this.field.options.userDefaultVabSearch) {
304
+ let userInfo = this.getFormRef().getUserInfo();
305
+ let valueSourceField = "id";
306
+ let labelSourceField = "nick_name";
307
+ if (this.field.options.clickBindEvent === "1") {
308
+ if (searchDialogConfig.valueSourceField) valueSourceField = searchDialogConfig.valueSourceField
309
+ if (searchDialogConfig.labelSourceField) labelSourceField = searchDialogConfig.labelSourceField
310
+ }
311
+ this.initValue(userInfo[valueSourceField] ?? null);
312
+ this.setShowValue(userInfo[labelSourceField] ?? null);
313
+ } else if (this.field.options.saleOrgDefaultVabSearch) {
314
+ let saleOrgDTO = this.getFormRef().getDefaultSaleOrgDTO();
315
+ if (saleOrgDTO) {
316
+ let valueSourceField = "id";
317
+ let labelSourceField = "name";
318
+ if (this.field.options.clickBindEvent === "1") {
319
+ if (searchDialogConfig.valueSourceField) valueSourceField = searchDialogConfig.valueSourceField
320
+ if (searchDialogConfig.labelSourceField) labelSourceField = searchDialogConfig.labelSourceField
321
+ }
322
+ this.initValue(saleOrgDTO[valueSourceField] ?? null);
323
+ this.setShowValue(saleOrgDTO[labelSourceField] ?? null);
324
+ }
325
+ }
326
+ }
327
+ if (!this.tableParam) {
328
+ //主表
329
+ if (this.isNotNullVal(defaultValue)) {
330
+ this.initValue(defaultValue);
331
+ }
332
+ } else {
333
+ //明细
334
+ if (!this.tableParam.row.id && this.isNotNullVal(defaultValue)) {
335
+ this.initValue(defaultValue);
336
+ }
337
+ }
338
+ } else {
339
+ //编辑
340
+ if (!this.tableParam) {
341
+ //主表
342
+ } else {
343
+ //明细
344
+ if (!this.tableParam.row.id && this.isNotNullVal(defaultValue)) {
345
+ this.initValue(defaultValue);
346
+ }
347
+ }
348
+ }
349
+ }
350
+
351
+ /*if (this.fieldKeyName === "f_mobile" && !this.fieldModel) {
352
+ }*/
353
+ /*void 0 === currentData[this.fieldKeyName] && void 0 !== this.field.options.defaultValue
354
+ ? this.fieldModel = this.field.options.defaultValue :
355
+ void 0 === currentData[this.fieldKeyName] ? currentData[this.fieldKeyName] = null : this.fieldModel = currentData[this.fieldKeyName];*/
356
+ this.oldFieldValue = baseRefUtil.deepClone(this.fieldModel);
357
+ /*if (this.fieldKeyName === "f_contract" && !this.fieldModel) {
358
+ }*/
359
+ this.initFileList();
360
+ }
361
+ },
362
+ isNotNullVal(val) {
363
+ return val !== null && val !== undefined && val !== "";
364
+ },
365
+ initFileList: function () {
366
+ ("picture-upload" !== this.field.type &&
367
+ "file-upload" !== this.field.type) ||
368
+ !0 === this.designState ||
369
+ (this.fieldModel &&
370
+ (Array.isArray(this.fieldModel)
371
+ ? (this.fileList = baseRefUtil.deepClone(this.fieldModel))
372
+ : this.fileList.splice(
373
+ 0,
374
+ 0,
375
+ baseRefUtil.deepClone(this.fieldModel)
376
+ )));
377
+ },
378
+ handleCreatedEnterEvent() {
379
+ this.handleCustomEvent(this.field.options.onCreatedEnter);
380
+ },
381
+ initEventHandler() {
382
+ this.designState ||
383
+ (this.$on("setFormData", (o) => {
384
+ /*if (!this.subFormItemFlag)
385
+ if (
386
+ !!this.getObjectFieldFlag()
387
+ && !this.designState
388
+ ) {
389
+ const e = this.getObjectModel();
390
+ this.setValue(
391
+ e === void 0
392
+ ? null
393
+ : e[this.fieldKeyName]
394
+ );
395
+ } else this.setValue(o[this.fieldKeyName]);*/
396
+ this.subFormItemFlag || this.setValue(o[this.fieldKeyName]);
397
+ }),
398
+ this.$on("field-value-changed", (o) => {
399
+ if (this.subFormItemFlag) {
400
+ let e = this.formModel[this.subFormName];
401
+ this.handleOnChangeForSubForm(o[0], o[1], e, this.subFormRowId);
402
+ } else this.handleOnChange(o[0], o[1]);
403
+ }),
404
+ /* this.$on("field-value-changed", function (e) {
405
+ if (this.subFormItemFlag) {
406
+ let t = this.formModel[this.subFormName];
407
+ this.handleOnChangeForSubForm(e[0], e[1], t, this.subFormRowId);
408
+ } else this.handleOnChange(e[0], e[1]);
409
+ }), */
410
+ this.$on("sync-field-value", (o) => {
411
+ const e = o[0],
412
+ n = o[1];
413
+ if (
414
+ this.field.options.name === e ||
415
+ (!n && this.field.options.keyName !== e) ||
416
+ (!this.field.options.keyName && this.field.options.name !== n) ||
417
+ (!!this.field.options.keyName &&
418
+ !!n &&
419
+ this.field.options.keyName !== n) ||
420
+ o[5] !== this.getObjectName()
421
+ )
422
+ return;
423
+ const s = o[2],
424
+ c = o[3],
425
+ u = o[4];
426
+ !this.subFormName && !s
427
+ ? this.setValue(u, !0)
428
+ : this.subFormName === s &&
429
+ this.subFormRowId === c &&
430
+ this.setValue(u, !0);
431
+ }),
432
+
433
+ /* 执行计算公式运算 */
434
+ this.$on('calculate-formula', (newValue, sourceWidget) => {
435
+ if (!!this.field.options.formulaEnabled && !!this.field.options.formula) {
436
+ let changedFieldRef = sourceWidget
437
+ const changedFieldName = sourceWidget.field.options.name
438
+ //检查计算公式是否包含当前修改字段
439
+ if (fieldIsUsedInFormula(changedFieldName, this.field.options.formula, this.getFormRef(), this)) {
440
+
441
+ /* 计算公式的计算改成延时执行,否则当子表单开启默认创建新行后,子表单字段的计算公式中使用到主表单字段则会出现计算错误!! */
442
+ //calculateFormula(this.getFormRef(), this.getGlobalDsv(), formulajs, this, changedFieldRef)
443
+
444
+ setTimeout(() => {
445
+ calculateFormula(this.getFormRef(), this.getGlobalDsv(), formulajs, this, changedFieldRef)
446
+ }, 200)
447
+ }
448
+ }
449
+ }),
450
+
451
+ /* 删除子表单行后重新执行计算公式运算 */
452
+ this.$on('calculate-formula-sfRowDeleted', (newValue, deletedFieldName) => {
453
+ if (!!this.field.options.formulaEnabled && !!this.field.options.formula) {
454
+ //检查计算公式是否包含当前修改字段
455
+ if (fieldIsUsedInFormula(deletedFieldName, this.field.options.formula, this.getFormRef())) {
456
+ recalculateFormulaOnSubFormRowDelete(this.getFormRef(), this.getGlobalDsv(), formulajs, this)
457
+ }
458
+ }
459
+ }),
460
+
461
+ this.$on("loadOptionItemsFromDataSet", (o) => {
462
+ this.loadOptionItemsFromDataSet(o), (this.dataSetLoadedFlag = !0);
463
+ }),
464
+ this.$on("reloadOptionItems", (o) => {
465
+ (o.length === 0 || o.indexOf(this.field.options.name) > -1) &&
466
+ this.initOptionItems(!0);
467
+ }));
468
+ },
469
+ getEventParam() {
470
+ let formRef = this.getFormRef();
471
+ let dataId = formRef?.dataId;
472
+ let formCode = formRef?.reportTemplate?.formCode;
473
+ return {
474
+ eventParamNames: ["dataId", "formCode"],
475
+ eventParamValues: [dataId, formCode],
476
+ };
477
+ },
478
+ handleCustomEvent(funtionStr, eventParamNames = [], eventParamValues = []) {
479
+ if (!this.designState && funtionStr) {
480
+ let eventParam = this.getEventParam();
481
+ let e = new Function(
482
+ ...eventParam.eventParamNames,
483
+ ...eventParamNames,
484
+ funtionStr
485
+ );
486
+ let that = this;
487
+ try{
488
+ return e.call(
489
+ this,
490
+ ...eventParam.eventParamValues,
491
+ ...eventParamValues
492
+ );
493
+ }catch(error){
494
+ if(settingConfig.fontErrorTipEnabled){
495
+ that.$errorMsg({
496
+ rmid: that.$t1("前端脚本异常"),
497
+ content: error.message,
498
+ type: 'error',
499
+ _errorMsg: error.stack
500
+ })
501
+ }
502
+ throw error;
503
+ }
504
+ }
505
+ },
506
+ handleOnCreated: function () {
507
+ this.handleCustomEvent(this.field.options.onCreated);
508
+ },
509
+ handleOnMounted: function () {
510
+ this.handleCustomEvent(this.field.options.onMounted);
511
+ this.autoExcScript();
512
+ },
513
+ registerToRefList: function (e) {
514
+ /* null !== this.refList && this.field.options.name && (this.tableParam && !this.designState ? (e
515
+ && delete this.refList[e + "@row" + this.tableParam.rowIndex],
516
+ this.refList[this.field.options.name + "@row" + this.tableParam.rowIndex] = this) : (e
517
+ && delete this.refList[e],
518
+ this.refList[this.field.options.name] = this)); */
519
+ if (null !== this.refList && this.field.options.name) {
520
+ if (this.tableParam && !this.designState) {
521
+ let row = this.tableParam.row;
522
+ if (!row._X_ROW_KEY) {
523
+ row._X_ROW_KEY = "row_" + generateId()
524
+ }
525
+ let keyVal = row._X_ROW_KEY;
526
+ e && delete this.refList[e + "_" + keyVal];
527
+ this.refList[this.field.options.name + "_" + keyVal] = this;
528
+
529
+ /* if (!!e) {
530
+ delete this.refList[e + '_' + this.subFormRowId]
531
+ }
532
+ this.refList[this.field.options.name + '@' + this.subFormRowId] = this
533
+ */
534
+ } else {
535
+ e && delete this.refList[e];
536
+ this.refList[this.field.options.name] = this;
537
+ if (this.widgetKeyNameMap) {
538
+ if (!this.widgetKeyNameMap[this.fieldKeyName]) {
539
+ this.widgetKeyNameMap[this.fieldKeyName] = [this.field.options.name]
540
+ } else {
541
+ this.widgetKeyNameMap[this.fieldKeyName].push(this.field.options.name);
542
+ }
543
+ }
544
+ }
545
+ }
546
+ },
547
+ getTableRef() {
548
+ let tableRef = this.getWidgetRef(this.parentWidget.options.name)
549
+ return tableRef;
550
+ },
551
+ getWidgetRefByTableRow(index, name) {
552
+ let tableRef = this.getTableRef();
553
+ return tableRef.getWidgetRefByTableRow(index, name)
554
+ },
555
+ getWidgetRefByTableParam(param) {
556
+ let tableParam = param || this.tableParam;
557
+ let tableRef = this.getTableRef();
558
+ return tableRef.getWidgetRefByTableParam(tableParam);
559
+ },
560
+ unregisterFromRefList: function () {
561
+ if (null !== this.refList && this.field.options.name) {
562
+ let e = this.field.options.name;
563
+ this.tableParam && !this.designState
564
+ ? delete this.refList[e + "@row" + this.tableParam.rowIndex]
565
+ : delete this.refList[e];
566
+ }
567
+ },
568
+ initOptionItemsHandle() {
569
+ if(this.tableParam){
570
+ if(this.field._syncInited){
571
+ this.handleCustomEvent(
572
+ this.field.options.formScriptSuccess
573
+ );
574
+ }
575
+ return
576
+ }
577
+ this.initGloatOptionItems(true);
578
+ },
579
+ initGloatOptionItems(initFlag) {
580
+ let t = this;
581
+ if (this.designState) {
582
+ return;
583
+ }
584
+
585
+ if (
586
+ this.field.type === "radio" ||
587
+ this.field.type === "checkbox" ||
588
+ this.field.type === "select" ||
589
+ this.field.type === "cascader" ||
590
+ this.field.type === "status"
591
+ ) {
592
+ /* this.field.options.optionItems.forEach(item=>{
593
+ if (!item.hasOwnProperty('disabled')) {
594
+ this.$set(item,"disabled",false)
595
+ }
596
+ }) */
597
+
598
+ let reportTemplate = this.getFormRef().reportTemplate;
599
+ let formCode = reportTemplate.formCode;
600
+ let formScriptEnabled = this.field.options.formScriptEnabled || false;
601
+ let scriptCode = this.field.options.formScriptCode || "getList";
602
+ let tableParam = this.tableParam;
603
+ if (formScriptEnabled) {
604
+ if (initFlag && tableParam) {
605
+ let optionItems = this.getOptionItemsFlag()
606
+ if (optionItems !== undefined) {
607
+ return
608
+ }
609
+ this.setOptionItemsFlag(null)
610
+ }
611
+ let accessParam = this.handleCustomEvent(
612
+ this.field.options.formScriptParam
613
+ );
614
+ return this.formHttp({
615
+ scriptCode: scriptCode,
616
+ data: {
617
+ formCode: formCode,
618
+ formVersion: reportTemplate.formVersion,
619
+ taBm: this.fieldKeyName,
620
+ data: {
621
+ ...accessParam,
622
+ },
623
+ },
624
+ callback: (res) => {
625
+ let rows = res.objx?.records || res.objx || [];
626
+ this.loadGloatOptions(rows, initFlag);
627
+ this.handleCustomEvent(
628
+ this.field.options.formScriptSuccess,
629
+ ["res"],
630
+ [res]
631
+ );
632
+ },
633
+ });
634
+ } else if (this.field.options.commonAttributeEnabled) {
635
+ let commonAttributeCode = this.field.options.commonAttributeCode;
636
+ if (!commonAttributeCode) return;
637
+ if (initFlag && tableParam) {
638
+ let optionItems = this.getOptionItemsFlag();
639
+ if (optionItems !== undefined) {
640
+ return
641
+ }
642
+ this.setOptionItemsFlag(null)
643
+ }
644
+ let accessParam = this.handleCustomEvent(
645
+ this.field.options.formScriptParam
646
+ );
647
+ this.$getBaseDicts({
648
+ code: commonAttributeCode,
649
+ data:{
650
+ ...accessParam
651
+ },
652
+ success: ({dicts, dictMap}) => {
653
+ this.loadGloatOptions(dicts, initFlag);
654
+ this.handleCustomEvent(
655
+ this.field.options.formScriptSuccess,
656
+ ["res"],
657
+ [dicts]
658
+ );
659
+ },
660
+ });
661
+ }
662
+
663
+ return;
664
+ }
665
+ },
666
+ loadGloatOptions: function (e, initFlag) {
667
+ let optionItems = baseRefUtil.translateOptionItems(
668
+ e,
669
+ this.field.type,
670
+ this.getOptionItemLabelKey(),
671
+ this.getOptionItemValueKey()
672
+ );
673
+ // this.field.options.optionItems = optionItems
674
+ this.setOptionItems(optionItems)
675
+ let tableParam = this.tableParam;
676
+ if (tableParam) {
677
+ if (initFlag) {
678
+ this.setOptionItemsFlag(true)
679
+ }
680
+ this.loadTableOtions(optionItems)
681
+ }
682
+ },
683
+ setOptionItems(rows){
684
+ let formScriptEnabledTypes = ['select', 'checkbox', 'radio',"cascader"]
685
+ let widgetType = this.field.type;
686
+ if(formScriptEnabledTypes.includes(widgetType)){
687
+ this.field.options.optionItems = rows || [];
688
+ }else if(widgetType=="status"){
689
+ this.field.options.statusParam = rows || [];
690
+ }
691
+ },
692
+ loadTableOtions(e) {
693
+ let tableParam = this.tableParam;
694
+ if (tableParam) {
695
+ let optionItems = baseRefUtil.translateOptionItems(
696
+ e,
697
+ this.field.type,
698
+ this.getOptionItemLabelKey(),
699
+ this.getOptionItemValueKey()
700
+ );
701
+ let widgetName = this.field.options.name;
702
+ let tableWidgetName = tableParam.column.params.tableWidgetName
703
+ let tableTarget = this.getWidgetRef(tableWidgetName);
704
+ tableTarget.loopHandleWidgetByName(widgetName, (row, widget, target) => {
705
+ widget.options.optionItems = optionItems
706
+ })
707
+ if (tableParam.column.params.widget) {
708
+ if (tableParam.column.params.widget.options.name === widgetName) {
709
+ tableParam.column.params.widget.options.optionItems = optionItems
710
+ }
711
+
712
+ }
713
+ if (tableParam.column.params.editWidget) {
714
+ if (tableParam.column.params.editWidget.options.name === widgetName) {
715
+ tableParam.column.params.editWidget.options.optionItems = optionItems
716
+ }
717
+ }
718
+ if (tableParam.column.params.widgetList?.length) {
719
+ this.loopHandleWidget(tableParam.column.params.widgetList, (item1) => {
720
+ if (item1.options.name === widgetName) {
721
+ item1.options.optionItems = optionItems
722
+ }
723
+ });
724
+ }
725
+
726
+ delete tableParam.column.params[widgetName]
727
+ }
728
+ },
729
+ async initOptionItems(gloatFlag) {
730
+ let t = this;
731
+ if (this.designState) {
732
+ return;
733
+ }
734
+
735
+ if (
736
+ this.field.type === "radio" ||
737
+ this.field.type === "checkbox" ||
738
+ this.field.type === "select" ||
739
+ this.field.type === "cascader"
740
+ ) {
741
+ let reportTemplate = this.getFormRef().reportTemplate;
742
+ let formCode = reportTemplate.formCode;
743
+ let formScriptEnabled = this.field.options.formScriptEnabled || false;
744
+ let scriptCode = this.field.options.formScriptCode || "getList";
745
+ let tableParam = this.tableParam;
746
+ if (formScriptEnabled) {
747
+ let accessParam = this.handleCustomEvent(
748
+ this.field.options.formScriptParam
749
+ );
750
+ return this.formHttp({
751
+ scriptCode: scriptCode,
752
+ data: {
753
+ formCode: formCode,
754
+ formVersion: reportTemplate.formVersion,
755
+ taBm: this.fieldKeyName,
756
+ data: {
757
+ ...accessParam,
758
+ },
759
+ },
760
+ callback: (res) => {
761
+ let rows = res.objx || [];
762
+ this.loadOptions(rows);
763
+ this.handleCustomEvent(
764
+ this.field.options.formScriptSuccess,
765
+ ["res"],
766
+ [res]
767
+ );
768
+ },
769
+ });
770
+ } else if (this.field.options.commonAttributeEnabled) {
771
+ let commonAttributeCode = this.field.options.commonAttributeCode;
772
+ if (!commonAttributeCode) return;
773
+ this.$getBaseDicts({
774
+ code: commonAttributeCode,
775
+ success: ({dicts, dictMap}) => {
776
+ this.loadOptions(dicts);
777
+ this.handleCustomEvent(
778
+ this.field.options.formScriptSuccess,
779
+ ["res"],
780
+ [dicts]
781
+ );
782
+ },
783
+ });
784
+ }
785
+
786
+ return;
787
+ }
788
+ },
789
+ refreshDefaultValue: function () {
790
+ !0 === this.designState &&
791
+ void 0 !== this.field.options.defaultValue &&
792
+ (this.fieldModel = this.field.options.defaultValue);
793
+ },
794
+
795
+ clearFieldRules() {
796
+ if (!this.field.formItemFlag) {
797
+ return
798
+ }
799
+
800
+ this.rules && this.rules.splice(0, this.rules.length) //清空已有
801
+ },
802
+
803
+ getValidateDefaultMsg(labelCode, vldName) {
804
+ let label = this.$t1(labelCode);
805
+ let map = {
806
+ number: "[{label}]包含非数字字符",
807
+ letter: "[{label}]包含非字母字符",
808
+ letterAndNumber: "[{label}]只能输入字母或数字",
809
+ mobilePhone: "[{label}]手机号码格式有误",
810
+ letterStartNumberIncluded: "[{label}]必须以字母开头,可包含数字",
811
+ noChinese: "[{label}]不可输入中文字符",
812
+ chinese: "[{label}]只能输入中文字符",
813
+ email: "[{label}]邮箱格式有误",
814
+ url: "[{label}]URL格式有误",
815
+ required: "[{label}]不能为空"
816
+ }
817
+ let result = null
818
+ let value = map[vldName]
819
+ if (!value) {
820
+ value = "[{label}]invalid value"
821
+ }
822
+ result = this.$t1(value, {label});
823
+ return result
824
+ },
825
+ getValidationHintMsg() {
826
+ let vldName = this.field.options.validation
827
+ if (this.field.options.validationHint) {
828
+ return this.$t1(this.field.options.validationHint)
829
+ } else {
830
+ return this.getValidateDefaultMsg(this.field.options.label, vldName)
831
+ }
832
+ },
833
+ getRequiredHintMsg() {
834
+ if (this.field.options.requiredHint) {
835
+ return this.$t1(this.field.options.requiredHint)
836
+ } else {
837
+ return this.getValidateDefaultMsg(this.field.options.label, "required")
838
+ }
839
+ },
840
+ buildFieldRules() {
841
+ if (!this.field.formItemFlag || this.field.options.hidden) {
842
+ return
843
+ }
844
+
845
+ this.rules.splice(0, this.rules.length) //清空已有
846
+ if (!!this.field.options.required) {
847
+ this.rules.push({
848
+ required: true,
849
+ //trigger: ['blur', 'change'],
850
+ trigger: ['blur'], /* 去掉change事件触发校验,change事件触发时formModel数据尚未更新,导致radio/checkbox必填校验出错!! */
851
+ message: this.getRequiredHintMsg()
852
+ })
853
+ }
854
+
855
+ if (!!this.field.options.validation) {
856
+ let vldName = this.field.options.validation
857
+ if (!!FormValidators[vldName]) {
858
+ this.rules.push({
859
+ validator: FormValidators[vldName],
860
+ trigger: ['blur', 'change'],
861
+ label: this.field.options.label,
862
+ // errorMsg: this.field.options.validationHint
863
+ errorMsg: this.getValidationHintMsg()
864
+ })
865
+ } else {
866
+ this.rules.push({
867
+ validator: FormValidators['regExp'],
868
+ trigger: ['blur', 'change'],
869
+ regExp: vldName,
870
+ label: this.field.options.label,
871
+ // errorMsg: this.field.options.validationHint
872
+ errorMsg: this.getValidationHintMsg()
873
+ })
874
+ }
875
+ }
876
+
877
+ if (!!this.field.options.onValidate) {
878
+ let customFn = (rule, value, callback) => {
879
+ let tmpFunc = new Function('rule', 'value', 'callback', this.field.options.onValidate)
880
+ return tmpFunc.call(this, rule, value, callback)
881
+ }
882
+ this.rules.push({
883
+ validator: customFn,
884
+ trigger: ['blur', 'change'],
885
+ label: this.field.options.label
886
+ })
887
+ }
888
+ },
889
+
890
+ /**
891
+ * 禁用字段值变动触发表单校验
892
+ */
893
+ disableChangeValidate() {
894
+ if (!this.rules) {
895
+ return
896
+ }
897
+
898
+ this.rules.forEach(rule => {
899
+ if (!!rule.trigger) {
900
+ rule.trigger.splice(0, rule.trigger.length)
901
+ }
902
+ })
903
+ },
904
+
905
+ /**
906
+ * 启用字段值变动触发表单校验
907
+ */
908
+ enableChangeValidate() {
909
+ if (!this.rules) {
910
+ return
911
+ }
912
+
913
+ this.rules.forEach(rule => {
914
+ if (!!rule.trigger) {
915
+ rule.trigger.push('blur')
916
+ rule.trigger.push('change')
917
+ }
918
+ })
919
+ },
920
+
921
+ disableOptionOfList(optionList, optionValue) {
922
+ if (!!optionList && (optionList.length > 0)) {
923
+ let valueKey = this.getOptionItemValueKey();
924
+ optionList.forEach(opt => {
925
+ if (opt[valueKey] === optionValue) {
926
+ opt.disabled = true
927
+ }
928
+
929
+ if (opt.children && Array.isArray(opt.children)) {
930
+ this.disableOptionOfList(opt.children, optionValue)
931
+ }
932
+ })
933
+ this.$forceUpdate()
934
+ }
935
+ },
936
+
937
+ enableOptionOfList(optionList, optionValue) {
938
+ if (!!optionList && (optionList.length > 0)) {
939
+ let valueKey = this.getOptionItemValueKey();
940
+ optionList.forEach(opt => {
941
+ if (opt[valueKey] === optionValue) {
942
+ opt.disabled = false
943
+ }
944
+
945
+ if (opt.children && Array.isArray(opt.children)) {
946
+ this.enableOptionOfList(opt.children, optionValue)
947
+ }
948
+ })
949
+ this.$forceUpdate()
950
+ }
951
+ },
952
+
953
+
954
+ emitFieldDataChange(newValue, oldValue) {
955
+ if (this.designState) return
956
+ this.$emit('field-value-changed', [newValue, oldValue])
957
+
958
+ /* 同步更新keyName属性一致的字段组件值!! */
959
+ if (this.field.options.keyNameEnabled) {
960
+ this.getFormRef().broadcast('FieldWidget', 'sync-field-value',
961
+ [this.field.options.name, this.field.options.keyName, this.subFormName, this.subFormRowId,
962
+ newValue, this.getObjectName()])
963
+ } else {
964
+ this.getFormRef().broadcast('FieldWidget', 'sync-field-value',
965
+ [this.field.options.name, this.field.options.name, this.subFormName, this.subFormRowId,
966
+ newValue, this.getObjectName()])
967
+ }
968
+
969
+ if (this.field.type === 'number') {
970
+ this.getFormRef().broadcast('FieldWidget', 'calculate-formula', [newValue, this]) //触发计算公式计算
971
+ }
972
+
973
+ /* 必须用dispatch向指定父组件派发消息!! */
974
+ this.dispatch('VFormRender', 'fieldChange',
975
+ [this.field.options.name, newValue, oldValue, this.subFormName, this.subFormRowIndex])
976
+ },
977
+ syncUpdateFormModel: function (e) {
978
+ if (!this.designState)
979
+ if (this.tableRow) {
980
+ this.tableRow[this.fieldKeyName] = e;
981
+ } else if (this.subFormItemFlag) {
982
+ let t = this.formModel[this.subFormName] || [{}],
983
+ i = t[this.subFormRowIndex];
984
+ i[this.fieldKeyName] = e;
985
+ } else this.formModel[this.fieldKeyName] = e;
986
+ },
987
+ handleChangeEvent: function (e) {
988
+ let widgetType = this.field.type;
989
+ if(widgetType === "select"){
990
+ if(e===""){
991
+ e = this.field.options.multiple? [] : null;
992
+ this.fieldModel = e;
993
+ }
994
+ }else if(widgetType === "number"){
995
+ if(e===undefined){
996
+ e = null;
997
+ this.fieldModel = e;
998
+ }
999
+ }
1000
+
1001
+ this.syncUpdateFormModel(e),
1002
+ this.emitFieldDataChange(e, this.oldFieldValue),
1003
+ (this.oldFieldValue = baseRefUtil.deepClone(e)),
1004
+ this.dispatch("VFormRender", "fieldValidation", [this.getPropName()]);
1005
+ },
1006
+ handleFocusCustomEvent: function (e) {
1007
+ if (
1008
+ ((this.oldFieldValue = baseRefUtil.deepClone(this.fieldModel)),
1009
+ this.field.options.onFocus)
1010
+ ) {
1011
+ let t = new Function("event", this.field.options.onFocus);
1012
+ t.call(this, e);
1013
+ }
1014
+ },
1015
+ handleBlurCustomEvent: function (e) {
1016
+ if (this.field.options.onBlur) {
1017
+ let t = new Function("event", this.field.options.onBlur);
1018
+ t.call(this, e);
1019
+ }
1020
+ },
1021
+ handleInputCustomEvent: function (e) {
1022
+ if (
1023
+ (this.syncUpdateFormModel(e),
1024
+ this.dispatch("VFormRender", "fieldValidation", [this.getPropName()]),
1025
+ this.field.options.onInput)
1026
+ ) {
1027
+ let t = new Function("value", this.field.options.onInput);
1028
+ t.call(this, e);
1029
+ }
1030
+ },
1031
+ emitAppendButtonClick: function () {
1032
+ if (!this.designState) {
1033
+ if (this.field.options.onAppendButtonClick) {
1034
+ let tableParam = this.tableParam;
1035
+ let eventParamNames = [];
1036
+ let eventParamValues = [];
1037
+ if (tableParam) {
1038
+ eventParamNames = ["rowData", "rowIndex"];
1039
+ eventParamValues = [tableParam.row, tableParam.rowIndex];
1040
+ }
1041
+
1042
+ this.handleCustomEvent(
1043
+ this.field.options.onAppendButtonClick,
1044
+ eventParamNames,
1045
+ eventParamValues
1046
+ );
1047
+
1048
+ // this.handleCustomEvent(this.field.options.onAppendButtonClick)
1049
+ } else {
1050
+ this.dispatch("VFormRender", "appendButtonClick", [this]);
1051
+ }
1052
+ this.handleCustomClickEvent();
1053
+ }
1054
+ },
1055
+ handleCustomClickEvent: function (flag) {
1056
+ let tableParam = this.tableParam;
1057
+ let clickBindEvent = !flag ? this.field.options.clickBindEvent : this.field.options.widgetTextLinkConfig?.options?.clickBindEvent;
1058
+
1059
+ const done = () => {
1060
+ if (clickBindEvent === "1") {
1061
+ //打开选择弹框
1062
+ this.openSearchDialog(tableParam, flag);
1063
+ } else if (clickBindEvent === "2") {
1064
+ //列表插入数据
1065
+ this.handleAddTableDataEvent(flag);
1066
+ }
1067
+ }
1068
+ if (clickBindEvent && this.field.options.onBeforeClickButton) {
1069
+ if (this.handleCustomEvent(this.field.options.onBeforeClickButton, ["done"], [done]) !== false) {
1070
+ done();
1071
+ }
1072
+ } else {
1073
+ done();
1074
+ }
1075
+ },
1076
+ handleAddTableDataEvent(flag) {
1077
+ let optionModel = !flag ? this.field.options : (this.field.options.widgetTextLinkConfig?.options || {});
1078
+
1079
+ let addTableDataConfig = optionModel.addTableDataConfig || {};
1080
+ if (!addTableDataConfig.tableRef) return;
1081
+ let tableData = addTableDataConfig.tableData || {};
1082
+ this.getWidgetRef(addTableDataConfig.tableRef).addTableData([tableData]);
1083
+ },
1084
+ handleOnChange: function (e, t) {
1085
+ if (this.field.options.onChange) {
1086
+ let i = new Function("value", "oldValue", this.field.options.onChange);
1087
+ i.call(this, e, t);
1088
+ }
1089
+ },
1090
+ handleOnChangeForSubForm: function (e, t, i, n) {
1091
+ if (this.field.options.onChange) {
1092
+ let o = new Function(
1093
+ "value",
1094
+ "oldValue",
1095
+ "subFormData",
1096
+ "rowId",
1097
+ this.field.options.onChange
1098
+ );
1099
+ o.call(this, e, t, i, n);
1100
+ }
1101
+ },
1102
+ handleButtonWidgetClick: function (event, flag) {
1103
+ if (!this.designState) {
1104
+ let onClick = !flag ? this.field.options.onClick : this.field.options.widgetTextLinkConfig?.options?.onClick
1105
+ if (onClick) {
1106
+ let tableParam = this.tableParam;
1107
+ let eventParamNames = ["event"];
1108
+ let eventParamValues = [event];
1109
+ if (tableParam) {
1110
+ eventParamNames = ["row", "rowIndex", "event"];
1111
+ eventParamValues = [tableParam.row, tableParam.rowIndex, event];
1112
+ }
1113
+ this.handleCustomEvent(
1114
+ onClick,
1115
+ eventParamNames,
1116
+ eventParamValues
1117
+ );
1118
+ } else {
1119
+ if (!flag) this.dispatch("VFormRender", "buttonClick", [this]);
1120
+ }
1121
+ this.handleCustomClickEvent(flag);
1122
+ }
1123
+ },
1124
+ getSearchDialogSourceField(targetField) {
1125
+ let searchDialogConfig = this.field.options.searchDialogConfig || {};
1126
+ let tableData = searchDialogConfig.tableData || [];
1127
+ },
1128
+ openSearchDialog(tableParam, flag) {
1129
+ let optionModel = !flag ? this.field.options : (this.field.options.widgetTextLinkConfig?.options || {});
1130
+ let searchDialogConfig = optionModel.searchDialogConfig || {};
1131
+ let formCode = searchDialogConfig.formCode;
1132
+ let tableData = searchDialogConfig.tableData || [];
1133
+ let formModel = this.formModel;
1134
+
1135
+ let rows = [];
1136
+ if (this.hasVabsearchFlag()) {
1137
+ if (this.field.options.multipleChoices) {
1138
+ let fieldKeyName = this.fieldKeyName;
1139
+ let valueField = trim(this.field.options.valueField || fieldKeyName);
1140
+ let vabSearchName = trim(this.field.options.vabSearchName || fieldKeyName);
1141
+ let valueSourceField = trim(searchDialogConfig.valueSourceField)
1142
+ let labelSourceField = trim(searchDialogConfig.labelSourceField)
1143
+
1144
+ rows = (this.fieldModel || []).map((row) => {
1145
+ return {
1146
+ [valueSourceField]: row[valueField],
1147
+ [labelSourceField]: row[vabSearchName],
1148
+ };
1149
+ });
1150
+ }
1151
+ }
1152
+
1153
+ // dialogQueryParam.
1154
+ let queryParam = null;
1155
+ if (searchDialogConfig.dialogQueryParam) {
1156
+ queryParam = this.handleCustomEvent(searchDialogConfig.dialogQueryParam)
1157
+ }
1158
+ let dialogCustomParam = {};
1159
+ if (searchDialogConfig.dialogCustomParam) {
1160
+ dialogCustomParam = this.handleCustomEvent(searchDialogConfig.dialogCustomParam) || {}
1161
+ }
1162
+ let dialogParam = Object.assign({
1163
+ formCode: formCode,
1164
+ rows,
1165
+ queryParam,
1166
+ multiple: searchDialogConfig.multipleChoices || false,
1167
+ confirm: (rows) => {
1168
+ this.handleConfirmSearchDialog(rows, false, flag);
1169
+ },
1170
+ },dialogCustomParam)
1171
+ this.getFormRef().openSearchDialog(dialogParam);
1172
+ },
1173
+ handleClearSearchDialog() {
1174
+ let clickBindEvent = this.field.options.clickBindEvent;
1175
+ if (clickBindEvent === "1") {
1176
+ this.handleConfirmSearchDialog(null, true);
1177
+ }
1178
+ },
1179
+ getMultipleChoices() {
1180
+ let multipleChoices = this.field.options.multipleChoices;
1181
+ return multipleChoices;
1182
+ },
1183
+ hasVabsearchFlag() {
1184
+ return this.field.type === "vabsearch" || this.field.type === "singerSearch" || this.field.type === "multiSearch"
1185
+ },
1186
+ handleConfirmSearchDialog(rows, isClear, flag) {
1187
+ if (!isClear && !rows.length) return;
1188
+ let optionModel = !flag ? this.field.options : (this.field.options.widgetTextLinkConfig?.options || {});
1189
+
1190
+ let tableParam = this.tableParam;
1191
+ let searchDialogConfig = optionModel.searchDialogConfig || {};
1192
+ let formCode = searchDialogConfig.formCode;
1193
+ let tableData = searchDialogConfig.tableData || [];
1194
+ let formModel = this.formModel;
1195
+ let row = rows && rows.length ? rows[0] : null;
1196
+ let multipleChoices =
1197
+ optionModel.searchDialogConfig.multipleChoices || false;
1198
+
1199
+ let valueSourceField = trim(searchDialogConfig.valueSourceField)
1200
+ let labelSourceField = trim(searchDialogConfig.labelSourceField)
1201
+ if (this.hasVabsearchFlag()) {
1202
+ let fieldKeyName = this.fieldKeyName;
1203
+ let valueField = trim(this.field.options.valueField || fieldKeyName);
1204
+ let vabSearchName = trim(this.field.options.vabSearchName || fieldKeyName);
1205
+ if (tableParam) {
1206
+ let rowData = tableParam.row;
1207
+ if (this.getMultipleChoices()) {
1208
+ if (isClear) {
1209
+ rowData[fieldKeyName] = [];
1210
+ } else {
1211
+ rowData[fieldKeyName] = rows.map((item) => {
1212
+ let newData = {};
1213
+ newData[valueField] =
1214
+ item[valueSourceField] ?? null;
1215
+ newData[vabSearchName] =
1216
+ item[labelSourceField] ?? null;
1217
+ tableData.forEach((item1) => {
1218
+ let targetFormField = trim(item1.targetFormField || item1.targetField)
1219
+ let sourceField = trim(item1.sourceField)
1220
+ newData[targetFormField] = item[sourceField];
1221
+ });
1222
+ return newData;
1223
+ });
1224
+ }
1225
+ } else {
1226
+ rowData[fieldKeyName] = !isClear
1227
+ ? row[valueSourceField]
1228
+ : null;
1229
+ if (labelSourceField)
1230
+ rowData[vabSearchName] = !isClear
1231
+ ? row[labelSourceField]
1232
+ : null;
1233
+ tableData.forEach((item) => {
1234
+ let targetFormField = trim(item.targetFormField || item.targetField);
1235
+ let sourceField = trim(item.sourceField)
1236
+ if (!isClear) {
1237
+ rowData[targetFormField] = row[sourceField];
1238
+ } else {
1239
+ rowData[targetFormField] = null;
1240
+ }
1241
+ });
1242
+ }
1243
+ } else {
1244
+ if (this.getMultipleChoices()) {
1245
+ let rowData = [];
1246
+ if (isClear) {
1247
+ rowData = [];
1248
+ } else {
1249
+ rowData = rows.map((item) => {
1250
+ let newData = {};
1251
+ newData[valueField] =
1252
+ item[valueSourceField] ?? null;
1253
+ newData[vabSearchName] =
1254
+ item[labelSourceField] ?? null;
1255
+ tableData.forEach((item1) => {
1256
+ let targetFormField = trim(item1.targetFormField || item1.targetField)
1257
+ let sourceField = trim(item1.sourceField)
1258
+ newData[targetFormField] = item[sourceField];
1259
+ });
1260
+ return newData;
1261
+ });
1262
+ }
1263
+ this.setValue(rowData);
1264
+ } else {
1265
+ /* this.fieldModel = !isClear
1266
+ ? row[valueSourceField]
1267
+ : null; */
1268
+ let value = !isClear
1269
+ ? row[valueSourceField]
1270
+ : null
1271
+ this.setValue(value)
1272
+ if (labelSourceField) {
1273
+ this.setShowValue(
1274
+ !isClear ? row[labelSourceField] : null
1275
+ );
1276
+ }
1277
+ tableData.forEach((item) => {
1278
+ // formModel[item.targetField] = row[item.sourceField]
1279
+ let value = !isClear ? row[item.sourceField] ?? null : null;
1280
+ let targetField = trim(item.targetField)
1281
+ let targetFormField = trim(item.targetFormField)
1282
+ if (targetField) {
1283
+ this.getWidgetRef(targetField).setValue(value);
1284
+ } else if (targetFormField) {
1285
+ formModel[targetFormField] = value;
1286
+ }
1287
+ });
1288
+ }
1289
+ }
1290
+ } else {
1291
+ if (searchDialogConfig.tableEnabled) {
1292
+ if (!searchDialogConfig.tableRef || !tableData.length) return;
1293
+ let addRows = rows.map((rowData) => {
1294
+ let itemData = {};
1295
+ tableData.forEach((item) => {
1296
+ let targetFormField = trim(item.targetFormField || item.targetField);
1297
+ let sourceField = trim(item.sourceField)
1298
+ itemData[targetFormField] = rowData[sourceField];
1299
+ });
1300
+ return itemData;
1301
+ });
1302
+ let tableUniqueKey = trim(searchDialogConfig.tableUniqueKey);
1303
+ this.getWidgetRef(searchDialogConfig.tableRef).addTableData(
1304
+ addRows,
1305
+ tableUniqueKey
1306
+ );
1307
+ } else if (!multipleChoices) {
1308
+ tableData.forEach((item) => {
1309
+ let value = row[item.sourceField] ?? null;
1310
+ // formModel[item.targetField] = value
1311
+ // this.getWidgetRef(item.targetField).setValue(value);
1312
+ let targetField = trim(item.targetField)
1313
+ let targetFormField = trim(item.targetFormField)
1314
+ if (targetField) {
1315
+ this.getWidgetRef(targetField).setValue(value);
1316
+ } else if (targetFormField) {
1317
+ formModel[targetFormField] = value;
1318
+ }
1319
+
1320
+
1321
+ });
1322
+ // this.$forceUpdate();
1323
+ }
1324
+ }
1325
+
1326
+ if (!isClear) {
1327
+ this.$nextTick(() => {
1328
+ this.handleCustomEvent(
1329
+ searchDialogConfig.confirmCallback,
1330
+ ["rows"],
1331
+ [rows]
1332
+ );
1333
+ });
1334
+ }
1335
+ },
1336
+ remoteQuery: function (e) {
1337
+ if (this.field.options.onRemoteQuery) {
1338
+ let t = new Function("keyword", this.field.options.onRemoteQuery);
1339
+ t.call(this, e);
1340
+ }
1341
+ },
1342
+ getFormRef: function () {
1343
+ return this.refList ? this.refList["v_form_ref"] : null;
1344
+ },
1345
+ getWidgetRef: function (e, t) {
1346
+ let i = this.refList[e];
1347
+ return (
1348
+ !i &&
1349
+ t &&
1350
+ this.$message.error(this.i18nt("render.hint.refNotFound") + e),
1351
+ i
1352
+ );
1353
+ },
1354
+ getFieldEditor: function () {
1355
+ return this.$refs["fieldEditor"];
1356
+ },
1357
+ initValue: function (e) {
1358
+ let value = e ?? null;
1359
+ let currentData =
1360
+ this.tableParam && this.tableParam.row
1361
+ ? this.tableParam.row
1362
+ : this.formModel;
1363
+ if (void 0 === currentData[this.fieldKeyName]) {
1364
+ this.$set(currentData, this.fieldKeyName, null);
1365
+ }
1366
+ this.fieldModel = value;
1367
+ this.initFileList();
1368
+ this.syncUpdateFormModel(value);
1369
+ },
1370
+ setValue: function (e) {
1371
+ if (this.field.formItemFlag) {
1372
+ let value = e ?? null;
1373
+
1374
+ let currentData =
1375
+ this.tableParam && this.tableParam.row
1376
+ ? this.tableParam.row
1377
+ : this.formModel;
1378
+ if (void 0 === currentData[this.fieldKeyName]) {
1379
+ this.$set(currentData, this.fieldKeyName, null);
1380
+ }
1381
+
1382
+ let t = baseRefUtil.deepClone(this.fieldModel);
1383
+ (this.fieldModel = value),
1384
+ this.initFileList(),
1385
+ this.syncUpdateFormModel(value),
1386
+ this.emitFieldDataChange(value, t);
1387
+ }
1388
+ },
1389
+ getValue: function () {
1390
+ return this.fieldModel;
1391
+ },
1392
+ resetField: function () {
1393
+ if (!this.subFormItemFlag) {
1394
+ let e = this.field.options.defaultValue;
1395
+ this.setValue(e),
1396
+ ("picture-upload" !== this.field.type &&
1397
+ "file-upload" !== this.field.type) ||
1398
+ (this.$refs["fieldEditor"].clearFiles(),
1399
+ this.fileList.splice(0, this.fileList.length));
1400
+ }
1401
+ },
1402
+ setWidgetOption: function (e, t) {
1403
+ this.field.options.hasOwnProperty(e) && (this.field.options[e] = t);
1404
+ },
1405
+ setReadonly: function (e) {
1406
+ this.field.options.readonly = e;
1407
+ this.readonly = e;
1408
+ },
1409
+ setDisabled: function (e) {
1410
+ this.field.options.disabled = e;
1411
+ this.disabled = e;
1412
+ },
1413
+ setAppendButtonVisible: function (e) {
1414
+ this.field.options.appendButton = e;
1415
+ },
1416
+ setAppendButtonDisabled: function (e) {
1417
+ this.field.options.appendButtonDisabled = e;
1418
+ },
1419
+ setHidden: function (e) {
1420
+ this.field.options.hidden = e;
1421
+ this.hidden = e;
1422
+ e ? this.clearFieldRules() : this.buildFieldRules();
1423
+ },
1424
+ setRequired: function (e) {
1425
+ (this.field.options.required = e), this.buildFieldRules();
1426
+ },
1427
+ setLabel: function (e) {
1428
+ this.field.options.label = e;
1429
+ },
1430
+ focus: function () {
1431
+ this.getFieldEditor() &&
1432
+ this.getFieldEditor().focus &&
1433
+ this.getFieldEditor().focus();
1434
+ },
1435
+ clearSelectedOptions: function () {
1436
+ ("checkbox" !== this.field.type &&
1437
+ "radio" !== this.field.type &&
1438
+ "select" !== this.field.type) ||
1439
+ ("checkbox" === this.field.type ||
1440
+ ("select" === this.field.type && this.field.options.multiple)
1441
+ ? (this.fieldModel = [])
1442
+ : (this.fieldModel = ""));
1443
+ },
1444
+ getOptionItemValueKey(){
1445
+ return this.field.options.valueKey || "value"
1446
+ },
1447
+ getOptionItemLabelKey(){
1448
+ return this.field.options.labelKey || "label"
1449
+ },
1450
+ loadRowGloatOptions: function (e) {
1451
+ let optionItems = baseRefUtil.translateOptionItems(
1452
+ e,
1453
+ this.field.type,
1454
+ this.getOptionItemLabelKey(),
1455
+ this.getOptionItemValueKey()()
1456
+ );
1457
+ // this.field.options.optionItems = optionItems
1458
+ this.setOptionItems(optionItems)
1459
+ },
1460
+ loadOptions: function (e, rowOptionFlag) {
1461
+ let optionItems = baseRefUtil.translateOptionItems(
1462
+ e,
1463
+ this.field.type,
1464
+ this.getOptionItemLabelKey(),
1465
+ this.getOptionItemValueKey()
1466
+ );
1467
+ // this.field.options.optionItems = optionItems
1468
+ this.setOptionItems(optionItems)
1469
+ },
1470
+ getOptionKey() {
1471
+ let key = "optionItems-" + this.field.options.name
1472
+ return key;
1473
+ },
1474
+ getOptionItemsFlag: function () {
1475
+ let key = this.getOptionKey()
1476
+ return this.getGlobalParam(key);
1477
+ },
1478
+ setOptionItemsFlag: function (flag) {
1479
+ let key = this.getOptionKey()
1480
+ return this.setGlobalParam(key, flag);
1481
+ },
1482
+ reloadOptions: function (e) {
1483
+ let optionItems = baseRefUtil.translateOptionItems(
1484
+ e,
1485
+ this.field.type,
1486
+ this.getOptionItemLabelKey(),
1487
+ this.getOptionItemValueKey()
1488
+ );
1489
+ // this.field.options.optionItems = optionItems;
1490
+ this.setOptionItems(optionItems)
1491
+ },
1492
+ getOptions: function () {
1493
+ return this.getOptionItems();
1494
+ },
1495
+ disableOption: function (e) {
1496
+ this.disableOptionOfList(this.getOptionItems(), e);
1497
+ },
1498
+ enableOption: function (e) {
1499
+ this.enableOptionOfList(this.getOptionItems(), e);
1500
+ },
1501
+ getOptionItems: function () {
1502
+ let optionItems = this.field.options.optionItems;
1503
+ return optionItems;
1504
+ },
1505
+ setUploadHeader: function (e, t) {
1506
+ this.$set(this.uploadHeaders, e, t);
1507
+ },
1508
+ setUploadData: function (e, t) {
1509
+ this.$set(this.uploadData, e, t);
1510
+ },
1511
+ setToolbar: function (e) {
1512
+ this.customToolbar = e;
1513
+ },
1514
+ isSubFormItem: function () {
1515
+ return this.subFormItemFlag;
1516
+ },
1517
+ isSubFormField: function () {
1518
+ return this.subFormItemFlag;
1519
+ },
1520
+ setReadMode: function () {
1521
+ let e =
1522
+ !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
1523
+ this.fieldReadonlyFlag = e;
1524
+ },
1525
+ addCssClass: function (e) {
1526
+ this.field.options.customClass
1527
+ ? this.field.options.customClass.push(e)
1528
+ : (this.field.options.customClass = [e]);
1529
+ },
1530
+ removeCssClass: function (e) {
1531
+ if (this.field.options.customClass) {
1532
+ let t = -1;
1533
+ this.field.options.customClass.map(function (i, n) {
1534
+ i === e && (t = n);
1535
+ }),
1536
+ t > -1 && this.field.options.customClass.splice(t, 1);
1537
+ }
1538
+ },
1539
+ async initAccess() {
1540
+ if (this.field.options.accessCode) {
1541
+ return this.$http({
1542
+ url: SUPPORT_PREFIX + `/report_requestaccess/getByCode`,
1543
+ method: `post`,
1544
+ data: {
1545
+ stringOne: this.field.options.accessCode,
1546
+ },
1547
+ isLoading: true,
1548
+ // modalStrictly: true,
1549
+ success: (res) => {
1550
+ let requestAccess = res.objx || {};
1551
+
1552
+ let dsModel = {};
1553
+ if (requestAccess.accessViewContent) {
1554
+ dsModel = JSON.parse(requestAccess.accessViewContent);
1555
+ }
1556
+ if (!dsModel.headers) dsModel.headers = [];
1557
+ if (!dsModel.params) dsModel.params = [];
1558
+ if (!dsModel.data) dsModel.data = [];
1559
+ if (dsModel.dataHandlerCode === null || dsModel.dataHandlerCode === undefined) dsModel.dataHandlerCode = "";
1560
+ if (dsModel.configHandlerCode === null || dsModel.configHandlerCode === undefined)
1561
+ dsModel.configHandlerCode = "";
1562
+ if (dsModel.errorHandlerCode === null || dsModel.errorHandlerCode === undefined) dsModel.errorHandlerCode = "";
1563
+
1564
+ requestAccess.dsModel = dsModel;
1565
+ this.requestAccess = requestAccess;
1566
+ },
1567
+ });
1568
+ } else {
1569
+ return null;
1570
+ }
1571
+ },
1572
+ addExtraAccessData(data) {
1573
+ if (data) {
1574
+ Object.keys(data).forEach((field) => {
1575
+ this.extraAccessData[field] = data[field];
1576
+ });
1577
+ }
1578
+ },
1579
+ clearExtraAccessData() {
1580
+ this.extraAccessData = {};
1581
+ },
1582
+ doAccess(accessCode, conditions, callback) {
1583
+ let path = baseRefUtil.getAccessUrl();
1584
+ let globalReqData = baseRefUtil.getReportGlobalMap(); //全局请求参数
1585
+ return this.$http({
1586
+ url: path,
1587
+ method: `post`,
1588
+ loadingTarget: document.body,
1589
+ data: {
1590
+ accessCode: accessCode,
1591
+ conditions: {
1592
+ ...conditions,
1593
+ ...globalReqData,
1594
+ },
1595
+ },
1596
+ isLoading: true,
1597
+ success: (res) => {
1598
+ callback && callback(res);
1599
+ },
1600
+ });
1601
+ },
1602
+ autoExcScript() {
1603
+ if (!this.designState && this.field.options.accessAutoExc) {
1604
+ this.scriptHttp({
1605
+ options: this.field.options,
1606
+ });
1607
+ }
1608
+ },
1609
+ addInterval(handler, timeout) {
1610
+ let timer = setInterval(handler, timeout);
1611
+ this.timerMap[timer] = timer;
1612
+ return timer;
1613
+ },
1614
+ clearAllInterval() {
1615
+ let timerMap = this.timerMap;
1616
+ for (let key in timerMap) {
1617
+ let timer = timerMap[key];
1618
+ clearInterval(timer);
1619
+ }
1620
+ this.timerMap = {};
1621
+ },
1622
+ getI18nLabel(label, path, param) {
1623
+ return !this.designState && label ? this.$t2(label, path, param) : label;
1624
+ },
1625
+ getParentTarget() {
1626
+ let name = this.parentWidget?.options?.name ?? null;
1627
+ return name ? this.getWidgetRef(name) : null;
1628
+ },
1629
+ setWidgetTextFlag(val) {
1630
+ this.widgetTextFlag = val;
1631
+ },
1632
+ showWidget() {
1633
+ this.widgetTextFlag = 0;
1634
+ },
1635
+ showText() {
1636
+ this.widgetTextFlag = 1;
1637
+ },
1638
+ showEncryptText() {
1639
+ this.widgetTextFlag = 2;
1640
+ },
1641
+ showAText() {
1642
+ this.widgetTextFlag = 3;
1643
+ },
1644
+ getAuthCode(){
1645
+ let formRef = this.getFormRef();
1646
+ if(formRef){
1647
+ return formRef.reportTemplate.formCode + ":" + this.field.options.name;
1648
+ }
1649
+
1650
+ }
1651
+ },
1652
+ };
1653
+
1654
+ export default modules;