vxe-table 4.10.12 → 4.10.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/style.css +1 -1
- package/es/table/module/edit/hook.js +133 -123
- package/es/table/module/export/hook.js +3 -2
- package/es/table/src/body.js +1 -0
- package/es/table/src/table.js +40 -12
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +224 -168
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/hook.js +159 -149
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +3 -2
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/body.js +1 -0
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +57 -13
- 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/edit/hook.ts +136 -124
- package/packages/table/module/export/hook.ts +3 -2
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/table.ts +43 -12
- /package/es/{iconfont.1739237387649.ttf → iconfont.1739333111603.ttf} +0 -0
- /package/es/{iconfont.1739237387649.woff → iconfont.1739333111603.woff} +0 -0
- /package/es/{iconfont.1739237387649.woff2 → iconfont.1739333111603.woff2} +0 -0
- /package/lib/{iconfont.1739237387649.ttf → iconfont.1739333111603.ttf} +0 -0
- /package/lib/{iconfont.1739237387649.woff → iconfont.1739333111603.woff} +0 -0
- /package/lib/{iconfont.1739237387649.woff2 → iconfont.1739333111603.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.14";
|
|
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.14",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,minHeight:144,resizeConfig:{},resizableConfig:{dragMode:"auto",showDragTip:!0,isSyncAutoHeight:!0,isSyncAutoWidth:!0,minHeight:18},radioConfig:{strict:!0},rowDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},columnDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{maxFixedSize:4},cellConfig:{padding:!0},headerCellConfig:{height:"unset"},footerCellConfig:{height:"unset"},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showFooter:!0,placement:"top-right",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:{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,extendDirection:{top:!0,left:!0,bottom:!0,right:!0}},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},virtualXConfig:{enabled:!0,gt:60,preSize:0,oSize:1},virtualYConfig:{enabled:!0,gt:100,preSize:1,oSize:2},scrollbarConfig:{}},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.14"}`;
|
|
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.14",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.14",
|
|
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.83"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/resize-observer-browser": "^0.1.11",
|
|
@@ -6,7 +6,7 @@ import { getCellValue, setCellValue, getRowid } from '../../src/util'
|
|
|
6
6
|
import { browse, removeClass, addClass } from '../../../ui/src/dom'
|
|
7
7
|
import { warnLog, errLog } from '../../../ui/src/log'
|
|
8
8
|
|
|
9
|
-
import type { TableEditMethods, TableEditPrivateMethods } from '../../../../types'
|
|
9
|
+
import type { TableEditMethods, TableEditPrivateMethods, VxeTableDefines } from '../../../../types'
|
|
10
10
|
|
|
11
11
|
const { getConfig, renderer, hooks, getI18n } = VxeUI
|
|
12
12
|
|
|
@@ -21,7 +21,7 @@ hooks.add('tableEditModule', {
|
|
|
21
21
|
let editMethods = {} as TableEditMethods
|
|
22
22
|
let editPrivateMethods = {} as TableEditPrivateMethods
|
|
23
23
|
|
|
24
|
-
const getEditColumnModel = (row: any, column:
|
|
24
|
+
const getEditColumnModel = (row: any, column: VxeTableDefines.ColumnInfo) => {
|
|
25
25
|
const { model, editRender } = column
|
|
26
26
|
if (editRender) {
|
|
27
27
|
model.value = getCellValue(row, column)
|
|
@@ -29,7 +29,7 @@ hooks.add('tableEditModule', {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const setEditColumnModel = (row: any, column:
|
|
32
|
+
const setEditColumnModel = (row: any, column: VxeTableDefines.ColumnInfo) => {
|
|
33
33
|
const { model, editRender } = column
|
|
34
34
|
if (editRender && model.update) {
|
|
35
35
|
setCellValue(row, column, model.value)
|
|
@@ -48,21 +48,21 @@ hooks.add('tableEditModule', {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
const syncActivedCell = () => {
|
|
52
52
|
const { editStore, tableColumn } = reactData
|
|
53
53
|
const editOpts = computeEditOpts.value
|
|
54
54
|
const { actived } = editStore
|
|
55
55
|
const { row, column } = actived
|
|
56
56
|
if (row || column) {
|
|
57
57
|
if (editOpts.mode === 'row') {
|
|
58
|
-
tableColumn.forEach((column
|
|
58
|
+
tableColumn.forEach((column) => setEditColumnModel(row, column))
|
|
59
59
|
} else {
|
|
60
60
|
setEditColumnModel(row, column)
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
const insertTreeRow = (newRecords: any[], isAppend: boolean) => {
|
|
66
66
|
const { tableFullTreeData, afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData
|
|
67
67
|
const treeOpts = computeTreeOpts.value
|
|
68
68
|
const { rowField, parentField, mapChildrenField } = treeOpts
|
|
@@ -329,6 +329,133 @@ hooks.add('tableEditModule', {
|
|
|
329
329
|
})
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
+
const handleEditActive = (params: any, evnt: Event | null, isFocus: boolean) => {
|
|
333
|
+
const { editConfig, mouseConfig } = props
|
|
334
|
+
const { editStore, tableColumn } = reactData
|
|
335
|
+
const editOpts = computeEditOpts.value
|
|
336
|
+
const { mode } = editOpts
|
|
337
|
+
const { actived, focused } = editStore
|
|
338
|
+
const { row, column } = params
|
|
339
|
+
const { editRender } = column
|
|
340
|
+
const cell = (params.cell || $xeTable.getCellElement(row, column))
|
|
341
|
+
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod
|
|
342
|
+
params.cell = cell
|
|
343
|
+
if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
|
|
344
|
+
// 激活编辑
|
|
345
|
+
if (!$xeTable.isPendingByRow(row)) {
|
|
346
|
+
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
347
|
+
// 判断是否禁用编辑
|
|
348
|
+
let type: 'edit-disabled' | 'edit-activated' = 'edit-disabled'
|
|
349
|
+
if (!beforeEditMethod || beforeEditMethod({ ...params, $table: $xeTable, $grid: $xeTable.xegrid })) {
|
|
350
|
+
if (mouseConfig) {
|
|
351
|
+
$xeTable.clearSelected()
|
|
352
|
+
if ($xeTable.clearCellAreas) {
|
|
353
|
+
$xeTable.clearCellAreas()
|
|
354
|
+
$xeTable.clearCopyCellArea()
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
$xeTable.closeTooltip()
|
|
358
|
+
if (actived.column) {
|
|
359
|
+
handleClearEdit(evnt)
|
|
360
|
+
}
|
|
361
|
+
type = 'edit-activated'
|
|
362
|
+
column.renderHeight = cell.offsetHeight
|
|
363
|
+
actived.args = params
|
|
364
|
+
actived.row = row
|
|
365
|
+
actived.column = column
|
|
366
|
+
if (mode === 'row') {
|
|
367
|
+
tableColumn.forEach((column: any) => getEditColumnModel(row, column))
|
|
368
|
+
} else {
|
|
369
|
+
getEditColumnModel(row, column)
|
|
370
|
+
}
|
|
371
|
+
const afterEditMethod = editOpts.afterEditMethod
|
|
372
|
+
nextTick(() => {
|
|
373
|
+
if (isFocus) {
|
|
374
|
+
$xeTable.handleFocus(params, evnt)
|
|
375
|
+
}
|
|
376
|
+
if (afterEditMethod) {
|
|
377
|
+
afterEditMethod({ ...params, $table: $xeTable, $grid: $xeTable.xegrid })
|
|
378
|
+
}
|
|
379
|
+
})
|
|
380
|
+
}
|
|
381
|
+
$xeTable.dispatchEvent(type, {
|
|
382
|
+
row,
|
|
383
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
384
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
385
|
+
column,
|
|
386
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
387
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
388
|
+
}, evnt)
|
|
389
|
+
|
|
390
|
+
// v4已废弃
|
|
391
|
+
if (type === 'edit-activated') {
|
|
392
|
+
$xeTable.dispatchEvent('edit-actived', {
|
|
393
|
+
row,
|
|
394
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
395
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
396
|
+
column,
|
|
397
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
398
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
399
|
+
}, evnt)
|
|
400
|
+
}
|
|
401
|
+
} else {
|
|
402
|
+
const { column: oldColumn } = actived
|
|
403
|
+
if (mouseConfig) {
|
|
404
|
+
$xeTable.clearSelected()
|
|
405
|
+
if ($xeTable.clearCellAreas) {
|
|
406
|
+
$xeTable.clearCellAreas()
|
|
407
|
+
$xeTable.clearCopyCellArea()
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
if (oldColumn !== column) {
|
|
411
|
+
const { model: oldModel } = oldColumn
|
|
412
|
+
if (oldModel.update) {
|
|
413
|
+
setCellValue(row, oldColumn, oldModel.value)
|
|
414
|
+
}
|
|
415
|
+
if ($xeTable.clearValidate) {
|
|
416
|
+
$xeTable.clearValidate(row, column)
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
column.renderHeight = cell.offsetHeight
|
|
420
|
+
actived.args = params
|
|
421
|
+
actived.column = column
|
|
422
|
+
if (isFocus) {
|
|
423
|
+
setTimeout(() => {
|
|
424
|
+
$xeTable.handleFocus(params, evnt)
|
|
425
|
+
})
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
focused.column = null
|
|
429
|
+
focused.row = null
|
|
430
|
+
$xeTable.focus()
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return nextTick()
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
const handleEditCell = (row: any, fieldOrColumn: string | VxeTableDefines.ColumnInfo, isPos: boolean) => {
|
|
437
|
+
const { editConfig } = props
|
|
438
|
+
const column = XEUtils.isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn
|
|
439
|
+
if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
|
|
440
|
+
return Promise.resolve(isPos ? $xeTable.scrollToRow(row, column) : null).then(() => {
|
|
441
|
+
const cell = $xeTable.getCellElement(row, column)
|
|
442
|
+
if (cell) {
|
|
443
|
+
handleEditActive({
|
|
444
|
+
row,
|
|
445
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
446
|
+
column,
|
|
447
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
448
|
+
cell,
|
|
449
|
+
$table: $xeTable
|
|
450
|
+
}, null, false)
|
|
451
|
+
internalData._lastCallTime = Date.now()
|
|
452
|
+
}
|
|
453
|
+
return nextTick()
|
|
454
|
+
})
|
|
455
|
+
}
|
|
456
|
+
return nextTick()
|
|
457
|
+
}
|
|
458
|
+
|
|
332
459
|
editMethods = {
|
|
333
460
|
/**
|
|
334
461
|
* 往表格中插入临时数据
|
|
@@ -658,7 +785,7 @@ hooks.add('tableEditModule', {
|
|
|
658
785
|
if (fieldOrColumn) {
|
|
659
786
|
column = XEUtils.isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn
|
|
660
787
|
}
|
|
661
|
-
return
|
|
788
|
+
return handleEditCell(row, column, false)
|
|
662
789
|
},
|
|
663
790
|
setActiveCell (row, fieldOrColumn) {
|
|
664
791
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
@@ -671,26 +798,7 @@ hooks.add('tableEditModule', {
|
|
|
671
798
|
* 激活单元格编辑
|
|
672
799
|
*/
|
|
673
800
|
setEditCell (row, fieldOrColumn) {
|
|
674
|
-
|
|
675
|
-
const column = XEUtils.isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn
|
|
676
|
-
if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
|
|
677
|
-
return $xeTable.scrollToRow(row, column).then(() => {
|
|
678
|
-
const cell = $xeTable.getCellElement(row, column)
|
|
679
|
-
if (cell) {
|
|
680
|
-
editPrivateMethods.handleEdit({
|
|
681
|
-
row,
|
|
682
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
683
|
-
column,
|
|
684
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
685
|
-
cell,
|
|
686
|
-
$table: $xeTable
|
|
687
|
-
})
|
|
688
|
-
internalData._lastCallTime = Date.now()
|
|
689
|
-
}
|
|
690
|
-
return nextTick()
|
|
691
|
-
})
|
|
692
|
-
}
|
|
693
|
-
return nextTick()
|
|
801
|
+
return handleEditCell(row, fieldOrColumn, true)
|
|
694
802
|
},
|
|
695
803
|
/**
|
|
696
804
|
* 只对 trigger=dblclick 有效,选中单元格
|
|
@@ -722,103 +830,7 @@ hooks.add('tableEditModule', {
|
|
|
722
830
|
* 处理激活编辑
|
|
723
831
|
*/
|
|
724
832
|
handleEdit (params, evnt) {
|
|
725
|
-
|
|
726
|
-
const { editStore, tableColumn } = reactData
|
|
727
|
-
const editOpts = computeEditOpts.value
|
|
728
|
-
const { mode } = editOpts
|
|
729
|
-
const { actived, focused } = editStore
|
|
730
|
-
const { row, column } = params
|
|
731
|
-
const { editRender } = column
|
|
732
|
-
const cell = (params.cell || $xeTable.getCellElement(row, column))
|
|
733
|
-
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod
|
|
734
|
-
params.cell = cell
|
|
735
|
-
if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
|
|
736
|
-
// 激活编辑
|
|
737
|
-
if (!$xeTable.isPendingByRow(row)) {
|
|
738
|
-
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
739
|
-
// 判断是否禁用编辑
|
|
740
|
-
let type: 'edit-disabled' | 'edit-activated' = 'edit-disabled'
|
|
741
|
-
if (!beforeEditMethod || beforeEditMethod({ ...params, $table: $xeTable, $grid: $xeTable.xegrid })) {
|
|
742
|
-
if (mouseConfig) {
|
|
743
|
-
editMethods.clearSelected()
|
|
744
|
-
if ($xeTable.clearCellAreas) {
|
|
745
|
-
$xeTable.clearCellAreas()
|
|
746
|
-
$xeTable.clearCopyCellArea()
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
$xeTable.closeTooltip()
|
|
750
|
-
if (actived.column) {
|
|
751
|
-
handleClearEdit(evnt)
|
|
752
|
-
}
|
|
753
|
-
type = 'edit-activated'
|
|
754
|
-
column.renderHeight = cell.offsetHeight
|
|
755
|
-
actived.args = params
|
|
756
|
-
actived.row = row
|
|
757
|
-
actived.column = column
|
|
758
|
-
if (mode === 'row') {
|
|
759
|
-
tableColumn.forEach((column: any) => getEditColumnModel(row, column))
|
|
760
|
-
} else {
|
|
761
|
-
getEditColumnModel(row, column)
|
|
762
|
-
}
|
|
763
|
-
const afterEditMethod = editOpts.afterEditMethod
|
|
764
|
-
nextTick(() => {
|
|
765
|
-
editPrivateMethods.handleFocus(params, evnt)
|
|
766
|
-
if (afterEditMethod) {
|
|
767
|
-
afterEditMethod({ ...params, $table: $xeTable, $grid: $xeTable.xegrid })
|
|
768
|
-
}
|
|
769
|
-
})
|
|
770
|
-
}
|
|
771
|
-
$xeTable.dispatchEvent(type, {
|
|
772
|
-
row,
|
|
773
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
774
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
775
|
-
column,
|
|
776
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
777
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
778
|
-
}, evnt)
|
|
779
|
-
|
|
780
|
-
// v4已废弃
|
|
781
|
-
if (type === 'edit-activated') {
|
|
782
|
-
$xeTable.dispatchEvent('edit-actived', {
|
|
783
|
-
row,
|
|
784
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
785
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
786
|
-
column,
|
|
787
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
788
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
789
|
-
}, evnt)
|
|
790
|
-
}
|
|
791
|
-
} else {
|
|
792
|
-
const { column: oldColumn } = actived
|
|
793
|
-
if (mouseConfig) {
|
|
794
|
-
editMethods.clearSelected()
|
|
795
|
-
if ($xeTable.clearCellAreas) {
|
|
796
|
-
$xeTable.clearCellAreas()
|
|
797
|
-
$xeTable.clearCopyCellArea()
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
if (oldColumn !== column) {
|
|
801
|
-
const { model: oldModel } = oldColumn
|
|
802
|
-
if (oldModel.update) {
|
|
803
|
-
setCellValue(row, oldColumn, oldModel.value)
|
|
804
|
-
}
|
|
805
|
-
if ($xeTable.clearValidate) {
|
|
806
|
-
$xeTable.clearValidate(row, column)
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
column.renderHeight = cell.offsetHeight
|
|
810
|
-
actived.args = params
|
|
811
|
-
actived.column = column
|
|
812
|
-
setTimeout(() => {
|
|
813
|
-
editPrivateMethods.handleFocus(params, evnt)
|
|
814
|
-
})
|
|
815
|
-
}
|
|
816
|
-
focused.column = null
|
|
817
|
-
focused.row = null
|
|
818
|
-
$xeTable.focus()
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
return nextTick()
|
|
833
|
+
return handleEditActive(params, evnt, true)
|
|
822
834
|
},
|
|
823
835
|
/**
|
|
824
836
|
* @deprecated
|
|
@@ -3,6 +3,7 @@ import XEUtils from 'xe-utils'
|
|
|
3
3
|
import { VxeUI } from '../../../ui'
|
|
4
4
|
import { isColumnInfo, mergeBodyMethod, getCellValue } from '../../src/util'
|
|
5
5
|
import { parseFile, formatText, eqEmptyValue } from '../../../ui/src/utils'
|
|
6
|
+
import { hasClass } from '../../../ui/src/dom'
|
|
6
7
|
import { createHtmlPage, getExportBlobByContent } from './util'
|
|
7
8
|
import { warnLog, errLog } from '../../../ui/src/log'
|
|
8
9
|
|
|
@@ -406,7 +407,7 @@ hooks.add('tableExportModule', {
|
|
|
406
407
|
cellValue = htmlCellElem.innerText.trim()
|
|
407
408
|
} else {
|
|
408
409
|
const cell = $xeTable.getCellElement(row, column)
|
|
409
|
-
if (cell) {
|
|
410
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
410
411
|
cellValue = cell.innerText.trim()
|
|
411
412
|
}
|
|
412
413
|
}
|
|
@@ -464,7 +465,7 @@ hooks.add('tableExportModule', {
|
|
|
464
465
|
cellValue = htmlCellElem.innerText.trim()
|
|
465
466
|
} else {
|
|
466
467
|
const cell = $xeTable.getCellElement(row, column)
|
|
467
|
-
if (cell) {
|
|
468
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
468
469
|
cellValue = cell.innerText.trim()
|
|
469
470
|
}
|
|
470
471
|
}
|
|
@@ -408,6 +408,7 @@ export default defineComponent({
|
|
|
408
408
|
'fixed--width': !isAutoCellWidth,
|
|
409
409
|
'fixed--hidden': fixedHiddenColumn,
|
|
410
410
|
'is--padding': isCellPadding,
|
|
411
|
+
'is--progress': (fixedHiddenColumn && isAllOverflow) || isVNPreEmptyStatus,
|
|
411
412
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
412
413
|
'is--drag-disabled': isDisabledDrag,
|
|
413
414
|
'col--dirty': isDirty,
|
|
@@ -1648,13 +1648,13 @@ export default defineComponent({
|
|
|
1648
1648
|
const sortOpts = computeSortOpts.value
|
|
1649
1649
|
const treeOpts = computeTreeOpts.value
|
|
1650
1650
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
1651
|
-
const { transform } = treeOpts
|
|
1651
|
+
const { transform, rowField, parentField, mapChildrenField } = treeOpts
|
|
1652
1652
|
const { remote: allRemoteFilter, filterMethod: allFilterMethod } = filterOpts
|
|
1653
1653
|
const { remote: allRemoteSort, sortMethod: allSortMethod, multiple: sortMultiple, chronological } = sortOpts
|
|
1654
1654
|
let tableData: any[] = []
|
|
1655
1655
|
let tableTree: any[] = []
|
|
1656
1656
|
|
|
1657
|
-
//
|
|
1657
|
+
// 处理数据
|
|
1658
1658
|
if (!allRemoteFilter || !allRemoteSort) {
|
|
1659
1659
|
const filterColumns: {
|
|
1660
1660
|
column: VxeTableDefines.ColumnInfo
|
|
@@ -1712,7 +1712,7 @@ export default defineComponent({
|
|
|
1712
1712
|
tableTree = XEUtils.searchTree(tableFullTreeData, handleFilter, {
|
|
1713
1713
|
original: true,
|
|
1714
1714
|
isEvery: true,
|
|
1715
|
-
children:
|
|
1715
|
+
children: mapChildrenField,
|
|
1716
1716
|
mapChildren: childrenField
|
|
1717
1717
|
})
|
|
1718
1718
|
tableData = tableTree
|
|
@@ -1726,7 +1726,7 @@ export default defineComponent({
|
|
|
1726
1726
|
tableTree = XEUtils.searchTree(tableFullTreeData, () => true, {
|
|
1727
1727
|
original: true,
|
|
1728
1728
|
isEvery: true,
|
|
1729
|
-
children:
|
|
1729
|
+
children: mapChildrenField,
|
|
1730
1730
|
mapChildren: childrenField
|
|
1731
1731
|
})
|
|
1732
1732
|
tableData = tableTree
|
|
@@ -1745,7 +1745,18 @@ export default defineComponent({
|
|
|
1745
1745
|
const sortRests = allSortMethod({ data: tableTree, sortList: orderColumns, $table: $xeTable })
|
|
1746
1746
|
tableTree = XEUtils.isArray(sortRests) ? sortRests : tableTree
|
|
1747
1747
|
} else {
|
|
1748
|
-
|
|
1748
|
+
const treeList = XEUtils.toTreeArray(tableTree, {
|
|
1749
|
+
children: mapChildrenField
|
|
1750
|
+
})
|
|
1751
|
+
tableTree = XEUtils.toArrayTree(
|
|
1752
|
+
XEUtils.orderBy(treeList, orderColumns.map(({ column, order }) => [getOrderField(column), order])),
|
|
1753
|
+
{
|
|
1754
|
+
key: rowField,
|
|
1755
|
+
parentKey: parentField,
|
|
1756
|
+
children: childrenField,
|
|
1757
|
+
mapChildren: mapChildrenField
|
|
1758
|
+
}
|
|
1759
|
+
)
|
|
1749
1760
|
}
|
|
1750
1761
|
tableData = tableTree
|
|
1751
1762
|
} else {
|
|
@@ -8610,6 +8621,7 @@ export default defineComponent({
|
|
|
8610
8621
|
}
|
|
8611
8622
|
},
|
|
8612
8623
|
triggerBodyScrollEvent (evnt, fixedType) {
|
|
8624
|
+
const { scrollYLoad, scrollXLoad } = reactData
|
|
8613
8625
|
const { elemStore, intoRunScroll, lastScrollTop, lastScrollLeft, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll, scrollRenderType, inFooterScroll } = internalData
|
|
8614
8626
|
const xHandleEl = refScrollXHandleElem.value
|
|
8615
8627
|
const yHandleEl = refScrollYHandleElem.value
|
|
@@ -8664,13 +8676,17 @@ export default defineComponent({
|
|
|
8664
8676
|
setScrollTop(rightScrollElem, scrollTop)
|
|
8665
8677
|
}
|
|
8666
8678
|
setScrollTop(yHandleEl, scrollTop)
|
|
8667
|
-
|
|
8679
|
+
if (scrollYLoad) {
|
|
8680
|
+
$xeTable.triggerScrollYEvent(evnt)
|
|
8681
|
+
}
|
|
8668
8682
|
}
|
|
8669
8683
|
if (isRollX) {
|
|
8670
8684
|
setScrollLeft(xHandleEl, scrollLeft)
|
|
8671
8685
|
setScrollLeft(headerScrollElem, scrollLeft)
|
|
8672
8686
|
setScrollLeft(footerScrollElem, scrollLeft)
|
|
8673
|
-
|
|
8687
|
+
if (scrollXLoad) {
|
|
8688
|
+
$xeTable.triggerScrollXEvent(evnt)
|
|
8689
|
+
}
|
|
8674
8690
|
}
|
|
8675
8691
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8676
8692
|
type: 'body',
|
|
@@ -8678,6 +8694,7 @@ export default defineComponent({
|
|
|
8678
8694
|
})
|
|
8679
8695
|
},
|
|
8680
8696
|
triggerHeaderScrollEvent (evnt, fixedType) {
|
|
8697
|
+
const { scrollXLoad } = reactData
|
|
8681
8698
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inBodyScroll, inFooterScroll } = internalData
|
|
8682
8699
|
const yHandleEl = refScrollYHandleElem.value
|
|
8683
8700
|
const xHandleEl = refScrollXHandleElem.value
|
|
@@ -8707,13 +8724,16 @@ export default defineComponent({
|
|
|
8707
8724
|
setScrollLeft(xHandleEl, scrollLeft)
|
|
8708
8725
|
setScrollLeft(footerScrollElem, scrollLeft)
|
|
8709
8726
|
setScrollLeft(bodyScrollElem, scrollLeft)
|
|
8710
|
-
|
|
8727
|
+
if (scrollXLoad) {
|
|
8728
|
+
$xeTable.triggerScrollXEvent(evnt)
|
|
8729
|
+
}
|
|
8711
8730
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8712
8731
|
type: 'header',
|
|
8713
8732
|
fixed: fixedType
|
|
8714
8733
|
})
|
|
8715
8734
|
},
|
|
8716
8735
|
triggerFooterScrollEvent (evnt, fixedType) {
|
|
8736
|
+
const { scrollXLoad } = reactData
|
|
8717
8737
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData
|
|
8718
8738
|
const yHandleEl = refScrollYHandleElem.value
|
|
8719
8739
|
const xHandleEl = refScrollXHandleElem.value
|
|
@@ -8743,7 +8763,9 @@ export default defineComponent({
|
|
|
8743
8763
|
setScrollLeft(xHandleEl, scrollLeft)
|
|
8744
8764
|
setScrollLeft(headerScrollElem, scrollLeft)
|
|
8745
8765
|
setScrollLeft(bodyScrollElem, scrollLeft)
|
|
8746
|
-
|
|
8766
|
+
if (scrollXLoad) {
|
|
8767
|
+
$xeTable.triggerScrollXEvent(evnt)
|
|
8768
|
+
}
|
|
8747
8769
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8748
8770
|
type: 'footer',
|
|
8749
8771
|
fixed: fixedType
|
|
@@ -8755,6 +8777,7 @@ export default defineComponent({
|
|
|
8755
8777
|
return
|
|
8756
8778
|
}
|
|
8757
8779
|
const { highlightHoverRow } = tableProps
|
|
8780
|
+
const { scrollYLoad } = reactData
|
|
8758
8781
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData
|
|
8759
8782
|
const rowOpts = computeRowOpts.value
|
|
8760
8783
|
const xHandleEl = refScrollXHandleElem.value
|
|
@@ -8802,7 +8825,9 @@ export default defineComponent({
|
|
|
8802
8825
|
setScrollTop(bodyScrollElem, currTopNum)
|
|
8803
8826
|
setScrollTop(leftScrollElem, currTopNum)
|
|
8804
8827
|
setScrollTop(rightScrollElem, currTopNum)
|
|
8805
|
-
|
|
8828
|
+
if (scrollYLoad) {
|
|
8829
|
+
$xeTable.triggerScrollYEvent(evnt)
|
|
8830
|
+
}
|
|
8806
8831
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
8807
8832
|
type: 'table',
|
|
8808
8833
|
fixed: ''
|
|
@@ -8823,6 +8848,7 @@ export default defineComponent({
|
|
|
8823
8848
|
}
|
|
8824
8849
|
},
|
|
8825
8850
|
triggerVirtualScrollXEvent (evnt) {
|
|
8851
|
+
const { scrollXLoad } = reactData
|
|
8826
8852
|
const { elemStore, inWheelScroll, lastScrollTop, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData
|
|
8827
8853
|
if (inHeaderScroll || inBodyScroll || inFooterScroll) {
|
|
8828
8854
|
return
|
|
@@ -8848,13 +8874,16 @@ export default defineComponent({
|
|
|
8848
8874
|
setScrollLeft(bodyScrollElem, scrollLeft)
|
|
8849
8875
|
setScrollLeft(headerScrollElem, scrollLeft)
|
|
8850
8876
|
setScrollLeft(footerScrollElem, scrollLeft)
|
|
8851
|
-
|
|
8877
|
+
if (scrollXLoad) {
|
|
8878
|
+
$xeTable.triggerScrollXEvent(evnt)
|
|
8879
|
+
}
|
|
8852
8880
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8853
8881
|
type: 'table',
|
|
8854
8882
|
fixed: ''
|
|
8855
8883
|
})
|
|
8856
8884
|
},
|
|
8857
8885
|
triggerVirtualScrollYEvent (evnt) {
|
|
8886
|
+
const { scrollYLoad } = reactData
|
|
8858
8887
|
const { elemStore, inWheelScroll, lastScrollLeft, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData
|
|
8859
8888
|
if (inHeaderScroll || inBodyScroll || inFooterScroll) {
|
|
8860
8889
|
return
|
|
@@ -8880,7 +8909,9 @@ export default defineComponent({
|
|
|
8880
8909
|
setScrollTop(bodyScrollElem, scrollTop)
|
|
8881
8910
|
setScrollTop(leftScrollElem, scrollTop)
|
|
8882
8911
|
setScrollTop(rightScrollElem, scrollTop)
|
|
8883
|
-
|
|
8912
|
+
if (scrollYLoad) {
|
|
8913
|
+
$xeTable.triggerScrollYEvent(evnt)
|
|
8914
|
+
}
|
|
8884
8915
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8885
8916
|
type: 'table',
|
|
8886
8917
|
fixed: ''
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|