vxe-table 4.8.0 → 4.8.1
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/locale/lang/en-US.js +4 -2
- package/es/locale/lang/es-ES.js +4 -2
- package/es/locale/lang/hu-HU.js +4 -2
- package/es/locale/lang/ja-JP.js +4 -2
- package/es/locale/lang/ko-KR.js +4 -2
- package/es/locale/lang/pt-BR.js +4 -2
- package/es/locale/lang/ru-RU.js +4 -2
- package/es/locale/lang/uk-UA.js +4 -2
- package/es/locale/lang/vi-VN.js +4 -2
- package/es/locale/lang/zh-CHT.js +4 -2
- package/es/locale/lang/zh-CN.js +4 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/hook.js +7 -4
- package/es/table/src/body.js +22 -8
- package/es/table/src/cell.js +53 -24
- package/es/table/src/column.js +3 -1
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/emits.js +3 -0
- package/es/table/src/props.js +2 -0
- package/es/table/src/table.js +241 -40
- package/es/table/style.css +74 -2
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +74 -2
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.umd.js +359 -82
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -2
- package/lib/locale/lang/es-ES.js +4 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +4 -2
- package/lib/locale/lang/hu-HU.js +4 -2
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +4 -2
- package/lib/locale/lang/ja-JP.js +4 -2
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +4 -2
- package/lib/locale/lang/ko-KR.js +4 -2
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +4 -2
- package/lib/locale/lang/pt-BR.js +4 -2
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +4 -2
- package/lib/locale/lang/ru-RU.js +4 -2
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -2
- package/lib/locale/lang/uk-UA.js +4 -2
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +4 -2
- package/lib/locale/lang/vi-VN.js +4 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +4 -2
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +4 -2
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +4 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/hook.js +8 -4
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/body.js +18 -5
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +60 -24
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +3 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/props.js +2 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +258 -43
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +74 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +4 -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 +74 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/en-US.ts +4 -2
- package/packages/locale/lang/es-ES.ts +4 -2
- package/packages/locale/lang/hu-HU.ts +4 -2
- package/packages/locale/lang/ja-JP.ts +4 -2
- package/packages/locale/lang/ko-KR.ts +4 -2
- package/packages/locale/lang/pt-BR.ts +4 -2
- package/packages/locale/lang/ru-RU.ts +4 -2
- package/packages/locale/lang/uk-UA.ts +4 -2
- package/packages/locale/lang/vi-VN.ts +4 -2
- package/packages/locale/lang/zh-CHT.ts +4 -2
- package/packages/locale/lang/zh-CN.ts +4 -2
- package/packages/table/module/custom/panel.ts +1 -1
- package/packages/table/module/edit/hook.ts +7 -4
- package/packages/table/src/body.ts +22 -8
- package/packages/table/src/cell.ts +57 -24
- package/packages/table/src/column.ts +3 -1
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/emits.ts +4 -0
- package/packages/table/src/props.ts +2 -0
- package/packages/table/src/table.ts +258 -42
- package/packages/ui/index.ts +3 -0
- package/styles/components/table-module/custom.scss +9 -3
- package/styles/components/table.scss +80 -0
- /package/es/{iconfont.1730681238555.ttf → iconfont.1730873064176.ttf} +0 -0
- /package/es/{iconfont.1730681238555.woff → iconfont.1730873064176.woff} +0 -0
- /package/es/{iconfont.1730681238555.woff2 → iconfont.1730873064176.woff2} +0 -0
- /package/lib/{iconfont.1730681238555.ttf → iconfont.1730873064176.ttf} +0 -0
- /package/lib/{iconfont.1730681238555.woff → iconfont.1730873064176.woff} +0 -0
- /package/lib/{iconfont.1730681238555.woff2 → iconfont.1730873064176.woff2} +0 -0
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: '{0} レコードがインポートされました',
|
|
63
63
|
expLoading: 'エクスポート中',
|
|
64
64
|
expSuccess: 'エクスポートが成功しました',
|
|
65
|
+
expError: 'Export failure',
|
|
65
66
|
expOriginFilename: 'エクスポート_{0}',
|
|
66
67
|
expSrcFilename: 'エクスポート_ソース_{0}',
|
|
67
68
|
customTitle: '列設定',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '关闭',
|
|
71
72
|
customCancel: 'Cancel',
|
|
72
73
|
customRestore: 'リセット',
|
|
73
|
-
maxFixedCol: '最大固定列数が {0} です。'
|
|
74
|
+
maxFixedCol: '最大固定列数が {0} です。',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: '1つ以上のレコードを選択してください',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: 'キャンセル',
|
|
122
124
|
cstmConfirm: 'OK',
|
|
123
125
|
cstmConfirmRestore: '列をデフォルト状態に戻します。よろしいですか?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移动:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: 'ソート',
|
|
127
129
|
sortHelpTip: 'ドラッグして列を並べ替えます',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: '成功导入 {0} 条记录',
|
|
63
63
|
expLoading: '正在导出中',
|
|
64
64
|
expSuccess: '导出成功',
|
|
65
|
+
expError: 'Export failure',
|
|
65
66
|
expFilename: '导出_{0}',
|
|
66
67
|
expOriginFilename: '导出_源_{0}',
|
|
67
68
|
customTitle: '列设置',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '关闭',
|
|
71
72
|
customCancel: '取消',
|
|
72
73
|
customRestore: '恢复默认',
|
|
73
|
-
maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
|
|
74
|
+
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: '取消',
|
|
122
124
|
cstmConfirm: '确定',
|
|
123
125
|
cstmConfirmRestore: '请确认是否恢复成默认列配置?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移动:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: '排序',
|
|
127
129
|
sortHelpTip: '点击并拖动图标可以调整列的排序',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: 'Importado com sucesso {0} registros',
|
|
63
63
|
expLoading: 'Exportando',
|
|
64
64
|
expSuccess: 'Exportado com sucesso',
|
|
65
|
+
expError: 'Export failure',
|
|
65
66
|
expFilename: 'Exportar_{0}',
|
|
66
67
|
expOriginFilename: 'Exportar_original_{0}',
|
|
67
68
|
customTitle: 'Configurações de coluna',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '关闭',
|
|
71
72
|
customCancel: 'Cancel',
|
|
72
73
|
customRestore: 'Restore',
|
|
73
|
-
maxFixedCol: 'The maximum number of Freeze columns cannot exceed {0}'
|
|
74
|
+
maxFixedCol: 'The maximum number of Freeze columns cannot exceed {0}',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: 'Por favor, selecione pelo menos um registro!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: 'Cancelar',
|
|
122
124
|
cstmConfirm: 'Confirm',
|
|
123
125
|
cstmConfirmRestore: 'Please confirm whether to restore the default column configuration?',
|
|
124
|
-
cstmDragTarget: 'Moving
|
|
126
|
+
cstmDragTarget: 'Moving: {0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: 'Sort',
|
|
127
129
|
sortHelpTip: 'Click and drag the icon to adjust the order of the columns.',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: 'Успешно импортировано {0} записей.',
|
|
63
63
|
expLoading: 'Экспорт',
|
|
64
64
|
expSuccess: 'Экспорт выполнен успешно',
|
|
65
|
+
expError: 'Export failure',
|
|
65
66
|
expFilename: 'Экспорт_{0}',
|
|
66
67
|
expOriginFilename: 'экспорт_источник_{0}',
|
|
67
68
|
customTitle: 'Настройки столбца',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: 'закрытие',
|
|
71
72
|
customCancel: 'Отмена',
|
|
72
73
|
customRestore: 'Восстановить настройки по умолчанию',
|
|
73
|
-
maxFixedCol: 'Максимальное количество замороженных столбцов не может превышать {0}.'
|
|
74
|
+
maxFixedCol: 'Максимальное количество замороженных столбцов не может превышать {0}.',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: 'Пожалуйста, выберите хотя бы одну запись!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: 'Отмена',
|
|
122
124
|
cstmConfirm: 'Конечно',
|
|
123
125
|
cstmConfirmRestore: 'Пожалуйста, подтвердите, нужно ли восстановить конфигурацию столбца по умолчанию?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移动:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: 'сортировать',
|
|
127
129
|
sortHelpTip: 'Нажмите и перетащите значок, чтобы изменить порядок столбцов.',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: '成功导入 {0} 条记录',
|
|
63
63
|
expLoading: '正在导出中',
|
|
64
64
|
expSuccess: '导出成功',
|
|
65
|
+
expError: '导出失败',
|
|
65
66
|
expFilename: '导出_{0}',
|
|
66
67
|
expOriginFilename: '导出_源_{0}',
|
|
67
68
|
customTitle: '列设置',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '关闭',
|
|
71
72
|
customCancel: '取消',
|
|
72
73
|
customRestore: '恢复默认',
|
|
73
|
-
maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
|
|
74
|
+
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: '取消',
|
|
122
124
|
cstmConfirm: '确定',
|
|
123
125
|
cstmConfirmRestore: '请确认是否恢复成默认列配置?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移动:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: '排序',
|
|
127
129
|
sortHelpTip: '点击并拖动图标可以调整列的排序',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: '成功导入 {0} 条记录',
|
|
63
63
|
expLoading: '正在导出中',
|
|
64
64
|
expSuccess: '导出成功',
|
|
65
|
+
expError: '导出失败',
|
|
65
66
|
expFilename: '导出_{0}',
|
|
66
67
|
expOriginFilename: '导出_源_{0}',
|
|
67
68
|
customTitle: '列设置',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '关闭',
|
|
71
72
|
customCancel: '取消',
|
|
72
73
|
customRestore: '恢复默认',
|
|
73
|
-
maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
|
|
74
|
+
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: '取消',
|
|
122
124
|
cstmConfirm: '确定',
|
|
123
125
|
cstmConfirmRestore: '请确认是否恢复成默认列配置?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移动:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: '排序',
|
|
127
129
|
sortHelpTip: '点击并拖动图标可以调整列的排序',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: '成功導入 {0} 筆記錄',
|
|
63
63
|
expLoading: '正在匯出中',
|
|
64
64
|
expSuccess: '匯出成功',
|
|
65
|
+
expError: '导出失败',
|
|
65
66
|
expFilename: '導出_{0}',
|
|
66
67
|
expOriginFilename: '匯出_來源_{0}',
|
|
67
68
|
customTitle: '列設定',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '關閉',
|
|
71
72
|
customCancel: '取消',
|
|
72
73
|
customRestore: '恢復預設',
|
|
73
|
-
maxFixedCol: '最大凍結列的數量不能超過 {0} 個'
|
|
74
|
+
maxFixedCol: '最大凍結列的數量不能超過 {0} 個',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: '請至少選擇一筆記錄!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: '取消',
|
|
122
124
|
cstmConfirm: '確定',
|
|
123
125
|
cstmConfirmRestore: '請確認是否恢復成預設列配置?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移動:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: '排序',
|
|
127
129
|
sortHelpTip: '點擊並拖曳圖示可以調整列的排序',
|
|
@@ -62,6 +62,7 @@ export default {
|
|
|
62
62
|
impSuccess: '成功导入 {0} 条记录',
|
|
63
63
|
expLoading: '正在导出中',
|
|
64
64
|
expSuccess: '导出成功',
|
|
65
|
+
expError: '导出失败',
|
|
65
66
|
expFilename: '导出_{0}',
|
|
66
67
|
expOriginFilename: '导出_源_{0}',
|
|
67
68
|
customTitle: '列设置',
|
|
@@ -70,7 +71,8 @@ export default {
|
|
|
70
71
|
customClose: '关闭',
|
|
71
72
|
customCancel: '取消',
|
|
72
73
|
customRestore: '恢复默认',
|
|
73
|
-
maxFixedCol: '最大冻结列的数量不能超过 {0} 个'
|
|
74
|
+
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
75
|
+
dragTip: '移动:{0}'
|
|
74
76
|
},
|
|
75
77
|
grid: {
|
|
76
78
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -121,7 +123,7 @@ export default {
|
|
|
121
123
|
cstmCancel: '取消',
|
|
122
124
|
cstmConfirm: '确定',
|
|
123
125
|
cstmConfirmRestore: '请确认是否恢复成默认列配置?',
|
|
124
|
-
cstmDragTarget: '
|
|
126
|
+
cstmDragTarget: '移动:{0}',
|
|
125
127
|
setting: {
|
|
126
128
|
colSort: '排序',
|
|
127
129
|
sortHelpTip: '点击并拖动图标可以调整列的排序',
|
|
@@ -261,7 +261,7 @@ export default defineComponent({
|
|
|
261
261
|
addClass(trEl, 'active--drag-origin')
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
const sortMouseupEvent = (evnt:
|
|
264
|
+
const sortMouseupEvent = (evnt: MouseEvent) => {
|
|
265
265
|
const btnEl = evnt.currentTarget as HTMLElement
|
|
266
266
|
const tdEl = btnEl.parentNode as HTMLElement
|
|
267
267
|
const trEl = tdEl.parentNode as HTMLElement
|
|
@@ -16,7 +16,7 @@ hooks.add('tableEditModule', {
|
|
|
16
16
|
setupTable ($xeTable) {
|
|
17
17
|
const { props, reactData, internalData } = $xeTable
|
|
18
18
|
const { refElem } = $xeTable.getRefMaps()
|
|
19
|
-
const { computeMouseOpts, computeEditOpts, computeCheckboxOpts, computeTreeOpts } = $xeTable.getComputeMaps()
|
|
19
|
+
const { computeMouseOpts, computeEditOpts, computeCheckboxOpts, computeTreeOpts, computeValidOpts } = $xeTable.getComputeMaps()
|
|
20
20
|
|
|
21
21
|
let editMethods = {} as TableEditMethods
|
|
22
22
|
let editPrivateMethods = {} as TableEditPrivateMethods
|
|
@@ -528,6 +528,7 @@ hooks.add('tableEditModule', {
|
|
|
528
528
|
const { editStore } = reactData
|
|
529
529
|
const { actived, focused } = editStore
|
|
530
530
|
const { row, column } = actived
|
|
531
|
+
const validOpts = computeValidOpts.value
|
|
531
532
|
if (row || column) {
|
|
532
533
|
syncActivedCell()
|
|
533
534
|
actived.args = null
|
|
@@ -543,9 +544,11 @@ hooks.add('tableEditModule', {
|
|
|
543
544
|
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
544
545
|
}, evnt || null)
|
|
545
546
|
}
|
|
546
|
-
if (
|
|
547
|
-
if (
|
|
548
|
-
|
|
547
|
+
if (validOpts.autoClear) {
|
|
548
|
+
if (validOpts.msgMode !== 'full' || getConfig().cellVaildMode === 'obsolete') {
|
|
549
|
+
if ($xeTable.clearValidate) {
|
|
550
|
+
return $xeTable.clearValidate()
|
|
551
|
+
}
|
|
549
552
|
}
|
|
550
553
|
}
|
|
551
554
|
focused.row = null
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createCommentVNode, defineComponent, h, ref, Ref, PropType, inject, nextTick, ComputedRef, onBeforeUnmount, onMounted, onUnmounted } from 'vue'
|
|
1
|
+
import { createCommentVNode, defineComponent, TransitionGroup, h, ref, Ref, PropType, inject, nextTick, ComputedRef, onBeforeUnmount, onMounted, onUnmounted } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI } from '../../ui'
|
|
4
4
|
import { mergeBodyMethod, getRowid, XEBodyScrollElement } from './util'
|
|
@@ -353,7 +353,7 @@ export default defineComponent({
|
|
|
353
353
|
getPropClass(className, params),
|
|
354
354
|
getPropClass(allCellClassName, params)
|
|
355
355
|
],
|
|
356
|
-
key: columnKey || columnOpts.useKey ? colid : $columnIndex,
|
|
356
|
+
key: columnKey || columnOpts.useKey || rowOpts.useKey ? colid : $columnIndex,
|
|
357
357
|
...attrs,
|
|
358
358
|
style: Object.assign({
|
|
359
359
|
height: cellHeight
|
|
@@ -379,7 +379,7 @@ export default defineComponent({
|
|
|
379
379
|
let rowIndex = $rowIndex
|
|
380
380
|
// 确保任何情况下 rowIndex 都精准指向真实 data 索引
|
|
381
381
|
rowIndex = $xeTable.getRowIndex(row)
|
|
382
|
-
//
|
|
382
|
+
// 当前行事件
|
|
383
383
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
384
384
|
trOn.onMouseenter = (evnt: any) => {
|
|
385
385
|
if (isVMScrollProcess()) {
|
|
@@ -394,6 +394,12 @@ export default defineComponent({
|
|
|
394
394
|
$xeTable.clearHoverRow()
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
+
// 拖拽行事件
|
|
398
|
+
if (rowOpts.drag) {
|
|
399
|
+
trOn.onDragstart = $xeTable.handleRowDragDragstartEvent
|
|
400
|
+
trOn.onDragend = $xeTable.handleRowDragDragendEvent
|
|
401
|
+
trOn.onDragover = $xeTable.handleRowDragDragoverEvent
|
|
402
|
+
}
|
|
397
403
|
const rowid = getRowid($xeTable, row)
|
|
398
404
|
const rest = fullAllDataRowIdData[rowid]
|
|
399
405
|
let rowLevel = 0
|
|
@@ -438,7 +444,7 @@ export default defineComponent({
|
|
|
438
444
|
],
|
|
439
445
|
rowid: rowid,
|
|
440
446
|
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
441
|
-
key:
|
|
447
|
+
key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
442
448
|
...trOn
|
|
443
449
|
}, tableColumn.map((column: any, $columnIndex: any) => {
|
|
444
450
|
return renderColumn(seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
|
|
@@ -700,9 +706,10 @@ export default defineComponent({
|
|
|
700
706
|
const renderVN = () => {
|
|
701
707
|
let { fixedColumn, fixedType, tableColumn } = props
|
|
702
708
|
const { keyboardConfig, showOverflow: allColumnOverflow, spanMethod, mouseConfig } = tableProps
|
|
703
|
-
const { tableData, mergeList, scrollYLoad, isAllOverflow } = tableReactData
|
|
709
|
+
const { tableData, mergeList, scrollYLoad, isAllOverflow, isDragRowMove } = tableReactData
|
|
704
710
|
const { visibleColumn } = tableInternalData
|
|
705
711
|
const { slots } = tableContext
|
|
712
|
+
const rowOpts = computeRowOpts.value
|
|
706
713
|
const sYOpts = computeSYOpts.value
|
|
707
714
|
const emptyOpts = computeEmptyOpts.value
|
|
708
715
|
const keyboardOpts = computeKeyboardOpts.value
|
|
@@ -782,9 +789,16 @@ export default defineComponent({
|
|
|
782
789
|
/**
|
|
783
790
|
* 内容
|
|
784
791
|
*/
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
792
|
+
rowOpts.drag
|
|
793
|
+
? h(TransitionGroup, {
|
|
794
|
+
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
|
|
795
|
+
tag: 'tbody'
|
|
796
|
+
}, {
|
|
797
|
+
default: () => renderRows(fixedType, tableData, tableColumn)
|
|
798
|
+
})
|
|
799
|
+
: h('tbody', {
|
|
800
|
+
ref: refBodyTBody
|
|
801
|
+
}, renderRows(fixedType, tableData, tableColumn))
|
|
788
802
|
]),
|
|
789
803
|
h('div', {
|
|
790
804
|
class: 'vxe-table--checkbox-range'
|
|
@@ -8,7 +8,7 @@ import { getSlotVNs } from '../../ui/src/vn'
|
|
|
8
8
|
|
|
9
9
|
import type { VxeTableConstructor, VxeTableDefines, VxeColumnPropTypes, VxeTablePrivateMethods, VxeComponentSlotType } from '../../../types'
|
|
10
10
|
|
|
11
|
-
const { getI18n, getIcon, renderer, formats } = VxeUI
|
|
11
|
+
const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI
|
|
12
12
|
|
|
13
13
|
function renderTitlePrefixIcon (params: VxeTableDefines.CellRenderHeaderParams) {
|
|
14
14
|
const { $table, column } = params
|
|
@@ -46,6 +46,37 @@ function renderTitleSuffixIcon (params: VxeTableDefines.CellRenderHeaderParams)
|
|
|
46
46
|
: []
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
function renderCellDragIcon (params: VxeTableDefines.CellRenderBodyParams) {
|
|
50
|
+
const { $table } = params
|
|
51
|
+
return h('span', {
|
|
52
|
+
key: 'dg',
|
|
53
|
+
class: 'vxe-cell--drag-handle',
|
|
54
|
+
onMousedown (evnt) {
|
|
55
|
+
$table.handleCellDragMousedownEvent(evnt, params)
|
|
56
|
+
},
|
|
57
|
+
onMouseup: $table.handleCellDragMouseupEvent
|
|
58
|
+
}, [
|
|
59
|
+
h('i', {
|
|
60
|
+
class: 'vxe-table-icon-drag-handle'
|
|
61
|
+
})
|
|
62
|
+
])
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function renderCellBaseVNs (params: VxeTableDefines.CellRenderBodyParams, content: VxeComponentSlotType | VxeComponentSlotType[]) {
|
|
66
|
+
const { $table, column } = params
|
|
67
|
+
const { dragSort } = column
|
|
68
|
+
const vns: VxeComponentSlotType[] = XEUtils.isArray(content) ? content : [content]
|
|
69
|
+
const { computeRowOpts, computeDragOpts } = $table.getComputeMaps()
|
|
70
|
+
const rowOpts = computeRowOpts.value
|
|
71
|
+
const dragOpts = computeDragOpts.value
|
|
72
|
+
if (dragSort && rowOpts.drag && dragOpts.showIcon) {
|
|
73
|
+
vns.unshift(
|
|
74
|
+
renderCellDragIcon(params)
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
return vns
|
|
78
|
+
}
|
|
79
|
+
|
|
49
80
|
function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams, content: VxeComponentSlotType | VxeComponentSlotType[]) {
|
|
50
81
|
const { $table, column } = params
|
|
51
82
|
const { props, reactData } = $table
|
|
@@ -250,7 +281,7 @@ export const Cell = {
|
|
|
250
281
|
const renderOpts = editRender || cellRender
|
|
251
282
|
const defaultSlot = slots ? slots.default : null
|
|
252
283
|
if (defaultSlot) {
|
|
253
|
-
return $table.callSlot(defaultSlot, params)
|
|
284
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params))
|
|
254
285
|
}
|
|
255
286
|
if (renderOpts) {
|
|
256
287
|
const compConf = renderer.get(renderOpts.name)
|
|
@@ -259,13 +290,13 @@ export const Cell = {
|
|
|
259
290
|
const rtDefault = compConf.renderTableDefault || compConf.renderDefault
|
|
260
291
|
const renderFn = editRender ? rtCell : rtDefault
|
|
261
292
|
if (renderFn) {
|
|
262
|
-
return getSlotVNs(renderFn(renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params)))
|
|
293
|
+
return renderCellBaseVNs(params, getSlotVNs(renderFn(renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))))
|
|
263
294
|
}
|
|
264
295
|
}
|
|
265
296
|
}
|
|
266
297
|
const cellValue = $table.getCellLabel(row, column)
|
|
267
298
|
const cellPlaceholder = editRender ? editRender.placeholder : ''
|
|
268
|
-
return [
|
|
299
|
+
return renderCellBaseVNs(params, [
|
|
269
300
|
h('span', {
|
|
270
301
|
class: 'vxe-cell--label'
|
|
271
302
|
}, [
|
|
@@ -277,7 +308,7 @@ export const Cell = {
|
|
|
277
308
|
: h('span', formatText(cellValue, 1))
|
|
278
309
|
]
|
|
279
310
|
)
|
|
280
|
-
]
|
|
311
|
+
])
|
|
281
312
|
},
|
|
282
313
|
renderTreeCell (params: VxeTableDefines.CellRenderBodyParams) {
|
|
283
314
|
return Cell.renderTreeIcon(params, Cell.renderDefaultCell(params) as VNode[])
|
|
@@ -377,11 +408,13 @@ export const Cell = {
|
|
|
377
408
|
const { slots } = column
|
|
378
409
|
const defaultSlot = slots ? slots.default : null
|
|
379
410
|
if (defaultSlot) {
|
|
380
|
-
return $table.callSlot(defaultSlot, params)
|
|
411
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params))
|
|
381
412
|
}
|
|
382
413
|
const { seq } = params
|
|
383
414
|
const seqMethod = seqOpts.seqMethod
|
|
384
|
-
return
|
|
415
|
+
return renderCellBaseVNs(params, [
|
|
416
|
+
h('span', `${formatText(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + (seq as number), 1)}`)
|
|
417
|
+
])
|
|
385
418
|
},
|
|
386
419
|
renderTreeIndexCell (params: VxeTableDefines.CellRenderBodyParams) {
|
|
387
420
|
return Cell.renderTreeIcon(params, Cell.renderSeqCell(params) as VNode[])
|
|
@@ -432,7 +465,7 @@ export const Cell = {
|
|
|
432
465
|
}
|
|
433
466
|
const radioParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible }
|
|
434
467
|
if (radioSlot) {
|
|
435
|
-
return $table.callSlot(radioSlot, radioParams)
|
|
468
|
+
return renderCellBaseVNs(params, $table.callSlot(radioSlot, radioParams))
|
|
436
469
|
}
|
|
437
470
|
const radioVNs: VNode[] = []
|
|
438
471
|
if (isVisible) {
|
|
@@ -449,7 +482,7 @@ export const Cell = {
|
|
|
449
482
|
}, defaultSlot ? $table.callSlot(defaultSlot, radioParams) : XEUtils.get(row, labelField as string))
|
|
450
483
|
)
|
|
451
484
|
}
|
|
452
|
-
return [
|
|
485
|
+
return renderCellBaseVNs(params, [
|
|
453
486
|
h('span', {
|
|
454
487
|
class: ['vxe-cell--radio', {
|
|
455
488
|
'is--checked': isChecked,
|
|
@@ -457,7 +490,7 @@ export const Cell = {
|
|
|
457
490
|
}],
|
|
458
491
|
...ons
|
|
459
492
|
}, radioVNs)
|
|
460
|
-
]
|
|
493
|
+
])
|
|
461
494
|
},
|
|
462
495
|
renderTreeRadioCell (params: VxeTableDefines.CellRenderBodyParams) {
|
|
463
496
|
return Cell.renderTreeIcon(params, Cell.renderRadioCell(params))
|
|
@@ -555,7 +588,7 @@ export const Cell = {
|
|
|
555
588
|
}
|
|
556
589
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
|
|
557
590
|
if (checkboxSlot) {
|
|
558
|
-
return $table.callSlot(checkboxSlot, checkboxParams)
|
|
591
|
+
return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams))
|
|
559
592
|
}
|
|
560
593
|
const checkVNs: VNode[] = []
|
|
561
594
|
if (isVisible) {
|
|
@@ -572,7 +605,7 @@ export const Cell = {
|
|
|
572
605
|
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField as string))
|
|
573
606
|
)
|
|
574
607
|
}
|
|
575
|
-
return [
|
|
608
|
+
return renderCellBaseVNs(params, [
|
|
576
609
|
h('span', {
|
|
577
610
|
class: ['vxe-cell--checkbox', {
|
|
578
611
|
'is--checked': isChecked,
|
|
@@ -582,7 +615,7 @@ export const Cell = {
|
|
|
582
615
|
}],
|
|
583
616
|
...ons
|
|
584
617
|
}, checkVNs)
|
|
585
|
-
]
|
|
618
|
+
])
|
|
586
619
|
},
|
|
587
620
|
renderTreeSelectionCell (params: VxeTableDefines.CellRenderBodyParams) {
|
|
588
621
|
return Cell.renderTreeIcon(params, Cell.renderCheckboxCell(params))
|
|
@@ -623,7 +656,7 @@ export const Cell = {
|
|
|
623
656
|
}
|
|
624
657
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate }
|
|
625
658
|
if (checkboxSlot) {
|
|
626
|
-
return $table.callSlot(checkboxSlot, checkboxParams)
|
|
659
|
+
return renderCellBaseVNs(params, $table.callSlot(checkboxSlot, checkboxParams))
|
|
627
660
|
}
|
|
628
661
|
const checkVNs: VNode[] = []
|
|
629
662
|
if (isVisible) {
|
|
@@ -640,7 +673,7 @@ export const Cell = {
|
|
|
640
673
|
)
|
|
641
674
|
}
|
|
642
675
|
}
|
|
643
|
-
return [
|
|
676
|
+
return renderCellBaseVNs(params, [
|
|
644
677
|
h('span', {
|
|
645
678
|
class: ['vxe-cell--checkbox', {
|
|
646
679
|
'is--checked': isChecked,
|
|
@@ -650,7 +683,7 @@ export const Cell = {
|
|
|
650
683
|
}],
|
|
651
684
|
...ons
|
|
652
685
|
}, checkVNs)
|
|
653
|
-
]
|
|
686
|
+
])
|
|
654
687
|
},
|
|
655
688
|
renderTreeSelectionCellByProp (params: VxeTableDefines.CellRenderBodyParams) {
|
|
656
689
|
return Cell.renderTreeIcon(params, Cell.renderCheckboxCellByProp(params))
|
|
@@ -672,7 +705,7 @@ export const Cell = {
|
|
|
672
705
|
let isAceived = false
|
|
673
706
|
let isLazyLoading = false
|
|
674
707
|
if (iconSlot) {
|
|
675
|
-
return $table.callSlot(iconSlot, params)
|
|
708
|
+
return renderCellBaseVNs(params, $table.callSlot(iconSlot, params))
|
|
676
709
|
}
|
|
677
710
|
if (!isHidden) {
|
|
678
711
|
const rowid = getRowid($table, row)
|
|
@@ -681,7 +714,7 @@ export const Cell = {
|
|
|
681
714
|
isLazyLoading = !!rowExpandLazyLoadedMaps[rowid]
|
|
682
715
|
}
|
|
683
716
|
}
|
|
684
|
-
return [
|
|
717
|
+
return renderCellBaseVNs(params, [
|
|
685
718
|
showIcon && (!visibleMethod || visibleMethod(params))
|
|
686
719
|
? h('span', {
|
|
687
720
|
class: ['vxe-table--expanded', {
|
|
@@ -695,13 +728,13 @@ export const Cell = {
|
|
|
695
728
|
class: ['vxe-table--expand-btn', isLazyLoading ? (iconLoaded || getIcon().TABLE_EXPAND_LOADED) : (isAceived ? (iconOpen || getIcon().TABLE_EXPAND_OPEN) : (iconClose || getIcon().TABLE_EXPAND_CLOSE))]
|
|
696
729
|
})
|
|
697
730
|
])
|
|
698
|
-
:
|
|
731
|
+
: renderEmptyElement($table),
|
|
699
732
|
defaultSlot || labelField
|
|
700
733
|
? h('span', {
|
|
701
734
|
class: 'vxe-table--expand-label'
|
|
702
735
|
}, defaultSlot ? $table.callSlot(defaultSlot, params) : XEUtils.get(row, labelField as string))
|
|
703
|
-
:
|
|
704
|
-
]
|
|
736
|
+
: renderEmptyElement($table)
|
|
737
|
+
])
|
|
705
738
|
},
|
|
706
739
|
renderExpandData (params: VxeTableDefines.CellRenderDataParams) {
|
|
707
740
|
const { $table, column } = params
|
|
@@ -730,14 +763,14 @@ export const Cell = {
|
|
|
730
763
|
const { slots } = column
|
|
731
764
|
const defaultSlot = slots ? slots.default : null
|
|
732
765
|
if (defaultSlot) {
|
|
733
|
-
return $table.callSlot(defaultSlot, params)
|
|
766
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params))
|
|
734
767
|
}
|
|
735
|
-
return [
|
|
768
|
+
return renderCellBaseVNs(params, [
|
|
736
769
|
h('span', {
|
|
737
770
|
class: 'vxe-cell--html',
|
|
738
771
|
innerHTML: getDefaultCellLabel(params)
|
|
739
772
|
})
|
|
740
|
-
]
|
|
773
|
+
])
|
|
741
774
|
},
|
|
742
775
|
renderTreeHTMLCell (params: VxeTableDefines.CellRenderBodyParams) {
|
|
743
776
|
return Cell.renderTreeIcon(params, Cell.renderHTMLCell(params) as VNode[])
|
|
@@ -81,8 +81,10 @@ export const columnProps = {
|
|
|
81
81
|
filterRecoverMethod: Function as PropType<VxeColumnPropTypes.FilterRecoverMethod>,
|
|
82
82
|
// 筛选模板配置项
|
|
83
83
|
filterRender: Object as PropType<VxeColumnPropTypes.FilterRender>,
|
|
84
|
-
//
|
|
84
|
+
// 设置为树节点
|
|
85
85
|
treeNode: Boolean as PropType<VxeColumnPropTypes.TreeNode>,
|
|
86
|
+
// 指定为树节点
|
|
87
|
+
dragSort: Boolean as PropType<VxeColumnPropTypes.DragSort>,
|
|
86
88
|
// 是否可视
|
|
87
89
|
visible: {
|
|
88
90
|
type: Boolean as PropType<VxeColumnPropTypes.Visible>,
|
|
@@ -187,6 +187,8 @@ export default {
|
|
|
187
187
|
cellConfig: Object as PropType<VxeTablePropTypes.CellConfig>,
|
|
188
188
|
// 行配置信息
|
|
189
189
|
rowConfig: Object as PropType<VxeTablePropTypes.RowConfig>,
|
|
190
|
+
// 可拖拽配置项
|
|
191
|
+
dragConfig: Object as PropType<VxeTablePropTypes.DragConfig>,
|
|
190
192
|
// 列调整配置项
|
|
191
193
|
resizableConfig: Object as PropType<VxeTablePropTypes.ResizableConfig>,
|
|
192
194
|
// 序号配置项
|