@leevan/jtui 2.0.43 → 2.0.45

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.
@@ -12,6 +12,9 @@ Vue.component(FilterContent.name, FilterContent)
12
12
  Vue.component(FilterComplex.name, FilterComplex)
13
13
  Vue.component(FilterExcel.name, FilterExcel)
14
14
 
15
+ import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx';
16
+ VXETable.use(VXETablePluginExportXLSX);
17
+
15
18
  // 创建一个简单的输入框筛选
16
19
  VXETable.renderer.add('FilterInput', {
17
20
  // 不显示底部按钮,使用自定义的按钮
@@ -4,26 +4,34 @@
4
4
  :class="isWrap ? 'isWrap' : ''"
5
5
  style="position: absolute; top: 1px; left: 1px; right: 1px; bottom: 1px"
6
6
  >
7
- <!-- 普通表格 -->
7
+
8
8
  <div style="position: relative" v-if="isTool">
9
9
  <vxe-toolbar
10
10
  class="jt-toolbar"
11
- custom
12
- :custom-options="{ icon: 'jtIcon iconpeizhi41 colStyle' }"
11
+ :custom="{ icon: 'jtIcon iconpeizhi41 colStyle' }"
13
12
  ></vxe-toolbar>
14
13
  </div>
14
+ <div style="width:100%;height:100%;position: relative;">
15
+ <div class="cus-empty-box" v-if="isShowEmpty">
16
+ <el-empty :image-size="200">
17
+ <template #description>
18
+ <p style="font-size:30px">暂无数据</p>
19
+ </template>
20
+ </el-empty>
21
+ </div>
22
+ <!-- 普通表格 -->
15
23
  <vxe-table
16
24
  class="jt-table-class-only"
17
25
  height="auto"
18
26
  size="mini"
19
- show-overflow="title"
20
- show-header-overflow="title"
27
+ show-overflow
28
+ show-header-overflow
21
29
  auto-resize
22
- :row-config="{ isCurrent: true, isHover: true, useKey: true}"
23
- :current-row-config="{isFollowSelected: true}"
24
- :column-config="{ isCurrent: true, useKey: true}"
25
- :current-column-config="{ isFollowSelected: true }"
30
+ resizable
31
+ highlight-current-row
32
+ highlight-current-column
26
33
  keep-source
34
+ empty-text=" "
27
35
  v-if="tableType === 'default'"
28
36
  :id="id"
29
37
  :ref="id"
@@ -54,7 +62,7 @@
54
62
  trigger: 'dblclick',
55
63
  mode: 'cell',
56
64
  showStatus: true,
57
- beforeEditMethod: activeCellMethod,
65
+ activeMethod: activeCellMethod,
58
66
  }"
59
67
  :expand-config="{
60
68
  visibleMethod,
@@ -130,8 +138,7 @@
130
138
  :align="handlerConfig.align"
131
139
  :width="handlerConfig.width"
132
140
  :fixed="handlerConfig.fixed"
133
- show-overflow="title"
134
- field="handler"
141
+ show-overflow
135
142
  >
136
143
  <template v-slot="{ row, rowIndex }">
137
144
  <el-dropdown v-if="handlerConfig.btnGroup">
@@ -193,27 +200,20 @@
193
200
  </template>
194
201
  </template>
195
202
  </vxe-table-column>
196
- <template #empty>
197
- <el-empty :image-size="200">
198
- <template #description>
199
- <p style="font-size:30px">暂无数据</p>
200
- </template>
201
- </el-empty>
202
- </template>
203
- </vxe-table>
203
+ </vxe-table>
204
204
  <!-- 大数据 -->
205
205
  <vxe-table
206
206
  class="jt-table-class-only"
207
207
  height="auto"
208
208
  size="mini"
209
- show-overflow="title"
210
- show-header-overflow="title"
209
+ show-overflow
210
+ show-header-overflow
211
211
  auto-resize
212
- :row-config="{ isCurrent: true, isHover: true, useKey: true}"
213
- :current-row-config="{isFollowSelected: true}"
214
- :column-config="{ isCurrent: true, useKey: true}"
215
- :current-column-config="{ isFollowSelected: true }"
212
+ resizable
213
+ highlight-current-row
214
+ highlight-current-column
216
215
  keep-source
216
+ empty-text=" "
217
217
  v-if="tableType === 'bigData'"
218
218
  :header-cell-class-name="headerClass"
219
219
  :id="id"
@@ -241,7 +241,7 @@
241
241
  trigger: 'dblclick',
242
242
  mode: 'cell',
243
243
  showStatus: true,
244
- beforeEditMethod: activeCellMethod,
244
+ activeMethod: activeCellMethod,
245
245
  }"
