cloud-web-corejs 1.0.54-dev.810 → 1.0.54-dev.811

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 (83) hide show
  1. package/package.json +1 -1
  2. package/src/components/VabUpload/image-viewer.vue +442 -442
  3. package/src/components/VabUpload/index.vue +44 -2
  4. package/src/components/VabUpload/mixins.js +126 -19
  5. package/src/components/VabUpload/view.vue +247 -209
  6. package/src/components/baseTabs/mixins.js +181 -181
  7. package/src/components/mobile/wf/content.vue +1665 -1556
  8. package/src/components/table/config.js +78 -78
  9. package/src/components/table/index.js +1276 -1276
  10. package/src/components/table/tableForm.vue +330 -330
  11. package/src/components/table/tableFormMixin.js +318 -318
  12. package/src/components/table/vxeFilter/index.js +163 -163
  13. package/src/components/table/vxeFilter/mixin.js +316 -316
  14. package/src/components/wf/content.vue +1188 -1188
  15. package/src/components/wf/wf.js +29 -12
  16. package/src/components/wf/wfActionDropdown.vue +1 -1
  17. package/src/components/wf/wfActionItems.js +1 -1
  18. package/src/components/xform/docs/2026-08 xform H5 P0 /345/256/236/347/216/260/350/247/204/346/240/274.md" +528 -0
  19. package/src/components/xform/docs/2026-08 xform H5 P1 /345/256/236/347/216/260/350/247/204/346/240/274.md" +412 -0
  20. package/src/components/xform/docs/2026-08 xform H5 P2 /345/256/236/347/216/260/350/247/204/346/240/274.md" +287 -0
  21. package/src/components/xform/docs/2026-08 xform /347/247/273/345/212/250/347/253/257/345/270/203/345/261/200/345/257/271/351/275/220 bill_setting /346/226/271/346/241/210.md" +400 -0
  22. package/src/components/xform/form-designer/designer.js +15 -0
  23. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +269 -269
  24. package/src/components/xform/form-designer/form-widget/container-widget/detail-temp-widget.vue +132 -0
  25. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +250 -250
  26. package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +319 -320
  27. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +365 -365
  28. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +554 -555
  29. package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +409 -409
  30. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +150 -132
  31. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +114 -114
  32. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +154 -154
  33. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +29 -1
  34. package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +178 -178
  35. package/src/components/xform/form-designer/form-widget/field-widget/mixins/time-limit-mixin.js +77 -77
  36. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +139 -139
  37. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +106 -106
  38. package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +134 -134
  39. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +1 -0
  40. package/src/components/xform/form-designer/setting-panel/form-setting.vue +39 -39
  41. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +438 -438
  42. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +2103 -2103
  43. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-temp-edito.vue +90 -0
  44. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +82 -82
  45. package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +8 -8
  46. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +137 -137
  47. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +237 -237
  48. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +43 -43
  49. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +43 -43
  50. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +96 -96
  51. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +42 -42
  52. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +43 -43
  53. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +158 -158
  54. package/src/components/xform/form-designer/setting-panel/property-editor/h5Span-editor.vue +51 -0
  55. package/src/components/xform/form-designer/setting-panel/property-editor/itemStyle-editor.vue +39 -0
  56. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +188 -188
  57. package/src/components/xform/form-designer/setting-panel/property-editor/styleTempClass-editor.vue +51 -0
  58. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +347 -347
  59. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +4 -0
  60. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +55 -3
  61. package/src/components/xform/form-render/container-item/data-table-mixin.js +33 -12
  62. package/src/components/xform/form-render/container-item/detail-h5-item.vue +183 -32
  63. package/src/components/xform/form-render/container-item/detail-temp-item.vue +110 -0
  64. package/src/components/xform/form-render/container-item/h5-card-pane-item.vue +160 -140
  65. package/src/components/xform/form-render/container-item/list-h5-item.vue +1642 -1700
  66. package/src/components/xform/form-render/index.vue +153 -147
  67. package/src/components/xform/form-render/indexMixin.js +12 -0
  68. package/src/components/xform/lang/en-US.js +10 -0
  69. package/src/components/xform/lang/zh-CN.js +12 -0
  70. package/src/components/xform/mixins/defaultHandle.js +707 -707
  71. package/src/components/xform/styles/h5.scss +1633 -0
  72. package/src/components/xform/utils/textMaskUtil.js +182 -182
  73. package/src/components/xform/utils/treeTableUtil.js +1292 -1265
  74. package/src/components/xform/utils/util.js +56 -11
  75. package/src/utils/pdfUtil.js +429 -429
  76. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -174
  77. package/src/views/bd/setting/table_model/edit.vue +1066 -1066
  78. package/src/views/bd/setting/table_model/mixins/edit.js +1455 -1455
  79. package/src/views/bd/setting/table_model/mixins/zdDialog.js +148 -148
  80. package/src/views/user/home/wjl/content.vue +394 -31
  81. package/src/views/user/role/edit.vue +632 -632
  82. package/src/views/user/role/list.vue +260 -260
  83. package/src/views/user/wf/wf_manage/list.vue +1116 -1116
