vxe-table 3.9.9 → 3.9.11
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/render/index.js +3 -0
- package/es/table/src/methods.js +123 -66
- package/es/table/src/table.js +0 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +151 -88
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/render/index.js +3 -0
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/methods.js +145 -76
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +0 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +2 -2
- 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 +3 -3
- package/packages/table/render/index.ts +3 -0
- package/packages/table/src/methods.ts +133 -67
- package/packages/table/src/table.ts +0 -1
- /package/es/{iconfont.1729060343798.ttf → iconfont.1729162486747.ttf} +0 -0
- /package/es/{iconfont.1729060343798.woff → iconfont.1729162486747.woff} +0 -0
- /package/es/{iconfont.1729060343798.woff2 → iconfont.1729162486747.woff2} +0 -0
- /package/lib/{iconfont.1729060343798.ttf → iconfont.1729162486747.ttf} +0 -0
- /package/lib/{iconfont.1729060343798.woff → iconfont.1729162486747.woff} +0 -0
- /package/lib/{iconfont.1729060343798.woff2 → iconfont.1729162486747.woff2} +0 -0
package/lib/ui/index.js
CHANGED
|
@@ -13,9 +13,9 @@ 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.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 = "3.9.
|
|
16
|
+
const version = exports.version = "3.9.11";
|
|
17
17
|
_core.VxeUI.version = version;
|
|
18
|
-
_core.VxeUI.tableVersion = "3.9.
|
|
18
|
+
_core.VxeUI.tableVersion = "3.9.11";
|
|
19
19
|
_core.VxeUI.setConfig({
|
|
20
20
|
emptyCell: ' ',
|
|
21
21
|
table: {
|
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.9.
|
|
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.9.11",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion="3.9.11",_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,padding:!0,minHeight:144,resizeConfig:{refreshDelay:250},radioConfig:{strict:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single"},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}},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},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",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.9.
|
|
11
|
+
const version = `table v${"3.9.11"}`;
|
|
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.9.
|
|
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.9.11",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": "3.9.
|
|
3
|
+
"version": "3.9.11",
|
|
4
4
|
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、列拖拽,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"style": "lib/style.css",
|
|
29
29
|
"typings": "types/index.d.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"vxe-pc-ui": "^3.1.
|
|
31
|
+
"vxe-pc-ui": "^3.1.30"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-transform-modules-commonjs": "^7.25.7",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"gulp-sourcemaps": "^3.0.0",
|
|
62
62
|
"gulp-typescript": "^5.0.1",
|
|
63
63
|
"gulp-uglify": "^3.0.2",
|
|
64
|
-
"sass": "^1.
|
|
64
|
+
"sass": "^1.80.1",
|
|
65
65
|
"sass-loader": "^14.2.1",
|
|
66
66
|
"typescript": "~4.5.5",
|
|
67
67
|
"vue": "2.6.14",
|
|
@@ -338,7 +338,6 @@ const Methods = {
|
|
|
338
338
|
const { scrollXLoad, scrollYLoad } = this
|
|
339
339
|
return this.handleTableData(true).then(() => {
|
|
340
340
|
this.updateFooter()
|
|
341
|
-
this.checkSelectionStatus()
|
|
342
341
|
if (scrollXLoad || scrollYLoad) {
|
|
343
342
|
if (scrollXLoad) {
|
|
344
343
|
this.updateScrollXSpace()
|
|
@@ -653,7 +652,7 @@ const Methods = {
|
|
|
653
652
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
654
653
|
*/
|
|
655
654
|
cacheRowMap (isSource?: boolean) {
|
|
656
|
-
const { treeConfig, treeOpts, tableFullData, fullAllDataRowIdData,
|
|
655
|
+
const { treeConfig, treeOpts, tableFullData, fullAllDataRowIdData, tableFullTreeData } = this
|
|
657
656
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
658
657
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
|
|
659
658
|
const rowkey = getRowkey(this)
|
|
@@ -685,7 +684,6 @@ const Methods = {
|
|
|
685
684
|
this.fullDataRowIdData = fullDataRowIdMaps
|
|
686
685
|
}
|
|
687
686
|
this.fullAllDataRowIdData = fullAllDataRowIdMaps
|
|
688
|
-
fullAllDataRowMap.clear()
|
|
689
687
|
if (treeConfig) {
|
|
690
688
|
XEUtils.eachTree(tableFullTreeData, handleCache, { children: childrenField })
|
|
691
689
|
} else {
|
|
@@ -721,11 +719,13 @@ const Methods = {
|
|
|
721
719
|
return this.params
|
|
722
720
|
},
|
|
723
721
|
loadTreeChildren (row: any, childRecords: any) {
|
|
724
|
-
const
|
|
722
|
+
const $xeTable = this
|
|
723
|
+
|
|
724
|
+
const { keepSource, tableSourceData, treeOpts, fullDataRowIdData, fullAllDataRowIdData, sourceDataRowIdData } = this
|
|
725
725
|
const { transform, mapChildrenField } = treeOpts
|
|
726
726
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
727
|
-
const
|
|
728
|
-
const parentLevel =
|
|
727
|
+
const parentRest = fullAllDataRowIdData[getRowid($xeTable, row)]
|
|
728
|
+
const parentLevel = parentRest ? parentRest.level : 0
|
|
729
729
|
return this.createData(childRecords).then((rows: any) => {
|
|
730
730
|
if (keepSource) {
|
|
731
731
|
const rowid = getRowid(this, row)
|
|
@@ -739,13 +739,11 @@ const Methods = {
|
|
|
739
739
|
})
|
|
740
740
|
}
|
|
741
741
|
XEUtils.eachTree(rows, (childRow, index, items, path, parent, nodes) => {
|
|
742
|
-
const rowid = getRowid(
|
|
743
|
-
const parentRow = parent || row
|
|
742
|
+
const rowid = getRowid($xeTable, childRow)
|
|
743
|
+
const parentRow = parent || parentRest.row
|
|
744
744
|
const rest = { row: childRow, rowid, seq: -1, index, _index: -1, $index: -1, items, parent: parentRow, level: parentLevel + nodes.length }
|
|
745
745
|
fullDataRowIdData[rowid] = rest
|
|
746
|
-
fullDataRowMap.set(childRow, rest)
|
|
747
746
|
fullAllDataRowIdData[rowid] = rest
|
|
748
|
-
fullAllDataRowMap.set(childRow, rest)
|
|
749
747
|
}, { children: childrenField })
|
|
750
748
|
row[childrenField] = rows
|
|
751
749
|
if (transform) {
|
|
@@ -1203,6 +1201,8 @@ const Methods = {
|
|
|
1203
1201
|
return null
|
|
1204
1202
|
},
|
|
1205
1203
|
getCellLabel (row: any, fieldOrColumn: any) {
|
|
1204
|
+
const $xeTable = this
|
|
1205
|
+
|
|
1206
1206
|
const column = handleFieldOrColumn(this, fieldOrColumn)
|
|
1207
1207
|
if (!column) {
|
|
1208
1208
|
return null
|
|
@@ -1211,15 +1211,15 @@ const Methods = {
|
|
|
1211
1211
|
const cellValue = getCellValue(row, column)
|
|
1212
1212
|
let cellLabel = cellValue
|
|
1213
1213
|
if (formatter) {
|
|
1214
|
-
let
|
|
1215
|
-
const {
|
|
1214
|
+
let formatData
|
|
1215
|
+
const { fullAllDataRowIdData } = $xeTable
|
|
1216
|
+
const rowid = getRowid($xeTable, row)
|
|
1216
1217
|
const colid = column.id
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
1219
|
-
rest = fullAllDataRowMap.get(row)
|
|
1218
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
1219
|
+
if (rest) {
|
|
1220
1220
|
formatData = rest.formatData
|
|
1221
1221
|
if (!formatData) {
|
|
1222
|
-
formatData =
|
|
1222
|
+
formatData = fullAllDataRowIdData[rowid].formatData = {}
|
|
1223
1223
|
}
|
|
1224
1224
|
if (rest && formatData[colid]) {
|
|
1225
1225
|
if (formatData[colid].value === cellValue) {
|
|
@@ -1597,8 +1597,10 @@ const Methods = {
|
|
|
1597
1597
|
* @param {Row} row 行对象
|
|
1598
1598
|
*/
|
|
1599
1599
|
getRowid (row: any) {
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1600
|
+
const $xeTable = this
|
|
1601
|
+
|
|
1602
|
+
const rowid = XEUtils.get(row, getRowkey($xeTable))
|
|
1603
|
+
return XEUtils.eqNull(rowid) ? '' : encodeURIComponent(rowid)
|
|
1602
1604
|
},
|
|
1603
1605
|
/**
|
|
1604
1606
|
* 获取处理后的表格数据
|
|
@@ -3352,7 +3354,8 @@ const Methods = {
|
|
|
3352
3354
|
if (rows && !XEUtils.isArray(rows)) {
|
|
3353
3355
|
rows = [rows]
|
|
3354
3356
|
}
|
|
3355
|
-
|
|
3357
|
+
this.handleBatchSelectRows(rows, !!value, isForce)
|
|
3358
|
+
this.checkSelectionStatus()
|
|
3356
3359
|
return this.$nextTick()
|
|
3357
3360
|
},
|
|
3358
3361
|
/**
|
|
@@ -3361,6 +3364,9 @@ const Methods = {
|
|
|
3361
3364
|
* @param {Boolean} value 是否选中
|
|
3362
3365
|
*/
|
|
3363
3366
|
setCheckboxRow (rows: any, value: any) {
|
|
3367
|
+
if (rows && !XEUtils.isArray(rows)) {
|
|
3368
|
+
rows = [rows]
|
|
3369
|
+
}
|
|
3364
3370
|
return this.handleCheckedCheckboxRow(rows, value, true)
|
|
3365
3371
|
},
|
|
3366
3372
|
isCheckedByCheckboxRow (row: any) {
|
|
@@ -3375,6 +3381,56 @@ const Methods = {
|
|
|
3375
3381
|
const { treeIndeterminateMaps } = this
|
|
3376
3382
|
return !!treeIndeterminateMaps[getRowid(this, row)] && !this.isCheckedByCheckboxRow(row)
|
|
3377
3383
|
},
|
|
3384
|
+
/**
|
|
3385
|
+
* 多行
|
|
3386
|
+
* 多选,行选中事件
|
|
3387
|
+
* value 选中true 不选false 半选-1
|
|
3388
|
+
*/
|
|
3389
|
+
handleBatchSelectRows (rows: any[], value: any, isForce: any) {
|
|
3390
|
+
const $xeTable = this
|
|
3391
|
+
const { treeConfig } = $xeTable
|
|
3392
|
+
|
|
3393
|
+
const { selectCheckboxMaps, checkboxOpts } = this
|
|
3394
|
+
const { checkField, checkStrictly, checkMethod } = checkboxOpts
|
|
3395
|
+
if (checkField) {
|
|
3396
|
+
if (treeConfig && !checkStrictly) {
|
|
3397
|
+
rows.forEach(row => {
|
|
3398
|
+
this.handleSelectRow({ row }, value, isForce)
|
|
3399
|
+
})
|
|
3400
|
+
} else {
|
|
3401
|
+
rows.forEach(row => {
|
|
3402
|
+
if (isForce || (!checkMethod || checkMethod({ row }))) {
|
|
3403
|
+
XEUtils.set(row, checkField, value)
|
|
3404
|
+
this.handleCheckboxReserveRow(row, value)
|
|
3405
|
+
}
|
|
3406
|
+
})
|
|
3407
|
+
}
|
|
3408
|
+
} else {
|
|
3409
|
+
if (treeConfig && !checkStrictly) {
|
|
3410
|
+
rows.forEach(row => {
|
|
3411
|
+
this.handleSelectRow({ row }, value, isForce)
|
|
3412
|
+
})
|
|
3413
|
+
} else {
|
|
3414
|
+
const selectRowMaps = Object.assign({}, selectCheckboxMaps)
|
|
3415
|
+
rows.forEach(row => {
|
|
3416
|
+
const rowid = getRowid($xeTable, row)
|
|
3417
|
+
if (isForce || (!checkMethod || checkMethod({ row }))) {
|
|
3418
|
+
if (value) {
|
|
3419
|
+
if (!selectRowMaps[rowid]) {
|
|
3420
|
+
selectRowMaps[rowid] = row
|
|
3421
|
+
}
|
|
3422
|
+
} else {
|
|
3423
|
+
if (selectRowMaps[rowid]) {
|
|
3424
|
+
delete selectRowMaps[rowid]
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
this.handleCheckboxReserveRow(row, value)
|
|
3428
|
+
}
|
|
3429
|
+
})
|
|
3430
|
+
this.selectCheckboxMaps = selectRowMaps
|
|
3431
|
+
}
|
|
3432
|
+
}
|
|
3433
|
+
},
|
|
3378
3434
|
/**
|
|
3379
3435
|
* 多选,行选中事件
|
|
3380
3436
|
* value 选中true 不选false 半选-1
|
|
@@ -3536,7 +3592,6 @@ const Methods = {
|
|
|
3536
3592
|
}
|
|
3537
3593
|
}
|
|
3538
3594
|
this.selectCheckboxMaps = selectRowMaps
|
|
3539
|
-
this.checkSelectionStatus()
|
|
3540
3595
|
},
|
|
3541
3596
|
handleToggleCheckRowEvent (evnt: any, params: any) {
|
|
3542
3597
|
const { selectCheckboxMaps, checkboxOpts } = this
|
|
@@ -3555,6 +3610,7 @@ const Methods = {
|
|
|
3555
3610
|
this.triggerCheckRowEvent(evnt, params, value)
|
|
3556
3611
|
} else {
|
|
3557
3612
|
this.handleSelectRow(params, value)
|
|
3613
|
+
this.checkSelectionStatus()
|
|
3558
3614
|
}
|
|
3559
3615
|
},
|
|
3560
3616
|
triggerCheckRowEvent (evnt: any, params: any, value: any) {
|
|
@@ -3582,6 +3638,7 @@ const Methods = {
|
|
|
3582
3638
|
}
|
|
3583
3639
|
if (!checkMethod || checkMethod({ row })) {
|
|
3584
3640
|
this.handleSelectRow(params, value)
|
|
3641
|
+
this.checkSelectionStatus()
|
|
3585
3642
|
this.emitEvent('checkbox-change', Object.assign({
|
|
3586
3643
|
records: this.getCheckboxRecords(),
|
|
3587
3644
|
reserves: this.getCheckboxReserveRecords(),
|
|
@@ -3598,6 +3655,7 @@ const Methods = {
|
|
|
3598
3655
|
const { checkField } = checkboxOpts
|
|
3599
3656
|
const value = checkField ? !XEUtils.get(row, checkField) : !selectCheckboxMaps[getRowid(this, row)]
|
|
3600
3657
|
this.handleSelectRow({ row }, value, true)
|
|
3658
|
+
this.checkSelectionStatus()
|
|
3601
3659
|
return this.$nextTick()
|
|
3602
3660
|
},
|
|
3603
3661
|
handleCheckedAllCheckboxRow (value: any, isForce: any) {
|
|
@@ -3804,9 +3862,11 @@ const Methods = {
|
|
|
3804
3862
|
},
|
|
3805
3863
|
// 还原展开、选中等相关状态
|
|
3806
3864
|
handleReserveStatus () {
|
|
3807
|
-
const
|
|
3865
|
+
const $xeTable = this
|
|
3866
|
+
|
|
3867
|
+
const { expandColumn, treeOpts, treeConfig, fullDataRowIdData, fullAllDataRowIdData, currentRow, selectRadioRow, radioReserveRow, radioOpts, checkboxOpts, selectCheckboxMaps, rowExpandedMaps, treeExpandedMaps, expandOpts } = this
|
|
3808
3868
|
// 单选框
|
|
3809
|
-
if (selectRadioRow && !
|
|
3869
|
+
if (selectRadioRow && !fullAllDataRowIdData[getRowid($xeTable, selectRadioRow)]) {
|
|
3810
3870
|
this.selectRadioRow = null // 刷新单选行状态
|
|
3811
3871
|
}
|
|
3812
3872
|
// 还原保留选中状态
|
|
@@ -3822,7 +3882,7 @@ const Methods = {
|
|
|
3822
3882
|
if (checkboxOpts.reserve) {
|
|
3823
3883
|
this.handleCheckedCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true, true)
|
|
3824
3884
|
}
|
|
3825
|
-
if (currentRow && !
|
|
3885
|
+
if (currentRow && !this.fullAllDataRowIdData[getRowid($xeTable, currentRow)]) {
|
|
3826
3886
|
this.currentRow = null // 刷新当前行状态
|
|
3827
3887
|
}
|
|
3828
3888
|
// 行展开
|
|
@@ -4539,14 +4599,19 @@ const Methods = {
|
|
|
4539
4599
|
* @param {Row} row 行对象
|
|
4540
4600
|
*/
|
|
4541
4601
|
isRowExpandLoaded (row: any) {
|
|
4542
|
-
const
|
|
4543
|
-
|
|
4602
|
+
const $xeTable = this
|
|
4603
|
+
|
|
4604
|
+
const { fullAllDataRowIdData } = this
|
|
4605
|
+
const rest = fullAllDataRowIdData[getRowid($xeTable, row)]
|
|
4606
|
+
return rest && !!rest.expandLoaded
|
|
4544
4607
|
},
|
|
4545
4608
|
clearRowExpandLoaded (row: any) {
|
|
4546
|
-
const
|
|
4609
|
+
const $xeTable = this
|
|
4610
|
+
|
|
4611
|
+
const { expandOpts, rowExpandLazyLoadedMaps, fullAllDataRowIdData } = this
|
|
4547
4612
|
const { lazy } = expandOpts
|
|
4548
|
-
const rowid = getRowid(
|
|
4549
|
-
const rest =
|
|
4613
|
+
const rowid = getRowid($xeTable, row)
|
|
4614
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
4550
4615
|
if (lazy && rest) {
|
|
4551
4616
|
rest.expandLoaded = false
|
|
4552
4617
|
const rowTempExpandLazyLoadedMaps = { ...rowExpandLazyLoadedMaps }
|
|
@@ -4640,32 +4705,28 @@ const Methods = {
|
|
|
4640
4705
|
return this.setRowExpand(expandedRows, expanded)
|
|
4641
4706
|
},
|
|
4642
4707
|
handleAsyncRowExpand (row: any) {
|
|
4643
|
-
const
|
|
4644
|
-
|
|
4708
|
+
const $xeTable = this
|
|
4709
|
+
|
|
4645
4710
|
return new Promise<void>(resolve => {
|
|
4711
|
+
const { expandOpts } = this
|
|
4646
4712
|
const { loadMethod } = expandOpts
|
|
4647
4713
|
if (loadMethod) {
|
|
4648
|
-
const { rowExpandLazyLoadedMaps } = this
|
|
4649
|
-
const
|
|
4650
|
-
const
|
|
4651
|
-
|
|
4652
|
-
this.
|
|
4653
|
-
loadMethod({ $table: this, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) }).then(() => {
|
|
4654
|
-
rest.expandLoaded = true
|
|
4714
|
+
const { rowExpandLazyLoadedMaps, fullAllDataRowIdData } = this
|
|
4715
|
+
const rowid = getRowid($xeTable, row)
|
|
4716
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
4717
|
+
rowExpandLazyLoadedMaps[rowid] = row
|
|
4718
|
+
loadMethod({ $table: $xeTable, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) }).then(() => {
|
|
4655
4719
|
const { rowExpandedMaps } = this
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
this.rowExpandedMaps = rowTempExpandedMaps
|
|
4720
|
+
rest.expandLoaded = true
|
|
4721
|
+
rowExpandedMaps[rowid] = row
|
|
4659
4722
|
}).catch(() => {
|
|
4660
4723
|
rest.expandLoaded = false
|
|
4661
4724
|
}).finally(() => {
|
|
4662
4725
|
const { rowExpandLazyLoadedMaps } = this
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
delete rowTempExpandLazyLoadedMaps[rowid]
|
|
4726
|
+
if (rowExpandLazyLoadedMaps[rowid]) {
|
|
4727
|
+
delete rowExpandLazyLoadedMaps[rowid]
|
|
4666
4728
|
}
|
|
4667
|
-
this.
|
|
4668
|
-
resolve(this.$nextTick().then(this.recalculate))
|
|
4729
|
+
this.$nextTick().then(() => this.recalculate()).then(() => resolve())
|
|
4669
4730
|
})
|
|
4670
4731
|
} else {
|
|
4671
4732
|
resolve()
|
|
@@ -4807,14 +4868,19 @@ const Methods = {
|
|
|
4807
4868
|
* @param {Row} row 行对象
|
|
4808
4869
|
*/
|
|
4809
4870
|
isTreeExpandLoaded (row: any) {
|
|
4810
|
-
const
|
|
4811
|
-
|
|
4871
|
+
const $xeTable = this
|
|
4872
|
+
|
|
4873
|
+
const { fullAllDataRowIdData } = this
|
|
4874
|
+
const rest = fullAllDataRowIdData[getRowid($xeTable, row)]
|
|
4875
|
+
return rest && !!rest.treeLoaded
|
|
4812
4876
|
},
|
|
4813
4877
|
clearTreeExpandLoaded (row: any) {
|
|
4814
|
-
const
|
|
4878
|
+
const $xeTable = this
|
|
4879
|
+
|
|
4880
|
+
const { treeOpts, treeExpandedMaps, fullAllDataRowIdData } = this
|
|
4815
4881
|
const { transform, lazy } = treeOpts
|
|
4816
|
-
const rowid = getRowid(
|
|
4817
|
-
const rest =
|
|
4882
|
+
const rowid = getRowid($xeTable, row)
|
|
4883
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
4818
4884
|
if (lazy && rest) {
|
|
4819
4885
|
rest.treeLoaded = false
|
|
4820
4886
|
if (treeExpandedMaps[rowid]) {
|
|
@@ -4907,35 +4973,36 @@ const Methods = {
|
|
|
4907
4973
|
}
|
|
4908
4974
|
},
|
|
4909
4975
|
handleAsyncTreeExpandChilds (row: any) {
|
|
4976
|
+
const $xeTable = this
|
|
4977
|
+
|
|
4910
4978
|
const { treeOpts, checkboxOpts } = this
|
|
4911
4979
|
const { transform, loadMethod } = treeOpts
|
|
4912
4980
|
const { checkStrictly } = checkboxOpts
|
|
4913
4981
|
return new Promise<void>(resolve => {
|
|
4914
4982
|
if (loadMethod) {
|
|
4915
|
-
const {
|
|
4916
|
-
const rowid = getRowid(
|
|
4917
|
-
const rest =
|
|
4983
|
+
const { treeExpandLazyLoadedMaps, fullAllDataRowIdData } = this
|
|
4984
|
+
const rowid = getRowid($xeTable, row)
|
|
4985
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
4918
4986
|
treeExpandLazyLoadedMaps[rowid] = row
|
|
4919
|
-
|
|
4920
|
-
|
|
4987
|
+
Promise.resolve(
|
|
4988
|
+
loadMethod({ $table: $xeTable, row })
|
|
4989
|
+
).then((childRecords: any) => {
|
|
4921
4990
|
rest.treeLoaded = true
|
|
4922
4991
|
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
4923
|
-
treeExpandLazyLoadedMaps[rowid]
|
|
4992
|
+
delete treeExpandLazyLoadedMaps[rowid]
|
|
4924
4993
|
}
|
|
4925
4994
|
if (!XEUtils.isArray(childRecords)) {
|
|
4926
4995
|
childRecords = []
|
|
4927
4996
|
}
|
|
4928
4997
|
if (childRecords) {
|
|
4929
|
-
return this.loadTreeChildren(row, childRecords).then((childRows: any) => {
|
|
4998
|
+
return this.loadTreeChildren(row, childRecords).then((childRows: any[]) => {
|
|
4930
4999
|
const { treeExpandedMaps } = this
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
treeTempExpandedMaps[rowid] = row
|
|
4934
|
-
this.treeExpandedMaps = treeTempExpandedMaps
|
|
5000
|
+
if (childRows.length && !treeExpandedMaps[rowid]) {
|
|
5001
|
+
treeExpandedMaps[rowid] = row
|
|
4935
5002
|
}
|
|
4936
5003
|
// 如果当前节点已选中,则展开后子节点也被选中
|
|
4937
5004
|
if (!checkStrictly && this.isCheckedByCheckboxRow(row)) {
|
|
4938
|
-
this.handleCheckedCheckboxRow(childRows, true
|
|
5005
|
+
this.handleCheckedCheckboxRow(childRows, true)
|
|
4939
5006
|
}
|
|
4940
5007
|
return this.$nextTick().then(() => {
|
|
4941
5008
|
if (transform) {
|
|
@@ -4945,11 +5012,10 @@ const Methods = {
|
|
|
4945
5012
|
})
|
|
4946
5013
|
}
|
|
4947
5014
|
}).catch(() => {
|
|
4948
|
-
// 如果响应异常,则不展开,再次点击后将重新触发懒加载
|
|
4949
|
-
rest.treeLoaded = false
|
|
4950
5015
|
const { treeExpandLazyLoadedMaps } = this
|
|
5016
|
+
rest.treeLoaded = false
|
|
4951
5017
|
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
4952
|
-
treeExpandLazyLoadedMaps[rowid]
|
|
5018
|
+
delete treeExpandLazyLoadedMaps[rowid]
|
|
4953
5019
|
}
|
|
4954
5020
|
}).finally(() => {
|
|
4955
5021
|
this.$nextTick().then(() => this.recalculate()).then(() => resolve())
|
|
@@ -4983,7 +5049,7 @@ const Methods = {
|
|
|
4983
5049
|
* @returns
|
|
4984
5050
|
*/
|
|
4985
5051
|
handleBaseTreeExpand (rows: any, expanded: any) {
|
|
4986
|
-
const {
|
|
5052
|
+
const { fullAllDataRowIdData, tableFullData, treeExpandedMaps, treeOpts, treeExpandLazyLoadedMaps, treeNodeColumn } = this
|
|
4987
5053
|
const { reserve, lazy, accordion, toggleMethod } = treeOpts
|
|
4988
5054
|
const treeTempExpandedMaps = { ...treeExpandedMaps }
|
|
4989
5055
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
@@ -5009,7 +5075,7 @@ const Methods = {
|
|
|
5009
5075
|
validRows.forEach((row: any) => {
|
|
5010
5076
|
const rowid = getRowid(this, row)
|
|
5011
5077
|
if (!treeTempExpandedMaps[rowid]) {
|
|
5012
|
-
const rest =
|
|
5078
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
5013
5079
|
const isLoad = lazy && row[hasChildField] && !rest.treeLoaded && !treeExpandLazyLoadedMaps[rowid]
|
|
5014
5080
|
// 是否使用懒加载
|
|
5015
5081
|
if (isLoad) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|