vxe-table 3.9.0-rc.9 → 3.9.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/README.md +80 -9
- package/es/grid/src/grid.js +116 -62
- package/es/grid/style.css +0 -1
- package/es/grid/style.min.css +1 -1
- package/es/index.esm.js +22 -3
- package/es/locale/lang/en-US.js +6 -2
- package/es/locale/lang/es-ES.js +5 -1
- package/es/locale/lang/hu-HU.js +5 -1
- package/es/locale/lang/ja-JP.js +5 -1
- package/es/locale/lang/ko-KR.js +5 -1
- package/es/locale/lang/pt-BR.js +5 -1
- package/es/locale/lang/ru-RU.js +5 -1
- package/es/locale/lang/uk-UA.js +5 -1
- package/es/locale/lang/vi-VN.js +5 -1
- package/es/locale/lang/zh-CHT.js +5 -1
- package/es/locale/lang/zh-CN.js +5 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +183 -173
- package/es/table/module/edit/mixin.js +35 -40
- package/es/table/module/export/export-panel.js +32 -4
- package/es/table/module/export/import-panel.js +25 -6
- package/es/table/module/export/mixin.js +11 -11
- package/es/table/module/menu/mixin.js +2 -2
- package/es/table/module/validator/mixin.js +4 -4
- package/es/table/render/index.js +17 -11
- package/es/table/src/body.js +1 -0
- package/es/table/src/columnInfo.js +3 -3
- package/es/table/src/methods.js +69 -55
- package/es/table/src/props.js +65 -15
- package/es/table/src/table.js +63 -29
- package/es/table/src/util.js +3 -2
- package/es/table/style.css +37 -48
- package/es/table/style.min.css +1 -1
- package/es/toolbar/src/toolbar.js +21 -7
- package/es/toolbar/style.css +0 -1
- package/es/toolbar/style.min.css +1 -1
- package/es/ui/index.js +5 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-grid/style.css +0 -1
- package/es/vxe-grid/style.min.css +1 -1
- package/es/vxe-table/style.css +37 -48
- package/es/vxe-table/style.min.css +1 -1
- package/es/vxe-toolbar/style.css +0 -1
- package/es/vxe-toolbar/style.min.css +1 -1
- package/lib/colgroup/index.js +3 -3
- package/lib/colgroup/index.min.js +1 -1
- package/lib/column/index.js +3 -3
- package/lib/column/index.min.js +1 -1
- package/lib/components.js +9 -11
- package/lib/components.min.js +1 -1
- package/lib/grid/index.js +3 -3
- package/lib/grid/index.min.js +1 -1
- package/lib/grid/src/grid.js +577 -487
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +0 -1
- package/lib/grid/style/style.min.css +1 -1
- package/lib/index.common.js +3 -4
- package/lib/index.umd.js +9148 -17246
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +6 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +6 -2
- package/lib/locale/lang/es-ES.js +5 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +5 -1
- package/lib/locale/lang/hu-HU.js +5 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +5 -1
- package/lib/locale/lang/ja-JP.js +5 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +5 -1
- package/lib/locale/lang/ko-KR.js +5 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +5 -1
- package/lib/locale/lang/pt-BR.js +5 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +5 -1
- package/lib/locale/lang/ru-RU.js +5 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +5 -1
- package/lib/locale/lang/uk-UA.js +5 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +5 -1
- package/lib/locale/lang/vi-VN.js +5 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +5 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +5 -1
- package/lib/locale/lang/zh-CN.js +5 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +5 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/index.js +4 -4
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/mixin.js +53 -44
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +310 -239
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +434 -383
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +136 -106
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +75 -54
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +592 -597
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/export/util.js +6 -4
- package/lib/table/module/export/util.min.js +1 -1
- package/lib/table/module/filter/mixin.js +147 -118
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +86 -65
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +163 -151
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +125 -114
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +36 -34
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +225 -214
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +401 -297
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +411 -349
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +470 -344
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +10 -10
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +46 -55
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +157 -132
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +1 -1
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +170 -153
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +2770 -2491
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +33 -74
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +436 -395
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +143 -131
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +37 -48
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/index.js +3 -3
- package/lib/toolbar/index.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +332 -284
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/toolbar/style/style.css +0 -1
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/ui/index.js +50 -41
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/comp.js +2 -3
- package/lib/ui/src/comp.min.js +1 -1
- package/lib/ui/src/dom.js +29 -28
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +6 -4
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +7 -7
- package/lib/v-x-e-table/index.js +3 -4
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/vxe-colgroup/index.js +3 -4
- package/lib/vxe-colgroup/index.min.js +1 -1
- package/lib/vxe-column/index.js +3 -4
- package/lib/vxe-column/index.min.js +1 -1
- package/lib/vxe-grid/index.js +3 -4
- package/lib/vxe-grid/index.min.js +1 -1
- package/lib/vxe-grid/style/style.css +0 -1
- package/lib/vxe-grid/style/style.min.css +1 -1
- package/lib/vxe-table/index.js +3 -4
- package/lib/vxe-table/index.min.js +1 -1
- package/lib/vxe-table/style/style.css +37 -48
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-toolbar/index.js +3 -4
- package/lib/vxe-toolbar/index.min.js +1 -1
- package/lib/vxe-toolbar/style/style.css +0 -1
- package/lib/vxe-toolbar/style/style.min.css +1 -1
- package/lib/vxe-ui/index.js +3 -4
- package/lib/vxe-ui/index.min.js +1 -1
- package/lib/vxe-v-x-e-table/index.js +3 -4
- package/lib/vxe-v-x-e-table/index.min.js +1 -1
- package/package.json +5 -4
- package/packages/grid/src/grid.ts +123 -61
- package/packages/locale/lang/en-US.ts +6 -2
- package/packages/locale/lang/es-ES.ts +5 -1
- package/packages/locale/lang/hu-HU.ts +5 -1
- package/packages/locale/lang/ja-JP.ts +5 -1
- package/packages/locale/lang/ko-KR.ts +5 -1
- package/packages/locale/lang/pt-BR.ts +5 -1
- package/packages/locale/lang/ru-RU.ts +5 -1
- package/packages/locale/lang/uk-UA.ts +5 -1
- package/packages/locale/lang/vi-VN.ts +5 -1
- package/packages/locale/lang/zh-CHT.ts +5 -1
- package/packages/locale/lang/zh-CN.ts +5 -1
- package/packages/table/module/custom/panel.ts +186 -175
- package/packages/table/module/edit/mixin.ts +34 -39
- package/packages/table/module/export/export-panel.ts +36 -4
- package/packages/table/module/export/import-panel.ts +29 -6
- package/packages/table/module/export/mixin.ts +11 -11
- package/packages/table/module/menu/mixin.ts +2 -2
- package/packages/table/module/validator/mixin.ts +4 -4
- package/packages/table/render/index.ts +20 -11
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/columnInfo.ts +3 -3
- package/packages/table/src/methods.ts +70 -55
- package/packages/table/src/props.ts +68 -15
- package/packages/table/src/table.ts +71 -26
- package/packages/table/src/util.ts +3 -2
- package/packages/toolbar/src/toolbar.ts +21 -7
- package/packages/ui/index.ts +3 -1
- package/styles/components/table.scss +82 -17
- package/types/all.d.ts +1 -0
- /package/es/{iconfont.1726453742001.ttf → iconfont.1728483486168.ttf} +0 -0
- /package/es/{iconfont.1726453742001.woff → iconfont.1728483486168.woff} +0 -0
- /package/es/{iconfont.1726453742001.woff2 → iconfont.1728483486168.woff2} +0 -0
- /package/lib/{iconfont.1726453742001.ttf → iconfont.1728483486168.ttf} +0 -0
- /package/lib/{iconfont.1726453742001.woff → iconfont.1728483486168.woff} +0 -0
- /package/lib/{iconfont.1726453742001.woff2 → iconfont.1728483486168.woff2} +0 -0
|
@@ -2,12 +2,17 @@ import { CreateElement } from 'vue'
|
|
|
2
2
|
import { VxeUI } from '../../../ui'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { parseFile } from '../../../ui/src/utils'
|
|
5
|
-
|
|
5
|
+
import { errLog } from '../../../ui/src/log'
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import type { VxeModalComponent, VxeSelectComponent, VxeButtonComponent } from 'vxe-pc-ui'
|
|
8
|
+
|
|
9
|
+
const { getI18n, getIcon, globalMixins } = VxeUI
|
|
8
10
|
|
|
9
11
|
export default {
|
|
10
12
|
name: 'VxeTableImportPanel',
|
|
13
|
+
mixins: [
|
|
14
|
+
globalMixins.sizeMixin
|
|
15
|
+
],
|
|
11
16
|
props: {
|
|
12
17
|
defaultOptions: Object,
|
|
13
18
|
storeData: Object
|
|
@@ -22,9 +27,6 @@ export default {
|
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
computed: {
|
|
25
|
-
vSize () {
|
|
26
|
-
return this.size || this.$parent.size || this.$parent.vSize
|
|
27
|
-
},
|
|
28
30
|
selectName () {
|
|
29
31
|
return `${this.storeData.filename}.${this.storeData.type}`
|
|
30
32
|
},
|
|
@@ -41,6 +43,27 @@ export default {
|
|
|
41
43
|
return `*.${typeList.map((item: any) => item.value).join(', *.')}`
|
|
42
44
|
}
|
|
43
45
|
} as any,
|
|
46
|
+
created (this: any) {
|
|
47
|
+
const $xeTableImportPanel = this
|
|
48
|
+
|
|
49
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
50
|
+
const VxeUIModalComponent = VxeUI.getComponent<VxeModalComponent>('VxeModal')
|
|
51
|
+
const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
|
|
52
|
+
const VxeUISelectComponent = VxeUI.getComponent<VxeSelectComponent>('VxeSelect')
|
|
53
|
+
|
|
54
|
+
$xeTableImportPanel.$nextTick(() => {
|
|
55
|
+
if (!VxeUIModalComponent) {
|
|
56
|
+
errLog('vxe.error.reqComp', ['vxe-modal'])
|
|
57
|
+
}
|
|
58
|
+
if (!VxeUIButtonComponent) {
|
|
59
|
+
errLog('vxe.error.reqComp', ['vxe-button'])
|
|
60
|
+
}
|
|
61
|
+
if (!VxeUISelectComponent) {
|
|
62
|
+
errLog('vxe.error.reqComp', ['vxe-select'])
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
},
|
|
44
67
|
render (this: any, h: CreateElement) {
|
|
45
68
|
const { hasFile, parseTypeLabel, defaultOptions, storeData, selectName } = this
|
|
46
69
|
return h('vxe-modal', {
|
|
@@ -48,7 +71,7 @@ export default {
|
|
|
48
71
|
props: {
|
|
49
72
|
value: storeData.visible,
|
|
50
73
|
title: getI18n('vxe.import.impTitle'),
|
|
51
|
-
width:
|
|
74
|
+
width: 540,
|
|
52
75
|
mask: true,
|
|
53
76
|
lockView: true,
|
|
54
77
|
showFooter: false,
|
|
@@ -584,7 +584,7 @@ function downloadFile ($xetable: any, opts: any, content: any) {
|
|
|
584
584
|
saveLocalFile({ filename, type, content }).then(() => {
|
|
585
585
|
if (opts.message !== false) {
|
|
586
586
|
// 检测弹窗模块
|
|
587
|
-
if (process.env.
|
|
587
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
588
588
|
if (!VxeUI.modal) {
|
|
589
589
|
errLog('vxe.error.reqModule', ['Modal'])
|
|
590
590
|
}
|
|
@@ -813,7 +813,7 @@ function handleImport ($xetable: any, content: any, opts: any) {
|
|
|
813
813
|
}
|
|
814
814
|
if (opts.message !== false) {
|
|
815
815
|
// 检测弹窗模块
|
|
816
|
-
if (process.env.
|
|
816
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
817
817
|
if (!VxeUI.modal) {
|
|
818
818
|
errLog('vxe.error.reqModule', ['Modal'])
|
|
819
819
|
}
|
|
@@ -828,7 +828,7 @@ function handleImport ($xetable: any, content: any, opts: any) {
|
|
|
828
828
|
})
|
|
829
829
|
} else if (opts.message !== false) {
|
|
830
830
|
// 检测弹窗模块
|
|
831
|
-
if (process.env.
|
|
831
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
832
832
|
if (!VxeUI.modal) {
|
|
833
833
|
errLog('vxe.error.reqModule', ['Modal'])
|
|
834
834
|
}
|
|
@@ -849,7 +849,7 @@ function handleFileImport ($xetable: any, file: any, opts: any) {
|
|
|
849
849
|
if (!importMethod && !XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)) {
|
|
850
850
|
if (opts.message !== false) {
|
|
851
851
|
// 检测弹窗模块
|
|
852
|
-
if (process.env.
|
|
852
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
853
853
|
if (!VxeUI.modal) {
|
|
854
854
|
errLog('vxe.error.reqModule', ['Modal'])
|
|
855
855
|
}
|
|
@@ -900,7 +900,7 @@ function handleFileImport ($xetable: any, file: any, opts: any) {
|
|
|
900
900
|
}
|
|
901
901
|
} else {
|
|
902
902
|
// 不支持的浏览器
|
|
903
|
-
if (process.env.
|
|
903
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
904
904
|
errLog('vxe.error.notExp')
|
|
905
905
|
}
|
|
906
906
|
_importResolve({ status: true })
|
|
@@ -957,7 +957,7 @@ export function readLocalFile (options: any = {}) {
|
|
|
957
957
|
} else {
|
|
958
958
|
if (options.message !== false) {
|
|
959
959
|
// 检测弹窗模块
|
|
960
|
-
if (process.env.
|
|
960
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
961
961
|
if (!VxeUI.modal) {
|
|
962
962
|
errLog('vxe.error.reqModule', ['Modal'])
|
|
963
963
|
}
|
|
@@ -1277,7 +1277,7 @@ export default {
|
|
|
1277
1277
|
|
|
1278
1278
|
// 检查类型,如果为自定义导出,则不需要校验类型
|
|
1279
1279
|
if (!opts.exportMethod && !XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)) {
|
|
1280
|
-
if (process.env.
|
|
1280
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1281
1281
|
errLog('vxe.error.notType', [type])
|
|
1282
1282
|
}
|
|
1283
1283
|
const params = { status: false }
|
|
@@ -1300,7 +1300,7 @@ export default {
|
|
|
1300
1300
|
opts.data = selectRecords
|
|
1301
1301
|
}
|
|
1302
1302
|
} else if (mode === 'all') {
|
|
1303
|
-
if (process.env.
|
|
1303
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1304
1304
|
if (!$xegrid) {
|
|
1305
1305
|
warnLog('vxe.error.errProp', ['all', 'mode=current,selected'])
|
|
1306
1306
|
}
|
|
@@ -1312,7 +1312,7 @@ export default {
|
|
|
1312
1312
|
const queryAllSuccessMethods = ajax.queryAllSuccess
|
|
1313
1313
|
const queryAllErrorMethods = ajax.queryAllError
|
|
1314
1314
|
|
|
1315
|
-
if (process.env.
|
|
1315
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1316
1316
|
if (!ajaxMethods) {
|
|
1317
1317
|
warnLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll'])
|
|
1318
1318
|
}
|
|
@@ -1484,7 +1484,7 @@ export default {
|
|
|
1484
1484
|
},
|
|
1485
1485
|
_openExport (options: any) {
|
|
1486
1486
|
const { exportOpts } = this
|
|
1487
|
-
if (process.env.
|
|
1487
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1488
1488
|
if (!this.exportConfig) {
|
|
1489
1489
|
errLog('vxe.error.reqProp', ['export-config'])
|
|
1490
1490
|
}
|
|
@@ -1493,7 +1493,7 @@ export default {
|
|
|
1493
1493
|
},
|
|
1494
1494
|
_openPrint (options: any) {
|
|
1495
1495
|
const { printOpts } = this
|
|
1496
|
-
if (process.env.
|
|
1496
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1497
1497
|
if (!this.printConfig) {
|
|
1498
1498
|
errLog('vxe.error.reqProp', ['print-config'])
|
|
1499
1499
|
}
|
|
@@ -107,7 +107,7 @@ export default {
|
|
|
107
107
|
this.handleOpenMenuEvent(evnt, layout, params)
|
|
108
108
|
// 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
|
|
109
109
|
if (this.$listeners[`${typePrefix}cell-context-menu`]) {
|
|
110
|
-
if (process.env.
|
|
110
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
111
111
|
warnLog('vxe.error.delEvent', [`${typePrefix}cell-context-menu`, `${typePrefix}cell-menu`])
|
|
112
112
|
}
|
|
113
113
|
this.emitEvent(`${typePrefix}cell-context-menu`, params, evnt)
|
|
@@ -258,7 +258,7 @@ export default {
|
|
|
258
258
|
}
|
|
259
259
|
// 在 v4 中废弃事件 context-menu-click
|
|
260
260
|
if (this.$listeners['context-menu-click']) {
|
|
261
|
-
if (process.env.
|
|
261
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
262
262
|
warnLog('vxe.error.delEvent', ['context-menu-click', 'menu-click'])
|
|
263
263
|
}
|
|
264
264
|
this.emitEvent('context-menu-click', params, evnt)
|
|
@@ -68,7 +68,7 @@ export default {
|
|
|
68
68
|
* 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
|
|
69
69
|
*/
|
|
70
70
|
_fullValidate (rows: any, cb: any) {
|
|
71
|
-
if (process.env.
|
|
71
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
72
72
|
if (XEUtils.isFunction(cb)) {
|
|
73
73
|
warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)'])
|
|
74
74
|
}
|
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
* 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
|
|
80
80
|
*/
|
|
81
81
|
_validate (rows: any, cb: any) {
|
|
82
|
-
if (process.env.
|
|
82
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
83
83
|
if (XEUtils.isFunction(cb)) {
|
|
84
84
|
warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)'])
|
|
85
85
|
}
|
|
@@ -308,12 +308,12 @@ export default {
|
|
|
308
308
|
if (gvItem.cellValidatorMethod) {
|
|
309
309
|
customValid = gvItem.cellValidatorMethod(validParams)
|
|
310
310
|
} else {
|
|
311
|
-
if (process.env.
|
|
311
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
312
312
|
warnLog('vxe.error.notValidators', [validator])
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
} else {
|
|
316
|
-
if (process.env.
|
|
316
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
317
317
|
errLog('vxe.error.notValidators', [validator])
|
|
318
318
|
}
|
|
319
319
|
}
|
|
@@ -24,7 +24,7 @@ function getFormatDate (value: any, props: any, defaultFormat: string) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function getLabelFormatDate (value: any, props: any) {
|
|
27
|
-
return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type}`))
|
|
27
|
+
return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type || 'date'}`))
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -640,15 +640,7 @@ renderer.mixin({
|
|
|
640
640
|
const { row, column } = params
|
|
641
641
|
let cellValue = XEUtils.get(row, column.field)
|
|
642
642
|
if (cellValue) {
|
|
643
|
-
|
|
644
|
-
case 'date':
|
|
645
|
-
case 'week':
|
|
646
|
-
case 'month':
|
|
647
|
-
case 'quarter':
|
|
648
|
-
case 'year':
|
|
649
|
-
cellValue = getLabelFormatDate(cellValue, props)
|
|
650
|
-
break
|
|
651
|
-
}
|
|
643
|
+
cellValue = getLabelFormatDate(cellValue, props)
|
|
652
644
|
}
|
|
653
645
|
return getCellLabelVNs(h, renderOpts, params, cellValue)
|
|
654
646
|
},
|
|
@@ -657,7 +649,8 @@ renderer.mixin({
|
|
|
657
649
|
tableFilterDefaultMethod: handleFilterMethod
|
|
658
650
|
},
|
|
659
651
|
VxeTextarea: {
|
|
660
|
-
tableAutoFocus: '
|
|
652
|
+
tableAutoFocus: 'textarea',
|
|
653
|
+
renderTableEdit: defaultEditRender
|
|
661
654
|
},
|
|
662
655
|
VxeButton: {
|
|
663
656
|
renderTableDefault: buttonCellRender
|
|
@@ -765,6 +758,22 @@ renderer.mixin({
|
|
|
765
758
|
]
|
|
766
759
|
}
|
|
767
760
|
},
|
|
761
|
+
VxeTextEllipsis: {
|
|
762
|
+
renderTableDefault (h, renderOpts, params) {
|
|
763
|
+
const { row, column } = params
|
|
764
|
+
const { props } = renderOpts
|
|
765
|
+
const cellValue = getCellValue(row, column)
|
|
766
|
+
return [
|
|
767
|
+
h(getDefaultComponent(renderOpts), {
|
|
768
|
+
props: {
|
|
769
|
+
...props,
|
|
770
|
+
content: cellValue
|
|
771
|
+
},
|
|
772
|
+
on: getEditOns(renderOpts, params)
|
|
773
|
+
})
|
|
774
|
+
]
|
|
775
|
+
}
|
|
776
|
+
},
|
|
768
777
|
|
|
769
778
|
// 以下已废弃
|
|
770
779
|
$input: {
|
|
@@ -280,6 +280,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi
|
|
|
280
280
|
'col--tree-node': treeNode,
|
|
281
281
|
'col--edit': isEdit,
|
|
282
282
|
'col--ellipsis': hasEllipsis,
|
|
283
|
+
'col--height': !!rowOpts.height,
|
|
283
284
|
'fixed--hidden': fixedHiddenColumn,
|
|
284
285
|
'col--dirty': isDirty,
|
|
285
286
|
'col--active': editConfig && isEdit && (actived.row === row && (actived.column === column || editOpts.mode === 'row')),
|
|
@@ -14,7 +14,7 @@ export class ColumnInfo {
|
|
|
14
14
|
const formatter = _vm.formatter
|
|
15
15
|
const visible = XEUtils.isBoolean(_vm.visible) ? _vm.visible : true
|
|
16
16
|
|
|
17
|
-
if (process.env.
|
|
17
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
18
18
|
const types = ['seq', 'checkbox', 'radio', 'expand', 'html']
|
|
19
19
|
if (_vm.type && types.indexOf(_vm.type) === -1) {
|
|
20
20
|
warnLog('vxe.error.errProp', [`type=${_vm.type}`, types.join(', ')])
|
|
@@ -42,12 +42,12 @@ export class ColumnInfo {
|
|
|
42
42
|
if (formatter) {
|
|
43
43
|
if (XEUtils.isString(formatter)) {
|
|
44
44
|
const gFormatOpts = formats.get(formatter) || XEUtils[formatter]
|
|
45
|
-
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.cellFormatMethod)) {
|
|
45
|
+
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
46
46
|
errLog('vxe.error.notFormats', [formatter])
|
|
47
47
|
}
|
|
48
48
|
} else if (XEUtils.isArray(formatter)) {
|
|
49
49
|
const gFormatOpts = formats.get(formatter[0]) || XEUtils[formatter[0]]
|
|
50
|
-
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.cellFormatMethod)) {
|
|
50
|
+
if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
|
|
51
51
|
errLog('vxe.error.notFormats', [formatter[0]])
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -7,6 +7,8 @@ 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 } from '../../../types'
|
|
11
|
+
|
|
10
12
|
const { getConfig, getI18n, renderer, formats, interceptor } = VxeUI
|
|
11
13
|
|
|
12
14
|
const isWebkit = browse['-webkit'] && !browse.edge
|
|
@@ -101,15 +103,16 @@ function computeVirtualX (_vm: any) {
|
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
|
-
return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(
|
|
106
|
+
return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(6, visibleSize) }
|
|
105
107
|
}
|
|
106
|
-
return { toVisibleIndex: 0, visibleSize:
|
|
108
|
+
return { toVisibleIndex: 0, visibleSize: 6 }
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
function computeVirtualY (_vm: any) {
|
|
110
|
-
const { $refs,
|
|
112
|
+
const { $refs, computeSize, rowHeightMaps } = _vm
|
|
111
113
|
const { tableHeader, tableBody } = $refs
|
|
112
114
|
const tableBodyElem = tableBody ? tableBody.$el : null
|
|
115
|
+
const vSize = computeSize
|
|
113
116
|
if (tableBodyElem) {
|
|
114
117
|
const tableHeaderElem = tableHeader ? tableHeader.$el : null
|
|
115
118
|
let rowHeight = 0
|
|
@@ -395,7 +398,7 @@ const Methods = {
|
|
|
395
398
|
if (treeConfig) {
|
|
396
399
|
// 树结构自动转换
|
|
397
400
|
if (treeOpts.transform) {
|
|
398
|
-
if (process.env.
|
|
401
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
399
402
|
if (!treeOpts.rowField) {
|
|
400
403
|
errLog('vxe.error.reqProp', ['table.tree-config.rowField'])
|
|
401
404
|
}
|
|
@@ -449,7 +452,7 @@ const Methods = {
|
|
|
449
452
|
if (keepSource) {
|
|
450
453
|
this.cacheSourceMap(fullData)
|
|
451
454
|
}
|
|
452
|
-
if (process.env.
|
|
455
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
453
456
|
if (sYLoad) {
|
|
454
457
|
if (!(this.height || this.maxHeight)) {
|
|
455
458
|
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}'])
|
|
@@ -580,7 +583,7 @@ const Methods = {
|
|
|
580
583
|
}
|
|
581
584
|
this.tableData = tableData.slice(0)
|
|
582
585
|
} else {
|
|
583
|
-
if (process.env.
|
|
586
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
584
587
|
warnLog('vxe.error.reqProp', ['keep-source'])
|
|
585
588
|
}
|
|
586
589
|
}
|
|
@@ -632,7 +635,7 @@ const Methods = {
|
|
|
632
635
|
this.clearMergeCells()
|
|
633
636
|
this.clearMergeFooterItems()
|
|
634
637
|
this.handleTableData(true)
|
|
635
|
-
if (process.env.
|
|
638
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
636
639
|
if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
|
|
637
640
|
warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
|
|
638
641
|
}
|
|
@@ -649,13 +652,14 @@ const Methods = {
|
|
|
649
652
|
* 更新数据行的 Map
|
|
650
653
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
651
654
|
*/
|
|
652
|
-
cacheRowMap (
|
|
653
|
-
const { treeConfig, treeOpts, tableFullData,
|
|
654
|
-
let { fullDataRowIdData, fullAllDataRowIdData } = this
|
|
655
|
+
cacheRowMap (isSource?: boolean) {
|
|
656
|
+
const { treeConfig, treeOpts, tableFullData, fullAllDataRowIdData, fullAllDataRowMap, tableFullTreeData } = this
|
|
655
657
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
656
658
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
|
|
657
659
|
const rowkey = getRowkey(this)
|
|
658
660
|
const isLazy = treeConfig && treeOpts.lazy
|
|
661
|
+
const fullAllDataRowIdMaps: Record<string, VxeTableDefines.RowCacheItem> = {}
|
|
662
|
+
const fullDataRowIdMaps: Record<string, VxeTableDefines.RowCacheItem> = {}
|
|
659
663
|
const handleCache = (row: any, index: any, items: any, path: any, parent: any, nodes: any) => {
|
|
660
664
|
let rowid = getRowid(this, row)
|
|
661
665
|
const seq = treeConfig && path ? toTreePathSeq(path) : index + 1
|
|
@@ -667,19 +671,20 @@ const Methods = {
|
|
|
667
671
|
if (isLazy && row[hasChildField] && XEUtils.isUndefined(row[childrenField])) {
|
|
668
672
|
row[childrenField] = null
|
|
669
673
|
}
|
|
670
|
-
|
|
671
|
-
if (
|
|
672
|
-
|
|
673
|
-
|
|
674
|
+
let cacheItem = fullAllDataRowIdData[rowid]
|
|
675
|
+
if (!cacheItem) {
|
|
676
|
+
cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, items, parent, level }
|
|
677
|
+
}
|
|
678
|
+
if (isSource) {
|
|
679
|
+
cacheItem.index = treeConfig && parent ? -1 : index
|
|
680
|
+
fullDataRowIdMaps[rowid] = cacheItem
|
|
674
681
|
}
|
|
675
|
-
|
|
676
|
-
fullAllDataRowMap.set(row, rest)
|
|
682
|
+
fullAllDataRowIdMaps[rowid] = cacheItem
|
|
677
683
|
}
|
|
678
|
-
if (
|
|
679
|
-
|
|
680
|
-
fullDataRowMap.clear()
|
|
684
|
+
if (isSource) {
|
|
685
|
+
this.fullDataRowIdData = fullDataRowIdMaps
|
|
681
686
|
}
|
|
682
|
-
|
|
687
|
+
this.fullAllDataRowIdData = fullAllDataRowIdMaps
|
|
683
688
|
fullAllDataRowMap.clear()
|
|
684
689
|
if (treeConfig) {
|
|
685
690
|
XEUtils.eachTree(tableFullTreeData, handleCache, { children: childrenField })
|
|
@@ -770,7 +775,7 @@ const Methods = {
|
|
|
770
775
|
const { id: colid, field, fixed, type, treeNode } = column
|
|
771
776
|
const rest = { column, colid, index, items, parent }
|
|
772
777
|
if (field) {
|
|
773
|
-
if (process.env.
|
|
778
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
774
779
|
if (fullColumnFieldData[field]) {
|
|
775
780
|
warnLog('vxe.error.colRepet', ['field', field])
|
|
776
781
|
}
|
|
@@ -786,7 +791,7 @@ const Methods = {
|
|
|
786
791
|
}
|
|
787
792
|
|
|
788
793
|
if (treeNode) {
|
|
789
|
-
if (process.env.
|
|
794
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
790
795
|
if (treeNodeColumn) {
|
|
791
796
|
warnLog('vxe.error.colRepet', ['tree-node', treeNode])
|
|
792
797
|
}
|
|
@@ -795,7 +800,7 @@ const Methods = {
|
|
|
795
800
|
treeNodeColumn = column
|
|
796
801
|
}
|
|
797
802
|
} else if (type === 'expand') {
|
|
798
|
-
if (process.env.
|
|
803
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
799
804
|
if (expandColumn) {
|
|
800
805
|
warnLog('vxe.error.colRepet', ['type', type])
|
|
801
806
|
}
|
|
@@ -804,7 +809,7 @@ const Methods = {
|
|
|
804
809
|
expandColumn = column
|
|
805
810
|
}
|
|
806
811
|
}
|
|
807
|
-
if (process.env.
|
|
812
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
808
813
|
if (type === 'checkbox') {
|
|
809
814
|
if (checkboxColumn) {
|
|
810
815
|
warnLog('vxe.error.colRepet', ['type', type])
|
|
@@ -821,7 +826,7 @@ const Methods = {
|
|
|
821
826
|
}
|
|
822
827
|
}
|
|
823
828
|
}
|
|
824
|
-
if (process.env.
|
|
829
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
825
830
|
if (this.showOverflow && column.showOverflow === false) {
|
|
826
831
|
warnLog('vxe.error.errConflicts', [`table.show-overflow=${this.showOverflow}`, `column.show-overflow=${column.showOverflow}`])
|
|
827
832
|
}
|
|
@@ -833,7 +838,7 @@ const Methods = {
|
|
|
833
838
|
}
|
|
834
839
|
}
|
|
835
840
|
|
|
836
|
-
if (process.env.
|
|
841
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
837
842
|
if (htmlColumn) {
|
|
838
843
|
if (!columnOpts.useKey) {
|
|
839
844
|
errLog('vxe.error.reqProp', ['column-config.useKey', 'column.type=html'])
|
|
@@ -863,7 +868,7 @@ const Methods = {
|
|
|
863
868
|
tableFullColumn.forEach(handleFunc)
|
|
864
869
|
}
|
|
865
870
|
|
|
866
|
-
if (process.env.
|
|
871
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
867
872
|
if (expandColumn && this.mouseOpts.area) {
|
|
868
873
|
errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
|
|
869
874
|
}
|
|
@@ -935,7 +940,7 @@ const Methods = {
|
|
|
935
940
|
},
|
|
936
941
|
// 在 v3 中废弃
|
|
937
942
|
_getRowIndex (row: any) {
|
|
938
|
-
if (process.env.
|
|
943
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
939
944
|
warnLog('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex'])
|
|
940
945
|
}
|
|
941
946
|
return this.getVTRowIndex(row)
|
|
@@ -949,7 +954,7 @@ const Methods = {
|
|
|
949
954
|
},
|
|
950
955
|
// 在 v3 中废弃
|
|
951
956
|
$getRowIndex (row: any) {
|
|
952
|
-
if (process.env.
|
|
957
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
953
958
|
warnLog('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex'])
|
|
954
959
|
}
|
|
955
960
|
return this.getVMRowIndex(row)
|
|
@@ -970,7 +975,7 @@ const Methods = {
|
|
|
970
975
|
},
|
|
971
976
|
// 在 v3 中废弃
|
|
972
977
|
_getColumnIndex (column: any) {
|
|
973
|
-
if (process.env.
|
|
978
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
974
979
|
warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex'])
|
|
975
980
|
}
|
|
976
981
|
return this.getVTColumnIndex(column)
|
|
@@ -984,7 +989,7 @@ const Methods = {
|
|
|
984
989
|
},
|
|
985
990
|
// 在 v3 中废弃
|
|
986
991
|
$getColumnIndex (column: any) {
|
|
987
|
-
if (process.env.
|
|
992
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
988
993
|
warnLog('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex'])
|
|
989
994
|
}
|
|
990
995
|
return this.getVMColumnIndex(column)
|
|
@@ -1071,7 +1076,7 @@ const Methods = {
|
|
|
1071
1076
|
revertData (rows: any, field: any) {
|
|
1072
1077
|
const { keepSource, tableSourceData, treeConfig } = this
|
|
1073
1078
|
if (!keepSource) {
|
|
1074
|
-
if (process.env.
|
|
1079
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1075
1080
|
warnLog('vxe.error.reqProp', ['keep-source'])
|
|
1076
1081
|
}
|
|
1077
1082
|
return this.$nextTick()
|
|
@@ -1180,10 +1185,12 @@ const Methods = {
|
|
|
1180
1185
|
const formatParams = { cellValue, row, rowIndex: this.getRowIndex(row), column, columnIndex: this.getColumnIndex(column) }
|
|
1181
1186
|
if (XEUtils.isString(formatter)) {
|
|
1182
1187
|
const gFormatOpts = formats.get(formatter)
|
|
1183
|
-
|
|
1188
|
+
const tcFormatMethod = gFormatOpts ? (gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod) : null
|
|
1189
|
+
cellLabel = tcFormatMethod ? tcFormatMethod(formatParams) : ''
|
|
1184
1190
|
} else if (XEUtils.isArray(formatter)) {
|
|
1185
1191
|
const gFormatOpts = formats.get(formatter[0])
|
|
1186
|
-
|
|
1192
|
+
const tcFormatMethod = gFormatOpts ? (gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod) : null
|
|
1193
|
+
cellLabel = tcFormatMethod ? tcFormatMethod(formatParams, ...formatter.slice(1)) : ''
|
|
1187
1194
|
} else {
|
|
1188
1195
|
cellLabel = formatter(formatParams)
|
|
1189
1196
|
}
|
|
@@ -1389,8 +1396,8 @@ const Methods = {
|
|
|
1389
1396
|
if (valueList.length && !allRemoteFilter) {
|
|
1390
1397
|
const { filterMethod, filterRender, field } = column
|
|
1391
1398
|
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
|
|
1392
|
-
const compFilterMethod = compConf
|
|
1393
|
-
const
|
|
1399
|
+
const compFilterMethod = compConf ? (compConf.tableFilterMethod || compConf.filterMethod) : null
|
|
1400
|
+
const tdFilterMethod = compConf ? (compConf.tableFilterDefaultMethod || compConf.defaultTableFilterMethod || compConf.defaultFilterMethod) : null
|
|
1394
1401
|
const cellValue = getCellValue(row, column)
|
|
1395
1402
|
if (filterMethod) {
|
|
1396
1403
|
return itemList.some((item: any) => filterMethod({ value: item.value, option: item, cellValue, row, column, $table: this }))
|
|
@@ -1398,8 +1405,8 @@ const Methods = {
|
|
|
1398
1405
|
return itemList.some((item: any) => compFilterMethod({ value: item.value, option: item, cellValue, row, column, $table: this }))
|
|
1399
1406
|
} else if (allFilterMethod) {
|
|
1400
1407
|
return allFilterMethod({ options: itemList, values: valueList, cellValue, row, column })
|
|
1401
|
-
} else if (
|
|
1402
|
-
return itemList.some((item: any) =>
|
|
1408
|
+
} else if (tdFilterMethod) {
|
|
1409
|
+
return itemList.some((item: any) => tdFilterMethod({ value: item.value, option: item, cellValue, row, column, $table: this }))
|
|
1403
1410
|
}
|
|
1404
1411
|
return valueList.indexOf(XEUtils.get(row, field)) > -1
|
|
1405
1412
|
}
|
|
@@ -1982,7 +1989,7 @@ const Methods = {
|
|
|
1982
1989
|
this.hasFixedColumn = leftList.length > 0 || rightList.length > 0
|
|
1983
1990
|
Object.assign(columnStore, { leftList, centerList, rightList })
|
|
1984
1991
|
if (scrollXLoad) {
|
|
1985
|
-
if (process.env.
|
|
1992
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1986
1993
|
// if (this.showHeader && !this.showHeaderOverflow) {
|
|
1987
1994
|
// warnLog('vxe.error.reqProp', ['show-header-overflow'])
|
|
1988
1995
|
// }
|
|
@@ -2098,6 +2105,10 @@ const Methods = {
|
|
|
2098
2105
|
const bodyElem = tableBody ? tableBody.$el : null
|
|
2099
2106
|
const headerElem = tableHeader ? tableHeader.$el : null
|
|
2100
2107
|
const footerElem = tableFooter ? tableFooter.$el : null
|
|
2108
|
+
const el = this.$el
|
|
2109
|
+
if (!el || !el.clientWidth) {
|
|
2110
|
+
return this.$nextTick()
|
|
2111
|
+
}
|
|
2101
2112
|
if (bodyElem) {
|
|
2102
2113
|
this.calcCellWidth()
|
|
2103
2114
|
this.autoCellWidth(headerElem, bodyElem, footerElem)
|
|
@@ -2130,10 +2141,20 @@ const Methods = {
|
|
|
2130
2141
|
paddingSize = Math.floor(XEUtils.toNumber(cellStyle.paddingLeft) + XEUtils.toNumber(cellStyle.paddingRight)) + 2
|
|
2131
2142
|
}
|
|
2132
2143
|
let colWidth = column.renderAutoWidth - paddingSize
|
|
2133
|
-
XEUtils.arrayEach(cellElList, (
|
|
2134
|
-
const
|
|
2135
|
-
|
|
2136
|
-
|
|
2144
|
+
XEUtils.arrayEach(cellElList, (itemEl) => {
|
|
2145
|
+
const cellEl = itemEl as HTMLElement
|
|
2146
|
+
const thElem = cellEl.parentNode as HTMLElement
|
|
2147
|
+
let titleWidth = 0
|
|
2148
|
+
if (`${thElem.tagName}`.toLowerCase() === 'th') {
|
|
2149
|
+
XEUtils.arrayEach(cellEl.children, (btnEl) => {
|
|
2150
|
+
titleWidth += (btnEl as HTMLElement).offsetWidth + 1
|
|
2151
|
+
})
|
|
2152
|
+
} else {
|
|
2153
|
+
const labelEl = cellEl.firstChild as HTMLElement
|
|
2154
|
+
titleWidth = labelEl.offsetWidth
|
|
2155
|
+
}
|
|
2156
|
+
if (titleWidth) {
|
|
2157
|
+
colWidth = Math.max(colWidth, Math.ceil(titleWidth) + 4)
|
|
2137
2158
|
}
|
|
2138
2159
|
})
|
|
2139
2160
|
column.renderAutoWidth = colWidth + paddingSize
|
|
@@ -2590,7 +2611,7 @@ const Methods = {
|
|
|
2590
2611
|
// 兼容老版本
|
|
2591
2612
|
if (!evntList.length && type === 'event.clearEdit') {
|
|
2592
2613
|
evntList = interceptor.get('event.clearActived')
|
|
2593
|
-
if (process.env.
|
|
2614
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
2594
2615
|
if (evntList.length) {
|
|
2595
2616
|
warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit'])
|
|
2596
2617
|
}
|
|
@@ -2988,12 +3009,6 @@ const Methods = {
|
|
|
2988
3009
|
setCellValue(selected.row, selected.column, null)
|
|
2989
3010
|
this.handleEdit(selected.args, evnt)
|
|
2990
3011
|
}
|
|
2991
|
-
const afterEditMethod = editOpts.afterEditMethod
|
|
2992
|
-
if (afterEditMethod) {
|
|
2993
|
-
this.$nextTick(() => {
|
|
2994
|
-
afterEditMethod(params)
|
|
2995
|
-
})
|
|
2996
|
-
}
|
|
2997
3012
|
}
|
|
2998
3013
|
}
|
|
2999
3014
|
}
|
|
@@ -4394,7 +4409,7 @@ const Methods = {
|
|
|
4394
4409
|
},
|
|
4395
4410
|
// 在 v3 中废弃
|
|
4396
4411
|
getSortColumn () {
|
|
4397
|
-
if (process.env.
|
|
4412
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
4398
4413
|
warnLog('vxe.error.delFunc', ['getSortColumn', 'getSortColumns'])
|
|
4399
4414
|
}
|
|
4400
4415
|
return XEUtils.find(this.tableFullColumn, column => (column.sortable || column.remoteSort) && column.order)
|
|
@@ -4491,7 +4506,7 @@ const Methods = {
|
|
|
4491
4506
|
return this.$nextTick()
|
|
4492
4507
|
},
|
|
4493
4508
|
reloadExpandContent (row: any) {
|
|
4494
|
-
if (process.env.
|
|
4509
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
4495
4510
|
warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand'])
|
|
4496
4511
|
}
|
|
4497
4512
|
// 即将废弃
|
|
@@ -4653,7 +4668,7 @@ const Methods = {
|
|
|
4653
4668
|
return !!rowExpandedMaps[rowid]
|
|
4654
4669
|
},
|
|
4655
4670
|
isExpandByRow (row: any) {
|
|
4656
|
-
if (process.env.
|
|
4671
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
4657
4672
|
warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow'])
|
|
4658
4673
|
}
|
|
4659
4674
|
// 即将废弃
|
|
@@ -4770,7 +4785,7 @@ const Methods = {
|
|
|
4770
4785
|
return this.$nextTick()
|
|
4771
4786
|
},
|
|
4772
4787
|
reloadTreeChilds (row: any) {
|
|
4773
|
-
if (process.env.
|
|
4788
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
4774
4789
|
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand'])
|
|
4775
4790
|
}
|
|
4776
4791
|
// 即将废弃
|
|
@@ -5537,7 +5552,7 @@ const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOp
|
|
|
5537
5552
|
|
|
5538
5553
|
funcs.forEach(name => {
|
|
5539
5554
|
Methods[name] = function (...args: any[]) {
|
|
5540
|
-
if (process.env.
|
|
5555
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
5541
5556
|
if (!this[`_${name}`]) {
|
|
5542
5557
|
if ('openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').includes(name)) {
|
|
5543
5558
|
errLog('vxe.error.reqModule', ['VxeTableExportModule'])
|