vxe-table 3.21.16 → 3.21.18
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 +17 -19
- 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/custom/panel.js +7 -3
- package/es/table/module/edit/mixin.js +2 -1
- package/es/table/module/export/export-panel.js +2 -1
- package/es/table/module/export/import-panel.js +2 -1
- package/es/table/module/export/mixin.js +2 -1
- package/es/table/module/filter/panel.js +2 -1
- package/es/table/module/menu/mixin.js +2 -1
- package/es/table/module/validator/mixin.js +2 -1
- package/es/table/render/index.js +2 -1
- package/es/table/src/columnInfo.js +8 -7
- package/es/table/src/footer.js +5 -5
- package/es/table/src/header.js +10 -8
- package/es/table/src/methods.js +10 -3
- package/es/table/src/table.js +2 -1
- package/es/table/src/util.js +2 -1
- package/es/toolbar/src/toolbar.js +19 -21
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +12 -3
- package/lib/grid/src/grid.js +24 -21
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1237 -1163
- 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/custom/panel.js +13 -7
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +19 -15
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +8 -5
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +6 -3
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +18 -14
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +4 -1
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/menu/mixin.js +5 -2
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +8 -4
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +4 -1
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/columnInfo.js +21 -11
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +5 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +12 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +43 -42
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +78 -74
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +6 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +24 -21
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +13 -3
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +3 -3
- package/packages/grid/src/grid.ts +20 -16
- package/packages/table/module/custom/panel.ts +8 -3
- package/packages/table/module/edit/mixin.ts +3 -1
- package/packages/table/module/export/export-panel.ts +3 -1
- package/packages/table/module/export/import-panel.ts +3 -1
- package/packages/table/module/export/mixin.ts +3 -1
- package/packages/table/module/filter/panel.ts +3 -1
- package/packages/table/module/menu/mixin.ts +3 -1
- package/packages/table/module/validator/mixin.ts +3 -1
- package/packages/table/render/index.ts +3 -1
- package/packages/table/src/columnInfo.ts +3 -1
- package/packages/table/src/footer.ts +5 -5
- package/packages/table/src/header.ts +10 -8
- package/packages/table/src/methods.ts +9 -2
- package/packages/table/src/table.ts +3 -1
- package/packages/table/src/util.ts +5 -17
- package/packages/toolbar/src/toolbar.ts +23 -18
- package/packages/ui/src/log.ts +13 -3
- package/styles/theme/dark.scss +1 -1
- package/styles/variable.scss +1 -1
- /package/es/{iconfont.1781753790081.ttf → iconfont.1782186465261.ttf} +0 -0
- /package/es/{iconfont.1781753790081.woff → iconfont.1782186465261.woff} +0 -0
- /package/es/{iconfont.1781753790081.woff2 → iconfont.1782186465261.woff2} +0 -0
- /package/lib/{iconfont.1781753790081.ttf → iconfont.1782186465261.ttf} +0 -0
- /package/lib/{iconfont.1781753790081.woff → iconfont.1782186465261.woff} +0 -0
- /package/lib/{iconfont.1781753790081.woff2 → iconfont.1782186465261.woff2} +0 -0
|
@@ -2,8 +2,9 @@ import { defineVxeComponent } from '../../../ui/src/comp';
|
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import { formatText } from '../../../ui/src/utils';
|
|
4
4
|
import { getTpImg, addClass, removeClass, hasControlKey } from '../../../ui/src/dom';
|
|
5
|
-
import {
|
|
5
|
+
import { createComponentLog } from '../../../ui/src/log';
|
|
6
6
|
import XEUtils from 'xe-utils';
|
|
7
|
+
const { errLog } = createComponentLog('table');
|
|
7
8
|
const { getI18n, getIcon, renderEmptyElement } = VxeUI;
|
|
8
9
|
function showDropTip($xeTableCustomPanel, evnt, optEl, showLine, dragPos) {
|
|
9
10
|
const customPanelInternalData = $xeTableCustomPanel.internalData;
|
|
@@ -1187,8 +1188,11 @@ export default {
|
|
|
1187
1188
|
const resizeParams = {
|
|
1188
1189
|
$table: $xeTable,
|
|
1189
1190
|
column,
|
|
1190
|
-
columnIndex:
|
|
1191
|
-
$columnIndex:
|
|
1191
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
1192
|
+
$columnIndex: $xeTable.getVMColumnIndex(column),
|
|
1193
|
+
_columnIndex: $xeTable.getVTColumnIndex(column),
|
|
1194
|
+
rowIndex: -1,
|
|
1195
|
+
_rowIndex: -1,
|
|
1192
1196
|
$rowIndex: -1
|
|
1193
1197
|
};
|
|
1194
1198
|
if (reMinWidth) {
|
|
@@ -3,7 +3,8 @@ import { VxeUI } from '../../../ui';
|
|
|
3
3
|
import { isEnableConf } from '../../../ui/src/utils';
|
|
4
4
|
import { getCellValue, setCellValue, getRowid } from '../../src/util';
|
|
5
5
|
import { removeClass, addClass } from '../../../ui/src/dom';
|
|
6
|
-
import {
|
|
6
|
+
import { createComponentLog } from '../../../ui/src/log';
|
|
7
|
+
const { warnLog, errLog } = createComponentLog('table');
|
|
7
8
|
const { getConfig, renderer, getI18n } = VxeUI;
|
|
8
9
|
const browseObj = XEUtils.browse();
|
|
9
10
|
function getEditColumnModel(row, column) {
|
|
@@ -2,7 +2,8 @@ import { defineVxeComponent } from '../../../ui/src/comp';
|
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
import { formatText } from '../../../ui/src/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { createComponentLog } from '../../../ui/src/log';
|
|
6
|
+
const { errLog } = createComponentLog('table');
|
|
6
7
|
const { getI18n, getIcon, globalMixins, renderEmptyElement } = VxeUI;
|
|
7
8
|
export default {
|
|
8
9
|
name: 'VxeTableExportPanel',
|
|
@@ -2,7 +2,8 @@ import { defineVxeComponent } from '../../../ui/src/comp';
|
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
import { parseFile } from '../../../ui/src/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { createComponentLog } from '../../../ui/src/log';
|
|
6
|
+
const { errLog } = createComponentLog('table');
|
|
6
7
|
const { getI18n, getIcon, globalMixins, renderEmptyElement } = VxeUI;
|
|
7
8
|
export default {
|
|
8
9
|
name: 'VxeTableImportPanel',
|
|
@@ -4,7 +4,8 @@ import { isColumnInfo, getCellValue, createHandleGetRowId } from '../../src/util
|
|
|
4
4
|
import { parseFile, formatText, eqEmptyValue } from '../../../ui/src/utils';
|
|
5
5
|
import { hasClass } from '../../../ui/src/dom';
|
|
6
6
|
import { createHtmlPage, getExportBlobByContent } from './util';
|
|
7
|
-
import {
|
|
7
|
+
import { createComponentLog } from '../../../ui/src/log';
|
|
8
|
+
const { warnLog, errLog } = createComponentLog('table');
|
|
8
9
|
const { getI18n, renderer } = VxeUI;
|
|
9
10
|
let htmlCellElem;
|
|
10
11
|
const csvBOM = '\ufeff';
|
|
@@ -3,7 +3,8 @@ import { VxeUI } from '../../../ui';
|
|
|
3
3
|
import { formatText, isEnableConf } from '../../../ui/src/utils';
|
|
4
4
|
import { getPropClass, toCssUnit } from '../../../ui/src/dom';
|
|
5
5
|
import { getSlotVNs } from '../../../ui/src/vn';
|
|
6
|
-
import {
|
|
6
|
+
import { createComponentLog } from '../../../ui/src/log';
|
|
7
|
+
const { warnLog } = createComponentLog('table');
|
|
7
8
|
const { getI18n, getIcon, renderer, globalMixins, renderEmptyElement } = VxeUI;
|
|
8
9
|
// 全部筛选事件
|
|
9
10
|
function filterCheckAllEvent($xeFilterPanel, evnt, value) {
|
|
@@ -2,7 +2,8 @@ import XEUtils from 'xe-utils';
|
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import { getDomNode, getAbsolutePos, getEventTargetNode } from '../../../ui/src/dom';
|
|
4
4
|
import { isEnableConf, hasChildrenList } from '../../../ui/src/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { createComponentLog } from '../../../ui/src/log';
|
|
6
|
+
const { warnLog } = createComponentLog('table');
|
|
6
7
|
const { menus, globalEvents, GLOBAL_EVENT_KEYS } = VxeUI;
|
|
7
8
|
export default {
|
|
8
9
|
methods: {
|
|
@@ -3,7 +3,8 @@ import { VxeUI } from '../../../ui';
|
|
|
3
3
|
import { eqEmptyValue, getFuncText } from '../../../ui/src/utils';
|
|
4
4
|
import { scrollToView } from '../../../ui/src/dom';
|
|
5
5
|
import { handleFieldOrColumn, getRowid } from '../../src/util';
|
|
6
|
-
import {
|
|
6
|
+
import { createComponentLog } from '../../../ui/src/log';
|
|
7
|
+
const { warnLog, errLog } = createComponentLog('table');
|
|
7
8
|
const { getConfig, validators } = VxeUI;
|
|
8
9
|
/**
|
|
9
10
|
* 校验规则
|
package/es/table/render/index.js
CHANGED
|
@@ -3,7 +3,8 @@ import { VxeUI } from '../../ui';
|
|
|
3
3
|
import { getCellValue, setCellValue } from '../src/util';
|
|
4
4
|
import { getFuncText, formatText, isEmptyValue } from '../../ui/src/utils';
|
|
5
5
|
import { getOnName, getModelEvent, getChangeEvent, hasInputType } from '../../ui/src/vn';
|
|
6
|
-
import {
|
|
6
|
+
import { createComponentLog } from '../../ui/src/log';
|
|
7
|
+
const { errLog } = createComponentLog('table');
|
|
7
8
|
const { getConfig, renderer, getI18n, getComponent } = VxeUI;
|
|
8
9
|
const componentDefaultModelProp = 'value';
|
|
9
10
|
const defaultCompProps = {};
|
|
@@ -3,7 +3,8 @@ import { VxeUI } from '../../ui';
|
|
|
3
3
|
import { toFilters } from './util';
|
|
4
4
|
import { isEnableConf, getFuncText } from '../../ui/src/utils';
|
|
5
5
|
import { isPx } from '../../ui/src/dom';
|
|
6
|
-
import {
|
|
6
|
+
import { createComponentLog } from '../../ui/src/log';
|
|
7
|
+
const { warnLog, errLog } = createComponentLog('table');
|
|
7
8
|
const { getI18n, formats, renderer } = VxeUI;
|
|
8
9
|
export class ColumnInfo {
|
|
9
10
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
@@ -151,11 +152,11 @@ export class ColumnInfo {
|
|
|
151
152
|
// 跨列
|
|
152
153
|
colSpan: 1,
|
|
153
154
|
// 数据排序
|
|
154
|
-
order: null,
|
|
155
|
-
sortTime: 0,
|
|
155
|
+
order: null, // 用于记录排序类型,升序和倒序
|
|
156
|
+
sortTime: 0, // 用于多列的先后顺序
|
|
156
157
|
// 列排序
|
|
157
|
-
sortNumber: 0,
|
|
158
|
-
renderSortNumber: 0,
|
|
158
|
+
sortNumber: 0, // 用于记录自定义列顺序
|
|
159
|
+
renderSortNumber: 0, // 用于记录自定义列顺序
|
|
159
160
|
renderAggFn: '',
|
|
160
161
|
renderAggDigits: null,
|
|
161
162
|
renderAggFormat: null,
|
|
@@ -165,9 +166,9 @@ export class ColumnInfo {
|
|
|
165
166
|
renderHeight: 0,
|
|
166
167
|
renderResizeWidth: 0,
|
|
167
168
|
renderAutoWidth: 0,
|
|
168
|
-
resizeWidth: 0,
|
|
169
|
+
resizeWidth: 0, // 手动调整
|
|
169
170
|
renderLeft: 0,
|
|
170
|
-
renderArgs: [],
|
|
171
|
+
renderArgs: [], // 渲染参数可用于扩展
|
|
171
172
|
model: {},
|
|
172
173
|
renderHeader: renderHeader || colConfs.renderHeader,
|
|
173
174
|
renderCell: renderCell || colConfs.renderCell,
|
package/es/table/src/footer.js
CHANGED
|
@@ -194,17 +194,17 @@ function renderHeads(h, _vm, isOptimizeMode, renderColumnList) {
|
|
|
194
194
|
const tableProps = $xeTable;
|
|
195
195
|
const { fixedType, footerTableData } = props;
|
|
196
196
|
const { footerRowClassName, footerRowStyle } = tableProps;
|
|
197
|
-
return footerTableData.map((row,
|
|
198
|
-
const
|
|
199
|
-
const rowParams = { $table: $xeTable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType };
|
|
197
|
+
return footerTableData.map((row, _rowIndex) => {
|
|
198
|
+
const $rowIndex = _rowIndex;
|
|
199
|
+
const rowParams = { $table: $xeTable, row, rowIndex: _rowIndex, _rowIndex, $rowIndex, fixed: fixedType, type: renderType };
|
|
200
200
|
return h('tr', {
|
|
201
|
-
key:
|
|
201
|
+
key: _rowIndex,
|
|
202
202
|
class: [
|
|
203
203
|
'vxe-footer--row',
|
|
204
204
|
footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''
|
|
205
205
|
],
|
|
206
206
|
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) : undefined
|
|
207
|
-
}, renderRows(h, _vm, isOptimizeMode, renderColumnList, footerTableData, row,
|
|
207
|
+
}, renderRows(h, _vm, isOptimizeMode, renderColumnList, footerTableData, row, _rowIndex, _rowIndex));
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
export default {
|
package/es/table/src/header.js
CHANGED
|
@@ -7,7 +7,7 @@ import { getSlotVNs } from '../../ui/src/vn';
|
|
|
7
7
|
const { renderer, renderEmptyElement } = VxeUI;
|
|
8
8
|
const sourceType = 'table';
|
|
9
9
|
const renderType = 'header';
|
|
10
|
-
function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups,
|
|
10
|
+
function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, _rowIndex, cols) {
|
|
11
11
|
const props = _vm;
|
|
12
12
|
const $xeTable = _vm.$parent;
|
|
13
13
|
const $xeGrid = $xeTable.$xeGrid;
|
|
@@ -27,7 +27,7 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, co
|
|
|
27
27
|
const headerCellOpts = $xeTable.computeHeaderCellOpts;
|
|
28
28
|
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
29
29
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts;
|
|
30
|
-
const isLastRow =
|
|
30
|
+
const isLastRow = _rowIndex === headerGroups.length - 1;
|
|
31
31
|
return cols.map((column, $columnIndex) => {
|
|
32
32
|
const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column;
|
|
33
33
|
// const { enabled } = tooltipOpts
|
|
@@ -56,7 +56,9 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, co
|
|
|
56
56
|
$table: $xeTable,
|
|
57
57
|
$grid: $xeGrid,
|
|
58
58
|
$gantt: $xeGantt,
|
|
59
|
-
|
|
59
|
+
rowIndex: _rowIndex,
|
|
60
|
+
_rowIndex,
|
|
61
|
+
$rowIndex: _rowIndex,
|
|
60
62
|
column,
|
|
61
63
|
columnIndex,
|
|
62
64
|
$columnIndex,
|
|
@@ -78,7 +80,7 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, co
|
|
|
78
80
|
thAttrs.rowspan = column.rowSpan > 1 ? column.rowSpan : null;
|
|
79
81
|
}
|
|
80
82
|
if (mergeHeadFlag && mergeHeaderList.length && (showCustomHeader || isLastRow)) {
|
|
81
|
-
const spanRest = mergeHeaderCellMaps[`${
|
|
83
|
+
const spanRest = mergeHeaderCellMaps[`${_rowIndex}:${showCustomHeader ? $columnIndex : _columnIndex}`];
|
|
82
84
|
if (spanRest) {
|
|
83
85
|
const { rowspan, colspan } = spanRest;
|
|
84
86
|
if (!rowspan || !colspan) {
|
|
@@ -317,16 +319,16 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups, renderColumn
|
|
|
317
319
|
const { fixedType } = props;
|
|
318
320
|
const { headerRowClassName, headerRowStyle } = tableProps;
|
|
319
321
|
const floatingFilterOpts = $xeTable.computeFloatingFilterOpts;
|
|
320
|
-
const rowVNs = headerGroups.map((cols,
|
|
321
|
-
const params = { $table: $xeTable, $rowIndex, fixed: fixedType, type: renderType };
|
|
322
|
+
const rowVNs = headerGroups.map((cols, _rowIndex) => {
|
|
323
|
+
const params = { $table: $xeTable, rowIndex: _rowIndex, _rowIndex, $rowIndex: _rowIndex, fixed: fixedType, type: renderType };
|
|
322
324
|
return h('tr', {
|
|
323
|
-
key:
|
|
325
|
+
key: _rowIndex,
|
|
324
326
|
class: [
|
|
325
327
|
'vxe-header--row',
|
|
326
328
|
headerRowClassName ? XEUtils.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''
|
|
327
329
|
],
|
|
328
330
|
style: headerRowStyle ? (XEUtils.isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle) : undefined
|
|
329
|
-
}, renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups,
|
|
331
|
+
}, renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, _rowIndex, cols));
|
|
330
332
|
});
|
|
331
333
|
if (floatingFilterOpts.enabled) {
|
|
332
334
|
rowVNs.push(h('tr', {
|
package/es/table/src/methods.js
CHANGED
|
@@ -6,8 +6,9 @@ import Cell from './cell';
|
|
|
6
6
|
import { getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight, getLastChildColumn, getRowMaxHeight } from './util';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
8
8
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime';
|
|
9
|
-
import {
|
|
9
|
+
import { createComponentLog } from '../../ui/src/log';
|
|
10
10
|
import { getCrossTableDragRowInfo } from './store';
|
|
11
|
+
const { warnLog, errLog } = createComponentLog('table');
|
|
11
12
|
const { getConfig, getI18n, renderer, formats, interceptor, createEvent, globalEvents, GLOBAL_EVENT_KEYS } = VxeUI;
|
|
12
13
|
const browseObj = XEUtils.browse();
|
|
13
14
|
const supportMaxRow = 5e6;
|
|
@@ -9533,7 +9534,13 @@ const tableMethods = {
|
|
|
9533
9534
|
}
|
|
9534
9535
|
if (editOpts.trigger === 'manual') {
|
|
9535
9536
|
if (actived.args && actived.row === row && column !== actived.column) {
|
|
9536
|
-
|
|
9537
|
+
if (editOpts.mode === 'row') {
|
|
9538
|
+
handleChangeCell($xeTable, evnt, params);
|
|
9539
|
+
}
|
|
9540
|
+
else {
|
|
9541
|
+
checkValidate($xeTable, 'blur')
|
|
9542
|
+
.catch((e) => e);
|
|
9543
|
+
}
|
|
9537
9544
|
}
|
|
9538
9545
|
}
|
|
9539
9546
|
else if (!actived.args || row !== actived.row || column !== actived.column) {
|
|
@@ -11190,7 +11197,7 @@ const tableMethods = {
|
|
|
11190
11197
|
style: null,
|
|
11191
11198
|
options: [],
|
|
11192
11199
|
column: null,
|
|
11193
|
-
multiple: false,
|
|
11200
|
+
multiple: false, // 选项是覅多选
|
|
11194
11201
|
visible: false
|
|
11195
11202
|
});
|
|
11196
11203
|
}
|
package/es/table/src/table.js
CHANGED
|
@@ -9,7 +9,7 @@ import TableHeaderComponent from './header';
|
|
|
9
9
|
import TableFooterComponent from './footer';
|
|
10
10
|
import { tableProps } from './props';
|
|
11
11
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
12
|
-
import {
|
|
12
|
+
import { createComponentLog } from '../../ui/src/log';
|
|
13
13
|
import { crossTableDragRowGlobal, getCrossTableDragRowInfo } from './store';
|
|
14
14
|
import TableCustomPanelComponent from '../module/custom/panel';
|
|
15
15
|
import TableFilterPanelComponent from '../module/filter/panel';
|
|
@@ -23,6 +23,7 @@ import exportMixin from '../module/export/mixin';
|
|
|
23
23
|
import keyboardMixin from '../module/keyboard/mixin';
|
|
24
24
|
import validatorMixin from '../module/validator/mixin';
|
|
25
25
|
import customMixin from '../module/custom/mixin';
|
|
26
|
+
const { warnLog, errLog } = createComponentLog('table');
|
|
26
27
|
const { getConfig, getIcon, getI18n, renderer, globalResize, globalEvents, globalMixins, renderEmptyElement } = VxeUI;
|
|
27
28
|
function handleUpdateMergeBodyCells($xeTable, merges) {
|
|
28
29
|
const internalData = $xeTable;
|
package/es/table/src/util.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { ColumnInfo } from './columnInfo';
|
|
3
3
|
import { isScale, isPx, queryElement } from '../../ui/src/dom';
|
|
4
|
-
import {
|
|
4
|
+
import { createComponentLog } from '../../ui/src/log';
|
|
5
5
|
import { eqEmptyValue } from '../../ui/src/utils';
|
|
6
|
+
const { warnLog, errLog } = createComponentLog('table');
|
|
6
7
|
export function createInternalData() {
|
|
7
8
|
return {
|
|
8
9
|
tZindex: 0,
|
|
@@ -2,7 +2,8 @@ import { defineVxeComponent } from '../../ui/src/comp';
|
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { VxeUI } from '../../ui';
|
|
4
4
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
5
|
-
import {
|
|
5
|
+
import { createComponentLog } from '../../ui/src/log';
|
|
6
|
+
const { warnLog, errLog } = createComponentLog('toolbar');
|
|
6
7
|
const { getConfig, getIcon, getI18n, renderer, commands, createEvent, globalMixins, renderEmptyElement } = VxeUI;
|
|
7
8
|
function createReactData() {
|
|
8
9
|
return {
|
|
@@ -64,12 +65,8 @@ export default {
|
|
|
64
65
|
data() {
|
|
65
66
|
const xID = XEUtils.uniqueId();
|
|
66
67
|
const reactData = createReactData();
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
xID,
|
|
70
|
-
reactData,
|
|
71
|
-
internalData
|
|
72
|
-
};
|
|
68
|
+
return Object.assign(Object.assign({}, {}), { xID,
|
|
69
|
+
reactData });
|
|
73
70
|
},
|
|
74
71
|
computed: Object.assign(Object.assign({}, {}), { computeRefreshOpts() {
|
|
75
72
|
const $xeToolbar = this;
|
|
@@ -224,7 +221,7 @@ export default {
|
|
|
224
221
|
$xeGGWrapper.triggerZoomEvent($event);
|
|
225
222
|
}
|
|
226
223
|
else {
|
|
227
|
-
warnLog('vxe.error.notProp', ['
|
|
224
|
+
warnLog('vxe.error.notProp', ['zoom']);
|
|
228
225
|
}
|
|
229
226
|
},
|
|
230
227
|
importEvent() {
|
|
@@ -352,7 +349,7 @@ export default {
|
|
|
352
349
|
tCommandMethod(params);
|
|
353
350
|
}
|
|
354
351
|
else {
|
|
355
|
-
errLog('vxe.error.notCommands', [
|
|
352
|
+
errLog('vxe.error.notCommands', [code]);
|
|
356
353
|
}
|
|
357
354
|
}
|
|
358
355
|
$xeToolbar.dispatchEvent('button-click', params, $event);
|
|
@@ -384,7 +381,7 @@ export default {
|
|
|
384
381
|
tCommandMethod(params);
|
|
385
382
|
}
|
|
386
383
|
else {
|
|
387
|
-
errLog('vxe.error.notCommands', [
|
|
384
|
+
errLog('vxe.error.notCommands', [code]);
|
|
388
385
|
}
|
|
389
386
|
}
|
|
390
387
|
$xeToolbar.dispatchEvent('tool-click', params, $event);
|
|
@@ -725,46 +722,47 @@ export default {
|
|
|
725
722
|
const $xeGrid = $xeToolbar.$xeGrid;
|
|
726
723
|
const $xeGantt = $xeToolbar.$xeGantt;
|
|
727
724
|
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
725
|
+
$xeToolbar.internalData = createInternalData();
|
|
728
726
|
$xeToolbar.$nextTick(() => {
|
|
729
727
|
const refreshOpts = $xeToolbar.computeRefreshOpts;
|
|
730
728
|
const $xeTable = $xeToolbar.fintTable();
|
|
731
729
|
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
732
730
|
if (props.refresh && !$xeGGWrapper && !queryMethod) {
|
|
733
|
-
warnLog('vxe.error.notFunc', ['
|
|
731
|
+
warnLog('vxe.error.notFunc', ['queryMethod']);
|
|
734
732
|
}
|
|
735
733
|
if (XEUtils.isPlainObject(props.custom)) {
|
|
736
|
-
warnLog('vxe.error.delProp', ['
|
|
734
|
+
warnLog('vxe.error.delProp', ['custom={...}', 'custom=boolean & custom-options={...}']);
|
|
737
735
|
}
|
|
738
736
|
if (XEUtils.isPlainObject(props.print)) {
|
|
739
|
-
warnLog('vxe.error.delProp', ['
|
|
737
|
+
warnLog('vxe.error.delProp', ['print={...}', 'print=boolean & print-options={...}']);
|
|
740
738
|
}
|
|
741
739
|
if (XEUtils.isPlainObject(props.export)) {
|
|
742
|
-
warnLog('vxe.error.delProp', ['
|
|
740
|
+
warnLog('vxe.error.delProp', ['export={...}', 'export=boolean & export-options={...}']);
|
|
743
741
|
}
|
|
744
742
|
if (XEUtils.isPlainObject(props.import)) {
|
|
745
|
-
warnLog('vxe.error.delProp', ['
|
|
743
|
+
warnLog('vxe.error.delProp', ['import={...}', 'import=boolean & import-options={...}']);
|
|
746
744
|
}
|
|
747
745
|
if (XEUtils.isPlainObject(props.refresh)) {
|
|
748
|
-
warnLog('vxe.error.delProp', ['
|
|
746
|
+
warnLog('vxe.error.delProp', ['refresh={...}', 'refresh=boolean & refresh-options={...}']);
|
|
749
747
|
}
|
|
750
748
|
if (XEUtils.isPlainObject(props.refresh)) {
|
|
751
|
-
warnLog('vxe.error.delProp', ['
|
|
749
|
+
warnLog('vxe.error.delProp', ['zoom={...}', 'zoom=boolean & zoom-options={...}']);
|
|
752
750
|
}
|
|
753
751
|
if ($xeTable) {
|
|
754
752
|
$xeTable.connect($xeToolbar);
|
|
755
753
|
}
|
|
756
754
|
const customOpts = $xeToolbar.computeCustomOpts;
|
|
757
755
|
if (customOpts.isFooter) {
|
|
758
|
-
warnLog('vxe.error.delProp', ['
|
|
756
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
|
|
759
757
|
}
|
|
760
758
|
if (customOpts.showFooter) {
|
|
761
|
-
warnLog('vxe.error.delProp', ['
|
|
759
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter']);
|
|
762
760
|
}
|
|
763
761
|
if (customOpts.immediate) {
|
|
764
|
-
warnLog('vxe.error.delProp', ['
|
|
762
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate']);
|
|
765
763
|
}
|
|
766
764
|
if (customOpts.trigger) {
|
|
767
|
-
warnLog('vxe.error.delProp', ['
|
|
765
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
|
|
768
766
|
}
|
|
769
767
|
});
|
|
770
768
|
// 使用已安装的组件,如果未安装则不渲染
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
const { log } = VxeUI;
|
|
3
|
-
const
|
|
4
|
-
export
|
|
5
|
-
|
|
3
|
+
const tableVersion = `table v${"3.21.18"}`;
|
|
4
|
+
export function createComponentLog(name) {
|
|
5
|
+
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
6
|
+
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
7
|
+
const designVersion = VxeUI.designVersion ? `design v${VxeUI.designVersion}` : '';
|
|
8
|
+
return {
|
|
9
|
+
warnLog: log.create('warn', uiVersion + tableVersion + ganttVersion + designVersion + '] [' + name),
|
|
10
|
+
errLog: log.create('error', uiVersion + tableVersion + ganttVersion + designVersion + '] [' + name)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export const warnLog = log.create('warn', tableVersion);
|
|
14
|
+
export const errLog = log.create('error', tableVersion);
|
package/lib/grid/src/grid.js
CHANGED
|
@@ -15,6 +15,10 @@ var _props = require("../../table/src/props");
|
|
|
15
15
|
var _table = _interopRequireDefault(require("../../table/src/table"));
|
|
16
16
|
var _toolbar = _interopRequireDefault(require("../../toolbar/src/toolbar"));
|
|
17
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
const {
|
|
19
|
+
warnLog,
|
|
20
|
+
errLog
|
|
21
|
+
} = (0, _log.createComponentLog)('grid');
|
|
18
22
|
const {
|
|
19
23
|
getConfig,
|
|
20
24
|
getI18n,
|
|
@@ -110,12 +114,10 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
110
114
|
data() {
|
|
111
115
|
const xID = _xeUtils.default.uniqueId();
|
|
112
116
|
const reactData = createReactData();
|
|
113
|
-
|
|
114
|
-
return {
|
|
117
|
+
return Object.assign(Object.assign({}, {}), {
|
|
115
118
|
xID,
|
|
116
|
-
reactData
|
|
117
|
-
|
|
118
|
-
};
|
|
119
|
+
reactData
|
|
120
|
+
});
|
|
119
121
|
},
|
|
120
122
|
computed: Object.assign(Object.assign({}, {}), {
|
|
121
123
|
isRespMsg() {
|
|
@@ -904,7 +906,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
904
906
|
};
|
|
905
907
|
});
|
|
906
908
|
} else {
|
|
907
|
-
|
|
909
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.query']);
|
|
908
910
|
}
|
|
909
911
|
break;
|
|
910
912
|
}
|
|
@@ -952,7 +954,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
952
954
|
};
|
|
953
955
|
});
|
|
954
956
|
} else {
|
|
955
|
-
|
|
957
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.queryFooter']);
|
|
956
958
|
}
|
|
957
959
|
break;
|
|
958
960
|
}
|
|
@@ -1044,7 +1046,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
1044
1046
|
}
|
|
1045
1047
|
}
|
|
1046
1048
|
} else {
|
|
1047
|
-
|
|
1049
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.delete']);
|
|
1048
1050
|
}
|
|
1049
1051
|
break;
|
|
1050
1052
|
}
|
|
@@ -1152,7 +1154,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
1152
1154
|
}
|
|
1153
1155
|
});
|
|
1154
1156
|
} else {
|
|
1155
|
-
|
|
1157
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.save']);
|
|
1156
1158
|
}
|
|
1157
1159
|
break;
|
|
1158
1160
|
}
|
|
@@ -1170,7 +1172,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
1170
1172
|
$gantt: null
|
|
1171
1173
|
}, ...args);
|
|
1172
1174
|
} else {
|
|
1173
|
-
|
|
1175
|
+
errLog('vxe.error.notCommands', [code]);
|
|
1174
1176
|
}
|
|
1175
1177
|
}
|
|
1176
1178
|
}
|
|
@@ -1604,7 +1606,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
1604
1606
|
_xeUtils.default.each(column.slots, func => {
|
|
1605
1607
|
if (!_xeUtils.default.isFunction(func)) {
|
|
1606
1608
|
if (!slots[func]) {
|
|
1607
|
-
|
|
1609
|
+
errLog('vxe.error.notSlot', [func]);
|
|
1608
1610
|
}
|
|
1609
1611
|
}
|
|
1610
1612
|
});
|
|
@@ -1627,7 +1629,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
1627
1629
|
if (slots[slotFunc]) {
|
|
1628
1630
|
slotConf[slotKey] = slots[slotFunc];
|
|
1629
1631
|
} else {
|
|
1630
|
-
|
|
1632
|
+
errLog('vxe.error.notSlot', [slotFunc]);
|
|
1631
1633
|
}
|
|
1632
1634
|
} else {
|
|
1633
1635
|
slotConf[slotKey] = slotFunc;
|
|
@@ -1643,10 +1645,10 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
1643
1645
|
const toolbarOptSlots = toolbarOpts.slots;
|
|
1644
1646
|
const toolbarSlots = {};
|
|
1645
1647
|
if (slots.buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
|
|
1646
|
-
|
|
1648
|
+
warnLog('vxe.error.reqProp', ['[grid] toolbar-config.slots.buttons']);
|
|
1647
1649
|
}
|
|
1648
1650
|
if (slots.tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
|
|
1649
|
-
|
|
1651
|
+
warnLog('vxe.error.reqProp', ['[grid] toolbar-config.slots.tools']);
|
|
1650
1652
|
}
|
|
1651
1653
|
if (toolbarOptSlots) {
|
|
1652
1654
|
const buttonsSlot = $xeGrid.getFuncSlot(toolbarOptSlots, 'buttons');
|
|
@@ -1685,7 +1687,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
1685
1687
|
if (slots[funcSlot]) {
|
|
1686
1688
|
return slots[funcSlot];
|
|
1687
1689
|
} else {
|
|
1688
|
-
|
|
1690
|
+
errLog('vxe.error.notSlot', [funcSlot]);
|
|
1689
1691
|
}
|
|
1690
1692
|
} else {
|
|
1691
1693
|
return funcSlot;
|
|
@@ -1927,7 +1929,7 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
1927
1929
|
childVNs.push($xeGrid.renderPager(h));
|
|
1928
1930
|
break;
|
|
1929
1931
|
default:
|
|
1930
|
-
|
|
1932
|
+
errLog('vxe.error.notProp', [`layouts -> ${key}`]);
|
|
1931
1933
|
break;
|
|
1932
1934
|
}
|
|
1933
1935
|
});
|
|
@@ -1986,29 +1988,30 @@ var _default = exports.default = /* define-vxe-component start */(0, _comp.defin
|
|
|
1986
1988
|
const VxeUIPagerComponent = _ui.VxeUI.getComponent('VxePager');
|
|
1987
1989
|
const $xeGrid = this;
|
|
1988
1990
|
const props = $xeGrid;
|
|
1991
|
+
$xeGrid.internalData = createInternalData();
|
|
1989
1992
|
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1990
1993
|
// const { data, formOpts, proxyOpts, proxyConfig } = this
|
|
1991
1994
|
// if (proxyConfig && (data || (proxyOpts.form && formOpts.data))) {
|
|
1992
1995
|
// errLog('vxe.error.errConflicts', ['[grid] data', 'proxy-config'])
|
|
1993
1996
|
// }
|
|
1994
1997
|
if (props.toolbar) {
|
|
1995
|
-
|
|
1998
|
+
errLog('vxe.error.delProp', ['toolbar', 'toolbar-config']);
|
|
1996
1999
|
}
|
|
1997
2000
|
if (props.toolbarConfig && !_xeUtils.default.isObject(props.toolbarConfig)) {
|
|
1998
|
-
|
|
2001
|
+
errLog('vxe.error.errProp', [`toolbar-config=${props.toolbarConfig}`, 'toolbar-config={}']);
|
|
1999
2002
|
}
|
|
2000
2003
|
if (proxyOpts.props) {
|
|
2001
|
-
|
|
2004
|
+
warnLog('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response']);
|
|
2002
2005
|
}
|
|
2003
2006
|
$xeGrid.$nextTick(() => {
|
|
2004
2007
|
if (props.formConfig) {
|
|
2005
2008
|
if (!VxeUIFormComponent) {
|
|
2006
|
-
|
|
2009
|
+
errLog('vxe.error.reqComp', ['vxe-form']);
|
|
2007
2010
|
}
|
|
2008
2011
|
}
|
|
2009
2012
|
if (props.pagerConfig) {
|
|
2010
2013
|
if (!VxeUIPagerComponent) {
|
|
2011
|
-
|
|
2014
|
+
errLog('vxe.error.reqComp', ['vxe-pager']);
|
|
2012
2015
|
}
|
|
2013
2016
|
}
|
|
2014
2017
|
});
|