246
246
  @scroll="scroll"
247
247
  @checkbox-change="selectChangeEvent"
@@ -307,8 +307,7 @@
307
307
  :align="handlerConfig.align"
308
308
  :width="handlerConfig.width"
309
309
  :fixed="handlerConfig.fixed"
310
- show-overflow="title"
311
- field="handler"
310
+ show-overflow
312
311
  >
313
312
  <template v-slot="{ row, rowIndex }">
314
313
  <el-dropdown v-if="handlerConfig.btnGroup">
@@ -370,13 +369,6 @@
370
369
  </template>
371
370
  </template>
372
371
  </vxe-table-column>
373
- <template #empty>
374
- <el-empty :image-size="200">
375
- <template #description>
376
- <p style="font-size:30px">暂无数据</p>
377
- </template>
378
- </el-empty>
379
- </template>
380
372
  </vxe-table>
381
373
  <!-- 分组表格 -->
382
374
  <vxe-table
@@ -384,22 +376,22 @@
384
376
  class="jt-table-class-only"
385
377
  :id="id"
386
378
  :ref="id"
379
+ empty-text=" "
387
380
  v-if="tableType === 'group'"
388
381
  :custom-config="{ storage: true, checkMethod: checkColumnMethod }"
389
382
  :border="border"
390
- show-overflow="title"
391
- show-header-overflow="title"
383
+ show-overflow
384
+ show-header-overflow
392
385
  height="auto"
393
386
  :max-height="maxHeight"
394
387
  auto-resize
395
- :row-config="{ isCurrent: true, isHover: true, useKey: true}"
396
- :current-row-config="{isFollowSelected: true}"
397
- :column-config="{ isCurrent: true, useKey: true}"
398
- :current-column-config="{ isFollowSelected: true }"
388
+ resizable
389
+ highlight-current-row
399
390
  :tree-config="groupConfig"
400
391
  :row-class-name="rowClassName"
401
392
  :cell-class-name="gcellClassName"
402
393
  :keyboard-config="{ isArrow: true }"
394
+ highlight-current-column
403
395
  @checkbox-change="treeSelectChangeEvent"
404
396
  :checkbox-config="{
405
397
  highlight: true,
@@ -429,7 +421,7 @@
429
421
  <template v-for="(item, index) in data.retjson.header">
430
422
  <vxe-table-column
431
423
  :key="index"
432
- show-overflow="title"
424
+ show-overflow
433
425
  :tree-node="item.prop == treeField"
434
426
  :field="item.prop"
435
427
  :align="item.align"
@@ -448,8 +440,7 @@
448
440
  :align="handlerConfig.align"
449
441
  :width="handlerConfig.width"
450
442
  :fixed="handlerConfig.fixed"
451
- show-overflow="title"
452
- field="handler"
443
+ show-overflow
453
444
  >
454
445
  <template v-slot="{ row, rowIndex }">
455
446
  <el-dropdown v-if="handlerConfig.btnGroup">
@@ -519,13 +510,6 @@
519
510
  </template>
520
511
  </template>
521
512
  </vxe-table-column>
522
- <template #empty>
523
- <el-empty :image-size="200">
524
- <template #description>
525
- <p style="font-size:30px">暂无数据</p>
526
- </template>
527
- </el-empty>
528
- </template>
529
513
  </vxe-table>
530
514
  <!-- 树形表格 and 树 -->
531
515
  <vxe-table
@@ -535,20 +519,19 @@
535
519
  :ref="id"
536
520
  :stripe="stripe"
537
521
  :show-header="treeTypeConfig.type == 'treeTable'"
522
+ empty-text=" "
538
523
  v-if="tableType === 'tree'"
539
524
  :max-height="maxHeight"
540
525
  :border="border"
541
- show-overflow="title"
542
- show-header-overflow="title"
526
+ show-overflow
527
+ show-header-overflow
543
528
  height="auto"
544
529
  auto-resize
