vxe-table 3.13.17 → 3.13.19
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/grid/src/grid.js +42 -72
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +25 -27
- package/es/table/module/edit/mixin.js +3 -5
- package/es/table/module/export/export-panel.js +22 -24
- package/es/table/module/export/import-panel.js +14 -16
- package/es/table/module/export/mixin.js +15 -31
- package/es/table/module/validator/mixin.js +1 -3
- package/es/table/render/index.js +90 -61
- package/es/table/src/columnInfo.js +30 -32
- package/es/table/src/methods.js +141 -80
- package/es/table/src/table.js +16 -18
- package/es/table/src/util.js +5 -7
- package/es/toolbar/src/toolbar.js +18 -26
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +42 -72
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +447 -411
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +31 -33
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +3 -5
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +22 -24
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +14 -16
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +15 -31
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +1 -3
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +98 -66
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/columnInfo.js +32 -34
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +148 -78
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +13 -15
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +4 -6
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +18 -26
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +1 -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/grid/src/grid.ts +42 -72
- package/packages/table/module/custom/panel.ts +25 -27
- package/packages/table/module/edit/mixin.ts +3 -5
- package/packages/table/module/export/export-panel.ts +22 -24
- package/packages/table/module/export/import-panel.ts +14 -16
- package/packages/table/module/export/mixin.ts +15 -31
- package/packages/table/module/validator/mixin.ts +1 -3
- package/packages/table/render/index.ts +89 -59
- package/packages/table/src/columnInfo.ts +30 -32
- package/packages/table/src/methods.ts +143 -78
- package/packages/table/src/table.ts +13 -15
- package/packages/table/src/util.ts +4 -6
- package/packages/toolbar/src/toolbar.ts +18 -26
- /package/es/{iconfont.1741051533862.ttf → iconfont.1741224103306.ttf} +0 -0
- /package/es/{iconfont.1741051533862.woff → iconfont.1741224103306.woff} +0 -0
- /package/es/{iconfont.1741051533862.woff2 → iconfont.1741224103306.woff2} +0 -0
- /package/lib/{iconfont.1741051533862.ttf → iconfont.1741224103306.ttf} +0 -0
- /package/lib/{iconfont.1741051533862.woff → iconfont.1741224103306.woff} +0 -0
- /package/lib/{iconfont.1741051533862.woff2 → iconfont.1741224103306.woff2} +0 -0
|
@@ -157,11 +157,9 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
157
157
|
const parentLevel = parentRest ? parentRest.level : 0;
|
|
158
158
|
newRecords.forEach((item, i) => {
|
|
159
159
|
const rowid = getRowid($xeTable, item);
|
|
160
|
-
if (
|
|
161
|
-
if (item[treeOpts.parentField]) {
|
|
162
|
-
|
|
163
|
-
errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`]);
|
|
164
|
-
}
|
|
160
|
+
if (item[treeOpts.parentField]) {
|
|
161
|
+
if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
|
|
162
|
+
errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`]);
|
|
165
163
|
}
|
|
166
164
|
}
|
|
167
165
|
if (parentRow) {
|
|
@@ -53,30 +53,28 @@ export default {
|
|
|
53
53
|
},
|
|
54
54
|
created() {
|
|
55
55
|
const $xeTableExportPanel = this;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
});
|
|
79
|
-
}
|
|
56
|
+
const VxeUIModalComponent = VxeUI.getComponent('VxeModal');
|
|
57
|
+
const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
|
|
58
|
+
const VxeUISelectComponent = VxeUI.getComponent('VxeSelect');
|
|
59
|
+
const VxeUIInputComponent = VxeUI.getComponent('VxeInput');
|
|
60
|
+
const VxeUICheckboxComponent = VxeUI.getComponent('VxeCheckbox');
|
|
61
|
+
$xeTableExportPanel.$nextTick(() => {
|
|
62
|
+
if (!VxeUIModalComponent) {
|
|
63
|
+
errLog('vxe.error.reqComp', ['vxe-modal']);
|
|
64
|
+
}
|
|
65
|
+
if (!VxeUIButtonComponent) {
|
|
66
|
+
errLog('vxe.error.reqComp', ['vxe-button']);
|
|
67
|
+
}
|
|
68
|
+
if (!VxeUISelectComponent) {
|
|
69
|
+
errLog('vxe.error.reqComp', ['vxe-select']);
|
|
70
|
+
}
|
|
71
|
+
if (!VxeUIInputComponent) {
|
|
72
|
+
errLog('vxe.error.reqComp', ['vxe-input']);
|
|
73
|
+
}
|
|
74
|
+
if (!VxeUICheckboxComponent) {
|
|
75
|
+
errLog('vxe.error.reqComp', ['vxe-checkbox']);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
80
78
|
},
|
|
81
79
|
render(h) {
|
|
82
80
|
const $xeTable = this.$xeTable;
|
|
@@ -45,22 +45,20 @@ export default {
|
|
|
45
45
|
},
|
|
46
46
|
created() {
|
|
47
47
|
const $xeTableImportPanel = this;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
}
|
|
48
|
+
const VxeUIModalComponent = VxeUI.getComponent('VxeModal');
|
|
49
|
+
const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
|
|
50
|
+
const VxeUISelectComponent = VxeUI.getComponent('VxeSelect');
|
|
51
|
+
$xeTableImportPanel.$nextTick(() => {
|
|
52
|
+
if (!VxeUIModalComponent) {
|
|
53
|
+
errLog('vxe.error.reqComp', ['vxe-modal']);
|
|
54
|
+
}
|
|
55
|
+
if (!VxeUIButtonComponent) {
|
|
56
|
+
errLog('vxe.error.reqComp', ['vxe-button']);
|
|
57
|
+
}
|
|
58
|
+
if (!VxeUISelectComponent) {
|
|
59
|
+
errLog('vxe.error.reqComp', ['vxe-select']);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
64
62
|
},
|
|
65
63
|
render(h) {
|
|
66
64
|
const $xeTable = this.$xeTable;
|
|
@@ -568,10 +568,8 @@ function downloadFile($xetable, opts, content) {
|
|
|
568
568
|
saveLocalFile({ filename, type, content }).then(() => {
|
|
569
569
|
if (opts.message !== false) {
|
|
570
570
|
// 检测弹窗模块
|
|
571
|
-
if (
|
|
572
|
-
|
|
573
|
-
errLog('vxe.error.reqModule', ['Modal']);
|
|
574
|
-
}
|
|
571
|
+
if (!VxeUI.modal) {
|
|
572
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
575
573
|
}
|
|
576
574
|
VxeUI.modal.message({ content: getI18n('vxe.table.expSuccess'), status: 'success' });
|
|
577
575
|
}
|
|
@@ -800,10 +798,8 @@ function handleImport($xeTable, content, opts) {
|
|
|
800
798
|
}
|
|
801
799
|
if (opts.message !== false) {
|
|
802
800
|
// 检测弹窗模块
|
|
803
|
-
if (
|
|
804
|
-
|
|
805
|
-
errLog('vxe.error.reqModule', ['Modal']);
|
|
806
|
-
}
|
|
801
|
+
if (!VxeUI.modal) {
|
|
802
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
807
803
|
}
|
|
808
804
|
VxeUI.modal.message({ content: getI18n('vxe.table.impSuccess', [rows.length]), status: 'success' });
|
|
809
805
|
}
|
|
@@ -816,10 +812,8 @@ function handleImport($xeTable, content, opts) {
|
|
|
816
812
|
}
|
|
817
813
|
else if (opts.message !== false) {
|
|
818
814
|
// 检测弹窗模块
|
|
819
|
-
if (
|
|
820
|
-
|
|
821
|
-
errLog('vxe.error.reqModule', ['Modal']);
|
|
822
|
-
}
|
|
815
|
+
if (!VxeUI.modal) {
|
|
816
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
823
817
|
}
|
|
824
818
|
VxeUI.modal.message({ content: getI18n('vxe.error.impFields'), status: 'error' });
|
|
825
819
|
if (_importReject) {
|
|
@@ -835,10 +829,8 @@ function handleFileImport($xetable, file, opts) {
|
|
|
835
829
|
if (!importMethod && !XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)) {
|
|
836
830
|
if (opts.message !== false) {
|
|
837
831
|
// 检测弹窗模块
|
|
838
|
-
if (
|
|
839
|
-
|
|
840
|
-
errLog('vxe.error.reqModule', ['Modal']);
|
|
841
|
-
}
|
|
832
|
+
if (!VxeUI.modal) {
|
|
833
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
842
834
|
}
|
|
843
835
|
VxeUI.modal.message({ content: getI18n('vxe.error.notType', [type]), status: 'error' });
|
|
844
836
|
}
|
|
@@ -888,9 +880,7 @@ function handleFileImport($xetable, file, opts) {
|
|
|
888
880
|
}
|
|
889
881
|
else {
|
|
890
882
|
// 不支持的浏览器
|
|
891
|
-
|
|
892
|
-
errLog('vxe.error.notExp');
|
|
893
|
-
}
|
|
883
|
+
errLog('vxe.error.notExp');
|
|
894
884
|
_importResolve({ status: true });
|
|
895
885
|
}
|
|
896
886
|
});
|
|
@@ -950,10 +940,8 @@ export function readLocalFile(options = {}) {
|
|
|
950
940
|
else {
|
|
951
941
|
if (options.message !== false) {
|
|
952
942
|
// 检测弹窗模块
|
|
953
|
-
if (
|
|
954
|
-
|
|
955
|
-
errLog('vxe.error.reqModule', ['Modal']);
|
|
956
|
-
}
|
|
943
|
+
if (!VxeUI.modal) {
|
|
944
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
957
945
|
}
|
|
958
946
|
VxeUI.modal.message({ content: getI18n('vxe.error.notType', [errType]), status: 'error' });
|
|
959
947
|
}
|
|
@@ -1618,20 +1606,16 @@ export default {
|
|
|
1618
1606
|
_closeExport: handleCloseExport,
|
|
1619
1607
|
_openExport(options) {
|
|
1620
1608
|
const { exportOpts } = this;
|
|
1621
|
-
if (
|
|
1622
|
-
|
|
1623
|
-
errLog('vxe.error.reqProp', ['export-config']);
|
|
1624
|
-
}
|
|
1609
|
+
if (!this.exportConfig) {
|
|
1610
|
+
errLog('vxe.error.reqProp', ['export-config']);
|
|
1625
1611
|
}
|
|
1626
1612
|
return handleExportAndPrint(this, Object.assign({}, exportOpts, options));
|
|
1627
1613
|
},
|
|
1628
1614
|
_closePrint: handleCloseExport,
|
|
1629
1615
|
_openPrint(options) {
|
|
1630
1616
|
const { printOpts } = this;
|
|
1631
|
-
if (
|
|
1632
|
-
|
|
1633
|
-
errLog('vxe.error.reqProp', ['print-config']);
|
|
1634
|
-
}
|
|
1617
|
+
if (!this.printConfig) {
|
|
1618
|
+
errLog('vxe.error.reqProp', ['print-config']);
|
|
1635
1619
|
}
|
|
1636
1620
|
return handleExportAndPrint(this, Object.assign({}, printOpts, options), true);
|
|
1637
1621
|
}
|
package/es/table/render/index.js
CHANGED
|
@@ -151,10 +151,8 @@ function getComponentOns(renderOpts, params, eFns) {
|
|
|
151
151
|
const ons = {};
|
|
152
152
|
XEUtils.objectEach(events, (func, key) => {
|
|
153
153
|
ons[getOnName(key)] = function (...args) {
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
errLog('vxe.error.errFunc', [func]);
|
|
157
|
-
}
|
|
154
|
+
if (!XEUtils.isFunction(func)) {
|
|
155
|
+
errLog('vxe.error.errFunc', [func]);
|
|
158
156
|
}
|
|
159
157
|
func(params, ...args);
|
|
160
158
|
};
|
|
@@ -558,6 +556,63 @@ function handleExportTreeSelectMethod(params) {
|
|
|
558
556
|
const { row, column, options } = params;
|
|
559
557
|
return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
|
|
560
558
|
}
|
|
559
|
+
function handleNumberCell(h, renderOpts, params) {
|
|
560
|
+
const { props = {}, showNegativeStatus } = renderOpts;
|
|
561
|
+
const { row, column } = params;
|
|
562
|
+
const { type } = props;
|
|
563
|
+
let cellValue = XEUtils.get(row, column.field);
|
|
564
|
+
let isNegative = false;
|
|
565
|
+
if (!isEmptyValue(cellValue)) {
|
|
566
|
+
const numberInputConfig = getConfig().numberInput || {};
|
|
567
|
+
if (type === 'float') {
|
|
568
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
569
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
570
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
571
|
+
if (!autoFill) {
|
|
572
|
+
cellValue = XEUtils.toNumber(cellValue);
|
|
573
|
+
}
|
|
574
|
+
if (showNegativeStatus) {
|
|
575
|
+
if (cellValue < 0) {
|
|
576
|
+
isNegative = true;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
else if (type === 'amount') {
|
|
581
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
582
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
583
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
584
|
+
cellValue = XEUtils.toNumber(cellValue);
|
|
585
|
+
if (showNegativeStatus) {
|
|
586
|
+
if (cellValue < 0) {
|
|
587
|
+
isNegative = true;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
cellValue = XEUtils.commafy(cellValue, { digits });
|
|
591
|
+
if (!autoFill) {
|
|
592
|
+
const [iStr, dStr] = cellValue.split('.');
|
|
593
|
+
if (dStr) {
|
|
594
|
+
const dRest = dStr.replace(/0+$/, '');
|
|
595
|
+
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
if (showCurrency) {
|
|
599
|
+
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
else {
|
|
603
|
+
if (showNegativeStatus) {
|
|
604
|
+
if (XEUtils.toNumber(cellValue) < 0) {
|
|
605
|
+
isNegative = true;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative
|
|
611
|
+
? {
|
|
612
|
+
class: 'is--negative'
|
|
613
|
+
}
|
|
614
|
+
: {});
|
|
615
|
+
}
|
|
561
616
|
/**
|
|
562
617
|
* 表格 - 渲染器
|
|
563
618
|
*/
|
|
@@ -622,66 +677,19 @@ renderer.mixin({
|
|
|
622
677
|
renderTableFilter: defaultFilterRender,
|
|
623
678
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
624
679
|
},
|
|
680
|
+
FormatNumberInput: {
|
|
681
|
+
renderTableDefault: handleNumberCell,
|
|
682
|
+
tableFilterDefaultMethod: handleInputFilterMethod,
|
|
683
|
+
tableExportMethod(params) {
|
|
684
|
+
const { row, column } = params;
|
|
685
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
686
|
+
return cellValue;
|
|
687
|
+
}
|
|
688
|
+
},
|
|
625
689
|
VxeNumberInput: {
|
|
626
690
|
tableAutoFocus: 'input',
|
|
627
691
|
renderTableEdit: defaultEditRender,
|
|
628
|
-
renderTableCell
|
|
629
|
-
const { props = {}, showNegativeStatus } = renderOpts;
|
|
630
|
-
const { row, column } = params;
|
|
631
|
-
const { type } = props;
|
|
632
|
-
let cellValue = XEUtils.get(row, column.field);
|
|
633
|
-
let isNegative = false;
|
|
634
|
-
if (!isEmptyValue(cellValue)) {
|
|
635
|
-
const numberInputConfig = getConfig().numberInput || {};
|
|
636
|
-
if (type === 'float') {
|
|
637
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
638
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
639
|
-
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
640
|
-
if (!autoFill) {
|
|
641
|
-
cellValue = XEUtils.toNumber(cellValue);
|
|
642
|
-
}
|
|
643
|
-
if (showNegativeStatus) {
|
|
644
|
-
if (cellValue < 0) {
|
|
645
|
-
isNegative = true;
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
else if (type === 'amount') {
|
|
650
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
651
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
652
|
-
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
653
|
-
cellValue = XEUtils.toNumber(cellValue);
|
|
654
|
-
if (showNegativeStatus) {
|
|
655
|
-
if (cellValue < 0) {
|
|
656
|
-
isNegative = true;
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
cellValue = XEUtils.commafy(cellValue, { digits });
|
|
660
|
-
if (!autoFill) {
|
|
661
|
-
const [iStr, dStr] = cellValue.split('.');
|
|
662
|
-
if (dStr) {
|
|
663
|
-
const dRest = dStr.replace(/0+$/, '');
|
|
664
|
-
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
if (showCurrency) {
|
|
668
|
-
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
else {
|
|
672
|
-
if (showNegativeStatus) {
|
|
673
|
-
if (XEUtils.toNumber(cellValue) < 0) {
|
|
674
|
-
isNegative = true;
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative
|
|
680
|
-
? {
|
|
681
|
-
class: 'is--negative'
|
|
682
|
-
}
|
|
683
|
-
: {});
|
|
684
|
-
},
|
|
692
|
+
renderTableCell: handleNumberCell,
|
|
685
693
|
renderTableFooter(h, renderOpts, params) {
|
|
686
694
|
const { props = {} } = renderOpts;
|
|
687
695
|
const { row, column, _columnIndex } = params;
|
|
@@ -786,11 +794,22 @@ renderer.mixin({
|
|
|
786
794
|
tableFilterDefaultMethod: handleFilterMethod,
|
|
787
795
|
tableExportMethod: handleExportSelectMethod
|
|
788
796
|
},
|
|
797
|
+
/**
|
|
798
|
+
* 已废弃,被 FormatSelect 替换
|
|
799
|
+
* @deprecated
|
|
800
|
+
*/
|
|
789
801
|
formatOption: {
|
|
790
802
|
renderTableDefault(h, renderOpts, params) {
|
|
791
803
|
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
792
804
|
}
|
|
793
805
|
},
|
|
806
|
+
FormatSelect: {
|
|
807
|
+
renderTableDefault(h, renderOpts, params) {
|
|
808
|
+
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
809
|
+
},
|
|
810
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
811
|
+
tableExportMethod: handleExportSelectMethod
|
|
812
|
+
},
|
|
794
813
|
VxeTreeSelect: {
|
|
795
814
|
tableAutoFocus: 'input',
|
|
796
815
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
@@ -807,11 +826,21 @@ renderer.mixin({
|
|
|
807
826
|
},
|
|
808
827
|
tableExportMethod: handleExportTreeSelectMethod
|
|
809
828
|
},
|
|
829
|
+
/**
|
|
830
|
+
* 已废弃,被 FormatTreeSelect 替换
|
|
831
|
+
* @deprecated
|
|
832
|
+
*/
|
|
810
833
|
formatTree: {
|
|
811
834
|
renderTableDefault(h, renderOpts, params) {
|
|
812
835
|
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
813
836
|
}
|
|
814
837
|
},
|
|
838
|
+
FormatTreeSelect: {
|
|
839
|
+
renderTableDefault(h, renderOpts, params) {
|
|
840
|
+
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
841
|
+
},
|
|
842
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
843
|
+
},
|
|
815
844
|
VxeColorPicker: {
|
|
816
845
|
tableAutoFocus: 'input',
|
|
817
846
|
renderTableEdit(h, renderOpts, params) {
|
|
@@ -12,41 +12,39 @@ export class ColumnInfo {
|
|
|
12
12
|
const formatter = _vm.formatter;
|
|
13
13
|
const visible = XEUtils.isBoolean(_vm.visible) ? _vm.visible : true;
|
|
14
14
|
const tableProps = $xetable;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
const types = ['seq', 'checkbox', 'radio', 'expand', 'html'];
|
|
16
|
+
if (_vm.type && types.indexOf(_vm.type) === -1) {
|
|
17
|
+
warnLog('vxe.error.errProp', [`type=${_vm.type}`, types.join(', ')]);
|
|
18
|
+
}
|
|
19
|
+
if (XEUtils.isBoolean(_vm.cellRender) || (_vm.cellRender && !XEUtils.isObject(_vm.cellRender))) {
|
|
20
|
+
warnLog('vxe.error.errProp', [`column.cell-render=${_vm.cellRender}`, 'column.cell-render={}']);
|
|
21
|
+
}
|
|
22
|
+
if (XEUtils.isBoolean(_vm.editRender) || (_vm.editRender && !XEUtils.isObject(_vm.editRender))) {
|
|
23
|
+
warnLog('vxe.error.errProp', [`column.edit-render=${_vm.editRender}`, 'column.edit-render={}']);
|
|
24
|
+
}
|
|
25
|
+
if (_vm.type === 'expand') {
|
|
26
|
+
const { treeConfig } = tableProps;
|
|
27
|
+
if (treeConfig && ($xetable.treeOpts.showLine || $xetable.treeOpts.line)) {
|
|
28
|
+
errLog('vxe.error.errConflicts', ['tree-config.line', 'column.type=expand']);
|
|
25
29
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
}
|
|
31
|
+
if (_vm.remoteSort) {
|
|
32
|
+
warnLog('vxe.error.delProp', ['column.remote-sort', 'sort-config.remote']);
|
|
33
|
+
}
|
|
34
|
+
if (_vm.sortMethod) {
|
|
35
|
+
warnLog('vxe.error.delProp', ['column.sort-method', 'sort-config.sortMethod']);
|
|
36
|
+
}
|
|
37
|
+
if (formatter) {
|
|
38
|
+
if (XEUtils.isString(formatter)) {
|
|
39
|
+
const gFormatOpts = formats.get(formatter) || XEUtils[formatter];
|
|
40
|
+
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
41
|
+
errLog('vxe.error.notFormats', [formatter]);
|
|
30
42
|
}
|
|
31
43
|
}
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
warnLog('vxe.error.delProp', ['column.sort-method', 'sort-config.sortMethod']);
|
|
37
|
-
}
|
|
38
|
-
if (formatter) {
|
|
39
|
-
if (XEUtils.isString(formatter)) {
|
|
40
|
-
const gFormatOpts = formats.get(formatter) || XEUtils[formatter];
|
|
41
|
-
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
42
|
-
errLog('vxe.error.notFormats', [formatter]);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
else if (XEUtils.isArray(formatter)) {
|
|
46
|
-
const gFormatOpts = formats.get(formatter[0]) || XEUtils[formatter[0]];
|
|
47
|
-
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
48
|
-
errLog('vxe.error.notFormats', [formatter[0]]);
|
|
49
|
-
}
|
|
44
|
+
else if (XEUtils.isArray(formatter)) {
|
|
45
|
+
const gFormatOpts = formats.get(formatter[0]) || XEUtils[formatter[0]];
|
|
46
|
+
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
47
|
+
errLog('vxe.error.notFormats', [formatter[0]]);
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
}
|