vxe-table 3.11.25 → 3.11.27-beta.0
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +2 -2
- package/es/locale/lang/de-DE.js +2 -2
- package/es/locale/lang/en-US.js +2 -2
- package/es/locale/lang/es-ES.js +2 -2
- package/es/locale/lang/fr-FR.js +2 -2
- package/es/locale/lang/hu-HU.js +2 -2
- package/es/locale/lang/hy-AM.js +2 -2
- package/es/locale/lang/ja-JP.js +2 -2
- package/es/locale/lang/ko-KR.js +2 -2
- package/es/locale/lang/nb-NO.js +2 -2
- package/es/locale/lang/pt-BR.js +2 -2
- package/es/locale/lang/ru-RU.js +2 -2
- package/es/locale/lang/ug-CN.js +2 -2
- package/es/locale/lang/uk-UA.js +2 -2
- package/es/locale/lang/vi-VN.js +2 -2
- package/es/locale/lang/zh-CHT.js +2 -2
- package/es/locale/lang/zh-CN.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +2 -2
- package/es/table/src/cell.js +2 -2
- package/es/table/src/column.js +10 -8
- package/es/table/src/group.js +37 -6
- package/es/table/src/methods.js +167 -70
- package/es/table/src/util.js +0 -1
- package/es/table/style.css +5 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +5 -0
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +244 -99
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -2
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -2
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -2
- package/lib/locale/lang/es-ES.js +2 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -2
- package/lib/locale/lang/fr-FR.js +2 -2
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -2
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -2
- package/lib/locale/lang/hy-AM.js +2 -2
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -2
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -2
- package/lib/locale/lang/ko-KR.js +2 -2
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -2
- package/lib/locale/lang/nb-NO.js +2 -2
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -2
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -2
- package/lib/locale/lang/ru-RU.js +2 -2
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +2 -2
- package/lib/locale/lang/ug-CN.js +2 -2
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +2 -2
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +2 -2
- package/lib/locale/lang/vi-VN.js +2 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -2
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -2
- package/lib/locale/lang/zh-CN.js +2 -2
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +2 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +2 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +11 -9
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/group.js +39 -6
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/methods.js +182 -72
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +0 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +5 -0
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +5 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +2 -2
- package/packages/locale/lang/de-DE.ts +2 -2
- package/packages/locale/lang/en-US.ts +2 -2
- package/packages/locale/lang/es-ES.ts +2 -2
- package/packages/locale/lang/fr-FR.ts +2 -2
- package/packages/locale/lang/hu-HU.ts +2 -2
- package/packages/locale/lang/hy-AM.ts +2 -2
- package/packages/locale/lang/ja-JP.ts +2 -2
- package/packages/locale/lang/ko-KR.ts +2 -2
- package/packages/locale/lang/nb-NO.ts +2 -2
- package/packages/locale/lang/pt-BR.ts +2 -2
- package/packages/locale/lang/ru-RU.ts +2 -2
- package/packages/locale/lang/ug-CN.ts +2 -2
- package/packages/locale/lang/uk-UA.ts +2 -2
- package/packages/locale/lang/vi-VN.ts +2 -2
- package/packages/locale/lang/zh-CHT.ts +2 -2
- package/packages/locale/lang/zh-CN.ts +2 -2
- package/packages/table/src/body.ts +2 -2
- package/packages/table/src/cell.ts +2 -2
- package/packages/table/src/column.ts +10 -8
- package/packages/table/src/group.ts +40 -6
- package/packages/table/src/methods.ts +183 -83
- package/packages/table/src/util.ts +0 -1
- package/styles/components/table.scss +5 -0
- /package/es/{iconfont.1733882708391.ttf → iconfont.1733931178504.ttf} +0 -0
- /package/es/{iconfont.1733882708391.woff → iconfont.1733931178504.woff} +0 -0
- /package/es/{iconfont.1733882708391.woff2 → iconfont.1733931178504.woff2} +0 -0
- /package/lib/{iconfont.1733882708391.ttf → iconfont.1733931178504.ttf} +0 -0
- /package/lib/{iconfont.1733882708391.woff → iconfont.1733931178504.woff} +0 -0
- /package/lib/{iconfont.1733882708391.woff2 → iconfont.1733931178504.woff2} +0 -0
|
@@ -47,8 +47,8 @@ export default {
|
|
|
47
47
|
notExp: '该浏览器不支持导入/导出功能',
|
|
48
48
|
impFields: '导入失败,请检查字段名和数据格式是否正确',
|
|
49
49
|
treeNotImp: '树表格不支持导入',
|
|
50
|
-
treeCrossDrag: '
|
|
51
|
-
treeDragChild: '
|
|
50
|
+
treeCrossDrag: '只能拖拽第一层级',
|
|
51
|
+
treeDragChild: '父级不能拖拽到自己的子级中',
|
|
52
52
|
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
|
|
53
53
|
},
|
|
54
54
|
table: {
|
|
@@ -47,8 +47,8 @@ export default {
|
|
|
47
47
|
notExp: '该浏览器不支持导入/导出功能',
|
|
48
48
|
impFields: '导入失败,请检查字段名和数据格式是否正确',
|
|
49
49
|
treeNotImp: '树表格不支持导入',
|
|
50
|
-
treeCrossDrag: '
|
|
51
|
-
treeDragChild: '
|
|
50
|
+
treeCrossDrag: '只能拖拽第一层级',
|
|
51
|
+
treeDragChild: '父级不能拖拽到自己的子级中',
|
|
52
52
|
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
|
|
53
53
|
},
|
|
54
54
|
table: {
|
|
@@ -47,8 +47,8 @@ export default {
|
|
|
47
47
|
notExp: '該瀏覽器不支援匯入/匯出功能',
|
|
48
48
|
impFields: '匯入失敗,請檢查欄位名稱和資料格式是否正確',
|
|
49
49
|
treeNotImp: '樹表格不支援導入',
|
|
50
|
-
treeCrossDrag: '
|
|
51
|
-
treeDragChild: '
|
|
50
|
+
treeCrossDrag: '只能拖拽第一层级',
|
|
51
|
+
treeDragChild: '父级不能拖拽到自己的子级中',
|
|
52
52
|
reqPlugin: '可選擴展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
|
|
53
53
|
},
|
|
54
54
|
table: {
|
|
@@ -47,8 +47,8 @@ export default {
|
|
|
47
47
|
notExp: '该浏览器不支持导入/导出功能',
|
|
48
48
|
impFields: '导入失败,请检查字段名和数据格式是否正确',
|
|
49
49
|
treeNotImp: '树表格不支持导入',
|
|
50
|
-
treeCrossDrag: '
|
|
51
|
-
treeDragChild: '
|
|
50
|
+
treeCrossDrag: '只能拖拽第一层级',
|
|
51
|
+
treeDragChild: '父级不能拖拽到自己的子级中',
|
|
52
52
|
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
|
|
53
53
|
},
|
|
54
54
|
table: {
|
|
@@ -323,7 +323,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi
|
|
|
323
323
|
getClass(className, params),
|
|
324
324
|
getClass(allCellClassName, params)
|
|
325
325
|
],
|
|
326
|
-
key: columnKey || columnOpts.useKey || rowOpts.useKey ? column.id : $columnIndex,
|
|
326
|
+
key: columnKey || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
|
|
327
327
|
attrs,
|
|
328
328
|
style: Object.assign({
|
|
329
329
|
height: cellHeight
|
|
@@ -453,7 +453,7 @@ function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any,
|
|
|
453
453
|
rowid
|
|
454
454
|
},
|
|
455
455
|
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
456
|
-
key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
456
|
+
key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
457
457
|
nativeOn: trOn
|
|
458
458
|
}, tdVNs)
|
|
459
459
|
: h('tr', {
|
|
@@ -106,10 +106,10 @@ function renderHeaderCellDragIcon (h: CreateElement, params: VxeTableDefines.Cel
|
|
|
106
106
|
const { $table, column } = params
|
|
107
107
|
const columnOpts = $table.computeColumnOpts
|
|
108
108
|
const columnDragOpts = $table.computeColumnDragOpts
|
|
109
|
-
const { showIcon, icon, visibleMethod, disabledMethod } = columnDragOpts
|
|
109
|
+
const { showIcon, icon, isCrossDrag, visibleMethod, disabledMethod } = columnDragOpts
|
|
110
110
|
const isDisabled = disabledMethod && disabledMethod(params)
|
|
111
111
|
if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
|
|
112
|
-
if (!
|
|
112
|
+
if (!column.fixed && (isCrossDrag || !column.parentId)) {
|
|
113
113
|
return h('span', {
|
|
114
114
|
key: 'dg',
|
|
115
115
|
class: ['vxe-cell--drag-handle', {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Cell from './cell'
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp'
|
|
2
3
|
import { assembleColumn, destroyColumn } from './util'
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
+
export const columnProps = {
|
|
5
6
|
// 列唯一主键
|
|
6
7
|
colId: [String, Number],
|
|
7
8
|
// 渲染类型 seq,radio,checkbox,expand,html
|
|
@@ -94,9 +95,9 @@ const props = {
|
|
|
94
95
|
params: Object
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
const
|
|
98
|
-
Object.keys(
|
|
99
|
-
|
|
98
|
+
export const columnWatch: Record<string, any> = {}
|
|
99
|
+
Object.keys(columnProps).forEach(name => {
|
|
100
|
+
columnWatch[name] = function (value: any) {
|
|
100
101
|
this.columnConfig.update(name, value)
|
|
101
102
|
if (this.$xetable) {
|
|
102
103
|
if (name === 'filters') {
|
|
@@ -109,9 +110,9 @@ Object.keys(props).forEach(name => {
|
|
|
109
110
|
}
|
|
110
111
|
})
|
|
111
112
|
|
|
112
|
-
export default {
|
|
113
|
+
export default defineVxeComponent({
|
|
113
114
|
name: 'VxeColumn',
|
|
114
|
-
props,
|
|
115
|
+
props: columnProps,
|
|
115
116
|
provide () {
|
|
116
117
|
return {
|
|
117
118
|
$xecolumn: this,
|
|
@@ -126,11 +127,12 @@ export default {
|
|
|
126
127
|
default: null
|
|
127
128
|
}
|
|
128
129
|
},
|
|
129
|
-
watch,
|
|
130
|
+
watch: columnWatch,
|
|
130
131
|
created (this: any) {
|
|
131
132
|
this.columnConfig = this.createColumn(this.$xetable, this)
|
|
132
133
|
},
|
|
133
134
|
mounted () {
|
|
135
|
+
this.columnConfig.slots = this.$scopedSlots
|
|
134
136
|
assembleColumn(this)
|
|
135
137
|
},
|
|
136
138
|
destroyed () {
|
|
@@ -140,4 +142,4 @@ export default {
|
|
|
140
142
|
return h('div', this.$slots.default)
|
|
141
143
|
},
|
|
142
144
|
methods: Cell
|
|
143
|
-
}
|
|
145
|
+
})
|
|
@@ -1,12 +1,46 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Cell from './cell'
|
|
2
|
+
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
|
+
import { assembleColumn, destroyColumn } from './util'
|
|
4
|
+
import { columnProps, columnWatch } from './column'
|
|
2
5
|
|
|
3
|
-
export default {
|
|
6
|
+
export default defineVxeComponent({
|
|
4
7
|
name: 'VxeColgroup',
|
|
5
|
-
|
|
8
|
+
props: columnProps,
|
|
6
9
|
provide () {
|
|
7
10
|
return {
|
|
8
|
-
|
|
11
|
+
$xecolumn: this,
|
|
9
12
|
$xegrid: null
|
|
10
13
|
}
|
|
11
|
-
}
|
|
12
|
-
|
|
14
|
+
},
|
|
15
|
+
inject: {
|
|
16
|
+
$xetable: {
|
|
17
|
+
default: null
|
|
18
|
+
},
|
|
19
|
+
$xecolumn: {
|
|
20
|
+
default: null
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
watch: columnWatch,
|
|
24
|
+
created (this: any) {
|
|
25
|
+
this.columnConfig = this.createColumn(this.$xetable, this)
|
|
26
|
+
},
|
|
27
|
+
mounted () {
|
|
28
|
+
const { $scopedSlots } = this
|
|
29
|
+
const columnSlots: {
|
|
30
|
+
header?: any
|
|
31
|
+
} = {}
|
|
32
|
+
|
|
33
|
+
if ($scopedSlots.header) {
|
|
34
|
+
columnSlots.header = $scopedSlots.header
|
|
35
|
+
}
|
|
36
|
+
this.columnConfig.slots = columnSlots
|
|
37
|
+
assembleColumn(this)
|
|
38
|
+
},
|
|
39
|
+
destroyed () {
|
|
40
|
+
destroyColumn(this)
|
|
41
|
+
},
|
|
42
|
+
render (this: any, h: any) {
|
|
43
|
+
return h('div', this.$slots.default)
|
|
44
|
+
},
|
|
45
|
+
methods: Cell
|
|
46
|
+
})
|
|
@@ -7,7 +7,7 @@ import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible,
|
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
9
9
|
|
|
10
|
-
import type { VxeTableDefines, VxeTableEmits, ValueOf } from '../../../types'
|
|
10
|
+
import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf } from '../../../types'
|
|
11
11
|
|
|
12
12
|
const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI
|
|
13
13
|
|
|
@@ -16,6 +16,8 @@ const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeU
|
|
|
16
16
|
|
|
17
17
|
const customStorageKey = 'VXE_CUSTOM_STORE'
|
|
18
18
|
|
|
19
|
+
const tpImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
|
|
20
|
+
|
|
19
21
|
// 获取所有的列,排除分组
|
|
20
22
|
const getColumnList = (columns: any[]) => {
|
|
21
23
|
const result: any[] = []
|
|
@@ -470,11 +472,18 @@ function showDropTip ($xeTable: any, evnt: DragEvent | MouseEvent, trEl: HTMLEle
|
|
|
470
472
|
if (cdLineEl) {
|
|
471
473
|
if (showLine) {
|
|
472
474
|
const thRect = thEl.getBoundingClientRect()
|
|
475
|
+
const offsetTop = Math.max(0, thRect.y - wrapperRect.y)
|
|
473
476
|
cdLineEl.style.display = 'block'
|
|
477
|
+
cdLineEl.style.top = `${offsetTop}px`
|
|
474
478
|
cdLineEl.style.left = `${Math.max(1, thRect.x - wrapperRect.x)}px`
|
|
475
479
|
cdLineEl.style.width = `${thRect.width}px`
|
|
476
|
-
|
|
480
|
+
if (prevDragToChild) {
|
|
481
|
+
cdLineEl.style.height = `${thRect.height}px`
|
|
482
|
+
} else {
|
|
483
|
+
cdLineEl.style.height = `${wrapperRect.height - offsetTop - scrollbarHeight}px`
|
|
484
|
+
}
|
|
477
485
|
cdLineEl.setAttribute('drag-pos', dragPos)
|
|
486
|
+
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n')
|
|
478
487
|
} else {
|
|
479
488
|
cdLineEl.style.display = ''
|
|
480
489
|
}
|
|
@@ -971,12 +980,12 @@ const Methods = {
|
|
|
971
980
|
if (!cacheItem) {
|
|
972
981
|
cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, items, parent, level, height: 0 }
|
|
973
982
|
}
|
|
983
|
+
cacheItem.row = row
|
|
984
|
+
cacheItem.items = items
|
|
985
|
+
cacheItem.parent = parent
|
|
986
|
+
cacheItem.level = level
|
|
987
|
+
cacheItem.index = treeConfig && parent ? -1 : index
|
|
974
988
|
if (isSource) {
|
|
975
|
-
cacheItem.row = row
|
|
976
|
-
cacheItem.items = items
|
|
977
|
-
cacheItem.parent = parent
|
|
978
|
-
cacheItem.level = level
|
|
979
|
-
cacheItem.index = treeConfig && parent ? -1 : index
|
|
980
989
|
fullDataRowIdMaps[rowid] = cacheItem
|
|
981
990
|
}
|
|
982
991
|
fullAllDataRowIdMaps[rowid] = cacheItem
|
|
@@ -1059,36 +1068,46 @@ const Methods = {
|
|
|
1059
1068
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
1060
1069
|
*/
|
|
1061
1070
|
cacheColumnMap () {
|
|
1062
|
-
const
|
|
1063
|
-
const
|
|
1064
|
-
const
|
|
1071
|
+
const $xeTable = this
|
|
1072
|
+
const props = $xeTable
|
|
1073
|
+
const reactData = $xeTable
|
|
1074
|
+
const internalData = $xeTable
|
|
1075
|
+
|
|
1076
|
+
const { tableFullColumn, collectColumn } = internalData
|
|
1077
|
+
const fullColumnIdData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnIdData = {}
|
|
1078
|
+
const fullColumnFieldData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnFieldData = {}
|
|
1079
|
+
const mouseOpts = $xeTable.computeMouseOpts
|
|
1080
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
1081
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
1082
|
+
const { isCrossDrag, isSelfToChildDrag } = columnDragOpts
|
|
1083
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
1065
1084
|
const isGroup = collectColumn.some(hasChildrenList)
|
|
1066
|
-
let isAllOverflow = !!showOverflow
|
|
1067
|
-
let expandColumn:
|
|
1068
|
-
let treeNodeColumn:
|
|
1069
|
-
let checkboxColumn:
|
|
1070
|
-
let radioColumn:
|
|
1071
|
-
let htmlColumn:
|
|
1072
|
-
let hasFixed:
|
|
1073
|
-
const handleFunc = (column:
|
|
1085
|
+
let isAllOverflow = !!props.showOverflow
|
|
1086
|
+
let expandColumn: VxeTableDefines.ColumnInfo | undefined
|
|
1087
|
+
let treeNodeColumn: VxeTableDefines.ColumnInfo | undefined
|
|
1088
|
+
let checkboxColumn: VxeTableDefines.ColumnInfo | undefined
|
|
1089
|
+
let radioColumn: VxeTableDefines.ColumnInfo | undefined
|
|
1090
|
+
let htmlColumn: VxeTableDefines.ColumnInfo | undefined
|
|
1091
|
+
let hasFixed: VxeColumnPropTypes.Fixed | undefined
|
|
1092
|
+
const handleFunc = (column: VxeTableDefines.ColumnInfo, index: number, items: VxeTableDefines.ColumnInfo[], path?: string[], parent?: VxeTableDefines.ColumnInfo) => {
|
|
1074
1093
|
const { id: colid, field, fixed, type, treeNode } = column
|
|
1075
|
-
const rest = { column, colid, index, items, parent: parent || null, width: 0 }
|
|
1094
|
+
const rest = { $index: -1, _index: -1, column, colid, index, items, parent: parent || null, width: 0 }
|
|
1076
1095
|
if (field) {
|
|
1077
|
-
if (
|
|
1078
|
-
|
|
1079
|
-
warnLog('vxe.error.colRepet', ['field', field])
|
|
1080
|
-
}
|
|
1096
|
+
if (fullColumnFieldData[field]) {
|
|
1097
|
+
errLog('vxe.error.colRepet', ['field', field])
|
|
1081
1098
|
}
|
|
1082
1099
|
fullColumnFieldData[field] = rest
|
|
1100
|
+
} else {
|
|
1101
|
+
if (isCrossDrag || isSelfToChildDrag) {
|
|
1102
|
+
errLog('vxe.error.emptyProp', ['column.field'])
|
|
1103
|
+
}
|
|
1083
1104
|
}
|
|
1084
|
-
|
|
1085
1105
|
if (!hasFixed && fixed) {
|
|
1086
1106
|
hasFixed = fixed
|
|
1087
1107
|
}
|
|
1088
1108
|
if (!htmlColumn && type === 'html') {
|
|
1089
1109
|
htmlColumn = column
|
|
1090
1110
|
}
|
|
1091
|
-
|
|
1092
1111
|
if (treeNode) {
|
|
1093
1112
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1094
1113
|
if (treeNodeColumn) {
|
|
@@ -1125,29 +1144,6 @@ const Methods = {
|
|
|
1125
1144
|
}
|
|
1126
1145
|
}
|
|
1127
1146
|
}
|
|
1128
|
-
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1129
|
-
if (this.showOverflow && column.showOverflow === false) {
|
|
1130
|
-
warnLog('vxe.error.errConflicts', [`table.show-overflow=${this.showOverflow}`, `column.show-overflow=${column.showOverflow}`])
|
|
1131
|
-
}
|
|
1132
|
-
if (this.showHeaderOverflow && column.showHeaderOverflow === false) {
|
|
1133
|
-
warnLog('vxe.error.errConflicts', [`table.show-header-overflow=${this.showHeaderOverflow}`, `column.show-header-overflow=${column.showHeaderOverflow}`])
|
|
1134
|
-
}
|
|
1135
|
-
if (this.showFooterOverflow && column.showFooterOverflow === false) {
|
|
1136
|
-
warnLog('vxe.error.errConflicts', [`table.show-footer-overflow=${this.showFooterOverflow}`, `column.show-footer-overflow=${column.showFooterOverflow}`])
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1141
|
-
if (htmlColumn) {
|
|
1142
|
-
if (!columnOpts.useKey) {
|
|
1143
|
-
errLog('vxe.error.reqProp', ['column-config.useKey', 'column.type=html'])
|
|
1144
|
-
}
|
|
1145
|
-
if (!rowOpts.useKey) {
|
|
1146
|
-
errLog('vxe.error.reqProp', ['row-config.useKey', 'column.type=html'])
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
1147
|
if (isAllOverflow && column.showOverflow === false) {
|
|
1152
1148
|
isAllOverflow = false
|
|
1153
1149
|
}
|
|
@@ -1155,9 +1151,8 @@ const Methods = {
|
|
|
1155
1151
|
errLog('vxe.error.colRepet', ['colId', colid])
|
|
1156
1152
|
}
|
|
1157
1153
|
fullColumnIdData[colid] = rest
|
|
1158
|
-
fullColumnMap.set(column, rest)
|
|
1159
1154
|
}
|
|
1160
|
-
|
|
1155
|
+
|
|
1161
1156
|
if (isGroup) {
|
|
1162
1157
|
XEUtils.eachTree(collectColumn, (column, index, items, path, parent, nodes) => {
|
|
1163
1158
|
column.level = nodes.length
|
|
@@ -1168,15 +1163,26 @@ const Methods = {
|
|
|
1168
1163
|
}
|
|
1169
1164
|
|
|
1170
1165
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1171
|
-
if (expandColumn &&
|
|
1166
|
+
if (expandColumn && mouseOpts.area) {
|
|
1172
1167
|
errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
|
|
1173
1168
|
}
|
|
1174
1169
|
}
|
|
1175
1170
|
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1171
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1172
|
+
if (htmlColumn) {
|
|
1173
|
+
if (!columnOpts.useKey) {
|
|
1174
|
+
errLog('vxe.error.reqProp', ['column-config.useKey & column.type=html'])
|
|
1175
|
+
}
|
|
1176
|
+
if (!rowOpts.useKey) {
|
|
1177
|
+
errLog('vxe.error.reqProp', ['row-config.useKey & column.type=html'])
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
reactData.isGroup = isGroup
|
|
1183
|
+
reactData.treeNodeColumn = treeNodeColumn
|
|
1184
|
+
reactData.expandColumn = expandColumn
|
|
1185
|
+
reactData.isAllOverflow = isAllOverflow
|
|
1180
1186
|
},
|
|
1181
1187
|
/**
|
|
1182
1188
|
* 根据 tr 元素获取对应的 row 信息
|
|
@@ -2679,6 +2685,10 @@ const Methods = {
|
|
|
2679
2685
|
const internalData = $xeTable
|
|
2680
2686
|
|
|
2681
2687
|
const { rceTimeout } = internalData
|
|
2688
|
+
const el = $xeTable.$refs.refElem
|
|
2689
|
+
if (!el || !el.clientWidth) {
|
|
2690
|
+
$xeTable.autoCellWidth()
|
|
2691
|
+
}
|
|
2682
2692
|
if (rceTimeout) {
|
|
2683
2693
|
clearTimeout(rceTimeout)
|
|
2684
2694
|
$xeTable.$nextTick(() => {
|
|
@@ -5070,8 +5080,9 @@ const Methods = {
|
|
|
5070
5080
|
* 行拖拽
|
|
5071
5081
|
*/
|
|
5072
5082
|
handleRowDragDragstartEvent (evnt: DragEvent) {
|
|
5073
|
-
const img = new Image()
|
|
5074
5083
|
if (evnt.dataTransfer) {
|
|
5084
|
+
const img = new Image()
|
|
5085
|
+
img.src = tpImg
|
|
5075
5086
|
evnt.dataTransfer.setDragImage(img, 0, 0)
|
|
5076
5087
|
}
|
|
5077
5088
|
},
|
|
@@ -5137,8 +5148,8 @@ const Methods = {
|
|
|
5137
5148
|
return
|
|
5138
5149
|
}
|
|
5139
5150
|
if (oldAllMaps[newRowid]) {
|
|
5151
|
+
isSelfToChildStatus = true
|
|
5140
5152
|
if (!isSelfToChildDrag) {
|
|
5141
|
-
isSelfToChildStatus = true
|
|
5142
5153
|
if (VxeUI.modal) {
|
|
5143
5154
|
VxeUI.modal.message({
|
|
5144
5155
|
status: 'error',
|
|
@@ -5220,7 +5231,7 @@ const Methods = {
|
|
|
5220
5231
|
|
|
5221
5232
|
reactData.isDragRowMove = true
|
|
5222
5233
|
$xeTable.handleTableData(treeConfig && transform)
|
|
5223
|
-
$xeTable.cacheRowMap(
|
|
5234
|
+
$xeTable.cacheRowMap()
|
|
5224
5235
|
$xeTable.updateScrollYStatus()
|
|
5225
5236
|
if (!(treeConfig && transform)) {
|
|
5226
5237
|
$xeTable.updateAfterDataIndex()
|
|
@@ -5250,6 +5261,7 @@ const Methods = {
|
|
|
5250
5261
|
}
|
|
5251
5262
|
hideDropTip($xeTable)
|
|
5252
5263
|
clearRowDropOrigin($xeTable)
|
|
5264
|
+
internalData.prevDragToChild = false
|
|
5253
5265
|
reactData.dragRow = null
|
|
5254
5266
|
reactData.dragCol = null
|
|
5255
5267
|
setTimeout(() => {
|
|
@@ -5342,8 +5354,9 @@ const Methods = {
|
|
|
5342
5354
|
* 列拖拽
|
|
5343
5355
|
*/
|
|
5344
5356
|
handleHeaderCellDragDragstartEvent (evnt: DragEvent) {
|
|
5345
|
-
const img = new Image()
|
|
5346
5357
|
if (evnt.dataTransfer) {
|
|
5358
|
+
const img = new Image()
|
|
5359
|
+
img.src = tpImg
|
|
5347
5360
|
evnt.dataTransfer.setDragImage(img, 0, 0)
|
|
5348
5361
|
}
|
|
5349
5362
|
},
|
|
@@ -5355,18 +5368,20 @@ const Methods = {
|
|
|
5355
5368
|
|
|
5356
5369
|
const { mouseConfig } = props
|
|
5357
5370
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
5358
|
-
const { dragEndMethod } = columnDragOpts
|
|
5371
|
+
const { isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts
|
|
5359
5372
|
const { dragCol } = reactData
|
|
5360
|
-
const { collectColumn, prevDragCol, prevDragPos } = internalData
|
|
5373
|
+
const { collectColumn, prevDragCol, prevDragPos, prevDragToChild } = internalData
|
|
5361
5374
|
const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0
|
|
5362
5375
|
if (prevDragCol && dragCol) {
|
|
5363
5376
|
// 判断是否有拖动
|
|
5364
5377
|
if (prevDragCol !== dragCol) {
|
|
5378
|
+
const oldColumn: VxeTableDefines.ColumnInfo = dragCol
|
|
5379
|
+
const newColumn: VxeTableDefines.ColumnInfo = prevDragCol
|
|
5365
5380
|
Promise.resolve(
|
|
5366
5381
|
dragEndMethod
|
|
5367
5382
|
? dragEndMethod({
|
|
5368
|
-
oldColumn
|
|
5369
|
-
newColumn
|
|
5383
|
+
oldColumn,
|
|
5384
|
+
newColumn,
|
|
5370
5385
|
dragPos: prevDragPos as any,
|
|
5371
5386
|
offsetIndex: dragOffsetIndex
|
|
5372
5387
|
})
|
|
@@ -5376,6 +5391,101 @@ const Methods = {
|
|
|
5376
5391
|
return
|
|
5377
5392
|
}
|
|
5378
5393
|
|
|
5394
|
+
let oafIndex = -1
|
|
5395
|
+
let nafIndex = -1
|
|
5396
|
+
|
|
5397
|
+
const oldAllMaps: Record<string, any> = {}
|
|
5398
|
+
XEUtils.eachTree([oldColumn], column => {
|
|
5399
|
+
oldAllMaps[column.id] = column
|
|
5400
|
+
})
|
|
5401
|
+
|
|
5402
|
+
let isSelfToChildStatus = false
|
|
5403
|
+
|
|
5404
|
+
if (oldColumn.parentId && newColumn.parentId) {
|
|
5405
|
+
// 子到子
|
|
5406
|
+
|
|
5407
|
+
if (!isCrossDrag) {
|
|
5408
|
+
return
|
|
5409
|
+
}
|
|
5410
|
+
if (oldAllMaps[newColumn.id]) {
|
|
5411
|
+
isSelfToChildStatus = true
|
|
5412
|
+
if (!isSelfToChildDrag) {
|
|
5413
|
+
if (VxeUI.modal) {
|
|
5414
|
+
VxeUI.modal.message({
|
|
5415
|
+
status: 'error',
|
|
5416
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
5417
|
+
})
|
|
5418
|
+
}
|
|
5419
|
+
return
|
|
5420
|
+
}
|
|
5421
|
+
}
|
|
5422
|
+
} else if (oldColumn.parentId) {
|
|
5423
|
+
// 子到根
|
|
5424
|
+
|
|
5425
|
+
if (!isCrossDrag) {
|
|
5426
|
+
return
|
|
5427
|
+
}
|
|
5428
|
+
} else if (newColumn.parentId) {
|
|
5429
|
+
// 根到子
|
|
5430
|
+
|
|
5431
|
+
if (!isCrossDrag) {
|
|
5432
|
+
return
|
|
5433
|
+
}
|
|
5434
|
+
if (oldAllMaps[newColumn.id]) {
|
|
5435
|
+
isSelfToChildStatus = true
|
|
5436
|
+
if (!isSelfToChildDrag) {
|
|
5437
|
+
if (VxeUI.modal) {
|
|
5438
|
+
VxeUI.modal.message({
|
|
5439
|
+
status: 'error',
|
|
5440
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
5441
|
+
})
|
|
5442
|
+
}
|
|
5443
|
+
return
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5446
|
+
} else {
|
|
5447
|
+
// 根到根
|
|
5448
|
+
}
|
|
5449
|
+
|
|
5450
|
+
const oldewMatchRest = XEUtils.findTree(collectColumn as VxeTableDefines.ColumnInfo[], item => item.id === oldColumn.id)
|
|
5451
|
+
|
|
5452
|
+
// 改变层级
|
|
5453
|
+
if (isSelfToChildStatus && isSelfToChildDrag) {
|
|
5454
|
+
if (oldewMatchRest) {
|
|
5455
|
+
const { items: oCols, index: oIndex } = oldewMatchRest
|
|
5456
|
+
const childList = oldColumn.children || []
|
|
5457
|
+
childList.forEach(column => {
|
|
5458
|
+
column.parentId = oldColumn.parentId
|
|
5459
|
+
})
|
|
5460
|
+
oCols.splice(oIndex, 1, ...childList)
|
|
5461
|
+
oldColumn.children = []
|
|
5462
|
+
}
|
|
5463
|
+
} else {
|
|
5464
|
+
if (oldewMatchRest) {
|
|
5465
|
+
const { items: oCols, index: oIndex, parent: oParent } = oldewMatchRest
|
|
5466
|
+
oCols.splice(oIndex, 1)
|
|
5467
|
+
if (!oParent) {
|
|
5468
|
+
oafIndex = oIndex
|
|
5469
|
+
}
|
|
5470
|
+
}
|
|
5471
|
+
}
|
|
5472
|
+
|
|
5473
|
+
const newMatchRest = XEUtils.findTree(collectColumn as VxeTableDefines.ColumnInfo[], item => item.id === newColumn.id)
|
|
5474
|
+
if (newMatchRest) {
|
|
5475
|
+
const { items: nCols, index: nIndex, parent: nParent } = newMatchRest
|
|
5476
|
+
// 转子级
|
|
5477
|
+
if (isToChildDrag && prevDragToChild) {
|
|
5478
|
+
oldColumn.parentId = newColumn.id
|
|
5479
|
+
newColumn.children = (newColumn.children || []).concat([oldColumn])
|
|
5480
|
+
} else {
|
|
5481
|
+
oldColumn.parentId = newColumn.parentId
|
|
5482
|
+
nCols.splice(nIndex + dragOffsetIndex, 0, oldColumn)
|
|
5483
|
+
}
|
|
5484
|
+
if (!nParent) {
|
|
5485
|
+
nafIndex = nIndex
|
|
5486
|
+
}
|
|
5487
|
+
}
|
|
5488
|
+
|
|
5379
5489
|
XEUtils.eachTree(collectColumn, (column, index, items, path, parent) => {
|
|
5380
5490
|
if (!parent) {
|
|
5381
5491
|
const sortIndex = index + 1
|
|
@@ -5383,19 +5493,6 @@ const Methods = {
|
|
|
5383
5493
|
}
|
|
5384
5494
|
})
|
|
5385
5495
|
|
|
5386
|
-
const oafIndex = XEUtils.findIndexOf(collectColumn, item => item.id === dragCol.id)
|
|
5387
|
-
const nafIndex = XEUtils.findIndexOf(collectColumn, item => item.id === prevDragCol.id) + dragOffsetIndex
|
|
5388
|
-
|
|
5389
|
-
const newTargetCol = collectColumn[nafIndex]
|
|
5390
|
-
if (newTargetCol) {
|
|
5391
|
-
// 插入最后位置
|
|
5392
|
-
dragCol.renderSortNumber = newTargetCol.renderSortNumber
|
|
5393
|
-
newTargetCol.renderSortNumber = dragCol.renderSortNumber + 0.5
|
|
5394
|
-
} else {
|
|
5395
|
-
// 插入新位置
|
|
5396
|
-
dragCol.renderSortNumber = collectColumn.length + 1.5
|
|
5397
|
-
}
|
|
5398
|
-
|
|
5399
5496
|
reactData.isDragColMove = true
|
|
5400
5497
|
if (mouseConfig) {
|
|
5401
5498
|
if ($xeTable.clearSelected) {
|
|
@@ -5406,15 +5503,14 @@ const Methods = {
|
|
|
5406
5503
|
$xeTable.clearCopyCellArea()
|
|
5407
5504
|
}
|
|
5408
5505
|
}
|
|
5409
|
-
|
|
5410
|
-
$xeTable
|
|
5506
|
+
|
|
5507
|
+
$xeTable.refreshColumn(true).then(() => {
|
|
5411
5508
|
$xeTable.updateCellAreas()
|
|
5412
|
-
$xeTable.refreshColumn(true)
|
|
5413
5509
|
})
|
|
5414
5510
|
|
|
5415
5511
|
$xeTable.dispatchEvent('column-dragend', {
|
|
5416
|
-
oldColumn
|
|
5417
|
-
newColumn
|
|
5512
|
+
oldColumn,
|
|
5513
|
+
newColumn,
|
|
5418
5514
|
dragPos: prevDragPos,
|
|
5419
5515
|
offsetIndex: dragOffsetIndex,
|
|
5420
5516
|
_index: {
|
|
@@ -5430,6 +5526,7 @@ const Methods = {
|
|
|
5430
5526
|
}
|
|
5431
5527
|
hideDropTip($xeTable)
|
|
5432
5528
|
clearColDropOrigin($xeTable)
|
|
5529
|
+
internalData.prevDragToChild = false
|
|
5433
5530
|
reactData.dragRow = null
|
|
5434
5531
|
reactData.dragCol = null
|
|
5435
5532
|
setTimeout(() => {
|
|
@@ -5442,10 +5539,13 @@ const Methods = {
|
|
|
5442
5539
|
const internalData = $xeTable
|
|
5443
5540
|
|
|
5444
5541
|
const { dragCol } = reactData
|
|
5542
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
5543
|
+
const { isToChildDrag, isCrossDrag } = columnDragOpts
|
|
5445
5544
|
if (!dragCol) {
|
|
5446
5545
|
evnt.preventDefault()
|
|
5447
5546
|
return
|
|
5448
5547
|
}
|
|
5548
|
+
const hasCtrlKey = evnt.ctrlKey
|
|
5449
5549
|
const thEl = evnt.currentTarget as HTMLElement
|
|
5450
5550
|
const colid = thEl.getAttribute('colid')
|
|
5451
5551
|
const column = $xeTable.getColumnById(colid)
|
|
@@ -5454,11 +5554,11 @@ const Methods = {
|
|
|
5454
5554
|
const { dragCol } = reactData
|
|
5455
5555
|
const offsetX = evnt.clientX - thEl.getBoundingClientRect().x
|
|
5456
5556
|
const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right'
|
|
5457
|
-
if (dragCol.id === column.id || column.parentId) {
|
|
5557
|
+
if ((dragCol && dragCol.id === column.id) || (!isCrossDrag && column.parentId)) {
|
|
5458
5558
|
showDropTip($xeTable, evnt, null, thEl, false, dragPos)
|
|
5459
5559
|
return
|
|
5460
5560
|
}
|
|
5461
|
-
internalData.prevDragToChild =
|
|
5561
|
+
internalData.prevDragToChild = !!(isToChildDrag && hasCtrlKey)
|
|
5462
5562
|
internalData.prevDragCol = column
|
|
5463
5563
|
internalData.prevDragPos = dragPos
|
|
5464
5564
|
showDropTip($xeTable, evnt, null, thEl, true, dragPos)
|
|
@@ -137,7 +137,6 @@ export function handleFieldOrColumn (_vm: any, fieldOrColumn: any) {
|
|
|
137
137
|
export function assembleColumn (_vm: any) {
|
|
138
138
|
const { $el, $xetable, $xecolumn, columnConfig } = _vm
|
|
139
139
|
const groupConfig = $xecolumn ? $xecolumn.columnConfig : null
|
|
140
|
-
columnConfig.slots = _vm.$scopedSlots
|
|
141
140
|
if (groupConfig) {
|
|
142
141
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
143
142
|
if ($xecolumn.$options._componentTag === 'vxe-table-column') {
|
|
@@ -1286,6 +1286,11 @@
|
|
|
1286
1286
|
&[drag-pos="right"] {
|
|
1287
1287
|
border-right-color: var(--vxe-ui-font-primary-color);
|
|
1288
1288
|
}
|
|
1289
|
+
&[drag-to-child="y"] {
|
|
1290
|
+
border-left-color: transparent;
|
|
1291
|
+
border-right-color: transparent;
|
|
1292
|
+
border-bottom-color: var(--vxe-ui-status-success-color);
|
|
1293
|
+
}
|
|
1289
1294
|
&.is--guides {
|
|
1290
1295
|
background-color: var( --vxe-ui-table-drag-over-background-color);
|
|
1291
1296
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|