vxe-table 3.12.2 → 3.12.4
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/src/methods.js +97 -69
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +122 -108
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/methods.js +110 -95
- package/lib/table/src/methods.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/src/methods.ts +110 -72
- /package/es/{iconfont.1736124502269.ttf → iconfont.1736149136555.ttf} +0 -0
- /package/es/{iconfont.1736124502269.woff → iconfont.1736149136555.woff} +0 -0
- /package/es/{iconfont.1736124502269.woff2 → iconfont.1736149136555.woff2} +0 -0
- /package/lib/{iconfont.1736124502269.ttf → iconfont.1736149136555.ttf} +0 -0
- /package/lib/{iconfont.1736124502269.woff → iconfont.1736149136555.woff} +0 -0
- /package/lib/{iconfont.1736124502269.woff2 → iconfont.1736149136555.woff2} +0 -0
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.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="3.12.
|
|
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.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="3.12.4",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,padding:!0,minHeight:144,resizeConfig:{},resizableConfig:{dragMode:"auto",showDragTip:!0},radioConfig:{strict:!0},rowDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0},columnDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{maxFixedSize:4},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showFooter:!0,placement:"top-right",modalOptions:{showMaximize:!0,mask:!0,lockView:!0,resize:!0,escClosable:!0},drawerOptions:{mask:!0,lockView:!0,escClosable:!0,resize:!0}},sortConfig:{showIcon:!0,iconLayout:"vertical"},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0},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:{isEsc:!0},areaConfig:{autoClear:!0,selectCellByHeader:!0,selectCellByBody:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{gt:60},scrollY:{gt:100}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showResponseMsg:!0,showActiveMsg:!0,props:{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_RADIO_CHECKED:iconPrefix+"radio-checked-fill",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",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_COLUMN:iconPrefix+"swap",TABLE_DRAG_DISABLED:iconPrefix+"no-drop",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,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${"3.12.
|
|
11
|
+
const version = `table v${"3.12.4"}`;
|
|
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 v3.12.
|
|
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 v3.12.4",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/package.json
CHANGED
|
@@ -211,7 +211,7 @@ function cacheColumnMap ($xeTable: VxeTableConstructor) {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
if (process.env.VUE_APP_VXE_ENV === '
|
|
214
|
+
if (process.env.VUE_APP_VXE_ENV === 'developmeznt') {
|
|
215
215
|
if (htmlColumn) {
|
|
216
216
|
if (!columnOpts.useKey) {
|
|
217
217
|
errLog('vxe.error.reqProp', ['column-config.useKey & column.type=html'])
|
|
@@ -228,6 +228,60 @@ function cacheColumnMap ($xeTable: VxeTableConstructor) {
|
|
|
228
228
|
reactData.isAllOverflow = isAllOverflow
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
const updateScrollYStatus = ($xeTable: VxeTableConstructor, fullData?: any[]) => {
|
|
232
|
+
const props = $xeTable
|
|
233
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
234
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
235
|
+
|
|
236
|
+
const { treeConfig } = props
|
|
237
|
+
const sYOpts = $xeTable.computeSYOpts
|
|
238
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
239
|
+
const { transform } = treeOpts
|
|
240
|
+
const allList = fullData || internalData.tableFullData
|
|
241
|
+
// 如果gt为0,则总是启用
|
|
242
|
+
const scrollYLoad = (transform || !treeConfig) && !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt < allList.length)
|
|
243
|
+
reactData.scrollYLoad = scrollYLoad
|
|
244
|
+
return scrollYLoad
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* 如果为虚拟树,将树结构拍平
|
|
249
|
+
* @returns
|
|
250
|
+
*/
|
|
251
|
+
function handleVirtualTreeToList ($xeTable: VxeTableConstructor) {
|
|
252
|
+
const props = $xeTable
|
|
253
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
254
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
255
|
+
|
|
256
|
+
const { treeConfig } = props
|
|
257
|
+
const { treeExpandedMaps } = reactData
|
|
258
|
+
const { fullAllDataRowIdData } = internalData
|
|
259
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
260
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
261
|
+
if (treeConfig && treeOpts.transform) {
|
|
262
|
+
const fullData: any[] = []
|
|
263
|
+
const expandMaps: {
|
|
264
|
+
[key: string]: number
|
|
265
|
+
} = {}
|
|
266
|
+
XEUtils.eachTree(internalData.afterTreeFullData, (row, index, items, path, parentRow) => {
|
|
267
|
+
const rowid = getRowid($xeTable, row)
|
|
268
|
+
const parentRowid = getRowid($xeTable, parentRow)
|
|
269
|
+
if (!parentRow || (expandMaps[parentRowid] && treeExpandedMaps[parentRowid])) {
|
|
270
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
271
|
+
if (rowRest) {
|
|
272
|
+
rowRest._index = fullData.length
|
|
273
|
+
}
|
|
274
|
+
expandMaps[rowid] = 1
|
|
275
|
+
fullData.push(row)
|
|
276
|
+
}
|
|
277
|
+
}, { children: childrenField })
|
|
278
|
+
internalData.afterFullData = fullData
|
|
279
|
+
updateScrollYStatus($xeTable, fullData)
|
|
280
|
+
return fullData
|
|
281
|
+
}
|
|
282
|
+
return internalData.afterFullData
|
|
283
|
+
}
|
|
284
|
+
|
|
231
285
|
function computeRowHeight ($xeTable: any) {
|
|
232
286
|
const tableHeader = $xeTable.$refs.tableHeader
|
|
233
287
|
const tableBody = $xeTable.$refs.tableBody
|
|
@@ -1146,6 +1200,8 @@ const Methods = {
|
|
|
1146
1200
|
})
|
|
1147
1201
|
},
|
|
1148
1202
|
handleTableData (force: any) {
|
|
1203
|
+
const $xeTable = this
|
|
1204
|
+
|
|
1149
1205
|
const { scrollYLoad, scrollYStore, fullDataRowIdData, afterFullData } = this
|
|
1150
1206
|
let fullList = afterFullData
|
|
1151
1207
|
// 是否进行数据处理
|
|
@@ -1153,7 +1209,7 @@ const Methods = {
|
|
|
1153
1209
|
// 更新数据,处理筛选和排序
|
|
1154
1210
|
this.updateAfterFullData()
|
|
1155
1211
|
// 如果为虚拟树,将树结构拍平
|
|
1156
|
-
fullList =
|
|
1212
|
+
fullList = handleVirtualTreeToList($xeTable)
|
|
1157
1213
|
}
|
|
1158
1214
|
const tableData = scrollYLoad ? fullList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullList.slice(0)
|
|
1159
1215
|
tableData.forEach((row: any, $index: any) => {
|
|
@@ -1166,15 +1222,6 @@ const Methods = {
|
|
|
1166
1222
|
this.tableData = tableData
|
|
1167
1223
|
return this.$nextTick()
|
|
1168
1224
|
},
|
|
1169
|
-
updateScrollYStatus (fullData: any) {
|
|
1170
|
-
const { treeConfig, treeOpts, sYOpts } = this
|
|
1171
|
-
const { transform } = treeOpts
|
|
1172
|
-
const allList = fullData || this.tableFullData
|
|
1173
|
-
// 如果gt为0,则总是启用
|
|
1174
|
-
const scrollYLoad = (transform || !treeConfig) && !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt <= allList.length)
|
|
1175
|
-
this.scrollYLoad = scrollYLoad
|
|
1176
|
-
return scrollYLoad
|
|
1177
|
-
},
|
|
1178
1225
|
/**
|
|
1179
1226
|
* 加载表格数据
|
|
1180
1227
|
* @param {Array} datas 数据
|
|
@@ -1230,7 +1277,7 @@ const Methods = {
|
|
|
1230
1277
|
editStore.insertMaps = {}
|
|
1231
1278
|
editStore.removeList = []
|
|
1232
1279
|
editStore.removeMaps = {}
|
|
1233
|
-
const sYLoad =
|
|
1280
|
+
const sYLoad = updateScrollYStatus($xeTable, fullData)
|
|
1234
1281
|
this.isDragRowMove = false
|
|
1235
1282
|
// 全量数据
|
|
1236
1283
|
this.tableFullData = fullData
|
|
@@ -2106,38 +2153,6 @@ const Methods = {
|
|
|
2106
2153
|
}
|
|
2107
2154
|
return rowList
|
|
2108
2155
|
},
|
|
2109
|
-
/**
|
|
2110
|
-
* 如果为虚拟树,将树结构拍平
|
|
2111
|
-
* @returns
|
|
2112
|
-
*/
|
|
2113
|
-
handleVirtualTreeToList () {
|
|
2114
|
-
const $xeTable = this
|
|
2115
|
-
const internalData = $xeTable
|
|
2116
|
-
|
|
2117
|
-
const { fullAllDataRowIdData } = internalData
|
|
2118
|
-
const { treeOpts, treeConfig, treeExpandedMaps, afterTreeFullData, afterFullData } = this
|
|
2119
|
-
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
2120
|
-
if (treeConfig && treeOpts.transform) {
|
|
2121
|
-
const fullData: any[] = []
|
|
2122
|
-
const expandMaps: any = {}
|
|
2123
|
-
XEUtils.eachTree(afterTreeFullData, (row, index, items, path, parentRow) => {
|
|
2124
|
-
const rowid = getRowid(this, row)
|
|
2125
|
-
const parentRowid = getRowid(this, parentRow)
|
|
2126
|
-
if (!parentRow || (expandMaps[parentRowid] && treeExpandedMaps[parentRowid])) {
|
|
2127
|
-
const rowRest = fullAllDataRowIdData[rowid]
|
|
2128
|
-
if (rowRest) {
|
|
2129
|
-
rowRest._index = fullData.length
|
|
2130
|
-
}
|
|
2131
|
-
expandMaps[rowid] = 1
|
|
2132
|
-
fullData.push(row)
|
|
2133
|
-
}
|
|
2134
|
-
}, { children: childrenField })
|
|
2135
|
-
this.afterFullData = fullData
|
|
2136
|
-
this.updateScrollYStatus(fullData)
|
|
2137
|
-
return fullData
|
|
2138
|
-
}
|
|
2139
|
-
return afterFullData
|
|
2140
|
-
},
|
|
2141
2156
|
/**
|
|
2142
2157
|
* 获取处理后全量的表格数据
|
|
2143
2158
|
* 如果存在筛选条件,继续处理
|
|
@@ -5597,7 +5612,7 @@ const Methods = {
|
|
|
5597
5612
|
reactData.isDragRowMove = true
|
|
5598
5613
|
$xeTable.handleTableData(treeConfig && transform)
|
|
5599
5614
|
$xeTable.cacheRowMap()
|
|
5600
|
-
$xeTable
|
|
5615
|
+
updateScrollYStatus($xeTable)
|
|
5601
5616
|
if (!(treeConfig && transform)) {
|
|
5602
5617
|
$xeTable.updateAfterDataIndex()
|
|
5603
5618
|
}
|
|
@@ -6286,21 +6301,22 @@ const Methods = {
|
|
|
6286
6301
|
return rowRest && !!rowRest.expandLoaded
|
|
6287
6302
|
},
|
|
6288
6303
|
clearRowExpandLoaded (row: any) {
|
|
6289
|
-
const $xeTable = this
|
|
6304
|
+
const $xeTable = this as VxeTableConstructor
|
|
6305
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
6306
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
6290
6307
|
|
|
6291
|
-
const {
|
|
6308
|
+
const rExpandLazyLoadedMaps = { ...reactData.rowExpandLazyLoadedMaps }
|
|
6309
|
+
const { fullAllDataRowIdData } = internalData
|
|
6310
|
+
const expandOpts = $xeTable.computeExpandOpts
|
|
6292
6311
|
const { lazy } = expandOpts
|
|
6293
6312
|
const rowid = getRowid($xeTable, row)
|
|
6294
6313
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
6295
6314
|
if (lazy && rowRest) {
|
|
6296
6315
|
rowRest.expandLoaded = false
|
|
6297
|
-
|
|
6298
|
-
if (rowTempExpandLazyLoadedMaps[rowid]) {
|
|
6299
|
-
delete rowTempExpandLazyLoadedMaps[rowid]
|
|
6300
|
-
}
|
|
6301
|
-
this.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps
|
|
6316
|
+
delete rExpandLazyLoadedMaps[rowid]
|
|
6302
6317
|
}
|
|
6303
|
-
|
|
6318
|
+
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
|
|
6319
|
+
return $xeTable.$nextTick()
|
|
6304
6320
|
},
|
|
6305
6321
|
/**
|
|
6306
6322
|
* 重新懒加载展开行,并展开内容
|
|
@@ -6386,31 +6402,37 @@ const Methods = {
|
|
|
6386
6402
|
},
|
|
6387
6403
|
handleAsyncRowExpand (row: any) {
|
|
6388
6404
|
const $xeTable = this
|
|
6405
|
+
const reactData = $xeTable as TableReactData
|
|
6406
|
+
const internalData = $xeTable as TableInternalData
|
|
6389
6407
|
|
|
6390
6408
|
return new Promise<void>(resolve => {
|
|
6391
6409
|
const { expandOpts } = this
|
|
6392
6410
|
const { loadMethod } = expandOpts
|
|
6393
6411
|
if (loadMethod) {
|
|
6394
|
-
const {
|
|
6412
|
+
const { fullAllDataRowIdData } = internalData
|
|
6413
|
+
const rExpandLazyLoadedMaps = { ...reactData.rowExpandLazyLoadedMaps }
|
|
6395
6414
|
const rowid = getRowid($xeTable, row)
|
|
6396
6415
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6416
|
+
rExpandLazyLoadedMaps[rowid] = row
|
|
6417
|
+
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
|
|
6418
|
+
loadMethod({ $table: $xeTable, row, rowIndex: $xeTable.getRowIndex(row), $rowIndex: $xeTable.getVMRowIndex(row) }).then(() => {
|
|
6419
|
+
const rExpandedMaps = { ...reactData.rowExpandedMaps }
|
|
6400
6420
|
if (rowRest) {
|
|
6401
6421
|
rowRest.expandLoaded = true
|
|
6402
6422
|
}
|
|
6403
|
-
|
|
6423
|
+
rExpandedMaps[rowid] = row
|
|
6424
|
+
reactData.rowExpandedMaps = rExpandedMaps
|
|
6404
6425
|
}).catch(() => {
|
|
6405
6426
|
if (rowRest) {
|
|
6406
6427
|
rowRest.expandLoaded = false
|
|
6407
6428
|
}
|
|
6408
6429
|
}).finally(() => {
|
|
6409
|
-
const { rowExpandLazyLoadedMaps }
|
|
6410
|
-
if (
|
|
6411
|
-
delete
|
|
6430
|
+
const rExpandLazyLoadedMaps = { ...reactData.rowExpandLazyLoadedMaps }
|
|
6431
|
+
if (rExpandLazyLoadedMaps[rowid]) {
|
|
6432
|
+
delete rExpandLazyLoadedMaps[rowid]
|
|
6412
6433
|
}
|
|
6413
|
-
|
|
6434
|
+
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
|
|
6435
|
+
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => resolve())
|
|
6414
6436
|
})
|
|
6415
6437
|
} else {
|
|
6416
6438
|
resolve()
|
|
@@ -6559,9 +6581,13 @@ const Methods = {
|
|
|
6559
6581
|
return rowRest && !!rowRest.treeLoaded
|
|
6560
6582
|
},
|
|
6561
6583
|
clearTreeExpandLoaded (rows: any) {
|
|
6562
|
-
const $xeTable = this
|
|
6584
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
6585
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
6586
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
6563
6587
|
|
|
6564
|
-
const {
|
|
6588
|
+
const tExpandedMaps = { ...reactData.treeExpandedMaps }
|
|
6589
|
+
const { fullAllDataRowIdData } = internalData
|
|
6590
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
6565
6591
|
const { transform } = treeOpts
|
|
6566
6592
|
if (rows) {
|
|
6567
6593
|
if (!XEUtils.isArray(rows)) {
|
|
@@ -6572,23 +6598,26 @@ const Methods = {
|
|
|
6572
6598
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
6573
6599
|
if (rowRest) {
|
|
6574
6600
|
rowRest.treeLoaded = false
|
|
6575
|
-
if (
|
|
6576
|
-
delete
|
|
6601
|
+
if (tExpandedMaps[rowid]) {
|
|
6602
|
+
delete tExpandedMaps[rowid]
|
|
6577
6603
|
}
|
|
6578
6604
|
}
|
|
6579
6605
|
})
|
|
6580
6606
|
}
|
|
6607
|
+
reactData.treeExpandedMaps = tExpandedMaps
|
|
6581
6608
|
if (transform) {
|
|
6582
|
-
|
|
6583
|
-
return
|
|
6609
|
+
handleVirtualTreeToList($xeTable)
|
|
6610
|
+
return $xeTable.handleTableData()
|
|
6584
6611
|
}
|
|
6585
|
-
return
|
|
6612
|
+
return $xeTable.$nextTick()
|
|
6586
6613
|
},
|
|
6587
6614
|
/**
|
|
6588
6615
|
* 重新懒加载树节点,并展开该节点
|
|
6589
6616
|
* @param {Row} row 行对象
|
|
6590
6617
|
*/
|
|
6591
6618
|
reloadTreeExpand (row: any) {
|
|
6619
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
6620
|
+
|
|
6592
6621
|
const { treeOpts, treeExpandLazyLoadedMaps } = this
|
|
6593
6622
|
const { transform, lazy } = treeOpts
|
|
6594
6623
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
|
|
@@ -6598,7 +6627,7 @@ const Methods = {
|
|
|
6598
6627
|
return this.handleAsyncTreeExpandChilds(row)
|
|
6599
6628
|
}).then(() => {
|
|
6600
6629
|
if (transform) {
|
|
6601
|
-
|
|
6630
|
+
handleVirtualTreeToList($xeTable)
|
|
6602
6631
|
return this.handleTableData()
|
|
6603
6632
|
}
|
|
6604
6633
|
}).then(() => {
|
|
@@ -6809,8 +6838,10 @@ const Methods = {
|
|
|
6809
6838
|
* @returns
|
|
6810
6839
|
*/
|
|
6811
6840
|
handleVirtualTreeExpand (rows: any[], expanded: boolean) {
|
|
6841
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
6842
|
+
|
|
6812
6843
|
return this.handleBaseTreeExpand(rows, expanded).then(() => {
|
|
6813
|
-
|
|
6844
|
+
handleVirtualTreeToList($xeTable)
|
|
6814
6845
|
this.handleTableData()
|
|
6815
6846
|
this.updateTreeDataIndex()
|
|
6816
6847
|
}).then(() => {
|
|
@@ -6858,6 +6889,8 @@ const Methods = {
|
|
|
6858
6889
|
* 手动清空树形节点的展开状态,数据会恢复成未展开的状态
|
|
6859
6890
|
*/
|
|
6860
6891
|
clearTreeExpand () {
|
|
6892
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
6893
|
+
|
|
6861
6894
|
const { treeOpts, tableFullData } = this
|
|
6862
6895
|
const { transform, reserve } = treeOpts
|
|
6863
6896
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
@@ -6868,7 +6901,7 @@ const Methods = {
|
|
|
6868
6901
|
}
|
|
6869
6902
|
return this.handleTableData().then(() => {
|
|
6870
6903
|
if (transform) {
|
|
6871
|
-
|
|
6904
|
+
handleVirtualTreeToList($xeTable)
|
|
6872
6905
|
return this.handleTableData()
|
|
6873
6906
|
}
|
|
6874
6907
|
}).then(() => {
|
|
@@ -7297,6 +7330,11 @@ const Methods = {
|
|
|
7297
7330
|
}
|
|
7298
7331
|
this.$nextTick(this.updateStyle)
|
|
7299
7332
|
},
|
|
7333
|
+
updateScrollYStatus () {
|
|
7334
|
+
const $xeTable = this
|
|
7335
|
+
|
|
7336
|
+
return updateScrollYStatus($xeTable)
|
|
7337
|
+
},
|
|
7300
7338
|
/**
|
|
7301
7339
|
* 如果有滚动条,则滚动到对应的位置
|
|
7302
7340
|
* @param {Number} scrollLeft 左距离
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|