@@ -1,318 +1,318 @@
1
- import Sortable from "sortablejs";
2
- import tableUtil from "../../components/table/index.js";
3
-
4
- let modules = {};
5
- modules = {
6
- name: "tableForm",
7
- props: {
8
- formData: {
9
- type: Object,
10
- },
11
-
12
- },
13
- data() {
14
- return {
15
- showAdvancedSearch: false,
16
- form1Fields: [],
17
- form2Fields: [],
18
- /* 全量列,「确定」按它回写,隐藏列也在里面(不能丢,它照样往上送条件) */
19
- tableColumns: [],
20
- /* 弹框实际渲染的列,是 tableColumns 里非隐藏项的**引用**(同一批对象,改默认值直接生效) */
21
- dialogColumns: [],
22
- dialogVisible: false,
23
- advancedFormData: {},
24
- formDataClone: {},
25
- showAdvancedContent: true
26
- };
27
- },
28
- watch: {},
29
- created() {},
30
- mounted() {
31
- let $grid = this.$parent;
32
- $grid.tableFormStop = true; //阻塞列表查询
33
- this.init(10);
34
- },
35
- methods: {
36
- openAdvancedSearchDialog() {
37
- let $grid = this.$parent;
38
- let formData = this.formData;
39
- let formData2 = this.$baseLodash.cloneDeep(this.formData);
40
- let advancedFormData = {};
41
- $grid.params.searchColumns.forEach((form1Field) => {
42
- let nullValue = this.getNullValue(form1Field);
43
- if (!form1Field.common) {
44
- let value = formData2[form1Field.field];
45
- if (value !== null && value !== undefined) {
46
- advancedFormData[form1Field.field] = value;
47
- } else {
48
- advancedFormData[form1Field.field] = nullValue;
49
- }
50
- }
51
- });
52
- this.advancedFormData = advancedFormData;
53
- this.formDataClone = this.$baseLodash.cloneDeep(this.formData);
54
- this.showAdvancedSearch = true;
55
- },
56
- confirmAdvancedSearchDialog() {
57
- let formDataClone = this.formDataClone;
58
- let $grid = this.$parent;
59
- let formData = this.formData;
60
- let advancedFormData = this.advancedFormData;
61
- $grid.params.searchColumns.forEach((form1Field) => {
62
- let field = form1Field.field;
63
- let nullValue = this.getNullValue(form1Field);
64
- if (!form1Field.common) {
65
- let value = advancedFormData[field];
66
- if (!!form1Field.slot && formData[field] !== formDataClone[field]) {
67
- } else if (value !== null && value !== undefined) {
68
- formData[field] = value;
69
- } else {
70
- formData[field] = nullValue;
71
- }
72
- }
73
- });
74
- this.searchEvent();
75
- },
76
- clearAdvancedSearchDialog() {
77
- let $grid = this.$parent;
78
- let formData = this.formData;
79
- let advancedFormData = this.advancedFormData;
80
- $grid.params.searchColumns.forEach((form1Field) => {
81
- let nullValue = this.getNullValue(form1Field);
82
- if (!form1Field.common) {
83
-
84
- // formData[form1Field.field] = nullValue;
85
- if(formData[form1Field.field] && Array.isArray(formData[form1Field.field]) ){
86
- formData[form1Field.field].length = 0;
87
- }else{
88
- formData[form1Field.field] = nullValue;
89
- }
90
-
91
- if(advancedFormData[form1Field.field] && Array.isArray(advancedFormData[form1Field.field]) ){
92
- advancedFormData[form1Field.field].length = 0;
93
- }else{
94
- advancedFormData[form1Field.field] = nullValue;
95
- }
96
- }
97
- });
98
- this.$emit("advancedClear",formData);
99
- this.showAdvancedContent = false;
100
- this.$nextTick(() => {
101
- this.showAdvancedContent = true;
102
- })
103
- },
104
- searchEvent() {
105
- this.$emit("searchEvent");
106
- },
107
- resetEvent() {
108
- this.$emit("resetEvent");
109
- },
110
- init(s) {
111
- setTimeout(() => {
112
- let $grid = this.$parent;
113
- if (!$grid.params) {
114
- this.init(10);
115
- return;
116
- }
117
- let originOption = $grid.params.originOption;
118
- if (!originOption || !$grid.params.searchColumns) {
119
- this.init(10);
120
- return;
121
- }
122
- this.handleSyncFun();
123
- }, s);
124
- },
125
- getIsDateRange(item) {
126
- let type = item.type;
127
- let widgetType = item.widgetType;
128
- let widgetConfig = item.widgetConfig || {};
129
- let isDateRange = false;
130
- if (type === "time" && widgetConfig.isRange) {
131
- isDateRange = true;
132
- } else if (type === "date") {
133
- if (widgetConfig.isRange) {
134
- isDateRange = true;
135
- } else if (
136
- [
137
- "dates",
138
- "months",
139
- "years",
140
- "datetimerange",
141
- "daterange",
142
- "monthrange",
143
- ].includes(widgetType)
144
- ) {
145
- isDateRange = true;
146
- }
147
- }
148
-
149
- return isDateRange;
150
- },
151
- getNullValue(item) {
152
- let type = item.type;
153
- let widgetType = item.widgetType;
154
- let widgetConfig = item.widgetConfig || {};
155
- let value = null;
156
- if (type === "inputBatch") {
157
- value = [];
158
- } else if (this.getIsDateRange(item)) {
159
- // value = [];
160
- value = null;
161
- }
162
- return value;
163
- },
164
- handleSyncFun() {
165
- let requests = [];
166
- let $grid = this.$parent;
167
- let originOption = $grid.params.originOption;
168
- let formData = this.formData;
169
- let advancedFormData = this.advancedFormData;
170
- $grid.params.searchColumns.forEach((form1Field) => {
171
- if (form1Field.defaultValueEnabled !== false) {
172
- if (form1Field.common) {
173
- if (form1Field.hasOwnProperty("defaultValue")) {
174
- this.$set(formData, form1Field.field, form1Field.defaultValue);
175
- }
176
- } else {
177
- if (form1Field.hasOwnProperty("defaultValue")) {
178
- // this.$set(advancedFormData, form1Field.field, form1Field.defaultValue);
179
- this.$set(formData, form1Field.field, form1Field.defaultValue);
180
- }
181
- }
182
- }
183
-
184
- if (form1Field.syncHandle) {
185
- requests.push(
186
- form1Field.syncHandle().then((rows) => {
187
- let itemOption = rows || [];
188
- form1Field.itemOption = itemOption;
189
- let nColumn = originOption.searchColumns.find(
190
- (item) => item.field === form1Field.field
191
- );
192
- if (nColumn) {
193
- nColumn.itemOption = itemOption;
194
- }
195
- })
196
- );
197
- }
198
- });
199
- $grid.tableFormStop = false; //释放列表查询
200
- if (requests.length) {
201
- Promise.all(requests)
202
- .then((responses) => {
203
- let searchColumns = this.$baseLodash.cloneDeep($grid.params.searchColumns);
204
- this.form1Fields = searchColumns.filter((item) => item.common);
205
- this.form2Fields = searchColumns.filter((item) => !item.common);
206
- })
207
- .catch((error) => {
208
- // 至少一个请求失败了
209
- console.error("An error occurred:", error);
210
- });
211
- } else {
212
- let searchColumns = this.$baseLodash.cloneDeep($grid.params.searchColumns);
213
- this.form1Fields = searchColumns.filter((item) => item.common);
214
- this.form2Fields = searchColumns.filter((item) => !item.common);
215
- }
216
- },
217
- openTableColumnsDialog() {
218
- let $grid = this.$parent;
219
- // 原写法 let tableColumns = (tableColumns = ...) 自引用触发 TDZ,
220
- // 只因 Babel 把 let 降成 var 才没在浏览器里炸
221
- let tableColumns = this.$baseLodash.cloneDeep(
222
- $grid.params.searchColumns || []
223
- );
224
- tableColumns.forEach((item) => {
225
- if (!item.widgetConfig) item.widgetConfig = {};
226
- });
227
- this.tableColumns = tableColumns;
228
- // 隐藏字段(如查询区里存树ID的隐藏输入框)是内部条件,不给用户看也不给拖
229
- this.dialogColumns = tableColumns.filter((item) => !item.hidden);
230
- this.dialogVisible = true;
231
- this.$nextTick(() => {
232
- this.$nextTick(() => {
233
- this.dragSort();
234
- });
235
- });
236
- },
237
- dragSort: function () {
238
- let e = this.$refs.singleTable.$el.querySelectorAll(
239
- ".el-table__body-wrapper > table > tbody"
240
- )[0],
241
- t = this.tableColumns,
242
- visible = this.dialogColumns;
243
- this.sortable = Sortable.create(e, {
244
- ghostClass: "sortable-ghost",
245
- // 固定查询条件不可拖动(它的位置由配置决定,个性化也不该记)
246
- filter: ".drag-disabled",
247
- setData: function (e) {
248
- e.setData("Text", "");
249
- },
250
- onEnd: function (e) {
251
- // 拖拽发生在「可见列」上,隐藏列不在其中,所以要把新次序同步回全量列:
252
- // 先在可见列里挪好,再按「新位置的后一个可见列」定位插到全量列的哪里。
253
- let moved = visible.splice(e.oldIndex, 1)[0];
254
- visible.splice(e.newIndex, 0, moved);
255
- let fullIndex = t.indexOf(moved);
256
- if (fullIndex > -1) {
257
- t.splice(fullIndex, 1);
258
- }
259
- let nextVisible = visible[e.newIndex + 1];
260
- let insertAt = nextVisible ? t.indexOf(nextVisible) : t.length;
261
- t.splice(insertAt < 0 ? t.length : insertAt, 0, moved);
262
- },
263
- });
264
- },
265
- /** 固定查询条件行加标记类:禁拖拽(Sortable filter)+ 视觉上区分 */
266
- dialogRowClassName({ row }) {
267
- return row && row.lockValue ? "drag-disabled" : "";
268
- },
269
- dialogPrimary(newTableColumns) {
270
- let searchColumns = this.$baseLodash.cloneDeep(
271
- newTableColumns || this.tableColumns
272
- );
273
- this.form1Fields = searchColumns.filter((item) => item.common);
274
- this.form2Fields = searchColumns.filter((item) => !item.common);
275
- let $grid = this.$parent;
276
- $grid.params.searchColumns = searchColumns;
277
-
278
- let originOption = $grid.params.originOption;
279
- let tableName = originOption.tableName;
280
- tableUtil.addTableJson(originOption.vue, $grid, tableName);
281
- this.dialogVisible = false;
282
-
283
- let formData = this.formData;
284
- let advancedFormData = this.advancedFormData;
285
- /*formData = {};
286
- advancedFormData = {};*/
287
- // this.$set(this, "formData", {});
288
- // this.$set(this, "advancedFormData", {});
289
- searchColumns.forEach((form1Field) => {
290
- // 固定查询条件:值由业务通道(树点选 / 脚本 setValue / 页面回填)注入,
291
- // 「确定」「还原」都不许覆盖它,否则一点设置就把当前上下文查丢了。
292
- // 注意只认 lockValue,不认 fixed —— 手写页面的 fixed 列(如分支)
293
- // 正是靠这里按 defaultValue 回填的,跳过它们会打掉原有行为。
294
- if (form1Field.lockValue) {
295
- return;
296
- }
297
- let nullValue = this.getNullValue(form1Field);
298
- let defaultValue = nullValue;
299
- if (form1Field.defaultValueEnabled !== false) {
300
- defaultValue = form1Field.defaultValue ?? nullValue;
301
- }
302
- let currentData = formData;
303
- this.$set(currentData, form1Field.field, defaultValue);
304
- if (form1Field.field2) {
305
- this.$set(currentData, form1Field.field2, defaultValue);
306
- }
307
- });
308
- this.searchEvent();
309
- this.$emit("settingConfirm");
310
- },
311
- dialogReset() {
312
- let $grid = this.$parent;
313
- let originOption = $grid.params.originOption;
314
- this.dialogPrimary(originOption.searchColumns);
315
- },
316
- },
317
- };
318
- export default modules;
1
+ import Sortable from "sortablejs";
2
+ import tableUtil from "../../components/table/index.js";
3
+
4
+ let modules = {};
5
+ modules = {
6
+ name: "tableForm",
7
+ props: {
8
+ formData: {
9
+ type: Object,
10
+ },
11
+
12
+ },
13
+ data() {
14
+ return {
15
+ showAdvancedSearch: false,
16
+ form1Fields: [],
17
+ form2Fields: [],
18
+ /* 全量列,「确定」按它回写,隐藏列也在里面(不能丢,它照样往上送条件) */
19
+ tableColumns: [],
20
+ /* 弹框实际渲染的列,是 tableColumns 里非隐藏项的**引用**(同一批对象,改默认值直接生效) */
21
+ dialogColumns: [],
22
+ dialogVisible: false,
23
+ advancedFormData: {},
24
+ formDataClone: {},
25
+ showAdvancedContent: true
26
+ };
27
+ },
28
+ watch: {},
29
+ created() {},
30
+ mounted() {
31
+ let $grid = this.$parent;
32
+ $grid.tableFormStop = true; //阻塞列表查询
33
+ this.init(10);
34
+ },
35
+ methods: {
36
+ openAdvancedSearchDialog() {
37
+ let $grid = this.$parent;
38
+ let formData = this.formData;
39
+ let formData2 = this.$baseLodash.cloneDeep(this.formData);
40
+ let advancedFormData = {};
41
+ $grid.params.searchColumns.forEach((form1Field) => {
42
+ let nullValue = this.getNullValue(form1Field);
43
+ if (!form1Field.common) {
44
+ let value = formData2[form1Field.field];
45
+ if (value !== null && value !== undefined) {
46
+ advancedFormData[form1Field.field] = value;
47
+ } else {
48
+ advancedFormData[form1Field.field] = nullValue;
49
+ }
50
+ }
51
+ });
52
+ this.advancedFormData = advancedFormData;
53
+ this.formDataClone = this.$baseLodash.cloneDeep(this.formData);
54
+ this.showAdvancedSearch = true;
55
+ },
56
+ confirmAdvancedSearchDialog() {
57
+ let formDataClone = this.formDataClone;
58
+ let $grid = this.$parent;
59
+ let formData = this.formData;
60
+ let advancedFormData = this.advancedFormData;
61
+ $grid.params.searchColumns.forEach((form1Field) => {
62
+ let field = form1Field.field;
63
+ let nullValue = this.getNullValue(form1Field);
64
+ if (!form1Field.common) {
65
+ let value = advancedFormData[field];
66
+ if (!!form1Field.slot && formData[field] !== formDataClone[field]) {
67
+ } else if (value !== null && value !== undefined) {
68
+ formData[field] = value;
69
+ } else {
70
+ formData[field] = nullValue;
71
+ }
72
+ }
73
+ });
74
+ this.searchEvent();
75
+ },
76
+ clearAdvancedSearchDialog() {
77
+ let $grid = this.$parent;
78
+ let formData = this.formData;
79
+ let advancedFormData = this.advancedFormData;
80
+ $grid.params.searchColumns.forEach((form1Field) => {
81
+ let nullValue = this.getNullValue(form1Field);
82
+ if (!form1Field.common) {
83
+
84
+ // formData[form1Field.field] = nullValue;
85
+ if(formData[form1Field.field] && Array.isArray(formData[form1Field.field]) ){
86
+ formData[form1Field.field].length = 0;
87
+ }else{
88
+ formData[form1Field.field] = nullValue;
89
+ }
90
+
91
+ if(advancedFormData[form1Field.field] && Array.isArray(advancedFormData[form1Field.field]) ){
92
+ advancedFormData[form1Field.field].length = 0;
93
+ }else{
94
+ advancedFormData[form1Field.field] = nullValue;
95
+ }
96
+ }
97
+ });
98
+ this.$emit("advancedClear",formData);
99
+ this.showAdvancedContent = false;
100
+ this.$nextTick(() => {
101
+ this.showAdvancedContent = true;
102
+ })
103
+ },
104
+ searchEvent() {
105
+ this.$emit("searchEvent");
106
+ },
107
+ resetEvent() {
108
+ this.$emit("resetEvent");
109
+ },
110
+ init(s) {
111
+ setTimeout(() => {
112
+ let $grid = this.$parent;
113
+ if (!$grid.params) {
114
+ this.init(10);
115
+ return;
116
+ }
117
+ let originOption = $grid.params.originOption;
118
+ if (!originOption || !$grid.params.searchColumns) {
119
+ this.init(10);
120
+ return;
121
+ }
122
+ this.handleSyncFun();
123
+ }, s);
124
+ },
125
+ getIsDateRange(item) {
126
+ let type = item.type;
127
+ let widgetType = item.widgetType;
128
+ let widgetConfig = item.widgetConfig || {};
129
+ let isDateRange = false;
130
+ if (type === "time" && widgetConfig.isRange) {
131
+ isDateRange = true;
132
+ } else if (type === "date") {
133
+ if (widgetConfig.isRange) {
134
+ isDateRange = true;
135
+ } else if (
136
+ [
137
+ "dates",
138
+ "months",
139
+ "years",
140
+ "datetimerange",
141
+ "daterange",
142
+ "monthrange",
143
+ ].includes(widgetType)
144
+ ) {
145
+ isDateRange = true;
146
+ }
147
+ }
148
+
149
+ return isDateRange;
150
+ },
151
+ getNullValue(item) {
152
+ let type = item.type;
153
+ let widgetType = item.widgetType;
154
+ let widgetConfig = item.widgetConfig || {};
155
+ let value = null;
156
+ if (type === "inputBatch") {
157
+ value = [];
158
+ } else if (this.getIsDateRange(item)) {
159
+ // value = [];
160
+ value = null;
161
+ }
162
+ return value;
163
+ },
164
+ handleSyncFun() {
165
+ let requests = [];
166
+ let $grid = this.$parent;
167
+ let originOption = $grid.params.originOption;
168
+ let formData = this.formData;
169
+ let advancedFormData = this.advancedFormData;
170
+ $grid.params.searchColumns.forEach((form1Field) => {
171
+ if (form1Field.defaultValueEnabled !== false) {
172
+ if (form1Field.common) {
173
+ if (form1Field.hasOwnProperty("defaultValue")) {
174
+ this.$set(formData, form1Field.field, form1Field.defaultValue);
175
+ }
176
+ } else {
177
+ if (form1Field.hasOwnProperty("defaultValue")) {
178
+ // this.$set(advancedFormData, form1Field.field, form1Field.defaultValue);
179
+ this.$set(formData, form1Field.field, form1Field.defaultValue);
180
+ }
181
+ }
182
+ }
183
+
184
+ if (form1Field.syncHandle) {
185
+ requests.push(
186
+ form1Field.syncHandle().then((rows) => {
187
+ let itemOption = rows || [];
188
+ form1Field.itemOption = itemOption;
189
+ let nColumn = originOption.searchColumns.find(
190
+ (item) => item.field === form1Field.field
191
+ );
192
+ if (nColumn) {
193
+ nColumn.itemOption = itemOption;
194
+ }
195
+ })
196
+ );
197
+ }
198
+ });
199
+ $grid.tableFormStop = false; //释放列表查询
200
+ if (requests.length) {
201
+ Promise.all(requests)
202
+ .then((responses) => {
203
+ let searchColumns = this.$baseLodash.cloneDeep($grid.params.searchColumns);
204
+ this.form1Fields = searchColumns.filter((item) => item.common);
205
+ this.form2Fields = searchColumns.filter((item) => !item.common);
206
+ })
207
+ .catch((error) => {
208
+ // 至少一个请求失败了
209
+ console.error("An error occurred:", error);
210
+ });
211
+ } else {
212
+ let searchColumns = this.$baseLodash.cloneDeep($grid.params.searchColumns);
213
+ this.form1Fields = searchColumns.filter((item) => item.common);
214
+ this.form2Fields = searchColumns.filter((item) => !item.common);
215
+ }
216
+ },
217
+ openTableColumnsDialog() {
218
+ let $grid = this.$parent;
219
+ // 原写法 let tableColumns = (tableColumns = ...) 自引用触发 TDZ,
220
+ // 只因 Babel 把 let 降成 var 才没在浏览器里炸
221
+ let tableColumns = this.$baseLodash.cloneDeep(
222
+ $grid.params.searchColumns || []
223
+ );
224
+ tableColumns.forEach((item) => {
225
+ if (!item.widgetConfig) item.widgetConfig = {};
226
+ });
227
+ this.tableColumns = tableColumns;
228
+ // 隐藏字段(如查询区里存树ID的隐藏输入框)是内部条件,不给用户看也不给拖
229
+ this.dialogColumns = tableColumns.filter((item) => !item.hidden);
230
+ this.dialogVisible = true;
231
+ this.$nextTick(() => {
232
+ this.$nextTick(() => {
233
+ this.dragSort();
234
+ });
235
+ });
236
+ },
237
+ dragSort: function () {
238
+ let e = this.$refs.singleTable.$el.querySelectorAll(
239
+ ".el-table__body-wrapper > table > tbody"
240
+ )[0],
241
+ t = this.tableColumns,
242
+ visible = this.dialogColumns;
243
+ this.sortable = Sortable.create(e, {
244
+ ghostClass: "sortable-ghost",
245
+ // 固定查询条件不可拖动(它的位置由配置决定,个性化也不该记)
246
+ filter: ".drag-disabled",
247
+ setData: function (e) {
248
+ e.setData("Text", "");
249
+ },
250
+ onEnd: function (e) {
251
+ // 拖拽发生在「可见列」上,隐藏列不在其中,所以要把新次序同步回全量列:
252
+ // 先在可见列里挪好,再按「新位置的后一个可见列」定位插到全量列的哪里。
253
+ let moved = visible.splice(e.oldIndex, 1)[0];
254
+ visible.splice(e.newIndex, 0, moved);
255
+ let fullIndex = t.indexOf(moved);
256
+ if (fullIndex > -1) {
257
+ t.splice(fullIndex, 1);
258
+ }
259
+ let nextVisible = visible[e.newIndex + 1];
260
+ let insertAt = nextVisible ? t.indexOf(nextVisible) : t.length;
261
+ t.splice(insertAt < 0 ? t.length : insertAt, 0, moved);
262
+ },
263
+ });
264
+ },
265
+ /** 固定查询条件行加标记类:禁拖拽(Sortable filter)+ 视觉上区分 */
266
+ dialogRowClassName({ row }) {
267
+ return row && row.lockValue ? "drag-disabled" : "";
268
+ },
269
+ dialogPrimary(newTableColumns) {
270
+ let searchColumns = this.$baseLodash.cloneDeep(
271
+ newTableColumns || this.tableColumns
272
+ );
273
+ this.form1Fields = searchColumns.filter((item) => item.common);
274
+ this.form2Fields = searchColumns.filter((item) => !item.common);
275
+ let $grid = this.$parent;
276
+ $grid.params.searchColumns = searchColumns;
277
+
278
+ let originOption = $grid.params.originOption;
279
+ let tableName = originOption.tableName;
280
+ tableUtil.addTableJson(originOption.vue, $grid, tableName);
281
+ this.dialogVisible = false;
282
+
283
+ let formData = this.formData;
284
+ let advancedFormData = this.advancedFormData;
285
+ /*formData = {};
286
+ advancedFormData = {};*/
287
+ // this.$set(this, "formData", {});
288
+ // this.$set(this, "advancedFormData", {});
289
+ searchColumns.forEach((form1Field) => {
290
+ // 固定查询条件:值由业务通道(树点选 / 脚本 setValue / 页面回填)注入,
291
+ // 「确定」「还原」都不许覆盖它,否则一点设置就把当前上下文查丢了。
292
+ // 注意只认 lockValue,不认 fixed —— 手写页面的 fixed 列(如分支)
293
+ // 正是靠这里按 defaultValue 回填的,跳过它们会打掉原有行为。
294
+ if (form1Field.lockValue) {
295
+ return;
296
+ }
297
+ let nullValue = this.getNullValue(form1Field);
298
+ let defaultValue = nullValue;
299
+ if (form1Field.defaultValueEnabled !== false) {
300
+ defaultValue = form1Field.defaultValue ?? nullValue;
301
+ }
302
+ let currentData = formData;
303
+ this.$set(currentData, form1Field.field, defaultValue);
304
+ if (form1Field.field2) {
305
+ this.$set(currentData, form1Field.field2, defaultValue);
306
+ }
307
+ });
308
+ this.searchEvent();
309
+ this.$emit("settingConfirm");
310
+ },
311
+ dialogReset() {
312
+ let $grid = this.$parent;
313
+ let originOption = $grid.params.originOption;
314
+ this.dialogPrimary(originOption.searchColumns);
315
+ },
316
+ },
317
+ };
318
+ export default modules;