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

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 +1634 -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,409 +1,409 @@
1
- <template>
2
- <el-dialog
3
- title="单据列表"
4
- :append-to-body="true"
5
- :modal-append-to-body="true"
6
- :close-on-click-modal="falseValue"
7
- :visible.sync="showDialog"
8
- :modal="falseValue"
9
- custom-class="dialog-style list-dialog dialog-checkbox pd_0"
10
- width="1200px"
11
- @close="dialogClose"
12
- v-el-drag-dialog
13
- v-el-dialog-center
14
- >
15
- <div class="cont" style="height:450px">
16
- <vxe-grid
17
- class="is-pointer"
18
- ref="table-m1"
19
- v-bind="vxeOption"
20
- @resizable-change="$vxeTableUtil.onColumnWitchChange"
21
- @custom="$vxeTableUtil.customHandle"
22
- @checkbox-change="addDataTable"
23
- @checkbox-all="checkAll"
24
- @cell-dblclick="checkWithSubmit"
25
- >
26
- <template #form>
27
- <div class="clearfix screen-btns">
28
- <div class="fr">
29
- <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
30
- plain>刷新
31
- </vxe-button>
32
- <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">搜索</vxe-button>
33
- </div>
34
- </div>
35
- <template v-if="searchFields.length>0">
36
- <vxe-form ref="form" class="screen-box" title-width="92px" title-align="right" :data="formData"
37
- @submit="searchEvent" @reset="searchEvent">
38
- <vxe-form-item v-for="(item,index) in searchFields"
39
- :key="index" :title="item.label+':'">
40
- <template v-slot>
41
- <el-input v-model="formData[item.prop]" size="small" clearable/>
42
- </template>
43
- </vxe-form-item>
44
- </vxe-form>
45
- </template>
46
- </template>
47
- </vxe-grid>
48
- </div>
49
- <label id="labBtn" class="transverse">
50
- <div class="icon">
51
- <i class="el-icon-more"></i>
52
- <i class="el-icon-more"></i>
53
- </div>
54
- </label>
55
- <div class="multipleChoice">
56
- <el-tooltip :enterable="false" effect="dark" :content="$t1('全部删除')" placement="top"><a class="allDel icon-quanbushanchu"
57
- @click="clearChecked()"></a>
58
- </el-tooltip>
59
- <div class="list">
60
- <div class="item" v-for="(checkRow, index) in checkRows" :key="'c'+index">
61
- <p>{{ checkRow[showFormField] }}</p>
62
- <a class="el-icon-close" @click="clearTable1Select(index)"></a>
63
- </div>
64
- </div>
65
- </div>
66
- <span slot="footer" class="dialog-footer">
67
- <span class="fl tips" v-if="!selectMulti">{{ $t1('注:双击确认选择(单选)') }}</span>
68
- <el-button type="primary" plain class="button-sty" @click="dialogClose">
69
- <i class="el-icon-close el-icon"></i>
70
- {{ $t2('取 消', 'system.button.cancel2') }}
71
- </el-button>
72
- <el-button type="primary" @click="dialogPrimary" class="button-sty">
73
- <i class="el-icon-check el-icon"></i>
74
- {{ $t2('确 定', 'system.button.confirm2') }}
75
- </el-button>
76
- </span>
77
- </el-dialog>
78
- </template>
79
-
80
- <script>
81
- import {selectDialogMixins} from '../../../../../mixins/selectDialog/index.js';
82
- import {getTableStateValue} from '../../../../../components/table/state';
83
-
84
- export default {
85
- name: "vabSearchDialog",
86
- props: ['visiable', 'multi', 'rows', 'param', 'formCode', 'showFormField', 'widget'],
87
- mixins: [selectDialogMixins],
88
- inject: ['scriptHttp'],
89
- created() {
90
- this.initSetting();
91
- this.checkField = this.showFormField;
92
- },
93
- mounted() {
94
- this.initTableM1();
95
- },
96
- data() {
97
- var that = this;
98
- return {
99
- showDialog: true,
100
- falseValue: false,
101
- selectMulti: true,
102
- formData: {},
103
- vxeOption: {},
104
- formInsListField0DTOs: [],
105
- formInsListField1DTOs: [],
106
- targetFormTemplate: null,
107
- formJson: null,
108
- tableColumns: [],
109
- searchFields: [],
110
- tableConfig: {},
111
- checkField: null,
112
- filedKey: 'dialogConfig'
113
- };
114
- },
115
- methods: {
116
- searchEvent() {
117
- this.$refs['table-m1'].commitProxy('reload');
118
- },
119
- resetEvent() {
120
- this.formData = {};
121
- this.$refs['table-m1'].commitProxy('reload');
122
- },
123
- async initTableM1() {
124
- let that = this;
125
- let tableRef = 'table-m1';
126
- let syncColumns = [];
127
- await this.createColumns().then(res => {
128
- syncColumns = res;
129
- });
130
- this.checkField = this.tableConfig.showFormField || this.showFormField || 'id';
131
- let defaultPath = USER_PREFIX + '/form_ins/listPage';
132
- let path = this.tableConfig.url || defaultPath;
133
-
134
- let optionModel = this.widget.options;
135
- let targetFormConfig = this.targetFormConfig;
136
- let isScriptEnabled = false;
137
- let scriptUuid = null;
138
- let scriptUuid2 = null;
139
- let returnType = 0;
140
- if (this.targetFormTemplate) {
141
- let gridConfig = targetFormConfig[this.filedKey] || {};
142
- isScriptEnabled = !!gridConfig.isLoadDataByAccess && !!gridConfig.scriptUuid;
143
- scriptUuid = gridConfig.scriptUuid;
144
- scriptUuid2 = gridConfig.scriptUuid2;
145
- returnType = isScriptEnabled ? gridConfig.accessReturnType : 1;
146
- } else {
147
- isScriptEnabled = !!optionModel.isLoadDataByAccess && !!optionModel.scriptUuid;
148
- scriptUuid = optionModel.scriptUuid;
149
- scriptUuid2 = optionModel.scriptUuid2;
150
- returnType = isScriptEnabled ? optionModel.accessReturnType : 1;
151
- }
152
- if(returnType===null || returnType===undefined){
153
- returnType = 1;
154
- }
155
-
156
- let tableOption = {
157
- vue: that,
158
- tableRef: tableRef,
159
- tableName: 'user-form_form_ins_dialog-m1',
160
- path: path,
161
- param: () => {
162
- let customParam = this.getCustomParam();
163
- let condition = {
164
- ...this.formData,
165
- ...this.param,
166
- ...customParam
167
- }
168
- Object.keys(condition).forEach(key => {
169
- if (condition[key] === "" || condition[key] === null) {
170
- delete condition[key]
171
- }
172
- })
173
- if (path == defaultPath) {
174
- return {
175
- formCode: this.formCode,
176
- condition: condition
177
- };
178
- } else {
179
- return {
180
- ...condition
181
- };
182
- }
183
-
184
- },
185
- columns: [
186
- {type: 'checkbox', fixed: 'left', width: 48, resizable: false},
187
- ...syncColumns,
188
- {
189
- width: 47,
190
- fixed: 'right',
191
- title: '',
192
- sortable: false
193
- }
194
- ],
195
- config: {
196
- checkboxConfig: {
197
- checkStrictly: true,
198
- showHeader: this.selectMulti,
199
- trigger: 'row'
200
- },
201
- proxyConfig: {
202
- props: {
203
- result: returnType === 1 ? 'objx.records' : 'objx', // 配置响应结果列表字段
204
- total: returnType === 1 ? 'objx.total' : 'objx.length' // 配置响应结果总页数字段
205
- },
206
- ajax: {
207
- // 接收 Promise 对象
208
- query: ({page, sorts, filters, form}) => {
209
- if (!path) {
210
- return;
211
- }
212
-
213
- let formData = tableOption.param ? tableOption.param() || {} : {};
214
- const queryParams = Object.assign({}, formData);
215
- if (isScriptEnabled) {
216
- let condition = queryParams.condition
217
- delete queryParams.condition;
218
- delete queryParams.formCode;
219
- Object.assign(queryParams, condition);
220
- }
221
-
222
- // 处理排序条件
223
- const firstSort = sorts[0];
224
- if (firstSort) {
225
- queryParams.sort = firstSort.property;
226
- queryParams.order = firstSort.order;
227
- }
228
- // 处理筛选条件
229
- filters.forEach(({property, values}) => {
230
- queryParams[property] = values.join(",");
231
- });
232
- if (page.pageSize !== undefined) {
233
- queryParams["size"] = `${page.pageSize}`;
234
- queryParams["current"] = `${page.currentPage}`;
235
- }
236
-
237
- var $grid = this.$refs[tableRef];
238
- let isQueryAllPage = getTableStateValue($grid, 'isQueryAllPage');
239
- let pathStr1 = "";
240
- if (isQueryAllPage === false) {
241
- queryParams.searchCount = false;
242
- }
243
-
244
- var reqPath = typeof path == "function" ? path() : path;
245
-
246
- let toDo = (res) => {
247
- let rows = res.objx ? res.objx.records || res.objx || [] : [];
248
- if (tableOption.callback) {
249
- that.$nextTick(() => {
250
- setTimeout(function () {
251
- tableOption.callback(rows);
252
- }, 0);
253
- });
254
- }
255
- }
256
-
257
- return new Promise((resolve, reject) => {
258
- if (isScriptEnabled) {
259
- let option1 = this.$baseLodash.cloneDeep(optionModel);
260
- option1.scriptUuid = scriptUuid;
261
- option1.scriptUuid2 = scriptUuid2;
262
- this.scriptHttp({
263
- options: option1,
264
- params: queryParams,
265
- targetFormTemplate: this.targetFormTemplate,
266
- isLoading: false,
267
- callback: (res) => {
268
- resolve(res);
269
- if (res.type == "success") {
270
- toDo(res);
271
- }
272
- }
273
- });
274
- } else {
275
- that.$http({
276
- url: reqPath,
277
- method: "post",
278
- data: queryParams,
279
- callback: (res) => {
280
- resolve(res);
281
- if (res.type == "success") {
282
- toDo(res);
283
- }
284
- },
285
- error: (error) => {
286
- reject(error);
287
- },
288
- });
289
- }
290
- });
291
- }
292
- },
293
- }
294
- }
295
- };
296
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
297
- that.vxeOption = opts;
298
- });
299
- },
300
- async createColumns() {
301
- await this.getFormTemplate();
302
- await this.getListFields();
303
-
304
- let formField = this.formField;
305
- return this.tableColumns.map((row, index) => {
306
- let column = {
307
- title: row.label,
308
- field: row.prop,
309
- width: 150
310
- }
311
- if (index === 0) {
312
- column.fixed = 'left';
313
- }
314
- return column;
315
- })
316
- },
317
- async getListFields() {
318
- if (!this.formCode) return;
319
- return this.$http({
320
- url: USER_PREFIX + '/form_ins/getListFields',
321
- method: `post`,
322
- data: {stringOne: this.formCode},
323
- isLoading: true,
324
- loadingTarget: document.body,
325
- // modalStrictly: true,
326
- success: res => {
327
- let formInsListFieldDTOs = res.objx || [];
328
- this.formInsListField0DTOs = formInsListFieldDTOs.filter(item => item.fieldType === 0);
329
- this.formInsListField1DTOs = formInsListFieldDTOs.filter(item => item.fieldType === 1);
330
-
331
- if (!this.tableColumns.length) {
332
- this.tableColumns = this.formInsListField0DTOs.map(row => {
333
- return {
334
- label: row.fieldDesc,
335
- prop: row.fieldName,
336
- width: 150
337
- }
338
- });
339
- }
340
- if (!this.searchFields.length) {
341
- this.searchFields = this.formInsListField1DTOs.map(row => {
342
- return {
343
- label: row.fieldDesc,
344
- prop: row.fieldName
345
- }
346
- });
347
- }
348
- }
349
- });
350
- },
351
- async getFormTemplate() {
352
- let options = this.widget.options;
353
- let customGridConfig = options[this.filedKey] || {};
354
- this.customGridConfig = customGridConfig
355
- let searchField0s = customGridConfig && customGridConfig.searchFields ? customGridConfig.searchFields : [];
356
- let tableColumn0s = customGridConfig && customGridConfig.tableColumns ? customGridConfig.tableColumns : [];
357
- if (!this.formCode) {
358
- this.searchFields = searchField0s;
359
- this.tableColumns = tableColumn0s;
360
- this.tableConfig = customGridConfig;
361
- this.targetFormTemplate = null
362
- this.targetFormConfig = null;
363
- return;
364
- }
365
- return this.$http({
366
- url: USER_PREFIX + `/formTemplate/getByFormCode`,
367
- method: `post`,
368
- data: {
369
- stringOne: this.formCode
370
- },
371
- isLoading: true,
372
- loadingTarget: document.body,
373
- success: res => {
374
- let targetFormTemplate = res.objx || {};
375
- let formJson = targetFormTemplate.formViewContent ? JSON.parse(targetFormTemplate.formViewContent) : {};
376
- let formConfig = formJson.formConfig;
377
- this.targetFormTemplate = res.objx ? targetFormTemplate : null
378
- this.targetFormConfig = formConfig;
379
-
380
- let gridConfig = formConfig[this.filedKey] || {}
381
-
382
- let searchFields = gridConfig.searchFields || []
383
- let tableColumns = gridConfig.tableColumns || [];
384
- searchFields = searchFields.filter(item => {
385
- return !!item.prop && !!item.label;
386
- });
387
- this.tableColumns = tableColumns;
388
- this.searchFields = searchFields;
389
-
390
- let tableConfig = {};
391
- Object.assign(tableConfig, gridConfig, customGridConfig)
392
- this.tableConfig = tableConfig;
393
- }
394
- });
395
- },
396
- getCustomParam() {
397
- let tableConfig = this.tableConfig
398
- if (!!tableConfig.searchParams) {
399
- var e = new Function(tableConfig.searchParams);
400
- return e.call(this);
401
- }
402
- }
403
- }
404
- }
405
- </script>
406
-
407
- <style scoped>
408
-
409
- </style>
1
+ <template>
2
+ <el-dialog
3
+ title="单据列表"
4
+ :append-to-body="true"
5
+ :modal-append-to-body="true"
6
+ :close-on-click-modal="falseValue"
7
+ :visible.sync="showDialog"
8
+ :modal="falseValue"
9
+ custom-class="dialog-style list-dialog dialog-checkbox pd_0"
10
+ width="1200px"
11
+ @close="dialogClose"
12
+ v-el-drag-dialog
13
+ v-el-dialog-center
14
+ >
15
+ <div class="cont" style="height:450px">
16
+ <vxe-grid
17
+ class="is-pointer"
18
+ ref="table-m1"
19
+ v-bind="vxeOption"
20
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
21
+ @custom="$vxeTableUtil.customHandle"
22
+ @checkbox-change="addDataTable"
23
+ @checkbox-all="checkAll"
24
+ @cell-dblclick="checkWithSubmit"
25
+ >
26
+ <template #form>
27
+ <div class="clearfix screen-btns">
28
+ <div class="fr">
29
+ <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
30
+ plain>刷新
31
+ </vxe-button>
32
+ <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">搜索</vxe-button>
33
+ </div>
34
+ </div>
35
+ <template v-if="searchFields.length>0">
36
+ <vxe-form ref="form" class="screen-box" title-width="92px" title-align="right" :data="formData"
37
+ @submit="searchEvent" @reset="searchEvent">
38
+ <vxe-form-item v-for="(item,index) in searchFields"
39
+ :key="index" :title="item.label+':'">
40
+ <template v-slot>
41
+ <el-input v-model="formData[item.prop]" size="small" clearable/>
42
+ </template>
43
+ </vxe-form-item>
44
+ </vxe-form>
45
+ </template>
46
+ </template>
47
+ </vxe-grid>
48
+ </div>
49
+ <label id="labBtn" class="transverse">
50
+ <div class="icon">
51
+ <i class="el-icon-more"></i>
52
+ <i class="el-icon-more"></i>
53
+ </div>
54
+ </label>
55
+ <div class="multipleChoice">
56
+ <el-tooltip :enterable="false" effect="dark" :content="$t1('全部删除')" placement="top"><a class="allDel icon-quanbushanchu"
57
+ @click="clearChecked()"></a>
58
+ </el-tooltip>
59
+ <div class="list">
60
+ <div class="item" v-for="(checkRow, index) in checkRows" :key="'c'+index">
61
+ <p>{{ checkRow[showFormField] }}</p>
62
+ <a class="el-icon-close" @click="clearTable1Select(index)"></a>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <span slot="footer" class="dialog-footer">
67
+ <span class="fl tips" v-if="!selectMulti">{{ $t1('注:双击确认选择(单选)') }}</span>
68
+ <el-button type="primary" plain class="button-sty" @click="dialogClose">
69
+ <i class="el-icon-close el-icon"></i>
70
+ {{ $t2('取 消', 'system.button.cancel2') }}
71
+ </el-button>
72
+ <el-button type="primary" @click="dialogPrimary" class="button-sty">
73
+ <i class="el-icon-check el-icon"></i>
74
+ {{ $t2('确 定', 'system.button.confirm2') }}
75
+ </el-button>
76
+ </span>
77
+ </el-dialog>
78
+ </template>
79
+
80
+ <script>
81
+ import {selectDialogMixins} from '../../../../../mixins/selectDialog/index.js';
82
+ import {getTableStateValue} from '../../../../../components/table/state';
83
+
84
+ export default {
85
+ name: "vabSearchDialog",
86
+ props: ['visiable', 'multi', 'rows', 'param', 'formCode', 'showFormField', 'widget'],
87
+ mixins: [selectDialogMixins],
88
+ inject: ['scriptHttp'],
89
+ created() {
90
+ this.initSetting();
91
+ this.checkField = this.showFormField;
92
+ },
93
+ mounted() {
94
+ this.initTableM1();
95
+ },
96
+ data() {
97
+ var that = this;
98
+ return {
99
+ showDialog: true,
100
+ falseValue: false,
101
+ selectMulti: true,
102
+ formData: {},
103
+ vxeOption: {},
104
+ formInsListField0DTOs: [],
105
+ formInsListField1DTOs: [],
106
+ targetFormTemplate: null,
107
+ formJson: null,
108
+ tableColumns: [],
109
+ searchFields: [],
110
+ tableConfig: {},
111
+ checkField: null,
112
+ filedKey: 'dialogConfig'
113
+ };
114
+ },
115
+ methods: {
116
+ searchEvent() {
117
+ this.$refs['table-m1'].commitProxy('reload');
118
+ },
119
+ resetEvent() {
120
+ this.formData = {};
121
+ this.$refs['table-m1'].commitProxy('reload');
122
+ },
123
+ async initTableM1() {
124
+ let that = this;
125
+ let tableRef = 'table-m1';
126
+ let syncColumns = [];
127
+ await this.createColumns().then(res => {
128
+ syncColumns = res;
129
+ });
130
+ this.checkField = this.tableConfig.showFormField || this.showFormField || 'id';
131
+ let defaultPath = USER_PREFIX + '/form_ins/listPage';
132
+ let path = this.tableConfig.url || defaultPath;
133
+
134
+ let optionModel = this.widget.options;
135
+ let targetFormConfig = this.targetFormConfig;
136
+ let isScriptEnabled = false;
137
+ let scriptUuid = null;
138
+ let scriptUuid2 = null;
139
+ let returnType = 0;
140
+ if (this.targetFormTemplate) {
141
+ let gridConfig = targetFormConfig[this.filedKey] || {};
142
+ isScriptEnabled = !!gridConfig.isLoadDataByAccess && !!gridConfig.scriptUuid;
143
+ scriptUuid = gridConfig.scriptUuid;
144
+ scriptUuid2 = gridConfig.scriptUuid2;
145
+ returnType = isScriptEnabled ? gridConfig.accessReturnType : 1;
146
+ } else {
147
+ isScriptEnabled = !!optionModel.isLoadDataByAccess && !!optionModel.scriptUuid;
148
+ scriptUuid = optionModel.scriptUuid;
149
+ scriptUuid2 = optionModel.scriptUuid2;
150
+ returnType = isScriptEnabled ? optionModel.accessReturnType : 1;
151
+ }
152
+ if(returnType===null || returnType===undefined){
153
+ returnType = 1;
154
+ }
155
+
156
+ let tableOption = {
157
+ vue: that,
158
+ tableRef: tableRef,
159
+ tableName: 'user-form_form_ins_dialog-m1',
160
+ path: path,
161
+ param: () => {
162
+ let customParam = this.getCustomParam();
163
+ let condition = {
164
+ ...this.formData,
165
+ ...this.param,
166
+ ...customParam
167
+ }
168
+ Object.keys(condition).forEach(key => {
169
+ if (condition[key] === "" || condition[key] === null) {
170
+ delete condition[key]
171
+ }
172
+ })
173
+ if (path == defaultPath) {
174
+ return {
175
+ formCode: this.formCode,
176
+ condition: condition
177
+ };
178
+ } else {
179
+ return {
180
+ ...condition
181
+ };
182
+ }
183
+
184
+ },
185
+ columns: [
186
+ {type: 'checkbox', fixed: 'left', width: 48, resizable: false},
187
+ ...syncColumns,
188
+ {
189
+ width: 47,
190
+ fixed: 'right',
191
+ title: '',
192
+ sortable: false
193
+ }
194
+ ],
195
+ config: {
196
+ checkboxConfig: {
197
+ checkStrictly: true,
198
+ showHeader: this.selectMulti,
199
+ trigger: 'row'
200
+ },
201
+ proxyConfig: {
202
+ props: {
203
+ result: returnType === 1 ? 'objx.records' : 'objx', // 配置响应结果列表字段
204
+ total: returnType === 1 ? 'objx.total' : 'objx.length' // 配置响应结果总页数字段
205
+ },
206
+ ajax: {
207
+ // 接收 Promise 对象
208
+ query: ({page, sorts, filters, form}) => {
209
+ if (!path) {
210
+ return;
211
+ }
212
+
213
+ let formData = tableOption.param ? tableOption.param() || {} : {};
214
+ const queryParams = Object.assign({}, formData);
215
+ if (isScriptEnabled) {
216
+ let condition = queryParams.condition
217
+ delete queryParams.condition;
218
+ delete queryParams.formCode;
219
+ Object.assign(queryParams, condition);
220
+ }
221
+
222
+ // 处理排序条件
223
+ const firstSort = sorts[0];
224
+ if (firstSort) {
225
+ queryParams.sort = firstSort.property;
226
+ queryParams.order = firstSort.order;
227
+ }
228
+ // 处理筛选条件
229
+ filters.forEach(({property, values}) => {
230
+ queryParams[property] = values.join(",");
231
+ });
232
+ if (page.pageSize !== undefined) {
233
+ queryParams["size"] = `${page.pageSize}`;
234
+ queryParams["current"] = `${page.currentPage}`;
235
+ }
236
+
237
+ var $grid = this.$refs[tableRef];
238
+ let isQueryAllPage = getTableStateValue($grid, 'isQueryAllPage');
239
+ let pathStr1 = "";
240
+ if (isQueryAllPage === false) {
241
+ queryParams.searchCount = false;
242
+ }
243
+
244
+ var reqPath = typeof path == "function" ? path() : path;
245
+
246
+ let toDo = (res) => {
247
+ let rows = res.objx ? res.objx.records || res.objx || [] : [];
248
+ if (tableOption.callback) {
249
+ that.$nextTick(() => {
250
+ setTimeout(function () {
251
+ tableOption.callback(rows);
252
+ }, 0);
253
+ });
254
+ }
255
+ }
256
+
257
+ return new Promise((resolve, reject) => {
258
+ if (isScriptEnabled) {
259
+ let option1 = this.$baseLodash.cloneDeep(optionModel);
260
+ option1.scriptUuid = scriptUuid;
261
+ option1.scriptUuid2 = scriptUuid2;
262
+ this.scriptHttp({
263
+ options: option1,
264
+ params: queryParams,
265
+ targetFormTemplate: this.targetFormTemplate,
266
+ isLoading: false,
267
+ callback: (res) => {
268
+ resolve(res);
269
+ if (res.type == "success") {
270
+ toDo(res);
271
+ }
272
+ }
273
+ });
274
+ } else {
275
+ that.$http({
276
+ url: reqPath,
277
+ method: "post",
278
+ data: queryParams,
279
+ callback: (res) => {
280
+ resolve(res);
281
+ if (res.type == "success") {
282
+ toDo(res);
283
+ }
284
+ },
285
+ error: (error) => {
286
+ reject(error);
287
+ },
288
+ });
289
+ }
290
+ });
291
+ }
292
+ },
293
+ }
294
+ }
295
+ };
296
+ this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
297
+ that.vxeOption = opts;
298
+ });
299
+ },
300
+ async createColumns() {
301
+ await this.getFormTemplate();
302
+ await this.getListFields();
303
+
304
+ let formField = this.formField;
305
+ return this.tableColumns.map((row, index) => {
306
+ let column = {
307
+ title: row.label,
308
+ field: row.prop,
309
+ width: 150
310
+ }
311
+ if (index === 0) {
312
+ column.fixed = 'left';
313
+ }
314
+ return column;
315
+ })
316
+ },
317
+ async getListFields() {
318
+ if (!this.formCode) return;
319
+ return this.$http({
320
+ url: USER_PREFIX + '/form_ins/getListFields',
321
+ method: `post`,
322
+ data: {stringOne: this.formCode},
323
+ isLoading: true,
324
+ loadingTarget: document.body,
325
+ // modalStrictly: true,
326
+ success: res => {
327
+ let formInsListFieldDTOs = res.objx || [];
328
+ this.formInsListField0DTOs = formInsListFieldDTOs.filter(item => item.fieldType === 0);
329
+ this.formInsListField1DTOs = formInsListFieldDTOs.filter(item => item.fieldType === 1);
330
+
331
+ if (!this.tableColumns.length) {
332
+ this.tableColumns = this.formInsListField0DTOs.map(row => {
333
+ return {
334
+ label: row.fieldDesc,
335
+ prop: row.fieldName,
336
+ width: 150
337
+ }
338
+ });
339
+ }
340
+ if (!this.searchFields.length) {
341
+ this.searchFields = this.formInsListField1DTOs.map(row => {
342
+ return {
343
+ label: row.fieldDesc,
344
+ prop: row.fieldName
345
+ }
346
+ });
347
+ }
348
+ }
349
+ });
350
+ },
351
+ async getFormTemplate() {
352
+ let options = this.widget.options;
353
+ let customGridConfig = options[this.filedKey] || {};
354
+ this.customGridConfig = customGridConfig
355
+ let searchField0s = customGridConfig && customGridConfig.searchFields ? customGridConfig.searchFields : [];
356
+ let tableColumn0s = customGridConfig && customGridConfig.tableColumns ? customGridConfig.tableColumns : [];
357
+ if (!this.formCode) {
358
+ this.searchFields = searchField0s;
359
+ this.tableColumns = tableColumn0s;
360
+ this.tableConfig = customGridConfig;
361
+ this.targetFormTemplate = null
362
+ this.targetFormConfig = null;
363
+ return;
364
+ }
365
+ return this.$http({
366
+ url: USER_PREFIX + `/formTemplate/getByFormCode`,
367
+ method: `post`,
368
+ data: {
369
+ stringOne: this.formCode
370
+ },
371
+ isLoading: true,
372
+ loadingTarget: document.body,
373
+ success: res => {
374
+ let targetFormTemplate = res.objx || {};
375
+ let formJson = targetFormTemplate.formViewContent ? JSON.parse(targetFormTemplate.formViewContent) : {};
376
+ let formConfig = formJson.formConfig;
377
+ this.targetFormTemplate = res.objx ? targetFormTemplate : null
378
+ this.targetFormConfig = formConfig;
379
+
380
+ let gridConfig = formConfig[this.filedKey] || {}
381
+
382
+ let searchFields = gridConfig.searchFields || []
383
+ let tableColumns = gridConfig.tableColumns || [];
384
+ searchFields = searchFields.filter(item => {
385
+ return !!item.prop && !!item.label;
386
+ });
387
+ this.tableColumns = tableColumns;
388
+ this.searchFields = searchFields;
389
+
390
+ let tableConfig = {};
391
+ Object.assign(tableConfig, gridConfig, customGridConfig)
392
+ this.tableConfig = tableConfig;
393
+ }
394
+ });
395
+ },
396
+ getCustomParam() {
397
+ let tableConfig = this.tableConfig
398
+ if (!!tableConfig.searchParams) {
399
+ var e = new Function(tableConfig.searchParams);
400
+ return e.call(this);
401
+ }
402
+ }
403
+ }
404
+ }
405
+ </script>
406
+
407
+ <style scoped>
408
+
409
+ </style>