545
530
  :cell-style="cellStyle_m"
546
531
  :row-style="rowStyle"
547
532
  :span-method="spanMethod"
548
- :row-config="{ isCurrent: true, isHover: true, useKey: true}"
549
- :current-row-config="{isFollowSelected: true}"
550
- :column-config="{ isCurrent: true, useKey: true}"
551
- :current-column-config="{ isFollowSelected: true }"
533
+ resizable
534
+ highlight-current-row
552
535
  :tree-config="treeConfig"
553
536
  :row-key="true"
554
537
  row-id="pkid"
@@ -570,7 +553,7 @@
570
553
  trigger: 'dblclick',
571
554
  mode: 'cell',
572
555
  showStatus: true,
573
- beforeEditMethod: activeCellMethod,
556
+ activeMethod: activeCellMethod,
574
557
  }"
575
558
  keep-source
576
559
  :loading="loading"
@@ -618,7 +601,7 @@
618
601
  :type="treeTypeConfig.colType"
619
602
  :tree-node="index == 0"
620
603
  :key="index"
621
- show-overflow="title"
604
+ show-overflow
622
605
  :field="item.prop"
623
606
  align="left"
624
607
  :title="item.label"
@@ -652,7 +635,7 @@
652
635
  :edit-render="item.edit"
653
636
  :tree-node="index == 0"
654
637
  :key="index"
655
- show-overflow="title"
638
+ show-overflow
656
639
  :field="item.prop"
657
640
  :align="item.align"
658
641
  :title="item.label"
@@ -706,8 +689,7 @@
706
689
  :align="handlerConfig.align"
707
690
  :width="handlerConfig.width"
708
691
  :fixed="handlerConfig.fixed"
709
- show-overflow="title"
710
- field="handler"
692
+ show-overflow
711
693
  >
712
694
  <template v-slot="{ row, rowIndex }">
713
695
  <el-dropdown v-if="handlerConfig.btnGroup">
@@ -777,14 +759,8 @@
777
759
  </template>
778
760
  </template>
779
761
  </vxe-table-column>
780
- <template #empty>
781
- <el-empty :image-size="200">
782
- <template #description>
783
- <p style="font-size:30px">暂无数据</p>
784
- </template>
785
- </el-empty>
786
- </template>
787
762
  </vxe-table>
763
+ </div>
788
764
  </div>
789
765
  </template>
790
766
 
@@ -991,8 +967,30 @@ export default {
991
967
  default: null
992
968
  }
993
969
  },
970
+ watch:{
971
+ loading:{
972
+ deep:true,
973
+ handler(n){
974
+ if(this.$refs[this.id]){
975
+ const temp = this.$refs[this.id].getTableData()
976
+ if(temp.fullData.length > 0){
977
+ this.isShowEmpty = false
978
+ }else{
979
+ if(n){
980
+ this.isShowEmpty = false
981
+ }else{
982
+ this.isShowEmpty = true
983
+ }
984
+ }
985
+ }else{
986
+ this.isShowEmpty = false
987
+ }
988
+ }
989
+ }
990
+ },
994
991
  data() {
995
992
  return {
993
+ isShowEmpty:false,
996
994
  tableData: this.data.DataArray, //表格数据
997
995
  headerClass: (this.data.retjson.header || []).find(i => (i.children || []).length) ? 'has-sub-header' : 'normal-header',
998
996
  colNum: 0, //当前列的数量
@@ -1045,6 +1043,10 @@ export default {
1045
1043
  loadData(data) {
1046
1044
  return this.$refs[this.id].loadData(data);
1047
1045
  },
1046
+ //重载数据
1047
+ reloadData(data) {
1048
+ return this.$refs[this.id].reloadData(data);
1049
+ },
1048
1050
  //根据类型返回筛选框源数据
1049
1051
  filterData(type) {
1050
1052
  switch (type) {
@@ -1759,4 +1761,11 @@ export default {
1759
1761
  .vxe-table--render-default .vxe-body--column{
1760
1762
  line-height:normal !important;
1761
1763
  }
1764
+ .cus-empty-box{
1765
+ position: absolute;
1766
+ top:50%;
1767
+ left:50%;
1768
+ transform: translate(-50%,-50%);
1769
+ z-index:999;
1770
+ }
1762
1771
  </style>