vxe-table 4.15.0-beta.15 → 4.15.0-beta.16
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/style.css +1 -1
- package/es/table/module/custom/hook.js +14 -15
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/table.js +64 -21
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +28 -28
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/hook.js +13 -14
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/table.js +12 -12
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/hook.ts +13 -14
- package/packages/table/src/columnInfo.ts +2 -0
- package/packages/table/src/table.ts +65 -22
- /package/es/{iconfont.1753843924271.ttf → iconfont.1753864741935.ttf} +0 -0
- /package/es/{iconfont.1753843924271.woff → iconfont.1753864741935.woff} +0 -0
- /package/es/{iconfont.1753843924271.woff2 → iconfont.1753864741935.woff2} +0 -0
- /package/lib/{iconfont.1753843924271.ttf → iconfont.1753864741935.ttf} +0 -0
- /package/lib/{iconfont.1753843924271.woff → iconfont.1753864741935.woff} +0 -0
- /package/lib/{iconfont.1753843924271.woff2 → iconfont.1753864741935.woff2} +0 -0
package/lib/ui/index.js
CHANGED
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "VxeUI", {
|
|
|
13
13
|
exports.version = exports.validators = exports.use = exports.t = exports.setup = exports.setTheme = exports.setLanguage = exports.setIcon = exports.setI18n = exports.setConfig = exports.saveFile = exports.renderer = exports.readFile = exports.print = exports.modal = exports.menus = exports.log = exports.interceptor = exports.hooks = exports.globalResize = exports.globalEvents = exports.getTheme = exports.getIcon = exports.getI18n = exports.getConfig = exports.formats = exports.default = exports.config = exports.commands = exports.clipboard = exports._t = void 0;
|
|
14
14
|
var _core = require("@vxe-ui/core");
|
|
15
15
|
var _utils = require("./src/utils");
|
|
16
|
-
const version = exports.version = "4.15.0-beta.
|
|
16
|
+
const version = exports.version = "4.15.0-beta.16";
|
|
17
17
|
_core.VxeUI.version = version;
|
|
18
18
|
_core.VxeUI.tableVersion = version;
|
|
19
19
|
_core.VxeUI.setConfig({
|
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.hooks=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="4.15.0-beta.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.hooks=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="4.15.0-beta.16",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,minHeight:144,resizeConfig:{},resizableConfig:{dragMode:"auto",showDragTip:!0,isSyncAutoHeight:!0,isSyncAutoWidth:!0,minHeight:18},radioConfig:{strict:!0},rowDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},columnDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{autoOptions:{isCalcHeader:!0,isCalcBody:!0,isCalcFooter:!0},maxFixedSize:4},cellConfig:{padding:!0},headerCellConfig:{height:"unset"},footerCellConfig:{height:"unset"},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showFooter:!0,placement:"top-right",storeOptions:{visible:!0,resizable:!0,sort:!0,fixed:!0},modalOptions:{showMaximize:!0,mask:!0,lockView:!0,resize:!0,escClosable:!0},drawerOptions:{mask:!0,lockView:!0,escClosable:!0,resize:!0}},sortConfig:{showIcon:!0,allowClear:!0,allowBtn:!0,iconLayout:"vertical"},filterConfig:{multiple:!0,showIcon:!0},aggregateConfig:{padding:!0,rowField:"id",parentField:"_X_ROW_PARENT_KEY",childrenField:"_X_ROW_CHILDREN",mapChildrenField:"_X_ROW_CHILD_LIST",indent:20,showIcon:!0,maxGroupSize:4,showAggFuncTitle:!0},treeConfig:{padding:!0,rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0,mode:"fixed"},editConfig:{showIcon:!0,showAsterisk:!0,autoFocus:!0},importConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},exportConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},printConfig:{},mouseConfig:{extension:!0},keyboardConfig:{isAll:!0,isEsc:!0},areaConfig:{autoClear:!0,selectCellByHeader:!0,selectCellByBody:!0,extendDirection:{top:!0,left:!0,bottom:!0,right:!0}},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},virtualXConfig:{gt:24,preSize:1,oSize:0},virtualYConfig:{gt:100,preSize:1,oSize:0},scrollbarConfig:{}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showLoading:!0,showResponseMsg:!0,showActionMsg:!0,response:{list:null,result:"result",total:"page.total",message:"message"}}},toolbar:{}}),"vxe-table-icon-"),setTheme=(_core.VxeUI.setIcon({TABLE_SORT_ASC:iconPrefix+"caret-up",TABLE_SORT_DESC:iconPrefix+"caret-down",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit",TABLE_TITLE_PREFIX:iconPrefix+"question-circle-fill",TABLE_TITLE_SUFFIX:iconPrefix+"question-circle-fill",TABLE_TREE_LOADED:iconPrefix+"spinner roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"spinner roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",TABLE_CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",TABLE_CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked-fill",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",TABLE_RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",TABLE_CUSTOM_SORT:iconPrefix+"drag-handle",TABLE_MENU_OPTIONS:iconPrefix+"arrow-right",TABLE_DRAG_ROW:iconPrefix+"drag-handle",TABLE_DRAG_COLUMN:iconPrefix+"drag-handle",TABLE_DRAG_STATUS_ROW:iconPrefix+"sort",TABLE_DRAG_STATUS_SUB_ROW:iconPrefix+"add-sub",TABLE_DRAG_STATUS_AGG_GROUP:iconPrefix+"grouping",TABLE_DRAG_STATUS_AGG_VALUES:iconPrefix+"values",TABLE_DRAG_STATUS_COLUMN:iconPrefix+"swap",TABLE_DRAG_DISABLED:iconPrefix+"no-drop",TABLE_ROW_GROUP_OPEN:iconPrefix+"arrow-right rotate90",TABLE_ROW_GROUP_CLOSE:iconPrefix+"arrow-right",TABLE_AGGREGATE_GROUPING:iconPrefix+"grouping",TABLE_AGGREGATE_VALUES:iconPrefix+"values",TABLE_AGGREGATE_SORT:iconPrefix+"drag-handle",TABLE_AGGREGATE_DELETE:iconPrefix+"close",TOOLBAR_TOOLS_REFRESH:iconPrefix+"repeat",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"repeat roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_FULLSCREEN:iconPrefix+"fullscreen",TOOLBAR_TOOLS_MINIMIZE:iconPrefix+"minimize",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"custom-column",TOOLBAR_TOOLS_FIXED_LEFT:iconPrefix+"fixed-left",TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE:iconPrefix+"fixed-right-fill"}),exports.setTheme=_core.VxeUI.setTheme),getTheme=exports.getTheme=_core.VxeUI.getTheme,setConfig=exports.setConfig=_core.VxeUI.setConfig,getConfig=exports.getConfig=_core.VxeUI.getConfig,setIcon=exports.setIcon=_core.VxeUI.setIcon,getIcon=exports.getIcon=_core.VxeUI.getIcon,setLanguage=exports.setLanguage=_core.VxeUI.setLanguage,setI18n=exports.setI18n=_core.VxeUI.setI18n,getI18n=exports.getI18n=_core.VxeUI.getI18n,globalEvents=exports.globalEvents=_core.VxeUI.globalEvents,globalResize=exports.globalResize=_core.VxeUI.globalResize,renderer=exports.renderer=_core.VxeUI.renderer,validators=exports.validators=_core.VxeUI.validators,menus=exports.menus=_core.VxeUI.menus,formats=exports.formats=_core.VxeUI.formats,commands=exports.commands=_core.VxeUI.commands,interceptor=exports.interceptor=_core.VxeUI.interceptor,clipboard=exports.clipboard=_core.VxeUI.clipboard,log=exports.log=_core.VxeUI.log,hooks=exports.hooks=_core.VxeUI.hooks,use=exports.use=_core.VxeUI.use,setup=e=>_core.VxeUI.setConfig(e),config=(exports.setup=setup,_core.VxeUI.setup=setup,e=>_core.VxeUI.setConfig(e)),t=(exports.config=config,_core.VxeUI.config=config,(e,o)=>_core.VxeUI.getI18n(e,o)),_t=(exports.t=t,_core.VxeUI.t=t,(e,o)=>(0,_utils.getFuncText)(e,o)),VXETable=(exports._t=_t,_core.VxeUI._t=_t,exports.VXETable=_core.VxeUI),saveFile=e=>_core.VxeUI.saveFile(e),readFile=(exports.saveFile=saveFile,e=>_core.VxeUI.readFile(e)),print=(exports.readFile=readFile,e=>_core.VxeUI.print(e)),modal=(exports.print=print,exports.modal={get(e){return _core.VxeUI.modal.get(e)},close(e){return _core.VxeUI.modal.close(e)},open(e){return _core.VxeUI.modal.open(e)},alert(e,o,r){return _core.VxeUI.modal.alert(e,o,r)},confirm(e,o,r){return _core.VxeUI.modal.confirm(e,o,r)},message(e,o){return _core.VxeUI.modal.message(e,o)},notification(e,o,r){return _core.VxeUI.modal.notification(e,o,r)}});var _default=exports.default=_core.VxeUI;
|
package/lib/ui/src/log.js
CHANGED
|
@@ -8,6 +8,6 @@ var _core = require("@vxe-ui/core");
|
|
|
8
8
|
const {
|
|
9
9
|
log
|
|
10
10
|
} = _core.VxeUI;
|
|
11
|
-
const version = `table v${"4.15.0-beta.
|
|
11
|
+
const version = `table v${"4.15.0-beta.16"}`;
|
|
12
12
|
const warnLog = exports.warnLog = log.create('warn', version);
|
|
13
13
|
const errLog = exports.errLog = log.create('error', version);
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v4.15.0-beta.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v4.15.0-beta.16",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "4.15.0-beta.
|
|
3
|
+
"version": "4.15.0-beta.16",
|
|
4
4
|
"description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -112,21 +112,20 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
112
112
|
}
|
|
113
113
|
})
|
|
114
114
|
reactData.isCustomStatus = true
|
|
115
|
-
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
$xeTable.clearRowGroups()
|
|
123
|
-
}
|
|
124
|
-
} else if (allowValues) {
|
|
125
|
-
// 更新聚合函数
|
|
126
|
-
$xeTable.handleUpdateAggData()
|
|
115
|
+
if (allowGroup && !!$xeTable.handlePivotTableAggregateData) {
|
|
116
|
+
if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
|
|
117
|
+
// 更新数据分组
|
|
118
|
+
if (aggHandleFields.length) {
|
|
119
|
+
$xeTable.setRowGroups(aggHandleFields)
|
|
120
|
+
} else {
|
|
121
|
+
$xeTable.clearRowGroups()
|
|
127
122
|
}
|
|
123
|
+
} else if (allowValues) {
|
|
124
|
+
// 更新聚合函数
|
|
125
|
+
$xeTable.handleUpdateAggData()
|
|
128
126
|
}
|
|
129
|
-
}
|
|
127
|
+
}
|
|
128
|
+
return $xeTable.saveCustomStore('confirm')
|
|
130
129
|
}
|
|
131
130
|
|
|
132
131
|
const cancelCustom = () => {
|
|
@@ -241,7 +240,6 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
241
240
|
internalData.tableFullColumn = getColumnList(newCollectCols)
|
|
242
241
|
}
|
|
243
242
|
reactData.isCustomStatus = false
|
|
244
|
-
$xeTable.saveCustomStore('reset')
|
|
245
243
|
return $xeTable.handleCustom().then(() => {
|
|
246
244
|
if (opts.aggFunc && ($xeTable as any).handlePivotTableAggregateData) {
|
|
247
245
|
const rowGroupFields = computeRowGroupFields.value
|
|
@@ -255,6 +253,7 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
255
253
|
$xeTable.handleUpdateAggData()
|
|
256
254
|
}
|
|
257
255
|
}
|
|
256
|
+
$xeTable.saveCustomStore('reset')
|
|
258
257
|
})
|
|
259
258
|
},
|
|
260
259
|
toggleCustomAllCheckbox () {
|
|
@@ -1533,17 +1533,28 @@ export default defineVxeComponent({
|
|
|
1533
1533
|
}
|
|
1534
1534
|
|
|
1535
1535
|
const handleCustomRestore = (storeData: VxeTableDefines.CustomStoreData) => {
|
|
1536
|
+
const { aggregateConfig, rowGroupConfig } = props
|
|
1536
1537
|
const { collectColumn } = internalData
|
|
1537
|
-
|
|
1538
|
+
const customOpts = computeCustomOpts.value
|
|
1539
|
+
const { storage, storeOptions } = customOpts
|
|
1540
|
+
const isAllCustom = storage === true
|
|
1541
|
+
const storageOpts: VxeTableDefines.VxeTableCustomStorageObj = isAllCustom ? {} : Object.assign({}, storage || {}, storeOptions)
|
|
1542
|
+
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom)
|
|
1543
|
+
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom)
|
|
1544
|
+
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom)
|
|
1545
|
+
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom)
|
|
1546
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom)
|
|
1547
|
+
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom)
|
|
1548
|
+
let { resizableData, sortData, visibleData, fixedData, aggGroupData, aggFuncData } = storeData
|
|
1538
1549
|
// 处理还原
|
|
1539
|
-
if (resizableData || sortData || visibleData || fixedData) {
|
|
1550
|
+
if ((isCustomResizable && resizableData) || (isCustomSort && sortData) || (isCustomVisible && visibleData) || (isCustomFixed && fixedData) || (isCustomAggGroup && aggGroupData) || (isCustomAggFunc && aggFuncData)) {
|
|
1540
1551
|
const sortColMaps: Record<string, {
|
|
1541
1552
|
key: string
|
|
1542
1553
|
sNum: number
|
|
1543
1554
|
pKey: string | null
|
|
1544
1555
|
}> = {}
|
|
1545
|
-
|
|
1546
|
-
|
|
1556
|
+
if (isCustomSort && sortData) {
|
|
1557
|
+
// 转换兼容老版本数据,即将废弃兼容
|
|
1547
1558
|
if (!XEUtils.isArray(sortData)) {
|
|
1548
1559
|
const sortRests: {key: string, index: number}[] = []
|
|
1549
1560
|
XEUtils.each(sortData, (index: number, colKey: string) => {
|
|
@@ -1562,25 +1573,40 @@ export default defineVxeComponent({
|
|
|
1562
1573
|
}
|
|
1563
1574
|
const colKeyMaps: Record<string, VxeTableDefines.ColumnInfo> = {}
|
|
1564
1575
|
const allCols: VxeTableDefines.ColumnInfo[] = []
|
|
1576
|
+
const aggGroupConfs: VxeTableDefines.RowGroupItem[] = []
|
|
1565
1577
|
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
1566
1578
|
const colKey = column.getKey()
|
|
1567
1579
|
// 支持一级
|
|
1568
1580
|
if (!parentColumn) {
|
|
1569
|
-
if (fixedData && fixedData[colKey] !== undefined) {
|
|
1581
|
+
if (isCustomFixed && fixedData && fixedData[colKey] !== undefined) {
|
|
1570
1582
|
column.fixed = fixedData[colKey]
|
|
1571
1583
|
}
|
|
1572
1584
|
}
|
|
1573
|
-
if (resizableData && XEUtils.isNumber(resizableData[colKey])) {
|
|
1585
|
+
if (isCustomResizable && resizableData && XEUtils.isNumber(resizableData[colKey])) {
|
|
1574
1586
|
column.resizeWidth = resizableData[colKey]
|
|
1575
1587
|
}
|
|
1576
|
-
if (visibleData && XEUtils.isBoolean(visibleData[colKey])) {
|
|
1588
|
+
if (isCustomVisible && visibleData && XEUtils.isBoolean(visibleData[colKey])) {
|
|
1577
1589
|
column.visible = visibleData[colKey]
|
|
1578
1590
|
}
|
|
1591
|
+
if (isCustomAggFunc && aggFuncData && (aggregateConfig || rowGroupConfig) && aggFuncData[colKey]) {
|
|
1592
|
+
column.aggFunc = aggFuncData[colKey]
|
|
1593
|
+
}
|
|
1594
|
+
if (isCustomAggGroup && aggGroupData && aggGroupData[colKey]) {
|
|
1595
|
+
aggGroupConfs.push({ field: column.field })
|
|
1596
|
+
}
|
|
1579
1597
|
colKeyMaps[colKey] = column
|
|
1580
1598
|
allCols.push(column)
|
|
1581
1599
|
})
|
|
1600
|
+
if ((aggregateConfig || rowGroupConfig) && aggGroupConfs.length) {
|
|
1601
|
+
const groupRest = handleGroupData(internalData.tableFullData, aggGroupConfs)
|
|
1602
|
+
internalData.tableFullTreeData = []
|
|
1603
|
+
internalData.tableFullGroupData = groupRest.treeData
|
|
1604
|
+
reactData.isRowGroupStatus = true
|
|
1605
|
+
reactData.rowGroupList = aggGroupConfs
|
|
1606
|
+
$xeTable.cacheRowMap(false)
|
|
1607
|
+
}
|
|
1582
1608
|
// 如果自定义了顺序
|
|
1583
|
-
if (sortData) {
|
|
1609
|
+
if (isCustomSort && sortData) {
|
|
1584
1610
|
allCols.forEach(column => {
|
|
1585
1611
|
const colKey = column.getKey()
|
|
1586
1612
|
const scItem = sortColMaps[colKey]
|
|
@@ -1614,8 +1640,9 @@ export default defineVxeComponent({
|
|
|
1614
1640
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom)
|
|
1615
1641
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom)
|
|
1616
1642
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom)
|
|
1643
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom)
|
|
1617
1644
|
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom)
|
|
1618
|
-
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
|
|
1645
|
+
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggGroup || isCustomAggFunc)) {
|
|
1619
1646
|
if (!tableId) {
|
|
1620
1647
|
errLog('vxe.error.reqProp', ['id'])
|
|
1621
1648
|
return
|
|
@@ -3287,18 +3314,18 @@ export default defineVxeComponent({
|
|
|
3287
3314
|
}
|
|
3288
3315
|
|
|
3289
3316
|
const handleUpdateRowGroup = (groupFields?: string[]) => {
|
|
3290
|
-
const
|
|
3291
|
-
const
|
|
3317
|
+
const aggGroupFields: string[] = []
|
|
3318
|
+
const aggGroupConfs: { field: string }[] = []
|
|
3292
3319
|
if (groupFields) {
|
|
3293
3320
|
(XEUtils.isArray(groupFields) ? groupFields : [groupFields]).forEach(field => {
|
|
3294
|
-
|
|
3295
|
-
|
|
3321
|
+
aggGroupFields.push(field)
|
|
3322
|
+
aggGroupConfs.push({
|
|
3296
3323
|
field
|
|
3297
3324
|
})
|
|
3298
3325
|
})
|
|
3299
3326
|
}
|
|
3300
|
-
reactData.rowGroupList =
|
|
3301
|
-
reactData.aggHandleFields =
|
|
3327
|
+
reactData.rowGroupList = aggGroupConfs
|
|
3328
|
+
reactData.aggHandleFields = aggGroupFields
|
|
3302
3329
|
handleUpdateAggValues()
|
|
3303
3330
|
}
|
|
3304
3331
|
|
|
@@ -3689,7 +3716,7 @@ export default defineVxeComponent({
|
|
|
3689
3716
|
if (parentColumn && parentColumn.fixed) {
|
|
3690
3717
|
column.fixed = parentColumn.fixed
|
|
3691
3718
|
}
|
|
3692
|
-
if (parentColumn && column.fixed !== parentColumn.fixed) {
|
|
3719
|
+
if (parentColumn && (column.fixed || '') !== (parentColumn.fixed || '')) {
|
|
3693
3720
|
errLog('vxe.error.groupFixed')
|
|
3694
3721
|
}
|
|
3695
3722
|
if (isColGroup) {
|
|
@@ -6960,7 +6987,8 @@ export default defineVxeComponent({
|
|
|
6960
6987
|
getCustomStoreData () {
|
|
6961
6988
|
const { id } = props
|
|
6962
6989
|
const customOpts = computeCustomOpts.value
|
|
6963
|
-
const {
|
|
6990
|
+
const { isRowGroupStatus, rowGroupList } = reactData
|
|
6991
|
+
const { fullColumnFieldData, collectColumn } = internalData
|
|
6964
6992
|
const { storage, checkMethod, storeOptions } = customOpts
|
|
6965
6993
|
const isAllCustom = storage === true
|
|
6966
6994
|
const storageOpts: VxeTableDefines.VxeTableCustomStorageObj = isAllCustom ? {} : Object.assign({}, storage || {}, storeOptions)
|
|
@@ -6968,17 +6996,20 @@ export default defineVxeComponent({
|
|
|
6968
6996
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom)
|
|
6969
6997
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom)
|
|
6970
6998
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom)
|
|
6999
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom)
|
|
6971
7000
|
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom)
|
|
6972
7001
|
const resizableData: Record<string, number> = {}
|
|
6973
7002
|
const sortData: VxeTableDefines.CustomSortStoreObj[] = []
|
|
6974
7003
|
const visibleData: Record<string, boolean> = {}
|
|
6975
7004
|
const fixedData: Record<string, VxeColumnPropTypes.Fixed> = {}
|
|
7005
|
+
const aggGroupData: Record<string, boolean> = {}
|
|
6976
7006
|
const aggFuncData: Record<string, VxeColumnPropTypes.AggFunc> = {}
|
|
6977
7007
|
const storeData: VxeTableDefines.CustomStoreData = {
|
|
6978
7008
|
resizableData: undefined,
|
|
6979
7009
|
sortData: undefined,
|
|
6980
7010
|
visibleData: undefined,
|
|
6981
7011
|
fixedData: undefined,
|
|
7012
|
+
aggGroupData: undefined,
|
|
6982
7013
|
aggFuncData: undefined
|
|
6983
7014
|
}
|
|
6984
7015
|
if (!id) {
|
|
@@ -7021,7 +7052,7 @@ export default defineVxeComponent({
|
|
|
7021
7052
|
sortData.push(sObj)
|
|
7022
7053
|
}
|
|
7023
7054
|
// 只支持一级
|
|
7024
|
-
if (isCustomFixed && column.fixed !== column.defaultFixed) {
|
|
7055
|
+
if (isCustomFixed && (column.fixed || '') !== (column.defaultFixed || '')) {
|
|
7025
7056
|
hasFixed = 1
|
|
7026
7057
|
fixedData[colKey] = column.fixed
|
|
7027
7058
|
}
|
|
@@ -7039,7 +7070,7 @@ export default defineVxeComponent({
|
|
|
7039
7070
|
visibleData[colKey] = true
|
|
7040
7071
|
}
|
|
7041
7072
|
}
|
|
7042
|
-
if (isCustomAggFunc && column.aggFunc !== column.defaultAggFunc) {
|
|
7073
|
+
if (isCustomAggFunc && (column.aggFunc || '') !== (column.defaultAggFunc || '')) {
|
|
7043
7074
|
hasAggFunc = 1
|
|
7044
7075
|
aggFuncData[colKey] = column.aggFunc
|
|
7045
7076
|
}
|
|
@@ -7056,6 +7087,15 @@ export default defineVxeComponent({
|
|
|
7056
7087
|
if (hasVisible) {
|
|
7057
7088
|
storeData.visibleData = visibleData
|
|
7058
7089
|
}
|
|
7090
|
+
if (isCustomAggGroup && isRowGroupStatus) {
|
|
7091
|
+
rowGroupList.forEach(aggConf => {
|
|
7092
|
+
const colRest = fullColumnFieldData[aggConf.field]
|
|
7093
|
+
if (colRest) {
|
|
7094
|
+
aggGroupData[colRest.column.getKey()] = true
|
|
7095
|
+
}
|
|
7096
|
+
})
|
|
7097
|
+
storeData.aggGroupData = aggGroupData
|
|
7098
|
+
}
|
|
7059
7099
|
if (hasAggFunc) {
|
|
7060
7100
|
storeData.aggFuncData = aggFuncData
|
|
7061
7101
|
}
|
|
@@ -8490,22 +8530,25 @@ export default defineVxeComponent({
|
|
|
8490
8530
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom)
|
|
8491
8531
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom)
|
|
8492
8532
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom)
|
|
8533
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom)
|
|
8493
8534
|
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom)
|
|
8494
8535
|
if (type !== 'reset') {
|
|
8495
8536
|
// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
8496
8537
|
reactData.isCustomStatus = true
|
|
8497
8538
|
}
|
|
8498
|
-
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
|
|
8539
|
+
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggGroup || isCustomAggFunc)) {
|
|
8499
8540
|
if (!tableId) {
|
|
8500
8541
|
errLog('vxe.error.reqProp', ['id'])
|
|
8501
8542
|
return nextTick()
|
|
8502
8543
|
}
|
|
8503
|
-
const storeData = type === 'reset'
|
|
8544
|
+
const storeData: VxeTableDefines.CustomStoreData = type === 'reset'
|
|
8504
8545
|
? {
|
|
8505
8546
|
resizableData: {},
|
|
8506
8547
|
sortData: [],
|
|
8507
8548
|
visibleData: {},
|
|
8508
|
-
fixedData: {}
|
|
8549
|
+
fixedData: {},
|
|
8550
|
+
aggGroupData: {},
|
|
8551
|
+
aggFuncData: {}
|
|
8509
8552
|
}
|
|
8510
8553
|
: tableMethods.getCustomStoreData()
|
|
8511
8554
|
if (updateStore) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|