vxe-table 4.17.28 → 4.17.29
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/emits.js +3 -0
- package/es/table/src/table.js +201 -165
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +31 -30
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/table.js +28 -27
- 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/src/emits.ts +4 -0
- package/packages/table/src/table.ts +208 -170
- /package/es/{iconfont.1765353166500.ttf → iconfont.1765538995329.ttf} +0 -0
- /package/es/{iconfont.1765353166500.woff → iconfont.1765538995329.woff} +0 -0
- /package/es/{iconfont.1765353166500.woff2 → iconfont.1765538995329.woff2} +0 -0
- /package/lib/{iconfont.1765353166500.ttf → iconfont.1765538995329.ttf} +0 -0
- /package/lib/{iconfont.1765353166500.woff → iconfont.1765538995329.woff} +0 -0
- /package/lib/{iconfont.1765353166500.woff2 → iconfont.1765538995329.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.17.
|
|
16
|
+
const version = exports.version = "4.17.29";
|
|
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.17.
|
|
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.17.29",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,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},headerTooltipConfig:{enterable:!0},footerTooltipConfig:{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"},menuConfig:{destroyOnClose:!0},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:{destroyOnClose:!0,multiple:!0,showIcon:!0},floatingFilterConfig:{},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,showRootLine:!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:{x:{visible:!0},y:{visible:!0}}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showLoading:!0,showResponseMsg:!0,showActionMsg:!0,response:{list:"list",result:"result",total:"page.total",footerData:"footerData",message:"message"}}},toolbar:{},gantt:{}}),"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_MENU_OPTION_LOADING:iconPrefix+"repeat roll",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.17.
|
|
11
|
+
const version = `table v${"4.17.29"}`;
|
|
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.17.
|
|
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.17.29",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.17.
|
|
3
|
+
"version": "4.17.29",
|
|
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",
|
|
@@ -3787,7 +3787,8 @@ export default defineVxeComponent({
|
|
|
3787
3787
|
|
|
3788
3788
|
const initData = () => {
|
|
3789
3789
|
const { data } = props
|
|
3790
|
-
|
|
3790
|
+
dispatchEvent('ready', {}, null)
|
|
3791
|
+
loadTableData(data || [], true, true).then(() => {
|
|
3791
3792
|
if (data && data.length) {
|
|
3792
3793
|
internalData.inited = true
|
|
3793
3794
|
internalData.initStatus = true
|
|
@@ -3806,10 +3807,10 @@ export default defineVxeComponent({
|
|
|
3806
3807
|
* 加载表格数据
|
|
3807
3808
|
* @param {Array} datas 数据
|
|
3808
3809
|
*/
|
|
3809
|
-
const loadTableData = (datas: any[], isReset: boolean) => {
|
|
3810
|
+
const loadTableData = (datas: any[], isReload: boolean, isReset: boolean) => {
|
|
3810
3811
|
const { keepSource, treeConfig, rowGroupConfig, aggregateConfig } = props
|
|
3811
3812
|
const { rowGroupList, scrollYLoad: oldScrollYLoad } = reactData
|
|
3812
|
-
const { scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData
|
|
3813
|
+
const { initStatus, scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData
|
|
3813
3814
|
const rowOpts = computeRowOpts.value
|
|
3814
3815
|
const treeOpts = computeTreeOpts.value
|
|
3815
3816
|
const expandOpts = computeExpandOpts.value
|
|
@@ -3948,6 +3949,18 @@ export default defineVxeComponent({
|
|
|
3948
3949
|
|
|
3949
3950
|
handleReserveStatus()
|
|
3950
3951
|
$xeTable.checkSelectionStatus()
|
|
3952
|
+
if (initStatus) {
|
|
3953
|
+
dispatchEvent('data-rendered', {
|
|
3954
|
+
isReload,
|
|
3955
|
+
visibleColumn: internalData.visibleColumn,
|
|
3956
|
+
visibleData: internalData.afterFullData
|
|
3957
|
+
}, null)
|
|
3958
|
+
} else {
|
|
3959
|
+
dispatchEvent('init-rendered', {
|
|
3960
|
+
visibleColumn: internalData.visibleColumn,
|
|
3961
|
+
visibleData: internalData.afterFullData
|
|
3962
|
+
}, null)
|
|
3963
|
+
}
|
|
3951
3964
|
$xeTable.dispatchEvent('data-change', {
|
|
3952
3965
|
visibleColumn: internalData.visibleColumn,
|
|
3953
3966
|
visibleData: internalData.afterFullData
|
|
@@ -4019,7 +4032,9 @@ export default defineVxeComponent({
|
|
|
4019
4032
|
handleDefaultMergeCells()
|
|
4020
4033
|
handleDefaultMergeHeaderItems()
|
|
4021
4034
|
handleDefaultMergeFooterItems()
|
|
4022
|
-
nextTick(() =>
|
|
4035
|
+
nextTick(() => {
|
|
4036
|
+
setTimeout(() => $xeTable.recalculate())
|
|
4037
|
+
})
|
|
4023
4038
|
}
|
|
4024
4039
|
|
|
4025
4040
|
/**
|
|
@@ -5022,7 +5037,7 @@ export default defineVxeComponent({
|
|
|
5022
5037
|
*/
|
|
5023
5038
|
loadData (datas) {
|
|
5024
5039
|
const { initStatus } = internalData
|
|
5025
|
-
return loadTableData(datas, false).then(() => {
|
|
5040
|
+
return loadTableData(datas, false, false).then(() => {
|
|
5026
5041
|
internalData.inited = true
|
|
5027
5042
|
internalData.initStatus = true
|
|
5028
5043
|
if (!initStatus) {
|
|
@@ -5040,7 +5055,7 @@ export default defineVxeComponent({
|
|
|
5040
5055
|
.then(() => {
|
|
5041
5056
|
internalData.inited = true
|
|
5042
5057
|
internalData.initStatus = true
|
|
5043
|
-
return loadTableData(datas, true)
|
|
5058
|
+
return loadTableData(datas, true, true)
|
|
5044
5059
|
}).then(() => {
|
|
5045
5060
|
handleLoadDefaults()
|
|
5046
5061
|
return handleLazyRecalculate(false, true, true)
|
|
@@ -7123,7 +7138,7 @@ export default defineVxeComponent({
|
|
|
7123
7138
|
handleUpdateRowGroup(confList.map(fieldOrColumn => {
|
|
7124
7139
|
return XEUtils.isString(fieldOrColumn) ? fieldOrColumn : fieldOrColumn.field
|
|
7125
7140
|
}))
|
|
7126
|
-
return loadTableData(internalData.tableSynchData, true)
|
|
7141
|
+
return loadTableData(internalData.tableSynchData, false, true)
|
|
7127
7142
|
}
|
|
7128
7143
|
return nextTick()
|
|
7129
7144
|
},
|
|
@@ -7152,7 +7167,7 @@ export default defineVxeComponent({
|
|
|
7152
7167
|
return nextTick()
|
|
7153
7168
|
}
|
|
7154
7169
|
handleUpdateRowGroup([])
|
|
7155
|
-
return loadTableData(internalData.tableSynchData, true)
|
|
7170
|
+
return loadTableData(internalData.tableSynchData, false, true)
|
|
7156
7171
|
},
|
|
7157
7172
|
isRowGroupRecord (row) {
|
|
7158
7173
|
warnLog('vxe.error.delFunc', ['isRowGroupRecord', 'isAggregateRecord'])
|
|
@@ -8506,6 +8521,18 @@ export default defineVxeComponent({
|
|
|
8506
8521
|
}
|
|
8507
8522
|
}
|
|
8508
8523
|
|
|
8524
|
+
const handleRowDragEndClearStatus = () => {
|
|
8525
|
+
clearRowDragData()
|
|
8526
|
+
clearCrossTableDragStatus()
|
|
8527
|
+
handleRecalculateStyle(false, true, true)
|
|
8528
|
+
}
|
|
8529
|
+
|
|
8530
|
+
const handleColDragEndClearStatus = () => {
|
|
8531
|
+
clearColDragData()
|
|
8532
|
+
clearCrossTableDragStatus()
|
|
8533
|
+
handleRecalculateStyle(true, true, true)
|
|
8534
|
+
}
|
|
8535
|
+
|
|
8509
8536
|
const clearRowDropOrigin = () => {
|
|
8510
8537
|
const el = refElem.value
|
|
8511
8538
|
if (el) {
|
|
@@ -10539,82 +10566,52 @@ export default defineVxeComponent({
|
|
|
10539
10566
|
dragToChild: !!prevDragToChild,
|
|
10540
10567
|
offsetIndex: dragOffsetIndex as 0 | 1
|
|
10541
10568
|
}
|
|
10542
|
-
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
10543
|
-
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
10544
|
-
if (!status) {
|
|
10545
|
-
return errRest
|
|
10546
|
-
}
|
|
10547
10569
|
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
}
|
|
10570
|
+
const dragRowid = getRowid($xeTable, dragRow)
|
|
10571
|
+
const dragRowRest = fullAllDataRowIdData[dragRowid] || {}
|
|
10572
|
+
const _dragRowIndex = dragRowRest._index
|
|
10573
|
+
let dragRowHeight = 0
|
|
10574
|
+
let dragOffsetTop = -1
|
|
10575
|
+
if (animation) {
|
|
10576
|
+
dragRowHeight = getCellRestHeight(dragRowRest, cellOpts, rowOpts, defaultRowHeight)
|
|
10577
|
+
const oldTrEl = el.querySelector<HTMLElement>(`.vxe-body--row[rowid="${dragRowid}"]`)
|
|
10578
|
+
if (oldTrEl) {
|
|
10579
|
+
dragOffsetTop = oldTrEl.offsetTop
|
|
10559
10580
|
}
|
|
10581
|
+
}
|
|
10560
10582
|
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
const newRowid = getRowid($xeTable, prevDragRow)
|
|
10569
|
-
const newRest = fullAllDataRowIdData[newRowid]
|
|
10570
|
-
|
|
10571
|
-
if (oldRest && newRest) {
|
|
10572
|
-
const { level: oldLevel } = oldRest
|
|
10573
|
-
const { level: newLevel } = newRest
|
|
10574
|
-
|
|
10575
|
-
const oldAllMaps: Record<string, any> = {}
|
|
10576
|
-
XEUtils.eachTree([dragRow], item => {
|
|
10577
|
-
oldAllMaps[getRowid($xeTable, item)] = item
|
|
10578
|
-
}, { children: mapChildrenField })
|
|
10579
|
-
|
|
10580
|
-
let isSelfToChildStatus = false
|
|
10581
|
-
|
|
10582
|
-
if (oldLevel && newLevel) {
|
|
10583
|
-
// 子到子
|
|
10584
|
-
|
|
10585
|
-
if (isPeerDrag && !isCrossDrag) {
|
|
10586
|
-
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
10587
|
-
// 非同级
|
|
10588
|
-
return errRest
|
|
10589
|
-
}
|
|
10590
|
-
} else {
|
|
10591
|
-
if (!isCrossDrag) {
|
|
10592
|
-
return errRest
|
|
10593
|
-
}
|
|
10594
|
-
if (oldAllMaps[newRowid]) {
|
|
10595
|
-
isSelfToChildStatus = true
|
|
10596
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
10597
|
-
if (VxeUI.modal) {
|
|
10598
|
-
VxeUI.modal.message({
|
|
10599
|
-
status: 'error',
|
|
10600
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
10601
|
-
})
|
|
10602
|
-
}
|
|
10603
|
-
return errRest
|
|
10604
|
-
}
|
|
10605
|
-
}
|
|
10606
|
-
}
|
|
10607
|
-
} else if (oldLevel) {
|
|
10608
|
-
// 子到根
|
|
10583
|
+
let oafIndex = -1
|
|
10584
|
+
let nafIndex = -1
|
|
10585
|
+
const oldRest = dragRowRest
|
|
10586
|
+
const newRowid = getRowid($xeTable, prevDragRow)
|
|
10587
|
+
const newRest = fullAllDataRowIdData[newRowid]
|
|
10588
|
+
const oldAllMaps: Record<string, any> = {}
|
|
10589
|
+
let isSelfToChildStatus = false
|
|
10609
10590
|
|
|
10610
|
-
|
|
10611
|
-
|
|
10591
|
+
// 如果为树结构
|
|
10592
|
+
if (treeConfig) {
|
|
10593
|
+
if (transform) {
|
|
10594
|
+
if (oldRest && newRest) {
|
|
10595
|
+
const { level: oldLevel } = oldRest
|
|
10596
|
+
const { level: newLevel } = newRest
|
|
10597
|
+
|
|
10598
|
+
XEUtils.eachTree([dragRow], item => {
|
|
10599
|
+
oldAllMaps[getRowid($xeTable, item)] = item
|
|
10600
|
+
}, { children: mapChildrenField })
|
|
10601
|
+
|
|
10602
|
+
if (oldLevel && newLevel) {
|
|
10603
|
+
// 子到子
|
|
10604
|
+
|
|
10605
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
10606
|
+
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
10607
|
+
// 非同级
|
|
10608
|
+
handleRowDragEndClearStatus()
|
|
10609
|
+
return Promise.resolve(errRest)
|
|
10612
10610
|
}
|
|
10613
|
-
} else
|
|
10614
|
-
// 根到子
|
|
10615
|
-
|
|
10611
|
+
} else {
|
|
10616
10612
|
if (!isCrossDrag) {
|
|
10617
|
-
|
|
10613
|
+
handleRowDragEndClearStatus()
|
|
10614
|
+
return Promise.resolve(errRest)
|
|
10618
10615
|
}
|
|
10619
10616
|
if (oldAllMaps[newRowid]) {
|
|
10620
10617
|
isSelfToChildStatus = true
|
|
@@ -10625,13 +10622,56 @@ export default defineVxeComponent({
|
|
|
10625
10622
|
content: getI18n('vxe.error.treeDragChild')
|
|
10626
10623
|
})
|
|
10627
10624
|
}
|
|
10628
|
-
|
|
10625
|
+
handleRowDragEndClearStatus()
|
|
10626
|
+
return Promise.resolve(errRest)
|
|
10629
10627
|
}
|
|
10630
10628
|
}
|
|
10631
|
-
} else {
|
|
10632
|
-
// 根到根
|
|
10633
10629
|
}
|
|
10630
|
+
} else if (oldLevel) {
|
|
10631
|
+
// 子到根
|
|
10632
|
+
|
|
10633
|
+
if (!isCrossDrag) {
|
|
10634
|
+
handleRowDragEndClearStatus()
|
|
10635
|
+
return Promise.resolve(errRest)
|
|
10636
|
+
}
|
|
10637
|
+
} else if (newLevel) {
|
|
10638
|
+
// 根到子
|
|
10639
|
+
|
|
10640
|
+
if (!isCrossDrag) {
|
|
10641
|
+
handleRowDragEndClearStatus()
|
|
10642
|
+
return Promise.resolve(errRest)
|
|
10643
|
+
}
|
|
10644
|
+
if (oldAllMaps[newRowid]) {
|
|
10645
|
+
isSelfToChildStatus = true
|
|
10646
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
10647
|
+
if (VxeUI.modal) {
|
|
10648
|
+
VxeUI.modal.message({
|
|
10649
|
+
status: 'error',
|
|
10650
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
10651
|
+
})
|
|
10652
|
+
}
|
|
10653
|
+
handleRowDragEndClearStatus()
|
|
10654
|
+
return Promise.resolve(errRest)
|
|
10655
|
+
}
|
|
10656
|
+
}
|
|
10657
|
+
} else {
|
|
10658
|
+
// 根到根
|
|
10659
|
+
}
|
|
10660
|
+
}
|
|
10661
|
+
}
|
|
10662
|
+
}
|
|
10663
|
+
|
|
10664
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
10665
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
10666
|
+
if (!status) {
|
|
10667
|
+
return errRest
|
|
10668
|
+
}
|
|
10634
10669
|
|
|
10670
|
+
// 如果为树结构
|
|
10671
|
+
if (treeConfig) {
|
|
10672
|
+
if (transform) {
|
|
10673
|
+
// 移出源位置
|
|
10674
|
+
if (oldRest && newRest) {
|
|
10635
10675
|
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
10636
10676
|
key: rowField,
|
|
10637
10677
|
parentKey: parentField,
|
|
@@ -10677,8 +10717,6 @@ export default defineVxeComponent({
|
|
|
10677
10717
|
afterFullData.splice(nafIndex, 0, dragRow)
|
|
10678
10718
|
tableFullData.splice(ntfIndex, 0, dragRow)
|
|
10679
10719
|
}
|
|
10680
|
-
clearRowDragData()
|
|
10681
|
-
clearCrossTableDragStatus()
|
|
10682
10720
|
|
|
10683
10721
|
$xeTable.handleTableData(treeConfig && transform)
|
|
10684
10722
|
$xeTable.cacheRowMap(false)
|
|
@@ -10791,18 +10829,15 @@ export default defineVxeComponent({
|
|
|
10791
10829
|
}).catch(() => {
|
|
10792
10830
|
return errRest
|
|
10793
10831
|
}).then((rest) => {
|
|
10794
|
-
|
|
10795
|
-
clearCrossTableDragStatus()
|
|
10832
|
+
handleRowDragEndClearStatus()
|
|
10796
10833
|
return rest
|
|
10797
10834
|
})
|
|
10798
10835
|
}
|
|
10799
|
-
|
|
10800
|
-
clearCrossTableDragStatus()
|
|
10836
|
+
handleRowDragEndClearStatus()
|
|
10801
10837
|
return Promise.resolve(errRest)
|
|
10802
10838
|
},
|
|
10803
10839
|
handleCrossTableRowDragCancelEvent () {
|
|
10804
|
-
|
|
10805
|
-
clearCrossTableDragStatus()
|
|
10840
|
+
handleRowDragEndClearStatus()
|
|
10806
10841
|
},
|
|
10807
10842
|
/**
|
|
10808
10843
|
* 处理跨表拖拽完成
|
|
@@ -10863,8 +10898,7 @@ export default defineVxeComponent({
|
|
|
10863
10898
|
dispatchEvent('row-remove-dragend', {
|
|
10864
10899
|
row: dragRow
|
|
10865
10900
|
}, evnt)
|
|
10866
|
-
|
|
10867
|
-
clearCrossTableDragStatus()
|
|
10901
|
+
handleRowDragEndClearStatus()
|
|
10868
10902
|
}
|
|
10869
10903
|
}
|
|
10870
10904
|
},
|
|
@@ -10937,8 +10971,7 @@ export default defineVxeComponent({
|
|
|
10937
10971
|
$oldTable.handleCrossTableRowDragCancelEvent(evnt)
|
|
10938
10972
|
}
|
|
10939
10973
|
}
|
|
10940
|
-
|
|
10941
|
-
clearCrossTableDragStatus()
|
|
10974
|
+
handleRowDragEndClearStatus()
|
|
10942
10975
|
return errRest
|
|
10943
10976
|
}
|
|
10944
10977
|
let insertRest: Promise<any> = Promise.resolve()
|
|
@@ -11204,86 +11237,58 @@ export default defineVxeComponent({
|
|
|
11204
11237
|
dragToChild: !!prevDragToChild,
|
|
11205
11238
|
offsetIndex: dragOffsetIndex as 0 | 1
|
|
11206
11239
|
}
|
|
11207
|
-
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
11208
|
-
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
11209
|
-
if (!status) {
|
|
11210
|
-
return errRest
|
|
11211
|
-
}
|
|
11212
|
-
|
|
11213
|
-
let dragTargetColumn: VxeTableDefines.ColumnInfo | null = null
|
|
11214
|
-
const dragAllTargetCols: VxeTableDefines.ColumnInfo[] = []
|
|
11215
|
-
let dragColWidth = 0
|
|
11216
|
-
if (animation) {
|
|
11217
|
-
XEUtils.eachTree([dragColumn], column => {
|
|
11218
|
-
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
11219
|
-
dragTargetColumn = column
|
|
11220
|
-
dragColWidth += column.renderWidth
|
|
11221
|
-
}
|
|
11222
|
-
dragAllTargetCols.push(column)
|
|
11223
|
-
})
|
|
11224
|
-
}
|
|
11225
|
-
if (!dragTargetColumn) {
|
|
11226
|
-
dragTargetColumn = dragColumn
|
|
11227
|
-
}
|
|
11228
|
-
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {}
|
|
11229
|
-
const _dragColIndex = dragColRest._index
|
|
11230
11240
|
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11241
|
+
let dragTargetColumn: VxeTableDefines.ColumnInfo | null = null
|
|
11242
|
+
const dragAllTargetCols: VxeTableDefines.ColumnInfo[] = []
|
|
11243
|
+
let dragColWidth = 0
|
|
11244
|
+
if (animation) {
|
|
11245
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
11246
|
+
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
11247
|
+
dragTargetColumn = column
|
|
11248
|
+
dragColWidth += column.renderWidth
|
|
11236
11249
|
}
|
|
11250
|
+
dragAllTargetCols.push(column)
|
|
11251
|
+
})
|
|
11252
|
+
}
|
|
11253
|
+
if (!dragTargetColumn) {
|
|
11254
|
+
dragTargetColumn = dragColumn
|
|
11255
|
+
}
|
|
11256
|
+
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {}
|
|
11257
|
+
const _dragColIndex = dragColRest._index
|
|
11258
|
+
|
|
11259
|
+
let dragOffsetLeft = -1
|
|
11260
|
+
if (animation) {
|
|
11261
|
+
const oldTrEl = el.querySelector<HTMLElement>(`.vxe-table--column[colid="${dragTargetColumn.id}"]`)
|
|
11262
|
+
if (oldTrEl) {
|
|
11263
|
+
dragOffsetLeft = oldTrEl.offsetLeft
|
|
11237
11264
|
}
|
|
11265
|
+
}
|
|
11238
11266
|
|
|
11239
|
-
|
|
11240
|
-
|
|
11267
|
+
let oafIndex = -1
|
|
11268
|
+
let nafIndex = -1
|
|
11241
11269
|
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11270
|
+
const oldAllMaps: Record<string, any> = {}
|
|
11271
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
11272
|
+
oldAllMaps[column.id] = column
|
|
11273
|
+
})
|
|
11246
11274
|
|
|
11247
|
-
|
|
11275
|
+
let isSelfToChildStatus = false
|
|
11248
11276
|
|
|
11249
|
-
|
|
11250
|
-
|
|
11277
|
+
if (dragColumn.parentId && newColumn.parentId) {
|
|
11278
|
+
// 子到子
|
|
11251
11279
|
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
} else {
|
|
11258
|
-
if (!isCrossDrag) {
|
|
11259
|
-
return errRest
|
|
11260
|
-
}
|
|
11261
|
-
|
|
11262
|
-
if (oldAllMaps[newColumn.id]) {
|
|
11263
|
-
isSelfToChildStatus = true
|
|
11264
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
11265
|
-
if (VxeUI.modal) {
|
|
11266
|
-
VxeUI.modal.message({
|
|
11267
|
-
status: 'error',
|
|
11268
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
11269
|
-
})
|
|
11270
|
-
}
|
|
11271
|
-
return errRest
|
|
11272
|
-
}
|
|
11273
|
-
}
|
|
11280
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
11281
|
+
if (dragColumn.parentId !== newColumn.parentId) {
|
|
11282
|
+
// 非同级
|
|
11283
|
+
handleColDragEndClearStatus()
|
|
11284
|
+
return Promise.resolve(errRest)
|
|
11274
11285
|
}
|
|
11275
|
-
} else
|
|
11276
|
-
// 子到根
|
|
11277
|
-
|
|
11286
|
+
} else {
|
|
11278
11287
|
if (!isCrossDrag) {
|
|
11279
|
-
|
|
11288
|
+
handleColDragEndClearStatus()
|
|
11289
|
+
return Promise.resolve(errRest)
|
|
11280
11290
|
}
|
|
11281
|
-
} else if (newColumn.parentId) {
|
|
11282
|
-
// 根到子
|
|
11283
11291
|
|
|
11284
|
-
if (!isCrossDrag) {
|
|
11285
|
-
return errRest
|
|
11286
|
-
}
|
|
11287
11292
|
if (oldAllMaps[newColumn.id]) {
|
|
11288
11293
|
isSelfToChildStatus = true
|
|
11289
11294
|
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
@@ -11293,11 +11298,46 @@ export default defineVxeComponent({
|
|
|
11293
11298
|
content: getI18n('vxe.error.treeDragChild')
|
|
11294
11299
|
})
|
|
11295
11300
|
}
|
|
11296
|
-
|
|
11301
|
+
handleColDragEndClearStatus()
|
|
11302
|
+
return Promise.resolve(errRest)
|
|
11297
11303
|
}
|
|
11298
11304
|
}
|
|
11299
|
-
}
|
|
11300
|
-
|
|
11305
|
+
}
|
|
11306
|
+
} else if (dragColumn.parentId) {
|
|
11307
|
+
// 子到根
|
|
11308
|
+
|
|
11309
|
+
if (!isCrossDrag) {
|
|
11310
|
+
handleColDragEndClearStatus()
|
|
11311
|
+
return Promise.resolve(errRest)
|
|
11312
|
+
}
|
|
11313
|
+
} else if (newColumn.parentId) {
|
|
11314
|
+
// 根到子
|
|
11315
|
+
|
|
11316
|
+
if (!isCrossDrag) {
|
|
11317
|
+
handleColDragEndClearStatus()
|
|
11318
|
+
return Promise.resolve(errRest)
|
|
11319
|
+
}
|
|
11320
|
+
if (oldAllMaps[newColumn.id]) {
|
|
11321
|
+
isSelfToChildStatus = true
|
|
11322
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
11323
|
+
if (VxeUI.modal) {
|
|
11324
|
+
VxeUI.modal.message({
|
|
11325
|
+
status: 'error',
|
|
11326
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
11327
|
+
})
|
|
11328
|
+
}
|
|
11329
|
+
handleColDragEndClearStatus()
|
|
11330
|
+
return Promise.resolve(errRest)
|
|
11331
|
+
}
|
|
11332
|
+
}
|
|
11333
|
+
} else {
|
|
11334
|
+
// 根到根
|
|
11335
|
+
}
|
|
11336
|
+
|
|
11337
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
11338
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
11339
|
+
if (!status) {
|
|
11340
|
+
return errRest
|
|
11301
11341
|
}
|
|
11302
11342
|
|
|
11303
11343
|
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id)
|
|
@@ -11465,13 +11505,11 @@ export default defineVxeComponent({
|
|
|
11465
11505
|
}).catch(() => {
|
|
11466
11506
|
return errRest
|
|
11467
11507
|
}).then((rest) => {
|
|
11468
|
-
|
|
11469
|
-
clearCrossTableDragStatus()
|
|
11508
|
+
handleColDragEndClearStatus()
|
|
11470
11509
|
return rest
|
|
11471
11510
|
})
|
|
11472
11511
|
}
|
|
11473
|
-
|
|
11474
|
-
clearCrossTableDragStatus()
|
|
11512
|
+
handleColDragEndClearStatus()
|
|
11475
11513
|
return Promise.resolve(errRest)
|
|
11476
11514
|
},
|
|
11477
11515
|
handleHeaderCellDragDragendEvent (evnt) {
|
|
@@ -12393,7 +12431,7 @@ export default defineVxeComponent({
|
|
|
12393
12431
|
}
|
|
12394
12432
|
},
|
|
12395
12433
|
handleUpdateAggData () {
|
|
12396
|
-
return loadTableData(internalData.tableSynchData, true)
|
|
12434
|
+
return loadTableData(internalData.tableSynchData, false, true)
|
|
12397
12435
|
},
|
|
12398
12436
|
updateZindex () {
|
|
12399
12437
|
if (props.zIndex) {
|
|
@@ -13226,7 +13264,7 @@ export default defineVxeComponent({
|
|
|
13226
13264
|
if (value && value.length >= 20000) {
|
|
13227
13265
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
|
|
13228
13266
|
}
|
|
13229
|
-
loadTableData(value, true).then(() => {
|
|
13267
|
+
loadTableData(value, false, true).then(() => {
|
|
13230
13268
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
13231
13269
|
const expandOpts = computeExpandOpts.value
|
|
13232
13270
|
internalData.inited = true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|