vxe-table 3.22.2 → 3.22.3
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/locale/lang/ar-EG.js +7 -0
- package/es/locale/lang/de-DE.js +7 -0
- package/es/locale/lang/en-US.js +7 -0
- package/es/locale/lang/es-ES.js +7 -0
- package/es/locale/lang/fr-FR.js +7 -0
- package/es/locale/lang/hu-HU.js +7 -0
- package/es/locale/lang/hy-AM.js +7 -0
- package/es/locale/lang/id-ID.js +7 -0
- package/es/locale/lang/it-IT.js +7 -0
- package/es/locale/lang/ja-JP.js +7 -0
- package/es/locale/lang/ko-KR.js +7 -0
- package/es/locale/lang/ms-MY.js +7 -0
- package/es/locale/lang/nb-NO.js +7 -0
- package/es/locale/lang/pt-BR.js +7 -0
- package/es/locale/lang/ru-RU.js +7 -0
- package/es/locale/lang/th-TH.js +7 -0
- package/es/locale/lang/ug-CN.js +7 -0
- package/es/locale/lang/uk-UA.js +7 -0
- package/es/locale/lang/uz-UZ.js +7 -0
- package/es/locale/lang/vi-VN.js +7 -0
- package/es/locale/lang/zh-CHT.js +7 -0
- package/es/locale/lang/zh-CN.js +7 -0
- package/es/style.css +1 -1
- package/es/table/module/export/export-panel.js +384 -335
- package/es/table/module/export/mixin.js +106 -28
- package/es/table/module/export/util.js +1 -1
- package/es/table/src/body.js +1 -1
- package/es/table/src/footer.js +1 -1
- package/es/table/src/header.js +4 -2
- package/es/table/src/table.js +24 -24
- package/es/table/src/util.js +1 -0
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +202 -79
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +7 -0
- package/lib/locale/lang/de-DE.js +7 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +7 -0
- package/lib/locale/lang/en-US.js +7 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -0
- package/lib/locale/lang/es-ES.js +7 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -0
- package/lib/locale/lang/fr-FR.js +7 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +7 -0
- package/lib/locale/lang/hu-HU.js +7 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -0
- package/lib/locale/lang/hy-AM.js +7 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +7 -0
- package/lib/locale/lang/id-ID.js +7 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +7 -0
- package/lib/locale/lang/it-IT.js +7 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +7 -0
- package/lib/locale/lang/ja-JP.js +7 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -0
- package/lib/locale/lang/ko-KR.js +7 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -0
- package/lib/locale/lang/ms-MY.js +7 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +7 -0
- package/lib/locale/lang/nb-NO.js +7 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +7 -0
- package/lib/locale/lang/pt-BR.js +7 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -0
- package/lib/locale/lang/ru-RU.js +7 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -0
- package/lib/locale/lang/th-TH.js +7 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +7 -0
- package/lib/locale/lang/ug-CN.js +7 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +7 -0
- package/lib/locale/lang/uk-UA.js +7 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -0
- package/lib/locale/lang/uz-UZ.js +7 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +7 -0
- package/lib/locale/lang/vi-VN.js +7 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +7 -0
- package/lib/locale/lang/zh-CHT.js +7 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +7 -0
- package/lib/locale/lang/zh-CN.js +7 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -0
- package/lib/style.css +1 -1
- package/lib/table/module/export/export-panel.js +50 -22
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +106 -28
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/export/util.js +1 -1
- package/lib/table/module/export/util.min.js +1 -1
- package/lib/table/src/body.js +1 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +1 -1
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +4 -2
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +28 -22
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +2 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +7 -0
- package/packages/locale/lang/de-DE.ts +7 -0
- package/packages/locale/lang/en-US.ts +7 -0
- package/packages/locale/lang/es-ES.ts +7 -0
- package/packages/locale/lang/fr-FR.ts +7 -0
- package/packages/locale/lang/hu-HU.ts +7 -0
- package/packages/locale/lang/hy-AM.ts +7 -0
- package/packages/locale/lang/id-ID.ts +7 -0
- package/packages/locale/lang/it-IT.ts +7 -0
- package/packages/locale/lang/ja-JP.ts +7 -0
- package/packages/locale/lang/ko-KR.ts +7 -0
- package/packages/locale/lang/ms-MY.ts +7 -0
- package/packages/locale/lang/nb-NO.ts +7 -0
- package/packages/locale/lang/pt-BR.ts +7 -0
- package/packages/locale/lang/ru-RU.ts +7 -0
- package/packages/locale/lang/th-TH.ts +7 -0
- package/packages/locale/lang/ug-CN.ts +7 -0
- package/packages/locale/lang/uk-UA.ts +7 -0
- package/packages/locale/lang/uz-UZ.ts +7 -0
- package/packages/locale/lang/vi-VN.ts +7 -0
- package/packages/locale/lang/zh-CHT.ts +7 -0
- package/packages/locale/lang/zh-CN.ts +7 -0
- package/packages/table/module/export/export-panel.ts +383 -333
- package/packages/table/module/export/mixin.ts +130 -46
- package/packages/table/module/export/util.ts +1 -1
- package/packages/table/src/body.ts +1 -1
- package/packages/table/src/footer.ts +1 -1
- package/packages/table/src/header.ts +4 -2
- package/packages/table/src/table.ts +24 -24
- package/packages/table/src/util.ts +1 -0
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1784122379007.ttf → iconfont.1784251254538.ttf} +0 -0
- /package/es/{iconfont.1784122379007.woff → iconfont.1784251254538.woff} +0 -0
- /package/es/{iconfont.1784122379007.woff2 → iconfont.1784251254538.woff2} +0 -0
- /package/lib/{iconfont.1784122379007.ttf → iconfont.1784251254538.ttf} +0 -0
- /package/lib/{iconfont.1784122379007.woff → iconfont.1784251254538.woff} +0 -0
- /package/lib/{iconfont.1784122379007.woff2 → iconfont.1784251254538.woff2} +0 -0
|
@@ -48,6 +48,18 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
48
48
|
};
|
|
49
49
|
},
|
|
50
50
|
computed: Object.assign(Object.assign({}, {}), {
|
|
51
|
+
computeColWidthModeOptions() {
|
|
52
|
+
return [{
|
|
53
|
+
value: '',
|
|
54
|
+
label: getI18n('vxe.export.wdModes.default')
|
|
55
|
+
}, {
|
|
56
|
+
value: 'auto',
|
|
57
|
+
label: getI18n('vxe.export.wdModes.auto')
|
|
58
|
+
}, {
|
|
59
|
+
value: 'scale',
|
|
60
|
+
label: getI18n('vxe.export.wdModes.scale')
|
|
61
|
+
}];
|
|
62
|
+
},
|
|
51
63
|
computeCheckedAll() {
|
|
52
64
|
const $xeExportPanel = this;
|
|
53
65
|
const props = $xeExportPanel;
|
|
@@ -251,6 +263,11 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
251
263
|
});
|
|
252
264
|
},
|
|
253
265
|
renderVN(h) {
|
|
266
|
+
const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
|
|
267
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
268
|
+
const VxeUISelectComponent = _ui.VxeUI.getComponent('VxeSelect');
|
|
269
|
+
const VxeUIInputComponent = _ui.VxeUI.getComponent('VxeInput');
|
|
270
|
+
const VxeUICheckboxComponent = _ui.VxeUI.getComponent('VxeCheckbox');
|
|
254
271
|
const $xeExportPanel = this;
|
|
255
272
|
const props = $xeExportPanel;
|
|
256
273
|
const reactData = $xeExportPanel.reactData;
|
|
@@ -281,6 +298,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
281
298
|
const showSheet = $xeExportPanel.computeShowSheet;
|
|
282
299
|
const supportMerge = $xeExportPanel.computeSupportMerge;
|
|
283
300
|
const supportStyle = $xeExportPanel.computeSupportStyle;
|
|
301
|
+
const colWidthModeOptions = $xeExportPanel.computeColWidthModeOptions;
|
|
284
302
|
// const supportGroup = $xeExportPanel.computeSupportGroup
|
|
285
303
|
const slots = defaultOptions.slots || {};
|
|
286
304
|
const topSlot = slots.top;
|
|
@@ -324,7 +342,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
324
342
|
class: 'vxe-checkbox--label'
|
|
325
343
|
}, colTitle)]));
|
|
326
344
|
});
|
|
327
|
-
return h(
|
|
345
|
+
return VxeUIModalComponent ? h(VxeUIModalComponent, {
|
|
328
346
|
ref: 'modal',
|
|
329
347
|
props: {
|
|
330
348
|
id: 'VXE_EXPORT_MODAL',
|
|
@@ -372,7 +390,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
372
390
|
cellpadding: 0,
|
|
373
391
|
border: 0
|
|
374
392
|
}
|
|
375
|
-
}, [h('tbody', [[isPrint ? renderEmptyElement($xeTable) : h('tr', [h('td', getI18n('vxe.export.expName')), h('td', [h(
|
|
393
|
+
}, [h('tbody', [[isPrint ? renderEmptyElement($xeTable) : h('tr', [h('td', getI18n('vxe.export.expName')), h('td', [VxeUIInputComponent ? h(VxeUIInputComponent, {
|
|
376
394
|
ref: 'filename',
|
|
377
395
|
props: {
|
|
378
396
|
value: defaultOptions.filename,
|
|
@@ -385,7 +403,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
385
403
|
defaultOptions.filename = value;
|
|
386
404
|
}
|
|
387
405
|
}
|
|
388
|
-
})])]), isPrint ? renderEmptyElement($xeTable) : h('tr', [h('td', getI18n('vxe.export.expType')), h('td', [h('vxe-select', {
|
|
406
|
+
}) : renderEmptyElement($xeTable)])]), isPrint ? renderEmptyElement($xeTable) : h('tr', [h('td', getI18n('vxe.export.expType')), h('td', [h('vxe-select', {
|
|
389
407
|
props: {
|
|
390
408
|
value: defaultOptions.type,
|
|
391
409
|
options: storeData.typeList
|
|
@@ -395,7 +413,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
395
413
|
defaultOptions.type = value;
|
|
396
414
|
}
|
|
397
415
|
}
|
|
398
|
-
})])]), isPrint || showSheet ? h('tr', [h('td', getI18n('vxe.export.expSheetName')), h('td', [h(
|
|
416
|
+
})])]), isPrint || showSheet ? h('tr', [h('td', getI18n('vxe.export.expSheetName')), h('td', [VxeUIInputComponent ? h(VxeUIInputComponent, {
|
|
399
417
|
ref: 'sheetname',
|
|
400
418
|
props: {
|
|
401
419
|
value: defaultOptions.sheetName,
|
|
@@ -408,7 +426,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
408
426
|
defaultOptions.sheetName = value;
|
|
409
427
|
}
|
|
410
428
|
}
|
|
411
|
-
})])]) : renderEmptyElement($xeTable), h('tr', [h('td', getI18n('vxe.export.expMode')), h('td', [h(
|
|
429
|
+
}) : renderEmptyElement($xeTable)])]) : renderEmptyElement($xeTable), h('tr', [h('td', getI18n('vxe.export.expMode')), h('td', [h(VxeUISelectComponent, {
|
|
412
430
|
props: {
|
|
413
431
|
value: defaultOptions.mode,
|
|
414
432
|
options: storeData.modeList
|
|
@@ -439,11 +457,21 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
439
457
|
class: 'vxe-checkbox--label'
|
|
440
458
|
}, getI18n('vxe.export.expCurrentColumn'))])]), h('ul', {
|
|
441
459
|
class: 'vxe-table-export--panel-column-body'
|
|
442
|
-
}, colVNs)])])]), h('tr', [h('td', getI18n('vxe.export.
|
|
460
|
+
}, colVNs)])])]), isPrint ? h('tr', [h('td', getI18n('vxe.export.widthMode')), h('td', [VxeUISelectComponent ? h(VxeUISelectComponent, {
|
|
461
|
+
props: {
|
|
462
|
+
value: defaultOptions.widthMode,
|
|
463
|
+
options: colWidthModeOptions
|
|
464
|
+
},
|
|
465
|
+
on: {
|
|
466
|
+
modelValue(value) {
|
|
467
|
+
defaultOptions.widthMode = value;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}) : renderEmptyElement($xeTable)])]) : renderEmptyElement($xeTable), h('tr', [h('td', getI18n('vxe.export.expOpts')), parameterSlot ? h('td', [h('div', {
|
|
443
471
|
class: 'vxe-table-export--panel-option-row'
|
|
444
472
|
}, $xeTable.callSlot(parameterSlot, params, h))]) : h('td', [h('div', {
|
|
445
473
|
class: 'vxe-table-export--panel-option-row'
|
|
446
|
-
}, [h(
|
|
474
|
+
}, VxeUICheckboxComponent ? [h(VxeUICheckboxComponent, {
|
|
447
475
|
props: {
|
|
448
476
|
value: hasEmptyData || isHeader,
|
|
449
477
|
disabled: hasEmptyData,
|
|
@@ -455,7 +483,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
455
483
|
defaultOptions.isHeader = value;
|
|
456
484
|
}
|
|
457
485
|
}
|
|
458
|
-
}), h(
|
|
486
|
+
}), h(VxeUICheckboxComponent, {
|
|
459
487
|
props: {
|
|
460
488
|
value: defaultOptions.isFooter,
|
|
461
489
|
disabled: !storeData.hasFooter,
|
|
@@ -467,7 +495,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
467
495
|
defaultOptions.isFooter = value;
|
|
468
496
|
}
|
|
469
497
|
}
|
|
470
|
-
}), h(
|
|
498
|
+
}), h(VxeUICheckboxComponent, {
|
|
471
499
|
props: {
|
|
472
500
|
value: isHeader ? defaultOptions.isTitle : false,
|
|
473
501
|
disabled: !isHeader,
|
|
@@ -479,7 +507,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
479
507
|
defaultOptions.isTitle = value;
|
|
480
508
|
}
|
|
481
509
|
}
|
|
482
|
-
}), h(
|
|
510
|
+
}), h(VxeUICheckboxComponent, {
|
|
483
511
|
props: {
|
|
484
512
|
value: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
|
|
485
513
|
disabled: !isHeader || !hasColgroup || !supportMerge,
|
|
@@ -491,9 +519,9 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
491
519
|
defaultOptions.isColgroup = value;
|
|
492
520
|
}
|
|
493
521
|
}
|
|
494
|
-
})]), h('div', {
|
|
522
|
+
})] : []), h('div', {
|
|
495
523
|
class: 'vxe-table-export--panel-option-row'
|
|
496
|
-
}, [h(
|
|
524
|
+
}, VxeUICheckboxComponent ? [h(VxeUICheckboxComponent, {
|
|
497
525
|
props: {
|
|
498
526
|
value: hasEmptyData ? false : defaultOptions.original,
|
|
499
527
|
disabled: hasEmptyData,
|
|
@@ -505,7 +533,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
505
533
|
defaultOptions.original = value;
|
|
506
534
|
}
|
|
507
535
|
}
|
|
508
|
-
}), h(
|
|
536
|
+
}), h(VxeUICheckboxComponent, {
|
|
509
537
|
props: {
|
|
510
538
|
value: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
|
|
511
539
|
disabled: hasEmptyData || !hasMerge || !supportMerge || !checkedAll,
|
|
@@ -517,7 +545,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
517
545
|
defaultOptions.isMerge = value;
|
|
518
546
|
}
|
|
519
547
|
}
|
|
520
|
-
}), isPrint ? renderEmptyElement($xeTable) : h(
|
|
548
|
+
}), isPrint ? renderEmptyElement($xeTable) : h(VxeUICheckboxComponent, {
|
|
521
549
|
props: {
|
|
522
550
|
value: supportStyle ? defaultOptions.useStyle : false,
|
|
523
551
|
disabled: !supportStyle,
|
|
@@ -529,9 +557,9 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
529
557
|
defaultOptions.useStyle = value;
|
|
530
558
|
}
|
|
531
559
|
}
|
|
532
|
-
})]), h('div', {
|
|
560
|
+
})] : []), h('div', {
|
|
533
561
|
class: 'vxe-table-export--panel-option-row'
|
|
534
|
-
}, [h(
|
|
562
|
+
}, VxeUICheckboxComponent ? [h(VxeUICheckboxComponent, {
|
|
535
563
|
props: {
|
|
536
564
|
value: hasTree ? defaultOptions.isTreeAllExpanded : false,
|
|
537
565
|
disabled: hasEmptyData || !hasTree,
|
|
@@ -543,7 +571,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
543
571
|
defaultOptions.isTreeAllExpanded = value;
|
|
544
572
|
}
|
|
545
573
|
}
|
|
546
|
-
}), h(
|
|
574
|
+
}), h(VxeUICheckboxComponent, {
|
|
547
575
|
props: {
|
|
548
576
|
value: hasRowGroup ? defaultOptions.isRowGroupAllExpanded : false,
|
|
549
577
|
disabled: hasEmptyData || !hasRowGroup,
|
|
@@ -555,7 +583,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
555
583
|
defaultOptions.isRowGroupAllExpanded = value;
|
|
556
584
|
}
|
|
557
585
|
}
|
|
558
|
-
})])])])]])])]), bottomSlot ? h('div', {
|
|
586
|
+
})] : [])])])]])])]), bottomSlot ? h('div', {
|
|
559
587
|
class: 'vxe-table-export--panel-bottom'
|
|
560
588
|
}, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable)]);
|
|
561
589
|
},
|
|
@@ -572,14 +600,14 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
572
600
|
class: 'vxe-table-export--panel-footer'
|
|
573
601
|
}, footerSlot ? $xeTable.callSlot(footerSlot, params, h) : [h('div', {
|
|
574
602
|
class: 'vxe-table-export--panel-btns'
|
|
575
|
-
}, [h(
|
|
603
|
+
}, [VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
576
604
|
props: {
|
|
577
605
|
content: getI18n('vxe.export.expCancel')
|
|
578
606
|
},
|
|
579
607
|
on: {
|
|
580
608
|
click: $xeExportPanel.cancelEvent
|
|
581
609
|
}
|
|
582
|
-
}), h(
|
|
610
|
+
}) : renderEmptyElement($xeTable), VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
583
611
|
ref: 'confirmBtn',
|
|
584
612
|
props: {
|
|
585
613
|
status: 'primary',
|
|
@@ -588,10 +616,10 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
588
616
|
on: {
|
|
589
617
|
click: $xeExportPanel.confirmEvent
|
|
590
618
|
}
|
|
591
|
-
})])]);
|
|
619
|
+
}) : renderEmptyElement($xeTable)])]);
|
|
592
620
|
}
|
|
593
621
|
}
|
|
594
|
-
});
|
|
622
|
+
}) : renderEmptyElement($xeTable);
|
|
595
623
|
}
|
|
596
624
|
},
|
|
597
625
|
render(h) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../../ui/src/comp"),_ui=require("../../../ui"),_xeUtils=_interopRequireDefault(require("xe-utils")),_utils=require("../../../ui/src/utils"),_log=require("../../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let errLog=(0,_log.createComponentLog)("table").errLog,{getI18n,getIcon,globalMixins,renderEmptyElement}=_ui.VxeUI;var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableExportPanel",mixins:[globalMixins.sizeMixin],props:{defaultOptions:{type:Object,default:()=>({})},storeData:{type:Object,default:()=>({})}},inject:{$xeTable:{default:null}},data(){return{reactData:{isAll:!1,isIndeterminate:!1,loading:!1}}},computed:Object.assign(Object.assign({},{}),{computeCheckedAll(){var e=this.storeData;return e.columns.every(e=>e.checked)},computeShowSheet(){var e=this.defaultOptions;return-1<["html","xml","xlsx","pdf"].indexOf(e.type)},computeSupportMerge(){var{storeData:e,defaultOptions:t}=this;return!t.original&&"current"===t.mode&&(e.isPrint||-1<["html","xlsx"].indexOf(t.type))},computeSupportStyle(){var e=this.defaultOptions;return!e.original&&-1<["xlsx"].indexOf(e.type)}}),created(){let e=_ui.VxeUI.getComponent("VxeModal"),t=_ui.VxeUI.getComponent("VxeButton"),l=_ui.VxeUI.getComponent("VxeSelect"),o=_ui.VxeUI.getComponent("VxeInput"),r=_ui.VxeUI.getComponent("VxeCheckbox");this.$nextTick(()=>{e||errLog("vxe.error.reqComp",["vxe-modal"]),t||errLog("vxe.error.reqComp",["vxe-button"]),l||errLog("vxe.error.reqComp",["vxe-select"]),o||errLog("vxe.error.reqComp",["vxe-input"]),r||errLog("vxe.error.reqComp",["vxe-checkbox"])})},methods:{changeOption(e){let t=!e.checked;_xeUtils.default.eachTree([e],e=>{e.checked=t,e.halfChecked=!1}),this.handleOptionCheck(e),this.checkStatus()},handleOptionCheck(t){var e=this.storeData,e=_xeUtils.default.findTree(e.columns,e=>e===t);e&&e.parent&&(e=e.parent,e.children)&&e.children.length&&(e.checked=e.children.every(e=>e.checked),e.halfChecked=!e.checked&&e.children.some(e=>e.checked||e.halfChecked),this.handleOptionCheck(e))},checkStatus(){var e=this.reactData,t=this.storeData,t=t.columns;e.isAll=t.every(e=>e.disabled||e.checked),e.isIndeterminate=!e.isAll&&t.some(e=>!e.disabled&&(e.checked||e.halfChecked))},allColumnEvent(){var e=this,t=e.reactData,l=e.storeData;let o=!t.isAll;_xeUtils.default.eachTree(l.columns,e=>{e.disabled||(e.checked=o,e.halfChecked=!1)}),t.isAll=o,e.checkStatus()},showEvent(){let t=this;t.$nextTick(()=>{var e=t.$refs.filename||t.$refs.sheetname||t.$refs.confirmBtn;e&&e.focus()}),t.checkStatus()},getExportOption(){var e=this,{storeData:t,defaultOptions:l}=e,{hasMerge:t,columns:o}=t,r=e.computeCheckedAll,e=e.computeSupportMerge,o=_xeUtils.default.searchTree(o,e=>e.checked,{children:"children",mapChildren:"childNodes",original:!0});return Object.assign({},l,{columns:o,isMerge:!!(t&&e&&r)&&l.isMerge})},cancelEvent(){var e=this.storeData;e.visible=!1},confirmEvent(){var e=this.storeData;e.isPrint?this.printEvent():this.exportEvent()},printEvent(){var e=this.$xeTable,t=this.storeData;t.visible=!1,e.print(Object.assign({},e.printOpts,this.getExportOption()))},exportEvent(){let e=this.reactData;var t=this.$xeTable;let l=this.storeData;var o=t.exportOpts;e.loading=!0,t.exportData(Object.assign({},o,this.getExportOption())).then(()=>{e.loading=!1,l.visible=!1}).catch(()=>{e.loading=!1})},renderVN(a){let
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _comp=require("../../../ui/src/comp"),_ui=require("../../../ui"),_xeUtils=_interopRequireDefault(require("xe-utils")),_utils=require("../../../ui/src/utils"),_log=require("../../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let errLog=(0,_log.createComponentLog)("table").errLog,{getI18n,getIcon,globalMixins,renderEmptyElement}=_ui.VxeUI;var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableExportPanel",mixins:[globalMixins.sizeMixin],props:{defaultOptions:{type:Object,default:()=>({})},storeData:{type:Object,default:()=>({})}},inject:{$xeTable:{default:null}},data(){return{reactData:{isAll:!1,isIndeterminate:!1,loading:!1}}},computed:Object.assign(Object.assign({},{}),{computeColWidthModeOptions(){return[{value:"",label:getI18n("vxe.export.wdModes.default")},{value:"auto",label:getI18n("vxe.export.wdModes.auto")},{value:"scale",label:getI18n("vxe.export.wdModes.scale")}]},computeCheckedAll(){var e=this.storeData;return e.columns.every(e=>e.checked)},computeShowSheet(){var e=this.defaultOptions;return-1<["html","xml","xlsx","pdf"].indexOf(e.type)},computeSupportMerge(){var{storeData:e,defaultOptions:t}=this;return!t.original&&"current"===t.mode&&(e.isPrint||-1<["html","xlsx"].indexOf(t.type))},computeSupportStyle(){var e=this.defaultOptions;return!e.original&&-1<["xlsx"].indexOf(e.type)}}),created(){let e=_ui.VxeUI.getComponent("VxeModal"),t=_ui.VxeUI.getComponent("VxeButton"),l=_ui.VxeUI.getComponent("VxeSelect"),o=_ui.VxeUI.getComponent("VxeInput"),r=_ui.VxeUI.getComponent("VxeCheckbox");this.$nextTick(()=>{e||errLog("vxe.error.reqComp",["vxe-modal"]),t||errLog("vxe.error.reqComp",["vxe-button"]),l||errLog("vxe.error.reqComp",["vxe-select"]),o||errLog("vxe.error.reqComp",["vxe-input"]),r||errLog("vxe.error.reqComp",["vxe-checkbox"])})},methods:{changeOption(e){let t=!e.checked;_xeUtils.default.eachTree([e],e=>{e.checked=t,e.halfChecked=!1}),this.handleOptionCheck(e),this.checkStatus()},handleOptionCheck(t){var e=this.storeData,e=_xeUtils.default.findTree(e.columns,e=>e===t);e&&e.parent&&(e=e.parent,e.children)&&e.children.length&&(e.checked=e.children.every(e=>e.checked),e.halfChecked=!e.checked&&e.children.some(e=>e.checked||e.halfChecked),this.handleOptionCheck(e))},checkStatus(){var e=this.reactData,t=this.storeData,t=t.columns;e.isAll=t.every(e=>e.disabled||e.checked),e.isIndeterminate=!e.isAll&&t.some(e=>!e.disabled&&(e.checked||e.halfChecked))},allColumnEvent(){var e=this,t=e.reactData,l=e.storeData;let o=!t.isAll;_xeUtils.default.eachTree(l.columns,e=>{e.disabled||(e.checked=o,e.halfChecked=!1)}),t.isAll=o,e.checkStatus()},showEvent(){let t=this;t.$nextTick(()=>{var e=t.$refs.filename||t.$refs.sheetname||t.$refs.confirmBtn;e&&e.focus()}),t.checkStatus()},getExportOption(){var e=this,{storeData:t,defaultOptions:l}=e,{hasMerge:t,columns:o}=t,r=e.computeCheckedAll,e=e.computeSupportMerge,o=_xeUtils.default.searchTree(o,e=>e.checked,{children:"children",mapChildren:"childNodes",original:!0});return Object.assign({},l,{columns:o,isMerge:!!(t&&e&&r)&&l.isMerge})},cancelEvent(){var e=this.storeData;e.visible=!1},confirmEvent(){var e=this.storeData;e.isPrint?this.printEvent():this.exportEvent()},printEvent(){var e=this.$xeTable,t=this.storeData;t.visible=!1,e.print(Object.assign({},e.printOpts,this.getExportOption()))},exportEvent(){let e=this.reactData;var t=this.$xeTable;let l=this.storeData;var o=t.exportOpts;e.loading=!0,t.exportData(Object.assign({},o,this.getExportOption())).then(()=>{e.loading=!1,l.visible=!1}).catch(()=>{e.loading=!1})},renderVN(a){var e=_ui.VxeUI.getComponent("VxeModal");let t=_ui.VxeUI.getComponent("VxeButton"),l=_ui.VxeUI.getComponent("VxeSelect"),o=_ui.VxeUI.getComponent("VxeInput"),r=_ui.VxeUI.getComponent("VxeCheckbox"),p=this;var n=p,i=p.reactData;let s=p.$xeTable,x=s.$xeGrid,d=s.$xeGantt,{defaultOptions:c,storeData:u}=n,{isAll:v,isIndeterminate:m}=i,{hasTree:h,hasRowGroup:g,hasMerge:b,isPrint:E,hasColgroup:C,columns:I}=u,f=c.isHeader,k=[],O=p.computeCheckedAll,T=p.computeShowSheet,_=p.computeSupportMerge,y=p.computeSupportStyle,M=p.computeColWidthModeOptions;n=c.slots||{};let V=n.top,S=n.bottom,D=n.default,A=n.footer,w=n.parameter;return _xeUtils.default.eachTree(I,e=>{var t=(0,_utils.formatText)(e.getTitle(),1),l=e.children&&e.children.length,o=e.checked,r=e.halfChecked,n="html"===e.type;k.push(a("li",{class:["vxe-table-export--panel-column-option","level--"+e.level,{"is--group":l,"is--checked":o,"is--indeterminate":r,"is--disabled":e.disabled}],attrs:{title:t},on:{click:()=>{e.disabled||p.changeOption(e)}}},[a("span",{class:["vxe-checkbox--icon",r?getIcon().TABLE_CHECKBOX_INDETERMINATE:o?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]}),n?a("span",{key:"1",class:"vxe-checkbox--label",domProps:{innerHTML:t}}):a("span",{key:"0",class:"vxe-checkbox--label"},t)]))}),e?a(e,{ref:"modal",props:{id:"VXE_EXPORT_MODAL",value:u.visible,title:getI18n(E?"vxe.export.printTitle":"vxe.export.expTitle"),width:660,minWidth:500,minHeight:400,mask:!0,lockView:!0,showFooter:!0,escClosable:!0,maskClosable:!0,showMaximize:!0,resize:!0,loading:i.loading},on:{input(e){u.visible=e},show:p.showEvent},scopedSlots:{default(){var e={$table:s,$grid:x,$gantt:d,options:c,columns:I,params:c.params},t="empty"===c.mode;return a("div",{class:"vxe-table-export--panel"},[V?a("div",{class:"vxe-table-export--panel-top"},s.callSlot(V,e,a)):renderEmptyElement(s),a("div",{class:"vxe-table-export--panel-body"},D?s.callSlot(D,e,a):[a("table",{attrs:{class:"vxe-table-export--panel-table",cellspacing:0,cellpadding:0,border:0}},[a("tbody",[[E?renderEmptyElement(s):a("tr",[a("td",getI18n("vxe.export.expName")),a("td",[o?a(o,{ref:"filename",props:{value:c.filename,type:"text",clearable:!0,placeholder:getI18n("vxe.export.expNamePlaceholder")},on:{modelValue(e){c.filename=e}}}):renderEmptyElement(s)])]),E?renderEmptyElement(s):a("tr",[a("td",getI18n("vxe.export.expType")),a("td",[a("vxe-select",{props:{value:c.type,options:u.typeList},on:{modelValue(e){c.type=e}}})])]),E||T?a("tr",[a("td",getI18n("vxe.export.expSheetName")),a("td",[o?a(o,{ref:"sheetname",props:{value:c.sheetName,type:"text",clearable:!0,placeholder:getI18n("vxe.export.expSheetNamePlaceholder")},on:{modelValue(e){c.sheetName=e}}}):renderEmptyElement(s)])]):renderEmptyElement(s),a("tr",[a("td",getI18n("vxe.export.expMode")),a("td",[a(l,{props:{value:c.mode,options:u.modeList},on:{modelValue(e){c.mode=e}}})])]),a("tr",[a("td",[getI18n("vxe.export.expColumn")]),a("td",[a("div",{class:"vxe-table-export--panel-column"},[a("ul",{class:"vxe-table-export--panel-column-header"},[a("li",{class:["vxe-table-export--panel-column-option",{"is--checked":v,"is--indeterminate":m}],attrs:{title:getI18n("vxe.table.allTitle")},on:{click:p.allColumnEvent}},[a("span",{class:["vxe-checkbox--icon",m?getIcon().TABLE_CHECKBOX_INDETERMINATE:v?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]}),a("span",{class:"vxe-checkbox--label"},getI18n("vxe.export.expCurrentColumn"))])]),a("ul",{class:"vxe-table-export--panel-column-body"},k)])])]),E?a("tr",[a("td",getI18n("vxe.export.widthMode")),a("td",[l?a(l,{props:{value:c.widthMode,options:M},on:{modelValue(e){c.widthMode=e}}}):renderEmptyElement(s)])]):renderEmptyElement(s),a("tr",[a("td",getI18n("vxe.export.expOpts")),w?a("td",[a("div",{class:"vxe-table-export--panel-option-row"},s.callSlot(w,e,a))]):a("td",[a("div",{class:"vxe-table-export--panel-option-row"},r?[a(r,{props:{value:t||f,disabled:t,title:getI18n("vxe.export.expHeaderTitle"),content:getI18n("vxe.export.expOptHeader")},on:{input(e){c.isHeader=e}}}),a(r,{props:{value:c.isFooter,disabled:!u.hasFooter,title:getI18n("vxe.export.expFooterTitle"),content:getI18n("vxe.export.expOptFooter")},on:{input(e){c.isFooter=e}}}),a(r,{props:{value:!!f&&c.isTitle,disabled:!f,title:getI18n("vxe.export.expTitleTitle"),content:getI18n("vxe.export.expOptTitle")},on:{input(e){c.isTitle=e}}}),a(r,{props:{value:!!(f&&C&&_)&&c.isColgroup,disabled:!f||!C||!_,title:getI18n("vxe.export.expColgroupTitle"),content:getI18n("vxe.export.expOptColgroup")},on:{input(e){c.isColgroup=e}}})]:[]),a("div",{class:"vxe-table-export--panel-option-row"},r?[a(r,{props:{value:!t&&c.original,disabled:t,title:getI18n("vxe.export.expOriginalTitle"),content:getI18n("vxe.export.expOptOriginal")},on:{input(e){c.original=e}}}),a(r,{props:{value:!!(b&&_&&O)&&c.isMerge,disabled:t||!b||!_||!O,title:getI18n("vxe.export.expMergeTitle"),content:getI18n("vxe.export.expOptMerge")},on:{input(e){c.isMerge=e}}}),E?renderEmptyElement(s):a(r,{props:{value:!!y&&c.useStyle,disabled:!y,title:getI18n("vxe.export.expUseStyleTitle"),content:getI18n("vxe.export.expOptUseStyle")},on:{input(e){c.useStyle=e}}})]:[]),a("div",{class:"vxe-table-export--panel-option-row"},r?[a(r,{props:{value:!!h&&c.isTreeAllExpanded,disabled:t||!h,title:getI18n("vxe.export.expTreeAllExpandTitle"),content:getI18n("vxe.export.expOptTreeAllExpand")},on:{input(e){c.isTreeAllExpanded=e}}}),a(r,{props:{value:!!g&&c.isRowGroupAllExpanded,disabled:t||!g,title:getI18n("vxe.export.expRowGroupAllExpandTitle"),content:getI18n("vxe.export.expOptRowGroupAllExpand")},on:{input(e){c.isRowGroupAllExpanded=e}}})]:[])])])]])])]),S?a("div",{class:"vxe-table-export--panel-bottom"},s.callSlot(S,e,a)):renderEmptyElement(s)])},footer(){var e={$table:s,$grid:x,$gantt:d,options:c,columns:I,params:c.params};return a("div",{class:"vxe-table-export--panel-footer"},A?s.callSlot(A,e,a):[a("div",{class:"vxe-table-export--panel-btns"},[t?a(t,{props:{content:getI18n("vxe.export.expCancel")},on:{click:p.cancelEvent}}):renderEmptyElement(s),t?a(t,{ref:"confirmBtn",props:{status:"primary",content:getI18n(E?"vxe.export.expPrint":"vxe.export.expConfirm")},on:{click:p.confirmEvent}}):renderEmptyElement(s)])])}}}):renderEmptyElement(s)}},render(e){return this.renderVN(e)}});
|
|
@@ -579,6 +579,9 @@ function hasEllipsis($xeTable, column, property, allColumnOverflow) {
|
|
|
579
579
|
}
|
|
580
580
|
return isEllipsis;
|
|
581
581
|
}
|
|
582
|
+
function getCustomColKey(conf) {
|
|
583
|
+
return `${conf.field || ''}:${conf.type || ''}`;
|
|
584
|
+
}
|
|
582
585
|
function toHtml($xeTable, opts, columns, datas) {
|
|
583
586
|
const props = $xeTable;
|
|
584
587
|
const reactData = $xeTable;
|
|
@@ -604,42 +607,113 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
604
607
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
605
608
|
const {
|
|
606
609
|
print: isPrint,
|
|
610
|
+
widthMode,
|
|
607
611
|
isHeader,
|
|
608
612
|
isFooter,
|
|
609
613
|
isColgroup,
|
|
610
614
|
isMerge,
|
|
611
615
|
colgroups,
|
|
616
|
+
_columnConfs,
|
|
612
617
|
original
|
|
613
618
|
} = opts;
|
|
614
|
-
const
|
|
615
|
-
const
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
619
|
+
const isAutoWidth = widthMode === 'auto';
|
|
620
|
+
const isScaleWidth = widthMode === 'scale';
|
|
621
|
+
const isDefaultWidth = !isAutoWidth && !isScaleWidth;
|
|
622
|
+
const customWidthMaps = {};
|
|
623
|
+
if (_columnConfs) {
|
|
624
|
+
_columnConfs.forEach(conf => {
|
|
625
|
+
if (!(0, _util.isColumnInfo)(conf)) {
|
|
626
|
+
if ((conf.field || conf.type) && conf.width) {
|
|
627
|
+
customWidthMaps[getCustomColKey(conf)] = conf.width;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
// 计算宽度
|
|
633
|
+
const colWidthMaps = {};
|
|
634
|
+
const printWidthMaps = {};
|
|
635
|
+
if (isPrint) {
|
|
636
|
+
let tableWidth = 0;
|
|
637
|
+
columns.forEach(column => {
|
|
638
|
+
tableWidth += column.renderWidth;
|
|
639
|
+
});
|
|
640
|
+
if (colgroups) {
|
|
620
641
|
colgroups.forEach(cols => {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
642
|
+
cols.forEach(column => {
|
|
643
|
+
if (!column.childNodes || !column.childNodes.length) {
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
625
646
|
let childWidth = 0;
|
|
626
647
|
let countChild = 0;
|
|
627
648
|
_xeUtils.default.eachTree([column], item => {
|
|
628
649
|
if (!item.childNodes || !column.childNodes.length) {
|
|
629
650
|
countChild++;
|
|
630
651
|
}
|
|
631
|
-
|
|
652
|
+
const ptWidth = printWidthMaps[item.id];
|
|
653
|
+
childWidth += ptWidth || 0;
|
|
632
654
|
}, {
|
|
633
655
|
children: 'childNodes'
|
|
634
656
|
});
|
|
635
|
-
const
|
|
657
|
+
const colWidth = childWidth - countChild;
|
|
658
|
+
colWidthMaps[column.id] = colWidth;
|
|
659
|
+
printWidthMaps[column.id] = _xeUtils.default.floor(colWidth / tableWidth * 180, 2);
|
|
660
|
+
});
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
columns.forEach(column => {
|
|
664
|
+
const colWidth = column.renderWidth;
|
|
665
|
+
if (column.width) {
|
|
666
|
+
colWidthMaps[column.id] = colWidth;
|
|
667
|
+
}
|
|
668
|
+
printWidthMaps[column.id] = _xeUtils.default.floor(colWidth / tableWidth * 180, 2);
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
const getHeaderWidthStyle = column => {
|
|
672
|
+
const cmColKey = getCustomColKey(column);
|
|
673
|
+
const cmWidthMaps = customWidthMaps[cmColKey];
|
|
674
|
+
if (cmWidthMaps) {
|
|
675
|
+
return 'width:' + (0, _dom.toCssUnit)(cmWidthMaps);
|
|
676
|
+
}
|
|
677
|
+
if (isAutoWidth) {
|
|
678
|
+
return '';
|
|
679
|
+
}
|
|
680
|
+
if (isScaleWidth) {
|
|
681
|
+
return printWidthMaps[column.id] ? 'width:' + printWidthMaps[column.id] + 'mm' : '';
|
|
682
|
+
}
|
|
683
|
+
return colWidthMaps[column.id] ? 'width:' + (0, _dom.toCssUnit)(colWidthMaps[column.id]) : '';
|
|
684
|
+
};
|
|
685
|
+
const getCellWidthStyle = column => {
|
|
686
|
+
const cmColKey = getCustomColKey(column);
|
|
687
|
+
const cmWidthMaps = customWidthMaps[cmColKey];
|
|
688
|
+
if (cmWidthMaps) {
|
|
689
|
+
return 'width:' + (0, _dom.toCssUnit)(cmWidthMaps);
|
|
690
|
+
}
|
|
691
|
+
if (isAutoWidth || isDefaultWidth) {
|
|
692
|
+
return '';
|
|
693
|
+
}
|
|
694
|
+
if (isScaleWidth) {
|
|
695
|
+
return printWidthMaps[column.id] ? 'width:' + printWidthMaps[column.id] + 'mm' : '';
|
|
696
|
+
}
|
|
697
|
+
return colWidthMaps[column.id] ? 'width:' + (0, _dom.toCssUnit)(colWidthMaps[column.id]) : '';
|
|
698
|
+
};
|
|
699
|
+
const allCls = 'check-all';
|
|
700
|
+
const clss = ['vxe-table', `border--${toTableBorder(border)}`, isPrint ? 'is--print' : '', isAutoWidth ? 'is--auto-width' : '', isScaleWidth ? 'is--scale-width' : '', isDefaultWidth ? 'is--default-width' : '', isHeader ? 'is--header' : ''].filter(cls => cls);
|
|
701
|
+
const tables = [`<table class="${clss.join(' ')}" border="0" cellspacing="0" cellpadding="0">`, `<colgroup>${columns.map(column => `<col style="${getHeaderWidthStyle(column)}">`).join('')}</colgroup>`];
|
|
702
|
+
if (isHeader) {
|
|
703
|
+
tables.push('<thead>');
|
|
704
|
+
if (isColgroup && !original) {
|
|
705
|
+
colgroups.forEach(cols => {
|
|
706
|
+
tables.push(`<tr>${cols.map(column => {
|
|
707
|
+
const headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
|
|
708
|
+
const classNames = hasEllipsis($xeTable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
|
|
709
|
+
const cellTitle = getHeaderTitle($xeTable, opts, column);
|
|
636
710
|
if (headAlign) {
|
|
637
711
|
classNames.push(`col--${headAlign}`);
|
|
638
712
|
}
|
|
639
713
|
if (column.type === 'checkbox') {
|
|
640
|
-
return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}"><div
|
|
714
|
+
return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" class="${allCls}" ${isAllSelected ? 'checked' : ''}><span>${cellTitle}</span></div></th>`;
|
|
641
715
|
}
|
|
642
|
-
return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}" title="${cellTitle}"><div
|
|
716
|
+
return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}" title="${cellTitle}"><div style="${getCellWidthStyle(column)}"><span>${(0, _utils.formatText)(cellTitle, true)}</span></div></th>`;
|
|
643
717
|
}).join('')}</tr>`);
|
|
644
718
|
});
|
|
645
719
|
} else {
|
|
@@ -651,9 +725,9 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
651
725
|
classNames.push(`col--${headAlign}`);
|
|
652
726
|
}
|
|
653
727
|
if (column.type === 'checkbox') {
|
|
654
|
-
return `<th class="${classNames.join(' ')}"><div
|
|
728
|
+
return `<th class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" class="${allCls}" ${isAllSelected ? 'checked' : ''}><span>${cellTitle}</span></div></th>`;
|
|
655
729
|
}
|
|
656
|
-
return `<th class="${classNames.join(' ')}" title="${cellTitle}"><div
|
|
730
|
+
return `<th class="${classNames.join(' ')}" title="${cellTitle}"><div style="${getCellWidthStyle(column)}"><span>${(0, _utils.formatText)(cellTitle, true)}</span></div></th>`;
|
|
657
731
|
}).join('')}</tr>`);
|
|
658
732
|
}
|
|
659
733
|
tables.push('</thead>');
|
|
@@ -676,18 +750,18 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
676
750
|
}
|
|
677
751
|
classNames.push('vxe-table--tree-node');
|
|
678
752
|
if (column.type === 'radio') {
|
|
679
|
-
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div
|
|
753
|
+
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell"><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></div></div></td>`;
|
|
680
754
|
} else if (column.type === 'checkbox') {
|
|
681
|
-
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div
|
|
755
|
+
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></div></div></td>`;
|
|
682
756
|
}
|
|
683
|
-
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div
|
|
757
|
+
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell">${cellValue}</div></div></div></td>`;
|
|
684
758
|
}
|
|
685
759
|
if (column.type === 'radio') {
|
|
686
|
-
return `<td class="${classNames.join(' ')}"><div
|
|
760
|
+
return `<td class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></td>`;
|
|
687
761
|
} else if (column.type === 'checkbox') {
|
|
688
|
-
return `<td class="${classNames.join(' ')}"><div
|
|
762
|
+
return `<td class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></td>`;
|
|
689
763
|
}
|
|
690
|
-
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div
|
|
764
|
+
return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${(0, _utils.formatText)(cellValue, true)}</div></td>`;
|
|
691
765
|
}).join('') + '</tr>');
|
|
692
766
|
});
|
|
693
767
|
} else {
|
|
@@ -723,11 +797,11 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
723
797
|
classNames.push(`col--${cellAlign}`);
|
|
724
798
|
}
|
|
725
799
|
if (column.type === 'radio') {
|
|
726
|
-
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div
|
|
800
|
+
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div style="${getCellWidthStyle(column)}"><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></td>`;
|
|
727
801
|
} else if (column.type === 'checkbox') {
|
|
728
|
-
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div
|
|
802
|
+
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></td>`;
|
|
729
803
|
}
|
|
730
|
-
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div
|
|
804
|
+
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${(0, _utils.formatText)(cellValue, true)}</div></td>`;
|
|
731
805
|
}).join('') + '</tr>');
|
|
732
806
|
});
|
|
733
807
|
}
|
|
@@ -770,7 +844,7 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
770
844
|
if (footAlign) {
|
|
771
845
|
classNames.push(`col--${footAlign}`);
|
|
772
846
|
}
|
|
773
|
-
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div
|
|
847
|
+
return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${(0, _utils.formatText)(cellValue, true)}</div></td>`;
|
|
774
848
|
}).join('')}</tr>`);
|
|
775
849
|
});
|
|
776
850
|
tables.push('</tfoot>');
|
|
@@ -779,7 +853,7 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
779
853
|
// 是否半选状态
|
|
780
854
|
const script = !isAllSelected && isIndeterminate ? `<script>(function(){var a=document.querySelector(".${allCls}");if(a){a.indeterminate=true}})()</script>` : '';
|
|
781
855
|
tables.push('</table>', script);
|
|
782
|
-
return
|
|
856
|
+
return isAutoWidth ? tables.join('') : (0, _util2.createHtmlPage)(opts, tables.join(''));
|
|
783
857
|
}
|
|
784
858
|
function toXML($xeTable, opts, columns, datas) {
|
|
785
859
|
const reactData = $xeTable;
|
|
@@ -1460,6 +1534,9 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
1460
1534
|
if (!typeList.some(item => item.value === type)) {
|
|
1461
1535
|
exportParams.type = typeList[0].value;
|
|
1462
1536
|
}
|
|
1537
|
+
if (!exportParams.widthMode) {
|
|
1538
|
+
exportParams.widthMode = '';
|
|
1539
|
+
}
|
|
1463
1540
|
initStore.export = true;
|
|
1464
1541
|
return $xeTable.$nextTick();
|
|
1465
1542
|
}
|
|
@@ -1623,7 +1700,8 @@ var _default = exports.default = {
|
|
|
1623
1700
|
}
|
|
1624
1701
|
const handleOptions = Object.assign({}, opts, {
|
|
1625
1702
|
filename: '',
|
|
1626
|
-
sheetName: ''
|
|
1703
|
+
sheetName: '',
|
|
1704
|
+
_columnConfs: columns
|
|
1627
1705
|
});
|
|
1628
1706
|
// 如果设置源数据,则默认导出设置了字段的列
|
|
1629
1707
|
if (!isCustomCol && !columnFilterMethod) {
|