vxe-table 3.23.0-beta.2 → 3.23.0-beta.4
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/es/style.css +1 -1
- package/es/table/module/export/export-panel.js +208 -195
- package/es/table/module/export/import-panel.js +31 -23
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +5 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +3 -0
- package/lib/index.umd.js +47 -27
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/export/export-panel.js +22 -15
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +15 -9
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +6 -1
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +4 -0
- package/lib/ui/src/utils.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/module/export/export-panel.ts +208 -195
- package/packages/table/module/export/import-panel.ts +31 -23
- package/packages/ui/src/dom.ts +7 -2
- package/packages/ui/src/utils.ts +4 -0
- /package/es/{iconfont.1787119200875.ttf → iconfont.1787216111946.ttf} +0 -0
- /package/es/{iconfont.1787119200875.woff → iconfont.1787216111946.woff} +0 -0
- /package/es/{iconfont.1787119200875.woff2 → iconfont.1787216111946.woff2} +0 -0
- /package/lib/{iconfont.1787119200875.ttf → iconfont.1787216111946.ttf} +0 -0
- /package/lib/{iconfont.1787119200875.woff → iconfont.1787216111946.woff} +0 -0
- /package/lib/{iconfont.1787119200875.woff2 → iconfont.1787216111946.woff2} +0 -0
|
@@ -2,7 +2,7 @@ import { CreateElement, VNode, PropType } from 'vue'
|
|
|
2
2
|
import { defineVxeComponent } from '../../../ui/src/comp'
|
|
3
3
|
import { VxeUI } from '../../../ui'
|
|
4
4
|
import XEUtils from 'xe-utils'
|
|
5
|
-
import { formatText } from '../../../ui/src/utils'
|
|
5
|
+
import { formatText, getDefaultConfig } from '../../../ui/src/utils'
|
|
6
6
|
import { createComponentLog } from '../../../ui/src/log'
|
|
7
7
|
|
|
8
8
|
import type { VxeComponentSizeType } from 'vxe-pc-ui'
|
|
@@ -260,6 +260,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
260
260
|
const { hasTree, hasRowGroup, hasMerge, isPrint, hasColgroup, columns } = storeData
|
|
261
261
|
const { isHeader } = defaultOptions
|
|
262
262
|
const colVNs: VNode[] = []
|
|
263
|
+
const exportOpts = $xeTable.computeExportOpts
|
|
264
|
+
const printOpts = $xeTable.computePrintOpts
|
|
265
|
+
const modelOptions = (isPrint ? printOpts : exportOpts).modelOptions || {}
|
|
266
|
+
const settingOptions = (isPrint ? printOpts : exportOpts).settingOptions || {}
|
|
263
267
|
const checkedAll = $xeExportPanel.computeCheckedAll
|
|
264
268
|
const showSheet = $xeExportPanel.computeShowSheet
|
|
265
269
|
const supportMerge = $xeExportPanel.computeSupportMerge
|
|
@@ -321,17 +325,20 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
321
325
|
props: {
|
|
322
326
|
id: 'VXE_EXPORT_MODAL',
|
|
323
327
|
value: storeData.visible,
|
|
324
|
-
title: getI18n(isPrint ? 'vxe.export.printTitle' : 'vxe.export.expTitle'),
|
|
325
|
-
width: 660,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
328
|
+
title: modelOptions.title || getI18n(isPrint ? 'vxe.export.printTitle' : 'vxe.export.expTitle'),
|
|
329
|
+
width: modelOptions.width || 660,
|
|
330
|
+
height: modelOptions.height,
|
|
331
|
+
minWidth: modelOptions.minWidth || 500,
|
|
332
|
+
minHeight: modelOptions.minHeight || 400,
|
|
333
|
+
mask: getDefaultConfig(modelOptions.mask, true),
|
|
334
|
+
lockView: getDefaultConfig(modelOptions.lockView, true),
|
|
330
335
|
showFooter: true,
|
|
331
336
|
escClosable: true,
|
|
332
337
|
maskClosable: true,
|
|
333
|
-
|
|
334
|
-
|
|
338
|
+
fullscreen: modelOptions.fullscreen,
|
|
339
|
+
showMinimize: modelOptions.showMinimize,
|
|
340
|
+
showMaximize: getDefaultConfig(modelOptions.showMaximize, true),
|
|
341
|
+
resize: getDefaultConfig(modelOptions.resize, true),
|
|
335
342
|
loading: reactData.loading
|
|
336
343
|
},
|
|
337
344
|
on: {
|
|
@@ -375,7 +382,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
375
382
|
}, [
|
|
376
383
|
h('tbody', [
|
|
377
384
|
[
|
|
378
|
-
isPrint
|
|
385
|
+
isPrint || settingOptions.showFileName === false
|
|
379
386
|
? renderEmptyElement($xeTable)
|
|
380
387
|
: h('tr', [
|
|
381
388
|
h('td', getI18n('vxe.export.expName')),
|
|
@@ -398,7 +405,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
398
405
|
: renderEmptyElement($xeTable)
|
|
399
406
|
])
|
|
400
407
|
]),
|
|
401
|
-
isPrint
|
|
408
|
+
isPrint || settingOptions.showType === false
|
|
402
409
|
? renderEmptyElement($xeTable)
|
|
403
410
|
: h('tr', [
|
|
404
411
|
h('td', getI18n('vxe.export.expType')),
|
|
@@ -416,7 +423,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
416
423
|
})
|
|
417
424
|
])
|
|
418
425
|
]),
|
|
419
|
-
isPrint || showSheet
|
|
426
|
+
(isPrint || showSheet) && settingOptions.showSheet !== false
|
|
420
427
|
? h('tr', [
|
|
421
428
|
h('td', getI18n('vxe.export.expSheetName')),
|
|
422
429
|
h('td', [
|
|
@@ -439,58 +446,62 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
439
446
|
])
|
|
440
447
|
])
|
|
441
448
|
: renderEmptyElement($xeTable),
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
h('
|
|
445
|
-
h(
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
449
|
+
settingOptions.showMode === false
|
|
450
|
+
? renderEmptyElement($xeTable)
|
|
451
|
+
: h('tr', [
|
|
452
|
+
h('td', getI18n('vxe.export.expMode')),
|
|
453
|
+
h('td', [
|
|
454
|
+
h(VxeUISelectComponent, {
|
|
455
|
+
props: {
|
|
456
|
+
value: defaultOptions.mode,
|
|
457
|
+
options: storeData.modeList
|
|
458
|
+
},
|
|
459
|
+
on: {
|
|
460
|
+
modelValue (value: any) {
|
|
461
|
+
defaultOptions.mode = value
|
|
462
|
+
}
|
|
453
463
|
}
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
])
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
h('
|
|
460
|
-
|
|
461
|
-
h('
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
h('ul', {
|
|
465
|
-
class: 'vxe-table-export--panel-column-header'
|
|
464
|
+
})
|
|
465
|
+
])
|
|
466
|
+
]),
|
|
467
|
+
settingOptions.showColumn === false
|
|
468
|
+
? renderEmptyElement($xeTable)
|
|
469
|
+
: h('tr', [
|
|
470
|
+
h('td', [getI18n('vxe.export.expColumn')]),
|
|
471
|
+
h('td', [
|
|
472
|
+
h('div', {
|
|
473
|
+
class: 'vxe-table-export--panel-column'
|
|
466
474
|
}, [
|
|
467
|
-
h('
|
|
468
|
-
class:
|
|
469
|
-
'is--checked': isAllChecked,
|
|
470
|
-
'is--indeterminate': isAllIndeterminate
|
|
471
|
-
}],
|
|
472
|
-
attrs: {
|
|
473
|
-
title: getI18n('vxe.table.allTitle')
|
|
474
|
-
},
|
|
475
|
-
on: {
|
|
476
|
-
click: $xeExportPanel.allColumnEvent
|
|
477
|
-
}
|
|
475
|
+
h('ul', {
|
|
476
|
+
class: 'vxe-table-export--panel-column-header'
|
|
478
477
|
}, [
|
|
479
|
-
h('
|
|
480
|
-
class: ['vxe-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
478
|
+
h('li', {
|
|
479
|
+
class: ['vxe-table-export--panel-column-option', {
|
|
480
|
+
'is--checked': isAllChecked,
|
|
481
|
+
'is--indeterminate': isAllIndeterminate
|
|
482
|
+
}],
|
|
483
|
+
attrs: {
|
|
484
|
+
title: getI18n('vxe.table.allTitle')
|
|
485
|
+
},
|
|
486
|
+
on: {
|
|
487
|
+
click: $xeExportPanel.allColumnEvent
|
|
488
|
+
}
|
|
489
|
+
}, [
|
|
490
|
+
h('span', {
|
|
491
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
492
|
+
}),
|
|
493
|
+
h('span', {
|
|
494
|
+
class: 'vxe-checkbox--label'
|
|
495
|
+
}, getI18n('vxe.export.expCurrentColumn'))
|
|
496
|
+
])
|
|
497
|
+
]),
|
|
498
|
+
h('ul', {
|
|
499
|
+
class: 'vxe-table-export--panel-column-body'
|
|
500
|
+
}, colVNs)
|
|
501
|
+
])
|
|
490
502
|
])
|
|
491
|
-
])
|
|
492
|
-
|
|
493
|
-
isPrint
|
|
503
|
+
]),
|
|
504
|
+
isPrint && (settingOptions.showWidthMode !== false)
|
|
494
505
|
? h('tr', [
|
|
495
506
|
h('td', getI18n('vxe.export.widthMode')),
|
|
496
507
|
h('td', [
|
|
@@ -510,154 +521,156 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
510
521
|
])
|
|
511
522
|
])
|
|
512
523
|
: renderEmptyElement($xeTable),
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
h(VxeUICheckboxComponent, {
|
|
540
|
-
props: {
|
|
541
|
-
value: defaultOptions.isFooter,
|
|
542
|
-
disabled: !storeData.hasFooter,
|
|
543
|
-
title: getI18n('vxe.export.expFooterTitle'),
|
|
544
|
-
content: getI18n('vxe.export.expOptFooter')
|
|
545
|
-
},
|
|
546
|
-
on: {
|
|
547
|
-
input (value: any) {
|
|
548
|
-
defaultOptions.isFooter = value
|
|
524
|
+
settingOptions.showParameter === false
|
|
525
|
+
? renderEmptyElement($xeTable)
|
|
526
|
+
: h('tr', [
|
|
527
|
+
h('td', getI18n('vxe.export.expOpts')),
|
|
528
|
+
parameterSlot
|
|
529
|
+
? h('td', [
|
|
530
|
+
h('div', {
|
|
531
|
+
class: 'vxe-table-export--panel-option-row'
|
|
532
|
+
}, $xeTable.callSlot(parameterSlot, params, h))
|
|
533
|
+
])
|
|
534
|
+
: h('td', [
|
|
535
|
+
h('div', {
|
|
536
|
+
class: 'vxe-table-export--panel-option-row'
|
|
537
|
+
}, VxeUICheckboxComponent
|
|
538
|
+
? [
|
|
539
|
+
h(VxeUICheckboxComponent, {
|
|
540
|
+
props: {
|
|
541
|
+
value: hasEmptyData || isHeader,
|
|
542
|
+
disabled: hasEmptyData,
|
|
543
|
+
title: getI18n('vxe.export.expHeaderTitle'),
|
|
544
|
+
content: getI18n('vxe.export.expOptHeader')
|
|
545
|
+
},
|
|
546
|
+
on: {
|
|
547
|
+
input (value: any) {
|
|
548
|
+
defaultOptions.isHeader = value
|
|
549
|
+
}
|
|
549
550
|
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
551
|
+
}),
|
|
552
|
+
h(VxeUICheckboxComponent, {
|
|
553
|
+
props: {
|
|
554
|
+
value: defaultOptions.isFooter,
|
|
555
|
+
disabled: !storeData.hasFooter,
|
|
556
|
+
title: getI18n('vxe.export.expFooterTitle'),
|
|
557
|
+
content: getI18n('vxe.export.expOptFooter')
|
|
558
|
+
},
|
|
559
|
+
on: {
|
|
560
|
+
input (value: any) {
|
|
561
|
+
defaultOptions.isFooter = value
|
|
562
|
+
}
|
|
562
563
|
}
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
564
|
+
}),
|
|
565
|
+
h(VxeUICheckboxComponent, {
|
|
566
|
+
props: {
|
|
567
|
+
value: isHeader ? defaultOptions.isTitle : false,
|
|
568
|
+
disabled: !isHeader,
|
|
569
|
+
title: getI18n('vxe.export.expTitleTitle'),
|
|
570
|
+
content: getI18n('vxe.export.expOptTitle')
|
|
571
|
+
},
|
|
572
|
+
on: {
|
|
573
|
+
input (value: any) {
|
|
574
|
+
defaultOptions.isTitle = value
|
|
575
|
+
}
|
|
575
576
|
}
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
title: getI18n('vxe.export.expOriginalTitle'),
|
|
589
|
-
content: getI18n('vxe.export.expOptOriginal')
|
|
590
|
-
},
|
|
591
|
-
on: {
|
|
592
|
-
input (value: any) {
|
|
593
|
-
defaultOptions.original = value
|
|
577
|
+
}),
|
|
578
|
+
h(VxeUICheckboxComponent, {
|
|
579
|
+
props: {
|
|
580
|
+
value: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
|
|
581
|
+
disabled: !isHeader || !hasColgroup || !supportMerge,
|
|
582
|
+
title: getI18n('vxe.export.expColgroupTitle'),
|
|
583
|
+
content: getI18n('vxe.export.expOptColgroup')
|
|
584
|
+
},
|
|
585
|
+
on: {
|
|
586
|
+
input (value: any) {
|
|
587
|
+
defaultOptions.isColgroup = value
|
|
588
|
+
}
|
|
594
589
|
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
590
|
+
})
|
|
591
|
+
]
|
|
592
|
+
: []),
|
|
593
|
+
h('div', {
|
|
594
|
+
class: 'vxe-table-export--panel-option-row'
|
|
595
|
+
}, VxeUICheckboxComponent
|
|
596
|
+
? [
|
|
597
|
+
h(VxeUICheckboxComponent, {
|
|
598
|
+
props: {
|
|
599
|
+
value: hasEmptyData ? false : defaultOptions.original,
|
|
600
|
+
disabled: hasEmptyData,
|
|
601
|
+
title: getI18n('vxe.export.expOriginalTitle'),
|
|
602
|
+
content: getI18n('vxe.export.expOptOriginal')
|
|
603
|
+
},
|
|
604
|
+
on: {
|
|
605
|
+
input (value: any) {
|
|
606
|
+
defaultOptions.original = value
|
|
607
|
+
}
|
|
607
608
|
}
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
isPrint
|
|
611
|
-
? renderEmptyElement($xeTable)
|
|
612
|
-
: h(VxeUICheckboxComponent, {
|
|
609
|
+
}),
|
|
610
|
+
h(VxeUICheckboxComponent, {
|
|
613
611
|
props: {
|
|
614
|
-
value:
|
|
615
|
-
disabled: !
|
|
616
|
-
title: getI18n('vxe.export.
|
|
617
|
-
content: getI18n('vxe.export.
|
|
612
|
+
value: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
|
|
613
|
+
disabled: hasEmptyData || !hasMerge || !supportMerge || !checkedAll,
|
|
614
|
+
title: getI18n('vxe.export.expMergeTitle'),
|
|
615
|
+
content: getI18n('vxe.export.expOptMerge')
|
|
618
616
|
},
|
|
619
617
|
on: {
|
|
620
618
|
input (value: any) {
|
|
621
|
-
defaultOptions.
|
|
619
|
+
defaultOptions.isMerge = value
|
|
622
620
|
}
|
|
623
621
|
}
|
|
624
|
-
})
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
622
|
+
}),
|
|
623
|
+
isPrint
|
|
624
|
+
? renderEmptyElement($xeTable)
|
|
625
|
+
: h(VxeUICheckboxComponent, {
|
|
626
|
+
props: {
|
|
627
|
+
value: supportStyle ? defaultOptions.useStyle : false,
|
|
628
|
+
disabled: !supportStyle,
|
|
629
|
+
title: getI18n('vxe.export.expUseStyleTitle'),
|
|
630
|
+
content: getI18n('vxe.export.expOptUseStyle')
|
|
631
|
+
},
|
|
632
|
+
on: {
|
|
633
|
+
input (value: any) {
|
|
634
|
+
defaultOptions.useStyle = value
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
})
|
|
638
|
+
]
|
|
639
|
+
: []),
|
|
640
|
+
h('div', {
|
|
641
|
+
class: 'vxe-table-export--panel-option-row'
|
|
642
|
+
}, VxeUICheckboxComponent
|
|
643
|
+
? [
|
|
644
|
+
h(VxeUICheckboxComponent, {
|
|
645
|
+
props: {
|
|
646
|
+
value: hasTree ? defaultOptions.isTreeAllExpanded : false,
|
|
647
|
+
disabled: hasEmptyData || !hasTree,
|
|
648
|
+
title: getI18n('vxe.export.expTreeAllExpandTitle'),
|
|
649
|
+
content: getI18n('vxe.export.expOptTreeAllExpand')
|
|
650
|
+
},
|
|
651
|
+
on: {
|
|
652
|
+
input (value: any) {
|
|
653
|
+
defaultOptions.isTreeAllExpanded = value
|
|
654
|
+
}
|
|
641
655
|
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
656
|
+
}),
|
|
657
|
+
h(VxeUICheckboxComponent, {
|
|
658
|
+
props: {
|
|
659
|
+
value: hasRowGroup ? defaultOptions.isRowGroupAllExpanded : false,
|
|
660
|
+
disabled: hasEmptyData || !hasRowGroup,
|
|
661
|
+
title: getI18n('vxe.export.expRowGroupAllExpandTitle'),
|
|
662
|
+
content: getI18n('vxe.export.expOptRowGroupAllExpand')
|
|
663
|
+
},
|
|
664
|
+
on: {
|
|
665
|
+
input (value: any) {
|
|
666
|
+
defaultOptions.isRowGroupAllExpanded = value
|
|
667
|
+
}
|
|
654
668
|
}
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
]
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
])
|
|
669
|
+
})
|
|
670
|
+
]
|
|
671
|
+
: [])
|
|
672
|
+
])
|
|
673
|
+
])
|
|
661
674
|
]
|
|
662
675
|
])
|
|
663
676
|
])
|
|
@@ -2,7 +2,7 @@ import { CreateElement, PropType } from 'vue'
|
|
|
2
2
|
import { defineVxeComponent } from '../../../ui/src/comp'
|
|
3
3
|
import { VxeUI } from '../../../ui'
|
|
4
4
|
import XEUtils from 'xe-utils'
|
|
5
|
-
import { parseFile } from '../../../ui/src/utils'
|
|
5
|
+
import { getDefaultConfig, parseFile } from '../../../ui/src/utils'
|
|
6
6
|
import { createComponentLog } from '../../../ui/src/log'
|
|
7
7
|
|
|
8
8
|
import type { VxeComponentSizeType } from 'vxe-pc-ui'
|
|
@@ -154,7 +154,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
154
154
|
const { defaultOptions, storeData } = props
|
|
155
155
|
const selectName = $xeImportPanel.computeSelectName as string
|
|
156
156
|
const hasFile = $xeImportPanel.computeHasFile
|
|
157
|
+
const importOpts = $xeTable.computeImportOpts
|
|
157
158
|
const parseTypeLabel = $xeImportPanel.computeParseTypeLabel as string
|
|
159
|
+
const modelOptions = importOpts.modelOptions || {}
|
|
160
|
+
const settingOptions = importOpts.settingOptions || {}
|
|
158
161
|
const slots = defaultOptions.slots || {}
|
|
159
162
|
const topSlot = slots.top
|
|
160
163
|
const bottomSlot = slots.bottom
|
|
@@ -165,17 +168,20 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
165
168
|
props: {
|
|
166
169
|
id: 'VXE_IMPORT_MODAL',
|
|
167
170
|
value: storeData.visible,
|
|
168
|
-
title: getI18n('vxe.import.impTitle'),
|
|
169
|
-
width: 540,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
title: modelOptions.title || getI18n('vxe.import.impTitle'),
|
|
172
|
+
width: modelOptions.width || 540,
|
|
173
|
+
height: modelOptions.height,
|
|
174
|
+
minWidth: modelOptions.minWidth || 360,
|
|
175
|
+
minHeight: modelOptions.minHeight || 240,
|
|
176
|
+
mask: getDefaultConfig(modelOptions.mask, true),
|
|
177
|
+
lockView: getDefaultConfig(modelOptions.lockView, true),
|
|
174
178
|
showFooter: true,
|
|
175
179
|
escClosable: true,
|
|
176
180
|
maskClosable: true,
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
fullscreen: modelOptions.fullscreen,
|
|
182
|
+
showMinimize: modelOptions.showMinimize,
|
|
183
|
+
showMaximize: getDefaultConfig(modelOptions.showMaximize, true),
|
|
184
|
+
resize: getDefaultConfig(modelOptions.resize, true),
|
|
179
185
|
loading: reactData.loading
|
|
180
186
|
},
|
|
181
187
|
on: {
|
|
@@ -250,22 +256,24 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
250
256
|
h('td', getI18n('vxe.import.impType')),
|
|
251
257
|
h('td', parseTypeLabel)
|
|
252
258
|
]),
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
h('
|
|
256
|
-
h('vxe
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
259
|
+
settingOptions.showMode === false
|
|
260
|
+
? renderEmptyElement($xeTable)
|
|
261
|
+
: h('tr', [
|
|
262
|
+
h('td', getI18n('vxe.import.impMode')),
|
|
263
|
+
h('td', [
|
|
264
|
+
h('vxe-select', {
|
|
265
|
+
props: {
|
|
266
|
+
value: defaultOptions.mode,
|
|
267
|
+
options: storeData.modeList
|
|
268
|
+
},
|
|
269
|
+
on: {
|
|
270
|
+
modelValue (value: any) {
|
|
271
|
+
defaultOptions.mode = value
|
|
272
|
+
}
|
|
264
273
|
}
|
|
265
|
-
}
|
|
266
|
-
|
|
274
|
+
})
|
|
275
|
+
])
|
|
267
276
|
])
|
|
268
|
-
])
|
|
269
277
|
])
|
|
270
278
|
])
|
|
271
279
|
]
|
package/packages/ui/src/dom.ts
CHANGED
|
@@ -249,8 +249,13 @@ export function wheelScrollTopTo (diffNum: number, cb: (progress: number) => voi
|
|
|
249
249
|
|
|
250
250
|
export function getPopupContainer (appendTo: string | HTMLElement | ((params: any) => string | HTMLElement) | undefined) {
|
|
251
251
|
const selectElem = appendTo && XEUtils.isFunction(appendTo) ? appendTo({}) : appendTo
|
|
252
|
+
return selectElem || 'body'
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export function getPopupAppendElement (appendTo: string | HTMLElement | ((params: any) => string | HTMLElement) | undefined) {
|
|
256
|
+
const selectElem = getPopupContainer(appendTo)
|
|
252
257
|
if (XEUtils.isString(selectElem)) {
|
|
253
|
-
return document.querySelector(selectElem) || document.body
|
|
258
|
+
return document.querySelector<HTMLElement>(selectElem) || document.body
|
|
254
259
|
}
|
|
255
|
-
return selectElem
|
|
260
|
+
return selectElem
|
|
256
261
|
}
|
package/packages/ui/src/utils.ts
CHANGED
|
@@ -54,3 +54,7 @@ export function eqEmptyValue (cellValue: any) {
|
|
|
54
54
|
export function getClass (property: any, params: any) {
|
|
55
55
|
return property ? XEUtils.isFunction(property) ? property(params) : property : ''
|
|
56
56
|
}
|
|
57
|
+
|
|
58
|
+
export function getDefaultConfig (val1: any, def1: any) {
|
|
59
|
+
return XEUtils.eqNull(val1) ? def1 : val1
|
|
60
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|