vxe-table 3.11.35 → 3.11.37
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +57 -33
- package/es/table/module/export/mixin.js +23 -20
- package/es/table/src/body.js +4 -4
- package/es/table/src/footer.js +4 -2
- package/es/table/src/header.js +4 -2
- package/es/table/src/methods.js +2 -2
- package/es/table/src/table.js +6 -3
- package/es/table/style.css +3 -25
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +3 -25
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +110 -64
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +67 -33
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +22 -19
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/body.js +4 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +4 -1
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +4 -1
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +2 -2
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +5 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +3 -25
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +3 -25
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +58 -33
- package/packages/table/module/export/mixin.ts +24 -20
- package/packages/table/src/body.ts +4 -3
- package/packages/table/src/footer.ts +4 -2
- package/packages/table/src/header.ts +4 -2
- package/packages/table/src/methods.ts +2 -2
- package/packages/table/src/table.ts +6 -3
- package/styles/components/table.scss +3 -22
- /package/es/{iconfont.1734517179309.ttf → iconfont.1734680280915.ttf} +0 -0
- /package/es/{iconfont.1734517179309.woff → iconfont.1734680280915.woff} +0 -0
- /package/es/{iconfont.1734517179309.woff2 → iconfont.1734680280915.woff2} +0 -0
- /package/lib/{iconfont.1734517179309.ttf → iconfont.1734680280915.ttf} +0 -0
- /package/lib/{iconfont.1734517179309.woff → iconfont.1734680280915.woff} +0 -0
- /package/lib/{iconfont.1734517179309.woff2 → iconfont.1734680280915.woff2} +0 -0
|
@@ -46,8 +46,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
function handleInsertRowAt(
|
|
50
|
-
const $xeTable = _vm;
|
|
49
|
+
function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
51
50
|
const props = $xeTable;
|
|
52
51
|
const reactData = $xeTable;
|
|
53
52
|
const internalData = $xeTable;
|
|
@@ -60,11 +59,11 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
60
59
|
if (!XEUtils.isArray(records)) {
|
|
61
60
|
records = [records];
|
|
62
61
|
}
|
|
63
|
-
const newRecords =
|
|
64
|
-
if (XEUtils.eqNull(
|
|
62
|
+
const newRecords = $xeTable.defineField(records.map(record => Object.assign(treeConfig && transform ? { [mapChildrenField]: [], [childrenField]: [] } : {}, record)));
|
|
63
|
+
if (XEUtils.eqNull(targetRow)) {
|
|
65
64
|
// 如果为虚拟树
|
|
66
65
|
if (treeConfig && transform) {
|
|
67
|
-
insertTreeRow(
|
|
66
|
+
insertTreeRow($xeTable, newRecords, false);
|
|
68
67
|
}
|
|
69
68
|
else {
|
|
70
69
|
newRecords.forEach(item => {
|
|
@@ -85,10 +84,10 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
86
|
else {
|
|
88
|
-
if (
|
|
87
|
+
if (targetRow === -1) {
|
|
89
88
|
// 如果为虚拟树
|
|
90
89
|
if (treeConfig && transform) {
|
|
91
|
-
insertTreeRow(
|
|
90
|
+
insertTreeRow($xeTable, newRecords, true);
|
|
92
91
|
}
|
|
93
92
|
else {
|
|
94
93
|
newRecords.forEach(item => {
|
|
@@ -111,14 +110,14 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
111
110
|
else {
|
|
112
111
|
// 如果为虚拟树
|
|
113
112
|
if (treeConfig && transform) {
|
|
114
|
-
const matchMapObj = XEUtils.findTree(tableFullTreeData, (item) =>
|
|
113
|
+
const matchMapObj = XEUtils.findTree(tableFullTreeData, (item) => targetRow[rowField] === item[rowField], { children: mapChildrenField });
|
|
115
114
|
if (matchMapObj) {
|
|
116
115
|
const { parent: parentRow } = matchMapObj;
|
|
117
116
|
const parentMapChilds = parentRow ? parentRow[mapChildrenField] : tableFullTreeData;
|
|
118
|
-
const parentRest = fullAllDataRowIdData[getRowid(
|
|
117
|
+
const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)];
|
|
119
118
|
const parentLevel = parentRest ? parentRest.level : 0;
|
|
120
119
|
newRecords.forEach((item, i) => {
|
|
121
|
-
const rowid = getRowid(
|
|
120
|
+
const rowid = getRowid($xeTable, item);
|
|
122
121
|
if (process.env.NODE_ENV === 'development') {
|
|
123
122
|
if (item[treeOpts.parentField]) {
|
|
124
123
|
if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
|
|
@@ -140,7 +139,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
140
139
|
});
|
|
141
140
|
// 源
|
|
142
141
|
if (parentRow) {
|
|
143
|
-
const matchObj = XEUtils.findTree(tableFullTreeData, (item) =>
|
|
142
|
+
const matchObj = XEUtils.findTree(tableFullTreeData, (item) => targetRow[rowField] === item[rowField], { children: childrenField });
|
|
144
143
|
if (matchObj) {
|
|
145
144
|
const parentChilds = matchObj.items;
|
|
146
145
|
let targetIndex = matchObj.index;
|
|
@@ -155,7 +154,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
155
154
|
if (process.env.NODE_ENV === 'development') {
|
|
156
155
|
warnLog('vxe.error.unableInsert');
|
|
157
156
|
}
|
|
158
|
-
insertTreeRow(
|
|
157
|
+
insertTreeRow($xeTable, newRecords, true);
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
160
|
else {
|
|
@@ -164,13 +163,13 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
164
163
|
}
|
|
165
164
|
let afIndex = -1;
|
|
166
165
|
// 如果是可视索引
|
|
167
|
-
if (XEUtils.isNumber(
|
|
168
|
-
if (
|
|
169
|
-
afIndex =
|
|
166
|
+
if (XEUtils.isNumber(targetRow)) {
|
|
167
|
+
if (targetRow < afterFullData.length) {
|
|
168
|
+
afIndex = targetRow;
|
|
170
169
|
}
|
|
171
170
|
}
|
|
172
171
|
else {
|
|
173
|
-
afIndex =
|
|
172
|
+
afIndex = $xeTable.findRowIndexOf(afterFullData, targetRow);
|
|
174
173
|
}
|
|
175
174
|
// 如果是插入指定行的下一行
|
|
176
175
|
if (isInsertNextRow) {
|
|
@@ -180,7 +179,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
180
179
|
throw new Error(errLog('vxe.error.unableInsert'));
|
|
181
180
|
}
|
|
182
181
|
afterFullData.splice(afIndex, 0, ...newRecords);
|
|
183
|
-
tableFullData.splice(
|
|
182
|
+
tableFullData.splice($xeTable.findRowIndexOf(tableFullData, targetRow), 0, ...newRecords);
|
|
184
183
|
// 刷新单元格合并
|
|
185
184
|
mergeList.forEach((mergeItem) => {
|
|
186
185
|
const { row: mergeRowIndex, rowspan: mergeRowspan } = mergeItem;
|
|
@@ -199,20 +198,20 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
199
198
|
const rowid = getRowid($xeTable, newRow);
|
|
200
199
|
insertMaps[rowid] = newRow;
|
|
201
200
|
});
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
201
|
+
$xeTable.cacheRowMap();
|
|
202
|
+
$xeTable.updateScrollYStatus();
|
|
203
|
+
$xeTable.handleTableData(treeConfig && transform);
|
|
205
204
|
if (!(treeConfig && transform)) {
|
|
206
|
-
|
|
205
|
+
$xeTable.updateAfterDataIndex();
|
|
207
206
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
if (
|
|
211
|
-
|
|
207
|
+
$xeTable.updateFooter();
|
|
208
|
+
$xeTable.checkSelectionStatus();
|
|
209
|
+
if ($xeTable.scrollYLoad) {
|
|
210
|
+
$xeTable.updateScrollYSpace();
|
|
212
211
|
}
|
|
213
|
-
return
|
|
214
|
-
|
|
215
|
-
return
|
|
212
|
+
return $xeTable.$nextTick().then(() => {
|
|
213
|
+
$xeTable.updateCellAreas();
|
|
214
|
+
return $xeTable.recalculate();
|
|
216
215
|
}).then(() => {
|
|
217
216
|
return {
|
|
218
217
|
row: newRecords.length ? newRecords[newRecords.length - 1] : null,
|
|
@@ -220,6 +219,22 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
220
219
|
};
|
|
221
220
|
});
|
|
222
221
|
}
|
|
222
|
+
function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInsertNextRow) {
|
|
223
|
+
const props = $xeTable;
|
|
224
|
+
const { treeConfig } = props;
|
|
225
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
226
|
+
const { transform, rowField, parentField } = treeOpts;
|
|
227
|
+
if (treeConfig && transform) {
|
|
228
|
+
if (!XEUtils.isArray(records)) {
|
|
229
|
+
records = [records];
|
|
230
|
+
}
|
|
231
|
+
return handleInsertRowAt($xeTable, records.map((item) => Object.assign({}, item, { [parentField]: parentRow[rowField] })), targetRow, isInsertNextRow);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
errLog('vxe.error.errProp', ['tree-config.treeConfig=false', 'tree-config.treeConfig=true']);
|
|
235
|
+
}
|
|
236
|
+
return Promise.resolve({ row: null, rows: [] });
|
|
237
|
+
}
|
|
223
238
|
export default {
|
|
224
239
|
methods: {
|
|
225
240
|
/**
|
|
@@ -236,14 +251,23 @@ export default {
|
|
|
236
251
|
* 如果 row 为 -1 则从插入到底部
|
|
237
252
|
* 如果 row 为有效行则插入到该行的位置
|
|
238
253
|
* @param {Object/Array} records 新的数据
|
|
239
|
-
* @param {Row}
|
|
254
|
+
* @param {Row} targetRow 指定行
|
|
240
255
|
* @returns
|
|
241
256
|
*/
|
|
242
|
-
_insertAt(records,
|
|
243
|
-
return handleInsertRowAt(this, records,
|
|
257
|
+
_insertAt(records, targetRow) {
|
|
258
|
+
return handleInsertRowAt(this, records, targetRow);
|
|
259
|
+
},
|
|
260
|
+
_insertNextAt(records, targetRow) {
|
|
261
|
+
return handleInsertRowAt(this, records, targetRow, true);
|
|
262
|
+
},
|
|
263
|
+
_insertChild(records, parentRow) {
|
|
264
|
+
return handleInsertChildRowAt(this, records, parentRow, null);
|
|
265
|
+
},
|
|
266
|
+
_insertChildAt(records, parentRow, targetRow) {
|
|
267
|
+
return handleInsertChildRowAt(this, records, parentRow, targetRow);
|
|
244
268
|
},
|
|
245
|
-
|
|
246
|
-
return
|
|
269
|
+
_insertChildNextAt(records, parentRow, targetRow) {
|
|
270
|
+
return handleInsertChildRowAt(this, records, parentRow, targetRow, true);
|
|
247
271
|
},
|
|
248
272
|
/**
|
|
249
273
|
* 删除指定行数据
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import { isColumnInfo, mergeBodyMethod, getCellValue } from '../../src/util';
|
|
4
|
-
import { parseFile, formatText } from '../../../ui/src/utils';
|
|
4
|
+
import { parseFile, formatText, eqEmptyValue } from '../../../ui/src/utils';
|
|
5
5
|
import { browse } from '../../../ui/src/dom';
|
|
6
6
|
import { createHtmlPage, getExportBlobByContent } from './util';
|
|
7
7
|
import { warnLog, errLog } from '../../../ui/src/log';
|
|
@@ -54,9 +54,12 @@ function toTableBorder(border) {
|
|
|
54
54
|
function toBooleanValue(cellValue) {
|
|
55
55
|
return XEUtils.isBoolean(cellValue) ? (cellValue ? 'TRUE' : 'FALSE') : cellValue;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
const toStringValue = (cellValue) => {
|
|
58
|
+
return eqEmptyValue(cellValue) ? '' : `${cellValue}`;
|
|
59
|
+
};
|
|
60
|
+
function getBodyLabelData($xeTable, opts, columns, datas) {
|
|
58
61
|
const { isAllExpand, mode } = opts;
|
|
59
|
-
const { treeConfig, treeOpts, radioOpts, checkboxOpts, columnOpts } = $
|
|
62
|
+
const { treeConfig, treeOpts, radioOpts, checkboxOpts, columnOpts } = $xeTable;
|
|
60
63
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
61
64
|
if (!htmlCellElem) {
|
|
62
65
|
htmlCellElem = document.createElement('div');
|
|
@@ -68,13 +71,13 @@ function getBodyLabelData($xetable, opts, columns, datas) {
|
|
|
68
71
|
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parent, nodes) => {
|
|
69
72
|
const row = item._row || item;
|
|
70
73
|
const parentRow = parent && parent._row ? parent._row : parent;
|
|
71
|
-
if ((isAllExpand || !parentRow || (expandMaps.has(parentRow) && $
|
|
72
|
-
const hasRowChild = hasTreeChildren($
|
|
74
|
+
if ((isAllExpand || !parentRow || (expandMaps.has(parentRow) && $xeTable.isTreeExpandByRow(parentRow)))) {
|
|
75
|
+
const hasRowChild = hasTreeChildren($xeTable, row);
|
|
73
76
|
const item = {
|
|
74
77
|
_row: row,
|
|
75
78
|
_level: nodes.length - 1,
|
|
76
79
|
_hasChild: hasRowChild,
|
|
77
|
-
_expand: hasRowChild && $
|
|
80
|
+
_expand: hasRowChild && $xeTable.isTreeExpandByRow(row)
|
|
78
81
|
};
|
|
79
82
|
columns.forEach((column, $columnIndex) => {
|
|
80
83
|
let cellValue = '';
|
|
@@ -90,22 +93,22 @@ function getBodyLabelData($xetable, opts, columns, datas) {
|
|
|
90
93
|
bodyExportMethod = columnOpts.exportMethod;
|
|
91
94
|
}
|
|
92
95
|
if (bodyExportMethod) {
|
|
93
|
-
cellValue = bodyExportMethod({ $table: $
|
|
96
|
+
cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts });
|
|
94
97
|
}
|
|
95
98
|
else {
|
|
96
99
|
switch (column.type) {
|
|
97
100
|
case 'seq': {
|
|
98
101
|
const seqValue = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
|
|
99
|
-
cellValue = mode === 'all' ? seqValue : getSeq($
|
|
102
|
+
cellValue = mode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex);
|
|
100
103
|
break;
|
|
101
104
|
}
|
|
102
105
|
case 'checkbox':
|
|
103
|
-
cellValue = toBooleanValue($
|
|
106
|
+
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
|
|
104
107
|
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : '';
|
|
105
108
|
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ row });
|
|
106
109
|
break;
|
|
107
110
|
case 'radio':
|
|
108
|
-
cellValue = toBooleanValue($
|
|
111
|
+
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
|
|
109
112
|
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : '';
|
|
110
113
|
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ row });
|
|
111
114
|
break;
|
|
@@ -114,13 +117,13 @@ function getBodyLabelData($xetable, opts, columns, datas) {
|
|
|
114
117
|
cellValue = getCellValue(row, column);
|
|
115
118
|
}
|
|
116
119
|
else {
|
|
117
|
-
cellValue = $
|
|
120
|
+
cellValue = $xeTable.getCellLabel(row, column);
|
|
118
121
|
if (column.type === 'html') {
|
|
119
122
|
htmlCellElem.innerHTML = cellValue;
|
|
120
123
|
cellValue = htmlCellElem.innerText.trim();
|
|
121
124
|
}
|
|
122
125
|
else {
|
|
123
|
-
const cell = $
|
|
126
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
124
127
|
if (cell) {
|
|
125
128
|
cellValue = cell.innerText.trim();
|
|
126
129
|
}
|
|
@@ -128,7 +131,7 @@ function getBodyLabelData($xetable, opts, columns, datas) {
|
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
133
|
}
|
|
131
|
-
item[column.id] =
|
|
134
|
+
item[column.id] = toStringValue(cellValue);
|
|
132
135
|
});
|
|
133
136
|
expandMaps.set(row, 1);
|
|
134
137
|
rest.push(Object.assign(item, row));
|
|
@@ -154,22 +157,22 @@ function getBodyLabelData($xetable, opts, columns, datas) {
|
|
|
154
157
|
bodyExportMethod = columnOpts.exportMethod;
|
|
155
158
|
}
|
|
156
159
|
if (bodyExportMethod) {
|
|
157
|
-
cellValue = bodyExportMethod({ $table: $
|
|
160
|
+
cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts });
|
|
158
161
|
}
|
|
159
162
|
else {
|
|
160
163
|
switch (column.type) {
|
|
161
164
|
case 'seq': {
|
|
162
165
|
const seqValue = $rowIndex + 1;
|
|
163
|
-
cellValue = mode === 'all' ? seqValue : getSeq($
|
|
166
|
+
cellValue = mode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex);
|
|
164
167
|
break;
|
|
165
168
|
}
|
|
166
169
|
case 'checkbox':
|
|
167
|
-
cellValue = toBooleanValue($
|
|
170
|
+
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
|
|
168
171
|
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : '';
|
|
169
172
|
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ row });
|
|
170
173
|
break;
|
|
171
174
|
case 'radio':
|
|
172
|
-
cellValue = toBooleanValue($
|
|
175
|
+
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
|
|
173
176
|
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : '';
|
|
174
177
|
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ row });
|
|
175
178
|
break;
|
|
@@ -178,13 +181,13 @@ function getBodyLabelData($xetable, opts, columns, datas) {
|
|
|
178
181
|
cellValue = getCellValue(row, column);
|
|
179
182
|
}
|
|
180
183
|
else {
|
|
181
|
-
cellValue = $
|
|
184
|
+
cellValue = $xeTable.getCellLabel(row, column);
|
|
182
185
|
if (column.type === 'html') {
|
|
183
186
|
htmlCellElem.innerHTML = cellValue;
|
|
184
187
|
cellValue = htmlCellElem.innerText.trim();
|
|
185
188
|
}
|
|
186
189
|
else {
|
|
187
|
-
const cell = $
|
|
190
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
188
191
|
if (cell) {
|
|
189
192
|
cellValue = cell.innerText.trim();
|
|
190
193
|
}
|
|
@@ -192,7 +195,7 @@ function getBodyLabelData($xetable, opts, columns, datas) {
|
|
|
192
195
|
}
|
|
193
196
|
}
|
|
194
197
|
}
|
|
195
|
-
item[column.id] =
|
|
198
|
+
item[column.id] = toStringValue(cellValue);
|
|
196
199
|
});
|
|
197
200
|
return item;
|
|
198
201
|
});
|
package/es/table/src/body.js
CHANGED
|
@@ -285,7 +285,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
285
285
|
getClass(className, params),
|
|
286
286
|
getClass(allCellClassName, params)
|
|
287
287
|
],
|
|
288
|
-
key: columnKey || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
|
|
288
|
+
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
|
|
289
289
|
attrs,
|
|
290
290
|
style: Object.assign({
|
|
291
291
|
height: cellHeight
|
|
@@ -296,7 +296,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
296
296
|
function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
297
297
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
298
298
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
299
|
-
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, showOverflow: allColumnOverflow, treeConfig, treeOpts, expandOpts, editOpts, treeExpandedMaps, scrollYLoad, rowExpandedMaps, radioOpts, checkboxOpts, expandColumn, hasFixedColumn, fullAllDataRowIdData, rowOpts, pendingRowMaps, isDragColMove } = $xeTable;
|
|
299
|
+
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, showOverflow: allColumnOverflow, treeConfig, treeOpts, expandOpts, editOpts, treeExpandedMaps, scrollXLoad, scrollYLoad, rowExpandedMaps, radioOpts, checkboxOpts, expandColumn, hasFixedColumn, fullAllDataRowIdData, rowOpts, pendingRowMaps, isDragColMove } = $xeTable;
|
|
300
300
|
const { transform, seqMode } = treeOpts;
|
|
301
301
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
302
302
|
const rows = [];
|
|
@@ -391,7 +391,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
|
391
391
|
rowid
|
|
392
392
|
},
|
|
393
393
|
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
394
|
-
key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
394
|
+
key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
395
395
|
nativeOn: trOn
|
|
396
396
|
}, tdVNs)
|
|
397
397
|
: h('tr', {
|
|
@@ -400,7 +400,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
|
400
400
|
rowid
|
|
401
401
|
},
|
|
402
402
|
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
403
|
-
key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
403
|
+
key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
404
404
|
on: trOn
|
|
405
405
|
}, tdVNs));
|
|
406
406
|
// 如果行被展开了
|
package/es/table/src/footer.js
CHANGED
|
@@ -19,7 +19,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
19
19
|
}
|
|
20
20
|
function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex) {
|
|
21
21
|
const { $parent: $xetable, fixedType } = _vm;
|
|
22
|
-
const { $listeners: tableListeners, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, mergeFooterList, footerSpanMethod, align: allAlign, scrollXLoad, columnKey, columnOpts, showFooterOverflow: allColumnFooterOverflow, currentColumn, overflowX, scrollbarWidth, tooltipOpts } = $xetable;
|
|
22
|
+
const { $listeners: tableListeners, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, mergeFooterList, footerSpanMethod, align: allAlign, scrollXLoad, columnKey, columnOpts, showFooterOverflow: allColumnFooterOverflow, currentColumn, overflowX, scrollYLoad, scrollbarWidth, tooltipOpts } = $xetable;
|
|
23
23
|
return tableColumn.map((column, $columnIndex) => {
|
|
24
24
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column;
|
|
25
25
|
const renderOpts = editRender || cellRender;
|
|
@@ -128,7 +128,7 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
|
|
|
128
128
|
attrs,
|
|
129
129
|
style: footerCellStyle ? (XEUtils.isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle) : null,
|
|
130
130
|
on: tfOns,
|
|
131
|
-
key: columnKey || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex
|
|
131
|
+
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex
|
|
132
132
|
}, [
|
|
133
133
|
h('div', {
|
|
134
134
|
class: ['vxe-cell', {
|
|
@@ -158,6 +158,7 @@ function renderHeads(h, _vm, footerTableData) {
|
|
|
158
158
|
const rowParams = { $table: $xetable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType };
|
|
159
159
|
if (columnOpts.drag && columnDragOpts.animation) {
|
|
160
160
|
return h('transition-group', {
|
|
161
|
+
key: $rowIndex,
|
|
161
162
|
props: {
|
|
162
163
|
tag: 'tr',
|
|
163
164
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
@@ -170,6 +171,7 @@ function renderHeads(h, _vm, footerTableData) {
|
|
|
170
171
|
}, renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex));
|
|
171
172
|
}
|
|
172
173
|
return h('tr', {
|
|
174
|
+
key: $rowIndex,
|
|
173
175
|
class: [
|
|
174
176
|
'vxe-footer--row',
|
|
175
177
|
footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''
|
package/es/table/src/header.js
CHANGED
|
@@ -9,7 +9,7 @@ const renderRows = (h, _vm, cols, $rowIndex) => {
|
|
|
9
9
|
const $xeTable = _vm.$parent;
|
|
10
10
|
const $xeGrid = $xeTable.xegrid;
|
|
11
11
|
const { fixedType } = _vm;
|
|
12
|
-
const { resizable: allResizable, border, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, currentColumn, scrollXLoad, overflowX, scrollbarWidth, mouseConfig, columnOpts } = $xeTable;
|
|
12
|
+
const { resizable: allResizable, border, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, currentColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, mouseConfig, columnOpts } = $xeTable;
|
|
13
13
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
14
14
|
const { disabledMethod: dragDisabledMethod } = columnDragOpts;
|
|
15
15
|
return cols.map((column, $columnIndex) => {
|
|
@@ -81,7 +81,7 @@ const renderRows = (h, _vm, cols, $rowIndex) => {
|
|
|
81
81
|
attrs: thAttrs,
|
|
82
82
|
style: headerCellStyle ? (XEUtils.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle) : null,
|
|
83
83
|
on: thOns,
|
|
84
|
-
key: columnKey || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
84
|
+
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
85
85
|
}, [
|
|
86
86
|
h('div', {
|
|
87
87
|
class: ['vxe-cell', {
|
|
@@ -125,6 +125,7 @@ function renderHeads(h, _vm, headerGroups) {
|
|
|
125
125
|
const params = { $table: $xeTable, $rowIndex, fixed: fixedType, type: cellType };
|
|
126
126
|
if (columnOpts.drag && columnDragOpts.animation) {
|
|
127
127
|
return h('transition-group', {
|
|
128
|
+
key: $rowIndex,
|
|
128
129
|
props: {
|
|
129
130
|
tag: 'tr',
|
|
130
131
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
@@ -137,6 +138,7 @@ function renderHeads(h, _vm, headerGroups) {
|
|
|
137
138
|
}, renderRows(h, _vm, cols, $rowIndex));
|
|
138
139
|
}
|
|
139
140
|
return h('tr', {
|
|
141
|
+
key: $rowIndex,
|
|
140
142
|
class: [
|
|
141
143
|
'vxe-header--row',
|
|
142
144
|
headerRowClassName ? XEUtils.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''
|
package/es/table/src/methods.js
CHANGED
|
@@ -6728,7 +6728,7 @@ const Methods = {
|
|
|
6728
6728
|
const internalData = $xeTable;
|
|
6729
6729
|
const { lyTimeout, lyRunTime, scrollYStore } = internalData;
|
|
6730
6730
|
const { visibleSize } = scrollYStore;
|
|
6731
|
-
const fpsTime = Math.min(80, Math.floor(visibleSize
|
|
6731
|
+
const fpsTime = Math.min(80, Math.floor(visibleSize));
|
|
6732
6732
|
if (lyTimeout) {
|
|
6733
6733
|
clearTimeout(lyTimeout);
|
|
6734
6734
|
}
|
|
@@ -7378,7 +7378,7 @@ const Methods = {
|
|
|
7378
7378
|
}
|
|
7379
7379
|
};
|
|
7380
7380
|
// Module methods
|
|
7381
|
-
const funcs = 'setFilter,openFilter,clearFilter,saveFilterPanel,resetFilterPanel,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
|
|
7381
|
+
const funcs = 'setFilter,openFilter,clearFilter,saveFilterPanel,resetFilterPanel,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,insertChild,insertChildAt,insertChildNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
|
|
7382
7382
|
funcs.forEach(name => {
|
|
7383
7383
|
Methods[name] = function (...args) {
|
|
7384
7384
|
if (process.env.NODE_ENV === 'development') {
|
package/es/table/src/table.js
CHANGED
|
@@ -708,8 +708,10 @@ export default {
|
|
|
708
708
|
}
|
|
709
709
|
return false;
|
|
710
710
|
},
|
|
711
|
-
|
|
712
|
-
const
|
|
711
|
+
computeTableBorder() {
|
|
712
|
+
const $xeTable = this;
|
|
713
|
+
const props = $xeTable;
|
|
714
|
+
const { border } = props;
|
|
713
715
|
if (border === true) {
|
|
714
716
|
return 'full';
|
|
715
717
|
}
|
|
@@ -1160,11 +1162,12 @@ export default {
|
|
|
1160
1162
|
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
1161
1163
|
const $xeTable = this;
|
|
1162
1164
|
const $xeGrid = $xeTable.$xeGrid;
|
|
1163
|
-
const { _e, $scopedSlots, tId, isCalcColumn, tableData, tableColumn, tableGroupColumn, isGroup, loading, stripe, showHeader, height,
|
|
1165
|
+
const { _e, $scopedSlots, tId, isCalcColumn, tableData, tableColumn, tableGroupColumn, isGroup, loading, stripe, showHeader, height, treeOpts, treeConfig, mouseConfig, mouseOpts, areaOpts, computeSize, validOpts, showFooter, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, validTipOpts, initStore, columnStore, filterStore, customStore, ctxMenuStore, ctxMenuOpts, footerTableData, columnOpts, rowOpts, checkboxOpts, loadingOpts, resizableOpts, editRules } = $xeTable;
|
|
1164
1166
|
const { leftList, rightList } = columnStore;
|
|
1165
1167
|
const loadingSlot = $scopedSlots.loading;
|
|
1166
1168
|
const currLoading = this._isLoading || loading;
|
|
1167
1169
|
const vSize = computeSize;
|
|
1170
|
+
const tableBorder = $xeTable.computeTableBorder;
|
|
1168
1171
|
const virtualScrollBars = $xeTable.computeVirtualScrollBars;
|
|
1169
1172
|
const isArea = mouseConfig && mouseOpts.area;
|
|
1170
1173
|
const tableStyle = $xeTable.computeTableStyle;
|
package/es/table/style.css
CHANGED
|
@@ -1772,22 +1772,6 @@
|
|
|
1772
1772
|
.vxe-footer--column.fixed--width > .vxe-cell .vxe-ico-picker {
|
|
1773
1773
|
width: 100%;
|
|
1774
1774
|
}
|
|
1775
|
-
.vxe-header--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-input,
|
|
1776
|
-
.vxe-header--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-textarea,
|
|
1777
|
-
.vxe-header--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-select,
|
|
1778
|
-
.vxe-header--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-tree-select,
|
|
1779
|
-
.vxe-header--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-date-picker,
|
|
1780
|
-
.vxe-header--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-number-input,
|
|
1781
|
-
.vxe-header--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-ico-picker,
|
|
1782
|
-
.vxe-footer--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-input,
|
|
1783
|
-
.vxe-footer--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-textarea,
|
|
1784
|
-
.vxe-footer--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-select,
|
|
1785
|
-
.vxe-footer--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-tree-select,
|
|
1786
|
-
.vxe-footer--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-date-picker,
|
|
1787
|
-
.vxe-footer--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-number-input,
|
|
1788
|
-
.vxe-footer--column.fixed--width > .vxe-cell .vxe-cell--tree-node .vxe-ico-picker {
|
|
1789
|
-
width: 100%;
|
|
1790
|
-
}
|
|
1791
1775
|
|
|
1792
1776
|
.vxe-body--column.fixed--width > .vxe-cell > .vxe-default-input, .vxe-body--column.fixed--width > .vxe-cell > .vxe-default-textarea, .vxe-body--column.fixed--width > .vxe-cell > .vxe-default-select {
|
|
1793
1777
|
width: 100%;
|
|
@@ -1795,6 +1779,9 @@
|
|
|
1795
1779
|
.vxe-body--column.fixed--width > .vxe-cell > .vxe-input, .vxe-body--column.fixed--width > .vxe-cell > .vxe-textarea, .vxe-body--column.fixed--width > .vxe-cell > .vxe-select, .vxe-body--column.fixed--width > .vxe-cell > .vxe-tree-select, .vxe-body--column.fixed--width > .vxe-cell > .vxe-date-picker, .vxe-body--column.fixed--width > .vxe-cell > .vxe-number-input, .vxe-body--column.fixed--width > .vxe-cell > .vxe-ico-picker {
|
|
1796
1780
|
width: 100%;
|
|
1797
1781
|
}
|
|
1782
|
+
.vxe-body--column.fixed--width > .vxe-cell > .vxe-cell--tree-node .vxe-default-input,
|
|
1783
|
+
.vxe-body--column.fixed--width > .vxe-cell > .vxe-cell--tree-node .vxe-default-textarea,
|
|
1784
|
+
.vxe-body--column.fixed--width > .vxe-cell > .vxe-cell--tree-node .vxe-default-select,
|
|
1798
1785
|
.vxe-body--column.fixed--width > .vxe-cell > .vxe-cell--tree-node .vxe-input,
|
|
1799
1786
|
.vxe-body--column.fixed--width > .vxe-cell > .vxe-cell--tree-node .vxe-textarea,
|
|
1800
1787
|
.vxe-body--column.fixed--width > .vxe-cell > .vxe-cell--tree-node .vxe-select,
|
|
@@ -1811,15 +1798,6 @@
|
|
|
1811
1798
|
.vxe-table--filter-template > .vxe-input, .vxe-table--filter-template > .vxe-textarea, .vxe-table--filter-template > .vxe-select, .vxe-table--filter-template > .vxe-tree-select, .vxe-table--filter-template > .vxe-date-picker, .vxe-table--filter-template > .vxe-number-input, .vxe-table--filter-template > .vxe-ico-picker {
|
|
1812
1799
|
width: 100%;
|
|
1813
1800
|
}
|
|
1814
|
-
.vxe-table--filter-template > .vxe-cell--tree-node .vxe-input,
|
|
1815
|
-
.vxe-table--filter-template > .vxe-cell--tree-node .vxe-textarea,
|
|
1816
|
-
.vxe-table--filter-template > .vxe-cell--tree-node .vxe-select,
|
|
1817
|
-
.vxe-table--filter-template > .vxe-cell--tree-node .vxe-tree-select,
|
|
1818
|
-
.vxe-table--filter-template > .vxe-cell--tree-node .vxe-date-picker,
|
|
1819
|
-
.vxe-table--filter-template > .vxe-cell--tree-node .vxe-number-input,
|
|
1820
|
-
.vxe-table--filter-template > .vxe-cell--tree-node .vxe-ico-picker {
|
|
1821
|
-
width: 100%;
|
|
1822
|
-
}
|
|
1823
1801
|
|
|
1824
1802
|
.vxe-cell .vxe-default-input,
|
|
1825
1803
|
.vxe-cell .vxe-default-textarea,
|