cloud-web-corejs 1.0.54-dev.645 → 1.0.54-dev.647

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.
@@ -1,78 +1,755 @@
1
1
  <template>
2
- <div>
3
- <div class="h5-box">
4
- <div>
5
- <!-- <div class="header-box"><i class="back el-icon-arrow-left"></i>杂发订单</div> -->
6
- <div class="search-H5box">
7
- <div class="txt">
8
- <el-input placeholder="订单编号" suffix-icon="el-icon-search" v-model="formData.sn"
9
- @keyup.enter.native="searchEvent">
10
- <el-button slot="append" @click="searchEvent"> 搜索</el-button>
11
- </el-input>
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>
12
181
  </div>
13
- <div class="icon-screen" @click="popStatus = true">
14
- <i class="iconfont icon-shaixuan1"></i>
15
- <span>高级筛选</span>
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>
16
298
  </div>
17
- </div>
18
- <div class="orderList-box" @scroll="handleScroll">
19
- <div class="item" v-for="(row,rowIndex) in page.records" :key="rowIndex" @click="openEditDialog(row.id)">
20
- <div class="info1">
21
- <div class="name">订单编号:{{ row.orderSn }}</div>
22
- <p>发货单号:{{ row.shippingSn }}</p>
23
- <p>外部订单号:{{ row.outTradeSn }}</p>
24
- <p>客户编码:{{ row.customerCode }}</p>
25
- <p>客户名称:{{ row.customerName }}</p>
26
- <p>机构:{{ row.saleOrgName }}</p>
27
- <p>业务员:{{ row.salesManName }}</p>
28
- <p>订单类型:{{ row.orderTypeVal }}</p>
29
- <h5-status-tag :value="row.status"></h5-status-tag>
30
- </div>
31
- <!-- <div class="btns">
32
- <el-button type="success" icon="iconfont icon-shenhe" class="btn">审核</el-button>
33
- <el-button type="primary" icon="el-icon-edit-outline" class="btn" @click="openEditDialog(row.orderId)">
34
- 编辑
35
- </el-button>
36
- </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>
37
360
  </div>
38
- </div>
39
- <div class="float-addBtn" @click="openEditDialog()"><i class="el-icon-plus"></i><span>新增</span></div>
40
- <h5SearchDialog v-if="popStatus" :visiable.sync="popStatus" @searchEvent="confirmSearchDialog"
41
- @resetEvent="resetSearchDialog">
42
- <el-form label-position="top">
43
- <el-form-item label="订单编号">
44
- <el-input v-model="formData.sn" class="txt" clearable/>
45
- </el-form-item>
46
- <el-form-item label="发货单号">
47
- <el-input v-model="formData.shippingSn" class="txt" clearable/>
48
- </el-form-item>
49
- <el-form-item label="订单状态">
50
- <el-select v-model="formData.statuses" class="txt" multiple clearable>
51
- <el-option :value="0" label="未审核"/>
52
- <el-option :value="1" label="审核中"/>
53
- <el-option :value="2" label="已审核"/>
54
- <el-option :value="3" label="已作废"/>
55
- </el-select>
56
- </el-form-item>
57
- </el-form>
58
- </h5SearchDialog>
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&#45;&#45;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>
59
393
  </div>
60
394
  </div>
61
- <!-- <editView v-if="showViewDialog && showEdit" visible-key="showEdit" :_dataId.sync="dataId" :copyId.sync="copyId"
62
- :parent-target="_self" @reload="$reloadHandle" @close="closeViewDialog"></editView>-->
63
- </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>
64
737
  </template>
65
738
 
66
739
  <script>
67
- import emitter from '../../../../components/xform/utils/emitter';
68
- import i18n from '../../../../components/xform/utils/i18n';
69
- import refMixin from '../../../../components/xform/form-render/refMixin';
70
- import containerItemMixin from './containerItemMixin';
71
- import FieldComponents from '../../../../components/xform/form-designer/form-widget/field-widget/index';
72
- import {assembleAxiosConfig, generateId, getReportGlobalMap} from "../../../../components/xform/utils/util";
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";
73
750
  import * as formatUtil from "../../../../components/xform/utils/format";
751
+ import { extendDeeply } from "../../../../utils/index.js";
74
752
  import render from "../../../../views/user/bill_setting/render.vue";
75
- import mixin from "../../../../mixins/mobile/list/index";
76
753
 
