vxe-table 4.1.0 → 4.1.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/README.md +1 -0
- package/README.zh-TW.md +1 -0
- package/es/edit/src/hook.js +2 -2
- package/es/export/src/hook.js +24 -0
- package/es/export/src/util.js +20 -8
- package/es/footer/src/footer.js +4 -4
- package/es/form/src/form.js +13 -6
- package/es/form/src/render.js +4 -4
- package/es/grid/src/grid.js +48 -1
- package/es/header/src/header.js +7 -5
- package/es/select/src/select.js +5 -5
- package/es/table/src/body.js +18 -14
- package/es/table/src/cell.js +70 -54
- package/es/table/src/props.js +4 -1
- package/es/table/src/table.js +208 -97
- package/es/v-x-e-table/src/conf.js +2 -3
- package/es/validator/src/hook.js +12 -5
- package/helper/vetur/attributes.json +16 -8
- package/helper/vetur/tags.json +2 -0
- package/lib/edit/src/hook.js +2 -2
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/export/src/hook.js +28 -0
- package/lib/export/src/hook.min.js +1 -1
- package/lib/export/src/util.js +21 -7
- package/lib/export/src/util.min.js +1 -1
- package/lib/footer/src/footer.js +4 -4
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/src/form.js +23 -6
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +4 -4
- package/lib/form/src/render.min.js +1 -1
- package/lib/grid/src/grid.js +56 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +7 -5
- package/lib/header/src/header.min.js +1 -1
- package/lib/index.umd.js +536 -220
- package/lib/index.umd.min.js +1 -1
- package/lib/select/src/select.js +5 -5
- package/lib/table/src/body.js +18 -14
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +92 -35
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/props.js +4 -1
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +265 -133
- package/lib/table/src/table.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +2 -3
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/validator/src/hook.js +12 -5
- package/lib/validator/src/hook.min.js +1 -1
- package/package.json +2 -2
- package/packages/edit/src/hook.ts +2 -2
- package/packages/export/src/hook.ts +24 -0
- package/packages/export/src/util.ts +17 -5
- package/packages/footer/src/footer.ts +4 -4
- package/packages/form/src/form.ts +10 -6
- package/packages/form/src/render.ts +4 -4
- package/packages/grid/src/grid.ts +48 -1
- package/packages/header/src/header.ts +7 -5
- package/packages/select/src/select.ts +5 -5
- package/packages/table/src/body.ts +18 -14
- package/packages/table/src/cell.ts +77 -44
- package/packages/table/src/props.ts +4 -1
- package/packages/table/src/table.ts +211 -96
- package/packages/v-x-e-table/src/conf.ts +2 -3
- package/packages/validator/src/hook.ts +9 -5
- package/types/column.d.ts +5 -1
- package/types/form-item.d.ts +5 -1
- package/types/form.d.ts +5 -1
- package/types/modal.d.ts +4 -5
- package/types/table.d.ts +49 -14
- package/types/validator.d.ts +5 -1
package/README.md
CHANGED
package/README.zh-TW.md
CHANGED
package/es/edit/src/hook.js
CHANGED
|
@@ -141,7 +141,7 @@ var editHook = {
|
|
|
141
141
|
(_a = editStore.insertList).unshift.apply(_a, newRecords);
|
|
142
142
|
reactData.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
|
|
143
143
|
$xetable.updateFooter();
|
|
144
|
-
$xetable.
|
|
144
|
+
$xetable.cacheRowMap();
|
|
145
145
|
$xetable.handleTableData();
|
|
146
146
|
$xetable.updateAfterDataIndex();
|
|
147
147
|
$xetable.checkSelectionStatus();
|
|
@@ -237,7 +237,7 @@ var editHook = {
|
|
|
237
237
|
});
|
|
238
238
|
reactData.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length;
|
|
239
239
|
$xetable.updateFooter();
|
|
240
|
-
$xetable.
|
|
240
|
+
$xetable.cacheRowMap();
|
|
241
241
|
$xetable.handleTableData();
|
|
242
242
|
$xetable.updateAfterDataIndex();
|
|
243
243
|
$xetable.checkSelectionStatus();
|
package/es/export/src/hook.js
CHANGED
|
@@ -688,6 +688,12 @@ var tableExportHook = {
|
|
|
688
688
|
}
|
|
689
689
|
saveLocalFile({ filename: filename, type: type, content: content }).then(function () {
|
|
690
690
|
if (opts.message !== false) {
|
|
691
|
+
// 检测弹窗模块
|
|
692
|
+
if (process.env.NODE_ENV === 'development') {
|
|
693
|
+
if (!VXETable.modal) {
|
|
694
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
691
697
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.table.expSuccess'), status: 'success' });
|
|
692
698
|
}
|
|
693
699
|
});
|
|
@@ -754,6 +760,12 @@ var tableExportHook = {
|
|
|
754
760
|
loadRest = $xetable.reloadData(data);
|
|
755
761
|
}
|
|
756
762
|
if (opts.message !== false) {
|
|
763
|
+
// 检测弹窗模块
|
|
764
|
+
if (process.env.NODE_ENV === 'development') {
|
|
765
|
+
if (!VXETable.modal) {
|
|
766
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
757
769
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.table.impSuccess', [rows.length]), status: 'success' });
|
|
758
770
|
}
|
|
759
771
|
return loadRest.then(function () {
|
|
@@ -764,6 +776,12 @@ var tableExportHook = {
|
|
|
764
776
|
});
|
|
765
777
|
}
|
|
766
778
|
else if (opts.message !== false) {
|
|
779
|
+
// 检测弹窗模块
|
|
780
|
+
if (process.env.NODE_ENV === 'development') {
|
|
781
|
+
if (!VXETable.modal) {
|
|
782
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
767
785
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.error.impFields'), status: 'error' });
|
|
768
786
|
if (_importReject) {
|
|
769
787
|
_importReject({ status: false });
|
|
@@ -776,6 +794,12 @@ var tableExportHook = {
|
|
|
776
794
|
// 检查类型,如果为自定义导出,则不需要校验类型
|
|
777
795
|
if (!importMethod && !XEUtils.includes(VXETable.config.importTypes, type)) {
|
|
778
796
|
if (opts.message !== false) {
|
|
797
|
+
// 检测弹窗模块
|
|
798
|
+
if (process.env.NODE_ENV === 'development') {
|
|
799
|
+
if (!VXETable.modal) {
|
|
800
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
779
803
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.error.notType', [type]), status: 'error' });
|
|
780
804
|
}
|
|
781
805
|
var params = { status: false };
|
package/es/export/src/util.js
CHANGED
|
@@ -2,7 +2,7 @@ import XEUtils from 'xe-utils';
|
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf';
|
|
3
3
|
import { VXETable } from '../../v-x-e-table';
|
|
4
4
|
import { browse } from '../../tools/dom';
|
|
5
|
-
import { getLog, parseFile } from '../../tools/utils';
|
|
5
|
+
import { getLog, parseFile, errLog } from '../../tools/utils';
|
|
6
6
|
// 导入
|
|
7
7
|
var fileForm;
|
|
8
8
|
var fileInput;
|
|
@@ -74,6 +74,12 @@ export var readLocalFile = function (options) {
|
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
76
|
if (opts.message !== false) {
|
|
77
|
+
// 检测弹窗模块
|
|
78
|
+
if (process.env.NODE_ENV === 'development') {
|
|
79
|
+
if (!VXETable.modal) {
|
|
80
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
77
83
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.error.notType', [errType]), status: 'error' });
|
|
78
84
|
}
|
|
79
85
|
var params = { status: false, files: files, file: file };
|
|
@@ -146,13 +152,19 @@ export var saveLocalFile = function (options) {
|
|
|
146
152
|
navigator.msSaveBlob(blob, name);
|
|
147
153
|
}
|
|
148
154
|
else {
|
|
149
|
-
var
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
var url_1 = URL.createObjectURL(blob);
|
|
156
|
+
var linkElem_1 = document.createElement('a');
|
|
157
|
+
linkElem_1.target = '_blank';
|
|
158
|
+
linkElem_1.download = name;
|
|
159
|
+
linkElem_1.href = url_1;
|
|
160
|
+
document.body.appendChild(linkElem_1);
|
|
161
|
+
linkElem_1.click();
|
|
162
|
+
requestAnimationFrame(function () {
|
|
163
|
+
if (linkElem_1.parentNode) {
|
|
164
|
+
linkElem_1.parentNode.removeChild(linkElem_1);
|
|
165
|
+
}
|
|
166
|
+
URL.revokeObjectURL(url_1);
|
|
167
|
+
});
|
|
156
168
|
}
|
|
157
169
|
return Promise.resolve();
|
|
158
170
|
}
|
package/es/footer/src/footer.js
CHANGED
|
@@ -92,11 +92,11 @@ export default defineComponent({
|
|
|
92
92
|
var fixedType = props.fixedType, fixedColumn = props.fixedColumn, tableColumn = props.tableColumn, footerTableData = props.footerTableData;
|
|
93
93
|
var footerRowClassName = tableProps.footerRowClassName, footerCellClassName = tableProps.footerCellClassName, footerRowStyle = tableProps.footerRowStyle, footerCellStyle = tableProps.footerCellStyle, allFooterAlign = tableProps.footerAlign, footerSpanMethod = tableProps.footerSpanMethod, allAlign = tableProps.align, columnKey = tableProps.columnKey, allColumnFooterOverflow = tableProps.showFooterOverflow;
|
|
94
94
|
var visibleColumn = tableInternalData.visibleColumn;
|
|
95
|
-
var
|
|
95
|
+
var scrollYLoad = tableReactData.scrollYLoad, overflowX = tableReactData.overflowX, scrollbarWidth = tableReactData.scrollbarWidth, currentColumn = tableReactData.currentColumn, mergeFooterList = tableReactData.mergeFooterList;
|
|
96
96
|
var tooltipOpts = computeTooltipOpts.value;
|
|
97
97
|
// 如果是使用优化模式
|
|
98
98
|
if (fixedType) {
|
|
99
|
-
if (
|
|
99
|
+
if (scrollYLoad || allColumnFooterOverflow) {
|
|
100
100
|
if (!mergeFooterList.length || !footerSpanMethod) {
|
|
101
101
|
tableColumn = fixedColumn;
|
|
102
102
|
}
|
|
@@ -169,8 +169,8 @@ export default defineComponent({
|
|
|
169
169
|
var _columnIndex = $xetable.getVTColumnIndex(column);
|
|
170
170
|
var itemIndex = _columnIndex;
|
|
171
171
|
var params = { $table: $xetable, _rowIndex: _rowIndex, $rowIndex: $rowIndex, column: column, columnIndex: columnIndex, $columnIndex: $columnIndex, _columnIndex: _columnIndex, itemIndex: itemIndex, items: list, fixed: fixedType, type: renderType, data: footerTableData };
|
|
172
|
-
//
|
|
173
|
-
if (
|
|
172
|
+
// 纵向虚拟滚动不支持动态行高
|
|
173
|
+
if (scrollYLoad && !hasEllipsis) {
|
|
174
174
|
showEllipsis = hasEllipsis = true;
|
|
175
175
|
}
|
|
176
176
|
if (showTitle || showTooltip || showAllTip) {
|
package/es/form/src/form.js
CHANGED
|
@@ -32,9 +32,16 @@ var Rule = /** @class */ (function () {
|
|
|
32
32
|
maxWidth: rule.maxWidth
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
+
Object.defineProperty(Rule.prototype, "content", {
|
|
36
|
+
get: function () {
|
|
37
|
+
return getFuncText(this.$options.content || this.$options.message);
|
|
38
|
+
},
|
|
39
|
+
enumerable: false,
|
|
40
|
+
configurable: true
|
|
41
|
+
});
|
|
35
42
|
Object.defineProperty(Rule.prototype, "message", {
|
|
36
43
|
get: function () {
|
|
37
|
-
return
|
|
44
|
+
return this.content;
|
|
38
45
|
},
|
|
39
46
|
enumerable: false,
|
|
40
47
|
configurable: true
|
|
@@ -76,10 +83,10 @@ export default defineComponent({
|
|
|
76
83
|
loading: Boolean,
|
|
77
84
|
data: Object,
|
|
78
85
|
size: { type: String, default: function () { return GlobalConfig.form.size || GlobalConfig.size; } },
|
|
79
|
-
span: [String, Number],
|
|
86
|
+
span: { type: [String, Number], default: function () { return GlobalConfig.form.span; } },
|
|
80
87
|
align: { type: String, default: function () { return GlobalConfig.form.align; } },
|
|
81
88
|
titleAlign: { type: String, default: function () { return GlobalConfig.form.titleAlign; } },
|
|
82
|
-
titleWidth: [String, Number],
|
|
89
|
+
titleWidth: { type: [String, Number], default: function () { return GlobalConfig.form.titleWidth; } },
|
|
83
90
|
titleColon: { type: Boolean, default: function () { return GlobalConfig.form.titleColon; } },
|
|
84
91
|
titleAsterisk: { type: Boolean, default: function () { return GlobalConfig.form.titleAsterisk; } },
|
|
85
92
|
titleOverflow: { type: [Boolean, String], default: null },
|
|
@@ -311,12 +318,12 @@ export default defineComponent({
|
|
|
311
318
|
});
|
|
312
319
|
if (customValid) {
|
|
313
320
|
if (XEUtils.isError(customValid)) {
|
|
314
|
-
errorRules.push(new Rule({ type: 'custom', trigger: trigger,
|
|
321
|
+
errorRules.push(new Rule({ type: 'custom', trigger: trigger, content: customValid.message, rule: new Rule(rule) }));
|
|
315
322
|
}
|
|
316
323
|
else if (customValid.catch) {
|
|
317
324
|
// 如果为异步校验(注:异步校验是并发无序的)
|
|
318
325
|
syncVailds.push(customValid.catch(function (e) {
|
|
319
|
-
errorRules.push(new Rule({ type: 'custom', trigger: trigger,
|
|
326
|
+
errorRules.push(new Rule({ type: 'custom', trigger: trigger, content: e ? e.message : (rule.content || rule.message), rule: new Rule(rule) }));
|
|
320
327
|
}));
|
|
321
328
|
}
|
|
322
329
|
}
|
|
@@ -558,7 +565,7 @@ export default defineComponent({
|
|
|
558
565
|
style: errRule.maxWidth ? {
|
|
559
566
|
width: errRule.maxWidth + "px"
|
|
560
567
|
} : null
|
|
561
|
-
}, errRule.
|
|
568
|
+
}, errRule.content));
|
|
562
569
|
}
|
|
563
570
|
var ons = showTooltip ? {
|
|
564
571
|
onMouseenter: function (evnt) {
|
package/es/form/src/render.js
CHANGED
|
@@ -29,9 +29,9 @@ export function renderTitle($xeform, item) {
|
|
|
29
29
|
var contVNs = [];
|
|
30
30
|
var titVNs = [];
|
|
31
31
|
if (titlePrefix) {
|
|
32
|
-
titVNs.push(titlePrefix.message
|
|
32
|
+
titVNs.push((titlePrefix.content || titlePrefix.message)
|
|
33
33
|
? h(resolveComponent('vxe-tooltip'), {
|
|
34
|
-
content: getFuncText(titlePrefix.message),
|
|
34
|
+
content: getFuncText(titlePrefix.content || titlePrefix.message),
|
|
35
35
|
enterable: titlePrefix.enterable,
|
|
36
36
|
theme: titlePrefix.theme
|
|
37
37
|
}, {
|
|
@@ -47,9 +47,9 @@ export function renderTitle($xeform, item) {
|
|
|
47
47
|
}, titVNs));
|
|
48
48
|
var fixVNs = [];
|
|
49
49
|
if (titleSuffix) {
|
|
50
|
-
fixVNs.push(titleSuffix.message
|
|
50
|
+
fixVNs.push((titleSuffix.content || titleSuffix.message)
|
|
51
51
|
? h(resolveComponent('vxe-tooltip'), {
|
|
52
|
-
content: getFuncText(titleSuffix.message),
|
|
52
|
+
content: getFuncText(titleSuffix.content || titleSuffix.message),
|
|
53
53
|
enterable: titleSuffix.enterable,
|
|
54
54
|
theme: titleSuffix.theme
|
|
55
55
|
}, {
|
package/es/grid/src/grid.js
CHANGED
|
@@ -25,7 +25,7 @@ import tableComponentEmits from '../../table/src/emits';
|
|
|
25
25
|
import { useSize } from '../../hooks/size';
|
|
26
26
|
import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event';
|
|
27
27
|
var tableComponentPropKeys = Object.keys(tableComponentProps);
|
|
28
|
-
var tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getData', 'getCheckboxRecords', 'getRowById', 'getRowid', 'getTableData', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'isCheckedByCheckboxRow', 'isIndeterminateByCheckboxRow', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'setRadioRow', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'sort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isRowExpandLoaded', 'clearRowExpandLoaded', '
|
|
28
|
+
var tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getData', 'getCheckboxRecords', 'getRowById', 'getRowid', 'getTableData', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'isCheckedByCheckboxRow', 'isIndeterminateByCheckboxRow', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'setRadioRow', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'sort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'focus', 'blur', 'connect'];
|
|
29
29
|
var gridComponentEmits = __spreadArray(__spreadArray([], tableComponentEmits), [
|
|
30
30
|
'page-change',
|
|
31
31
|
'form-submit',
|
|
@@ -244,6 +244,12 @@ export default defineComponent({
|
|
|
244
244
|
}
|
|
245
245
|
else {
|
|
246
246
|
if (isMsg) {
|
|
247
|
+
// 检测弹窗模块
|
|
248
|
+
if (process.env.NODE_ENV === 'development') {
|
|
249
|
+
if (!VXETable.modal) {
|
|
250
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
247
253
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' });
|
|
248
254
|
}
|
|
249
255
|
}
|
|
@@ -269,6 +275,12 @@ export default defineComponent({
|
|
|
269
275
|
});
|
|
270
276
|
}
|
|
271
277
|
else {
|
|
278
|
+
// 检测弹窗模块
|
|
279
|
+
if (process.env.NODE_ENV === 'development') {
|
|
280
|
+
if (!VXETable.modal) {
|
|
281
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
272
284
|
VXETable.modal.message({ id: "msg_" + code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' });
|
|
273
285
|
}
|
|
274
286
|
}
|
|
@@ -761,6 +773,12 @@ export default defineComponent({
|
|
|
761
773
|
reactData.tableLoading = false;
|
|
762
774
|
reactData.pendingRecords = reactData.pendingRecords.filter(function (row) { return $xetable.findRowIndexOf(removeRecords_1, row) === -1; });
|
|
763
775
|
if (isMsg) {
|
|
776
|
+
// 检测弹窗模块
|
|
777
|
+
if (process.env.NODE_ENV === 'development') {
|
|
778
|
+
if (!VXETable.modal) {
|
|
779
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
764
782
|
VXETable.modal.message({ content: getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' });
|
|
765
783
|
}
|
|
766
784
|
if (afterDelete) {
|
|
@@ -773,6 +791,11 @@ export default defineComponent({
|
|
|
773
791
|
.catch(function (rest) {
|
|
774
792
|
reactData.tableLoading = false;
|
|
775
793
|
if (isMsg) {
|
|
794
|
+
if (process.env.NODE_ENV === 'development') {
|
|
795
|
+
if (!VXETable.modal.message) {
|
|
796
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
776
799
|
VXETable.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
777
800
|
}
|
|
778
801
|
});
|
|
@@ -780,6 +803,12 @@ export default defineComponent({
|
|
|
780
803
|
}
|
|
781
804
|
else {
|
|
782
805
|
if (isMsg) {
|
|
806
|
+
// 检测弹窗模块
|
|
807
|
+
if (process.env.NODE_ENV === 'development') {
|
|
808
|
+
if (!VXETable.modal) {
|
|
809
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
783
812
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' });
|
|
784
813
|
}
|
|
785
814
|
}
|
|
@@ -814,6 +843,12 @@ export default defineComponent({
|
|
|
814
843
|
reactData.tableLoading = false;
|
|
815
844
|
reactData.pendingRecords = [];
|
|
816
845
|
if (isMsg) {
|
|
846
|
+
// 检测弹窗模块
|
|
847
|
+
if (process.env.NODE_ENV === 'development') {
|
|
848
|
+
if (!VXETable.modal) {
|
|
849
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
817
852
|
VXETable.modal.message({ content: getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' });
|
|
818
853
|
}
|
|
819
854
|
if (afterSave) {
|
|
@@ -826,12 +861,24 @@ export default defineComponent({
|
|
|
826
861
|
.catch(function (rest) {
|
|
827
862
|
reactData.tableLoading = false;
|
|
828
863
|
if (isMsg) {
|
|
864
|
+
// 检测弹窗模块
|
|
865
|
+
if (process.env.NODE_ENV === 'development') {
|
|
866
|
+
if (!VXETable.modal) {
|
|
867
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
829
870
|
VXETable.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
830
871
|
}
|
|
831
872
|
});
|
|
832
873
|
}
|
|
833
874
|
else {
|
|
834
875
|
if (isMsg) {
|
|
876
|
+
// 检测弹窗模块
|
|
877
|
+
if (process.env.NODE_ENV === 'development') {
|
|
878
|
+
if (!VXETable.modal) {
|
|
879
|
+
errLog('vxe.error.reqModule', ['Modal']);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
835
882
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.dataUnchanged'), status: 'info' });
|
|
836
883
|
}
|
|
837
884
|
}
|
package/es/header/src/header.js
CHANGED
|
@@ -28,6 +28,7 @@ export default defineComponent({
|
|
|
28
28
|
var $xetable = inject('$xetable', {});
|
|
29
29
|
var xID = $xetable.xID, tableProps = $xetable.props, tableReactData = $xetable.reactData, tableInternalData = $xetable.internalData;
|
|
30
30
|
var _a = $xetable.getRefMaps(), tableRefElem = _a.refElem, refTableBody = _a.refTableBody, refLeftContainer = _a.refLeftContainer, refRightContainer = _a.refRightContainer, refCellResizeBar = _a.refCellResizeBar;
|
|
31
|
+
var computeColumnOpts = $xetable.getComputeMaps().computeColumnOpts;
|
|
31
32
|
var headerColumn = ref([]);
|
|
32
33
|
var refElem = ref();
|
|
33
34
|
var refHeaderTable = ref();
|
|
@@ -145,12 +146,13 @@ export default defineComponent({
|
|
|
145
146
|
var renderVN = function () {
|
|
146
147
|
var fixedType = props.fixedType, fixedColumn = props.fixedColumn, tableColumn = props.tableColumn;
|
|
147
148
|
var resizable = tableProps.resizable, border = tableProps.border, columnKey = tableProps.columnKey, headerRowClassName = tableProps.headerRowClassName, headerCellClassName = tableProps.headerCellClassName, headerRowStyle = tableProps.headerRowStyle, headerCellStyle = tableProps.headerCellStyle, allColumnHeaderOverflow = tableProps.showHeaderOverflow, allHeaderAlign = tableProps.headerAlign, allAlign = tableProps.align, mouseConfig = tableProps.mouseConfig;
|
|
148
|
-
var isGroup = tableReactData.isGroup, currentColumn = tableReactData.currentColumn,
|
|
149
|
+
var isGroup = tableReactData.isGroup, currentColumn = tableReactData.currentColumn, scrollYLoad = tableReactData.scrollYLoad, overflowX = tableReactData.overflowX, scrollbarWidth = tableReactData.scrollbarWidth;
|
|
150
|
+
var columnOpts = computeColumnOpts.value;
|
|
149
151
|
var headerGroups = headerColumn.value;
|
|
150
152
|
// 如果是使用优化模式
|
|
151
153
|
if (!isGroup) {
|
|
152
154
|
if (fixedType) {
|
|
153
|
-
if (
|
|
155
|
+
if (scrollYLoad || allColumnHeaderOverflow) {
|
|
154
156
|
tableColumn = fixedColumn;
|
|
155
157
|
}
|
|
156
158
|
}
|
|
@@ -216,8 +218,8 @@ export default defineComponent({
|
|
|
216
218
|
onClick: function (evnt) { return $xetable.triggerHeaderCellClickEvent(evnt, params); },
|
|
217
219
|
onDblclick: function (evnt) { return $xetable.triggerHeaderCellDblclickEvent(evnt, params); }
|
|
218
220
|
};
|
|
219
|
-
//
|
|
220
|
-
if (
|
|
221
|
+
// 纵向虚拟滚动不支持动态行高
|
|
222
|
+
if (scrollYLoad && !hasEllipsis) {
|
|
221
223
|
showEllipsis = hasEllipsis = true;
|
|
222
224
|
}
|
|
223
225
|
// 按下事件处理
|
|
@@ -248,7 +250,7 @@ export default defineComponent({
|
|
|
248
250
|
/**
|
|
249
251
|
* 列宽拖动
|
|
250
252
|
*/
|
|
251
|
-
!fixedHiddenColumn && !isColGroup && (XEUtils.isBoolean(column.resizable) ? column.resizable : resizable) ? h('div', {
|
|
253
|
+
!fixedHiddenColumn && !isColGroup && (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || resizable)) ? h('div', {
|
|
252
254
|
class: ['vxe-resizable', {
|
|
253
255
|
'is--line': !border || border === 'none'
|
|
254
256
|
}],
|
package/es/select/src/select.js
CHANGED
|
@@ -171,7 +171,7 @@ export default defineComponent({
|
|
|
171
171
|
}
|
|
172
172
|
return nextTick();
|
|
173
173
|
};
|
|
174
|
-
var
|
|
174
|
+
var cacheItemMap = function () {
|
|
175
175
|
var fullOptionList = reactData.fullOptionList, fullGroupList = reactData.fullGroupList;
|
|
176
176
|
var groupOptionsField = computeGroupOptionsField.value;
|
|
177
177
|
var key = getOptkey();
|
|
@@ -674,17 +674,17 @@ export default defineComponent({
|
|
|
674
674
|
reactData.fullGroupList = [];
|
|
675
675
|
reactData.fullOptionList = value || [];
|
|
676
676
|
}
|
|
677
|
-
|
|
677
|
+
cacheItemMap();
|
|
678
678
|
});
|
|
679
679
|
watch(function () { return props.options; }, function (value) {
|
|
680
680
|
reactData.fullGroupList = [];
|
|
681
681
|
reactData.fullOptionList = value || [];
|
|
682
|
-
|
|
682
|
+
cacheItemMap();
|
|
683
683
|
});
|
|
684
684
|
watch(function () { return props.optionGroups; }, function (value) {
|
|
685
685
|
reactData.fullOptionList = [];
|
|
686
686
|
reactData.fullGroupList = value || [];
|
|
687
|
-
|
|
687
|
+
cacheItemMap();
|
|
688
688
|
});
|
|
689
689
|
onMounted(function () {
|
|
690
690
|
nextTick(function () {
|
|
@@ -695,7 +695,7 @@ export default defineComponent({
|
|
|
695
695
|
else if (options) {
|
|
696
696
|
reactData.fullOptionList = options;
|
|
697
697
|
}
|
|
698
|
-
|
|
698
|
+
cacheItemMap();
|
|
699
699
|
});
|
|
700
700
|
GlobalEvent.on($xeselect, 'mousewheel', handleGlobalMousewheelEvent);
|
|
701
701
|
GlobalEvent.on($xeselect, 'mousedown', handleGlobalMousedownEvent);
|
package/es/table/src/body.js
CHANGED
|
@@ -40,7 +40,7 @@ export default defineComponent({
|
|
|
40
40
|
var xesize = inject('xesize', null);
|
|
41
41
|
var xID = $xetable.xID, tableProps = $xetable.props, tableContext = $xetable.context, tableReactData = $xetable.reactData, tableInternalData = $xetable.internalData;
|
|
42
42
|
var _a = $xetable.getRefMaps(), refTableHeader = _a.refTableHeader, refTableBody = _a.refTableBody, refTableFooter = _a.refTableFooter, refTableLeftBody = _a.refTableLeftBody, refTableRightBody = _a.refTableRightBody, refValidTooltip = _a.refValidTooltip;
|
|
43
|
-
var _b = $xetable.getComputeMaps(), computeEditOpts = _b.computeEditOpts, computeMouseOpts = _b.computeMouseOpts, computeSYOpts = _b.computeSYOpts, computeEmptyOpts = _b.computeEmptyOpts, computeKeyboardOpts = _b.computeKeyboardOpts, computeTooltipOpts = _b.computeTooltipOpts, computeRadioOpts = _b.computeRadioOpts, computeTreeOpts = _b.computeTreeOpts, computeCheckboxOpts = _b.computeCheckboxOpts, computeValidOpts = _b.computeValidOpts;
|
|
43
|
+
var _b = $xetable.getComputeMaps(), computeEditOpts = _b.computeEditOpts, computeMouseOpts = _b.computeMouseOpts, computeSYOpts = _b.computeSYOpts, computeEmptyOpts = _b.computeEmptyOpts, computeKeyboardOpts = _b.computeKeyboardOpts, computeTooltipOpts = _b.computeTooltipOpts, computeRadioOpts = _b.computeRadioOpts, computeTreeOpts = _b.computeTreeOpts, computeCheckboxOpts = _b.computeCheckboxOpts, computeValidOpts = _b.computeValidOpts, computeRowOpts = _b.computeRowOpts;
|
|
44
44
|
var refElem = ref();
|
|
45
45
|
var refBodyTable = ref();
|
|
46
46
|
var refBodyColgroup = ref();
|
|
@@ -113,16 +113,18 @@ export default defineComponent({
|
|
|
113
113
|
var renderColumn = function ($seq, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
|
|
114
114
|
var _a;
|
|
115
115
|
var columnKey = tableProps.columnKey, height = tableProps.height, allColumnOverflow = tableProps.showOverflow, cellClassName = tableProps.cellClassName, cellStyle = tableProps.cellStyle, allAlign = tableProps.align, spanMethod = tableProps.spanMethod, mouseConfig = tableProps.mouseConfig, editConfig = tableProps.editConfig, editRules = tableProps.editRules, tooltipConfig = tableProps.tooltipConfig;
|
|
116
|
-
var tableData = tableReactData.tableData, overflowX = tableReactData.overflowX,
|
|
116
|
+
var tableData = tableReactData.tableData, overflowX = tableReactData.overflowX, scrollYLoad = tableReactData.scrollYLoad, currentColumn = tableReactData.currentColumn, mergeList = tableReactData.mergeList, editStore = tableReactData.editStore, validStore = tableReactData.validStore, isAllOverflow = tableReactData.isAllOverflow;
|
|
117
117
|
var afterFullData = tableInternalData.afterFullData;
|
|
118
118
|
var validOpts = computeValidOpts.value;
|
|
119
119
|
var checkboxOpts = computeCheckboxOpts.value;
|
|
120
120
|
var editOpts = computeEditOpts.value;
|
|
121
121
|
var tooltipOpts = computeTooltipOpts.value;
|
|
122
|
+
var rowOpts = computeRowOpts.value;
|
|
122
123
|
var sYOpts = computeSYOpts.value;
|
|
123
124
|
var type = column.type, cellRender = column.cellRender, editRender = column.editRender, align = column.align, showOverflow = column.showOverflow, className = column.className, treeNode = column.treeNode;
|
|
124
125
|
var actived = editStore.actived;
|
|
125
|
-
var
|
|
126
|
+
var scrollYRHeight = sYOpts.rHeight;
|
|
127
|
+
var rowHeight = rowOpts.height;
|
|
126
128
|
var showAllTip = tooltipOpts.showAll;
|
|
127
129
|
var columnIndex = $xetable.getColumnIndex(column);
|
|
128
130
|
var _columnIndex = $xetable.getVTColumnIndex(column);
|
|
@@ -141,7 +143,7 @@ export default defineComponent({
|
|
|
141
143
|
var attrs = { colid: column.id };
|
|
142
144
|
var params = { $table: $xetable, $seq: $seq, seq: seq, rowid: rowid, row: row, rowIndex: rowIndex, $rowIndex: $rowIndex, _rowIndex: _rowIndex, column: column, columnIndex: columnIndex, $columnIndex: $columnIndex, _columnIndex: _columnIndex, fixed: fixedType, type: renderType, isHidden: fixedHiddenColumn, level: rowLevel, visibleData: afterFullData, data: tableData, items: items };
|
|
143
145
|
// 虚拟滚动不支持动态高度
|
|
144
|
-
if (
|
|
146
|
+
if (scrollYLoad && !hasEllipsis) {
|
|
145
147
|
showEllipsis = hasEllipsis = true;
|
|
146
148
|
}
|
|
147
149
|
// hover 进入事件
|
|
@@ -234,7 +236,7 @@ export default defineComponent({
|
|
|
234
236
|
'c--ellipsis': showEllipsis
|
|
235
237
|
}],
|
|
236
238
|
style: {
|
|
237
|
-
maxHeight: hasEllipsis &&
|
|
239
|
+
maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? (scrollYRHeight || rowHeight) + "px" : ''
|
|
238
240
|
}
|
|
239
241
|
}));
|
|
240
242
|
}
|
|
@@ -247,7 +249,7 @@ export default defineComponent({
|
|
|
247
249
|
'c--ellipsis': showEllipsis
|
|
248
250
|
}],
|
|
249
251
|
style: {
|
|
250
|
-
maxHeight: hasEllipsis &&
|
|
252
|
+
maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? (scrollYRHeight || rowHeight) + "px" : ''
|
|
251
253
|
},
|
|
252
254
|
title: showTitle ? $xetable.getCellLabel(row, column) : null
|
|
253
255
|
}, column.renderCell(params))]));
|
|
@@ -277,13 +279,13 @@ export default defineComponent({
|
|
|
277
279
|
_a['col--valid-error'] = hasValidError,
|
|
278
280
|
_a['col--current'] = currentColumn === column,
|
|
279
281
|
_a), getPropClass(className, params), getPropClass(cellClassName, params)], key: columnKey ? column.id : $columnIndex }, attrs), { style: Object.assign({
|
|
280
|
-
height: hasEllipsis &&
|
|
282
|
+
height: hasEllipsis && (scrollYRHeight || rowHeight) ? (scrollYRHeight || rowHeight) + "px" : ''
|
|
281
283
|
}, cellStyle ? (XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle) : null) }), tdOns), tdVNs);
|
|
282
284
|
};
|
|
283
|
-
var renderRows = function ($seq,
|
|
285
|
+
var renderRows = function ($seq, fixedType, tableData, tableColumn) {
|
|
284
286
|
var stripe = tableProps.stripe, rowKey = tableProps.rowKey, highlightHoverRow = tableProps.highlightHoverRow, rowClassName = tableProps.rowClassName, rowStyle = tableProps.rowStyle, allColumnOverflow = tableProps.showOverflow, editConfig = tableProps.editConfig, treeConfig = tableProps.treeConfig;
|
|
285
287
|
var hasFixedColumn = tableReactData.hasFixedColumn, treeExpandeds = tableReactData.treeExpandeds, scrollYLoad = tableReactData.scrollYLoad, editStore = tableReactData.editStore, rowExpandeds = tableReactData.rowExpandeds, expandColumn = tableReactData.expandColumn, selectRow = tableReactData.selectRow;
|
|
286
|
-
var scrollYStore = tableInternalData.scrollYStore;
|
|
288
|
+
var fullAllDataRowIdData = tableInternalData.fullAllDataRowIdData, scrollYStore = tableInternalData.scrollYStore;
|
|
287
289
|
var checkboxOpts = computeCheckboxOpts.value;
|
|
288
290
|
var radioOpts = computeRadioOpts.value;
|
|
289
291
|
var treeOpts = computeTreeOpts.value;
|
|
@@ -315,6 +317,8 @@ export default defineComponent({
|
|
|
315
317
|
};
|
|
316
318
|
}
|
|
317
319
|
var rowid = getRowid($xetable, row);
|
|
320
|
+
var rest = fullAllDataRowIdData[rowid];
|
|
321
|
+
var rowLevel = rest ? rest.level : 0;
|
|
318
322
|
var params = { $table: $xetable, $seq: $seq, seq: seq, rowid: rowid, fixed: fixedType, type: renderType, level: rowLevel, row: row, rowIndex: rowIndex, $rowIndex: $rowIndex, _rowIndex: _rowIndex };
|
|
319
323
|
var isNewRow = false;
|
|
320
324
|
if (editConfig) {
|
|
@@ -358,10 +362,10 @@ export default defineComponent({
|
|
|
358
362
|
]));
|
|
359
363
|
}
|
|
360
364
|
// 如果是树形表格
|
|
361
|
-
if (treeConfig && treeExpandeds.length) {
|
|
365
|
+
if (treeConfig && !scrollYLoad && treeExpandeds.length) {
|
|
362
366
|
var rowChildren = row[treeOpts.children];
|
|
363
367
|
if (rowChildren && rowChildren.length && $xetable.findRowIndexOf(treeExpandeds, row) > -1) {
|
|
364
|
-
rows.push.apply(rows, renderRows($seq ? $seq + "." + seq : "" + seq,
|
|
368
|
+
rows.push.apply(rows, renderRows($seq ? $seq + "." + seq : "" + seq, fixedType, rowChildren, tableColumn));
|
|
365
369
|
}
|
|
366
370
|
}
|
|
367
371
|
});
|
|
@@ -570,7 +574,7 @@ export default defineComponent({
|
|
|
570
574
|
var renderVN = function () {
|
|
571
575
|
var fixedColumn = props.fixedColumn, fixedType = props.fixedType, tableColumn = props.tableColumn;
|
|
572
576
|
var keyboardConfig = tableProps.keyboardConfig, allColumnOverflow = tableProps.showOverflow, spanMethod = tableProps.spanMethod, mouseConfig = tableProps.mouseConfig;
|
|
573
|
-
var tableData = tableReactData.tableData, mergeList = tableReactData.mergeList,
|
|
577
|
+
var tableData = tableReactData.tableData, mergeList = tableReactData.mergeList, scrollYLoad = tableReactData.scrollYLoad, isAllOverflow = tableReactData.isAllOverflow;
|
|
574
578
|
var visibleColumn = tableInternalData.visibleColumn;
|
|
575
579
|
var slots = tableContext.slots;
|
|
576
580
|
var sYOpts = computeSYOpts.value;
|
|
@@ -581,7 +585,7 @@ export default defineComponent({
|
|
|
581
585
|
// const isMergeRightFixedExceeded = computeIsMergeRightFixedExceeded.value
|
|
582
586
|
// 如果是使用优化模式
|
|
583
587
|
if (fixedType) {
|
|
584
|
-
if (
|
|
588
|
+
if (scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
|
|
585
589
|
if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
|
|
586
590
|
tableColumn = fixedColumn;
|
|
587
591
|
}
|
|
@@ -648,7 +652,7 @@ export default defineComponent({
|
|
|
648
652
|
*/
|
|
649
653
|
h('tbody', {
|
|
650
654
|
ref: refBodyTBody
|
|
651
|
-
}, renderRows('',
|
|
655
|
+
}, renderRows('', fixedType, tableData, tableColumn))
|
|
652
656
|
]),
|
|
653
657
|
h('div', {
|
|
654
658
|
class: 'vxe-table--checkbox-range'
|