cloud-web-corejs 1.0.281 → 1.1.0-dev.11

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 (175) hide show
  1. package/package.json +6 -2
  2. package/src/components/VabUpload/image-viewer.vue +442 -442
  3. package/src/components/VabUpload/index.vue +45 -3
  4. package/src/components/VabUpload/mixins.js +126 -19
  5. package/src/components/VabUpload/view.vue +248 -209
  6. package/src/components/baseTabs/mixins.js +181 -181
  7. package/src/components/bizTab/BizBillActions.vue +129 -0
  8. package/src/components/bizTab/BizTabListPage.vue +391 -0
  9. package/src/components/bizTab/README.md +378 -0
  10. package/src/components/bizTab/billTableUtil.js +48 -0
  11. package/src/components/bizTab/billValidators.js +136 -0
  12. package/src/components/bizTab/bizBillDetailMixin.js +705 -0
  13. package/src/components/bizTab/index.js +24 -0
  14. package/src/components/excelExport/exportFieldDialog.vue +23 -12
  15. package/src/components/excelExport/exportItemConfigUtil.js +30 -0
  16. package/src/components/excelExport/mixins.js +3 -3
  17. package/src/components/excelImport/index.vue +156 -156
  18. package/src/components/jsonImport/index.vue +1 -1
  19. package/src/components/langImport/index.vue +1 -1
  20. package/src/components/mobile/statusTag/mixins.js +1 -61
  21. package/src/components/mobile/wf/addTaskUserdialog.vue +23 -3
  22. package/src/components/mobile/wf/content.vue +1705 -1556
  23. package/src/components/mobile/wf/deleteTaskUserDialog.vue +22 -3
  24. package/src/components/mobile/wf/mixins/wfModifyDialogMixin.js +8 -6
  25. package/src/components/mobile/wf/selectUserDialog.vue +118 -0
  26. package/src/components/mobile/wf/setCandidateDialog.vue +25 -4
  27. package/src/components/mobile/wf/urgingDialog.vue +26 -3
  28. package/src/components/mobile/wf/wfModifyDialog.vue +4 -0
  29. package/src/components/obsUpload/index.vue +1 -1
  30. package/src/components/table/config.js +78 -78
  31. package/src/components/table/index.js +1276 -1276
  32. package/src/components/table/plugins/cell-area/index.js +1055 -0
  33. package/src/components/table/plugins/cell-area/index.scss +77 -0
  34. package/src/components/table/plugins/cell-area/util.js +224 -0
  35. package/src/components/table/tableForm.vue +330 -330
  36. package/src/components/table/tableFormMixin.js +318 -318
  37. package/src/components/table/vxeFilter/index.js +163 -163
  38. package/src/components/table/vxeFilter/mixin.js +316 -316
  39. package/src/components/wf/content.vue +1188 -1188
  40. package/src/components/wf/wf.js +40 -20
  41. package/src/components/wf/wfActionDropdown.vue +1 -1
  42. package/src/components/wf/wfActionItems.js +1 -1
  43. package/src/components/xform/form-designer/designer.js +51 -52
  44. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +269 -269
  45. package/src/components/xform/form-designer/form-widget/container-widget/detail-h5-widget.vue +18 -2
  46. package/src/components/xform/form-designer/form-widget/container-widget/detail-temp-widget.vue +132 -0
  47. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +250 -250
  48. package/src/components/xform/form-designer/form-widget/container-widget/h5-card-pane-widget.vue +23 -2
  49. package/src/components/xform/form-designer/form-widget/container-widget/h5-card-widget.vue +30 -1
  50. package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +319 -320
  51. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +365 -365
  52. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +185 -185
  53. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +554 -555
  54. package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +409 -409
  55. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +150 -132
  56. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +114 -114
  57. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +154 -154
  58. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +47 -1
  59. package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +178 -178
  60. package/src/components/xform/form-designer/form-widget/field-widget/mixins/time-limit-mixin.js +77 -77
  61. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +6 -0
  62. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +139 -139
  63. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +1 -1
  64. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +106 -106
  65. package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +134 -134
  66. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +3 -2
  67. package/src/components/xform/form-designer/indexMixin.js +35 -1
  68. package/src/components/xform/form-designer/setting-panel/form-setting.vue +39 -39
  69. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +10 -10
  70. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +438 -432
  71. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +2103 -2103
  72. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-temp-edito.vue +90 -0
  73. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +82 -82
  74. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +833 -846
  75. package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +8 -8
  76. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +137 -137
  77. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +237 -237
  78. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +43 -43
  79. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +43 -43
  80. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +96 -96
  81. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +51 -0
  82. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +42 -42
  83. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +43 -43
  84. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +158 -158
  85. package/src/components/xform/form-designer/setting-panel/property-editor/h5Span-editor.vue +51 -0
  86. package/src/components/xform/form-designer/setting-panel/property-editor/itemStyle-editor.vue +39 -0
  87. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +188 -188
  88. package/src/components/xform/form-designer/setting-panel/property-editor/styleTempClass-editor.vue +51 -0
  89. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +347 -347
  90. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +12 -0
  91. package/src/components/xform/form-designer/toolbar-panel/index.vue +884 -874
  92. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +14 -0
  93. package/src/components/xform/form-designer/widget-panel/index.vue +11 -7
  94. package/src/components/xform/form-designer/widget-panel/indexMixin.js +30 -6
  95. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +112 -4
  96. package/src/components/xform/form-render/container-item/data-table-mixin.js +151 -93
  97. package/src/components/xform/form-render/container-item/detail-h5-item.vue +204 -34
  98. package/src/components/xform/form-render/container-item/detail-temp-item.vue +110 -0
  99. package/src/components/xform/form-render/container-item/h5-card-pane-item.vue +160 -140
  100. package/src/components/xform/form-render/container-item/list-h5-item.vue +1913 -1699
  101. package/src/components/xform/form-render/index.vue +153 -147
  102. package/src/components/xform/form-render/indexMixin.js +35 -3
  103. package/src/components/xform/lang/en-US.js +14 -0
  104. package/src/components/xform/lang/zh-CN.js +17 -0
  105. package/src/components/xform/mixins/defaultHandle.js +707 -707
  106. package/src/components/xform/styles/h5.scss +2262 -0
  107. package/src/components/xform/utils/textMaskUtil.js +182 -179
  108. package/src/components/xform/utils/treeTableUtil.js +1292 -1265
  109. package/src/components/xform/utils/util.js +56 -11
  110. package/src/directive/append-to-body/index.js +48 -0
  111. package/src/index.js +13 -4
  112. package/src/layout/components/Sidebar/default.vue +1655 -1655
  113. package/src/layout/components/extractedCode/viewDialog.vue +7 -7
  114. package/src/router/index.js +48 -27
  115. package/src/router/modules/customer.js +71 -14
  116. package/src/store/modules/permission.js +17 -18
  117. package/src/utils/assetUrl.js +19 -0
  118. package/src/utils/pdfUtil.js +429 -429
  119. package/src/utils/resolveViewComponent.js +142 -16
  120. package/src/utils/vab.js +1283 -1279
  121. package/src/views/bd/project/branch/bd_branch/edit.vue +145 -0
  122. package/src/views/bd/project/branch/bd_branch/list.vue +72 -0
  123. package/src/views/bd/project/branch/bd_branch/menuKindDialog.vue +106 -0
  124. package/src/views/bd/project/branch/bd_branch/mixins/edit.js +189 -0
  125. package/src/views/bd/project/branch/bd_branch/mixins/list.js +124 -0
  126. package/src/views/bd/project/branch/bd_branch/mixins/menuKindDialog.js +85 -0
  127. package/src/views/bd/project/branch/form_script/list.vue +31 -0
  128. package/src/views/bd/project/branch/form_template/list.vue +30 -0
  129. package/src/views/bd/project/branch/menu_kind/list.vue +31 -0
  130. package/src/views/bd/project/common/form_script/list.vue +16 -0
  131. package/src/views/bd/project/common/form_template/list.vue +15 -0
  132. package/src/views/bd/project/common/menu_kind/list.vue +15 -0
  133. package/src/views/bd/project/core/branchContext.js +100 -0
  134. package/src/views/bd/project/core/branchPage.js +78 -0
  135. package/src/views/bd/project/core/branchPageWrap.vue +225 -0
  136. package/src/views/bd/project/core/branchScope.js +44 -0
  137. package/src/views/bd/project/core/branchSearchPage.js +285 -0
  138. package/src/views/bd/project/core/branchSelect.vue +85 -0
  139. package/src/views/bd/project/core/branchTreeBar.vue +81 -0
  140. package/src/views/bd/project/core/httpBranchPatch.js +58 -0
  141. package/src/views/bd/project/datatable/menu_kind/list.vue +15 -0
  142. package/src/views/bd/project/datatable/table_model/list.vue +15 -0
  143. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -174
  144. package/src/views/bd/setting/form_template/edit.vue +378 -356
  145. package/src/views/bd/setting/form_template/formDesignerDialog.vue +6 -0
  146. package/src/views/bd/setting/form_template/formTemplateType.js +43 -0
  147. package/src/views/bd/setting/form_template/list.vue +304 -303
  148. package/src/views/bd/setting/form_template/mixins/edit.js +344 -280
  149. package/src/views/bd/setting/form_template/mixins/list.js +748 -721
  150. package/src/views/bd/setting/table_model/edit.vue +1066 -1066
  151. package/src/views/bd/setting/table_model/mixins/edit.js +1455 -1455
  152. package/src/views/bd/setting/table_model/mixins/zdDialog.js +148 -148
  153. package/src/views/support/form-dialog-demo/demoPickerDialog.vue +72 -0
  154. package/src/views/support/form-dialog-demo/index.vue +537 -0
  155. package/src/views/user/file_view_ins/list.vue +970 -970
  156. package/src/views/user/form/vform/designer.vue +823 -821
  157. package/src/views/user/home/default.vue +1117 -1117
  158. package/src/views/user/home/default2.vue +1 -1
  159. package/src/views/user/home/index.vue +103 -101
  160. package/src/views/user/notify_message/dialog.vue +139 -137
  161. package/src/views/user/outLink/form_view.vue +202 -202
  162. package/src/views/user/outLink/index.vue +110 -110
  163. package/src/views/user/outLink/view.vue +3 -3
  164. package/src/views/user/role/edit.vue +632 -632
  165. package/src/views/user/role/list.vue +260 -260
  166. package/src/views/user/wf/iframe/index.vue +51 -51
  167. package/src/views/user/wf/iframe/index2.vue +64 -64
  168. package/src/views/user/wf/wf_manage/list.vue +1112 -1116
  169. package/src/views/user/wf/wf_manage/list2.vue +871 -875
  170. package/src/views/user/wf/wf_manage/wfContentDialog.vue +134 -131
  171. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +1 -1
  172. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-menu-widget.vue +0 -106
  173. package/src/components/xform/form-designer/form-widget/field-widget/tableexportbuttonwidget.vue +0 -99
  174. package/src/components/xform/form-render/container-item/list-h5-item2.vue +0 -1340
  175. package/src/utils/wf.js +0 -766