77
754
  const baseRefUtil = {
78
755
  emitter,
@@ -81,16 +758,17 @@ const baseRefUtil = {
81
758
  containerItemMixin,
82
759
  formatUtil,
83
760
  assembleAxiosConfig,
84
- getReportGlobalMap
761
+ getReportGlobalMap,
85
762
  };
86
763
 
764
+ const defaultPageSize = 2;
87
765
  export default {
88
- name: 'list-h5-item',
766
+ name: "list-h5-item",
89
767
  components: {
90
- ...FieldComponents
768
+ ...FieldComponents,
91
769
  },
92
- mixins: [emitter, i18n, refMixin, containerItemMixin,mixin],
93
- componentName: 'ContainerItem',
770
+ mixins: [emitter, i18n, refMixin, containerItemMixin],
771
+ componentName: "ContainerItem",
94
772
  props: {
95
773
  widget: Object,
96
774
  parentWidget: Object,
@@ -98,21 +776,27 @@ export default {
98
776
  indexOfParentList: Number,
99
777
  subFormRowIndex: {
100
778
  type: Number,
101
- default: -1
779
+ default: -1,
102
780
  },
103
781
  subFormColIndex: {
104
782
  type: Number,
105
- default: -1
783
+ default: -1,
106
784
  },
107
785
  subFormRowId: {
108
786
  type: String,
109
- default: ''
110
- }
787
+ default: "",
788
+ },
111
789
  },
112
- inject: ['refList', 'sfRefList', 'globalModel', 'getFormConfig', 'getGlobalDsv'],
790
+ inject: [
791
+ "refList",
792
+ "sfRefList",
793
+ "globalModel",
794
+ "getFormConfig",
795
+ "getGlobalDsv",
796
+ ],
113
797
  data: function () {
114
798
  let that = this;
115
- let pageSize = 2;
799
+ let pageSize = defaultPageSize;
116
800
  return {
117
801
  showAdvancedSearch: false,
118
802
  showRowDetailDialog: false,
@@ -124,20 +808,20 @@ export default {
124
808
  currentPage: this.widget.options.pagination.currentPage,
125
809
  total: this.widget.options.pagination.total,*/
126
810
  formData: {
127
- saleOrgName: '',
128
- loginAccount: '',
129
- mobile: '',
130
- enabled: 1
811
+ saleOrgName: "",
812
+ loginAccount: "",
813
+ mobile: "",
814
+ enabled: 1,
131
815
  },
132
- vxeOption: {columns: []},
816
+ vxeOption: { columns: [] },
133
817
  requestAccess: null,
134
818
  columnFormatMap: {
135
- editInput: 'input',
136
- editNumber: 'number',
137
- editDate: 'date',
138
- editSelect: 'select',
139
- editSearch: 'vabsearch',
140
- button: 'button'
819
+ editInput: "input",
820
+ editNumber: "number",
821
+ editDate: "date",
822
+ editSelect: "select",
823
+ editSearch: "vabsearch",
824
+ button: "button",
141
825
  },
142
826
  dataTableConfig: {},
143
827
  advancedFormData: {},
@@ -152,33 +836,33 @@ export default {
152
836
  keyword: null,
153
837
 
154
838
  checkItemIds: [],
155
-
156
- dataId: 0,
157
- showEdit: false,
158
- showViewDialog: false
159
839
  };
160
840
  },
161
841
  watch: {
162
842
  fieldModel(val) {
163
843
  this.formModel[this.fieldKeyName] = val || [];
164
- }
844
+ },
165
845
  },
166
846
  computed: {
167
847
  formConfig: function () {
168
848
  return this.getFormConfig();
169
849
  },
170
850
  paginationLayout: function () {
171
- return this.widget.options.smallPagination ? 'prev, pager, next' : 'total, sizes, prev, pager, next, jumper';
851
+ return this.widget.options.smallPagination
852
+ ? "prev, pager, next"
853
+ : "total, sizes, prev, pager, next, jumper";
172
854
  },
173
855
  customClass: function () {
174
- return this.widget.options.customClass || '';
856
+ return this.widget.options.customClass || "";
175
857
  },
176
858
  singleRowSelectFlag: function () {
177
859
  return !this.widget.options.showCheckBox;
178
860
  },
179
861
  buttonsColumnFixed: function () {
180
- return void 0 === this.widget.options.buttonsColumnFixed ? 'right' : !!this.widget.options
181
- .buttonsColumnFixed && this.widget.options.buttonsColumnFixed;
862
+ return void 0 === this.widget.options.buttonsColumnFixed
863
+ ? "right"
864
+ : !!this.widget.options.buttonsColumnFixed &&
865
+ this.widget.options.buttonsColumnFixed;
182
866
  },
183
867
  columns() {
184
868
  let tableColumns = this.widget.options.tableColumns;
@@ -190,23 +874,25 @@ export default {
190
874
  fixed: 'left'
191
875
  });*/
192
876
 
193
- let firstColumn = tableColumns.find(column => {
877
+ let firstColumn = tableColumns.find((column) => {
194
878
  return !!column.prop && !!column.showForRow;
195
879
  });
196
880
  let mainFiled = firstColumn?.prop;
197
881
 
198
882
  let formRef = this.getFormRef();
199
- let dateConfig = this.$baseLodash.cloneDeep(formRef.getFieldWidgetByType('date').options)
200
- tableColumns.forEach(t => {
883
+ let dateConfig = this.$baseLodash.cloneDeep(
884
+ formRef.getFieldWidgetByType("date").options
885
+ );
886
+ tableColumns.forEach((t) => {
201
887
  let columnOption;
202
888
  let widget;
203
889
  let columnWidgetConfig = this.getColumnWidgetConfig(t);
204
- let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
890
+ let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
205
891
  if (columnSelectedWidget) {
206
- widget = columnSelectedWidget
892
+ widget = columnSelectedWidget;
207
893
  columnOption = widget.options;
208
894
  } else {
209
- columnOption = {}
895
+ columnOption = {};
210
896
  }
211
897
 
212
898
  let col = {
@@ -215,7 +901,7 @@ export default {
215
901
  title: t.label,
216
902
  witdh: t.width,
217
903
  sortable: t.sortable,
218
- align: t.align ? t.align : 'center',
904
+ align: t.align ? t.align : "center",
219
905
  formatter: this.formatterValue,
220
906
  isMainFiled: mainFiled == t.prop,
221
907
  showForRow: t.showForRow,
@@ -224,25 +910,25 @@ export default {
224
910
  widget: widget,
225
911
  formatS: t.formatS,
226
912
  required: t.required || false,
227
- columnConfig: t
913
+ columnConfig: t,
228
914
  },
229
- visible: t.show
915
+ visible: t.show,
230
916
  };
231
917
 
232
- if (t.formatS == 'render') {
233
- let r = t.render ? new Function('params', 'h', t.render) : null;
918
+ if (t.formatS == "render") {
919
+ let r = t.render ? new Function("params", "h", t.render) : null;
234
920
  col.slots = {
235
921
  default: (params, h) => {
236
- return r ? r.call(this, params, h) : '';
237
- }
922
+ return r ? r.call(this, params, h) : "";
923
+ },
238
924
  };
239
925
  } else if (columnSelectedWidget) {
240
926
  col.slots = {
241
- default: 'widget'
927
+ default: "widget",
242
928
  };
243
- } else if (['editDelete', 'editButton'].includes(t.formatS)) {
929
+ } else if (["editDelete", "editButton"].includes(t.formatS)) {
244
930
  col.slots = {
245
- default: t.formatS
931
+ default: t.formatS,
246
932
  };
247
933
  }
248
934
 
@@ -268,15 +954,16 @@ export default {
268
954
  cache: !1,
269
955
  get: function () {
270
956
  return this.globalModel.formModel;
271
- }
957
+ },
272
958
  },
273
959
  formDataId() {
274
960
  let formRef = this.getFormRef();
275
961
  return formRef.dataId;
276
- }
962
+ },
277
963
  },
278
964
  created: function () {
279
- if (!this.formModel[this.fieldKeyName]) this.formModel[this.fieldKeyName] = [];
965
+ if (!this.formModel[this.fieldKeyName])
966
+ this.formModel[this.fieldKeyName] = [];
280
967
  this.initRefList();
281
968
  this.handleOnCreated();
282
969
  },
@@ -305,24 +992,24 @@ export default {
305
992
  confirmAdvancedSearchDialog() {
306
993
  let formModel = this.formModel;
307
994
  let advancedFormData = this.advancedFormData;
308
- this.vxeOption.searchColumns.forEach(form1Field => {
995
+ this.vxeOption.searchColumns.forEach((form1Field) => {
309
996
  let value = formModel[form1Field.field];
310
997
  if (value !== null && value !== undefined) {
311
- advancedFormData[form1Field.field] = value
998
+ advancedFormData[form1Field.field] = value;
312
999
  } else {
313
- advancedFormData[form1Field.field] = null
1000
+ advancedFormData[form1Field.field] = null;
314
1001
  }
315
1002
  });
316
1003
  this.searchEvent();
317
1004
  },
318
1005
  advancedClear() {
319
- this.vxeOption.searchColumns.forEach(form1Field => {
320
- let widgetRef = this.getWidgetRef(form1Field.widget.options.name)
1006
+ this.vxeOption.searchColumns.forEach((form1Field) => {
1007
+ let widgetRef = this.getWidgetRef(form1Field.widget.options.name);
321
1008
  if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
322
1009
  });
323
1010
  },
324
1011
  setValue(val) {
325
- let rows = val || []
1012
+ let rows = val || [];
326
1013
  this.formModel[this.fieldKeyName] = rows;
327
1014
  this.fieldModel = rows;
328
1015
  },
@@ -331,40 +1018,36 @@ export default {
331
1018
  },
332
1019
  getFieldKeyName(widget) {
333
1020
  let o = widget.options.name;
334
- return (
335
- (widget.options.keyNameEnabled
336
- && widget.options.keyName)
337
- || o
338
- );
1021
+ return (widget.options.keyNameEnabled && widget.options.keyName) || o;
339
1022
  },
340
- formatterValue: function ({cellValue, row, column}) {
1023
+ formatterValue: function ({ cellValue, row, column }) {
341
1024
  if (cellValue === null || cellValue === undefined) return cellValue;
342
1025
 
343
1026
  if (column.params && column.params.formatS)
344
1027
  switch (column.params.formatS) {
345
- case 'd1':
1028
+ case "d1":
346
1029
  return baseRefUtil.formatUtil.formatDate1(cellValue);
347
- case 'd2':
1030
+ case "d2":
348
1031
  return baseRefUtil.formatUtil.formatDate2(cellValue);
349
- case 'd3':
1032
+ case "d3":
350
1033
  return baseRefUtil.formatUtil.formatDate3(cellValue);
351
- case 'd4':
1034
+ case "d4":
352
1035
  return baseRefUtil.formatUtil.formatDate4(cellValue);
353
- case 'd5':
1036
+ case "d5":
354
1037
  return baseRefUtil.formatUtil.formatDate4(cellValue);
355
- case 'n1':
1038
+ case "n1":
356
1039
  return baseRefUtil.formatUtil.formatNumber1(cellValue);
357
- case 'n2':
1040
+ case "n2":
358
1041
  return baseRefUtil.formatUtil.formatNumber2(cellValue);
359
- case 'n3':
1042
+ case "n3":
360
1043
  return baseRefUtil.formatUtil.formatNumber3(cellValue);
361
- case 'n4':
1044
+ case "n4":
362
1045
  return baseRefUtil.formatUtil.formatNumber4(cellValue);
363
- case 'n5':
1046
+ case "n5":
364
1047
  return baseRefUtil.formatUtil.formatNumber5(cellValue);
365
- case 'n6':
1048
+ case "n6":
366
1049
  return baseRefUtil.formatUtil.formatNumber6(cellValue);
367
- case 'n7':
1050
+ case "n7":
368
1051
  return baseRefUtil.formatUtil.formatNumber7(cellValue);
369
1052
  }
370
1053
  return cellValue;
@@ -376,73 +1059,60 @@ export default {
376
1059
  async resetEvent() {
377
1060
  let formData = this.formModel;
378
1061
  this.keyword = null;
379
- this.widget.widgetList && this.widget.widgetList.forEach(subWidget => {
380
- let widgetRef = this.getWidgetRef(subWidget.options.name)
381
- let fieldKeyName = this.getFieldKeyName(subWidget);
382
- formData[fieldKeyName] = null;
383
- this.advancedFormData[fieldKeyName] = null;
384
- if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
385
- });
1062
+ this.widget.widgetList &&
1063
+ this.widget.widgetList.forEach((subWidget) => {
1064
+ let widgetRef = this.getWidgetRef(subWidget.options.name);
1065
+ let fieldKeyName = this.getFieldKeyName(subWidget);
1066
+ formData[fieldKeyName] = null;
1067
+ this.advancedFormData[fieldKeyName] = null;
1068
+ if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
1069
+ });
386
1070
  // this.getGridTable().commitProxy('reload');
387
1071
  this.loadAccessData();
388
1072
  },
389
1073
  openEditDialog(row) {
390
1074
  let formRef = this.getFormRef();
391
1075
  let parentTarget = formRef.$attrs["parent-target"];
392
- parentTarget && parentTarget.$attrs.openEditDialog && parentTarget.$attrs.openEditDialog(row);
1076
+ parentTarget &&
1077
+ parentTarget.$attrs.openEditDialog &&
1078
+ parentTarget.$attrs.openEditDialog(row);
393
1079
  },
394
1080
  initTableList() {
395
1081
  let that = this;
396
1082
  let path = null;
397
1083
  let paramFun = null;
398
- // let mainDataSetDTO = null;
399
- let requestAccess = this.requestAccess;
400
1084
  let tableRef = this.getTableRef();
401
- let formDataModel = this.getFormRef().formDataModel;
402
1085
  let isQueryTable = this.widget.options.isQueryTable || false;
403
- let isDataPage = this.widget.options.accessReturnType == "2";
404
- let formCode = this.getFormRef().reportTemplate.formCode;
405
- let dataId = this.formDataId;
406
- let accessScript = this.widget.options.accessScript;
1086
+ let isDataPage = this.widget.options.accessReturnType === "2";
1087
+ let isQueryAllPage = !this.widget.options.isNotQueryAllPage;
407
1088
  let searchColumns = null;
408
1089
  if (isQueryTable) {
409
- path = this.getUrl();
1090
+ path = "#";
410
1091
  paramFun = () => {
411
- // let conditions = this.getSearchCondition();
412
- let conditions = {keyword: this.keyword, ...this.advancedFormData};
1092
+ let conditions = this.getSearchCondition();
413
1093
  if (this.widget.options.showPagination) {
414
1094
  let searchCount = true;
415
- /*let isQueryAllPage = $grid.isQueryAllPage;
416
- if (isQueryAllPage == false) {
1095
+ if (isQueryAllPage === false) {
417
1096
  searchCount = false;
418
- }*/
419
- /*let pager = proxyInfo ? proxyInfo.pager : null;
420
- if (pager) {
421
- conditions.current = pager.currentPage;
422
- conditions.size = pager.pageSize;
423
- conditions.searchCount = searchCount;
424
- }*/
1097
+ }
1098
+ conditions.current = this.page.current;
1099
+ conditions.size = this.page.size;
1100
+ conditions.searchCount = searchCount;
425
1101
  }
426
-
427
- /*let formData = {
428
- accessCode: requestAccess.accessCode,
429
- conditions: conditions
430
- };*/
431
- let formData = conditions;
432
- return formData;
1102
+ return conditions;
433
1103
  };
434
1104
 
435
1105
  searchColumns = [];
436
1106
  let widgetList = this.widget.widgetList;
437
1107
  let typeMap = {
438
- "input": "input",
439
- "number": "number",
440
- "inputBatch": "inputBatch",
441
- "date": "date"
442
- }
1108
+ input: "input",
1109
+ number: "number",
1110
+ inputBatch: "inputBatch",
1111
+ date: "date",
1112
+ };
443
1113
 
444
- widgetList.forEach(widget => {
445
- if ('container' !== widget.category) {
1114
+ widgetList.forEach((widget) => {
1115
+ if ("container" !== widget.category) {
446
1116
  let options = widget.options;
447
1117
  let type = typeMap[widget.type] || null;
448
1118
  searchColumns.push({
@@ -454,14 +1124,14 @@ export default {
454
1124
  defaultValueEnabled: !!type,
455
1125
  slot: options.name,
456
1126
  widget: widget,
457
- formItem: false
1127
+ formItem: false,
458
1128
  });
459
1129
  }
460
1130
  });
461
1131
  }
462
1132
 
463
1133
  let formRef = this.getFormRef();
464
- let dataTableConfig = formRef.$attrs.dataTableOption || {}
1134
+ let dataTableConfig = formRef.$attrs.dataTableOption || {};
465
1135
  this.dataTableConfig = dataTableConfig;
466
1136
 
467
1137
  let tableOption = {
@@ -477,190 +1147,108 @@ export default {
477
1147
  /*pagerConfig: {
478
1148
  autoHidden: !this.widget.options.showPagination
479
1149
  },*/
480
- ...dataTableConfig.config
1150
+ ...dataTableConfig.config,
481
1151
  },
482
1152
  exportAjax: (param) => {
483
1153
  let $grid = this.getGridTable();
484
1154
  let pageSize = param.size;
485
1155
  let currentPage = param.current;
486
- let page = {pageSize, currentPage};
487
- return this.vxeOption.config.proxyConfig.ajax.query.call(this, {page, param})
488
- }
1156
+ let page = { pageSize, currentPage };
1157
+ return this.vxeOption.config.proxyConfig.ajax.query.call(this, {
1158
+ page,
1159
+ param,
1160
+ });
1161
+ },
489
1162
  };
490
1163
 
491
1164
  if (isQueryTable) {
492
1165
  tableOption.path = path;
493
1166
  tableOption.config.proxyConfig = {
494
1167
  props: {
495
- result: isDataPage ? 'objx.records' : 'objx', // 配置响应结果列表字段
496
- total: isDataPage ? 'objx.total' : 'objx.length' // 配置响应结果总页数字段
1168
+ result: isDataPage ? "objx.records" : "objx", // 配置响应结果列表字段
1169
+ total: isDataPage ? "objx.total" : "objx.length", // 配置响应结果总页数字段
497
1170
  },
498
1171
  ajax: {
499
1172
  // 接收 Promise 对象
500
- query: ({page, sorts, filters, form, param}) => {
501
- if (!path) {
502
- return;
503
- }
504
-
1173
+ query: ({ page, sorts, filters, form, param }) => {
1174
+ let scriptCode = this.getScriptCode();
505
1175
  let formData = tableOption.param ? tableOption.param() || {} : {};
506
1176
  const queryParams = Object.assign({}, formData);
507
1177
 
508
- // 处理排序条件
509
- if (sorts) {
510
- const firstSort = sorts[0];
511
- if (firstSort) {
512
- queryParams.sort = firstSort.property;
513
- queryParams.order = firstSort.order;
514
- }
515
- }
516
-
517
- // 处理筛选条件
518
1178
  if (filters) {
519
- filters.forEach(({property, values}) => {
1179
+ filters.forEach(({ property, values }) => {
520
1180
  queryParams[property] = values.join(",");
521
1181
  });
522
1182
  }
523
1183
 
524
1184
  if (page.pageSize !== undefined) {
525
- queryParams["size"] = `${page.pageSize}`;
526
- queryParams["current"] = `${page.currentPage}`;
1185
+ queryParams.size = page.pageSize;
1186
+ queryParams.current = page.currentPage;
527
1187
  }
528
1188
 
529
- /*let $grid = this.getGridTable();
530
- let isQueryAllPage = $grid.isQueryAllPage;
531
- let pathStr1 = "";
532
- if (isQueryAllPage === false) {
533
- queryParams.searchCount = false;
534
- }*/
535
- Object.assign(queryParams, param)
1189
+ queryParams.searchCount = isQueryAllPage !== false;
1190
+ Object.assign(queryParams, param);
536
1191
 
537
- var reqPath = typeof path == "function" ? path() : path;
1192
+ if (that.dataTableConfig.queryParam) {
1193
+ Object.assign(queryParams, that.dataTableConfig.queryParam);
1194
+ }
538
1195
 
539
1196
  return new Promise((resolve, reject) => {
540
1197
  let reqData = {
541
- formCode: formCode,
542
- ...queryParams
543
- }
544
- if (accessScript) {
545
- let index = 0;
546
- let toDo = () => {
547
- let f = new Function("dataId", "formCode", "param", "done", accessScript);
548
- let done = (res) => {
549
- resolve(res);
550
- if (res.type == "success") {
551
- let rows = res.objx ? res.objx.records || res.objx || [] : [];
552
- this.setValue(rows);
553
- if (res.objx && res.objx.records) {
554
- this.page = res.objx || {};
555
- }
556
- if (tableOption.callback) {
557
- that.$nextTick(() => {
558
- setTimeout(function () {
559
- tableOption.callback(rows);
560
- }, 0);
561
- });
562
- }
563
- } else {
564
- this.setValue([]);
1198
+ ...queryParams,
1199
+ };
1200
+ if (scriptCode) {
1201
+ let done = (res) => {
1202
+ resolve(res);
1203
+ if (res.type === "success") {
1204
+ let rows = res.objx
1205
+ ? res.objx.records || res.objx || []
1206
+ : [];
1207
+ this.setValue(rows);
1208
+ if (res.objx && res.objx.records !== undefined) {
1209
+ this.page = {
1210
+ current: res.objx.current ?? this.page.current,
1211
+ size: res.objx.size ?? this.page.size,
1212
+ total: res.objx.total ?? 0,
1213
+ records: rows,
1214
+ };
565
1215
  }
566
- }
567
- let r = f.call(that, dataId, formCode, reqData, done);
568
- if (r) {
569
- r.catch(error => {
570
- reject(error);
1216
+ that.$nextTick(() => {
1217
+ setTimeout(function () {
1218
+ dataTableConfig.callback &&
1219
+ dataTableConfig.callback(rows);
1220
+ tableOption.callback && tableOption.callback(rows);
1221
+ that.handleCustomEvent(
1222
+ that.widget.options.formScriptCallback,
1223
+ ["rows"],
1224
+ [rows]
1225
+ );
1226
+ }, 0);
571
1227
  });
1228
+ } else {
1229
+ this.page = {
1230
+ current: 1,
1231
+ size: this.pageSize,
1232
+ total: 0,
1233
+ records: [],
1234
+ };
1235
+ this.setValue([]);
572
1236
  }
573
1237
  };
574
- let loopHandle = () => {
575
- /*if (index < 500 && $grid.tableFormStop === true) {
576
- //阻塞列表查询,或者次数达到500时,自动释放
577
- index++
578
- setTimeout(() => {
579
- loopHandle();
580
- }, 10)
581
- } else {
582
- if ($grid.tableFormStop) $grid.tableFormStop = false;
583
- toDo();
584
- }*/
585
- toDo();
586
- }
587
- loopHandle();
1238
+ this.loadDefaultQueryList(reqData, done).catch((error) => {
1239
+ reject(error);
1240
+ });
588
1241
  } else {
589
1242
  resolve();
590
1243
  }
591
- /*that.scriptHttp({
592
- options: this.widget.options,
593
- params: queryParams,
594
- callback: (res) => {
595
- resolve(res);
596
- if (res.type == "success") {
597
- let rows = res.objx ? res.objx.records || res.objx || [] : [];
598
- /!*if (tableOption.treeNodeUrl) {
599
- if (rows.length > 0) {
600
- let $t = this.$refs[tableRef];
601
- var treeConditions = $t.originOption.treeConditions || [
602
- "enabled",
603
- ];
604
- let treeFiled = Object.keys(formData).some((key) => {
605
- return (
606
- !treeConditions.includes(key) && formData[key] != null && formData[key] != ""
607
- );
608
- });
609
- if (treeFiled) {
610
- that.$nextTick(() => {
611
- setTimeout(function () {
612
- let isLazy = $t.treeConfig.lazy;
613
- $t.treeConfig.lazy = false;
614
- $t.setAllTreeExpand(true).then(() => {
615
- let fullAllDataRowMap = $t.$refs.xTable.fullAllDataRowMap;
616
- let fullData = $t.getTableData().fullData;
617
- fullData.forEach((lineData) => {
618
- if (
619
- $t.$refs.xTable.isTreeExpandByRow(lineData)
620
- ) {
621
- var rest = fullAllDataRowMap.get(lineData);
622
- rest.treeLoaded = true;
623
- }
624
- });
625
- $t.treeConfig.lazy = isLazy;
626
- });
627
- }, 0);
628
- });
629
- } else {
630
- let row = rows[0];
631
- if (row[result.treeConfig.hasChild]) {
632
- that.$nextTick(() => {
633
- setTimeout(function () {
634
- $t.setTreeExpand(row, true);
635
- }, 0);
636
- });
637
- }
638
- }
639
- }
640
- }*!/
641
- if (tableOption.callback) {
642
- that.$nextTick(() => {
643
- setTimeout(function () {
644
- tableOption.callback(rows);
645
- }, 0);
646
- });
647
- }
648
- }
649
- },
650
- httpConfig: {
651
- error: (error) => {
652
- reject(error);
653
- }
654
- }
655
- });*/
656
1244
  });
657
- }
658
- }
1245
+ },
1246
+ },
659
1247
  };
660
1248
  tableOption.callback = (rows) => {
661
1249
  // this.fieldModel = rows;
662
- this.formModel[this.fieldKeyName] = rows
663
- }
1250
+ this.formModel[this.fieldKeyName] = rows;
1251
+ };
664
1252
  }
665
1253
  this.vxeOption = tableOption;
666
1254
  this.loadAccessData();
@@ -677,23 +1265,66 @@ export default {
677
1265
  this.loadAccessData();
678
1266
  }*/
679
1267
  },
1268
+ getTableCondition() {
1269
+ if (this.widget.options.tableCondition) {
1270
+ let e = new Function(this.widget.options.tableCondition);
1271
+ return e.call(this);
1272
+ }
1273
+ },
1274
+ getSearchCondition() {
1275
+ // let extraAccessData = this.extraAccessData || {};
1276
+ let searchFormData = this.getSearchFormData();
1277
+ let conditions = {
1278
+ // ...this.getTableCondition(),
1279
+ ...searchFormData,
1280
+ // ...this.advancedFormData,
1281
+ // ...extraAccessData,
1282
+ };
1283
+ if (this.keyword) {
1284
+ conditions.keyword = this.keyword;
1285
+ }
1286
+ return conditions;
1287
+ },
680
1288
  getSearchFormData() {
681
- let map = {};
1289
+ let map = { condition: [] };
682
1290
  let formData = this.globalModel.formModel;
683
1291
  let widgetList = this.widget.widgetList;
684
1292
  if (!!widgetList && widgetList.length > 0) {
685
1293
  let loop = (wItem) => {
686
- if (wItem.category === 'container') {
1294
+ if (wItem.category === "container") {
687
1295
  loop(wItem);
688
1296
  } else {
689
1297
  let formField = this.getFieldKeyName(wItem);
690
1298
  let vaule = formData[formField];
691
- if (vaule !== null && vaule !== undefined && vaule !== '') {
692
- map[formField] = vaule;
1299
+ if (vaule !== null && vaule !== undefined && vaule !== "") {
1300
+ if (!Array.isArray(vaule) || vaule.length > 0) {
1301
+ let item = {
1302
+ value: vaule,
1303
+ field: formField,
1304
+ filter: null,
1305
+ };
1306
+ let wType = wItem.type;
1307
+ if (["date-range", "time-range"].includes(wType)) {
1308
+ item.filter = "between";
1309
+ } else if (
1310
+ ["input-batch", "checkbox"].includes(wType) ||
1311
+ (wType === "select" && wItem.options.multiple)
1312
+ ) {
1313
+ item.filter = "in";
1314
+ } else if (
1315
+ ["radio", "time", "date"].includes(wType) ||
1316
+ (wType === "select" && !wItem.options.multiple)
1317
+ ) {
1318
+ item.filter = "eq";
1319
+ } else {
1320
+ item.filter = "like";
1321
+ }
1322
+ map.condition.push(item);
1323
+ }
693
1324
  }
694
1325
  }
695
1326
  };
696
- widgetList.forEach(wItem => {
1327
+ widgetList.forEach((wItem) => {
697
1328
  loop(wItem);
698
1329
  });
699
1330
  }
@@ -706,51 +1337,131 @@ export default {
706
1337
  param = param || {};
707
1338
  let pageSize = param.size || this.pageSize;
708
1339
  let currentPage = param.current || 1;
709
- let page = {pageSize, currentPage};
710
- return this.vxeOption.config.proxyConfig.ajax.query.call(this, {page, param})
1340
+ let page = { pageSize, currentPage };
1341
+ return this.vxeOption.config.proxyConfig.ajax.query.call(this, {
1342
+ page,
1343
+ param,
1344
+ });
711
1345
  },
712
1346
  loadAccessData() {
713
1347
  let isQueryTable = this.widget.options.isQueryTable || false;
714
1348
  if (isQueryTable) {
715
- this.loadTableData({})
1349
+ this.loadTableData({});
716
1350
  return;
717
1351
  }
718
1352
  if (!isQueryTable && !this.formDataId) return;
719
1353
 
720
- let accessScript = this.widget.options.accessScript;
721
- let formCode = this.getFormRef().reportTemplate.formCode;
722
- if (accessScript) {
723
- let f = new Function("dataId", "formCode", "param", "done", accessScript);
724
- let toDo = (res) => {
725
- let rows = res.objx ? res.objx.records || res.objx || [] : [];
726
- // this.fieldModel = rows;
727
- this.formModel[this.fieldKeyName] = rows
728
- this.fieldModel = rows;
1354
+ let scriptCode = this.getScriptCode();
1355
+ if (scriptCode) {
1356
+ this.loadDefaultViewList();
1357
+ }
1358
+ },
1359
+ getAccessParam() {
1360
+ if (!this.widget.options.formScriptParam) return;
1361
+ return this.handleCustomEvent(this.widget.options.formScriptParam);
1362
+ },
1363
+ getScriptCode() {
1364
+ let accessReturnType = this.widget.options.accessReturnType;
1365
+ let defaultScriptCode = "getList";
1366
+ if (accessReturnType === "1") {
1367
+ defaultScriptCode = "getList";
1368
+ } else if (accessReturnType === "2") {
1369
+ defaultScriptCode = "getPage";
1370
+ }
1371
+ return this.widget.options.formScriptCode || defaultScriptCode;
1372
+ },
1373
+ getAttachmentType() {
1374
+ let result = [];
1375
+ let tableColumns = this.widget.options.tableColumns || [];
1376
+ tableColumns.forEach((item) => {
1377
+ if (item.prop && item.label && item.formatS === "editAttachment") {
1378
+ result.push(item.prop);
729
1379
  }
730
-
731
- f.call(this, this.formDataId, formCode, null, toDo)
1380
+ });
1381
+ return result;
1382
+ },
1383
+ getHttpConfigForUser() {
1384
+ return {
1385
+ addCreateInfo: true,
1386
+ queryCreateInfo: window.$vueRoot.$store.getters.queryCreateInfo || "0",
1387
+ };
1388
+ },
1389
+ loadDefaultQueryList(reqData, done) {
1390
+ let reportTemplate = this.getFormRef().reportTemplate;
1391
+ let formCode = reportTemplate.formCode;
1392
+ let scriptCode = this.getScriptCode();
1393
+ let accessParam = this.getAccessParam() || {};
1394
+ let otherParam = {};
1395
+ let attachmentType = this.getAttachmentType();
1396
+ if (attachmentType.length) {
1397
+ otherParam.attachmentType = attachmentType;
732
1398
  }
733
-
734
- /*this.scriptHttp({
735
- options: this.widget.options,
736
- params: {},
737
- success: (res) => {
1399
+ let defaultOption = this.getHttpConfigForUser();
1400
+ let requestData = {
1401
+ ...reqData,
1402
+ ...otherParam,
1403
+ };
1404
+ requestData = extendDeeply(requestData, accessParam);
1405
+ return this.formHttp({
1406
+ scriptCode: scriptCode,
1407
+ data: {
1408
+ formCode: formCode,
1409
+ formVersion: reportTemplate.formVersion,
1410
+ taBm: this.fieldKeyName,
1411
+ data: requestData,
1412
+ },
1413
+ isLoading: false,
1414
+ ...defaultOption,
1415
+ callback: (res) => {
1416
+ done(res);
1417
+ },
1418
+ });
1419
+ },
1420
+ loadDefaultViewList() {
1421
+ let dataId = this.formDataId;
1422
+ let reportTemplate = this.getFormRef().reportTemplate;
1423
+ let formCode = reportTemplate.formCode;
1424
+ let accessParam = this.getAccessParam() || {};
1425
+ let otherParam = {};
1426
+ let attachmentType = this.getAttachmentType();
1427
+ if (attachmentType.length) {
1428
+ otherParam.attachmentType = attachmentType;
1429
+ }
1430
+ let scriptCode = this.getScriptCode();
1431
+ return this.formHttp({
1432
+ scriptCode: scriptCode,
1433
+ data: {
1434
+ formCode: formCode,
1435
+ formVersion: reportTemplate.formVersion,
1436
+ taBm: this.fieldKeyName,
1437
+ data: {
1438
+ id: dataId,
1439
+ ...otherParam,
1440
+ ...accessParam,
1441
+ },
1442
+ },
1443
+ callback: (res) => {
738
1444
  let rows = res.objx ? res.objx.records || res.objx || [] : [];
739
- this.fieldModel = rows;
740
- }
741
- });*/
1445
+ this.setValue(rows);
1446
+ this.handleCustomEvent(
1447
+ this.widget.options.formScriptCallback,
1448
+ ["rows"],
1449
+ [rows]
1450
+ );
1451
+ },
1452
+ });
742
1453
  },
743
1454
  getReqParam(item, dataId, billData) {
744
1455
  let param = {};
745
1456
  if (item.accessParam) {
746
1457
  if (typeof item.accessParam === "string") {
747
- let n = new Function('billData', item.accessParam);
1458
+ let n = new Function("billData", item.accessParam);
748
1459
  param = n.call(this, billData);
749
1460
  } else {
750
- param = item.accessParam
1461
+ param = item.accessParam;
751
1462
  }
752
1463
  } else {
753
- param = {id: dataId}
1464
+ param = { id: dataId };
754
1465
  }
755
1466
  return param;
756
1467
  },
@@ -758,10 +1469,12 @@ export default {
758
1469
  this.fieldModel.splice(rowIndex, 1);
759
1470
  },
760
1471
  createNewTableData() {
761
- let vailColumns = this.widget.options.tableColumns.filter(item => item.prop && item.label);
1472
+ let vailColumns = this.widget.options.tableColumns.filter(
1473
+ (item) => item.prop && item.label
1474
+ );
762
1475
  let newData = {};
763
- vailColumns.forEach(item => {
764
- if (item.formatS == 'editSearch') {
1476
+ vailColumns.forEach((item) => {
1477
+ if (item.formatS == "editSearch") {
765
1478
  newData[item.prop] = null;
766
1479
  let vabSearchName = item?.columnOption?.vabSearchName;
767
1480
  if (vabSearchName) newData[vabSearchName] = null;
@@ -777,11 +1490,11 @@ export default {
777
1490
  let fullData = this.fieldModel;
778
1491
  let items;
779
1492
  if (field) {
780
- let keys = fullData.map(item => {
1493
+ let keys = fullData.map((item) => {
781
1494
  return item[field] + "";
782
1495
  });
783
- items = rows.filter(item => {
784
- let value = item[field] + ""
1496
+ items = rows.filter((item) => {
1497
+ let value = item[field] + "";
785
1498
  return !keys.includes(value);
786
1499
  });
787
1500
  } else {
@@ -789,12 +1502,12 @@ export default {
789
1502
  }
790
1503
  if (items) {
791
1504
  if (items.length) {
792
- items.forEach(row => {
1505
+ items.forEach((row) => {
793
1506
  let newData = this.createNewTableData();
794
1507
  Object.assign(newData, row);
795
1508
 
796
1509
  tableRows.push(newData);
797
- })
1510
+ });
798
1511
  }
799
1512
  } else {
800
1513
  let newData = this.createNewTableData();
@@ -806,16 +1519,18 @@ export default {
806
1519
  },
807
1520
  getColumnWidgetConfig(row) {
808
1521
  let formRef = this.getFormRef();
809
- let formatS = row.formatS
1522
+ let formatS = row.formatS;
810
1523
  let columnSelectedWidget = null;
811
1524
  let columnEditFields = null;
812
1525
 
813
1526
  let type = this.columnFormatMap[row.formatS];
814
1527
 
815
1528
  if (type) {
816
- columnSelectedWidget = this.$baseLodash.cloneDeep(formRef.getFieldWidgetByType(type));
1529
+ columnSelectedWidget = this.$baseLodash.cloneDeep(
1530
+ formRef.getFieldWidgetByType(type)
1531
+ );
817
1532
  let tmpId = generateId();
818
- let idVal = row.prop ? row.prop : (type + tmpId);
1533
+ let idVal = row.prop ? row.prop : type + tmpId;
819
1534
  columnSelectedWidget.id = idVal;
820
1535
  columnSelectedWidget.options.name = idVal;
821
1536
  if (row.columnOption && Object.keys(row.columnOption).length) {
@@ -829,24 +1544,42 @@ export default {
829
1544
  columnSelectedWidget.options.label = row.label;
830
1545
  columnSelectedWidget.options.labelHidden = true;
831
1546
  }
832
- return {columnSelectedWidget, columnEditFields};
1547
+ return { columnSelectedWidget, columnEditFields };
833
1548
  },
834
1549
  getColumnProp(widget, obj) {
835
1550
  let isQueryTable = this.widget.options.isQueryTable || false;
836
1551
  if (isQueryTable) {
837
1552
  return "false";
838
1553
  } else {
839
- let propName = this.getFieldKeyName(widget) + '.' + obj.rowIndex + '.' + obj.column.field
1554
+ let propName =
1555
+ this.getFieldKeyName(widget) +
1556
+ "." +
1557
+ obj.rowIndex +
1558
+ "." +
1559
+ obj.column.field;
840
1560
  if (this.isVabsearchFlagWidget(widget)) {
841
1561
  let vabSearchName = obj.column.params.widget.options.vabSearchName;
842
- propName = this.getFieldKeyName(widget) + '.' + obj.rowIndex + '.' + vabSearchName;
1562
+ propName =
1563
+ this.getFieldKeyName(widget) +
1564
+ "." +
1565
+ obj.rowIndex +
1566
+ "." +
1567
+ vabSearchName;
843
1568
  }
844
1569
  return propName;
845
1570
  }
846
1571
  },
1572
+ isVabsearchFlagWidget(widget) {
1573
+ let type = widget?.type;
1574
+ return (
1575
+ type === "vabsearch" ||
1576
+ type === "singerSearch" ||
1577
+ type === "multiSearch"
1578
+ );
1579
+ },
847
1580
  getColumnWidgetName(e) {
848
1581
  if (e && e.type) {
849
- return e.type + '-widget';
1582
+ return e.type + "-widget";
850
1583
  }
851
1584
  },
852
1585
  getGridTable() {
@@ -858,8 +1591,8 @@ export default {
858
1591
  return tableRef;
859
1592
  },
860
1593
  getUrl() {
861
- let accessUrl = this.widget.options.accessUrl
862
- return accessUrl || (USER_PREFIX + `/form_ins/getFormInsData`);
1594
+ let accessUrl = this.widget.options.accessUrl;
1595
+ return accessUrl || USER_PREFIX + `/form_ins/getFormInsData`;
863
1596
  },
864
1597
  openRowDetailDialog(row) {
865
1598
  /*let isQueryTable = this.widget.options.isQueryTable || false;
@@ -867,17 +1600,17 @@ export default {
867
1600
  this.editRow = row;
868
1601
  this.showRowDetailDialog = true;
869
1602
  },
870
- changePageNew({type, currentPage, pageSize, $event}) {
1603
+ changePageNew({ type, currentPage, pageSize, $event }) {
871
1604
  this.loadTableData({
872
1605
  size: pageSize + "",
873
- current: currentPage + ""
874
- })
1606
+ current: currentPage + "",
1607
+ });
875
1608
  },
876
1609
  exportData(option) {
877
1610
  let tableRef = this.getTableRef();
878
1611
  let serverName = this.getFormRef().reportTemplate.serverName;
879
1612
  option.prefix = option.prefix || serverName;
880
- this.$excelExport({targetRef: tableRef, ...option})
1613
+ this.$excelExport({ targetRef: tableRef, ...option });
881
1614
  },
882
1615
  itemCheck(row) {
883
1616
  let dataTableConfig = this.dataTableConfig;
@@ -889,25 +1622,15 @@ export default {
889
1622
  checkItemIds.splice(checkItemIds.indexOf(row.id), 1);
890
1623
  } else {
891
1624
  checked = true;
892
- checkItemIds.push(row.id)
1625
+ checkItemIds.push(row.id);
893
1626
  }
894
- let param = {row, checked};
895
- dataTableConfig.onCheckboxChange && dataTableConfig.onCheckboxChange(param);
1627
+ let param = { row, checked };
1628
+ dataTableConfig.onCheckboxChange &&
1629
+ dataTableConfig.onCheckboxChange(param);
896
1630
  }
897
-
898
- }
899
- }
1631
+ },
1632
+ },
900
1633
  };
901
1634
  </script>
902
- <style lang="scss" scoped>
903
- @import "~@/resources/css/h5.scss";
904
-
905
- .orderList-box {
906
- flex: 1;
907
- overflow-y: auto;
908
- }
909
-
910
- .search-H5box {
911
- margin: 0 0 9px;
912
- }
913
- </style>
1635
+
1636
+ <style lang="scss" scoped></style>