cloud-web-corejs 1.0.54-dev.645 → 1.0.54-dev.646
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.
- package/package.json +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +210 -15
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +51 -36
- package/src/components/xform/form-render/container-item/data-table-item.vue +7 -2
- package/src/components/xform/form-render/container-item/data-table-mixin.js +181 -100
- package/src/components/xform/form-render/container-item/list-h5-item.vue +1119 -394
- package/src/components/xform/form-render/container-item/list-h5-item2.vue +0 -1629
|
@@ -1,1629 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<container-item-wrapper
|
|
3
|
-
:widget="widget"
|
|
4
|
-
:class="widget.options.isFullscreen ? 'full-height' : ''"
|
|
5
|
-
>
|
|
6
|
-
<div class="h5-header">{{ widget.options.label }}</div>
|
|
7
|
-
<div class="h5-search-box">
|
|
8
|
-
<el-input v-model="keyword" placeholder="请选择" class="txt">
|
|
9
|
-
<i slot="suffix" class="el-input__icon el-icon-search"></i>
|
|
10
|
-
<el-button slot="append" class="btn" @click="searchEvent"
|
|
11
|
-
>搜索</el-button
|
|
12
|
-
>
|
|
13
|
-
</el-input>
|
|
14
|
-
<div class="icon-screen" @click="openAdvancedSearchDialog">
|
|
15
|
-
<i class="iconfont icon-chaxuntiaojianshezhi"></i>筛选
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
<div
|
|
19
|
-
v-if="widget.options.isQueryTable"
|
|
20
|
-
class="h5-fixed-top-btns"
|
|
21
|
-
title-width="92px"
|
|
22
|
-
title-align="right"
|
|
23
|
-
>
|
|
24
|
-
<el-form label-position="top">
|
|
25
|
-
<template v-if="!!widget.buttons && widget.buttons.length > 0">
|
|
26
|
-
<template v-for="(subWidget, swIdx) in widget.buttons">
|
|
27
|
-
<template v-if="'container' === subWidget.category">
|
|
28
|
-
<component
|
|
29
|
-
:is="subWidget.type + '-item'"
|
|
30
|
-
:widget="subWidget"
|
|
31
|
-
:key="swIdx"
|
|
32
|
-
:parent-list="widget.buttons"
|
|
33
|
-
:index-of-parent-list="swIdx"
|
|
34
|
-
:parent-widget="widget"
|
|
35
|
-
>
|
|
36
|
-
<!-- 递归传递插槽!!! -->
|
|
37
|
-
<template
|
|
38
|
-
v-for="slot in Object.keys($scopedSlots)"
|
|
39
|
-
v-slot:[slot]="scope"
|
|
40
|
-
>
|
|
41
|
-
<slot :name="slot" v-bind="scope" />
|
|
42
|
-
</template>
|
|
43
|
-
</component>
|
|
44
|
-
</template>
|
|
45
|
-
<template v-else>
|
|
46
|
-
<component
|
|
47
|
-
:is="subWidget.type + '-widget'"
|
|
48
|
-
:field="subWidget"
|
|
49
|
-
:designer="null"
|
|
50
|
-
:key="swIdx"
|
|
51
|
-
:parent-list="widget.buttons"
|
|
52
|
-
:index-of-parent-list="swIdx"
|
|
53
|
-
:parent-widget="widget"
|
|
54
|
-
>
|
|
55
|
-
<!-- 递归传递插槽!!! -->
|
|
56
|
-
<template
|
|
57
|
-
v-for="slot in Object.keys($scopedSlots)"
|
|
58
|
-
v-slot:[slot]="scope"
|
|
59
|
-
>
|
|
60
|
-
<slot :name="slot" v-bind="scope" />
|
|
61
|
-
</template>
|
|
62
|
-
</component>
|
|
63
|
-
</template>
|
|
64
|
-
</template>
|
|
65
|
-
</template>
|
|
66
|
-
</el-form>
|
|
67
|
-
</div>
|
|
68
|
-
<div class="h5-list-box">
|
|
69
|
-
<div
|
|
70
|
-
v-for="(row, rowIndex) in fieldModel"
|
|
71
|
-
:key="rowIndex"
|
|
72
|
-
class="item"
|
|
73
|
-
@click="itemCheck(row)"
|
|
74
|
-
:class="{ checked: checkItemIds.includes(row.id) }"
|
|
75
|
-
>
|
|
76
|
-
<div
|
|
77
|
-
v-if="!widget.options.isQueryTable"
|
|
78
|
-
class="del-btn"
|
|
79
|
-
@click.stop="deleteRow(row, rowIndex)"
|
|
80
|
-
>
|
|
81
|
-
<i class="el-icon-delete"></i>
|
|
82
|
-
</div>
|
|
83
|
-
<template v-if="vxeOption.columns.length > 0">
|
|
84
|
-
<div class="t1" v-if="widget.options.isQueryTable">
|
|
85
|
-
<template
|
|
86
|
-
v-for="(column, columnIndex) in vxeOption.columns.filter(
|
|
87
|
-
(item, index) => item.isMainFiled
|
|
88
|
-
)"
|
|
89
|
-
>
|
|
90
|
-
<b :key="'1-' + columnIndex">{{ column.title }}:</b>
|
|
91
|
-
<span :key="'2-' + columnIndex">
|
|
92
|
-
<template v-if="!column.params.formatS">
|
|
93
|
-
{{ row[column.field] }}
|
|
94
|
-
</template>
|
|
95
|
-
<template v-else-if="column.params.formatS == 'render'">
|
|
96
|
-
{{
|
|
97
|
-
column.slots.default({
|
|
98
|
-
column: column,
|
|
99
|
-
rowIndex: rowIndex,
|
|
100
|
-
row: row,
|
|
101
|
-
items: fieldModel,
|
|
102
|
-
})
|
|
103
|
-
}}
|
|
104
|
-
</template>
|
|
105
|
-
<template
|
|
106
|
-
v-else-if="column.slots && column.slots.default == 'widget'"
|
|
107
|
-
>
|
|
108
|
-
<component
|
|
109
|
-
:is="getColumnWidgetName(column.params.widget)"
|
|
110
|
-
:field="column.params.widget"
|
|
111
|
-
:form-model="globalModel.formModel"
|
|
112
|
-
:designer="null"
|
|
113
|
-
:key="rowIndex"
|
|
114
|
-
:parent-widget="widget"
|
|
115
|
-
:columnConfig="column.params.columnConfig"
|
|
116
|
-
:subFormRowIndex="rowIndex"
|
|
117
|
-
:formItemProp="
|
|
118
|
-
getColumnProp(widget, {
|
|
119
|
-
column: column,
|
|
120
|
-
rowIndex: rowIndex,
|
|
121
|
-
row: row,
|
|
122
|
-
items: fieldModel,
|
|
123
|
-
})
|
|
124
|
-
"
|
|
125
|
-
:tableParam="{
|
|
126
|
-
column: column,
|
|
127
|
-
rowIndex: rowIndex,
|
|
128
|
-
row: row,
|
|
129
|
-
items: fieldModel,
|
|
130
|
-
}"
|
|
131
|
-
></component>
|
|
132
|
-
</template>
|
|
133
|
-
<template v-else-if="column.params.formatS == 'editDelete'">
|
|
134
|
-
<a
|
|
135
|
-
href="javascript:void(0);"
|
|
136
|
-
class="a-link"
|
|
137
|
-
@click="deleteRow(row, rowIndex)"
|
|
138
|
-
>
|
|
139
|
-
<el-tooltip
|
|
140
|
-
:enterable="false"
|
|
141
|
-
effect="dark"
|
|
142
|
-
content="删除"
|
|
143
|
-
placement="top"
|
|
144
|
-
popper-class="tooltip-skin"
|
|
145
|
-
>
|
|
146
|
-
<i class="el-icon-delete" />
|
|
147
|
-
</el-tooltip>
|
|
148
|
-
</a>
|
|
149
|
-
</template>
|
|
150
|
-
<template v-else-if="column.params.formatS == 'editButton'">
|
|
151
|
-
<a
|
|
152
|
-
href="javascript:void(0);"
|
|
153
|
-
class="a-link"
|
|
154
|
-
@click.stop="openEditDialog(obj.row)"
|
|
155
|
-
>
|
|
156
|
-
<el-tooltip
|
|
157
|
-
:enterable="false"
|
|
158
|
-
effect="dark"
|
|
159
|
-
content="查看"
|
|
160
|
-
placement="top"
|
|
161
|
-
popper-class="tooltip-skin"
|
|
162
|
-
>
|
|
163
|
-
<i class="el-icon-edit" />
|
|
164
|
-
</el-tooltip>
|
|
165
|
-
</a>
|
|
166
|
-
</template>
|
|
167
|
-
<template v-else>
|
|
168
|
-
{{
|
|
169
|
-
column.formatter({
|
|
170
|
-
cellValue: row[column.field],
|
|
171
|
-
column: column,
|
|
172
|
-
rowIndex: rowIndex,
|
|
173
|
-
row: row,
|
|
174
|
-
items: fieldModel,
|
|
175
|
-
})
|
|
176
|
-
}}
|
|
177
|
-
</template>
|
|
178
|
-
</span>
|
|
179
|
-
<!-- <div class="status">未审核</div>-->
|
|
180
|
-
</template>
|
|
181
|
-
</div>
|
|
182
|
-
<div class="t2">
|
|
183
|
-
<template
|
|
184
|
-
v-if="
|
|
185
|
-
!widget.options.isQueryTable || vxeOption.columns.length > 1
|
|
186
|
-
"
|
|
187
|
-
>
|
|
188
|
-
<template v-for="(column, columnIndex) in vxeOption.columns">
|
|
189
|
-
<template
|
|
190
|
-
v-if="
|
|
191
|
-
(!widget.options.isQueryTable || !column.isMainFiled) &&
|
|
192
|
-
column.showForRow
|
|
193
|
-
"
|
|
194
|
-
>
|
|
195
|
-
<dl :key="columnIndex">
|
|
196
|
-
<div>
|
|
197
|
-
<dt>{{ column.title }}:</dt>
|
|
198
|
-
<dd>
|
|
199
|
-
<template v-if="!column.params.formatS">
|
|
200
|
-
{{ row[column.field] }}
|
|
201
|
-
</template>
|
|
202
|
-
<template v-else-if="column.params.formatS == 'render'">
|
|
203
|
-
{{
|
|
204
|
-
column.slots.default({
|
|
205
|
-
column: column,
|
|
206
|
-
rowIndex: rowIndex,
|
|
207
|
-
row: row,
|
|
208
|
-
items: fieldModel,
|
|
209
|
-
})
|
|
210
|
-
}}
|
|
211
|
-
</template>
|
|
212
|
-
|
|
213
|
-
<template
|
|
214
|
-
v-else-if="
|
|
215
|
-
column.slots && column.slots.default == 'widget'
|
|
216
|
-
"
|
|
217
|
-
>
|
|
218
|
-
<component
|
|
219
|
-
:is="getColumnWidgetName(column.params.widget)"
|
|
220
|
-
:field="column.params.widget"
|
|
221
|
-
:form-model="globalModel.formModel"
|
|
222
|
-
:designer="null"
|
|
223
|
-
:key="rowIndex + '-' + columnIndex"
|
|
224
|
-
:parent-widget="widget"
|
|
225
|
-
:columnConfig="column.params.columnConfig"
|
|
226
|
-
:subFormRowIndex="rowIndex"
|
|
227
|
-
:formItemProp="
|
|
228
|
-
getColumnProp(widget, {
|
|
229
|
-
column: column,
|
|
230
|
-
rowIndex: rowIndex,
|
|
231
|
-
row: row,
|
|
232
|
-
items: fieldModel,
|
|
233
|
-
})
|
|
234
|
-
"
|
|
235
|
-
:tableParam="{
|
|
236
|
-
column: column,
|
|
237
|
-
rowIndex: rowIndex,
|
|
238
|
-
row: row,
|
|
239
|
-
items: fieldModel,
|
|
240
|
-
}"
|
|
241
|
-
></component>
|
|
242
|
-
</template>
|
|
243
|
-
<template
|
|
244
|
-
v-else-if="column.params.formatS == 'editDelete'"
|
|
245
|
-
>
|
|
246
|
-
<a
|
|
247
|
-
href="javascript:void(0);"
|
|
248
|
-
class="a-link"
|
|
249
|
-
@click.stop="deleteRow(row, rowIndex)"
|
|
250
|
-
>
|
|
251
|
-
<el-tooltip
|
|
252
|
-
:enterable="false"
|
|
253
|
-
effect="dark"
|
|
254
|
-
content="删除"
|
|
255
|
-
placement="top"
|
|
256
|
-
popper-class="tooltip-skin"
|
|
257
|
-
>
|
|
258
|
-
<i class="el-icon-delete" />
|
|
259
|
-
</el-tooltip>
|
|
260
|
-
</a>
|
|
261
|
-
</template>
|
|
262
|
-
<template
|
|
263
|
-
v-else-if="column.params.formatS == 'editButton'"
|
|
264
|
-
>
|
|
265
|
-
<a
|
|
266
|
-
href="javascript:void(0);"
|
|
267
|
-
class="a-link"
|
|
268
|
-
@click.stop="openEditDialog(row)"
|
|
269
|
-
>
|
|
270
|
-
<el-tooltip
|
|
271
|
-
:enterable="false"
|
|
272
|
-
effect="dark"
|
|
273
|
-
content="查看"
|
|
274
|
-
placement="top"
|
|
275
|
-
popper-class="tooltip-skin"
|
|
276
|
-
>
|
|
277
|
-
<i class="el-icon-edit" />
|
|
278
|
-
</el-tooltip>
|
|
279
|
-
</a>
|
|
280
|
-
</template>
|
|
281
|
-
<template v-else>
|
|
282
|
-
{{
|
|
283
|
-
column.formatter({
|
|
284
|
-
cellValue: row[column.field],
|
|
285
|
-
column: column,
|
|
286
|
-
rowIndex: rowIndex,
|
|
287
|
-
row: row,
|
|
288
|
-
items: fieldModel,
|
|
289
|
-
})
|
|
290
|
-
}}
|
|
291
|
-
</template>
|
|
292
|
-
</dd>
|
|
293
|
-
</div>
|
|
294
|
-
</dl>
|
|
295
|
-
</template>
|
|
296
|
-
</template>
|
|
297
|
-
</template>
|
|
298
|
-
</div>
|
|
299
|
-
<div class="btns">
|
|
300
|
-
<!-- <div class="checkbox_fl">
|
|
301
|
-
<el-checkbox></el-checkbox>
|
|
302
|
-
</div> -->
|
|
303
|
-
<!-- <a class="btn"><i class="el-icon-delete"/><span>删除</span></a>
|
|
304
|
-
<a class="btn"><i class="el-icon-edit"/><span>查看</span></a>-->
|
|
305
|
-
<template
|
|
306
|
-
v-if="!!widget.lineButtons && widget.lineButtons.length > 0"
|
|
307
|
-
>
|
|
308
|
-
<template v-for="(subWidget, swIdx) in widget.lineButtons">
|
|
309
|
-
<template v-if="'container' === subWidget.category">
|
|
310
|
-
<component
|
|
311
|
-
:is="subWidget.type + '-item'"
|
|
312
|
-
:widget="subWidget"
|
|
313
|
-
:key="swIdx"
|
|
314
|
-
:parent-list="widget.lineButtons"
|
|
315
|
-
:index-of-parent-list="swIdx"
|
|
316
|
-
:parent-widget="widget"
|
|
317
|
-
:subFormRowIndex="rowIndex"
|
|
318
|
-
:tableParam="{
|
|
319
|
-
rowIndex: rowIndex,
|
|
320
|
-
row: row,
|
|
321
|
-
items: fieldModel,
|
|
322
|
-
}"
|
|
323
|
-
>
|
|
324
|
-
<!-- 递归传递插槽!!! -->
|
|
325
|
-
<template
|
|
326
|
-
v-for="slot in Object.keys($scopedSlots)"
|
|
327
|
-
v-slot:[slot]="scope"
|
|
328
|
-
>
|
|
329
|
-
<slot :name="slot" v-bind="scope" />
|
|
330
|
-
</template>
|
|
331
|
-
</component>
|
|
332
|
-
</template>
|
|
333
|
-
<template v-else>
|
|
334
|
-
<component
|
|
335
|
-
:is="subWidget.type + '-widget'"
|
|
336
|
-
:field="subWidget"
|
|
337
|
-
:designer="null"
|
|
338
|
-
:key="swIdx"
|
|
339
|
-
:parent-list="widget.lineButtons"
|
|
340
|
-
:index-of-parent-list="swIdx"
|
|
341
|
-
:parent-widget="widget"
|
|
342
|
-
:subFormRowIndex="rowIndex"
|
|
343
|
-
:tableParam="{
|
|
344
|
-
rowIndex: rowIndex,
|
|
345
|
-
row: row,
|
|
346
|
-
items: fieldModel,
|
|
347
|
-
}"
|
|
348
|
-
>
|
|
349
|
-
<!-- 递归传递插槽!!! -->
|
|
350
|
-
<template
|
|
351
|
-
v-for="slot in Object.keys($scopedSlots)"
|
|
352
|
-
v-slot:[slot]="scope"
|
|
353
|
-
>
|
|
354
|
-
<slot :name="slot" v-bind="scope" />
|
|
355
|
-
</template>
|
|
356
|
-
</component>
|
|
357
|
-
</template>
|
|
358
|
-
</template>
|
|
359
|
-
</template>
|
|
360
|
-
</div>
|
|
361
|
-
</template>
|
|
362
|
-
|
|
363
|
-
<!-- <div class="t1">
|
|
364
|
-
<b>订单号:21533666</b>
|
|
365
|
-
<div class="status">未审核</div>
|
|
366
|
-
</div>
|
|
367
|
-
<div class="t2">
|
|
368
|
-
<p>产地:广东佛山</p>
|
|
369
|
-
<p>产地:广东佛山</p>
|
|
370
|
-
<p>产地:广东佛山</p>
|
|
371
|
-
</div>-->
|
|
372
|
-
</div>
|
|
373
|
-
</div>
|
|
374
|
-
<div class="vxe-grid" v-if="widget.options.isQueryTable">
|
|
375
|
-
<div class="vxe-grid--pager-wrapper">
|
|
376
|
-
<vxe-pager
|
|
377
|
-
class="pages-box"
|
|
378
|
-
:current-page.sync="page.current"
|
|
379
|
-
:page-size.sync="page.size"
|
|
380
|
-
:total="page.total"
|
|
381
|
-
:layouts="['PrevPage', 'Number', 'NextPage']"
|
|
382
|
-
@page-change="changePageNew"
|
|
383
|
-
>
|
|
384
|
-
<template #right>
|
|
385
|
-
<span>
|
|
386
|
-
<span>当前记录</span>
|
|
387
|
-
<span class="f-red"> {{ page.records.length }} </span>
|
|
388
|
-
<span>/</span>
|
|
389
|
-
<span class="f-red"> {{ page.total }}</span>
|
|
390
|
-
</span>
|
|
391
|
-
</template>
|
|
392
|
-
</vxe-pager>
|
|
393
|
-
</div>
|
|
394
|
-
</div>
|
|
395
|
-
|
|
396
|
-
<advancedSearchDialog
|
|
397
|
-
v-if="showAdvancedSearch"
|
|
398
|
-
:visiable.sync="showAdvancedSearch"
|
|
399
|
-
class="adSearchForm_all"
|
|
400
|
-
:formData="advancedFormData"
|
|
401
|
-
@confirm="confirmAdvancedSearchDialog"
|
|
402
|
-
@clear="advancedClear"
|
|
403
|
-
>
|
|
404
|
-
<template #form>
|
|
405
|
-
<vxe-form
|
|
406
|
-
:model="formModel"
|
|
407
|
-
title-width="102px"
|
|
408
|
-
:inline="true"
|
|
409
|
-
class="adSearchForm"
|
|
410
|
-
>
|
|
411
|
-
<template v-for="(searchColumn, index) in vxeOption.searchColumns">
|
|
412
|
-
<vxe-form-item>
|
|
413
|
-
<component
|
|
414
|
-
:is="getColumnWidgetName(searchColumn.widget)"
|
|
415
|
-
:field="searchColumn.widget"
|
|
416
|
-
:form-model="globalModel.formModel"
|
|
417
|
-
:designer="null"
|
|
418
|
-
:key="index"
|
|
419
|
-
:parent-widget="widget"
|
|
420
|
-
></component>
|
|
421
|
-
</vxe-form-item>
|
|
422
|
-
</template>
|
|
423
|
-
</vxe-form>
|
|
424
|
-
</template>
|
|
425
|
-
</advancedSearchDialog>
|
|
426
|
-
<el-dialog
|
|
427
|
-
title="明细详情"
|
|
428
|
-
:modal-append-to-body="false"
|
|
429
|
-
:close-on-click-modal="false"
|
|
430
|
-
:visible.sync="showRowDetailDialog"
|
|
431
|
-
:modal="false"
|
|
432
|
-
custom-class="dialog-style h5view-dialog"
|
|
433
|
-
width="100%"
|
|
434
|
-
top="0px"
|
|
435
|
-
v-el-drag-dialog
|
|
436
|
-
v-el-dialog-center
|
|
437
|
-
:destroy-on-close="true"
|
|
438
|
-
>
|
|
439
|
-
<div class="cont" style="height: calc(100vh - 73px)">
|
|
440
|
-
<div class="h5-list-box">
|
|
441
|
-
<div
|
|
442
|
-
v-for="(row, rowIndex) in [editRow]"
|
|
443
|
-
:key="rowIndex"
|
|
444
|
-
class="item"
|
|
445
|
-
>
|
|
446
|
-
<!-- <div class="del-btn"><i class="el-icon-delete"></i></div>-->
|
|
447
|
-
<template v-if="vxeOption.columns.length > 0">
|
|
448
|
-
<div class="t1" v-if="widget.options.isQueryTable">
|
|
449
|
-
<template
|
|
450
|
-
v-for="(column, columnIndex) in vxeOption.columns.filter(
|
|
451
|
-
(item, index) => item.isMainFiled
|
|
452
|
-
)"
|
|
453
|
-
>
|
|
454
|
-
<b>{{ column.title }}:</b>
|
|
455
|
-
<span>
|
|
456
|
-
<template v-if="!column.params.formatS">
|
|
457
|
-
{{ row[column.field] }}
|
|
458
|
-
</template>
|
|
459
|
-
<template v-else-if="column.params.formatS == 'render'">
|
|
460
|
-
{{
|
|
461
|
-
column.slots.default({
|
|
462
|
-
column: column,
|
|
463
|
-
rowIndex: rowIndex,
|
|
464
|
-
row: row,
|
|
465
|
-
items: fieldModel,
|
|
466
|
-
})
|
|
467
|
-
}}
|
|
468
|
-
</template>
|
|
469
|
-
<template
|
|
470
|
-
v-else-if="
|
|
471
|
-
column.slots && column.slots.default == 'widget'
|
|
472
|
-
"
|
|
473
|
-
>
|
|
474
|
-
<component
|
|
475
|
-
:is="getColumnWidgetName(column.params.widget)"
|
|
476
|
-
:field="column.params.widget"
|
|
477
|
-
:form-model="globalModel.formModel"
|
|
478
|
-
:designer="null"
|
|
479
|
-
:key="rowIndex"
|
|
480
|
-
:parent-widget="widget"
|
|
481
|
-
:columnConfig="column.params.columnConfig"
|
|
482
|
-
:subFormRowIndex="rowIndex"
|
|
483
|
-
:formItemProp="
|
|
484
|
-
getColumnProp(widget, {
|
|
485
|
-
column: column,
|
|
486
|
-
rowIndex: rowIndex,
|
|
487
|
-
row: row,
|
|
488
|
-
items: fieldModel,
|
|
489
|
-
})
|
|
490
|
-
"
|
|
491
|
-
:tableParam="{
|
|
492
|
-
column: column,
|
|
493
|
-
rowIndex: rowIndex,
|
|
494
|
-
row: row,
|
|
495
|
-
items: fieldModel,
|
|
496
|
-
}"
|
|
497
|
-
></component>
|
|
498
|
-
</template>
|
|
499
|
-
<template v-else-if="column.params.formatS == 'editDelete'">
|
|
500
|
-
<a
|
|
501
|
-
href="javascript:void(0);"
|
|
502
|
-
class="a-link"
|
|
503
|
-
@click.stop="deleteRow(row, rowIndex)"
|
|
504
|
-
>
|
|
505
|
-
<el-tooltip
|
|
506
|
-
:enterable="false"
|
|
507
|
-
effect="dark"
|
|
508
|
-
content="删除"
|
|
509
|
-
placement="top"
|
|
510
|
-
popper-class="tooltip-skin"
|
|
511
|
-
>
|
|
512
|
-
<i class="el-icon-delete" />
|
|
513
|
-
</el-tooltip>
|
|
514
|
-
</a>
|
|
515
|
-
</template>
|
|
516
|
-
<template v-else-if="column.params.formatS == 'editButton'">
|
|
517
|
-
<a
|
|
518
|
-
href="javascript:void(0);"
|
|
519
|
-
class="a-link"
|
|
520
|
-
@click.stop="openEditDialog(obj.row)"
|
|
521
|
-
>
|
|
522
|
-
<el-tooltip
|
|
523
|
-
:enterable="false"
|
|
524
|
-
effect="dark"
|
|
525
|
-
content="查看"
|
|
526
|
-
placement="top"
|
|
527
|
-
popper-class="tooltip-skin"
|
|
528
|
-
>
|
|
529
|
-
<i class="el-icon-edit" />
|
|
530
|
-
</el-tooltip>
|
|
531
|
-
</a>
|
|
532
|
-
</template>
|
|
533
|
-
<template v-else>
|
|
534
|
-
{{
|
|
535
|
-
column.formatter({
|
|
536
|
-
cellValue: row[column.field],
|
|
537
|
-
column: column,
|
|
538
|
-
rowIndex: rowIndex,
|
|
539
|
-
row: row,
|
|
540
|
-
items: fieldModel,
|
|
541
|
-
})
|
|
542
|
-
}}
|
|
543
|
-
</template>
|
|
544
|
-
</span>
|
|
545
|
-
<!-- <div class="status">未审核</div>-->
|
|
546
|
-
</template>
|
|
547
|
-
</div>
|
|
548
|
-
<div class="t2">
|
|
549
|
-
<template
|
|
550
|
-
v-if="
|
|
551
|
-
!widget.options.isQueryTable || vxeOption.columns.length > 1
|
|
552
|
-
"
|
|
553
|
-
>
|
|
554
|
-
<template v-for="(column, columnIndex) in vxeOption.columns">
|
|
555
|
-
<template
|
|
556
|
-
v-if="!widget.options.isQueryTable || !column.isMainFiled"
|
|
557
|
-
>
|
|
558
|
-
<dl>
|
|
559
|
-
<div>
|
|
560
|
-
<dt>{{ column.title }}:</dt>
|
|
561
|
-
<dd>
|
|
562
|
-
<template v-if="!column.params.formatS">
|
|
563
|
-
{{ row[column.field] }}
|
|
564
|
-
</template>
|
|
565
|
-
<template
|
|
566
|
-
v-else-if="column.params.formatS == 'render'"
|
|
567
|
-
>
|
|
568
|
-
{{
|
|
569
|
-
column.slots.default({
|
|
570
|
-
column: column,
|
|
571
|
-
rowIndex: rowIndex,
|
|
572
|
-
row: row,
|
|
573
|
-
items: fieldModel,
|
|
574
|
-
})
|
|
575
|
-
}}
|
|
576
|
-
</template>
|
|
577
|
-
|
|
578
|
-
<template
|
|
579
|
-
v-else-if="
|
|
580
|
-
column.slots && column.slots.default == 'widget'
|
|
581
|
-
"
|
|
582
|
-
>
|
|
583
|
-
<component
|
|
584
|
-
:is="getColumnWidgetName(column.params.widget)"
|
|
585
|
-
:field="column.params.widget"
|
|
586
|
-
:form-model="globalModel.formModel"
|
|
587
|
-
:designer="null"
|
|
588
|
-
:key="rowIndex + '-' + columnIndex"
|
|
589
|
-
:parent-widget="widget"
|
|
590
|
-
:columnConfig="column.params.columnConfig"
|
|
591
|
-
:subFormRowIndex="rowIndex"
|
|
592
|
-
:formItemProp="
|
|
593
|
-
getColumnProp(widget, {
|
|
594
|
-
column: column,
|
|
595
|
-
rowIndex: rowIndex,
|
|
596
|
-
row: row,
|
|
597
|
-
items: fieldModel,
|
|
598
|
-
})
|
|
599
|
-
"
|
|
600
|
-
:tableParam="{
|
|
601
|
-
column: column,
|
|
602
|
-
rowIndex: rowIndex,
|
|
603
|
-
row: row,
|
|
604
|
-
items: fieldModel,
|
|
605
|
-
}"
|
|
606
|
-
></component>
|
|
607
|
-
</template>
|
|
608
|
-
<template
|
|
609
|
-
v-else-if="column.params.formatS == 'editDelete'"
|
|
610
|
-
>
|
|
611
|
-
<a
|
|
612
|
-
href="javascript:void(0);"
|
|
613
|
-
class="a-link"
|
|
614
|
-
@click="deleteRow(row, rowIndex)"
|
|
615
|
-
>
|
|
616
|
-
<el-tooltip
|
|
617
|
-
:enterable="false"
|
|
618
|
-
effect="dark"
|
|
619
|
-
content="删除"
|
|
620
|
-
placement="top"
|
|
621
|
-
popper-class="tooltip-skin"
|
|
622
|
-
>
|
|
623
|
-
<i class="el-icon-delete" />
|
|
624
|
-
</el-tooltip>
|
|
625
|
-
</a>
|
|
626
|
-
</template>
|
|
627
|
-
<template
|
|
628
|
-
v-else-if="column.params.formatS == 'editButton'"
|
|
629
|
-
>
|
|
630
|
-
<a
|
|
631
|
-
href="javascript:void(0);"
|
|
632
|
-
class="a-link"
|
|
633
|
-
@click="openEditDialog(obj.row)"
|
|
634
|
-
>
|
|
635
|
-
<el-tooltip
|
|
636
|
-
:enterable="false"
|
|
637
|
-
effect="dark"
|
|
638
|
-
content="查看"
|
|
639
|
-
placement="top"
|
|
640
|
-
popper-class="tooltip-skin"
|
|
641
|
-
>
|
|
642
|
-
<i class="el-icon-edit" />
|
|
643
|
-
</el-tooltip>
|
|
644
|
-
</a>
|
|
645
|
-
</template>
|
|
646
|
-
<template v-else>
|
|
647
|
-
{{
|
|
648
|
-
column.formatter({
|
|
649
|
-
cellValue: row[column.field],
|
|
650
|
-
column: column,
|
|
651
|
-
rowIndex: rowIndex,
|
|
652
|
-
row: row,
|
|
653
|
-
items: fieldModel,
|
|
654
|
-
})
|
|
655
|
-
}}
|
|
656
|
-
</template>
|
|
657
|
-
</dd>
|
|
658
|
-
</div>
|
|
659
|
-
</dl>
|
|
660
|
-
</template>
|
|
661
|
-
</template>
|
|
662
|
-
</template>
|
|
663
|
-
</div>
|
|
664
|
-
<div class="btns">
|
|
665
|
-
<template
|
|
666
|
-
v-if="!!widget.lineButtons && widget.lineButtons.length > 0"
|
|
667
|
-
>
|
|
668
|
-
<template v-for="(subWidget, swIdx) in widget.lineButtons">
|
|
669
|
-
<template v-if="'container' === subWidget.category">
|
|
670
|
-
<component
|
|
671
|
-
:is="subWidget.type + '-item'"
|
|
672
|
-
:widget="subWidget"
|
|
673
|
-
:key="swIdx"
|
|
674
|
-
:parent-list="widget.lineButtons"
|
|
675
|
-
:index-of-parent-list="swIdx"
|
|
676
|
-
:parent-widget="widget"
|
|
677
|
-
:subFormRowIndex="rowIndex"
|
|
678
|
-
:tableParam="{
|
|
679
|
-
rowIndex: rowIndex,
|
|
680
|
-
row: row,
|
|
681
|
-
items: fieldModel,
|
|
682
|
-
}"
|
|
683
|
-
>
|
|
684
|
-
<!-- 递归传递插槽!!! -->
|
|
685
|
-
<template
|
|
686
|
-
v-for="slot in Object.keys($scopedSlots)"
|
|
687
|
-
v-slot:[slot]="scope"
|
|
688
|
-
>
|
|
689
|
-
<slot :name="slot" v-bind="scope" />
|
|
690
|
-
</template>
|
|
691
|
-
</component>
|
|
692
|
-
</template>
|
|
693
|
-
<template v-else>
|
|
694
|
-
<component
|
|
695
|
-
:is="subWidget.type + '-widget'"
|
|
696
|
-
:field="subWidget"
|
|
697
|
-
:designer="null"
|
|
698
|
-
:key="swIdx"
|
|
699
|
-
:parent-list="widget.lineButtons"
|
|
700
|
-
:index-of-parent-list="swIdx"
|
|
701
|
-
:parent-widget="widget"
|
|
702
|
-
:subFormRowIndex="rowIndex"
|
|
703
|
-
:tableParam="{
|
|
704
|
-
rowIndex: rowIndex,
|
|
705
|
-
row: row,
|
|
706
|
-
items: fieldModel,
|
|
707
|
-
}"
|
|
708
|
-
>
|
|
709
|
-
<!-- 递归传递插槽!!! -->
|
|
710
|
-
<template
|
|
711
|
-
v-for="slot in Object.keys($scopedSlots)"
|
|
712
|
-
v-slot:[slot]="scope"
|
|
713
|
-
>
|
|
714
|
-
<slot :name="slot" v-bind="scope" />
|
|
715
|
-
</template>
|
|
716
|
-
</component>
|
|
717
|
-
</template>
|
|
718
|
-
</template>
|
|
719
|
-
</template>
|
|
720
|
-
</div>
|
|
721
|
-
</template>
|
|
722
|
-
|
|
723
|
-
<!-- <div class="t1">
|
|
724
|
-
<b>订单号:21533666</b>
|
|
725
|
-
<div class="status">未审核</div>
|
|
726
|
-
</div>
|
|
727
|
-
<div class="t2">
|
|
728
|
-
<p>产地:广东佛山</p>
|
|
729
|
-
<p>产地:广东佛山</p>
|
|
730
|
-
<p>产地:广东佛山</p>
|
|
731
|
-
</div>-->
|
|
732
|
-
</div>
|
|
733
|
-
</div>
|
|
734
|
-
</div>
|
|
735
|
-
</el-dialog>
|
|
736
|
-
</container-item-wrapper>
|
|
737
|
-
</template>
|
|
738
|
-
|
|
739
|
-
<script>
|
|
740
|
-
import emitter from "../../../../components/xform/utils/emitter";
|
|
741
|
-
import i18n from "../../../../components/xform/utils/i18n";
|
|
742
|
-
import refMixin from "../../../../components/xform/form-render/refMixin";
|
|
743
|
-
import containerItemMixin from "./containerItemMixin";
|
|
744
|
-
import FieldComponents from "../../../../components/xform/form-designer/form-widget/field-widget/index";
|
|
745
|
-
import {
|
|
746
|
-
assembleAxiosConfig,
|
|
747
|
-
generateId,
|
|
748
|
-
getReportGlobalMap,
|
|
749
|
-
} from "../../../../components/xform/utils/util";
|
|
750
|
-
import * as formatUtil from "../../../../components/xform/utils/format";
|
|
751
|
-
import render from "../../../../views/user/bill_setting/render.vue";
|
|
752
|
-
|
|
753
|
-
const baseRefUtil = {
|
|
754
|
-
emitter,
|
|
755
|
-
i18n,
|
|
756
|
-
refMixin,
|
|
757
|
-
containerItemMixin,
|
|
758
|
-
formatUtil,
|
|
759
|
-
assembleAxiosConfig,
|
|
760
|
-
getReportGlobalMap,
|
|
761
|
-
};
|
|
762
|
-
|
|
763
|
-
export default {
|
|
764
|
-
name: "list-h5-item",
|
|
765
|
-
components: {
|
|
766
|
-
...FieldComponents,
|
|
767
|
-
},
|
|
768
|
-
mixins: [emitter, i18n, refMixin, containerItemMixin],
|
|
769
|
-
componentName: "ContainerItem",
|
|
770
|
-
props: {
|
|
771
|
-
widget: Object,
|
|
772
|
-
parentWidget: Object,
|
|
773
|
-
parentList: Array,
|
|
774
|
-
indexOfParentList: Number,
|
|
775
|
-
subFormRowIndex: {
|
|
776
|
-
type: Number,
|
|
777
|
-
default: -1,
|
|
778
|
-
},
|
|
779
|
-
subFormColIndex: {
|
|
780
|
-
type: Number,
|
|
781
|
-
default: -1,
|
|
782
|
-
},
|
|
783
|
-
subFormRowId: {
|
|
784
|
-
type: String,
|
|
785
|
-
default: "",
|
|
786
|
-
},
|
|
787
|
-
},
|
|
788
|
-
inject: [
|
|
789
|
-
"refList",
|
|
790
|
-
"sfRefList",
|
|
791
|
-
"globalModel",
|
|
792
|
-
"getFormConfig",
|
|
793
|
-
"getGlobalDsv",
|
|
794
|
-
],
|
|
795
|
-
data: function () {
|
|
796
|
-
let that = this;
|
|
797
|
-
let pageSize = 2;
|
|
798
|
-
return {
|
|
799
|
-
showAdvancedSearch: false,
|
|
800
|
-
showRowDetailDialog: false,
|
|
801
|
-
editRow: {},
|
|
802
|
-
fieldModel: [],
|
|
803
|
-
selectedIndices: [],
|
|
804
|
-
/*pageSize: this.widget.options.pagination.pageSize,
|
|
805
|
-
pageSizes: this.widget.options.pagination.pageSizes,
|
|
806
|
-
currentPage: this.widget.options.pagination.currentPage,
|
|
807
|
-
total: this.widget.options.pagination.total,*/
|
|
808
|
-
formData: {
|
|
809
|
-
saleOrgName: "",
|
|
810
|
-
loginAccount: "",
|
|
811
|
-
mobile: "",
|
|
812
|
-
enabled: 1,
|
|
813
|
-
},
|
|
814
|
-
vxeOption: { columns: [] },
|
|
815
|
-
requestAccess: null,
|
|
816
|
-
columnFormatMap: {
|
|
817
|
-
editInput: "input",
|
|
818
|
-
editNumber: "number",
|
|
819
|
-
editDate: "date",
|
|
820
|
-
editSelect: "select",
|
|
821
|
-
editSearch: "vabsearch",
|
|
822
|
-
button: "button",
|
|
823
|
-
},
|
|
824
|
-
dataTableConfig: {},
|
|
825
|
-
advancedFormData: {},
|
|
826
|
-
|
|
827
|
-
pageSize: pageSize,
|
|
828
|
-
page: {
|
|
829
|
-
current: 1,
|
|
830
|
-
size: pageSize,
|
|
831
|
-
total: 0,
|
|
832
|
-
records: [],
|
|
833
|
-
},
|
|
834
|
-
keyword: null,
|
|
835
|
-
|
|
836
|
-
checkItemIds: [],
|
|
837
|
-
};
|
|
838
|
-
},
|
|
839
|
-
watch: {
|
|
840
|
-
fieldModel(val) {
|
|
841
|
-
this.formModel[this.fieldKeyName] = val || [];
|
|
842
|
-
},
|
|
843
|
-
},
|
|
844
|
-
computed: {
|
|
845
|
-
formConfig: function () {
|
|
846
|
-
return this.getFormConfig();
|
|
847
|
-
},
|
|
848
|
-
paginationLayout: function () {
|
|
849
|
-
return this.widget.options.smallPagination
|
|
850
|
-
? "prev, pager, next"
|
|
851
|
-
: "total, sizes, prev, pager, next, jumper";
|
|
852
|
-
},
|
|
853
|
-
customClass: function () {
|
|
854
|
-
return this.widget.options.customClass || "";
|
|
855
|
-
},
|
|
856
|
-
singleRowSelectFlag: function () {
|
|
857
|
-
return !this.widget.options.showCheckBox;
|
|
858
|
-
},
|
|
859
|
-
buttonsColumnFixed: function () {
|
|
860
|
-
return void 0 === this.widget.options.buttonsColumnFixed
|
|
861
|
-
? "right"
|
|
862
|
-
: !!this.widget.options.buttonsColumnFixed &&
|
|
863
|
-
this.widget.options.buttonsColumnFixed;
|
|
864
|
-
},
|
|
865
|
-
columns() {
|
|
866
|
-
let tableColumns = this.widget.options.tableColumns;
|
|
867
|
-
let newColumns = [];
|
|
868
|
-
/*newColumns.push({
|
|
869
|
-
type: 'checkbox',
|
|
870
|
-
width: 48,
|
|
871
|
-
resizable: false,
|
|
872
|
-
fixed: 'left'
|
|
873
|
-
});*/
|
|
874
|
-
|
|
875
|
-
let firstColumn = tableColumns.find((column) => {
|
|
876
|
-
return !!column.prop && !!column.showForRow;
|
|
877
|
-
});
|
|
878
|
-
let mainFiled = firstColumn?.prop;
|
|
879
|
-
|
|
880
|
-
let formRef = this.getFormRef();
|
|
881
|
-
let dateConfig = this.$baseLodash.cloneDeep(
|
|
882
|
-
formRef.getFieldWidgetByType("date").options
|
|
883
|
-
);
|
|
884
|
-
tableColumns.forEach((t) => {
|
|
885
|
-
let columnOption;
|
|
886
|
-
let widget;
|
|
887
|
-
let columnWidgetConfig = this.getColumnWidgetConfig(t);
|
|
888
|
-
let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
|
|
889
|
-
if (columnSelectedWidget) {
|
|
890
|
-
widget = columnSelectedWidget;
|
|
891
|
-
columnOption = widget.options;
|
|
892
|
-
} else {
|
|
893
|
-
columnOption = {};
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
let col = {
|
|
897
|
-
fixed: !!t.fixed && t.fixed,
|
|
898
|
-
field: t.prop,
|
|
899
|
-
title: t.label,
|
|
900
|
-
witdh: t.width,
|
|
901
|
-
sortable: t.sortable,
|
|
902
|
-
align: t.align ? t.align : "center",
|
|
903
|
-
formatter: this.formatterValue,
|
|
904
|
-
isMainFiled: mainFiled == t.prop,
|
|
905
|
-
showForRow: t.showForRow,
|
|
906
|
-
params: {
|
|
907
|
-
...columnOption,
|
|
908
|
-
widget: widget,
|
|
909
|
-
formatS: t.formatS,
|
|
910
|
-
required: t.required || false,
|
|
911
|
-
columnConfig: t,
|
|
912
|
-
},
|
|
913
|
-
visible: t.show,
|
|
914
|
-
};
|
|
915
|
-
|
|
916
|
-
if (t.formatS == "render") {
|
|
917
|
-
let r = t.render ? new Function("params", "h", t.render) : null;
|
|
918
|
-
col.slots = {
|
|
919
|
-
default: (params, h) => {
|
|
920
|
-
return r ? r.call(this, params, h) : "";
|
|
921
|
-
},
|
|
922
|
-
};
|
|
923
|
-
} else if (columnSelectedWidget) {
|
|
924
|
-
col.slots = {
|
|
925
|
-
default: "widget",
|
|
926
|
-
};
|
|
927
|
-
} else if (["editDelete", "editButton"].includes(t.formatS)) {
|
|
928
|
-
col.slots = {
|
|
929
|
-
default: t.formatS,
|
|
930
|
-
};
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
newColumns.push(col);
|
|
934
|
-
});
|
|
935
|
-
|
|
936
|
-
/*if (baseRefUtil.tableConfig && baseRefUtil.tableConfig.className == "list-table") {
|
|
937
|
-
if (tableColumns.length) {
|
|
938
|
-
let tableColumn = [tableColumns.length - 1];
|
|
939
|
-
if (tableColumn.fixed != "right") {
|
|
940
|
-
newColumns.push({
|
|
941
|
-
width: 47,
|
|
942
|
-
title: '',
|
|
943
|
-
fixed: 'right',
|
|
944
|
-
sortable: false,
|
|
945
|
-
});
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
}*/
|
|
949
|
-
return newColumns;
|
|
950
|
-
},
|
|
951
|
-
formModel: {
|
|
952
|
-
cache: !1,
|
|
953
|
-
get: function () {
|
|
954
|
-
return this.globalModel.formModel;
|
|
955
|
-
},
|
|
956
|
-
},
|
|
957
|
-
formDataId() {
|
|
958
|
-
let formRef = this.getFormRef();
|
|
959
|
-
return formRef.dataId;
|
|
960
|
-
},
|
|
961
|
-
},
|
|
962
|
-
created: function () {
|
|
963
|
-
if (!this.formModel[this.fieldKeyName])
|
|
964
|
-
this.formModel[this.fieldKeyName] = [];
|
|
965
|
-
this.initRefList();
|
|
966
|
-
this.handleOnCreated();
|
|
967
|
-
},
|
|
968
|
-
mounted: async function () {
|
|
969
|
-
this.handleOnMounted();
|
|
970
|
-
this.initTableList();
|
|
971
|
-
},
|
|
972
|
-
beforeDestroy: function () {
|
|
973
|
-
this.unregisterFromRefList();
|
|
974
|
-
},
|
|
975
|
-
methods: {
|
|
976
|
-
openAdvancedSearchDialog() {
|
|
977
|
-
/*let formData = this.formModel;
|
|
978
|
-
let advancedFormData = {};
|
|
979
|
-
this.vxeOption.searchColumns.forEach(form1Field => {
|
|
980
|
-
let value = formData[form1Field.field];
|
|
981
|
-
if (value !== null && value !== undefined) {
|
|
982
|
-
advancedFormData[form1Field.field] = value
|
|
983
|
-
} else {
|
|
984
|
-
advancedFormData[form1Field.field] = null
|
|
985
|
-
}
|
|
986
|
-
});
|
|
987
|
-
this.advancedFormData = advancedFormData;*/
|
|
988
|
-
this.showAdvancedSearch = true;
|
|
989
|
-
},
|
|
990
|
-
confirmAdvancedSearchDialog() {
|
|
991
|
-
let formModel = this.formModel;
|
|
992
|
-
let advancedFormData = this.advancedFormData;
|
|
993
|
-
this.vxeOption.searchColumns.forEach((form1Field) => {
|
|
994
|
-
let value = formModel[form1Field.field];
|
|
995
|
-
if (value !== null && value !== undefined) {
|
|
996
|
-
advancedFormData[form1Field.field] = value;
|
|
997
|
-
} else {
|
|
998
|
-
advancedFormData[form1Field.field] = null;
|
|
999
|
-
}
|
|
1000
|
-
});
|
|
1001
|
-
this.searchEvent();
|
|
1002
|
-
},
|
|
1003
|
-
advancedClear() {
|
|
1004
|
-
this.vxeOption.searchColumns.forEach((form1Field) => {
|
|
1005
|
-
let widgetRef = this.getWidgetRef(form1Field.widget.options.name);
|
|
1006
|
-
if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
|
|
1007
|
-
});
|
|
1008
|
-
},
|
|
1009
|
-
setValue(val) {
|
|
1010
|
-
let rows = val || [];
|
|
1011
|
-
this.formModel[this.fieldKeyName] = rows;
|
|
1012
|
-
this.fieldModel = rows;
|
|
1013
|
-
},
|
|
1014
|
-
getValue() {
|
|
1015
|
-
return this.formModel[this.fieldKeyName];
|
|
1016
|
-
},
|
|
1017
|
-
getFieldKeyName(widget) {
|
|
1018
|
-
let o = widget.options.name;
|
|
1019
|
-
return (widget.options.keyNameEnabled && widget.options.keyName) || o;
|
|
1020
|
-
},
|
|
1021
|
-
formatterValue: function ({ cellValue, row, column }) {
|
|
1022
|
-
if (cellValue === null || cellValue === undefined) return cellValue;
|
|
1023
|
-
|
|
1024
|
-
if (column.params && column.params.formatS)
|
|
1025
|
-
switch (column.params.formatS) {
|
|
1026
|
-
case "d1":
|
|
1027
|
-
return baseRefUtil.formatUtil.formatDate1(cellValue);
|
|
1028
|
-
case "d2":
|
|
1029
|
-
return baseRefUtil.formatUtil.formatDate2(cellValue);
|
|
1030
|
-
case "d3":
|
|
1031
|
-
return baseRefUtil.formatUtil.formatDate3(cellValue);
|
|
1032
|
-
case "d4":
|
|
1033
|
-
return baseRefUtil.formatUtil.formatDate4(cellValue);
|
|
1034
|
-
case "d5":
|
|
1035
|
-
return baseRefUtil.formatUtil.formatDate4(cellValue);
|
|
1036
|
-
case "n1":
|
|
1037
|
-
return baseRefUtil.formatUtil.formatNumber1(cellValue);
|
|
1038
|
-
case "n2":
|
|
1039
|
-
return baseRefUtil.formatUtil.formatNumber2(cellValue);
|
|
1040
|
-
case "n3":
|
|
1041
|
-
return baseRefUtil.formatUtil.formatNumber3(cellValue);
|
|
1042
|
-
case "n4":
|
|
1043
|
-
return baseRefUtil.formatUtil.formatNumber4(cellValue);
|
|
1044
|
-
case "n5":
|
|
1045
|
-
return baseRefUtil.formatUtil.formatNumber5(cellValue);
|
|
1046
|
-
case "n6":
|
|
1047
|
-
return baseRefUtil.formatUtil.formatNumber6(cellValue);
|
|
1048
|
-
case "n7":
|
|
1049
|
-
return baseRefUtil.formatUtil.formatNumber7(cellValue);
|
|
1050
|
-
}
|
|
1051
|
-
return cellValue;
|
|
1052
|
-
},
|
|
1053
|
-
searchEvent() {
|
|
1054
|
-
// this.getGridTable().commitProxy('reload');
|
|
1055
|
-
this.loadAccessData();
|
|
1056
|
-
},
|
|
1057
|
-
async resetEvent() {
|
|
1058
|
-
let formData = this.formModel;
|
|
1059
|
-
this.keyword = null;
|
|
1060
|
-
this.widget.widgetList &&
|
|
1061
|
-
this.widget.widgetList.forEach((subWidget) => {
|
|
1062
|
-
let widgetRef = this.getWidgetRef(subWidget.options.name);
|
|
1063
|
-
let fieldKeyName = this.getFieldKeyName(subWidget);
|
|
1064
|
-
formData[fieldKeyName] = null;
|
|
1065
|
-
this.advancedFormData[fieldKeyName] = null;
|
|
1066
|
-
if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
|
|
1067
|
-
});
|
|
1068
|
-
// this.getGridTable().commitProxy('reload');
|
|
1069
|
-
this.loadAccessData();
|
|
1070
|
-
},
|
|
1071
|
-
openEditDialog(row) {
|
|
1072
|
-
let formRef = this.getFormRef();
|
|
1073
|
-
let parentTarget = formRef.$attrs["parent-target"];
|
|
1074
|
-
parentTarget &&
|
|
1075
|
-
parentTarget.$attrs.openEditDialog &&
|
|
1076
|
-
parentTarget.$attrs.openEditDialog(row);
|
|
1077
|
-
},
|
|
1078
|
-
initTableList() {
|
|
1079
|
-
let that = this;
|
|
1080
|
-
let path = null;
|
|
1081
|
-
let paramFun = null;
|
|
1082
|
-
// let mainDataSetDTO = null;
|
|
1083
|
-
let requestAccess = this.requestAccess;
|
|
1084
|
-
let tableRef = this.getTableRef();
|
|
1085
|
-
let formDataModel = this.getFormRef().formDataModel;
|
|
1086
|
-
let isQueryTable = this.widget.options.isQueryTable || false;
|
|
1087
|
-
let isDataPage = this.widget.options.accessReturnType == "2";
|
|
1088
|
-
let formCode = this.getFormRef().reportTemplate.formCode;
|
|
1089
|
-
let dataId = this.formDataId;
|
|
1090
|
-
let accessScript = this.widget.options.accessScript;
|
|
1091
|
-
let searchColumns = null;
|
|
1092
|
-
if (isQueryTable) {
|
|
1093
|
-
path = this.getUrl();
|
|
1094
|
-
paramFun = () => {
|
|
1095
|
-
// let conditions = this.getSearchCondition();
|
|
1096
|
-
let conditions = { keyword: this.keyword, ...this.advancedFormData };
|
|
1097
|
-
if (this.widget.options.showPagination) {
|
|
1098
|
-
let searchCount = true;
|
|
1099
|
-
/*let isQueryAllPage = $grid.isQueryAllPage;
|
|
1100
|
-
if (isQueryAllPage == false) {
|
|
1101
|
-
searchCount = false;
|
|
1102
|
-
}*/
|
|
1103
|
-
/*let pager = proxyInfo ? proxyInfo.pager : null;
|
|
1104
|
-
if (pager) {
|
|
1105
|
-
conditions.current = pager.currentPage;
|
|
1106
|
-
conditions.size = pager.pageSize;
|
|
1107
|
-
conditions.searchCount = searchCount;
|
|
1108
|
-
}*/
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
/*let formData = {
|
|
1112
|
-
accessCode: requestAccess.accessCode,
|
|
1113
|
-
conditions: conditions
|
|
1114
|
-
};*/
|
|
1115
|
-
let formData = conditions;
|
|
1116
|
-
return formData;
|
|
1117
|
-
};
|
|
1118
|
-
|
|
1119
|
-
searchColumns = [];
|
|
1120
|
-
let widgetList = this.widget.widgetList;
|
|
1121
|
-
let typeMap = {
|
|
1122
|
-
input: "input",
|
|
1123
|
-
number: "number",
|
|
1124
|
-
inputBatch: "inputBatch",
|
|
1125
|
-
date: "date",
|
|
1126
|
-
};
|
|
1127
|
-
|
|
1128
|
-
widgetList.forEach((widget) => {
|
|
1129
|
-
if ("container" !== widget.category) {
|
|
1130
|
-
let options = widget.options;
|
|
1131
|
-
let type = typeMap[widget.type] || null;
|
|
1132
|
-
searchColumns.push({
|
|
1133
|
-
title: options.label,
|
|
1134
|
-
field: this.getFieldKeyName(widget),
|
|
1135
|
-
type: type,
|
|
1136
|
-
common: true,
|
|
1137
|
-
disabled: options.disabled,
|
|
1138
|
-
defaultValueEnabled: !!type,
|
|
1139
|
-
slot: options.name,
|
|
1140
|
-
widget: widget,
|
|
1141
|
-
formItem: false,
|
|
1142
|
-
});
|
|
1143
|
-
}
|
|
1144
|
-
});
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
let formRef = this.getFormRef();
|
|
1148
|
-
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
|
1149
|
-
this.dataTableConfig = dataTableConfig;
|
|
1150
|
-
|
|
1151
|
-
let tableOption = {
|
|
1152
|
-
vue: this,
|
|
1153
|
-
tableRef: tableRef,
|
|
1154
|
-
tableName: this.widget.options.name,
|
|
1155
|
-
param: paramFun,
|
|
1156
|
-
columns: this.columns,
|
|
1157
|
-
searchColumns: searchColumns,
|
|
1158
|
-
vform: true,
|
|
1159
|
-
config: {
|
|
1160
|
-
height: isQueryTable ? "550px" : this.widget.options.tableHeight,
|
|
1161
|
-
/*pagerConfig: {
|
|
1162
|
-
autoHidden: !this.widget.options.showPagination
|
|
1163
|
-
},*/
|
|
1164
|
-
...dataTableConfig.config,
|
|
1165
|
-
},
|
|
1166
|
-
exportAjax: (param) => {
|
|
1167
|
-
let $grid = this.getGridTable();
|
|
1168
|
-
let pageSize = param.size;
|
|
1169
|
-
let currentPage = param.current;
|
|
1170
|
-
let page = { pageSize, currentPage };
|
|
1171
|
-
return this.vxeOption.config.proxyConfig.ajax.query.call(this, {
|
|
1172
|
-
page,
|
|
1173
|
-
param,
|
|
1174
|
-
});
|
|
1175
|
-
},
|
|
1176
|
-
};
|
|
1177
|
-
|
|
1178
|
-
if (isQueryTable) {
|
|
1179
|
-
tableOption.path = path;
|
|
1180
|
-
tableOption.config.proxyConfig = {
|
|
1181
|
-
props: {
|
|
1182
|
-
result: isDataPage ? "objx.records" : "objx", // 配置响应结果列表字段
|
|
1183
|
-
total: isDataPage ? "objx.total" : "objx.length", // 配置响应结果总页数字段
|
|
1184
|
-
},
|
|
1185
|
-
ajax: {
|
|
1186
|
-
// 接收 Promise 对象
|
|
1187
|
-
query: ({ page, sorts, filters, form, param }) => {
|
|
1188
|
-
if (!path) {
|
|
1189
|
-
return;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
let formData = tableOption.param ? tableOption.param() || {} : {};
|
|
1193
|
-
const queryParams = Object.assign({}, formData);
|
|
1194
|
-
|
|
1195
|
-
// 处理排序条件
|
|
1196
|
-
if (sorts) {
|
|
1197
|
-
const firstSort = sorts[0];
|
|
1198
|
-
if (firstSort) {
|
|
1199
|
-
queryParams.sort = firstSort.property;
|
|
1200
|
-
queryParams.order = firstSort.order;
|
|
1201
|
-
}
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
// 处理筛选条件
|
|
1205
|
-
if (filters) {
|
|
1206
|
-
filters.forEach(({ property, values }) => {
|
|
1207
|
-
queryParams[property] = values.join(",");
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
if (page.pageSize !== undefined) {
|
|
1212
|
-
queryParams["size"] = `${page.pageSize}`;
|
|
1213
|
-
queryParams["current"] = `${page.currentPage}`;
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
/*let $grid = this.getGridTable();
|
|
1217
|
-
let isQueryAllPage = $grid.isQueryAllPage;
|
|
1218
|
-
let pathStr1 = "";
|
|
1219
|
-
if (isQueryAllPage === false) {
|
|
1220
|
-
queryParams.searchCount = false;
|
|
1221
|
-
}*/
|
|
1222
|
-
Object.assign(queryParams, param);
|
|
1223
|
-
|
|
1224
|
-
var reqPath = typeof path == "function" ? path() : path;
|
|
1225
|
-
|
|
1226
|
-
return new Promise((resolve, reject) => {
|
|
1227
|
-
let reqData = {
|
|
1228
|
-
formCode: formCode,
|
|
1229
|
-
...queryParams,
|
|
1230
|
-
};
|
|
1231
|
-
if (accessScript) {
|
|
1232
|
-
let index = 0;
|
|
1233
|
-
let toDo = () => {
|
|
1234
|
-
let f = new Function(
|
|
1235
|
-
"dataId",
|
|
1236
|
-
"formCode",
|
|
1237
|
-
"param",
|
|
1238
|
-
"done",
|
|
1239
|
-
accessScript
|
|
1240
|
-
);
|
|
1241
|
-
let done = (res) => {
|
|
1242
|
-
resolve(res);
|
|
1243
|
-
if (res.type == "success") {
|
|
1244
|
-
let rows = res.objx
|
|
1245
|
-
? res.objx.records || res.objx || []
|
|
1246
|
-
: [];
|
|
1247
|
-
this.setValue(rows);
|
|
1248
|
-
if (res.objx && res.objx.records) {
|
|
1249
|
-
this.page = res.objx || {};
|
|
1250
|
-
}
|
|
1251
|
-
if (tableOption.callback) {
|
|
1252
|
-
that.$nextTick(() => {
|
|
1253
|
-
setTimeout(function () {
|
|
1254
|
-
tableOption.callback(rows);
|
|
1255
|
-
}, 0);
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
} else {
|
|
1259
|
-
this.setValue([]);
|
|
1260
|
-
}
|
|
1261
|
-
};
|
|
1262
|
-
let r = f.call(that, dataId, formCode, reqData, done);
|
|
1263
|
-
if (r) {
|
|
1264
|
-
r.catch((error) => {
|
|
1265
|
-
reject(error);
|
|
1266
|
-
});
|
|
1267
|
-
}
|
|
1268
|
-
};
|
|
1269
|
-
let loopHandle = () => {
|
|
1270
|
-
/*if (index < 500 && $grid.tableFormStop === true) {
|
|
1271
|
-
//阻塞列表查询,或者次数达到500时,自动释放
|
|
1272
|
-
index++
|
|
1273
|
-
setTimeout(() => {
|
|
1274
|
-
loopHandle();
|
|
1275
|
-
}, 10)
|
|
1276
|
-
} else {
|
|
1277
|
-
if ($grid.tableFormStop) $grid.tableFormStop = false;
|
|
1278
|
-
toDo();
|
|
1279
|
-
}*/
|
|
1280
|
-
toDo();
|
|
1281
|
-
};
|
|
1282
|
-
loopHandle();
|
|
1283
|
-
} else {
|
|
1284
|
-
resolve();
|
|
1285
|
-
}
|
|
1286
|
-
/*that.scriptHttp({
|
|
1287
|
-
options: this.widget.options,
|
|
1288
|
-
params: queryParams,
|
|
1289
|
-
callback: (res) => {
|
|
1290
|
-
resolve(res);
|
|
1291
|
-
if (res.type == "success") {
|
|
1292
|
-
let rows = res.objx ? res.objx.records || res.objx || [] : [];
|
|
1293
|
-
/!*if (tableOption.treeNodeUrl) {
|
|
1294
|
-
if (rows.length > 0) {
|
|
1295
|
-
let $t = this.$refs[tableRef];
|
|
1296
|
-
var treeConditions = $t.originOption.treeConditions || [
|
|
1297
|
-
"enabled",
|
|
1298
|
-
];
|
|
1299
|
-
let treeFiled = Object.keys(formData).some((key) => {
|
|
1300
|
-
return (
|
|
1301
|
-
!treeConditions.includes(key) && formData[key] != null && formData[key] != ""
|
|
1302
|
-
);
|
|
1303
|
-
});
|
|
1304
|
-
if (treeFiled) {
|
|
1305
|
-
that.$nextTick(() => {
|
|
1306
|
-
setTimeout(function () {
|
|
1307
|
-
let isLazy = $t.treeConfig.lazy;
|
|
1308
|
-
$t.treeConfig.lazy = false;
|
|
1309
|
-
$t.setAllTreeExpand(true).then(() => {
|
|
1310
|
-
let fullAllDataRowMap = $t.$refs.xTable.fullAllDataRowMap;
|
|
1311
|
-
let fullData = $t.getTableData().fullData;
|
|
1312
|
-
fullData.forEach((lineData) => {
|
|
1313
|
-
if (
|
|
1314
|
-
$t.$refs.xTable.isTreeExpandByRow(lineData)
|
|
1315
|
-
) {
|
|
1316
|
-
var rest = fullAllDataRowMap.get(lineData);
|
|
1317
|
-
rest.treeLoaded = true;
|
|
1318
|
-
}
|
|
1319
|
-
});
|
|
1320
|
-
$t.treeConfig.lazy = isLazy;
|
|
1321
|
-
});
|
|
1322
|
-
}, 0);
|
|
1323
|
-
});
|
|
1324
|
-
} else {
|
|
1325
|
-
let row = rows[0];
|
|
1326
|
-
if (row[result.treeConfig.hasChild]) {
|
|
1327
|
-
that.$nextTick(() => {
|
|
1328
|
-
setTimeout(function () {
|
|
1329
|
-
$t.setTreeExpand(row, true);
|
|
1330
|
-
}, 0);
|
|
1331
|
-
});
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
}*!/
|
|
1336
|
-
if (tableOption.callback) {
|
|
1337
|
-
that.$nextTick(() => {
|
|
1338
|
-
setTimeout(function () {
|
|
1339
|
-
tableOption.callback(rows);
|
|
1340
|
-
}, 0);
|
|
1341
|
-
});
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
},
|
|
1345
|
-
httpConfig: {
|
|
1346
|
-
error: (error) => {
|
|
1347
|
-
reject(error);
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
});*/
|
|
1351
|
-
});
|
|
1352
|
-
},
|
|
1353
|
-
},
|
|
1354
|
-
};
|
|
1355
|
-
tableOption.callback = (rows) => {
|
|
1356
|
-
// this.fieldModel = rows;
|
|
1357
|
-
this.formModel[this.fieldKeyName] = rows;
|
|
1358
|
-
};
|
|
1359
|
-
}
|
|
1360
|
-
this.vxeOption = tableOption;
|
|
1361
|
-
this.loadAccessData();
|
|
1362
|
-
|
|
1363
|
-
/*this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
|
|
1364
|
-
this.vxeOption = opts;
|
|
1365
|
-
/!*if (!isQueryTable) {
|
|
1366
|
-
this.$nextTick(() => {
|
|
1367
|
-
this.loadAccessData();
|
|
1368
|
-
});
|
|
1369
|
-
}*!/
|
|
1370
|
-
});
|
|
1371
|
-
if (!isQueryTable) {
|
|
1372
|
-
this.loadAccessData();
|
|
1373
|
-
}*/
|
|
1374
|
-
},
|
|
1375
|
-
getSearchFormData() {
|
|
1376
|
-
let map = {};
|
|
1377
|
-
let formData = this.globalModel.formModel;
|
|
1378
|
-
let widgetList = this.widget.widgetList;
|
|
1379
|
-
if (!!widgetList && widgetList.length > 0) {
|
|
1380
|
-
let loop = (wItem) => {
|
|
1381
|
-
if (wItem.category === "container") {
|
|
1382
|
-
loop(wItem);
|
|
1383
|
-
} else {
|
|
1384
|
-
let formField = this.getFieldKeyName(wItem);
|
|
1385
|
-
let vaule = formData[formField];
|
|
1386
|
-
if (vaule !== null && vaule !== undefined && vaule !== "") {
|
|
1387
|
-
map[formField] = vaule;
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
};
|
|
1391
|
-
widgetList.forEach((wItem) => {
|
|
1392
|
-
loop(wItem);
|
|
1393
|
-
});
|
|
1394
|
-
}
|
|
1395
|
-
return map;
|
|
1396
|
-
},
|
|
1397
|
-
loadTableData(param) {
|
|
1398
|
-
if (this.dataTableConfig?.queryFormDialog !== true) {
|
|
1399
|
-
this.checkItemIds = [];
|
|
1400
|
-
}
|
|
1401
|
-
param = param || {};
|
|
1402
|
-
let pageSize = param.size || this.pageSize;
|
|
1403
|
-
let currentPage = param.current || 1;
|
|
1404
|
-
let page = { pageSize, currentPage };
|
|
1405
|
-
return this.vxeOption.config.proxyConfig.ajax.query.call(this, {
|
|
1406
|
-
page,
|
|
1407
|
-
param,
|
|
1408
|
-
});
|
|
1409
|
-
},
|
|
1410
|
-
loadAccessData() {
|
|
1411
|
-
let isQueryTable = this.widget.options.isQueryTable || false;
|
|
1412
|
-
if (isQueryTable) {
|
|
1413
|
-
this.loadTableData({});
|
|
1414
|
-
return;
|
|
1415
|
-
}
|
|
1416
|
-
if (!isQueryTable && !this.formDataId) return;
|
|
1417
|
-
|
|
1418
|
-
let accessScript = this.widget.options.accessScript;
|
|
1419
|
-
let formCode = this.getFormRef().reportTemplate.formCode;
|
|
1420
|
-
if (accessScript) {
|
|
1421
|
-
let f = new Function(
|
|
1422
|
-
"dataId",
|
|
1423
|
-
"formCode",
|
|
1424
|
-
"param",
|
|
1425
|
-
"done",
|
|
1426
|
-
accessScript
|
|
1427
|
-
);
|
|
1428
|
-
let toDo = (res) => {
|
|
1429
|
-
let rows = res.objx ? res.objx.records || res.objx || [] : [];
|
|
1430
|
-
// this.fieldModel = rows;
|
|
1431
|
-
this.formModel[this.fieldKeyName] = rows;
|
|
1432
|
-
this.fieldModel = rows;
|
|
1433
|
-
};
|
|
1434
|
-
|
|
1435
|
-
f.call(this, this.formDataId, formCode, null, toDo);
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
/*this.scriptHttp({
|
|
1439
|
-
options: this.widget.options,
|
|
1440
|
-
params: {},
|
|
1441
|
-
success: (res) => {
|
|
1442
|
-
let rows = res.objx ? res.objx.records || res.objx || [] : [];
|
|
1443
|
-
this.fieldModel = rows;
|
|
1444
|
-
}
|
|
1445
|
-
});*/
|
|
1446
|
-
},
|
|
1447
|
-
getReqParam(item, dataId, billData) {
|
|
1448
|
-
let param = {};
|
|
1449
|
-
if (item.accessParam) {
|
|
1450
|
-
if (typeof item.accessParam === "string") {
|
|
1451
|
-
let n = new Function("billData", item.accessParam);
|
|
1452
|
-
param = n.call(this, billData);
|
|
1453
|
-
} else {
|
|
1454
|
-
param = item.accessParam;
|
|
1455
|
-
}
|
|
1456
|
-
} else {
|
|
1457
|
-
param = { id: dataId };
|
|
1458
|
-
}
|
|
1459
|
-
return param;
|
|
1460
|
-
},
|
|
1461
|
-
async deleteRow(row, rowIndex) {
|
|
1462
|
-
this.fieldModel.splice(rowIndex, 1);
|
|
1463
|
-
},
|
|
1464
|
-
createNewTableData() {
|
|
1465
|
-
let vailColumns = this.widget.options.tableColumns.filter(
|
|
1466
|
-
(item) => item.prop && item.label
|
|
1467
|
-
);
|
|
1468
|
-
let newData = {};
|
|
1469
|
-
vailColumns.forEach((item) => {
|
|
1470
|
-
if (item.formatS == "editSearch") {
|
|
1471
|
-
newData[item.prop] = null;
|
|
1472
|
-
let vabSearchName = item?.columnOption?.vabSearchName;
|
|
1473
|
-
if (vabSearchName) newData[vabSearchName] = null;
|
|
1474
|
-
} else {
|
|
1475
|
-
newData[item.prop] = null;
|
|
1476
|
-
}
|
|
1477
|
-
});
|
|
1478
|
-
return newData;
|
|
1479
|
-
},
|
|
1480
|
-
addTableData(rows, field) {
|
|
1481
|
-
let formDataModel = this.formModel;
|
|
1482
|
-
let tableRows = this.fieldModel;
|
|
1483
|
-
let fullData = this.fieldModel;
|
|
1484
|
-
let items;
|
|
1485
|
-
if (field) {
|
|
1486
|
-
let keys = fullData.map((item) => {
|
|
1487
|
-
return item[field] + "";
|
|
1488
|
-
});
|
|
1489
|
-
items = rows.filter((item) => {
|
|
1490
|
-
let value = item[field] + "";
|
|
1491
|
-
return !keys.includes(value);
|
|
1492
|
-
});
|
|
1493
|
-
} else {
|
|
1494
|
-
items = rows;
|
|
1495
|
-
}
|
|
1496
|
-
if (items) {
|
|
1497
|
-
if (items.length) {
|
|
1498
|
-
items.forEach((row) => {
|
|
1499
|
-
let newData = this.createNewTableData();
|
|
1500
|
-
Object.assign(newData, row);
|
|
1501
|
-
|
|
1502
|
-
tableRows.push(newData);
|
|
1503
|
-
});
|
|
1504
|
-
}
|
|
1505
|
-
} else {
|
|
1506
|
-
let newData = this.createNewTableData();
|
|
1507
|
-
tableRows.push(newData);
|
|
1508
|
-
}
|
|
1509
|
-
// this.formModel[this.fieldKeyName] = this.$baseLodash(this.fieldModel)
|
|
1510
|
-
// this.fieldModel = tableRows
|
|
1511
|
-
// $grid.loadData(tableRows);
|
|
1512
|
-
},
|
|
1513
|
-
getColumnWidgetConfig(row) {
|
|
1514
|
-
let formRef = this.getFormRef();
|
|
1515
|
-
let formatS = row.formatS;
|
|
1516
|
-
let columnSelectedWidget = null;
|
|
1517
|
-
let columnEditFields = null;
|
|
1518
|
-
|
|
1519
|
-
let type = this.columnFormatMap[row.formatS];
|
|
1520
|
-
|
|
1521
|
-
if (type) {
|
|
1522
|
-
columnSelectedWidget = this.$baseLodash.cloneDeep(
|
|
1523
|
-
formRef.getFieldWidgetByType(type)
|
|
1524
|
-
);
|
|
1525
|
-
let tmpId = generateId();
|
|
1526
|
-
let idVal = row.prop ? row.prop : type + tmpId;
|
|
1527
|
-
columnSelectedWidget.id = idVal;
|
|
1528
|
-
columnSelectedWidget.options.name = idVal;
|
|
1529
|
-
if (row.columnOption && Object.keys(row.columnOption).length) {
|
|
1530
|
-
row.columnOption.required = row.required || false;
|
|
1531
|
-
columnSelectedWidget.options = row.columnOption;
|
|
1532
|
-
} else {
|
|
1533
|
-
columnSelectedWidget.options.required = row.required || false;
|
|
1534
|
-
row.columnOption = columnSelectedWidget.options;
|
|
1535
|
-
}
|
|
1536
|
-
columnSelectedWidget.options.name = row.prop;
|
|
1537
|
-
columnSelectedWidget.options.label = row.label;
|
|
1538
|
-
columnSelectedWidget.options.labelHidden = true;
|
|
1539
|
-
}
|
|
1540
|
-
return { columnSelectedWidget, columnEditFields };
|
|
1541
|
-
},
|
|
1542
|
-
getColumnProp(widget, obj) {
|
|
1543
|
-
let isQueryTable = this.widget.options.isQueryTable || false;
|
|
1544
|
-
if (isQueryTable) {
|
|
1545
|
-
return "false";
|
|
1546
|
-
} else {
|
|
1547
|
-
let propName =
|
|
1548
|
-
this.getFieldKeyName(widget) +
|
|
1549
|
-
"." +
|
|
1550
|
-
obj.rowIndex +
|
|
1551
|
-
"." +
|
|
1552
|
-
obj.column.field;
|
|
1553
|
-
if (this.isVabsearchFlagWidget(widget)) {
|
|
1554
|
-
let vabSearchName = obj.column.params.widget.options.vabSearchName;
|
|
1555
|
-
propName =
|
|
1556
|
-
this.getFieldKeyName(widget) +
|
|
1557
|
-
"." +
|
|
1558
|
-
obj.rowIndex +
|
|
1559
|
-
"." +
|
|
1560
|
-
vabSearchName;
|
|
1561
|
-
}
|
|
1562
|
-
return propName;
|
|
1563
|
-
}
|
|
1564
|
-
},
|
|
1565
|
-
isVabsearchFlagWidget(widget) {
|
|
1566
|
-
let type = widget?.type;
|
|
1567
|
-
return (
|
|
1568
|
-
type === "vabsearch" ||
|
|
1569
|
-
type === "singerSearch" ||
|
|
1570
|
-
type === "multiSearch"
|
|
1571
|
-
);
|
|
1572
|
-
},
|
|
1573
|
-
getColumnWidgetName(e) {
|
|
1574
|
-
if (e && e.type) {
|
|
1575
|
-
return e.type + "-widget";
|
|
1576
|
-
}
|
|
1577
|
-
},
|
|
1578
|
-
getGridTable() {
|
|
1579
|
-
let $grid = this.$refs[this.getTableRef()];
|
|
1580
|
-
return $grid;
|
|
1581
|
-
},
|
|
1582
|
-
getTableRef() {
|
|
1583
|
-
let tableRef = this.widget.id;
|
|
1584
|
-
return tableRef;
|
|
1585
|
-
},
|
|
1586
|
-
getUrl() {
|
|
1587
|
-
let accessUrl = this.widget.options.accessUrl;
|
|
1588
|
-
return accessUrl || USER_PREFIX + `/form_ins/getFormInsData`;
|
|
1589
|
-
},
|
|
1590
|
-
openRowDetailDialog(row) {
|
|
1591
|
-
/*let isQueryTable = this.widget.options.isQueryTable || false;
|
|
1592
|
-
if(isQueryTable)return;*/
|
|
1593
|
-
this.editRow = row;
|
|
1594
|
-
this.showRowDetailDialog = true;
|
|
1595
|
-
},
|
|
1596
|
-
changePageNew({ type, currentPage, pageSize, $event }) {
|
|
1597
|
-
this.loadTableData({
|
|
1598
|
-
size: pageSize + "",
|
|
1599
|
-
current: currentPage + "",
|
|
1600
|
-
});
|
|
1601
|
-
},
|
|
1602
|
-
exportData(option) {
|
|
1603
|
-
let tableRef = this.getTableRef();
|
|
1604
|
-
let serverName = this.getFormRef().reportTemplate.serverName;
|
|
1605
|
-
option.prefix = option.prefix || serverName;
|
|
1606
|
-
this.$excelExport({ targetRef: tableRef, ...option });
|
|
1607
|
-
},
|
|
1608
|
-
itemCheck(row) {
|
|
1609
|
-
let dataTableConfig = this.dataTableConfig;
|
|
1610
|
-
if (dataTableConfig) {
|
|
1611
|
-
let checkItemIds = this.checkItemIds;
|
|
1612
|
-
let checked;
|
|
1613
|
-
if (checkItemIds.includes(row.id)) {
|
|
1614
|
-
checked = false;
|
|
1615
|
-
checkItemIds.splice(checkItemIds.indexOf(row.id), 1);
|
|
1616
|
-
} else {
|
|
1617
|
-
checked = true;
|
|
1618
|
-
checkItemIds.push(row.id);
|
|
1619
|
-
}
|
|
1620
|
-
let param = { row, checked };
|
|
1621
|
-
dataTableConfig.onCheckboxChange &&
|
|
1622
|
-
dataTableConfig.onCheckboxChange(param);
|
|
1623
|
-
}
|
|
1624
|
-
},
|
|
1625
|
-
},
|
|
1626
|
-
};
|
|
1627
|
-
</script>
|
|
1628
|
-
|
|
1629
|
-
<style lang="scss" scoped></style>
|