@@ -1,1455 +1,1455 @@
1
- import formOplogTable from "@base/components/formOplog/index.vue";
2
- import preformDialog from "@base/views/bd/setting/form_template/preformDialog.vue";
3
- import projectTagView from "@base/components/projectTag/view.vue";
4
- import szTaMbDialog from "@base/views/bd/setting/table_model/dialog.vue";
5
- import MenuKindDialog from "@base/views/bd/setting/menu_kind/dialog.vue";
6
- import zdDialog from "@base/views/bd/setting/table_model/zdDialog.vue";
7
- import {getBdFlag} from "@base/api/user";
8
- import {getJsxBtn} from "@base/views/bd/setting/utils/index";
9
- import otherAuthDialog from "../otherAuthDialog.vue";
10
- import { mapGetters } from "vuex";
11
-
12
- let modules = {};
13
- modules = {
14
- name: "szTaMbEdit",
15
- props: {
16
- _dataId: [String, Number],
17
- currentFormType: Object,
18
- // readonly: Boolean,
19
- otherFlag:Boolean,
20
- hData: Object,
21
- compareHData: Object,
22
- extractedObj: Object,
23
- },
24
- components: {
25
- formOplogTable,
26
- preformDialog,
27
- projectTagView,
28
- szTaMbDialog,
29
- MenuKindDialog,
30
- zdDialog,
31
- otherAuthDialog
32
- },
33
- data() {
34
- return {
35
- tabIndex: 0,
36
- isEdit: false,
37
- dataId: "",
38
- szTaMb: {
39
- enabled: true,
40
- taType: 0,
41
- szTaZdMbDTOs: [],
42
- menuKindName: null,
43
- menuKindCode: null,
44
- serviceName: null,
45
- taRule: 0,
46
- dataRange: 0,
47
- szTaMbTagDTOs: [],
48
- fromTable: false,
49
- taCh: null,
50
- sszstEn: null,
51
- taEn: null,
52
- taBm: null,
53
- sszstBm: null,
54
- },
55
- oldSzTaMb: {
56
- enabled: true,
57
- taType: 0,
58
- szTaZdMbDTOs: [],
59
- menuKindName: null,
60
- menuKindCode: null,
61
- serviceName: null,
62
- taRule: 0,
63
- dataRange: 0,
64
- szTaMbTagDTOs: [],
65
- fromTable: false,
66
- taCh: null,
67
- sszstEn: null,
68
- taEn: null,
69
- taBm: null,
70
- sszstBm: null,
71
- },
72
- treeDefaultZds: [],
73
- productOption: {},
74
- showSzTaMbDialog: false,
75
- showMenuKindDialog: false,
76
- productCategoryCodes: [],
77
-
78
- referenceEntity: null,
79
- referenceKey: null,
80
- referenceShowFields: null,
81
- refServiceName: null,
82
- // 存行引用而不是行索引:两个弹框都是 modal=false(没有遮罩),
83
- // 开着的时候还能点后面的「新增」,而 addTaMbItems 是 splice(0,0) 插到最前面,
84
- // 存索引会当场整体错位,配置写到隔壁行上
85
- currentRow: null,
86
- showReferenceZdDialog: false,
87
-
88
- showEntityDialog: false,
89
- showEntityFieldDialog1: false,
90
- showEntityFieldDialog2: false,
91
- referenceShowRows: [],
92
- createdTableColumnStr: null,
93
- createdTableColumnArray: [],
94
- isDev: true,
95
- showPreformDialog: false,
96
- menuKindAuth: {
97
- editAuth: 0,
98
- },
99
-
100
- dbTable: null,
101
- showDtDialog: false,
102
- showTmDialog: false,
103
-
104
- showToTaBmZdDialog: false,
105
- // 和 currentRow 分开存:两个弹框可以同时打开,共用一个会互相覆盖
106
- toTaBmZdRow: null,
107
- toTaBmZdEntity: null,
108
- toTaBmZdField: null,
109
- showEntityDialog3: false,
110
- showEntityFieldDialog3: false,
111
-
112
- preValue: null, // 字段名输入框获得焦点时的原值(changeZdEn 用来迁移子行)
113
-
114
- sid: null,
115
- showOtherAuthDialog:false,
116
-
117
- readonly: false,
118
- isCompare: false,
119
- };
120
- },
121
- computed: {
122
- ...mapGetters([
123
- "userFlag",
124
- ]),
125
- // 这两张映射表只用于 fieldCompare 显示"旧值",文案必须和模板里
126
- // el-option 的 label 走同一套 $t1,否则英文环境下下拉是英文、对比值是中文
127
- zdTypeMap() {
128
- return {
129
- Boolean: this.$t1("布尔"),
130
- Integer: this.$t1("整数"),
131
- Long: this.$t1("长整数"),
132
- Decimal: this.$t1("精度小数"),
133
- Money: this.$t1("金额"),
134
- Text: this.$t1("文本"),
135
- TextArea: this.$t1("长文本"),
136
- DateTime: this.$t1("日期时间"),
137
- Reference: this.$t1("关联表(文本)"),
138
- ReferenceLong: this.$t1("关联表(长整型)"),
139
- };
140
- },
141
- // 单选弹框存的是字段名字符串,zdDialog 的 rows 要的是行对象(按 fieldKey=taZdMc 匹配)
142
- referenceKeyRows() {
143
- return this.referenceKey ? [{taZdMc: this.referenceKey}] : [];
144
- },
145
- toTaBmZdFieldRows() {
146
- return this.toTaBmZdField ? [{taZdMc: this.toTaBmZdField}] : [];
147
- },
148
- treeFlagMap() {
149
- return {
150
- name: this.$t1("名称"),
151
- wbs: this.$t1("WBS码"),
152
- parent: this.$t1("上级ID"),
153
- treePath: this.$t1("树ID路径"),
154
- treePathName: this.$t1("树名称路径"),
155
- hasChild: this.$t1("是否有下级"),
156
- grade: this.$t1("层级"),
157
- };
158
- },
159
- },
160
- created() {
161
- if(this.hData){
162
- this.readonly = true;
163
- }else{
164
- this.readonly = this.$attrs.readonly || false;
165
- }
166
- if (this._dataId && !isNaN(this._dataId)) {
167
- this.dataId = this._dataId;
168
- } else {
169
- this.szTaMb.menuKindName = this.currentFormType?.name || null;
170
- this.szTaMb.menuKindCode = this.currentFormType?.menuKindCode || null;
171
- this.szTaMb.serviceName = this.currentFormType?.serviceName || null;
172
- }
173
- },
174
- mounted() {
175
- this.getBdEnv();
176
- this.getTreeDefaultZds();
177
- this.initTableProduct();
178
- this.getData();
179
- },
180
- methods: {
181
- initData(formData){
182
- if(!!formData?.id)this.isEdit = true;
183
- this.szTaMb = formData;
184
- this.getMenuKindAuth(formData.menuKindCode);
185
- if(!!formData?.id)this.getCreatedTableColumns();
186
- },
187
- getData(callback) {
188
- if(this.extractedObj){
189
- this.dataId = this.extractedObj.id;
190
- // callback 分支(getNewData → createModifyTable)不能在这里被吞掉,
191
- // 否则从该入口进来点「创建/更新数据表」会静默无反应
192
- if (callback) {
193
- callback({objx: this.$baseLodash.cloneDeep(this.extractedObj)});
194
- return;
195
- }
196
- this.initData(this.extractedObj)
197
- //获取操作日志数据
198
- this.$refs["oplogTable"].initData({
199
- param: () => {
200
- return {
201
- logType: "SzTaMb",
202
- logObjCode: this.szTaMb.taCode,
203
- };
204
- },
205
- });
206
- }else if (this.dataId && !isNaN(this.dataId)) {
207
- this.isEdit = true;
208
- this.$http({
209
- aes: true,
210
- url: USER_PREFIX + `/szTaMb/get`,
211
- method: `post`,
212
- data: {
213
- id: this.dataId,
214
- },
215
- isLoading: true,
216
- modalStrictly: true,
217
- success: (res) => {
218
- if (!callback) {
219
- let szTaMb = res.objx || {};
220
- szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
221
- szTaMb.attachmentDTOs = this.szTaMb.attachmentDTOs;
222
- szTaMb.oplogDTOs = this.szTaMb.oplogDTOs;
223
-
224
- // this.szTaMb = szTaMb;
225
- // this.getCreatedTableColumns();
226
- // this.getMenuKindAuth(this.szTaMb.menuKindCode);
227
- this.initData(szTaMb);
228
- } else {
229
- callback(res);
230
- }
231
- //获取操作日志数据
232
- this.$refs["oplogTable"].initData({
233
- param: () => {
234
- return {
235
- logType: "SzTaMb",
236
- logObjCode: this.szTaMb.taCode,
237
- };
238
- },
239
- });
240
- },
241
- });
242
- } else if (this.hData){
243
- this.dataId = this.hData.id
244
- if (callback) {
245
- callback({objx: this.$baseLodash.cloneDeep(this.hData)});
246
- return;
247
- }
248
- this.initData(this.$baseLodash.cloneDeep(this.hData));
249
- if (this.compareHData && this.$attrs.isCompare) {
250
- this.oldSzTaMb = this.$baseLodash.cloneDeep(this.compareHData);
251
- let oldSzTaZdMbDTOs = this.$baseLodash.cloneDeep(this.compareHData.szTaZdMbDTOs) || [];
252
- this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
253
- let oldItem = oldSzTaZdMbDTOs.find((pItem) => pItem.zdEn === item.zdEn);
254
- item.hData = oldItem || {};
255
- })
256
- this.isCompare = true;
257
- }
258
- } else {
259
- this.getMenuKindAuth(this.szTaMb.menuKindCode);
260
- }
261
- },
262
- saveData() {
263
- this.$refs.editForm.$baseValidate((valid) => {
264
- if (valid) {
265
- const szTaZdMbDTOs =
266
- this.$refs["table-szTaZdMb"].getTableData().fullData;
267
- if (szTaZdMbDTOs.length === 0) {
268
- this.$baseAlert(this.$t1("明细不能为空!"));
269
- return false;
270
- }
271
- if (!this.validateItems(szTaZdMbDTOs)) {
272
- return false;
273
- }
274
- this.szTaMb.szTaZdMbDTOs = szTaZdMbDTOs;
275
- this.openPreformDialog();
276
- }
277
- });
278
- },
279
- /**
280
- * 明细必填校验。
281
- *
282
- * 表格开了虚拟滚动(initVxeTable 默认 scrollY.gt = 20),超过 20 行以后屏幕外的行
283
- * 根本不会渲染,单元格里那些 el-form-item 也就没挂上去 —— el-form 的 validate
284
- * 只能覆盖当前视口。字段数超过 20 的数据表模板是常态,所以必填必须自己按 fullData 走一遍。
285
- */
286
- validateItems(szTaZdMbDTOs) {
287
- let requiredFields = [
288
- {field: "zdEn", label: this.$t1("实体字段名称")},
289
- {field: "zdCh", label: this.$t1("字段描述")},
290
- ];
291
- // Object.create(null) 而不是 {}:字段名可能叫 constructor / toString 之类,
292
- // 普通对象会命中原型链上的同名属性,误判成重复
293
- let seenZdEn = Object.create(null);
294
- for (let i = 0; i < szTaZdMbDTOs.length; i++) {
295
- let row = szTaZdMbDTOs[i];
296
- for (let j = 0; j < requiredFields.length; j++) {
297
- let {field, label} = requiredFields[j];
298
- let value = row[field];
299
- if (value === null || value === undefined || String(value).trim() === "") {
300
- this.$baseAlert(
301
- this.$t1("第{index}行的[{label}]不能为空!", {
302
- index: i + 1,
303
- label,
304
- })
305
- );
306
- this.scrollToItemRow(row);
307
- return false;
308
- }
309
- }
310
- // 实体字段名重复的话建表时才会炸,这里提前拦住
311
- let zdEn = String(row.zdEn).trim();
312
- if (seenZdEn[zdEn] !== undefined) {
313
- this.$baseAlert(
314
- this.$t1("第{index}行的实体字段名称[{zdEn}]与第{index2}行重复!", {
315
- index: i + 1,
316
- zdEn,
317
- index2: seenZdEn[zdEn] + 1,
318
- })
319
- );
320
- this.scrollToItemRow(row);
321
- return false;
322
- }
323
- seenZdEn[zdEn] = i;
324
- }
325
- return true;
326
- },
327
- scrollToItemRow(row) {
328
- let $table = this.$refs["table-szTaZdMb"];
329
- if ($table && $table.scrollToRow) {
330
- $table.scrollToRow(row);
331
- }
332
- },
333
- saveDataHandle(preformData) {
334
- let formData = {
335
- ...this.szTaMb,
336
- logContent: preformData.logContent,
337
- };
338
- // const formData = this.szTaMb;
339
- // formData.szTaZdMbDTOs = szTaZdMbDTOs;
340
-
341
- var url = USER_PREFIX + (this.isEdit ? `/szTaMb/update` : `/szTaMb/save`);
342
- this.$http({
343
- aes: true,
344
- url: url,
345
- method: `post`,
346
- data: formData,
347
- isLoading: true,
348
- success: (res) => {
349
- this.$message({
350
- message: res.content,
351
- type: "success",
352
- duration: 500,
353
- onClose: (t) => {
354
- if (this.isEdit) {
355
- this.$baseReload();
356
- } else {
357
- this.$baseReload({
358
- updateParam: {
359
- _dataId: res.objx,
360
- },
361
- });
362
- }
363
- },
364
- });
365
- },
366
- });
367
- },
368
- openPreformDialog() {
369
- this.showPreformDialog = true;
370
- },
371
- confirmPreformDialog(preformData) {
372
- this.saveDataHandle(preformData);
373
- },
374
- initTableProduct() {
375
- const tableOption = {
376
- vue: this,
377
- tableRef: "table-szTaZdMb",
378
- tableName: "edit-szTaMb-szTaZdMb",
379
- config: {
380
- maxHeight: "600px",
381
- },
382
- columns: [
383
- {type: "checkbox", fixed: "left", width: 48, resizable: false},
384
- {
385
- title: this.$t1("实体字段名称"),
386
- field: "zdEn",
387
- width: 150,
388
- fixed: "left",
389
- slots: {
390
- default: "zdEn",
391
- },
392
- },
393
- {
394
- title: this.$t1("数据库表字段名"),
395
- field: "taZdMc",
396
- width: 150,
397
- fixed: "left",
398
- },
399
- {
400
- title: this.$t1("数据库表字段是否已创建"),
401
- field: "isFieldCreated",
402
- width: 200,
403
- slots: {
404
- default: ({row, rowIndex, $table}) => {
405
- let taZdMc = row.taZdMc;
406
- let createdTableColumnArray = this.createdTableColumnArray;
407
- let oldResult = createdTableColumnArray.includes(row?.hData?.taZdMc)
408
- ? this.$t1("是")
409
- : "_";
410
- let result = taZdMc && createdTableColumnArray.includes(taZdMc)
411
- ? this.$t1("是")
412
- : "_";
413
- return [
414
- <el-form-item>
415
- <fieldCompare
416
- isCompare={this.isCompare}
417
- oldVal={oldResult}
418
- newVal={result}
419
- >
420
- {result}
421
- </fieldCompare>
422
- </el-form-item>
423
- ]
424
- },
425
- },
426
- },
427
- {
428
- title: this.$t1("字段描述"),
429
- field: "zdCh",
430
- width: 150,
431
- slots: {
432
- default: "zdCh",
433
- },
434
- },
435
- {
436
- title: this.$t1("字段类型"),
437
- field: "zdType",
438
- width: 150,
439
- slots: {
440
- default: "zdType",
441
- },
442
- },
443
- {
444
- title: this.$t1("字段长度"),
445
- field: "zdLength",
446
- width: 150,
447
- slots: {
448
- default: "zdLength",
449
- },
450
- },
451
- {
452
- title: this.$t1("树标识"),
453
- field: "treeFlag",
454
- width: 150,
455
- slots: {
456
- default: "treeFlag",
457
- },
458
- },
459
- {
460
- title: this.$t1("关联字段"),
461
- field: "referenceZd",
462
- width: 250,
463
- slots: {
464
- default: "referenceZd",
465
- },
466
- },
467
- {
468
- title: this.$t1("来源关联字段"),
469
- field: "relationZd",
470
- width: 250,
471
- },
472
- {
473
- title: this.$t1("关联表对应服务名"),
474
- field: "refServiceName",
475
- width: 200,
476
- },
477
- {
478
- title: this.$t1("数据值对应表的字段"),
479
- field: "toTaBmZd",
480
- width: 250,
481
- slots: {
482
- default: "toTaBmZd",
483
- },
484
- },
485
- {
486
- title: this.$t1("字段类型对应的默认值"),
487
- field: "zdTypeValues",
488
- width: 200,
489
- slots: {
490
- default: "zdTypeValues",
491
- },
492
- },
493
- {
494
- title: this.$t1("是否必填项"),
495
- field: "required",
496
- width: 140,
497
- params: {
498
- exportVal:({row,column})=>{
499
- return this.$t1(row[column.field]? "是": "否")
500
- }
501
- },
502
- slots: {
503
- default: "required",
504
- },
505
- },
506
- {
507
- title: this.$t1("是否启用"),
508
- field: "enabled",
509
- width: 120,
510
- params: {
511
- exportVal:({row,column})=>{
512
- return this.$t1(row[column.field]? "是": "否")
513
- }
514
- },
515
- slots: {
516
- default: "enabled",
517
- },
518
- },
519
-
520
- {
521
- title: this.$t1("是否自动生成编码"),
522
- field: "generateCode",
523
- width: 180,
524
- params: {
525
- exportVal:({row,column})=>{
526
- return this.$t1(row[column.field]? "是": "否")
527
- }
528
- },
529
- slots: {
530
- default: "generateCode",
531
- },
532
- },
533
- {
534
- title: this.$t1('数据库字段加密'),
535
- field: 'atened',
536
- width: 180,
537
- params: {
538
- exportVal:({row,column})=>{
539
- return this.$t1(row[column.field]? "是": "否")
540
- }
541
- },
542
- slots: {
543
- default: "atened"
544
- }
545
- },
546
- {
547
- title: this.$t1('是否更新忽略字段'),
548
- field: 'updateIgnore',
549
- width: 180,
550
- params: {
551
- exportVal:({row,column})=>{
552
- return this.$t1(row[column.field]? "是": "否")
553
- }
554
- },
555
- slots: {
556
- default: "updateIgnore"
557
- }
558
- },
559
- {
560
- title: this.$t1("编码类型"),
561
- field: "codeType",
562
- width: 150,
563
- slots: {
564
- default: "codeType",
565
- },
566
- },
567
- {
568
- title: this.$t1("序号"),
569
- field: "orders",
570
- width: 150,
571
- slots: {
572
- default: "orders",
573
- },
574
- },
575
- {
576
- width: 47,
577
- fixed: "right",
578
- title: "",
579
- sortable: false,
580
- slots: {
581
- default: ({row, rowIndex, $table}) => {
582
- let taZdMc = row.taZdMc;
583
- let createdTableColumnArray =
584
- this.createdTableColumnArray || [];
585
- let hasCreated =
586
- !!taZdMc && createdTableColumnArray.includes(taZdMc);
587
- // let style = !row.relationZd ? "margin-left:20px" : "";
588
- if (!row.systems && !hasCreated && !this.readonly) {
589
- //非内置,未创建字段,非关联表带出来的字段
590
- return getJsxBtn({
591
- iconName: "el-icon-delete",
592
- content: this.$t1("删除"),
593
- onclick: () => {
594
- this.deleteItem(row, rowIndex);
595
- },
596
- });
597
- }
598
- },
599
- },
600
- },
601
- ],
602
- };
603
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
604
- this.productOption = opts;
605
- });
606
- if (this.dataId) {
607
- this.$http({
608
- aes: true,
609
- url: USER_PREFIX + `/szTaMb/getSzTaZdMbs`,
610
- method: `post`,
611
- data: {
612
- id: this.dataId,
613
- },
614
- isLoading: true,
615
- modalStrictly: true,
616
- success: (res) => {
617
- this.szTaMb.szTaZdMbDTOs = res.objx || [];
618
- },
619
- });
620
- }
621
- },
622
- addTaMbItems() {
623
- // let tacitly = true;
624
- // if (this.customer.szTaZdMbDTOs.length > 0) {
625
- // tacitly = false;
626
- // }
627
- // this.customer.szTaZdMbDTOs.push({tacitly: tacitly});
628
- let newIndex = this.getNewIndex();
629
- /* let item = {
630
- zdEn: null,
631
- zdCh: null,
632
- taZdMc: null,
633
- zdTypeValues: null,
634
- required: false,
635
- codeType: null,
636
- referenceZd: null,
637
- zdType: "Text",
638
- zdLength: "255",
639
- enabled: true,
640
- orders: newIndex,
641
- relationZd:null,
642
- refServiceName:null,
643
-
644
- generateCode: false,
645
- fromTable: false,
646
- toTaBmZd: null,
647
- treeFlag: null,
648
- atened: false,
649
- updateIgnore: false
650
- }; */
651
- let item = this.createRow();
652
- item.orders = newIndex,
653
- this.szTaMb.szTaZdMbDTOs.splice(0, 0, item);
654
- },
655
- deleteItem(row, rowIndex) {
656
- if (row.referenceZd) {
657
- // clearReferenceZd 是 filter 出新数组赋值回去,传进来的 rowIndex 会失效,
658
- // 所以下面必须重新按行引用定位
659
- this.clearReferenceZd(row);
660
- }
661
- let index = this.szTaMb.szTaZdMbDTOs.indexOf(row);
662
- if (index >= 0) {
663
- this.szTaMb.szTaZdMbDTOs.splice(index, 1);
664
- }
665
- },
666
- confirmInsertSzTaMb(rows) {
667
- if (rows.length > 0) {
668
- let row = rows[0];
669
- this.$set(this.szTaMb, "sszst", row.taCode);
670
- this.$set(this.szTaMb, "sszstEn", row.taEn);
671
- this.$set(this.szTaMb, "sszstBm", row.taBm);
672
- }
673
- },
674
- confirmInsertMenuKind(rows) {
675
- if (rows.length > 0) {
676
- let row = rows[0];
677
- this.$set(this.szTaMb, "menuKindCode", row.menuKindCode);
678
- this.$set(this.szTaMb, "menuKindName", row.name);
679
- // 权限是按表单分类取的,换了分类必须重取:
680
- // 否则新建单据(进来时 menuKindCode 为空、menuKindAuth 停在 editAuth:0)
681
- // 手工选完分类后「保存」按钮依然不渲染,流程直接走不下去
682
- this.getMenuKindAuth(row.menuKindCode);
683
- }
684
- },
685
- clearSszst() {
686
- // sszst 不在 szTaMb 的初始声明里(confirmInsertSzTaMb 也是 $set 写进去的),走 $set
687
- this.$set(this.szTaMb, "sszst", null);
688
- this.$set(this.szTaMb, "sszstBm", null);
689
- },
690
- clearMenuKind() {
691
- this.szTaMb.menuKindCode = "";
692
- // 反向同理:分类清空后旧分类的权限不能继续留着
693
- this.menuKindAuth = { editAuth: 0 };
694
- },
695
- getNewData(callback) {
696
- this.getData((res0) => {
697
- let szTaMb = res0.objx;
698
- this.$http({
699
- aes: true,
700
- url: USER_PREFIX + `/szTaMb/getSzTaZdMbs`,
701
- method: `post`,
702
- data: {
703
- id: this.dataId,
704
- },
705
- isLoading: true,
706
- modalStrictly: true,
707
- success: (res1) => {
708
- szTaMb.szTaZdMbDTOs = res1.objx || [];
709
- callback(szTaMb);
710
- },
711
- });
712
- });
713
- },
714
- createModifyTable() {
715
- let url = this.getServiceUrl("/dbTable/createUpdateTable");
716
- if (!url) return;
717
- let text = this.$t1("您确定要创建/更新数据表吗?");
718
- this.$baseConfirm(text).then(() => {
719
- this.getNewData((data) => {
720
- this.$http({
721
- aes: true,
722
- url: url,
723
- method: `post`,
724
- data: data,
725
- isLoading: true,
726
- success: (res) => {
727
- this.$message({
728
- message: res.content,
729
- type: "success",
730
- duration: 500,
731
- onClose: (t) => {
732
- this.$baseReload();
733
- },
734
- });
735
- },
736
- });
737
- });
738
- });
739
- },
740
- /**
741
- * 拼「服务名 + 接口路径」。serviceName 为空时不要拼出 /null/... 打到后端,
742
- * 直接提示并返回 null,由调用方中止。
743
- */
744
- getServiceUrl(path) {
745
- let serviceName = this.szTaMb.serviceName;
746
- if (!serviceName) {
747
- this.$baseAlert(this.$t1("服务名不能为空,请先选择表单分类"));
748
- return null;
749
- }
750
- return "/" + serviceName + path;
751
- },
752
- isReferenceZdType(zdType) {
753
- return zdType === "Reference" || zdType === "ReferenceLong";
754
- },
755
- openReferenceZdDialog(row, rowIndex, $table) {
756
- let referenceZd = row.referenceZd;
757
- let referenceZd2 = row.referenceZd + "." + row.zdEn;
758
- let referenceEntity = null;
759
- let referenceKey = null;
760
- let referenceShowFields = [];
761
-
762
- let referenceShowRows = [];
763
-
764
- if (referenceZd) {
765
- let index = referenceZd.indexOf(".");
766
- referenceEntity = referenceZd.substring(0, index);
767
- referenceKey = referenceZd.substr(index + 1);
768
- // 回填已有的关联显示字段行时必须带上 zdEn / zdCh:
769
- // confirmReferenceZdDialog 新建行要用它们拼 "ref_" + zdEn,
770
- // 只回填 taZdMc 会生成 zdEn 为 "ref_undefined"、zdCh 为空的脏行
771
- referenceShowRows = this.szTaMb.szTaZdMbDTOs
772
- .filter((item) => {
773
- return item.relationZd === referenceZd || item.relationZd === referenceZd2;
774
- })
775
- .map((item) => {
776
- let taZdMc = item.referenceZd ? item.referenceZd.substr(index + 1) : null;
777
- return {
778
- taZdMc,
779
- zdEn: item.zdEn ? item.zdEn.replace(/^ref_/, "") : taZdMc,
780
- zdCh: item.zdCh,
781
- };
782
- });
783
- referenceShowFields = referenceShowRows.map((item) => item.taZdMc);
784
- }
785
-
786
- this.referenceEntity = referenceEntity;
787
- this.referenceKey = referenceKey;
788
- this.referenceShowFields = referenceShowFields;
789
- this.refServiceName = row.refServiceName ?? null;
790
- this.referenceShowRows = referenceShowRows;
791
-
792
- this.currentRow = row;
793
- this.showReferenceZdDialog = true;
794
- },
795
- /**
796
- * item 是不是 parentRow 在 parentRefZd 这个关联配置下带出来的显示字段行。
797
- *
798
- * relationZd 历史上出现过三种写法(无后缀 / 后缀是主字段 zdEn / 后缀是子行自己的 zdEn),
799
- * 这里全部认,避免漏匹配导致子行变成孤儿。
800
- */
801
- isReferenceChildRow(item, parentRow, parentRefZd) {
802
- if (!parentRefZd || !item.relationZd) {
803
- return false;
804
- }
805
- return (
806
- item.relationZd === parentRefZd
807
- || item.relationZd === parentRefZd + "." + parentRow.zdEn
808
- || item.relationZd === parentRefZd + "." + item.zdEn
809
- );
810
- },
811
- changeZdType(row) {
812
- let map = {
813
- "Integer": "11",
814
- "Long": "20",
815
- "ReferenceLong": "20",
816
- "Decimal": "21,6",
817
- "Money": "21,2",
818
- "Text": "255"
819
- }
820
- row.zdLength = map[row.zdType] || null;
821
- if (!this.isReferenceZdType(row.zdType)) {
822
- this.clearReferenceZd(row);
823
- }
824
- },
825
- confirmClearReferenceZd(row) {
826
- if (!row.referenceZd) {
827
- return;
828
- }
829
- if (this.hasFieldCreated(row)) {
830
- this.$baseAlert(this.$t1("该字段已在数据库中创建,不能清空关联配置"));
831
- return;
832
- }
833
- // 这里原来还有一道「关联显示字段已在数据库中创建」的检查,是死代码:
834
- // 显示字段行不建库、taZdMc 恒为空,hasFieldCreated 永远返回 false。
835
- // 连同它唯一的调用方 getReferenceChildRows 一并删掉。
836
- let text = this.$t1("清空关联配置将同时删除关联显示字段,您确定要继续吗?");
837
- this.$baseConfirm(text).then(() => {
838
- this.clearReferenceZd(row);
839
- });
840
- },
841
- clearReferenceZd(row) {
842
- let referenceZd = row.referenceZd;
843
- if (referenceZd) {
844
- let referenceZd2 = referenceZd + "." + row.zdEn;
845
- this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter((item) => {
846
- return referenceZd !== item.relationZd && referenceZd2 !== item.relationZd;
847
- });
848
- } else if (row.zdEn) {
849
- let relationZdSuffix = "." + row.zdEn;
850
- this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter((item) => {
851
- return !(item.relationZd && item.relationZd.endsWith(relationZdSuffix));
852
- });
853
- }
854
- row.referenceZd = null;
855
- row.refServiceName = null;
856
- },
857
- confirmReferenceZdDialog() {
858
- let row = this.currentRow;
859
- if (!row) {
860
- this.showReferenceZdDialog = false;
861
- return;
862
- }
863
- let oldReferenceZd = row.referenceZd;
864
- let oldReferenceZd2 = row.referenceZd + "." + row.zdEn;
865
-
866
- let referenceEntity = this.referenceEntity;
867
- let refServiceName = this.refServiceName;
868
- let referenceKey = this.referenceKey
869
- let referenceZd = referenceEntity && referenceKey ? (referenceEntity + "." + referenceKey) : null;
870
-
871
- let referenceShowFields = this.referenceShowFields;
872
-
873
- // 关联表 / 关联字段任一为空都拼不出合法的 referenceZd,硬走下去
874
- // 新建行的 relationZd 会拼成 "null.xxx",父子彻底断开、之后再也认不回来。
875
- // 两个都为空是"清空关联配置",属于合法操作,放行走下面的删除分支。
876
- if (referenceEntity && !referenceKey) {
877
- this.$baseAlert(this.$t1("关联字段不能为空"));
878
- return;
879
- }
880
- if (!referenceZd && referenceShowFields.length) {
881
- this.$baseAlert(this.$t1("关联表不能为空"));
882
- return;
883
- }
884
-
885
- let keys = referenceShowFields.map((item) => {
886
- return referenceEntity + "." + item;
887
- });
888
- if (oldReferenceZd) {
889
- let index0 = oldReferenceZd.indexOf(".");
890
- let oldReferenceEntity = oldReferenceZd.substring(0, index0);
891
- let delIndex = [];
892
- if (referenceEntity !== oldReferenceEntity) {
893
- this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
894
- if (item.relationZd && (oldReferenceZd === item.relationZd || oldReferenceZd2 === item.relationZd)) {
895
- delIndex.push(index);
896
- }
897
- });
898
- } else {
899
- this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
900
- if (oldReferenceZd === item.relationZd || oldReferenceZd2 === item.relationZd) {
901
- if (!keys.includes(item.referenceZd)) {
902
- delIndex.push(index);
903
- } else {
904
- item.refServiceName = refServiceName;
905
- // 关联表没变、只换了关联字段时,保留下来的子行必须把 relationZd 迁到新的
906
- // referenceZd 上。否则它们既变成认不回来的孤儿行,
907
- // 又会因为下面 oldKeys 匹配不到而被当成"新字段"重复插入一遍。
908
- item.relationZd = referenceZd ? referenceZd + "." + row.zdEn : null;
909
- }
910
- }
911
- });
912
- }
913
- if (delIndex.length) {
914
- delIndex.reverse().forEach((i) => {
915
- this.szTaMb.szTaZdMbDTOs.splice(i, 1);
916
- });
917
- }
918
- }
919
-
920
- let oldKeys = this.szTaMb.szTaZdMbDTOs
921
- .filter((item) => this.isReferenceChildRow(item, row, referenceZd))
922
- .map((item) => item.referenceZd);
923
- let addReferenceShowFields = referenceShowFields.filter((item, index) => {
924
- return !oldKeys.includes(referenceEntity + "." + item);
925
- });
926
-
927
- let addIndex = -1;
928
- let lastIndex = this.szTaMb.szTaZdMbDTOs.findLastIndex((item) => {
929
- return this.isReferenceChildRow(item, row, referenceZd);
930
- });
931
- addIndex = lastIndex >= 0
932
- ? lastIndex + 1
933
- : this.szTaMb.szTaZdMbDTOs.indexOf(row) + 1;
934
-
935
- let referenceShowRows = this.referenceShowRows;
936
-
937
- let addReferenceShowRows = referenceShowRows.filter((item, index) => {
938
- return addReferenceShowFields.includes(item.taZdMc);
939
- });
940
- // 已占用的字段名,用来给新建行避让重名;本轮生成的也要边生成边记进去
941
- let usedZdEns = this.szTaMb.szTaZdMbDTOs
942
- .map((item) => item.zdEn)
943
- .filter((item) => !!item);
944
- addReferenceShowRows.forEach((item, index) => {
945
- let rIndex = addIndex + index;
946
- let orders = (row.orders || 0) + index + 1;
947
-
948
- let zdEn = this.buildReferenceZdEn(item.zdEn || item.taZdMc, row, usedZdEns);
949
- usedZdEns.push(zdEn);
950
-
951
- let newItem = this.createRow();
952
- Object.assign(newItem, {
953
- zdEn,
954
- zdCh: item.zdCh || null,
955
- required: false,
956
- referenceZd: referenceEntity + "." + item.taZdMc,
957
- zdType: "Text",
958
- zdLength: "255",
959
- enabled: true,
960
- orders,
961
- relationZd: referenceZd + "." + row.zdEn,
962
- refServiceName,
963
- })
964
-
965
- this.szTaMb.szTaZdMbDTOs.splice(rIndex, 0, newItem);
966
- });
967
- row.referenceZd = referenceZd;
968
- row.refServiceName = refServiceName;
969
- this.handleReferenceOrders(row);
970
- this.showReferenceZdDialog = false;
971
- },
972
- /**
973
- * 生成关联显示字段行的实体字段名。
974
- *
975
- * 基础名是 ref_<源字段>。两个字段绑同一张表的同一个字段时会撞
976
- * (典型:创建人 / 修改人都关联 sc_user.id 并显示 name,都想叫 ref_name),
977
- * 撞了才退化成 ref_<父字段>_<源字段>;还撞就往后加序号。
978
- * 先到先得,已存在的行不改名,所以存量数据不受影响。
979
- *
980
- * @param {String} srcName 源字段名
981
- * @param {Object} parentRow 发起关联的主字段行
982
- * @param {Array} usedZdEns 已占用的字段名(含本轮刚生成的)
983
- */
984
- buildReferenceZdEn(srcName, parentRow, usedZdEns) {
985
- let base = "ref_" + srcName;
986
- if (!usedZdEns.includes(base)) {
987
- return base;
988
- }
989
- let withParent = parentRow.zdEn
990
- ? "ref_" + parentRow.zdEn + "_" + srcName
991
- : base;
992
- if (withParent !== base && !usedZdEns.includes(withParent)) {
993
- return withParent;
994
- }
995
- let index = 2;
996
- while (usedZdEns.includes(withParent + "_" + index)) {
997
- index++;
998
- }
999
- return withParent + "_" + index;
1000
- },
1001
- createRow(){
1002
- let row = {
1003
- "orders": null,
1004
- "taCode": null,
1005
- "zdCode": null,
1006
- "zdEn": null,
1007
- "zdCh": null,
1008
- "taZdMc": null,
1009
- "zdType": "Text",
1010
- "zdLength": "255",
1011
- "referenceZd": null,
1012
- "relationZd": null,
1013
- "refServiceName": null,
1014
- "zdTypeValues": null,
1015
- "required": false,
1016
- "requiredMsg": null,
1017
- "regexpVal": null,
1018
- "regexpMsg": null,
1019
- "enabled": true,
1020
- "systems": false,
1021
- "generateCode": false,
1022
- "codeType": null,
1023
- "toTaBmZd": null,
1024
- "fromTable": false,
1025
- "treeFlag": null,
1026
- "atened": false,
1027
- "updateIgnore": false,
1028
- "abc": null
1029
- }
1030
- return row;
1031
- },
1032
- changeOrders(row) {
1033
- this.handleReferenceOrders(row);
1034
- },
1035
- handleReferenceOrders(row) {
1036
- let referenceZd = row.referenceZd;
1037
- let orders = row.orders || 0;
1038
- if (referenceZd) {
1039
- this.szTaMb.szTaZdMbDTOs
1040
- .filter((item) => this.isReferenceChildRow(item, row, referenceZd))
1041
- .forEach((item, index) => {
1042
- item.orders = orders + index + 1;
1043
- });
1044
- }
1045
- },
1046
- confirmEntityDialog(rows) {
1047
- if (rows.length) {
1048
- let row = rows[0];
1049
- if (this.referenceEntity !== row.taBm) {
1050
- this.referenceKey = null;
1051
- this.referenceShowFields = [];
1052
- // 换了关联表,上一张表的显示字段行必须一起丢掉,
1053
- // 否则 confirmReferenceZdDialog 会拿旧表的 taZdMc 去拼新表的 referenceZd
1054
- this.referenceShowRows = [];
1055
- }
1056
- this.referenceEntity = row.taBm;
1057
- this.refServiceName = row.serviceName;
1058
- }
1059
- },
1060
- clearReferenceEntity() {
1061
- this.referenceKey = null;
1062
- this.refServiceName = null;
1063
- this.referenceShowFields = [];
1064
- this.referenceShowRows = [];
1065
- },
1066
- openEntityFieldDialog1() {
1067
- if (!this.referenceEntity) {
1068
- this.$baseAlert(this.$t1("关联表不能为空"));
1069
- return;
1070
- }
1071
- this.showEntityFieldDialog1 = true;
1072
- },
1073
- confirmEntityFieldDialog1(rows) {
1074
- if (rows.length) {
1075
- let row = rows[0];
1076
- this.referenceKey = row.taZdMc;
1077
- }
1078
- },
1079
- openEntityFieldDialog2() {
1080
- if (!this.referenceEntity) {
1081
- this.$baseAlert(this.$t1("关联表不能为空"));
1082
- return;
1083
- }
1084
- this.showEntityFieldDialog2 = true;
1085
- },
1086
- confirmEntityFieldDialog2(rows) {
1087
- // 不能用 rows.length 兜底:回填可用之后,把勾选全部取消掉
1088
- // 就是"清空显示字段"的正常操作,必须让它生效
1089
- this.referenceShowRows = rows || [];
1090
- this.referenceShowFields = this.referenceShowRows.map((row) => {
1091
- return row.taZdMc;
1092
- });
1093
- },
1094
- getCreatedTableColumns() {
1095
- // 这里是首屏静默取数,serviceName 缺失时直接跳过,不弹提示打扰用户
1096
- if (!this.szTaMb.taBm || !this.szTaMb.serviceName) return;
1097
- this.$http({
1098
- aes: true,
1099
- url: "/" + this.szTaMb.serviceName + "/dbTable/getTableColumns",
1100
- method: `post`,
1101
- data: {
1102
- stringOne: this.szTaMb.taBm,
1103
- },
1104
- isLoading: true,
1105
- modalStrictly: true,
1106
- success: (res) => {
1107
- if (res.objx) {
1108
- this.createdTableColumnStr = res.objx;
1109
- let createdTableColumnArray = res.objx
1110
- .split(",")
1111
- .filter((item) => !!item);
1112
- this.createdTableColumnArray = createdTableColumnArray;
1113
- }
1114
- },
1115
- });
1116
- },
1117
- getTreeDefaultZds() {
1118
- this.$http({
1119
- aes: true,
1120
- url: USER_PREFIX + `/szTaMb/getTreeDefaultZds`,
1121
- method: `post`,
1122
- data: {},
1123
- isLoading: true,
1124
- modalStrictly: true,
1125
- success: (res) => {
1126
- let rows = res.objx || [];
1127
- this.treeDefaultZds = rows;
1128
- },
1129
- });
1130
- },
1131
- hasFieldCreated(row) {
1132
- let taZdMc = row.taZdMc;
1133
- let createdTableColumnArray = this.createdTableColumnArray || [];
1134
- let hasCreated = !!taZdMc && createdTableColumnArray.includes(taZdMc);
1135
- return hasCreated;
1136
- },
1137
- changeTaRule(val) {
1138
- let treeDefaultZds = this.$baseLodash.cloneDeep(this.treeDefaultZds);
1139
- let szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
1140
- if (val === 1) {
1141
- let zdEns = szTaZdMbDTOs
1142
- .filter((item) => !!item.zdEn)
1143
- .map((item) => item.zdEn);
1144
- if (zdEns.length) {
1145
- treeDefaultZds = treeDefaultZds.filter((item) => {
1146
- return !zdEns.includes(item.zdEn);
1147
- });
1148
- }
1149
- let newIndex = this.getNewIndex();
1150
- treeDefaultZds.forEach((item, index) => {
1151
- item.orders = newIndex + index;
1152
- });
1153
- szTaZdMbDTOs.push(...treeDefaultZds);
1154
- } else {
1155
- let zdEns = szTaZdMbDTOs
1156
- .filter((item) => !!item.zdEn)
1157
- .map((item) => item.zdEn);
1158
- let createdFields = szTaZdMbDTOs
1159
- .filter((item) => {
1160
- return !!item.zdEn && this.hasFieldCreated(item);
1161
- })
1162
- .map((item) => item.zdEn);
1163
- if (zdEns.length) {
1164
- treeDefaultZds = treeDefaultZds.filter((item) => {
1165
- return (
1166
- !createdFields.includes(item.zdEn) && zdEns.includes(item.zdEn)
1167
- );
1168
- });
1169
- }
1170
- let delFields = treeDefaultZds.map((item) => item.zdEn);
1171
- this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter(
1172
- (item) => !delFields.includes(item.zdEn)
1173
- );
1174
- }
1175
- },
1176
- getNewIndex() {
1177
- let min = 100;
1178
- let szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
1179
- let value = 0;
1180
- szTaZdMbDTOs.forEach((item) => {
1181
- let orders = item.orders;
1182
- if (orders !== null && orders !== undefined && orders < 9000) {
1183
- value = Math.max(value, orders);
1184
- }
1185
- });
1186
- let newIndex = Math.max(min, value + 10);
1187
- return newIndex;
1188
- },
1189
- getBdEnv() {
1190
- getBdFlag({
1191
- success: (res) => {
1192
- this.isDev = res.objx === 1;
1193
- },
1194
- });
1195
- },
1196
-
1197
- getMenuKindAuth(menuKindCode) {
1198
- if(this.otherFlag){
1199
- this.getOtherMenuKindAuth();
1200
- }else if (menuKindCode) {
1201
- this.$http({
1202
- aes: true,
1203
- url: USER_PREFIX + "/menu_kind_auth/getAuth",
1204
- method: `post`,
1205
- data: {stringOne: menuKindCode},
1206
- isLoading: true,
1207
- success: (res) => {
1208
- this.menuKindAuth = res.objx || {};
1209
- },
1210
- });
1211
- }
1212
- },
1213
- openDtDialog() {
1214
- //引用数据库中数据表结构
1215
- this.dbTable = null;
1216
- this.showDtDialog = true;
1217
- },
1218
- confirmDtDialog() {
1219
- let dbTable = this.dbTable;
1220
- if (!dbTable) {
1221
- this.$baseAlert(this.$t1("数据表不能为空"));
1222
- return;
1223
- }
1224
- let url = this.getServiceUrl("/dbTable/getSzTaZdMbs");
1225
- if (!url) return;
1226
- this.showDtDialog = false;
1227
- this.$http({
1228
- // aes: true,
1229
- url: url,
1230
- method: `post`,
1231
- data: {
1232
- stringOne: dbTable,
1233
- },
1234
- isLoading: true,
1235
- success: (res) => {
1236
- let items = res.objx || [];
1237
- if (!items.length) {
1238
- this.$baseAlert(this.$t1("数据表[{dbTable}]不存在", {dbTable}));
1239
- return;
1240
- }
1241
- let szTaZdMbDTOs = items
1242
- .filter((item) => !item.systems)
1243
- .map((item) => {
1244
- return {
1245
- ...item,
1246
- createBy: null,
1247
- createDate: null,
1248
- fromTable: true,
1249
- id: null,
1250
- modifyBy: null,
1251
- modifyDate: null,
1252
- };
1253
- });
1254
- this.szTaMb.taEn = dbTable;
1255
- this.szTaMb.taBm = dbTable;
1256
- this.szTaMb.szTaZdMbDTOs = szTaZdMbDTOs;
1257
- },
1258
- });
1259
- },
1260
- openTmDialog() {
1261
- //引用数据表定义的结构
1262
- this.showTmDialog = true;
1263
- },
1264
- confirmTmDialog(rows) {
1265
- if (rows.length) {
1266
- let row = rows[0];
1267
- this.$http({
1268
- aes: true,
1269
- url: USER_PREFIX + `/szTaMb/getSzTaZdMbs`,
1270
- method: `post`,
1271
- data: {
1272
- id: row.id,
1273
- },
1274
- isLoading: true,
1275
- modalStrictly: true,
1276
- success: (res) => {
1277
- let items = res.objx || [];
1278
- let szTaZdMbDTOs = items
1279
- .filter((item) => !item.systems)
1280
- .map((item) => {
1281
- return {
1282
- ...item,
1283
- createBy: null,
1284
- createDate: null,
1285
- fromTable: true,
1286
- id: null,
1287
- modifyBy: null,
1288
- modifyDate: null,
1289
- };
1290
- });
1291
- let newRow = {
1292
- ...row,
1293
- createBy: null,
1294
- createDate: null,
1295
- fromTable: true,
1296
- id: null,
1297
- modifyBy: null,
1298
- modifyDate: null,
1299
- sid: null,
1300
- // taBm: null,
1301
- taCode: null,
1302
- };
1303
- Object.keys(newRow).forEach((key) => {
1304
- if (key.endsWith("DTOs")) {
1305
- delete newRow[key];
1306
- }
1307
- });
1308
- Object.assign(this.szTaMb, newRow);
1309
- this.szTaMb.szTaZdMbDTOs = szTaZdMbDTOs;
1310
- },
1311
- });
1312
- }
1313
- },
1314
- openToTaBmZdDialog(row, rowIndex, $table) {
1315
- let toTaBmZd = row.toTaBmZd;
1316
- let toTaBmZdEntity = null;
1317
- let toTaBmZdField = null;
1318
- if (toTaBmZd) {
1319
- toTaBmZd.split(".").forEach((item, index) => {
1320
- if (index === 0) {
1321
- toTaBmZdEntity = item;
1322
- } else if (index === 1) {
1323
- toTaBmZdField = item;
1324
- }
1325
- });
1326
- } else {
1327
- if (this.szTaMb.taType === 1 && this.szTaMb.sszstBm) {
1328
- toTaBmZdEntity = this.szTaMb.sszstBm;
1329
- }
1330
- }
1331
- this.toTaBmZdEntity = toTaBmZdEntity;
1332
- this.toTaBmZdField = toTaBmZdField;
1333
- this.toTaBmZdRow = row;
1334
- this.showToTaBmZdDialog = true;
1335
- },
1336
- confirmToTaBmZdDialog() {
1337
- let row = this.toTaBmZdRow;
1338
- if (!row) {
1339
- this.showToTaBmZdDialog = false;
1340
- return;
1341
- }
1342
- let toTaBmZdEntity = this.toTaBmZdEntity;
1343
- let toTaBmZdField = this.toTaBmZdField;
1344
- if (!toTaBmZdEntity) {
1345
- this.$baseAlert(this.$t1("对应表不能为空"));
1346
- return;
1347
- }
1348
- if (!toTaBmZdField) {
1349
- this.$baseAlert(this.$t1("对应表字段不能为空"));
1350
- return;
1351
- }
1352
- row.toTaBmZd = toTaBmZdEntity + "." + toTaBmZdField;
1353
- this.showToTaBmZdDialog = false;
1354
- },
1355
- openEntityDialog3() {
1356
- this.showEntityDialog3 = true;
1357
- },
1358
- confirmEntityDialog3(rows) {
1359
- if (rows.length) {
1360
- let row = rows[0];
1361
- if (this.toTaBmZdEntity !== row.taBm) {
1362
- this.toTaBmZdEntity = row.taBm;
1363
- this.toTaBmZdField = null;
1364
- }
1365
- }
1366
- },
1367
- openEntityFieldDialog3() {
1368
- if (!this.toTaBmZdEntity) {
1369
- this.$baseAlert(this.$t1("关联表不能为空"));
1370
- return;
1371
- }
1372
- this.showEntityFieldDialog3 = true;
1373
- },
1374
- confirmEntityFieldDialog3(rows) {
1375
- if (rows.length) {
1376
- let row = rows[0];
1377
- this.toTaBmZdField = row.taZdMc;
1378
- }
1379
- },
1380
- /**
1381
- * 进入字段名输入框时记下原值。
1382
- *
1383
- * 原来是靠 keydown 开闸(fkey),但鼠标右键粘贴、拖拽填入、部分输入法提交路径
1384
- * 都不产生 keydown,那些场景下 changeZdEn 整个被跳过,子行的 relationZd
1385
- * 会停在旧字段名上变成孤儿行。改成 focus 播种,任何修改途径都覆盖得到。
1386
- */
1387
- cacheZdEn(row) {
1388
- this.preValue = row.zdEn;
1389
- },
1390
- /**
1391
- * 改字段名时,把该行关联带出来的显示字段行的 relationZd 一起迁过去。
1392
- */
1393
- changeZdEn(val, row) {
1394
- let oldVal = this.preValue;
1395
- let newVal = val;
1396
- this.preValue = newVal;
1397
- if (oldVal === undefined || oldVal === null || oldVal === newVal) {
1398
- return;
1399
- }
1400
- if (this.isReferenceZdType(row.zdType)) {
1401
- let referenceZd = row.referenceZd;
1402
- if (referenceZd) {
1403
- let referenceZd2 = referenceZd + "." + oldVal;
1404
- let relationZd = referenceZd + "." + newVal;
1405
- this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
1406
- if (referenceZd === item.relationZd || referenceZd2 === item.relationZd) {
1407
- item.relationZd = relationZd;
1408
- }
1409
- });
1410
- }
1411
- }
1412
- },
1413
-
1414
- getOtherMenuKindAuth() {
1415
- if (this.otherFlag && this.szTaMb.sid) {
1416
- this.$http({
1417
- aes: true,
1418
- url: USER_PREFIX + "/sz_ta_mb_auth/getAuth",
1419
- method: `post`,
1420
- data: {stringOne: this.szTaMb.sid},
1421
- isLoading: true,
1422
- success: (res) => {
1423
- this.menuKindAuth = res.objx || {};
1424
- },
1425
- });
1426
- }
1427
- },
1428
- openOtherAuthDialog(){
1429
- this.sid = this.szTaMb.sid
1430
- this.showOtherAuthDialog = true
1431
- },
1432
- confirmOtherAuthDialog(){
1433
- this.$baseReload()
1434
- },
1435
- excelExport(){
1436
- this.$excelExport({title: this.$t1('数据表字段明细导出'), targetRef: 'table-szTaZdMb', prefix: USER_PREFIX, type: 'selected'})
1437
- },
1438
- getHValue(row, column) {
1439
- if (row.hData && row.hData.id) {
1440
- let result = row.hData[column.property];
1441
- if(column.property === 'zdType'){
1442
- result = this.zdTypeMap[result]
1443
- }else if(column.property === 'treeFlag'){
1444
- result = this.treeFlagMap[result]
1445
- }
1446
- return result
1447
- }/* else if (!row?.hData?.id) {
1448
- return "HAS_NO_HDATA";
1449
- } */ else {
1450
- return null;
1451
- }
1452
- },
1453
- },
1454
- };
1455
- export default modules;
1
+ import formOplogTable from "@base/components/formOplog/index.vue";
2
+ import preformDialog from "@base/views/bd/setting/form_template/preformDialog.vue";
3
+ import projectTagView from "@base/components/projectTag/view.vue";
4
+ import szTaMbDialog from "@base/views/bd/setting/table_model/dialog.vue";
5
+ import MenuKindDialog from "@base/views/bd/setting/menu_kind/dialog.vue";
6
+ import zdDialog from "@base/views/bd/setting/table_model/zdDialog.vue";
7
+ import {getBdFlag} from "@base/api/user";
8
+ import {getJsxBtn} from "@base/views/bd/setting/utils/index";
9
+ import otherAuthDialog from "../otherAuthDialog.vue";
10
+ import { mapGetters } from "vuex";
11
+
12
+ let modules = {};
13
+ modules = {
14
+ name: "szTaMbEdit",
15
+ props: {
16
+ _dataId: [String, Number],
17
+ currentFormType: Object,
18
+ // readonly: Boolean,
19
+ otherFlag:Boolean,
20
+ hData: Object,
21
+ compareHData: Object,
22
+ extractedObj: Object,
23
+ },
24
+ components: {
25
+ formOplogTable,
26
+ preformDialog,
27
+ projectTagView,
28
+ szTaMbDialog,
29
+ MenuKindDialog,
30
+ zdDialog,
31
+ otherAuthDialog
32
+ },
33
+ data() {
34
+ return {
35
+ tabIndex: 0,
36
+ isEdit: false,
37
+ dataId: "",
38
+ szTaMb: {
39
+ enabled: true,
40
+ taType: 0,
41
+ szTaZdMbDTOs: [],
42
+ menuKindName: null,
43
+ menuKindCode: null,
44
+ serviceName: null,
45
+ taRule: 0,
46
+ dataRange: 0,
47
+ szTaMbTagDTOs: [],
48
+ fromTable: false,
49
+ taCh: null,
50
+ sszstEn: null,
51
+ taEn: null,
52
+ taBm: null,
53
+ sszstBm: null,
54
+ },
55
+ oldSzTaMb: {
56
+ enabled: true,
57
+ taType: 0,
58
+ szTaZdMbDTOs: [],
59
+ menuKindName: null,
60
+ menuKindCode: null,
61
+ serviceName: null,
62
+ taRule: 0,
63
+ dataRange: 0,
64
+ szTaMbTagDTOs: [],
65
+ fromTable: false,
66
+ taCh: null,
67
+ sszstEn: null,
68
+ taEn: null,
69
+ taBm: null,
70
+ sszstBm: null,
71
+ },
72
+ treeDefaultZds: [],
73
+ productOption: {},
74
+ showSzTaMbDialog: false,
75
+ showMenuKindDialog: false,
76
+ productCategoryCodes: [],
77
+
78
+ referenceEntity: null,
79
+ referenceKey: null,
80
+ referenceShowFields: null,
81
+ refServiceName: null,
82
+ // 存行引用而不是行索引:两个弹框都是 modal=false(没有遮罩),
83
+ // 开着的时候还能点后面的「新增」,而 addTaMbItems 是 splice(0,0) 插到最前面,
84
+ // 存索引会当场整体错位,配置写到隔壁行上
85
+ currentRow: null,
86
+ showReferenceZdDialog: false,
87
+
88
+ showEntityDialog: false,
89
+ showEntityFieldDialog1: false,
90
+ showEntityFieldDialog2: false,
91
+ referenceShowRows: [],
92
+ createdTableColumnStr: null,
93
+ createdTableColumnArray: [],
94
+ isDev: true,
95
+ showPreformDialog: false,
96
+ menuKindAuth: {
97
+ editAuth: 0,
98
+ },
99
+
100
+ dbTable: null,
101
+ showDtDialog: false,
102
+ showTmDialog: false,
103
+
104
+ showToTaBmZdDialog: false,
105
+ // 和 currentRow 分开存:两个弹框可以同时打开,共用一个会互相覆盖
106
+ toTaBmZdRow: null,
107
+ toTaBmZdEntity: null,
108
+ toTaBmZdField: null,
109
+ showEntityDialog3: false,
110
+ showEntityFieldDialog3: false,
111
+
112
+ preValue: null, // 字段名输入框获得焦点时的原值(changeZdEn 用来迁移子行)
113
+
114
+ sid: null,
115
+ showOtherAuthDialog:false,
116
+
117
+ readonly: false,
118
+ isCompare: false,
119
+ };
120
+ },
121
+ computed: {
122
+ ...mapGetters([
123
+ "userFlag",
124
+ ]),
125
+ // 这两张映射表只用于 fieldCompare 显示"旧值",文案必须和模板里
126
+ // el-option 的 label 走同一套 $t1,否则英文环境下下拉是英文、对比值是中文
127
+ zdTypeMap() {
128
+ return {
129
+ Boolean: this.$t1("布尔"),
130
+ Integer: this.$t1("整数"),
131
+ Long: this.$t1("长整数"),
132
+ Decimal: this.$t1("精度小数"),
133
+ Money: this.$t1("金额"),
134
+ Text: this.$t1("文本"),
135
+ TextArea: this.$t1("长文本"),
136
+ DateTime: this.$t1("日期时间"),
137
+ Reference: this.$t1("关联表(文本)"),
138
+ ReferenceLong: this.$t1("关联表(长整型)"),
139
+ };
140
+ },
141
+ // 单选弹框存的是字段名字符串,zdDialog 的 rows 要的是行对象(按 fieldKey=taZdMc 匹配)
142
+ referenceKeyRows() {
143
+ return this.referenceKey ? [{taZdMc: this.referenceKey}] : [];
144
+ },
145
+ toTaBmZdFieldRows() {
146
+ return this.toTaBmZdField ? [{taZdMc: this.toTaBmZdField}] : [];
147
+ },
148
+ treeFlagMap() {
149
+ return {
150
+ name: this.$t1("名称"),
151
+ wbs: this.$t1("WBS码"),
152
+ parent: this.$t1("上级ID"),
153
+ treePath: this.$t1("树ID路径"),
154
+ treePathName: this.$t1("树名称路径"),
155
+ hasChild: this.$t1("是否有下级"),
156
+ grade: this.$t1("层级"),
157
+ };
158
+ },
159
+ },
160
+ created() {
161
+ if(this.hData){
162
+ this.readonly = true;
163
+ }else{
164
+ this.readonly = this.$attrs.readonly || false;
165
+ }
166
+ if (this._dataId && !isNaN(this._dataId)) {
167
+ this.dataId = this._dataId;
168
+ } else {
169
+ this.szTaMb.menuKindName = this.currentFormType?.name || null;
170
+ this.szTaMb.menuKindCode = this.currentFormType?.menuKindCode || null;
171
+ this.szTaMb.serviceName = this.currentFormType?.serviceName || null;
172
+ }
173
+ },
174
+ mounted() {
175
+ this.getBdEnv();
176
+ this.getTreeDefaultZds();
177
+ this.initTableProduct();
178
+ this.getData();
179
+ },
180
+ methods: {
181
+ initData(formData){
182
+ if(!!formData?.id)this.isEdit = true;
183
+ this.szTaMb = formData;
184
+ this.getMenuKindAuth(formData.menuKindCode);
185
+ if(!!formData?.id)this.getCreatedTableColumns();
186
+ },
187
+ getData(callback) {
188
+ if(this.extractedObj){
189
+ this.dataId = this.extractedObj.id;
190
+ // callback 分支(getNewData → createModifyTable)不能在这里被吞掉,
191
+ // 否则从该入口进来点「创建/更新数据表」会静默无反应
192
+ if (callback) {
193
+ callback({objx: this.$baseLodash.cloneDeep(this.extractedObj)});
194
+ return;
195
+ }
196
+ this.initData(this.extractedObj)
197
+ //获取操作日志数据
198
+ this.$refs["oplogTable"].initData({
199
+ param: () => {
200
+ return {
201
+ logType: "SzTaMb",
202
+ logObjCode: this.szTaMb.taCode,
203
+ };
204
+ },
205
+ });
206
+ }else if (this.dataId && !isNaN(this.dataId)) {
207
+ this.isEdit = true;
208
+ this.$http({
209
+ aes: true,
210
+ url: USER_PREFIX + `/szTaMb/get`,
211
+ method: `post`,
212
+ data: {
213
+ id: this.dataId,
214
+ },
215
+ isLoading: true,
216
+ modalStrictly: true,
217
+ success: (res) => {
218
+ if (!callback) {
219
+ let szTaMb = res.objx || {};
220
+ szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
221
+ szTaMb.attachmentDTOs = this.szTaMb.attachmentDTOs;
222
+ szTaMb.oplogDTOs = this.szTaMb.oplogDTOs;
223
+
224
+ // this.szTaMb = szTaMb;
225
+ // this.getCreatedTableColumns();
226
+ // this.getMenuKindAuth(this.szTaMb.menuKindCode);
227
+ this.initData(szTaMb);
228
+ } else {
229
+ callback(res);
230
+ }
231
+ //获取操作日志数据
232
+ this.$refs["oplogTable"].initData({
233
+ param: () => {
234
+ return {
235
+ logType: "SzTaMb",
236
+ logObjCode: this.szTaMb.taCode,
237
+ };
238
+ },
239
+ });
240
+ },
241
+ });
242
+ } else if (this.hData){
243
+ this.dataId = this.hData.id
244
+ if (callback) {
245
+ callback({objx: this.$baseLodash.cloneDeep(this.hData)});
246
+ return;
247
+ }
248
+ this.initData(this.$baseLodash.cloneDeep(this.hData));
249
+ if (this.compareHData && this.$attrs.isCompare) {
250
+ this.oldSzTaMb = this.$baseLodash.cloneDeep(this.compareHData);
251
+ let oldSzTaZdMbDTOs = this.$baseLodash.cloneDeep(this.compareHData.szTaZdMbDTOs) || [];
252
+ this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
253
+ let oldItem = oldSzTaZdMbDTOs.find((pItem) => pItem.zdEn === item.zdEn);
254
+ item.hData = oldItem || {};
255
+ })
256
+ this.isCompare = true;
257
+ }
258
+ } else {
259
+ this.getMenuKindAuth(this.szTaMb.menuKindCode);
260
+ }
261
+ },
262
+ saveData() {
263
+ this.$refs.editForm.$baseValidate((valid) => {
264
+ if (valid) {
265
+ const szTaZdMbDTOs =
266
+ this.$refs["table-szTaZdMb"].getTableData().fullData;
267
+ if (szTaZdMbDTOs.length === 0) {
268
+ this.$baseAlert(this.$t1("明细不能为空!"));
269
+ return false;
270
+ }
271
+ if (!this.validateItems(szTaZdMbDTOs)) {
272
+ return false;
273
+ }
274
+ this.szTaMb.szTaZdMbDTOs = szTaZdMbDTOs;
275
+ this.openPreformDialog();
276
+ }
277
+ });
278
+ },
279
+ /**
280
+ * 明细必填校验。
281
+ *
282
+ * 表格开了虚拟滚动(initVxeTable 默认 scrollY.gt = 20),超过 20 行以后屏幕外的行
283
+ * 根本不会渲染,单元格里那些 el-form-item 也就没挂上去 —— el-form 的 validate
284
+ * 只能覆盖当前视口。字段数超过 20 的数据表模板是常态,所以必填必须自己按 fullData 走一遍。
285
+ */
286
+ validateItems(szTaZdMbDTOs) {
287
+ let requiredFields = [
288
+ {field: "zdEn", label: this.$t1("实体字段名称")},
289
+ {field: "zdCh", label: this.$t1("字段描述")},
290
+ ];
291
+ // Object.create(null) 而不是 {}:字段名可能叫 constructor / toString 之类,
292
+ // 普通对象会命中原型链上的同名属性,误判成重复
293
+ let seenZdEn = Object.create(null);
294
+ for (let i = 0; i < szTaZdMbDTOs.length; i++) {
295
+ let row = szTaZdMbDTOs[i];
296
+ for (let j = 0; j < requiredFields.length; j++) {
297
+ let {field, label} = requiredFields[j];
298
+ let value = row[field];
299
+ if (value === null || value === undefined || String(value).trim() === "") {
300
+ this.$baseAlert(
301
+ this.$t1("第{index}行的[{label}]不能为空!", {
302
+ index: i + 1,
303
+ label,
304
+ })
305
+ );
306
+ this.scrollToItemRow(row);
307
+ return false;
308
+ }
309
+ }
310
+ // 实体字段名重复的话建表时才会炸,这里提前拦住
311
+ let zdEn = String(row.zdEn).trim();
312
+ if (seenZdEn[zdEn] !== undefined) {
313
+ this.$baseAlert(
314
+ this.$t1("第{index}行的实体字段名称[{zdEn}]与第{index2}行重复!", {
315
+ index: i + 1,
316
+ zdEn,
317
+ index2: seenZdEn[zdEn] + 1,
318
+ })
319
+ );
320
+ this.scrollToItemRow(row);
321
+ return false;
322
+ }
323
+ seenZdEn[zdEn] = i;
324
+ }
325
+ return true;
326
+ },
327
+ scrollToItemRow(row) {
328
+ let $table = this.$refs["table-szTaZdMb"];
329
+ if ($table && $table.scrollToRow) {
330
+ $table.scrollToRow(row);
331
+ }
332
+ },
333
+ saveDataHandle(preformData) {
334
+ let formData = {
335
+ ...this.szTaMb,
336
+ logContent: preformData.logContent,
337
+ };
338
+ // const formData = this.szTaMb;
339
+ // formData.szTaZdMbDTOs = szTaZdMbDTOs;
340
+
341
+ var url = USER_PREFIX + (this.isEdit ? `/szTaMb/update` : `/szTaMb/save`);
342
+ this.$http({
343
+ aes: true,
344
+ url: url,
345
+ method: `post`,
346
+ data: formData,
347
+ isLoading: true,
348
+ success: (res) => {
349
+ this.$message({
350
+ message: res.content,
351
+ type: "success",
352
+ duration: 500,
353
+ onClose: (t) => {
354
+ if (this.isEdit) {
355
+ this.$baseReload();
356
+ } else {
357
+ this.$baseReload({
358
+ updateParam: {
359
+ _dataId: res.objx,
360
+ },
361
+ });
362
+ }
363
+ },
364
+ });
365
+ },
366
+ });
367
+ },
368
+ openPreformDialog() {
369
+ this.showPreformDialog = true;
370
+ },
371
+ confirmPreformDialog(preformData) {
372
+ this.saveDataHandle(preformData);
373
+ },
374
+ initTableProduct() {
375
+ const tableOption = {
376
+ vue: this,
377
+ tableRef: "table-szTaZdMb",
378
+ tableName: "edit-szTaMb-szTaZdMb",
379
+ config: {
380
+ maxHeight: "600px",
381
+ },
382
+ columns: [
383
+ {type: "checkbox", fixed: "left", width: 48, resizable: false},
384
+ {
385
+ title: this.$t1("实体字段名称"),
386
+ field: "zdEn",
387
+ width: 150,
388
+ fixed: "left",
389
+ slots: {
390
+ default: "zdEn",
391
+ },
392
+ },
393
+ {
394
+ title: this.$t1("数据库表字段名"),
395
+ field: "taZdMc",
396
+ width: 150,
397
+ fixed: "left",
398
+ },
399
+ {
400
+ title: this.$t1("数据库表字段是否已创建"),
401
+ field: "isFieldCreated",
402
+ width: 200,
403
+ slots: {
404
+ default: ({row, rowIndex, $table}) => {
405
+ let taZdMc = row.taZdMc;
406
+ let createdTableColumnArray = this.createdTableColumnArray;
407
+ let oldResult = createdTableColumnArray.includes(row?.hData?.taZdMc)
408
+ ? this.$t1("是")
409
+ : "_";
410
+ let result = taZdMc && createdTableColumnArray.includes(taZdMc)
411
+ ? this.$t1("是")
412
+ : "_";
413
+ return [
414
+ <el-form-item>
415
+ <fieldCompare
416
+ isCompare={this.isCompare}
417
+ oldVal={oldResult}
418
+ newVal={result}
419
+ >
420
+ {result}
421
+ </fieldCompare>
422
+ </el-form-item>
423
+ ]
424
+ },
425
+ },
426
+ },
427
+ {
428
+ title: this.$t1("字段描述"),
429
+ field: "zdCh",
430
+ width: 150,
431
+ slots: {
432
+ default: "zdCh",
433
+ },
434
+ },
435
+ {
436
+ title: this.$t1("字段类型"),
437
+ field: "zdType",
438
+ width: 150,
439
+ slots: {
440
+ default: "zdType",
441
+ },
442
+ },
443
+ {
444
+ title: this.$t1("字段长度"),
445
+ field: "zdLength",
446
+ width: 150,
447
+ slots: {
448
+ default: "zdLength",
449
+ },
450
+ },
451
+ {
452
+ title: this.$t1("树标识"),
453
+ field: "treeFlag",
454
+ width: 150,
455
+ slots: {
456
+ default: "treeFlag",
457
+ },
458
+ },
459
+ {
460
+ title: this.$t1("关联字段"),
461
+ field: "referenceZd",
462
+ width: 250,
463
+ slots: {
464
+ default: "referenceZd",
465
+ },
466
+ },
467
+ {
468
+ title: this.$t1("来源关联字段"),
469
+ field: "relationZd",
470
+ width: 250,
471
+ },
472
+ {
473
+ title: this.$t1("关联表对应服务名"),
474
+ field: "refServiceName",
475
+ width: 200,
476
+ },
477
+ {
478
+ title: this.$t1("数据值对应表的字段"),
479
+ field: "toTaBmZd",
480
+ width: 250,
481
+ slots: {
482
+ default: "toTaBmZd",
483
+ },
484
+ },
485
+ {
486
+ title: this.$t1("字段类型对应的默认值"),
487
+ field: "zdTypeValues",
488
+ width: 200,
489
+ slots: {
490
+ default: "zdTypeValues",
491
+ },
492
+ },
493
+ {
494
+ title: this.$t1("是否必填项"),
495
+ field: "required",
496
+ width: 140,
497
+ params: {
498
+ exportVal:({row,column})=>{
499
+ return this.$t1(row[column.field]? "是": "否")
500
+ }
501
+ },
502
+ slots: {
503
+ default: "required",
504
+ },
505
+ },
506
+ {
507
+ title: this.$t1("是否启用"),
508
+ field: "enabled",
509
+ width: 120,
510
+ params: {
511
+ exportVal:({row,column})=>{
512
+ return this.$t1(row[column.field]? "是": "否")
513
+ }
514
+ },
515
+ slots: {
516
+ default: "enabled",
517
+ },
518
+ },
519
+
520
+ {
521
+ title: this.$t1("是否自动生成编码"),
522
+ field: "generateCode",
523
+ width: 180,
524
+ params: {
525
+ exportVal:({row,column})=>{
526
+ return this.$t1(row[column.field]? "是": "否")
527
+ }
528
+ },
529
+ slots: {
530
+ default: "generateCode",
531
+ },
532
+ },
533
+ {
534
+ title: this.$t1('数据库字段加密'),
535
+ field: 'atened',
536
+ width: 180,
537
+ params: {
538
+ exportVal:({row,column})=>{
539
+ return this.$t1(row[column.field]? "是": "否")
540
+ }
541
+ },
542
+ slots: {
543
+ default: "atened"
544
+ }
545
+ },
546
+ {
547
+ title: this.$t1('是否更新忽略字段'),
548
+ field: 'updateIgnore',
549
+ width: 180,
550
+ params: {
551
+ exportVal:({row,column})=>{
552
+ return this.$t1(row[column.field]? "是": "否")
553
+ }
554
+ },
555
+ slots: {
556
+ default: "updateIgnore"
557
+ }
558
+ },
559
+ {
560
+ title: this.$t1("编码类型"),
561
+ field: "codeType",
562
+ width: 150,
563
+ slots: {
564
+ default: "codeType",
565
+ },
566
+ },
567
+ {
568
+ title: this.$t1("序号"),
569
+ field: "orders",
570
+ width: 150,
571
+ slots: {
572
+ default: "orders",
573
+ },
574
+ },
575
+ {
576
+ width: 47,
577
+ fixed: "right",
578
+ title: "",
579
+ sortable: false,
580
+ slots: {
581
+ default: ({row, rowIndex, $table}) => {
582
+ let taZdMc = row.taZdMc;
583
+ let createdTableColumnArray =
584
+ this.createdTableColumnArray || [];
585
+ let hasCreated =
586
+ !!taZdMc && createdTableColumnArray.includes(taZdMc);
587
+ // let style = !row.relationZd ? "margin-left:20px" : "";
588
+ if (!row.systems && !hasCreated && !this.readonly) {
589
+ //非内置,未创建字段,非关联表带出来的字段
590
+ return getJsxBtn({
591
+ iconName: "el-icon-delete",
592
+ content: this.$t1("删除"),
593
+ onclick: () => {
594
+ this.deleteItem(row, rowIndex);
595
+ },
596
+ });
597
+ }
598
+ },
599
+ },
600
+ },
601
+ ],
602
+ };
603
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
604
+ this.productOption = opts;
605
+ });
606
+ if (this.dataId) {
607
+ this.$http({
608
+ aes: true,
609
+ url: USER_PREFIX + `/szTaMb/getSzTaZdMbs`,
610
+ method: `post`,
611
+ data: {
612
+ id: this.dataId,
613
+ },
614
+ isLoading: true,
615
+ modalStrictly: true,
616
+ success: (res) => {
617
+ this.szTaMb.szTaZdMbDTOs = res.objx || [];
618
+ },
619
+ });
620
+ }
621
+ },
622
+ addTaMbItems() {
623
+ // let tacitly = true;
624
+ // if (this.customer.szTaZdMbDTOs.length > 0) {
625
+ // tacitly = false;
626
+ // }
627
+ // this.customer.szTaZdMbDTOs.push({tacitly: tacitly});
628
+ let newIndex = this.getNewIndex();
629
+ /* let item = {
630
+ zdEn: null,
631
+ zdCh: null,
632
+ taZdMc: null,
633
+ zdTypeValues: null,
634
+ required: false,
635
+ codeType: null,
636
+ referenceZd: null,
637
+ zdType: "Text",
638
+ zdLength: "255",
639
+ enabled: true,
640
+ orders: newIndex,
641
+ relationZd:null,
642
+ refServiceName:null,
643
+
644
+ generateCode: false,
645
+ fromTable: false,
646
+ toTaBmZd: null,
647
+ treeFlag: null,
648
+ atened: false,
649
+ updateIgnore: false
650
+ }; */
651
+ let item = this.createRow();
652
+ item.orders = newIndex,
653
+ this.szTaMb.szTaZdMbDTOs.splice(0, 0, item);
654
+ },
655
+ deleteItem(row, rowIndex) {
656
+ if (row.referenceZd) {
657
+ // clearReferenceZd 是 filter 出新数组赋值回去,传进来的 rowIndex 会失效,
658
+ // 所以下面必须重新按行引用定位
659
+ this.clearReferenceZd(row);
660
+ }
661
+ let index = this.szTaMb.szTaZdMbDTOs.indexOf(row);
662
+ if (index >= 0) {
663
+ this.szTaMb.szTaZdMbDTOs.splice(index, 1);
664
+ }
665
+ },
666
+ confirmInsertSzTaMb(rows) {
667
+ if (rows.length > 0) {
668
+ let row = rows[0];
669
+ this.$set(this.szTaMb, "sszst", row.taCode);
670
+ this.$set(this.szTaMb, "sszstEn", row.taEn);
671
+ this.$set(this.szTaMb, "sszstBm", row.taBm);
672
+ }
673
+ },
674
+ confirmInsertMenuKind(rows) {
675
+ if (rows.length > 0) {
676
+ let row = rows[0];
677
+ this.$set(this.szTaMb, "menuKindCode", row.menuKindCode);
678
+ this.$set(this.szTaMb, "menuKindName", row.name);
679
+ // 权限是按表单分类取的,换了分类必须重取:
680
+ // 否则新建单据(进来时 menuKindCode 为空、menuKindAuth 停在 editAuth:0)
681
+ // 手工选完分类后「保存」按钮依然不渲染,流程直接走不下去
682
+ this.getMenuKindAuth(row.menuKindCode);
683
+ }
684
+ },
685
+ clearSszst() {
686
+ // sszst 不在 szTaMb 的初始声明里(confirmInsertSzTaMb 也是 $set 写进去的),走 $set
687
+ this.$set(this.szTaMb, "sszst", null);
688
+ this.$set(this.szTaMb, "sszstBm", null);
689
+ },
690
+ clearMenuKind() {
691
+ this.szTaMb.menuKindCode = "";
692
+ // 反向同理:分类清空后旧分类的权限不能继续留着
693
+ this.menuKindAuth = { editAuth: 0 };
694
+ },
695
+ getNewData(callback) {
696
+ this.getData((res0) => {
697
+ let szTaMb = res0.objx;
698
+ this.$http({
699
+ aes: true,
700
+ url: USER_PREFIX + `/szTaMb/getSzTaZdMbs`,
701
+ method: `post`,
702
+ data: {
703
+ id: this.dataId,
704
+ },
705
+ isLoading: true,
706
+ modalStrictly: true,
707
+ success: (res1) => {
708
+ szTaMb.szTaZdMbDTOs = res1.objx || [];
709
+ callback(szTaMb);
710
+ },
711
+ });
712
+ });
713
+ },
714
+ createModifyTable() {
715
+ let url = this.getServiceUrl("/dbTable/createUpdateTable");
716
+ if (!url) return;
717
+ let text = this.$t1("您确定要创建/更新数据表吗?");
718
+ this.$baseConfirm(text).then(() => {
719
+ this.getNewData((data) => {
720
+ this.$http({
721
+ aes: true,
722
+ url: url,
723
+ method: `post`,
724
+ data: data,
725
+ isLoading: true,
726
+ success: (res) => {
727
+ this.$message({
728
+ message: res.content,
729
+ type: "success",
730
+ duration: 500,
731
+ onClose: (t) => {
732
+ this.$baseReload();
733
+ },
734
+ });
735
+ },
736
+ });
737
+ });
738
+ });
739
+ },
740
+ /**
741
+ * 拼「服务名 + 接口路径」。serviceName 为空时不要拼出 /null/... 打到后端,
742
+ * 直接提示并返回 null,由调用方中止。
743
+ */
744
+ getServiceUrl(path) {
745
+ let serviceName = this.szTaMb.serviceName;
746
+ if (!serviceName) {
747
+ this.$baseAlert(this.$t1("服务名不能为空,请先选择表单分类"));
748
+ return null;
749
+ }
750
+ return "/" + serviceName + path;
751
+ },
752
+ isReferenceZdType(zdType) {
753
+ return zdType === "Reference" || zdType === "ReferenceLong";
754
+ },
755
+ openReferenceZdDialog(row, rowIndex, $table) {
756
+ let referenceZd = row.referenceZd;
757
+ let referenceZd2 = row.referenceZd + "." + row.zdEn;
758
+ let referenceEntity = null;
759
+ let referenceKey = null;
760
+ let referenceShowFields = [];
761
+
762
+ let referenceShowRows = [];
763
+
764
+ if (referenceZd) {
765
+ let index = referenceZd.indexOf(".");
766
+ referenceEntity = referenceZd.substring(0, index);
767
+ referenceKey = referenceZd.substr(index + 1);
768
+ // 回填已有的关联显示字段行时必须带上 zdEn / zdCh:
769
+ // confirmReferenceZdDialog 新建行要用它们拼 "ref_" + zdEn,
770
+ // 只回填 taZdMc 会生成 zdEn 为 "ref_undefined"、zdCh 为空的脏行
771
+ referenceShowRows = this.szTaMb.szTaZdMbDTOs
772
+ .filter((item) => {
773
+ return item.relationZd === referenceZd || item.relationZd === referenceZd2;
774
+ })
775
+ .map((item) => {
776
+ let taZdMc = item.referenceZd ? item.referenceZd.substr(index + 1) : null;
777
+ return {
778
+ taZdMc,
779
+ zdEn: item.zdEn ? item.zdEn.replace(/^ref_/, "") : taZdMc,
780
+ zdCh: item.zdCh,
781
+ };
782
+ });
783
+ referenceShowFields = referenceShowRows.map((item) => item.taZdMc);
784
+ }
785
+
786
+ this.referenceEntity = referenceEntity;
787
+ this.referenceKey = referenceKey;
788
+ this.referenceShowFields = referenceShowFields;
789
+ this.refServiceName = row.refServiceName ?? null;
790
+ this.referenceShowRows = referenceShowRows;
791
+
792
+ this.currentRow = row;
793
+ this.showReferenceZdDialog = true;
794
+ },
795
+ /**
796
+ * item 是不是 parentRow 在 parentRefZd 这个关联配置下带出来的显示字段行。
797
+ *
798
+ * relationZd 历史上出现过三种写法(无后缀 / 后缀是主字段 zdEn / 后缀是子行自己的 zdEn),
799
+ * 这里全部认,避免漏匹配导致子行变成孤儿。
800
+ */
801
+ isReferenceChildRow(item, parentRow, parentRefZd) {
802
+ if (!parentRefZd || !item.relationZd) {
803
+ return false;
804
+ }
805
+ return (
806
+ item.relationZd === parentRefZd
807
+ || item.relationZd === parentRefZd + "." + parentRow.zdEn
808
+ || item.relationZd === parentRefZd + "." + item.zdEn
809
+ );
810
+ },
811
+ changeZdType(row) {
812
+ let map = {
813
+ "Integer": "11",
814
+ "Long": "20",
815
+ "ReferenceLong": "20",
816
+ "Decimal": "21,6",
817
+ "Money": "21,2",
818
+ "Text": "255"
819
+ }
820
+ row.zdLength = map[row.zdType] || null;
821
+ if (!this.isReferenceZdType(row.zdType)) {
822
+ this.clearReferenceZd(row);
823
+ }
824
+ },
825
+ confirmClearReferenceZd(row) {
826
+ if (!row.referenceZd) {
827
+ return;
828
+ }
829
+ if (this.hasFieldCreated(row)) {
830
+ this.$baseAlert(this.$t1("该字段已在数据库中创建,不能清空关联配置"));
831
+ return;
832
+ }
833
+ // 这里原来还有一道「关联显示字段已在数据库中创建」的检查,是死代码:
834
+ // 显示字段行不建库、taZdMc 恒为空,hasFieldCreated 永远返回 false。
835
+ // 连同它唯一的调用方 getReferenceChildRows 一并删掉。
836
+ let text = this.$t1("清空关联配置将同时删除关联显示字段,您确定要继续吗?");
837
+ this.$baseConfirm(text).then(() => {
838
+ this.clearReferenceZd(row);
839
+ });
840
+ },
841
+ clearReferenceZd(row) {
842
+ let referenceZd = row.referenceZd;
843
+ if (referenceZd) {
844
+ let referenceZd2 = referenceZd + "." + row.zdEn;
845
+ this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter((item) => {
846
+ return referenceZd !== item.relationZd && referenceZd2 !== item.relationZd;
847
+ });
848
+ } else if (row.zdEn) {
849
+ let relationZdSuffix = "." + row.zdEn;
850
+ this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter((item) => {
851
+ return !(item.relationZd && item.relationZd.endsWith(relationZdSuffix));
852
+ });
853
+ }
854
+ row.referenceZd = null;
855
+ row.refServiceName = null;
856
+ },
857
+ confirmReferenceZdDialog() {
858
+ let row = this.currentRow;
859
+ if (!row) {
860
+ this.showReferenceZdDialog = false;
861
+ return;
862
+ }
863
+ let oldReferenceZd = row.referenceZd;
864
+ let oldReferenceZd2 = row.referenceZd + "." + row.zdEn;
865
+
866
+ let referenceEntity = this.referenceEntity;
867
+ let refServiceName = this.refServiceName;
868
+ let referenceKey = this.referenceKey
869
+ let referenceZd = referenceEntity && referenceKey ? (referenceEntity + "." + referenceKey) : null;
870
+
871
+ let referenceShowFields = this.referenceShowFields;
872
+
873
+ // 关联表 / 关联字段任一为空都拼不出合法的 referenceZd,硬走下去
874
+ // 新建行的 relationZd 会拼成 "null.xxx",父子彻底断开、之后再也认不回来。
875
+ // 两个都为空是"清空关联配置",属于合法操作,放行走下面的删除分支。
876
+ if (referenceEntity && !referenceKey) {
877
+ this.$baseAlert(this.$t1("关联字段不能为空"));
878
+ return;
879
+ }
880
+ if (!referenceZd && referenceShowFields.length) {
881
+ this.$baseAlert(this.$t1("关联表不能为空"));
882
+ return;
883
+ }
884
+
885
+ let keys = referenceShowFields.map((item) => {
886
+ return referenceEntity + "." + item;
887
+ });
888
+ if (oldReferenceZd) {
889
+ let index0 = oldReferenceZd.indexOf(".");
890
+ let oldReferenceEntity = oldReferenceZd.substring(0, index0);
891
+ let delIndex = [];
892
+ if (referenceEntity !== oldReferenceEntity) {
893
+ this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
894
+ if (item.relationZd && (oldReferenceZd === item.relationZd || oldReferenceZd2 === item.relationZd)) {
895
+ delIndex.push(index);
896
+ }
897
+ });
898
+ } else {
899
+ this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
900
+ if (oldReferenceZd === item.relationZd || oldReferenceZd2 === item.relationZd) {
901
+ if (!keys.includes(item.referenceZd)) {
902
+ delIndex.push(index);
903
+ } else {
904
+ item.refServiceName = refServiceName;
905
+ // 关联表没变、只换了关联字段时,保留下来的子行必须把 relationZd 迁到新的
906
+ // referenceZd 上。否则它们既变成认不回来的孤儿行,
907
+ // 又会因为下面 oldKeys 匹配不到而被当成"新字段"重复插入一遍。
908
+ item.relationZd = referenceZd ? referenceZd + "." + row.zdEn : null;
909
+ }
910
+ }
911
+ });
912
+ }
913
+ if (delIndex.length) {
914
+ delIndex.reverse().forEach((i) => {
915
+ this.szTaMb.szTaZdMbDTOs.splice(i, 1);
916
+ });
917
+ }
918
+ }
919
+
920
+ let oldKeys = this.szTaMb.szTaZdMbDTOs
921
+ .filter((item) => this.isReferenceChildRow(item, row, referenceZd))
922
+ .map((item) => item.referenceZd);
923
+ let addReferenceShowFields = referenceShowFields.filter((item, index) => {
924
+ return !oldKeys.includes(referenceEntity + "." + item);
925
+ });
926
+
927
+ let addIndex = -1;
928
+ let lastIndex = this.szTaMb.szTaZdMbDTOs.findLastIndex((item) => {
929
+ return this.isReferenceChildRow(item, row, referenceZd);
930
+ });
931
+ addIndex = lastIndex >= 0
932
+ ? lastIndex + 1
933
+ : this.szTaMb.szTaZdMbDTOs.indexOf(row) + 1;
934
+
935
+ let referenceShowRows = this.referenceShowRows;
936
+
937
+ let addReferenceShowRows = referenceShowRows.filter((item, index) => {
938
+ return addReferenceShowFields.includes(item.taZdMc);
939
+ });
940
+ // 已占用的字段名,用来给新建行避让重名;本轮生成的也要边生成边记进去
941
+ let usedZdEns = this.szTaMb.szTaZdMbDTOs
942
+ .map((item) => item.zdEn)
943
+ .filter((item) => !!item);
944
+ addReferenceShowRows.forEach((item, index) => {
945
+ let rIndex = addIndex + index;
946
+ let orders = (row.orders || 0) + index + 1;
947
+
948
+ let zdEn = this.buildReferenceZdEn(item.zdEn || item.taZdMc, row, usedZdEns);
949
+ usedZdEns.push(zdEn);
950
+
951
+ let newItem = this.createRow();
952
+ Object.assign(newItem, {
953
+ zdEn,
954
+ zdCh: item.zdCh || null,
955
+ required: false,
956
+ referenceZd: referenceEntity + "." + item.taZdMc,
957
+ zdType: "Text",
958
+ zdLength: "255",
959
+ enabled: true,
960
+ orders,
961
+ relationZd: referenceZd + "." + row.zdEn,
962
+ refServiceName,
963
+ })
964
+
965
+ this.szTaMb.szTaZdMbDTOs.splice(rIndex, 0, newItem);
966
+ });
967
+ row.referenceZd = referenceZd;
968
+ row.refServiceName = refServiceName;
969
+ this.handleReferenceOrders(row);
970
+ this.showReferenceZdDialog = false;
971
+ },
972
+ /**
973
+ * 生成关联显示字段行的实体字段名。
974
+ *
975
+ * 基础名是 ref_<源字段>。两个字段绑同一张表的同一个字段时会撞
976
+ * (典型:创建人 / 修改人都关联 sc_user.id 并显示 name,都想叫 ref_name),
977
+ * 撞了才退化成 ref_<父字段>_<源字段>;还撞就往后加序号。
978
+ * 先到先得,已存在的行不改名,所以存量数据不受影响。
979
+ *
980
+ * @param {String} srcName 源字段名
981
+ * @param {Object} parentRow 发起关联的主字段行
982
+ * @param {Array} usedZdEns 已占用的字段名(含本轮刚生成的)
983
+ */
984
+ buildReferenceZdEn(srcName, parentRow, usedZdEns) {
985
+ let base = "ref_" + srcName;
986
+ if (!usedZdEns.includes(base)) {
987
+ return base;
988
+ }
989
+ let withParent = parentRow.zdEn
990
+ ? "ref_" + parentRow.zdEn + "_" + srcName
991
+ : base;
992
+ if (withParent !== base && !usedZdEns.includes(withParent)) {
993
+ return withParent;
994
+ }
995
+ let index = 2;
996
+ while (usedZdEns.includes(withParent + "_" + index)) {
997
+ index++;
998
+ }
999
+ return withParent + "_" + index;
1000
+ },
1001
+ createRow(){
1002
+ let row = {
1003
+ "orders": null,
1004
+ "taCode": null,
1005
+ "zdCode": null,
1006
+ "zdEn": null,
1007
+ "zdCh": null,
1008
+ "taZdMc": null,
1009
+ "zdType": "Text",
1010
+ "zdLength": "255",
1011
+ "referenceZd": null,
1012
+ "relationZd": null,
1013
+ "refServiceName": null,
1014
+ "zdTypeValues": null,
1015
+ "required": false,
1016
+ "requiredMsg": null,
1017
+ "regexpVal": null,
1018
+ "regexpMsg": null,
1019
+ "enabled": true,
1020
+ "systems": false,
1021
+ "generateCode": false,
1022
+ "codeType": null,
1023
+ "toTaBmZd": null,
1024
+ "fromTable": false,
1025
+ "treeFlag": null,
1026
+ "atened": false,
1027
+ "updateIgnore": false,
1028
+ "abc": null
1029
+ }
1030
+ return row;
1031
+ },
1032
+ changeOrders(row) {
1033
+ this.handleReferenceOrders(row);
1034
+ },
1035
+ handleReferenceOrders(row) {
1036
+ let referenceZd = row.referenceZd;
1037
+ let orders = row.orders || 0;
1038
+ if (referenceZd) {
1039
+ this.szTaMb.szTaZdMbDTOs
1040
+ .filter((item) => this.isReferenceChildRow(item, row, referenceZd))
1041
+ .forEach((item, index) => {
1042
+ item.orders = orders + index + 1;
1043
+ });
1044
+ }
1045
+ },
1046
+ confirmEntityDialog(rows) {
1047
+ if (rows.length) {
1048
+ let row = rows[0];
1049
+ if (this.referenceEntity !== row.taBm) {
1050
+ this.referenceKey = null;
1051
+ this.referenceShowFields = [];
1052
+ // 换了关联表,上一张表的显示字段行必须一起丢掉,
1053
+ // 否则 confirmReferenceZdDialog 会拿旧表的 taZdMc 去拼新表的 referenceZd
1054
+ this.referenceShowRows = [];
1055
+ }
1056
+ this.referenceEntity = row.taBm;
1057
+ this.refServiceName = row.serviceName;
1058
+ }
1059
+ },
1060
+ clearReferenceEntity() {
1061
+ this.referenceKey = null;
1062
+ this.refServiceName = null;
1063
+ this.referenceShowFields = [];
1064
+ this.referenceShowRows = [];
1065
+ },
1066
+ openEntityFieldDialog1() {
1067
+ if (!this.referenceEntity) {
1068
+ this.$baseAlert(this.$t1("关联表不能为空"));
1069
+ return;
1070
+ }
1071
+ this.showEntityFieldDialog1 = true;
1072
+ },
1073
+ confirmEntityFieldDialog1(rows) {
1074
+ if (rows.length) {
1075
+ let row = rows[0];
1076
+ this.referenceKey = row.taZdMc;
1077
+ }
1078
+ },
1079
+ openEntityFieldDialog2() {
1080
+ if (!this.referenceEntity) {
1081
+ this.$baseAlert(this.$t1("关联表不能为空"));
1082
+ return;
1083
+ }
1084
+ this.showEntityFieldDialog2 = true;
1085
+ },
1086
+ confirmEntityFieldDialog2(rows) {
1087
+ // 不能用 rows.length 兜底:回填可用之后,把勾选全部取消掉
1088
+ // 就是"清空显示字段"的正常操作,必须让它生效
1089
+ this.referenceShowRows = rows || [];
1090
+ this.referenceShowFields = this.referenceShowRows.map((row) => {
1091
+ return row.taZdMc;
1092
+ });
1093
+ },
1094
+ getCreatedTableColumns() {
1095
+ // 这里是首屏静默取数,serviceName 缺失时直接跳过,不弹提示打扰用户
1096
+ if (!this.szTaMb.taBm || !this.szTaMb.serviceName) return;
1097
+ this.$http({
1098
+ aes: true,
1099
+ url: "/" + this.szTaMb.serviceName + "/dbTable/getTableColumns",
1100
+ method: `post`,
1101
+ data: {
1102
+ stringOne: this.szTaMb.taBm,
1103
+ },
1104
+ isLoading: true,
1105
+ modalStrictly: true,
1106
+ success: (res) => {
1107
+ if (res.objx) {
1108
+ this.createdTableColumnStr = res.objx;
1109
+ let createdTableColumnArray = res.objx
1110
+ .split(",")
1111
+ .filter((item) => !!item);
1112
+ this.createdTableColumnArray = createdTableColumnArray;
1113
+ }
1114
+ },
1115
+ });
1116
+ },
1117
+ getTreeDefaultZds() {
1118
+ this.$http({
1119
+ aes: true,
1120
+ url: USER_PREFIX + `/szTaMb/getTreeDefaultZds`,
1121
+ method: `post`,
1122
+ data: {},
1123
+ isLoading: true,
1124
+ modalStrictly: true,
1125
+ success: (res) => {
1126
+ let rows = res.objx || [];
1127
+ this.treeDefaultZds = rows;
1128
+ },
1129
+ });
1130
+ },
1131
+ hasFieldCreated(row) {
1132
+ let taZdMc = row.taZdMc;
1133
+ let createdTableColumnArray = this.createdTableColumnArray || [];
1134
+ let hasCreated = !!taZdMc && createdTableColumnArray.includes(taZdMc);
1135
+ return hasCreated;
1136
+ },
1137
+ changeTaRule(val) {
1138
+ let treeDefaultZds = this.$baseLodash.cloneDeep(this.treeDefaultZds);
1139
+ let szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
1140
+ if (val === 1) {
1141
+ let zdEns = szTaZdMbDTOs
1142
+ .filter((item) => !!item.zdEn)
1143
+ .map((item) => item.zdEn);
1144
+ if (zdEns.length) {
1145
+ treeDefaultZds = treeDefaultZds.filter((item) => {
1146
+ return !zdEns.includes(item.zdEn);
1147
+ });
1148
+ }
1149
+ let newIndex = this.getNewIndex();
1150
+ treeDefaultZds.forEach((item, index) => {
1151
+ item.orders = newIndex + index;
1152
+ });
1153
+ szTaZdMbDTOs.push(...treeDefaultZds);
1154
+ } else {
1155
+ let zdEns = szTaZdMbDTOs
1156
+ .filter((item) => !!item.zdEn)
1157
+ .map((item) => item.zdEn);
1158
+ let createdFields = szTaZdMbDTOs
1159
+ .filter((item) => {
1160
+ return !!item.zdEn && this.hasFieldCreated(item);
1161
+ })
1162
+ .map((item) => item.zdEn);
1163
+ if (zdEns.length) {
1164
+ treeDefaultZds = treeDefaultZds.filter((item) => {
1165
+ return (
1166
+ !createdFields.includes(item.zdEn) && zdEns.includes(item.zdEn)
1167
+ );
1168
+ });
1169
+ }
1170
+ let delFields = treeDefaultZds.map((item) => item.zdEn);
1171
+ this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter(
1172
+ (item) => !delFields.includes(item.zdEn)
1173
+ );
1174
+ }
1175
+ },
1176
+ getNewIndex() {
1177
+ let min = 100;
1178
+ let szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
1179
+ let value = 0;
1180
+ szTaZdMbDTOs.forEach((item) => {
1181
+ let orders = item.orders;
1182
+ if (orders !== null && orders !== undefined && orders < 9000) {
1183
+ value = Math.max(value, orders);
1184
+ }
1185
+ });
1186
+ let newIndex = Math.max(min, value + 10);
1187
+ return newIndex;
1188
+ },
1189
+ getBdEnv() {
1190
+ getBdFlag({
1191
+ success: (res) => {
1192
+ this.isDev = res.objx === 1;
1193
+ },
1194
+ });
1195
+ },
1196
+
1197
+ getMenuKindAuth(menuKindCode) {
1198
+ if(this.otherFlag){
1199
+ this.getOtherMenuKindAuth();
1200
+ }else if (menuKindCode) {
1201
+ this.$http({
1202
+ aes: true,
1203
+ url: USER_PREFIX + "/menu_kind_auth/getAuth",
1204
+ method: `post`,
1205
+ data: {stringOne: menuKindCode},
1206
+ isLoading: true,
1207
+ success: (res) => {
1208
+ this.menuKindAuth = res.objx || {};
1209
+ },
1210
+ });
1211
+ }
1212
+ },
1213
+ openDtDialog() {
1214
+ //引用数据库中数据表结构
1215
+ this.dbTable = null;
1216
+ this.showDtDialog = true;
1217
+ },
1218
+ confirmDtDialog() {
1219
+ let dbTable = this.dbTable;
1220
+ if (!dbTable) {
1221
+ this.$baseAlert(this.$t1("数据表不能为空"));
1222
+ return;
1223
+ }
1224
+ let url = this.getServiceUrl("/dbTable/getSzTaZdMbs");
1225
+ if (!url) return;
1226
+ this.showDtDialog = false;
1227
+ this.$http({
1228
+ // aes: true,
1229
+ url: url,
1230
+ method: `post`,
1231
+ data: {
1232
+ stringOne: dbTable,
1233
+ },
1234
+ isLoading: true,
1235
+ success: (res) => {
1236
+ let items = res.objx || [];
1237
+ if (!items.length) {
1238
+ this.$baseAlert(this.$t1("数据表[{dbTable}]不存在", {dbTable}));
1239
+ return;
1240
+ }
1241
+ let szTaZdMbDTOs = items
1242
+ .filter((item) => !item.systems)
1243
+ .map((item) => {
1244
+ return {
1245
+ ...item,
1246
+ createBy: null,
1247
+ createDate: null,
1248
+ fromTable: true,
1249
+ id: null,
1250
+ modifyBy: null,
1251
+ modifyDate: null,
1252
+ };
1253
+ });
1254
+ this.szTaMb.taEn = dbTable;
1255
+ this.szTaMb.taBm = dbTable;
1256
+ this.szTaMb.szTaZdMbDTOs = szTaZdMbDTOs;
1257
+ },
1258
+ });
1259
+ },
1260
+ openTmDialog() {
1261
+ //引用数据表定义的结构
1262
+ this.showTmDialog = true;
1263
+ },
1264
+ confirmTmDialog(rows) {
1265
+ if (rows.length) {
1266
+ let row = rows[0];
1267
+ this.$http({
1268
+ aes: true,
1269
+ url: USER_PREFIX + `/szTaMb/getSzTaZdMbs`,
1270
+ method: `post`,
1271
+ data: {
1272
+ id: row.id,
1273
+ },
1274
+ isLoading: true,
1275
+ modalStrictly: true,
1276
+ success: (res) => {
1277
+ let items = res.objx || [];
1278
+ let szTaZdMbDTOs = items
1279
+ .filter((item) => !item.systems)
1280
+ .map((item) => {
1281
+ return {
1282
+ ...item,
1283
+ createBy: null,
1284
+ createDate: null,
1285
+ fromTable: true,
1286
+ id: null,
1287
+ modifyBy: null,
1288
+ modifyDate: null,
1289
+ };
1290
+ });
1291
+ let newRow = {
1292
+ ...row,
1293
+ createBy: null,
1294
+ createDate: null,
1295
+ fromTable: true,
1296
+ id: null,
1297
+ modifyBy: null,
1298
+ modifyDate: null,
1299
+ sid: null,
1300
+ // taBm: null,
1301
+ taCode: null,
1302
+ };
1303
+ Object.keys(newRow).forEach((key) => {
1304
+ if (key.endsWith("DTOs")) {
1305
+ delete newRow[key];
1306
+ }
1307
+ });
1308
+ Object.assign(this.szTaMb, newRow);
1309
+ this.szTaMb.szTaZdMbDTOs = szTaZdMbDTOs;
1310
+ },
1311
+ });
1312
+ }
1313
+ },
1314
+ openToTaBmZdDialog(row, rowIndex, $table) {
1315
+ let toTaBmZd = row.toTaBmZd;
1316
+ let toTaBmZdEntity = null;
1317
+ let toTaBmZdField = null;
1318
+ if (toTaBmZd) {
1319
+ toTaBmZd.split(".").forEach((item, index) => {
1320
+ if (index === 0) {
1321
+ toTaBmZdEntity = item;
1322
+ } else if (index === 1) {
1323
+ toTaBmZdField = item;
1324
+ }
1325
+ });
1326
+ } else {
1327
+ if (this.szTaMb.taType === 1 && this.szTaMb.sszstBm) {
1328
+ toTaBmZdEntity = this.szTaMb.sszstBm;
1329
+ }
1330
+ }
1331
+ this.toTaBmZdEntity = toTaBmZdEntity;
1332
+ this.toTaBmZdField = toTaBmZdField;
1333
+ this.toTaBmZdRow = row;
1334
+ this.showToTaBmZdDialog = true;
1335
+ },
1336
+ confirmToTaBmZdDialog() {
1337
+ let row = this.toTaBmZdRow;
1338
+ if (!row) {
1339
+ this.showToTaBmZdDialog = false;
1340
+ return;
1341
+ }
1342
+ let toTaBmZdEntity = this.toTaBmZdEntity;
1343
+ let toTaBmZdField = this.toTaBmZdField;
1344
+ if (!toTaBmZdEntity) {
1345
+ this.$baseAlert(this.$t1("对应表不能为空"));
1346
+ return;
1347
+ }
1348
+ if (!toTaBmZdField) {
1349
+ this.$baseAlert(this.$t1("对应表字段不能为空"));
1350
+ return;
1351
+ }
1352
+ row.toTaBmZd = toTaBmZdEntity + "." + toTaBmZdField;
1353
+ this.showToTaBmZdDialog = false;
1354
+ },
1355
+ openEntityDialog3() {
1356
+ this.showEntityDialog3 = true;
1357
+ },
1358
+ confirmEntityDialog3(rows) {
1359
+ if (rows.length) {
1360
+ let row = rows[0];
1361
+ if (this.toTaBmZdEntity !== row.taBm) {
1362
+ this.toTaBmZdEntity = row.taBm;
1363
+ this.toTaBmZdField = null;
1364
+ }
1365
+ }
1366
+ },
1367
+ openEntityFieldDialog3() {
1368
+ if (!this.toTaBmZdEntity) {
1369
+ this.$baseAlert(this.$t1("关联表不能为空"));
1370
+ return;
1371
+ }
1372
+ this.showEntityFieldDialog3 = true;
1373
+ },
1374
+ confirmEntityFieldDialog3(rows) {
1375
+ if (rows.length) {
1376
+ let row = rows[0];
1377
+ this.toTaBmZdField = row.taZdMc;
1378
+ }
1379
+ },
1380
+ /**
1381
+ * 进入字段名输入框时记下原值。
1382
+ *
1383
+ * 原来是靠 keydown 开闸(fkey),但鼠标右键粘贴、拖拽填入、部分输入法提交路径
1384
+ * 都不产生 keydown,那些场景下 changeZdEn 整个被跳过,子行的 relationZd
1385
+ * 会停在旧字段名上变成孤儿行。改成 focus 播种,任何修改途径都覆盖得到。
1386
+ */
1387
+ cacheZdEn(row) {
1388
+ this.preValue = row.zdEn;
1389
+ },
1390
+ /**
1391
+ * 改字段名时,把该行关联带出来的显示字段行的 relationZd 一起迁过去。
1392
+ */
1393
+ changeZdEn(val, row) {
1394
+ let oldVal = this.preValue;
1395
+ let newVal = val;
1396
+ this.preValue = newVal;
1397
+ if (oldVal === undefined || oldVal === null || oldVal === newVal) {
1398
+ return;
1399
+ }
1400
+ if (this.isReferenceZdType(row.zdType)) {
1401
+ let referenceZd = row.referenceZd;
1402
+ if (referenceZd) {
1403
+ let referenceZd2 = referenceZd + "." + oldVal;
1404
+ let relationZd = referenceZd + "." + newVal;
1405
+ this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
1406
+ if (referenceZd === item.relationZd || referenceZd2 === item.relationZd) {
1407
+ item.relationZd = relationZd;
1408
+ }
1409
+ });
1410
+ }
1411
+ }
1412
+ },
1413
+
1414
+ getOtherMenuKindAuth() {
1415
+ if (this.otherFlag && this.szTaMb.sid) {
1416
+ this.$http({
1417
+ aes: true,
1418
+ url: USER_PREFIX + "/sz_ta_mb_auth/getAuth",
1419
+ method: `post`,
1420
+ data: {stringOne: this.szTaMb.sid},
1421
+ isLoading: true,
1422
+ success: (res) => {
1423
+ this.menuKindAuth = res.objx || {};
1424
+ },
1425
+ });
1426
+ }
1427
+ },
1428
+ openOtherAuthDialog(){
1429
+ this.sid = this.szTaMb.sid
1430
+ this.showOtherAuthDialog = true
1431
+ },
1432
+ confirmOtherAuthDialog(){
1433
+ this.$baseReload()
1434
+ },
1435
+ excelExport(){
1436
+ this.$excelExport({title: this.$t1('数据表字段明细导出'), targetRef: 'table-szTaZdMb', prefix: USER_PREFIX, type: 'selected'})
1437
+ },
1438
+ getHValue(row, column) {
1439
+ if (row.hData && row.hData.id) {
1440
+ let result = row.hData[column.property];
1441
+ if(column.property === 'zdType'){
1442
+ result = this.zdTypeMap[result]
1443
+ }else if(column.property === 'treeFlag'){
1444
+ result = this.treeFlagMap[result]
1445
+ }
1446
+ return result
1447
+ }/* else if (!row?.hData?.id) {
1448
+ return "HAS_NO_HDATA";
1449
+ } */ else {
1450
+ return null;
1451
+ }
1452
+ },
1453
+ },
1454
+ };
1455
+ export default modules;