vxe-table 4.13.28 → 4.13.30
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 +25 -26
- package/es/style.css +1 -1
- package/es/table/module/edit/hook.js +11 -27
- package/es/table/module/export/hook.js +15 -20
- package/es/table/module/validator/hook.js +104 -44
- package/es/table/src/table.js +33 -26
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +25 -26
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +171 -136
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/hook.js +11 -27
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +15 -20
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/validator/hook.js +106 -47
- package/lib/table/module/validator/hook.min.js +1 -1
- package/lib/table/src/table.js +12 -14
- package/lib/table/src/table.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 +1 -1
- package/packages/grid/src/grid.ts +25 -27
- package/packages/table/module/edit/hook.ts +11 -27
- package/packages/table/module/export/hook.ts +17 -22
- package/packages/table/module/validator/hook.ts +106 -43
- package/packages/table/src/table.ts +33 -26
- /package/es/{iconfont.1747194464593.ttf → iconfont.1747357348072.ttf} +0 -0
- /package/es/{iconfont.1747194464593.woff → iconfont.1747357348072.woff} +0 -0
- /package/es/{iconfont.1747194464593.woff2 → iconfont.1747357348072.woff2} +0 -0
- /package/lib/{iconfont.1747194464593.ttf → iconfont.1747357348072.ttf} +0 -0
- /package/lib/{iconfont.1747194464593.woff → iconfont.1747357348072.woff} +0 -0
- /package/lib/{iconfont.1747194464593.woff2 → iconfont.1747357348072.woff2} +0 -0
|
@@ -82,10 +82,8 @@ hooks.add('tableEditModule', {
|
|
|
82
82
|
fullAllDataRowIdData[rowid] = rest;
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
warnLog('vxe.error.unableInsert');
|
|
88
|
-
}
|
|
85
|
+
if (parentRowId) {
|
|
86
|
+
warnLog('vxe.error.unableInsert');
|
|
89
87
|
}
|
|
90
88
|
afterFullData[funcName](item);
|
|
91
89
|
tableFullTreeData[funcName](item);
|
|
@@ -163,11 +161,9 @@ hooks.add('tableEditModule', {
|
|
|
163
161
|
const parentLevel = parentRest ? parentRest.level : 0;
|
|
164
162
|
newRecords.forEach((item, i) => {
|
|
165
163
|
const rowid = getRowid($xeTable, item);
|
|
166
|
-
if (
|
|
167
|
-
if (item[treeOpts.parentField]) {
|
|
168
|
-
|
|
169
|
-
errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`]);
|
|
170
|
-
}
|
|
164
|
+
if (item[treeOpts.parentField]) {
|
|
165
|
+
if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
|
|
166
|
+
errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`]);
|
|
171
167
|
}
|
|
172
168
|
}
|
|
173
169
|
if (parentRow) {
|
|
@@ -196,9 +192,7 @@ hooks.add('tableEditModule', {
|
|
|
196
192
|
}
|
|
197
193
|
}
|
|
198
194
|
else {
|
|
199
|
-
|
|
200
|
-
warnLog('vxe.error.unableInsert');
|
|
201
|
-
}
|
|
195
|
+
warnLog('vxe.error.unableInsert');
|
|
202
196
|
insertTreeRow(newRecords, true);
|
|
203
197
|
}
|
|
204
198
|
}
|
|
@@ -695,9 +689,7 @@ hooks.add('tableEditModule', {
|
|
|
695
689
|
return [];
|
|
696
690
|
},
|
|
697
691
|
getActiveRecord() {
|
|
698
|
-
|
|
699
|
-
warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord']);
|
|
700
|
-
}
|
|
692
|
+
warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord']);
|
|
701
693
|
return $xeTable.getEditRecord();
|
|
702
694
|
},
|
|
703
695
|
getEditRecord() {
|
|
@@ -723,9 +715,7 @@ hooks.add('tableEditModule', {
|
|
|
723
715
|
},
|
|
724
716
|
clearActived(row) {
|
|
725
717
|
// 即将废弃
|
|
726
|
-
|
|
727
|
-
warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit']);
|
|
728
|
-
}
|
|
718
|
+
warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit']);
|
|
729
719
|
return $xeTable.clearEdit(row);
|
|
730
720
|
},
|
|
731
721
|
/**
|
|
@@ -746,9 +736,7 @@ hooks.add('tableEditModule', {
|
|
|
746
736
|
return nextTick();
|
|
747
737
|
},
|
|
748
738
|
isActiveByRow(row) {
|
|
749
|
-
|
|
750
|
-
warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow']);
|
|
751
|
-
}
|
|
739
|
+
warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow']);
|
|
752
740
|
// 即将废弃
|
|
753
741
|
return $xeTable.isEditByRow(row);
|
|
754
742
|
},
|
|
@@ -761,9 +749,7 @@ hooks.add('tableEditModule', {
|
|
|
761
749
|
return editStore.actived.row === row;
|
|
762
750
|
},
|
|
763
751
|
setActiveRow(row) {
|
|
764
|
-
|
|
765
|
-
warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow']);
|
|
766
|
-
}
|
|
752
|
+
warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow']);
|
|
767
753
|
// 即将废弃
|
|
768
754
|
return editMethods.setEditRow(row);
|
|
769
755
|
},
|
|
@@ -783,9 +769,7 @@ hooks.add('tableEditModule', {
|
|
|
783
769
|
return handleEditCell(row, column, isPos);
|
|
784
770
|
},
|
|
785
771
|
setActiveCell(row, fieldOrColumn) {
|
|
786
|
-
|
|
787
|
-
warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell']);
|
|
788
|
-
}
|
|
772
|
+
warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell']);
|
|
789
773
|
// 即将废弃
|
|
790
774
|
return editMethods.setEditCell(row, fieldOrColumn);
|
|
791
775
|
},
|
|
@@ -11,7 +11,7 @@ let htmlCellElem;
|
|
|
11
11
|
const csvBOM = '\ufeff';
|
|
12
12
|
const enterSymbol = '\r\n';
|
|
13
13
|
function defaultFilterExportColumn(column) {
|
|
14
|
-
return column.field || ['seq', 'checkbox', 'radio'].indexOf(column.type) > -1;
|
|
14
|
+
return !!column.field || ['seq', 'checkbox', 'radio'].indexOf(column.type || '') > -1;
|
|
15
15
|
}
|
|
16
16
|
const getConvertColumns = (columns) => {
|
|
17
17
|
const result = [];
|
|
@@ -951,7 +951,7 @@ hooks.add('tableExportModule', {
|
|
|
951
951
|
}
|
|
952
952
|
return false;
|
|
953
953
|
}
|
|
954
|
-
return exportOpts.original ? column.field : defaultFilterExportColumn(column);
|
|
954
|
+
return exportOpts.original ? !!column.field : defaultFilterExportColumn(column);
|
|
955
955
|
};
|
|
956
956
|
const handleExportAndPrint = (options, isPrint) => {
|
|
957
957
|
const { treeConfig, showHeader, showFooter } = props;
|
|
@@ -1001,7 +1001,7 @@ hooks.add('tableExportModule', {
|
|
|
1001
1001
|
});
|
|
1002
1002
|
// 默认选中
|
|
1003
1003
|
XEUtils.eachTree(exportColumns, (column, index, items, path, parent) => {
|
|
1004
|
-
const isColGroup = column.children && column.children.length;
|
|
1004
|
+
const isColGroup = column.children && column.children.length > 0;
|
|
1005
1005
|
let isChecked = false;
|
|
1006
1006
|
if (columns && columns.length) {
|
|
1007
1007
|
isChecked = handleFilterColumns(defOpts, column, columns);
|
|
@@ -1121,7 +1121,7 @@ hooks.add('tableExportModule', {
|
|
|
1121
1121
|
const customCols = columns && columns.length
|
|
1122
1122
|
? columns
|
|
1123
1123
|
: XEUtils.searchTree(collectColumn, column => {
|
|
1124
|
-
const isColGroup = column.children && column.children.length;
|
|
1124
|
+
const isColGroup = column.children && column.children.length > 0;
|
|
1125
1125
|
let isChecked = false;
|
|
1126
1126
|
if (columns && columns.length) {
|
|
1127
1127
|
isChecked = handleFilterColumns(opts, column, columns);
|
|
@@ -1137,7 +1137,7 @@ hooks.add('tableExportModule', {
|
|
|
1137
1137
|
const handleOptions = Object.assign({}, opts, { filename: '', sheetName: '' });
|
|
1138
1138
|
// 如果设置源数据,则默认导出设置了字段的列
|
|
1139
1139
|
if (!customCols && !columnFilterMethod) {
|
|
1140
|
-
|
|
1140
|
+
columnFilterMethod = ({ column }) => {
|
|
1141
1141
|
if (excludeFields) {
|
|
1142
1142
|
if (XEUtils.includes(excludeFields, column.field)) {
|
|
1143
1143
|
return false;
|
|
@@ -1149,8 +1149,9 @@ hooks.add('tableExportModule', {
|
|
|
1149
1149
|
}
|
|
1150
1150
|
return false;
|
|
1151
1151
|
}
|
|
1152
|
-
return original ? column.field : defaultFilterExportColumn(column);
|
|
1152
|
+
return original ? !!column.field : defaultFilterExportColumn(column);
|
|
1153
1153
|
};
|
|
1154
|
+
handleOptions.columnFilterMethod = columnFilterMethod;
|
|
1154
1155
|
}
|
|
1155
1156
|
if (customCols) {
|
|
1156
1157
|
handleOptions._isCustomColumn = true;
|
|
@@ -1238,10 +1239,8 @@ hooks.add('tableExportModule', {
|
|
|
1238
1239
|
// 检查类型,如果为自定义导出,则不需要校验类型
|
|
1239
1240
|
if (!handleOptions.exportMethod && !XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)) {
|
|
1240
1241
|
errLog('vxe.error.notType', [type]);
|
|
1241
|
-
if (
|
|
1242
|
-
|
|
1243
|
-
warnLog('vxe.error.reqPlugin', [4, 'plugin-export-xlsx']);
|
|
1244
|
-
}
|
|
1242
|
+
if (['xlsx', 'pdf'].includes(type)) {
|
|
1243
|
+
warnLog('vxe.error.reqPlugin', [4, 'plugin-export-xlsx']);
|
|
1245
1244
|
}
|
|
1246
1245
|
const params = { status: false };
|
|
1247
1246
|
return Promise.reject(params);
|
|
@@ -1262,10 +1261,8 @@ hooks.add('tableExportModule', {
|
|
|
1262
1261
|
}
|
|
1263
1262
|
}
|
|
1264
1263
|
else if (mode === 'all') {
|
|
1265
|
-
if (
|
|
1266
|
-
|
|
1267
|
-
warnLog('vxe.error.errProp', ['all', 'mode=current,selected']);
|
|
1268
|
-
}
|
|
1264
|
+
if (!$xeGrid) {
|
|
1265
|
+
errLog('vxe.error.errProp', ['all', 'mode=current,selected']);
|
|
1269
1266
|
}
|
|
1270
1267
|
if ($xeGrid && !handleOptions.remote) {
|
|
1271
1268
|
const gridReactData = $xeGrid.reactData;
|
|
@@ -1277,10 +1274,8 @@ hooks.add('tableExportModule', {
|
|
|
1277
1274
|
const ajaxMethods = ajax.queryAll;
|
|
1278
1275
|
const queryAllSuccessMethods = ajax.queryAllSuccess;
|
|
1279
1276
|
const queryAllErrorMethods = ajax.queryAllError;
|
|
1280
|
-
if (
|
|
1281
|
-
|
|
1282
|
-
warnLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll']);
|
|
1283
|
-
}
|
|
1277
|
+
if (!ajaxMethods) {
|
|
1278
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll']);
|
|
1284
1279
|
}
|
|
1285
1280
|
if (ajaxMethods) {
|
|
1286
1281
|
const params = {
|
|
@@ -1518,7 +1513,7 @@ hooks.add('tableExportModule', {
|
|
|
1518
1513
|
if (!props.exportConfig) {
|
|
1519
1514
|
errLog('vxe.error.reqProp', ['export-config']);
|
|
1520
1515
|
}
|
|
1521
|
-
handleExportAndPrint(defOpts);
|
|
1516
|
+
return handleExportAndPrint(defOpts);
|
|
1522
1517
|
},
|
|
1523
1518
|
closePrint: handleCloseExport,
|
|
1524
1519
|
openPrint(options) {
|
|
@@ -1529,7 +1524,7 @@ hooks.add('tableExportModule', {
|
|
|
1529
1524
|
if (!props.printConfig) {
|
|
1530
1525
|
errLog('vxe.error.reqProp', ['print-config']);
|
|
1531
1526
|
}
|
|
1532
|
-
handleExportAndPrint(defOpts, true);
|
|
1527
|
+
return handleExportAndPrint(defOpts, true);
|
|
1533
1528
|
}
|
|
1534
1529
|
};
|
|
1535
1530
|
return exportMethods;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { nextTick } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { VxeUI } from '../../../ui';
|
|
4
|
-
import { getFuncText
|
|
4
|
+
import { getFuncText } from '../../../ui/src/utils';
|
|
5
5
|
import { scrollToView } from '../../../ui/src/dom';
|
|
6
6
|
import { handleFieldOrColumn, getRowid } from '../../src/util';
|
|
7
7
|
import { warnLog, errLog } from '../../../ui/src/log';
|
|
@@ -34,6 +34,104 @@ class Rule {
|
|
|
34
34
|
return this.content;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
// 如果存在 pattern,判断正则
|
|
38
|
+
function validREValue(pattern, val) {
|
|
39
|
+
if (pattern && !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
// 如果存在 max,判断最大值
|
|
45
|
+
function validMaxValue(max, num) {
|
|
46
|
+
if (!XEUtils.eqNull(max) && num > XEUtils.toNumber(max)) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
// 如果存在 min,判断最小值
|
|
52
|
+
function validMinValue(min, num) {
|
|
53
|
+
if (!XEUtils.eqNull(min) && num < XEUtils.toNumber(min)) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
function validRuleValue(rule, val, required) {
|
|
59
|
+
const { type, min, max, pattern } = rule;
|
|
60
|
+
const isArrType = type === 'array';
|
|
61
|
+
const isNumType = type === 'number';
|
|
62
|
+
const isStrType = type === 'string';
|
|
63
|
+
const strVal = `${val}`;
|
|
64
|
+
if (!validREValue(pattern, strVal)) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (isArrType) {
|
|
68
|
+
if (!XEUtils.isArray(val)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
if (required) {
|
|
72
|
+
if (!val.length) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (!validMinValue(min, val.length)) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
if (!validMaxValue(max, val.length)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (isNumType) {
|
|
84
|
+
const numVal = Number(val);
|
|
85
|
+
if (isNaN(numVal)) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
if (!validMinValue(min, numVal)) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
if (!validMaxValue(max, numVal)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
if (isStrType) {
|
|
97
|
+
if (!XEUtils.isString(val)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (required) {
|
|
102
|
+
if (!strVal) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (!validMinValue(min, strVal.length)) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (!validMaxValue(max, strVal.length)) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
function checkRuleStatus(rule, val) {
|
|
116
|
+
const { required } = rule;
|
|
117
|
+
const isEmptyVal = XEUtils.eqNull(val);
|
|
118
|
+
if (required) {
|
|
119
|
+
if (isEmptyVal) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
if (!validRuleValue(rule, val, required)) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
if (!isEmptyVal) {
|
|
128
|
+
if (!validRuleValue(rule, val, required)) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
37
135
|
const tableValidatorMethodKeys = ['fullValidate', 'validate', 'fullValidateField', 'validateField', 'clearValidate'];
|
|
38
136
|
hooks.add('tableValidatorModule', {
|
|
39
137
|
setupTable($xeTable) {
|
|
@@ -234,10 +332,8 @@ hooks.add('tableValidatorModule', {
|
|
|
234
332
|
* 完整校验行,和 validate 的区别就是会给有效数据中的每一行进行校验
|
|
235
333
|
*/
|
|
236
334
|
fullValidate(rows, cb) {
|
|
237
|
-
if (
|
|
238
|
-
|
|
239
|
-
warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
|
|
240
|
-
}
|
|
335
|
+
if (XEUtils.isFunction(cb)) {
|
|
336
|
+
warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
|
|
241
337
|
}
|
|
242
338
|
return beginValidate(rows, null, cb, true);
|
|
243
339
|
},
|
|
@@ -313,28 +409,6 @@ hooks.add('tableValidatorModule', {
|
|
|
313
409
|
return nextTick();
|
|
314
410
|
}
|
|
315
411
|
};
|
|
316
|
-
const validErrorRuleValue = (rule, val) => {
|
|
317
|
-
const { type, min, max, pattern } = rule;
|
|
318
|
-
const isNumType = type === 'number';
|
|
319
|
-
const numVal = isNumType ? XEUtils.toNumber(val) : XEUtils.getSize(val);
|
|
320
|
-
// 判断数值
|
|
321
|
-
if (isNumType && isNaN(val)) {
|
|
322
|
-
return true;
|
|
323
|
-
}
|
|
324
|
-
// 如果存在 min,判断最小值
|
|
325
|
-
if (!XEUtils.eqNull(min) && numVal < XEUtils.toNumber(min)) {
|
|
326
|
-
return true;
|
|
327
|
-
}
|
|
328
|
-
// 如果存在 max,判断最大值
|
|
329
|
-
if (!XEUtils.eqNull(max) && numVal > XEUtils.toNumber(max)) {
|
|
330
|
-
return true;
|
|
331
|
-
}
|
|
332
|
-
// 如果存在 pattern,正则校验
|
|
333
|
-
if (pattern && !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
|
|
334
|
-
return true;
|
|
335
|
-
}
|
|
336
|
-
return false;
|
|
337
|
-
};
|
|
338
412
|
validatorPrivateMethods = {
|
|
339
413
|
/**
|
|
340
414
|
* 校验数据
|
|
@@ -361,7 +435,7 @@ hooks.add('tableValidatorModule', {
|
|
|
361
435
|
if (rules) {
|
|
362
436
|
const cellValue = XEUtils.isUndefined(val) ? XEUtils.get(row, field) : val;
|
|
363
437
|
rules.forEach((rule) => {
|
|
364
|
-
const {
|
|
438
|
+
const { trigger, validator } = rule;
|
|
365
439
|
if (validType === 'all' || !trigger || validType === trigger) {
|
|
366
440
|
if (validator) {
|
|
367
441
|
const validParams = {
|
|
@@ -385,9 +459,7 @@ hooks.add('tableValidatorModule', {
|
|
|
385
459
|
customValid = tcvMethod(validParams);
|
|
386
460
|
}
|
|
387
461
|
else {
|
|
388
|
-
|
|
389
|
-
warnLog('vxe.error.notValidators', [validator]);
|
|
390
|
-
}
|
|
462
|
+
errLog('vxe.error.notValidators', [validator]);
|
|
391
463
|
}
|
|
392
464
|
}
|
|
393
465
|
else {
|
|
@@ -412,19 +484,7 @@ hooks.add('tableValidatorModule', {
|
|
|
412
484
|
}
|
|
413
485
|
}
|
|
414
486
|
else {
|
|
415
|
-
|
|
416
|
-
const isArrVal = XEUtils.isArray(cellValue);
|
|
417
|
-
let hasEmpty = true;
|
|
418
|
-
if (isArrType || isArrVal) {
|
|
419
|
-
hasEmpty = !isArrVal || !cellValue.length;
|
|
420
|
-
}
|
|
421
|
-
else if (XEUtils.isString(cellValue)) {
|
|
422
|
-
hasEmpty = eqEmptyValue(cellValue.trim());
|
|
423
|
-
}
|
|
424
|
-
else {
|
|
425
|
-
hasEmpty = eqEmptyValue(cellValue);
|
|
426
|
-
}
|
|
427
|
-
if (required ? (hasEmpty || validErrorRuleValue(rule, cellValue)) : (!hasEmpty && validErrorRuleValue(rule, cellValue))) {
|
|
487
|
+
if (!checkRuleStatus(rule, cellValue)) {
|
|
428
488
|
validRuleErr = true;
|
|
429
489
|
errorRules.push(new Rule(rule));
|
|
430
490
|
}
|
package/es/table/src/table.js
CHANGED
|
@@ -3396,7 +3396,6 @@ export default defineComponent({
|
|
|
3396
3396
|
// }
|
|
3397
3397
|
// }
|
|
3398
3398
|
// }
|
|
3399
|
-
// if (process.env.NODE_ENV === 'development') {
|
|
3400
3399
|
// if (props.showHeader && !props.showHeaderOverflow) {
|
|
3401
3400
|
// warnLog('vxe.error.reqProp', ['show-header-overflow'])
|
|
3402
3401
|
// }
|
|
@@ -3409,7 +3408,6 @@ export default defineComponent({
|
|
|
3409
3408
|
if (props.footerSpanMethod) {
|
|
3410
3409
|
warnLog('vxe.error.scrollErrProp', ['footer-span-method']);
|
|
3411
3410
|
}
|
|
3412
|
-
// }
|
|
3413
3411
|
if (isReset) {
|
|
3414
3412
|
const { visibleSize } = handleVirtualXVisible();
|
|
3415
3413
|
scrollXStore.startIndex = 0;
|
|
@@ -3758,7 +3756,7 @@ export default defineComponent({
|
|
|
3758
3756
|
}, fpsTime);
|
|
3759
3757
|
};
|
|
3760
3758
|
const checkLastSyncScroll = (isRollX, isRollY) => {
|
|
3761
|
-
const { scrollXLoad, scrollYLoad } = reactData;
|
|
3759
|
+
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
|
|
3762
3760
|
const { lcsTimeout } = internalData;
|
|
3763
3761
|
if (lcsTimeout) {
|
|
3764
3762
|
clearTimeout(lcsTimeout);
|
|
@@ -3773,13 +3771,19 @@ export default defineComponent({
|
|
|
3773
3771
|
internalData.inBodyScroll = false;
|
|
3774
3772
|
internalData.inFooterScroll = false;
|
|
3775
3773
|
internalData.scrollRenderType = '';
|
|
3776
|
-
|
|
3774
|
+
if (!isAllOverflow) {
|
|
3775
|
+
calcCellHeight();
|
|
3776
|
+
updateRowOffsetTop();
|
|
3777
|
+
}
|
|
3777
3778
|
if (isRollX && scrollXLoad) {
|
|
3778
3779
|
$xeTable.updateScrollXData();
|
|
3779
3780
|
}
|
|
3780
3781
|
if (isRollY && scrollYLoad) {
|
|
3781
3782
|
$xeTable.updateScrollYData().then(() => {
|
|
3782
|
-
|
|
3783
|
+
if (!isAllOverflow) {
|
|
3784
|
+
calcCellHeight();
|
|
3785
|
+
updateRowOffsetTop();
|
|
3786
|
+
}
|
|
3783
3787
|
$xeTable.updateScrollYSpace();
|
|
3784
3788
|
});
|
|
3785
3789
|
}
|
|
@@ -4094,9 +4098,7 @@ export default defineComponent({
|
|
|
4094
4098
|
reactData.tableData = tableData.slice(0);
|
|
4095
4099
|
}
|
|
4096
4100
|
else {
|
|
4097
|
-
|
|
4098
|
-
warnLog('vxe.error.reqProp', ['keep-source']);
|
|
4099
|
-
}
|
|
4101
|
+
errLog('vxe.error.reqProp', ['keep-source']);
|
|
4100
4102
|
}
|
|
4101
4103
|
return nextTick();
|
|
4102
4104
|
},
|
|
@@ -4277,9 +4279,7 @@ export default defineComponent({
|
|
|
4277
4279
|
const { transform } = treeOpts;
|
|
4278
4280
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
4279
4281
|
if (!keepSource) {
|
|
4280
|
-
|
|
4281
|
-
errLog('vxe.error.reqProp', ['keep-source']);
|
|
4282
|
-
}
|
|
4282
|
+
errLog('vxe.error.reqProp', ['keep-source']);
|
|
4283
4283
|
return nextTick();
|
|
4284
4284
|
}
|
|
4285
4285
|
let targetRows = rows;
|
|
@@ -4815,6 +4815,7 @@ export default defineComponent({
|
|
|
4815
4815
|
}
|
|
4816
4816
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
4817
4817
|
column.fixed = fixed;
|
|
4818
|
+
column.renderFixed = fixed;
|
|
4818
4819
|
});
|
|
4819
4820
|
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
4820
4821
|
if (!status) {
|
|
@@ -4839,6 +4840,7 @@ export default defineComponent({
|
|
|
4839
4840
|
if (targetColumn && targetColumn.fixed) {
|
|
4840
4841
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
4841
4842
|
column.fixed = null;
|
|
4843
|
+
column.renderFixed = null;
|
|
4842
4844
|
});
|
|
4843
4845
|
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
4844
4846
|
if (!status) {
|
|
@@ -5838,9 +5840,7 @@ export default defineComponent({
|
|
|
5838
5840
|
return nextTick();
|
|
5839
5841
|
},
|
|
5840
5842
|
reloadExpandContent(row) {
|
|
5841
|
-
|
|
5842
|
-
warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand']);
|
|
5843
|
-
}
|
|
5843
|
+
warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand']);
|
|
5844
5844
|
// 即将废弃
|
|
5845
5845
|
return $xeTable.reloadRowExpand(row);
|
|
5846
5846
|
},
|
|
@@ -5946,9 +5946,7 @@ export default defineComponent({
|
|
|
5946
5946
|
},
|
|
5947
5947
|
isExpandByRow(row) {
|
|
5948
5948
|
// 已废弃
|
|
5949
|
-
|
|
5950
|
-
warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow']);
|
|
5951
|
-
}
|
|
5949
|
+
warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow']);
|
|
5952
5950
|
return tableMethods.isRowExpandByRow(row);
|
|
5953
5951
|
},
|
|
5954
5952
|
/**
|
|
@@ -6128,9 +6126,7 @@ export default defineComponent({
|
|
|
6128
6126
|
return nextTick();
|
|
6129
6127
|
},
|
|
6130
6128
|
reloadTreeChilds(row) {
|
|
6131
|
-
|
|
6132
|
-
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
|
|
6133
|
-
}
|
|
6129
|
+
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
|
|
6134
6130
|
// 即将废弃
|
|
6135
6131
|
return $xeTable.reloadTreeExpand(row);
|
|
6136
6132
|
},
|
|
@@ -8056,10 +8052,8 @@ export default defineComponent({
|
|
|
8056
8052
|
// 兼容老版本
|
|
8057
8053
|
if (!evntList.length && type === 'event.clearEdit') {
|
|
8058
8054
|
evntList = interceptor.get('event.clearActived');
|
|
8059
|
-
if (
|
|
8060
|
-
|
|
8061
|
-
warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit']);
|
|
8062
|
-
}
|
|
8055
|
+
if (evntList.length) {
|
|
8056
|
+
warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit']);
|
|
8063
8057
|
}
|
|
8064
8058
|
}
|
|
8065
8059
|
// 兼容老版本
|
|
@@ -8455,10 +8449,14 @@ export default defineComponent({
|
|
|
8455
8449
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
8456
8450
|
const ctEl = tdEl.querySelector('.vxe-cell--wrapper');
|
|
8457
8451
|
let ovEl = null;
|
|
8452
|
+
let tipEl = tdEl.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
8458
8453
|
if (column.treeNode) {
|
|
8459
8454
|
ovEl = tdEl.querySelector('.vxe-tree-cell');
|
|
8460
8455
|
}
|
|
8461
|
-
|
|
8456
|
+
if (!tipEl) {
|
|
8457
|
+
tipEl = ctEl;
|
|
8458
|
+
}
|
|
8459
|
+
handleTooltip(evnt, tdEl, ovEl || ctEl, tipEl, params);
|
|
8462
8460
|
}
|
|
8463
8461
|
},
|
|
8464
8462
|
/**
|
|
@@ -8470,7 +8468,16 @@ export default defineComponent({
|
|
|
8470
8468
|
const tdEl = evnt.currentTarget;
|
|
8471
8469
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row);
|
|
8472
8470
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
8473
|
-
|
|
8471
|
+
const ctEl = tdEl.querySelector('.vxe-cell--wrapper');
|
|
8472
|
+
let ovEl = null;
|
|
8473
|
+
let tipEl = tdEl.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
8474
|
+
if (column.type === 'html') {
|
|
8475
|
+
ovEl = tdEl.querySelector('.vxe-cell--html');
|
|
8476
|
+
}
|
|
8477
|
+
if (!tipEl) {
|
|
8478
|
+
tipEl = ctEl;
|
|
8479
|
+
}
|
|
8480
|
+
handleTooltip(evnt, tdEl, ovEl || ctEl, tipEl, params);
|
|
8474
8481
|
}
|
|
8475
8482
|
},
|
|
8476
8483
|
handleTargetLeaveEvent() {
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/grid/src/grid.js
CHANGED
|
@@ -1367,31 +1367,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1367
1367
|
// return nextTick()
|
|
1368
1368
|
// }
|
|
1369
1369
|
};
|
|
1370
|
-
// 检查插槽
|
|
1371
|
-
if (process.env.NODE_ENV === 'development') {
|
|
1372
|
-
gridMethods.loadColumn = columns => {
|
|
1373
|
-
const $xeTable = refTable.value;
|
|
1374
|
-
_xeUtils.default.eachTree(columns, column => {
|
|
1375
|
-
if (column.slots) {
|
|
1376
|
-
_xeUtils.default.each(column.slots, func => {
|
|
1377
|
-
if (!_xeUtils.default.isFunction(func)) {
|
|
1378
|
-
if (!slots[func]) {
|
|
1379
|
-
(0, _log.errLog)('vxe.error.notSlot', [func]);
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
});
|
|
1383
|
-
}
|
|
1384
|
-
});
|
|
1385
|
-
if ($xeTable) {
|
|
1386
|
-
return $xeTable.loadColumn(columns);
|
|
1387
|
-
}
|
|
1388
|
-
return (0, _vue.nextTick)();
|
|
1389
|
-
};
|
|
1390
|
-
gridMethods.reloadColumn = columns => {
|
|
1391
|
-
gridExtendTableMethods.clearAll();
|
|
1392
|
-
return gridMethods.loadColumn(columns);
|
|
1393
|
-
};
|
|
1394
|
-
}
|
|
1395
1370
|
const gridPrivateMethods = {
|
|
1396
1371
|
extendTableMethods,
|
|
1397
1372
|
callSlot(slotFunc, params) {
|
|
@@ -1466,7 +1441,31 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1466
1441
|
}, evnt);
|
|
1467
1442
|
}
|
|
1468
1443
|
};
|
|
1469
|
-
Object.assign($xeGrid, gridExtendTableMethods, gridMethods, gridPrivateMethods
|
|
1444
|
+
Object.assign($xeGrid, gridExtendTableMethods, gridMethods, gridPrivateMethods, {
|
|
1445
|
+
// 检查插槽
|
|
1446
|
+
loadColumn(columns) {
|
|
1447
|
+
const $xeTable = refTable.value;
|
|
1448
|
+
_xeUtils.default.eachTree(columns, column => {
|
|
1449
|
+
if (column.slots) {
|
|
1450
|
+
_xeUtils.default.each(column.slots, func => {
|
|
1451
|
+
if (!_xeUtils.default.isFunction(func)) {
|
|
1452
|
+
if (!slots[func]) {
|
|
1453
|
+
(0, _log.errLog)('vxe.error.notSlot', [func]);
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
});
|
|
1459
|
+
if ($xeTable) {
|
|
1460
|
+
return $xeTable.loadColumn(columns);
|
|
1461
|
+
}
|
|
1462
|
+
return (0, _vue.nextTick)();
|
|
1463
|
+
},
|
|
1464
|
+
reloadColumn(columns) {
|
|
1465
|
+
$xeGrid.clearAll();
|
|
1466
|
+
return $xeGrid.loadColumn(columns);
|
|
1467
|
+
}
|
|
1468
|
+
});
|
|
1470
1469
|
const columnFlag = (0, _vue.ref)(0);
|
|
1471
1470
|
(0, _vue.watch)(() => props.columns ? props.columns.length : -1, () => {
|
|
1472
1471
|
columnFlag.value++;
|