vxe-table 3.21.21 → 3.21.23
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/{iconfont.1782656027274.ttf → iconfont.1783046294821.ttf} +0 -0
- package/es/iconfont.1783046294821.woff +0 -0
- package/es/iconfont.1783046294821.woff2 +0 -0
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +16 -3
- package/es/locale/lang/de-DE.js +16 -3
- package/es/locale/lang/en-US.js +20 -7
- package/es/locale/lang/es-ES.js +16 -3
- package/es/locale/lang/fr-FR.js +16 -3
- package/es/locale/lang/hu-HU.js +16 -3
- package/es/locale/lang/hy-AM.js +16 -3
- package/es/locale/lang/id-ID.js +16 -3
- package/es/locale/lang/it-IT.js +15 -2
- package/es/locale/lang/ja-JP.js +16 -3
- package/es/locale/lang/ko-KR.js +16 -3
- package/es/locale/lang/ms-MY.js +16 -3
- package/es/locale/lang/nb-NO.js +16 -3
- package/es/locale/lang/pt-BR.js +16 -3
- package/es/locale/lang/ru-RU.js +16 -3
- package/es/locale/lang/th-TH.js +16 -3
- package/es/locale/lang/ug-CN.js +16 -3
- package/es/locale/lang/uk-UA.js +16 -3
- package/es/locale/lang/uz-UZ.js +16 -3
- package/es/locale/lang/vi-VN.js +15 -2
- package/es/locale/lang/zh-CHT.js +18 -5
- package/es/locale/lang/zh-CN.js +18 -5
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +115 -38
- package/es/table/module/custom/panel.js +492 -312
- package/es/table/module/edit/mixin.js +12 -6
- package/es/table/src/columnInfo.js +13 -7
- package/es/table/src/methods.js +105 -60
- package/es/table/src/util.js +31 -1
- package/es/table/style.css +96 -49
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +16 -4
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +96 -49
- package/es/vxe-table/style.min.css +1 -1
- package/lib/{iconfont.1782656027274.ttf → iconfont.1783046294821.ttf} +0 -0
- package/lib/iconfont.1783046294821.woff +0 -0
- package/lib/iconfont.1783046294821.woff2 +0 -0
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +612 -226
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +16 -3
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +16 -3
- package/lib/locale/lang/de-DE.js +16 -3
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +16 -3
- package/lib/locale/lang/en-US.js +20 -7
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +20 -7
- package/lib/locale/lang/es-ES.js +16 -3
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +16 -3
- package/lib/locale/lang/fr-FR.js +16 -3
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +16 -3
- package/lib/locale/lang/hu-HU.js +16 -3
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +16 -3
- package/lib/locale/lang/hy-AM.js +16 -3
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +16 -3
- package/lib/locale/lang/id-ID.js +16 -3
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +16 -3
- package/lib/locale/lang/it-IT.js +15 -2
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +15 -2
- package/lib/locale/lang/ja-JP.js +16 -3
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +16 -3
- package/lib/locale/lang/ko-KR.js +16 -3
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +16 -3
- package/lib/locale/lang/ms-MY.js +16 -3
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +16 -3
- package/lib/locale/lang/nb-NO.js +16 -3
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +16 -3
- package/lib/locale/lang/pt-BR.js +16 -3
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +16 -3
- package/lib/locale/lang/ru-RU.js +16 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +16 -3
- package/lib/locale/lang/th-TH.js +16 -3
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +16 -3
- package/lib/locale/lang/ug-CN.js +16 -3
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +16 -3
- package/lib/locale/lang/uk-UA.js +16 -3
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +16 -3
- package/lib/locale/lang/uz-UZ.js +16 -3
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +16 -3
- package/lib/locale/lang/vi-VN.js +15 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +15 -2
- package/lib/locale/lang/zh-CHT.js +18 -5
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +18 -5
- package/lib/locale/lang/zh-CN.js +18 -5
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +18 -5
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +121 -35
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +383 -158
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +12 -6
- package/lib/table/src/columnInfo.js +16 -6
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +11 -10
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +35 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +96 -49
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +16 -4
- 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 +96 -49
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +16 -3
- package/packages/locale/lang/de-DE.ts +16 -3
- package/packages/locale/lang/en-US.ts +20 -7
- package/packages/locale/lang/es-ES.ts +16 -3
- package/packages/locale/lang/fr-FR.ts +16 -3
- package/packages/locale/lang/hu-HU.ts +16 -3
- package/packages/locale/lang/hy-AM.ts +16 -3
- package/packages/locale/lang/id-ID.ts +16 -3
- package/packages/locale/lang/it-IT.ts +15 -2
- package/packages/locale/lang/ja-JP.ts +16 -3
- package/packages/locale/lang/ko-KR.ts +16 -3
- package/packages/locale/lang/ms-MY.ts +16 -3
- package/packages/locale/lang/nb-NO.ts +16 -3
- package/packages/locale/lang/pt-BR.ts +16 -3
- package/packages/locale/lang/ru-RU.ts +16 -3
- package/packages/locale/lang/th-TH.ts +16 -3
- package/packages/locale/lang/ug-CN.ts +16 -3
- package/packages/locale/lang/uk-UA.ts +16 -3
- package/packages/locale/lang/uz-UZ.ts +16 -3
- package/packages/locale/lang/vi-VN.ts +15 -2
- package/packages/locale/lang/zh-CHT.ts +18 -5
- package/packages/locale/lang/zh-CN.ts +18 -5
- package/packages/table/module/custom/mixin.ts +115 -38
- package/packages/table/module/custom/panel.ts +545 -307
- package/packages/table/module/edit/mixin.ts +18 -6
- package/packages/table/src/columnInfo.ts +13 -7
- package/packages/table/src/methods.ts +120 -61
- package/packages/table/src/table.ts +6 -6
- package/packages/table/src/util.ts +34 -1
- package/packages/ui/index.ts +15 -3
- package/styles/components/icon.scss +29 -2
- package/styles/components/table-module/custom.scss +88 -67
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/styles/theme/base.scss +13 -1
- package/es/iconfont.1782656027274.woff +0 -0
- package/es/iconfont.1782656027274.woff2 +0 -0
- package/lib/iconfont.1782656027274.woff +0 -0
- package/lib/iconfont.1782656027274.woff2 +0 -0
|
@@ -528,7 +528,8 @@ export default {
|
|
|
528
528
|
* @param {*} records
|
|
529
529
|
*/
|
|
530
530
|
_insert(records) {
|
|
531
|
-
|
|
531
|
+
const $xeTable = this;
|
|
532
|
+
return handleInsertRowAt($xeTable, records, null);
|
|
532
533
|
},
|
|
533
534
|
/**
|
|
534
535
|
* 往表格指定行中插入临时数据
|
|
@@ -538,19 +539,24 @@ export default {
|
|
|
538
539
|
* @returns
|
|
539
540
|
*/
|
|
540
541
|
_insertAt(records, targetRowOrRowid) {
|
|
541
|
-
|
|
542
|
+
const $xeTable = this;
|
|
543
|
+
return handleInsertRowAt($xeTable, records, targetRowOrRowid);
|
|
542
544
|
},
|
|
543
545
|
_insertNextAt(records, targetRowOrRowid) {
|
|
544
|
-
|
|
546
|
+
const $xeTable = this;
|
|
547
|
+
return handleInsertRowAt($xeTable, records, targetRowOrRowid, true);
|
|
545
548
|
},
|
|
546
549
|
_insertChild(records, parentRowOrParentId) {
|
|
547
|
-
|
|
550
|
+
const $xeTable = this;
|
|
551
|
+
return handleInsertChildRowAt($xeTable, records, parentRowOrParentId, null);
|
|
548
552
|
},
|
|
549
553
|
_insertChildAt(records, parentRowOrParentId, targetRowOrRowid) {
|
|
550
|
-
|
|
554
|
+
const $xeTable = this;
|
|
555
|
+
return handleInsertChildRowAt($xeTable, records, parentRowOrParentId, targetRowOrRowid);
|
|
551
556
|
},
|
|
552
557
|
_insertChildNextAt(records, parentRowOrParentId, targetRowOrRowid) {
|
|
553
|
-
|
|
558
|
+
const $xeTable = this;
|
|
559
|
+
return handleInsertChildRowAt($xeTable, records, parentRowOrParentId, targetRowOrRowid, true);
|
|
554
560
|
},
|
|
555
561
|
/**
|
|
556
562
|
* 删除指定行数据
|
|
@@ -13,7 +13,7 @@ export class ColumnInfo {
|
|
|
13
13
|
const $xeGrid = $xeTable.$xeGrid;
|
|
14
14
|
const $xeGantt = $xeTable.$xeGantt;
|
|
15
15
|
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
16
|
-
const { type, field, width, visible, aggFunc, formatter, filterMultiple, cellRender, editRender, filterRender } = colConfs;
|
|
16
|
+
const { type, field, width, visible, fixed, align, headerAlign, footerAlign, aggFunc, formatter, filterMultiple, cellRender, editRender, filterRender } = colConfs;
|
|
17
17
|
const colId = colConfs.colId || XEUtils.uniqueId('col_');
|
|
18
18
|
const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : null;
|
|
19
19
|
const defaultVisible = XEUtils.isBoolean(visible) ? visible : true;
|
|
@@ -82,10 +82,10 @@ export class ColumnInfo {
|
|
|
82
82
|
minWidth: colConfs.minWidth,
|
|
83
83
|
maxWidth: colConfs.maxWidth,
|
|
84
84
|
resizable: colConfs.resizable,
|
|
85
|
-
fixed
|
|
86
|
-
align
|
|
87
|
-
headerAlign
|
|
88
|
-
footerAlign
|
|
85
|
+
fixed,
|
|
86
|
+
align,
|
|
87
|
+
headerAlign,
|
|
88
|
+
footerAlign,
|
|
89
89
|
showOverflow: colConfs.showOverflow,
|
|
90
90
|
showHeaderOverflow: colConfs.showHeaderOverflow,
|
|
91
91
|
showFooterOverflow: colConfs.showFooterOverflow,
|
|
@@ -126,7 +126,7 @@ export class ColumnInfo {
|
|
|
126
126
|
titleHelp: colConfs.titleHelp,
|
|
127
127
|
titlePrefix: colConfs.titlePrefix,
|
|
128
128
|
titleSuffix: colConfs.titleSuffix,
|
|
129
|
-
aggFunc
|
|
129
|
+
aggFunc,
|
|
130
130
|
copyMethod: colConfs.copyMethod,
|
|
131
131
|
cutMethod: colConfs.cutMethod,
|
|
132
132
|
pasteMethod: colConfs.pasteMethod,
|
|
@@ -140,7 +140,10 @@ export class ColumnInfo {
|
|
|
140
140
|
defaultParentId: null,
|
|
141
141
|
halfVisible: false,
|
|
142
142
|
defaultVisible: defaultVisible,
|
|
143
|
-
defaultFixed:
|
|
143
|
+
defaultFixed: fixed,
|
|
144
|
+
defaultAlign: align,
|
|
145
|
+
defaultHeaderAlign: headerAlign,
|
|
146
|
+
defaultFooterAlign: footerAlign,
|
|
144
147
|
defaultAggFunc: colConfs.aggFunc,
|
|
145
148
|
checked: false,
|
|
146
149
|
halfChecked: false,
|
|
@@ -160,6 +163,9 @@ export class ColumnInfo {
|
|
|
160
163
|
renderAggFn: '',
|
|
161
164
|
renderAggDigits: null,
|
|
162
165
|
renderAggFormat: null,
|
|
166
|
+
renderAlign: '',
|
|
167
|
+
renderHeaderAlign: '',
|
|
168
|
+
renderFooterAlign: '',
|
|
163
169
|
renderFixed: '',
|
|
164
170
|
renderVisible: false,
|
|
165
171
|
renderWidth: defaultRenderWidth,
|
package/es/table/src/methods.js
CHANGED
|
@@ -3,7 +3,7 @@ import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollLe
|
|
|
3
3
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
|
|
4
4
|
import { VxeUI } from '../../ui';
|
|
5
5
|
import Cell from './cell';
|
|
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';
|
|
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, handleCustomStoreConfig } from './util';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
8
8
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime';
|
|
9
9
|
import { createComponentLog } from '../../ui/src/log';
|
|
@@ -31,9 +31,6 @@ function eqCellValue(newRow, oldRow, field) {
|
|
|
31
31
|
}
|
|
32
32
|
return { newValue: val1, oldValue: val2, result };
|
|
33
33
|
}
|
|
34
|
-
function hangleStorageDefaultValue(value, isAll) {
|
|
35
|
-
return XEUtils.isBoolean(value) ? value : isAll;
|
|
36
|
-
}
|
|
37
34
|
function getNextSortOrder($xeTable, column) {
|
|
38
35
|
const sortOpts = $xeTable.computeSortOpts;
|
|
39
36
|
const { orders = [] } = sortOpts;
|
|
@@ -127,19 +124,18 @@ function handleCustomRestore($xeTable, storeData) {
|
|
|
127
124
|
const internalData = $xeTable;
|
|
128
125
|
const { aggregateConfig, rowGroupConfig } = props;
|
|
129
126
|
const { collectColumn } = internalData;
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
const isAllCustom = storage === true;
|
|
133
|
-
const storageOpts = Object.assign({}, isAllCustom ? {} : storage || {}, storeOptions);
|
|
134
|
-
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
|
|
135
|
-
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
136
|
-
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
137
|
-
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
138
|
-
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
139
|
-
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
140
|
-
let { resizableData, sortData, visibleData, fixedData, aggGroupData, aggFuncData } = storeData;
|
|
127
|
+
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable);
|
|
128
|
+
let { alignData, headerAlignData, footerAlignData, resizableData, sortData, visibleData, fixedData, aggGroupData, aggFuncData } = storeData;
|
|
141
129
|
// 处理还原
|
|
142
|
-
if ((
|
|
130
|
+
if ((isCustomAlign && alignData) ||
|
|
131
|
+
(isCustomHeaderAlign && headerAlignData) ||
|
|
132
|
+
(isCustomFooterAlign && footerAlignData) ||
|
|
133
|
+
(isCustomResizable && resizableData) ||
|
|
134
|
+
(isCustomSort && sortData) ||
|
|
135
|
+
(isCustomVisible && visibleData) ||
|
|
136
|
+
(isCustomFixed && fixedData) ||
|
|
137
|
+
(isCustomAggGroup && aggGroupData) ||
|
|
138
|
+
(isCustomAggFunc && aggFuncData)) {
|
|
143
139
|
const sortColMaps = {};
|
|
144
140
|
if (isCustomSort && sortData) {
|
|
145
141
|
// 转换兼容老版本数据,即将废弃兼容
|
|
@@ -223,15 +219,19 @@ function restoreCustomStorage($xeTable) {
|
|
|
223
219
|
const { customConfig } = props;
|
|
224
220
|
const tableId = $xeTable.computeTableId;
|
|
225
221
|
const customOpts = $xeTable.computeCustomOpts;
|
|
226
|
-
const { storage, restoreStore
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
222
|
+
const { storage, restoreStore } = customOpts;
|
|
223
|
+
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable);
|
|
224
|
+
if (storage &&
|
|
225
|
+
(customConfig ? isEnableConf(customOpts) : customOpts.enabled) &&
|
|
226
|
+
(isCustomAlign ||
|
|
227
|
+
isCustomHeaderAlign ||
|
|
228
|
+
isCustomFooterAlign ||
|
|
229
|
+
isCustomResizable ||
|
|
230
|
+
isCustomVisible ||
|
|
231
|
+
isCustomFixed ||
|
|
232
|
+
isCustomSort ||
|
|
233
|
+
isCustomAggGroup ||
|
|
234
|
+
isCustomAggFunc)) {
|
|
235
235
|
if (!tableId) {
|
|
236
236
|
errLog('vxe.error.reqProp', ['id']);
|
|
237
237
|
return;
|
|
@@ -2892,12 +2892,16 @@ function handleTooltip($xeTable, evnt, tipOpts, type, tdEl, overflowElem, tipEle
|
|
|
2892
2892
|
// 如果为 null 使用默认逻辑
|
|
2893
2893
|
if (XEUtils.eqNull(customContent)) {
|
|
2894
2894
|
isShow = isOver;
|
|
2895
|
+
content = cellText;
|
|
2895
2896
|
}
|
|
2896
2897
|
else if (customContent !== '' && customContent !== false) {
|
|
2897
2898
|
// 如果为 '' | false 则不显示
|
|
2898
2899
|
isShow = true;
|
|
2900
|
+
content = customContent;
|
|
2901
|
+
}
|
|
2902
|
+
else {
|
|
2903
|
+
content = cellText;
|
|
2899
2904
|
}
|
|
2900
|
-
content = cellText;
|
|
2901
2905
|
}
|
|
2902
2906
|
if (isShow && content) {
|
|
2903
2907
|
const tipContent = formatText(content);
|
|
@@ -6393,15 +6397,19 @@ const tableMethods = {
|
|
|
6393
6397
|
const { customConfig } = props;
|
|
6394
6398
|
const tableId = $xeTable.computeTableId;
|
|
6395
6399
|
const customOpts = $xeTable.computeCustomOpts;
|
|
6396
|
-
const { storage, restoreStore
|
|
6397
|
-
const
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6400
|
+
const { storage, restoreStore } = customOpts;
|
|
6401
|
+
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable);
|
|
6402
|
+
if (storage &&
|
|
6403
|
+
(customConfig ? isEnableConf(customOpts) : customOpts.enabled) &&
|
|
6404
|
+
(isCustomAlign ||
|
|
6405
|
+
isCustomHeaderAlign ||
|
|
6406
|
+
isCustomFooterAlign ||
|
|
6407
|
+
isCustomResizable ||
|
|
6408
|
+
isCustomVisible ||
|
|
6409
|
+
isCustomFixed ||
|
|
6410
|
+
isCustomSort ||
|
|
6411
|
+
isCustomAggGroup ||
|
|
6412
|
+
isCustomAggFunc)) {
|
|
6405
6413
|
if (!tableId) {
|
|
6406
6414
|
errLog('vxe.error.reqProp', ['id']);
|
|
6407
6415
|
return;
|
|
@@ -6446,6 +6454,9 @@ const tableMethods = {
|
|
|
6446
6454
|
if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
|
|
6447
6455
|
column.visible = column.defaultVisible;
|
|
6448
6456
|
}
|
|
6457
|
+
column.align = column.defaultAlign;
|
|
6458
|
+
column.headerAlign = column.defaultHeaderAlign;
|
|
6459
|
+
column.footerAlign = column.defaultFooterAlign;
|
|
6449
6460
|
column.aggFunc = column.defaultAggFunc;
|
|
6450
6461
|
column.renderAggFn = column.defaultAggFunc;
|
|
6451
6462
|
column.renderResizeWidth = column.renderWidth;
|
|
@@ -6491,15 +6502,11 @@ const tableMethods = {
|
|
|
6491
6502
|
const customOpts = $xeTable.computeCustomOpts;
|
|
6492
6503
|
const { isRowGroupStatus, rowGroupList } = reactData;
|
|
6493
6504
|
const { fullColumnFieldData, collectColumn } = internalData;
|
|
6494
|
-
const { storage, checkMethod
|
|
6495
|
-
const
|
|
6496
|
-
const
|
|
6497
|
-
const
|
|
6498
|
-
const
|
|
6499
|
-
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
6500
|
-
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
6501
|
-
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
6502
|
-
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
6505
|
+
const { storage, checkMethod } = customOpts;
|
|
6506
|
+
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable);
|
|
6507
|
+
const alignData = {};
|
|
6508
|
+
const headerAlignData = {};
|
|
6509
|
+
const footerAlignData = {};
|
|
6503
6510
|
const resizableData = {};
|
|
6504
6511
|
const sortData = [];
|
|
6505
6512
|
const visibleData = {};
|
|
@@ -6507,6 +6514,9 @@ const tableMethods = {
|
|
|
6507
6514
|
const aggGroupData = {};
|
|
6508
6515
|
const aggFuncData = {};
|
|
6509
6516
|
const storeData = {
|
|
6517
|
+
alignData: undefined,
|
|
6518
|
+
headerAlignData: undefined,
|
|
6519
|
+
footerAlignData: undefined,
|
|
6510
6520
|
resizableData: undefined,
|
|
6511
6521
|
sortData: undefined,
|
|
6512
6522
|
visibleData: undefined,
|
|
@@ -6520,6 +6530,9 @@ const tableMethods = {
|
|
|
6520
6530
|
}
|
|
6521
6531
|
return storeData;
|
|
6522
6532
|
}
|
|
6533
|
+
let hasAlign = 0;
|
|
6534
|
+
let hasHeaderAlign = 0;
|
|
6535
|
+
let hasFooterAlign = 0;
|
|
6523
6536
|
let hasResizable = 0;
|
|
6524
6537
|
let hasSort = 0;
|
|
6525
6538
|
let hasFixed = 0;
|
|
@@ -6560,6 +6573,18 @@ const tableMethods = {
|
|
|
6560
6573
|
fixedData[colKey] = column.fixed;
|
|
6561
6574
|
}
|
|
6562
6575
|
}
|
|
6576
|
+
if (isCustomAlign && column.align) {
|
|
6577
|
+
hasAlign = 1;
|
|
6578
|
+
alignData[colKey] = column.align;
|
|
6579
|
+
}
|
|
6580
|
+
if (isCustomHeaderAlign && column.headerAlign) {
|
|
6581
|
+
hasHeaderAlign = 1;
|
|
6582
|
+
headerAlignData[colKey] = column.headerAlign;
|
|
6583
|
+
}
|
|
6584
|
+
if (isCustomFooterAlign && column.footerAlign) {
|
|
6585
|
+
hasFooterAlign = 1;
|
|
6586
|
+
footerAlignData[colKey] = column.footerAlign;
|
|
6587
|
+
}
|
|
6563
6588
|
if (isCustomResizable && column.resizeWidth) {
|
|
6564
6589
|
hasResizable = 1;
|
|
6565
6590
|
resizableData[colKey] = column.renderWidth;
|
|
@@ -6579,6 +6604,15 @@ const tableMethods = {
|
|
|
6579
6604
|
aggFuncData[colKey] = column.aggFunc;
|
|
6580
6605
|
}
|
|
6581
6606
|
});
|
|
6607
|
+
if (hasAlign) {
|
|
6608
|
+
storeData.alignData = alignData;
|
|
6609
|
+
}
|
|
6610
|
+
if (hasHeaderAlign) {
|
|
6611
|
+
storeData.headerAlignData = headerAlignData;
|
|
6612
|
+
}
|
|
6613
|
+
if (hasFooterAlign) {
|
|
6614
|
+
storeData.footerAlignData = footerAlignData;
|
|
6615
|
+
}
|
|
6582
6616
|
if (hasResizable) {
|
|
6583
6617
|
storeData.resizableData = resizableData;
|
|
6584
6618
|
}
|
|
@@ -6615,33 +6649,40 @@ const tableMethods = {
|
|
|
6615
6649
|
const { customConfig } = props;
|
|
6616
6650
|
const tableId = $xeTable.computeTableId;
|
|
6617
6651
|
const customOpts = $xeTable.computeCustomOpts;
|
|
6618
|
-
const { updateStore, storage
|
|
6619
|
-
const
|
|
6620
|
-
const storageOpts = Object.assign({}, isAllCustom ? {} : storage || {}, storeOptions);
|
|
6621
|
-
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
|
|
6622
|
-
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
6623
|
-
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
6624
|
-
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
6625
|
-
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
6626
|
-
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
6652
|
+
const { updateStore, storage } = customOpts;
|
|
6653
|
+
const { isCustomAlign, isCustomHeaderAlign, isCustomFooterAlign, isCustomResizable, isCustomVisible, isCustomFixed, isCustomSort, isCustomAggGroup, isCustomAggFunc } = handleCustomStoreConfig($xeTable);
|
|
6627
6654
|
if (type !== 'reset') {
|
|
6655
|
+
// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
6628
6656
|
reactData.isCustomStatus = true;
|
|
6629
6657
|
}
|
|
6630
|
-
if (storage &&
|
|
6658
|
+
if (storage &&
|
|
6659
|
+
(customConfig ? isEnableConf(customOpts) : customOpts.enabled) &&
|
|
6660
|
+
(isCustomAlign ||
|
|
6661
|
+
isCustomHeaderAlign ||
|
|
6662
|
+
isCustomFooterAlign ||
|
|
6663
|
+
isCustomResizable ||
|
|
6664
|
+
isCustomVisible ||
|
|
6665
|
+
isCustomFixed ||
|
|
6666
|
+
isCustomSort ||
|
|
6667
|
+
isCustomAggGroup ||
|
|
6668
|
+
isCustomAggFunc)) {
|
|
6631
6669
|
if (!tableId) {
|
|
6632
6670
|
errLog('vxe.error.reqProp', ['id']);
|
|
6633
|
-
return
|
|
6671
|
+
return $xeTable.$nextTick();
|
|
6634
6672
|
}
|
|
6635
6673
|
const storeData = type === 'reset'
|
|
6636
6674
|
? {
|
|
6675
|
+
alignData: {},
|
|
6676
|
+
headerAlignData: {},
|
|
6677
|
+
footerAlignData: {},
|
|
6637
6678
|
resizableData: {},
|
|
6638
|
-
sortData:
|
|
6679
|
+
sortData: [],
|
|
6639
6680
|
visibleData: {},
|
|
6640
6681
|
fixedData: {},
|
|
6641
6682
|
aggGroupData: {},
|
|
6642
6683
|
aggFuncData: {}
|
|
6643
6684
|
}
|
|
6644
|
-
:
|
|
6685
|
+
: $xeTable.getCustomStoreData();
|
|
6645
6686
|
if (updateStore) {
|
|
6646
6687
|
return updateStore({
|
|
6647
6688
|
$table: $xeTable,
|
|
@@ -6654,13 +6695,17 @@ const tableMethods = {
|
|
|
6654
6695
|
setCustomStorageMap(tableId, type === 'reset' ? null : storeData);
|
|
6655
6696
|
}
|
|
6656
6697
|
}
|
|
6657
|
-
return
|
|
6698
|
+
return $xeTable.$nextTick();
|
|
6658
6699
|
},
|
|
6659
6700
|
handleUpdateDataQueue() {
|
|
6660
|
-
this
|
|
6701
|
+
const $xeTable = this;
|
|
6702
|
+
const reactData = $xeTable;
|
|
6703
|
+
reactData.upDataFlag++;
|
|
6661
6704
|
},
|
|
6662
6705
|
handleRefreshColumnQueue() {
|
|
6663
|
-
this
|
|
6706
|
+
const $xeTable = this;
|
|
6707
|
+
const reactData = $xeTable;
|
|
6708
|
+
reactData.reColumnFlag++;
|
|
6664
6709
|
},
|
|
6665
6710
|
handleFilterOptions(column) {
|
|
6666
6711
|
const $xeTable = this;
|
package/es/table/src/util.js
CHANGED
|
@@ -219,7 +219,8 @@ export function createReactData() {
|
|
|
219
219
|
activeWrapper: false,
|
|
220
220
|
visible: false,
|
|
221
221
|
maxHeight: null,
|
|
222
|
-
|
|
222
|
+
defPopupStyle: {},
|
|
223
|
+
panePopupStyle: {},
|
|
223
224
|
oldSortMaps: {},
|
|
224
225
|
oldFixedMaps: {},
|
|
225
226
|
oldVisibleMaps: {}
|
|
@@ -1011,3 +1012,32 @@ export function colToVisible($xeTable, isForce, column, row) {
|
|
|
1011
1012
|
}
|
|
1012
1013
|
return Promise.resolve();
|
|
1013
1014
|
}
|
|
1015
|
+
function hangleBolleanDefaultValue(currVal, defVal) {
|
|
1016
|
+
return XEUtils.isBoolean(currVal) ? currVal : defVal;
|
|
1017
|
+
}
|
|
1018
|
+
export function handleCustomStoreConfig($xeTable) {
|
|
1019
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
1020
|
+
const { storage, storeOptions } = customOpts;
|
|
1021
|
+
const isAllCustom = storage === true;
|
|
1022
|
+
const storageOpts = Object.assign({}, isAllCustom ? {} : storage || {}, storeOptions);
|
|
1023
|
+
const isCustomAlign = hangleBolleanDefaultValue(storageOpts.align, isAllCustom);
|
|
1024
|
+
const isCustomHeaderAlign = hangleBolleanDefaultValue(storageOpts.headerAlign, isAllCustom);
|
|
1025
|
+
const isCustomFooterAlign = hangleBolleanDefaultValue(storageOpts.footerAlign, isAllCustom);
|
|
1026
|
+
const isCustomResizable = hangleBolleanDefaultValue(storageOpts.resizable, isAllCustom);
|
|
1027
|
+
const isCustomVisible = hangleBolleanDefaultValue(storageOpts.visible, isAllCustom);
|
|
1028
|
+
const isCustomFixed = hangleBolleanDefaultValue(storageOpts.fixed, isAllCustom);
|
|
1029
|
+
const isCustomSort = hangleBolleanDefaultValue(storageOpts.sort, isAllCustom);
|
|
1030
|
+
const isCustomAggGroup = hangleBolleanDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
1031
|
+
const isCustomAggFunc = hangleBolleanDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
1032
|
+
return {
|
|
1033
|
+
isCustomAlign,
|
|
1034
|
+
isCustomHeaderAlign,
|
|
1035
|
+
isCustomFooterAlign,
|
|
1036
|
+
isCustomResizable,
|
|
1037
|
+
isCustomVisible,
|
|
1038
|
+
isCustomFixed,
|
|
1039
|
+
isCustomSort,
|
|
1040
|
+
isCustomAggGroup,
|
|
1041
|
+
isCustomAggFunc
|
|
1042
|
+
};
|
|
1043
|
+
}
|