vxe-table 4.10.1 → 4.10.2
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/README.md +6 -1
- package/es/style.css +1 -1
- package/es/table/module/custom/hook.js +3 -3
- package/es/table/src/cell.js +2 -1
- package/es/table/src/table.js +67 -29
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +96 -50
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/hook.js +3 -3
- package/lib/table/src/cell.js +2 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/table.js +79 -44
- 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 +2 -2
- package/packages/table/module/custom/hook.ts +3 -3
- package/packages/table/src/cell.ts +2 -1
- package/packages/table/src/table.ts +66 -29
- /package/es/{iconfont.1736122958782.ttf → iconfont.1736228981076.ttf} +0 -0
- /package/es/{iconfont.1736122958782.woff → iconfont.1736228981076.woff} +0 -0
- /package/es/{iconfont.1736122958782.woff2 → iconfont.1736228981076.woff2} +0 -0
- /package/lib/{iconfont.1736122958782.ttf → iconfont.1736228981076.ttf} +0 -0
- /package/lib/{iconfont.1736122958782.woff → iconfont.1736228981076.woff} +0 -0
- /package/lib/{iconfont.1736122958782.woff2 → iconfont.1736228981076.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.10.
|
|
16
|
+
const version = exports.version = "4.10.2";
|
|
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.10.
|
|
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.10.2",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,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.10.
|
|
11
|
+
const version = `table v${"4.10.2"}`;
|
|
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.10.
|
|
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.10.2",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.10.
|
|
3
|
+
"version": "4.10.2",
|
|
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": "^4.3.
|
|
31
|
+
"vxe-pc-ui": "^4.3.66"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/resize-observer-browser": "^0.1.11",
|
|
@@ -74,10 +74,10 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
74
74
|
const { customColumnList } = reactData
|
|
75
75
|
const customOpts = computeCustomOpts.value
|
|
76
76
|
const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts
|
|
77
|
-
XEUtils.eachTree(customColumnList, (column, index, items, path,
|
|
78
|
-
if (
|
|
77
|
+
XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
|
|
78
|
+
if (parentColumn) {
|
|
79
79
|
// 更新子列信息
|
|
80
|
-
column.fixed =
|
|
80
|
+
column.fixed = parentColumn.fixed
|
|
81
81
|
} else {
|
|
82
82
|
if (allowSort) {
|
|
83
83
|
const sortIndex = index + 1
|
|
@@ -462,6 +462,7 @@ export const Cell = {
|
|
|
462
462
|
$table.triggerTreeExpandEvent(evnt, params)
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
+
console.log(row.name, hasChild)
|
|
465
466
|
return [
|
|
466
467
|
h('div', {
|
|
467
468
|
class: ['vxe-cell--tree-node', {
|
|
@@ -471,7 +472,7 @@ export const Cell = {
|
|
|
471
472
|
paddingLeft: `${level * indent}px`
|
|
472
473
|
}
|
|
473
474
|
}, [
|
|
474
|
-
showIcon && (lazy ? (isLazyLoaded ? hasChild : hasLazyChilds) : hasChild)
|
|
475
|
+
showIcon && (lazy ? (isLazyLoaded ? hasChild : (hasChild || hasLazyChilds)) : hasChild)
|
|
475
476
|
? [
|
|
476
477
|
h('div', {
|
|
477
478
|
class: 'vxe-tree--btn-wrapper',
|
|
@@ -1122,6 +1122,8 @@ export default defineComponent({
|
|
|
1122
1122
|
const columnOpts = computeColumnOpts.value
|
|
1123
1123
|
const columnDragOpts = computeColumnDragOpts.value
|
|
1124
1124
|
const { isCrossDrag, isSelfToChildDrag } = columnDragOpts
|
|
1125
|
+
const customOpts = computeCustomOpts.value
|
|
1126
|
+
const { storage } = customOpts
|
|
1125
1127
|
const rowOpts = computeRowOpts.value
|
|
1126
1128
|
const isGroup = collectColumn.some(hasChildrenList)
|
|
1127
1129
|
let isAllOverflow = !!props.showOverflow
|
|
@@ -1140,8 +1142,8 @@ export default defineComponent({
|
|
|
1140
1142
|
}
|
|
1141
1143
|
fullColumnFieldData[field] = rest
|
|
1142
1144
|
} else {
|
|
1143
|
-
if (isCrossDrag || isSelfToChildDrag) {
|
|
1144
|
-
errLog('vxe.error.
|
|
1145
|
+
if (storage || isCrossDrag || isSelfToChildDrag) {
|
|
1146
|
+
errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`])
|
|
1145
1147
|
}
|
|
1146
1148
|
}
|
|
1147
1149
|
if (!hasFixed && fixed) {
|
|
@@ -2439,25 +2441,28 @@ export default defineComponent({
|
|
|
2439
2441
|
const { loadMethod } = expandOpts
|
|
2440
2442
|
if (loadMethod) {
|
|
2441
2443
|
const { fullAllDataRowIdData } = internalData
|
|
2442
|
-
const { rowExpandLazyLoadedMaps }
|
|
2444
|
+
const rExpandLazyLoadedMaps = { ...reactData.rowExpandLazyLoadedMaps }
|
|
2443
2445
|
const rowid = getRowid($xeTable, row)
|
|
2444
2446
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
2445
|
-
|
|
2447
|
+
rExpandLazyLoadedMaps[rowid] = row
|
|
2448
|
+
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
|
|
2446
2449
|
loadMethod({ $table: $xeTable, row, rowIndex: tableMethods.getRowIndex(row), $rowIndex: tableMethods.getVMRowIndex(row) }).then(() => {
|
|
2447
|
-
const { rowExpandedMaps }
|
|
2450
|
+
const rExpandedMaps = { ...reactData.rowExpandedMaps }
|
|
2448
2451
|
if (rowRest) {
|
|
2449
2452
|
rowRest.expandLoaded = true
|
|
2450
2453
|
}
|
|
2451
|
-
|
|
2454
|
+
rExpandedMaps[rowid] = row
|
|
2455
|
+
reactData.rowExpandedMaps = rExpandedMaps
|
|
2452
2456
|
}).catch(() => {
|
|
2453
2457
|
if (rowRest) {
|
|
2454
2458
|
rowRest.expandLoaded = false
|
|
2455
2459
|
}
|
|
2456
2460
|
}).finally(() => {
|
|
2457
|
-
const { rowExpandLazyLoadedMaps }
|
|
2458
|
-
if (
|
|
2459
|
-
delete
|
|
2461
|
+
const rExpandLazyLoadedMaps = { ...reactData.rowExpandLazyLoadedMaps }
|
|
2462
|
+
if (rExpandLazyLoadedMaps[rowid]) {
|
|
2463
|
+
delete rExpandLazyLoadedMaps[rowid]
|
|
2460
2464
|
}
|
|
2465
|
+
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
|
|
2461
2466
|
nextTick().then(() => tableMethods.recalculate()).then(() => resolve())
|
|
2462
2467
|
})
|
|
2463
2468
|
} else {
|
|
@@ -4796,7 +4801,7 @@ export default defineComponent({
|
|
|
4796
4801
|
return rowRest && !!rowRest.expandLoaded
|
|
4797
4802
|
},
|
|
4798
4803
|
clearRowExpandLoaded (row) {
|
|
4799
|
-
const { rowExpandLazyLoadedMaps }
|
|
4804
|
+
const rExpandLazyLoadedMaps = { ...reactData.rowExpandLazyLoadedMaps }
|
|
4800
4805
|
const { fullAllDataRowIdData } = internalData
|
|
4801
4806
|
const expandOpts = computeExpandOpts.value
|
|
4802
4807
|
const { lazy } = expandOpts
|
|
@@ -4804,8 +4809,9 @@ export default defineComponent({
|
|
|
4804
4809
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
4805
4810
|
if (lazy && rowRest) {
|
|
4806
4811
|
rowRest.expandLoaded = false
|
|
4807
|
-
delete
|
|
4812
|
+
delete rExpandLazyLoadedMaps[rowid]
|
|
4808
4813
|
}
|
|
4814
|
+
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
|
|
4809
4815
|
return nextTick()
|
|
4810
4816
|
},
|
|
4811
4817
|
/**
|
|
@@ -4974,7 +4980,7 @@ export default defineComponent({
|
|
|
4974
4980
|
return rowRest && !!rowRest.treeLoaded
|
|
4975
4981
|
},
|
|
4976
4982
|
clearTreeExpandLoaded (rows: any) {
|
|
4977
|
-
const { treeExpandedMaps }
|
|
4983
|
+
const tExpandedMaps = { ...reactData.treeExpandedMaps }
|
|
4978
4984
|
const { fullAllDataRowIdData } = internalData
|
|
4979
4985
|
const treeOpts = computeTreeOpts.value
|
|
4980
4986
|
const { transform } = treeOpts
|
|
@@ -4987,12 +4993,13 @@ export default defineComponent({
|
|
|
4987
4993
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
4988
4994
|
if (rowRest) {
|
|
4989
4995
|
rowRest.treeLoaded = false
|
|
4990
|
-
if (
|
|
4991
|
-
delete
|
|
4996
|
+
if (tExpandedMaps[rowid]) {
|
|
4997
|
+
delete tExpandedMaps[rowid]
|
|
4992
4998
|
}
|
|
4993
4999
|
}
|
|
4994
5000
|
})
|
|
4995
5001
|
}
|
|
5002
|
+
reactData.treeExpandedMaps = tExpandedMaps
|
|
4996
5003
|
if (transform) {
|
|
4997
5004
|
handleVirtualTreeToList()
|
|
4998
5005
|
return tablePrivateMethods.handleTableData()
|
|
@@ -5419,7 +5426,7 @@ export default defineComponent({
|
|
|
5419
5426
|
}
|
|
5420
5427
|
let hasResizable = 0
|
|
5421
5428
|
let hasSort = 0
|
|
5422
|
-
let
|
|
5429
|
+
let hasFixed = 0
|
|
5423
5430
|
let hasVisible = 0
|
|
5424
5431
|
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
5425
5432
|
// 只支持一级
|
|
@@ -5434,7 +5441,7 @@ export default defineComponent({
|
|
|
5434
5441
|
if (column.fixed !== column.defaultFixed) {
|
|
5435
5442
|
const colKey = column.getKey()
|
|
5436
5443
|
if (colKey) {
|
|
5437
|
-
|
|
5444
|
+
hasFixed = 1
|
|
5438
5445
|
fixedData[colKey] = column.fixed
|
|
5439
5446
|
}
|
|
5440
5447
|
}
|
|
@@ -5468,7 +5475,7 @@ export default defineComponent({
|
|
|
5468
5475
|
if (hasSort) {
|
|
5469
5476
|
storeData.sortData = sortData
|
|
5470
5477
|
}
|
|
5471
|
-
if (
|
|
5478
|
+
if (hasFixed) {
|
|
5472
5479
|
storeData.fixedData = fixedData
|
|
5473
5480
|
}
|
|
5474
5481
|
if (hasVisible) {
|
|
@@ -7375,22 +7382,21 @@ export default defineComponent({
|
|
|
7375
7382
|
evnt.dataTransfer.setDragImage(getTpImg(), 0, 0)
|
|
7376
7383
|
}
|
|
7377
7384
|
},
|
|
7378
|
-
|
|
7385
|
+
handleRowDragSwapEvent (evnt, isSyncRow, dragRow, prevDragRow, prevDragPos, prevDragToChild) {
|
|
7379
7386
|
const { treeConfig, dragConfig } = props
|
|
7380
7387
|
const rowDragOpts = computeRowDragOpts.value
|
|
7381
|
-
const { fullAllDataRowIdData
|
|
7388
|
+
const { fullAllDataRowIdData } = internalData
|
|
7382
7389
|
const { isPeerDrag, isCrossDrag, isSelfToChildDrag, dragEndMethod } = rowDragOpts
|
|
7383
7390
|
const treeOpts = computeTreeOpts.value
|
|
7384
7391
|
const { transform, rowField, mapChildrenField, parentField } = treeOpts
|
|
7385
7392
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
7386
|
-
const {
|
|
7387
|
-
const { afterFullData, tableFullData, prevDragRow, prevDragPos } = internalData
|
|
7393
|
+
const { afterFullData, tableFullData } = internalData
|
|
7388
7394
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null)
|
|
7389
7395
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0
|
|
7390
7396
|
if (prevDragRow && dragRow) {
|
|
7391
7397
|
// 判断是否有拖动
|
|
7392
7398
|
if (prevDragRow !== dragRow) {
|
|
7393
|
-
Promise.resolve(
|
|
7399
|
+
return Promise.resolve(
|
|
7394
7400
|
dEndMethod
|
|
7395
7401
|
? dEndMethod({
|
|
7396
7402
|
oldRow: dragRow,
|
|
@@ -7415,6 +7421,7 @@ export default defineComponent({
|
|
|
7415
7421
|
const oldRest = fullAllDataRowIdData[oldRowid]
|
|
7416
7422
|
const newRowid = getRowid($xeTable, prevDragRow)
|
|
7417
7423
|
const newRest = fullAllDataRowIdData[newRowid]
|
|
7424
|
+
|
|
7418
7425
|
if (oldRest && newRest) {
|
|
7419
7426
|
const { level: oldLevel } = oldRest
|
|
7420
7427
|
const { level: newLevel } = newRest
|
|
@@ -7552,6 +7559,32 @@ export default defineComponent({
|
|
|
7552
7559
|
})
|
|
7553
7560
|
}
|
|
7554
7561
|
}
|
|
7562
|
+
return Promise.resolve()
|
|
7563
|
+
},
|
|
7564
|
+
handleRowDragDragendEvent (evnt) {
|
|
7565
|
+
const { treeConfig } = props
|
|
7566
|
+
const { fullAllDataRowIdData, prevDragToChild } = internalData
|
|
7567
|
+
const { dragRow } = reactData
|
|
7568
|
+
const treeOpts = computeTreeOpts.value
|
|
7569
|
+
const { lazy } = treeOpts
|
|
7570
|
+
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
|
|
7571
|
+
const { prevDragRow, prevDragPos } = internalData
|
|
7572
|
+
if (treeConfig && prevDragToChild) {
|
|
7573
|
+
// 懒加载
|
|
7574
|
+
if (lazy) {
|
|
7575
|
+
const newRowid = getRowid($xeTable, prevDragRow)
|
|
7576
|
+
const rowRest = fullAllDataRowIdData[newRowid]
|
|
7577
|
+
if (prevDragRow[hasChildField]) {
|
|
7578
|
+
if (rowRest && rowRest.treeLoaded) {
|
|
7579
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild)
|
|
7580
|
+
}
|
|
7581
|
+
} else {
|
|
7582
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild)
|
|
7583
|
+
}
|
|
7584
|
+
}
|
|
7585
|
+
} else {
|
|
7586
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild)
|
|
7587
|
+
}
|
|
7555
7588
|
hideDropTip()
|
|
7556
7589
|
clearRowDropOrigin()
|
|
7557
7590
|
internalData.prevDragToChild = false
|
|
@@ -7566,7 +7599,8 @@ export default defineComponent({
|
|
|
7566
7599
|
const { fullAllDataRowIdData } = internalData
|
|
7567
7600
|
const { dragRow } = reactData
|
|
7568
7601
|
const treeOpts = computeTreeOpts.value
|
|
7569
|
-
const { transform, parentField } = treeOpts
|
|
7602
|
+
const { lazy, transform, parentField } = treeOpts
|
|
7603
|
+
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
|
|
7570
7604
|
const rowDragOpts = computeRowDragOpts.value
|
|
7571
7605
|
const { isPeerDrag, isCrossDrag, isToChildDrag } = rowDragOpts
|
|
7572
7606
|
if (!dragRow) {
|
|
@@ -7579,19 +7613,22 @@ export default defineComponent({
|
|
|
7579
7613
|
const rest = fullAllDataRowIdData[rowid]
|
|
7580
7614
|
if (rest) {
|
|
7581
7615
|
const row = rest.row
|
|
7616
|
+
const rowid = getRowid($xeTable, row)
|
|
7617
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
7582
7618
|
evnt.preventDefault()
|
|
7583
7619
|
const { dragRow } = reactData
|
|
7584
7620
|
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y
|
|
7585
7621
|
const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom'
|
|
7622
|
+
internalData.prevDragToChild = !!(treeConfig && transform && (isCrossDrag && isToChildDrag) && hasCtrlKey)
|
|
7623
|
+
internalData.prevDragRow = row
|
|
7624
|
+
internalData.prevDragPos = dragPos
|
|
7586
7625
|
if ($xeTable.eqRow(dragRow, row) ||
|
|
7626
|
+
(hasCtrlKey && treeConfig && lazy && row[hasChildField] && rowRest && !rowRest.treeLoaded) ||
|
|
7587
7627
|
(!isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rest.level))
|
|
7588
7628
|
) {
|
|
7589
7629
|
showDropTip(evnt, trEl, null, false, dragPos)
|
|
7590
7630
|
return
|
|
7591
7631
|
}
|
|
7592
|
-
internalData.prevDragToChild = !!(treeConfig && transform && (isCrossDrag && isToChildDrag) && hasCtrlKey)
|
|
7593
|
-
internalData.prevDragRow = row
|
|
7594
|
-
internalData.prevDragPos = dragPos
|
|
7595
7632
|
showDropTip(evnt, trEl, null, true, dragPos)
|
|
7596
7633
|
dispatchEvent('row-dragover', {
|
|
7597
7634
|
oldRow: dragRow,
|
|
@@ -7844,6 +7881,9 @@ export default defineComponent({
|
|
|
7844
7881
|
const { clientX } = evnt
|
|
7845
7882
|
const offsetX = clientX - thEl.getBoundingClientRect().x
|
|
7846
7883
|
const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right'
|
|
7884
|
+
internalData.prevDragToChild = !!((isCrossDrag && isToChildDrag) && hasCtrlKey)
|
|
7885
|
+
internalData.prevDragCol = column
|
|
7886
|
+
internalData.prevDragPos = dragPos
|
|
7847
7887
|
if (column.fixed ||
|
|
7848
7888
|
(dragCol && dragCol.id === column.id) ||
|
|
7849
7889
|
(!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.parentId))
|
|
@@ -7851,9 +7891,6 @@ export default defineComponent({
|
|
|
7851
7891
|
showDropTip(evnt, null, thEl, false, dragPos)
|
|
7852
7892
|
return
|
|
7853
7893
|
}
|
|
7854
|
-
internalData.prevDragToChild = !!((isCrossDrag && isToChildDrag) && hasCtrlKey)
|
|
7855
|
-
internalData.prevDragCol = column
|
|
7856
|
-
internalData.prevDragPos = dragPos
|
|
7857
7894
|
showDropTip(evnt, null, thEl, true, dragPos)
|
|
7858
7895
|
dispatchEvent('column-dragover', {
|
|
7859
7896
|
oldColumn: dragCol,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|