vxe-table 3.4.15 → 3.5.0-beta.2
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 +1 -1
- package/helper/vetur/attributes.json +30 -10
- package/helper/vetur/tags.json +7 -2
- package/lib/button/src/button.js +19 -9
- package/lib/button/src/button.min.js +1 -1
- package/lib/checkbox/src/checkbox.js +2 -2
- package/lib/checkbox/src/checkbox.min.js +1 -1
- package/lib/edit/src/mixin.js +26 -18
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/export-panel.js +2 -2
- package/lib/export/src/export-panel.min.js +1 -1
- package/lib/export/src/import-panel.js +2 -2
- package/lib/export/src/import-panel.min.js +1 -1
- package/lib/export/src/mixin.js +26 -24
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/filter/src/mixin.js +4 -4
- package/lib/filter/src/mixin.min.js +1 -1
- package/lib/filter/src/panel.js +2 -2
- package/lib/filter/src/panel.min.js +1 -1
- package/lib/footer/src/footer.js +7 -4
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/src/form-gather.js +2 -2
- package/lib/form/src/form-gather.min.js +1 -1
- package/lib/form/src/form-item.js +5 -5
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +49 -64
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +17 -14
- package/lib/form/src/render.min.js +1 -1
- package/lib/form/src/util.js +2 -2
- package/lib/form/src/util.min.js +1 -1
- package/lib/grid/src/grid.js +44 -34
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +10 -8
- package/lib/header/src/header.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +2390 -1553
- package/lib/index.umd.min.js +1 -2
- package/lib/input/src/input.js +30 -18
- package/lib/input/src/input.min.js +1 -1
- package/lib/keyboard/src/mixin.js +12 -8
- package/lib/keyboard/src/mixin.min.js +1 -1
- package/lib/list/src/list.js +7 -5
- package/lib/list/src/list.min.js +1 -1
- package/lib/menu/src/mixin.js +24 -14
- package/lib/menu/src/mixin.min.js +1 -1
- package/lib/menu/src/panel.js +3 -3
- package/lib/menu/src/panel.min.js +1 -1
- package/lib/modal/src/modal.js +24 -12
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +16 -12
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/radio/src/button.js +2 -2
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/radio.js +2 -2
- package/lib/radio/src/radio.min.js +1 -1
- package/lib/select/src/select.js +42 -21
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/style/style.css +1 -1
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/switch/src/switch.js +4 -4
- package/lib/switch/src/switch.min.js +1 -1
- package/lib/table/src/body.js +34 -36
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +22 -14
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +6 -4
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +202 -0
- package/lib/table/src/columnInfo.min.js +1 -0
- package/lib/table/src/methods.js +247 -263
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +104 -129
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +52 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/textarea/src/textarea.js +2 -2
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +16 -10
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/tools/{src/dom.js → dom.js} +0 -0
- package/lib/tools/{src/dom.min.js → dom.min.js} +0 -0
- package/lib/tools/{src/event.js → event.js} +3 -6
- package/lib/tools/event.min.js +1 -0
- package/lib/tools/log.js +29 -0
- package/lib/tools/log.min.js +1 -0
- package/lib/tools/{src/resize.js → resize.js} +1 -1
- package/lib/tools/resize.min.js +1 -0
- package/lib/tools/utils.js +142 -0
- package/lib/tools/utils.min.js +1 -0
- package/lib/tooltip/src/tooltip.js +59 -34
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tooltip/style/style.css +1 -1
- package/lib/tooltip/style/style.min.css +1 -1
- package/lib/v-x-e-table/index.js +7 -4
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +14 -7
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/interceptor.js +4 -4
- package/lib/v-x-e-table/src/interceptor.min.js +1 -1
- package/lib/v-x-e-table/src/renderer.js +18 -10
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +3 -3
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/lib/validator/src/mixin.js +4 -4
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +1 -1
- package/packages/button/src/button.js +4 -2
- package/packages/checkbox/src/checkbox.js +2 -2
- package/packages/edit/src/mixin.js +7 -6
- package/packages/export/src/export-panel.js +1 -1
- package/packages/export/src/import-panel.js +1 -1
- package/packages/export/src/mixin.js +20 -19
- package/packages/filter/src/mixin.js +3 -3
- package/packages/filter/src/panel.js +1 -1
- package/packages/footer/src/footer.js +4 -2
- package/packages/form/src/form-gather.js +2 -2
- package/packages/form/src/form-item.js +4 -4
- package/packages/form/src/form.js +19 -32
- package/packages/form/src/render.js +9 -9
- package/packages/form/src/util.js +2 -2
- package/packages/grid/src/grid.js +22 -20
- package/packages/header/src/header.js +3 -2
- package/packages/input/src/input.js +6 -3
- package/packages/keyboard/src/mixin.js +1 -2
- package/packages/list/src/list.js +3 -2
- package/packages/menu/src/mixin.js +5 -3
- package/packages/menu/src/panel.js +3 -3
- package/packages/modal/src/modal.js +7 -4
- package/packages/pulldown/src/pulldown.js +3 -1
- package/packages/radio/src/button.js +2 -2
- package/packages/radio/src/radio.js +2 -2
- package/packages/select/src/select.js +19 -8
- package/packages/switch/src/switch.js +4 -4
- package/packages/table/src/body.js +26 -25
- package/packages/table/src/cell.js +8 -7
- package/packages/table/src/column.js +4 -2
- package/packages/table/src/columnInfo.js +149 -0
- package/packages/table/src/methods.js +73 -95
- package/packages/table/src/table.js +73 -103
- package/packages/table/src/util.js +30 -1
- package/packages/textarea/src/textarea.js +2 -2
- package/packages/toolbar/src/toolbar.js +7 -4
- package/packages/tools/{src/dom.js → dom.js} +0 -0
- package/packages/tools/{src/event.js → event.js} +1 -3
- package/packages/tools/log.js +16 -0
- package/packages/tools/{src/resize.js → resize.js} +1 -1
- package/packages/tools/utils.js +97 -0
- package/packages/tooltip/src/tooltip.js +46 -26
- package/packages/v-x-e-table/index.js +4 -2
- package/packages/v-x-e-table/src/conf.js +14 -7
- package/packages/v-x-e-table/src/interceptor.js +3 -3
- package/packages/v-x-e-table/src/renderer.js +4 -3
- package/packages/v-x-e-table/src/store.js +2 -2
- package/packages/validator/src/mixin.js +3 -3
- package/styles/select.scss +1 -1
- package/styles/tooltip.scss +1 -1
- package/types/v-x-e-table/index.d.ts +8 -0
- package/lib/tools/index.js +0 -76
- package/lib/tools/index.min.js +0 -1
- package/lib/tools/src/event.min.js +0 -1
- package/lib/tools/src/resize.min.js +0 -1
- package/lib/tools/src/utils.js +0 -365
- package/lib/tools/src/utils.min.js +0 -1
- package/packages/tools/index.js +0 -14
- package/packages/tools/src/utils.js +0 -272
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import VXETable from '../../v-x-e-table'
|
|
3
|
-
import {
|
|
3
|
+
import { warnLog } from '../../tools/log'
|
|
4
4
|
|
|
5
5
|
class ItemConfig {
|
|
6
6
|
constructor ($xeform, item) {
|
|
@@ -31,7 +31,7 @@ class ItemConfig {
|
|
|
31
31
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
32
32
|
const compConf = item.itemRender ? VXETable.renderer.get(item.itemRender.name) : null
|
|
33
33
|
if (compConf && !compConf.renderItemContent && compConf.renderItem) {
|
|
34
|
-
|
|
34
|
+
warnLog('vxe.error.delProp', ['item-render.renderItem', 'item-render.renderItemContent'])
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -3,8 +3,10 @@ import XEUtils from 'xe-utils'
|
|
|
3
3
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
4
4
|
import vSize from '../../mixins/size'
|
|
5
5
|
import VXETable from '../../v-x-e-table'
|
|
6
|
-
import
|
|
7
|
-
import { getOffsetHeight, getPaddingTopBottomSize } from '../../tools/
|
|
6
|
+
import UtilTools, { isEnableConf } from '../../tools/utils'
|
|
7
|
+
import DomTools, { getOffsetHeight, getPaddingTopBottomSize } from '../../tools/dom'
|
|
8
|
+
import { GlobalEvent } from '../../tools/event'
|
|
9
|
+
import { warnLog, errLog } from '../../tools/log'
|
|
8
10
|
|
|
9
11
|
const methods = {}
|
|
10
12
|
const propKeys = Object.keys(Table.props)
|
|
@@ -59,7 +61,7 @@ function getFuncSlot (_vm, optSlots, slotKey) {
|
|
|
59
61
|
return $scopedSlots[funcSlot]
|
|
60
62
|
} else {
|
|
61
63
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
62
|
-
|
|
64
|
+
errLog('vxe.error.notSlot', [funcSlot])
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
} else {
|
|
@@ -77,10 +79,10 @@ function getToolbarSlots (_vm) {
|
|
|
77
79
|
const slots = {}
|
|
78
80
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
79
81
|
if ($scopedSlots.buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
|
|
80
|
-
|
|
82
|
+
warnLog('vxe.error.reqProp', ['toolbar-config.slots.buttons'])
|
|
81
83
|
}
|
|
82
84
|
if ($scopedSlots.tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
|
|
83
|
-
|
|
85
|
+
warnLog('vxe.error.reqProp', ['toolbar-config.slots.tools'])
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
if (toolbarOptSlots) {
|
|
@@ -253,15 +255,15 @@ export default {
|
|
|
253
255
|
created () {
|
|
254
256
|
const { data, formOpts, proxyOpts, proxyConfig } = this
|
|
255
257
|
if (proxyConfig && (data || (proxyOpts.form && formOpts.data))) {
|
|
256
|
-
|
|
258
|
+
errLog('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config'])
|
|
257
259
|
}
|
|
258
260
|
|
|
259
261
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
260
262
|
if (this.toolbar) {
|
|
261
|
-
|
|
263
|
+
warnLog('vxe.error.delProp', ['grid.toolbar', 'grid.toolbar-config'])
|
|
262
264
|
}
|
|
263
265
|
if (this.toolbarConfig && !XEUtils.isObject(this.toolbarConfig)) {
|
|
264
|
-
|
|
266
|
+
warnLog('vxe.error.errProp', [`grid.toolbar-config=${this.toolbarConfig}`, 'grid.toolbar-config={}'])
|
|
265
267
|
}
|
|
266
268
|
}
|
|
267
269
|
|
|
@@ -588,7 +590,7 @@ export default {
|
|
|
588
590
|
})
|
|
589
591
|
} else {
|
|
590
592
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
591
|
-
|
|
593
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.query'])
|
|
592
594
|
}
|
|
593
595
|
}
|
|
594
596
|
break
|
|
@@ -614,7 +616,7 @@ export default {
|
|
|
614
616
|
// 检测弹窗模块
|
|
615
617
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
616
618
|
if (!VXETable.modal) {
|
|
617
|
-
|
|
619
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
618
620
|
}
|
|
619
621
|
}
|
|
620
622
|
VXETable.modal.message({ content: this.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' })
|
|
@@ -631,7 +633,7 @@ export default {
|
|
|
631
633
|
// 检测弹窗模块
|
|
632
634
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
633
635
|
if (!VXETable.modal) {
|
|
634
|
-
|
|
636
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
635
637
|
}
|
|
636
638
|
}
|
|
637
639
|
VXETable.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
@@ -643,7 +645,7 @@ export default {
|
|
|
643
645
|
// 检测弹窗模块
|
|
644
646
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
645
647
|
if (!VXETable.modal) {
|
|
646
|
-
|
|
648
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
647
649
|
}
|
|
648
650
|
}
|
|
649
651
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
@@ -651,7 +653,7 @@ export default {
|
|
|
651
653
|
}
|
|
652
654
|
} else {
|
|
653
655
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
654
|
-
|
|
656
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.delete'])
|
|
655
657
|
}
|
|
656
658
|
}
|
|
657
659
|
break
|
|
@@ -690,7 +692,7 @@ export default {
|
|
|
690
692
|
// 检测弹窗模块
|
|
691
693
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
692
694
|
if (!VXETable.modal) {
|
|
693
|
-
|
|
695
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
694
696
|
}
|
|
695
697
|
}
|
|
696
698
|
VXETable.modal.message({ content: this.getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' })
|
|
@@ -707,7 +709,7 @@ export default {
|
|
|
707
709
|
// 检测弹窗模块
|
|
708
710
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
709
711
|
if (!VXETable.modal) {
|
|
710
|
-
|
|
712
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
711
713
|
}
|
|
712
714
|
}
|
|
713
715
|
VXETable.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
@@ -718,7 +720,7 @@ export default {
|
|
|
718
720
|
// 检测弹窗模块
|
|
719
721
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
720
722
|
if (!VXETable.modal) {
|
|
721
|
-
|
|
723
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
722
724
|
}
|
|
723
725
|
}
|
|
724
726
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.dataUnchanged'), status: 'info' })
|
|
@@ -727,7 +729,7 @@ export default {
|
|
|
727
729
|
})
|
|
728
730
|
} else {
|
|
729
731
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
730
|
-
|
|
732
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.save'])
|
|
731
733
|
}
|
|
732
734
|
}
|
|
733
735
|
break
|
|
@@ -762,7 +764,7 @@ export default {
|
|
|
762
764
|
// 检测弹窗模块
|
|
763
765
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
764
766
|
if (!VXETable.modal) {
|
|
765
|
-
|
|
767
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
766
768
|
}
|
|
767
769
|
}
|
|
768
770
|
VXETable.modal.message({ id: `msg_${code}`, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
@@ -817,7 +819,7 @@ export default {
|
|
|
817
819
|
// 检测弹窗模块
|
|
818
820
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
819
821
|
if (!VXETable.modal) {
|
|
820
|
-
|
|
822
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
821
823
|
}
|
|
822
824
|
}
|
|
823
825
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
@@ -931,7 +933,7 @@ export default {
|
|
|
931
933
|
XEUtils.each(column.slots, (func) => {
|
|
932
934
|
if (!XEUtils.isFunction(func)) {
|
|
933
935
|
if (!$scopedSlots[func]) {
|
|
934
|
-
|
|
936
|
+
errLog('vxe.error.notSlot', [func])
|
|
935
937
|
}
|
|
936
938
|
}
|
|
937
939
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
|
-
import
|
|
2
|
+
import UtilTools from '../../tools/utils'
|
|
3
|
+
import DomTools from '../../tools/dom'
|
|
3
4
|
import { convertToRows } from './util'
|
|
4
5
|
import { getColMinWidth } from '../../table/src/util'
|
|
5
6
|
|
|
@@ -163,7 +164,7 @@ export default {
|
|
|
163
164
|
},
|
|
164
165
|
style: headerCellStyle ? (XEUtils.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle) : null,
|
|
165
166
|
on: thOns,
|
|
166
|
-
key: columnKey || isColGroup ? column.id : $columnIndex
|
|
167
|
+
key: columnKey || columnOpts.useKey || isColGroup ? column.id : $columnIndex
|
|
167
168
|
}, [
|
|
168
169
|
h('div', {
|
|
169
170
|
class: ['vxe-cell', {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import vSize from '../../mixins/size'
|
|
4
|
-
import
|
|
4
|
+
import UtilTools, { getFuncText } from '../../tools/utils'
|
|
5
|
+
import DomTools from '../../tools/dom'
|
|
6
|
+
import { GlobalEvent } from '../../tools/event'
|
|
5
7
|
import { toStringTimeDate, getDateQuarter } from './date'
|
|
6
8
|
import { handleNumber, toFloatValueFixed } from './number'
|
|
9
|
+
import { warnLog } from '../../tools/log'
|
|
7
10
|
|
|
8
11
|
const yearSize = 20
|
|
9
12
|
const monthSize = 20
|
|
@@ -962,7 +965,7 @@ export default {
|
|
|
962
965
|
inpPlaceholder () {
|
|
963
966
|
const { placeholder } = this
|
|
964
967
|
if (placeholder) {
|
|
965
|
-
return
|
|
968
|
+
return getFuncText(placeholder)
|
|
966
969
|
}
|
|
967
970
|
return ''
|
|
968
971
|
},
|
|
@@ -1017,7 +1020,7 @@ export default {
|
|
|
1017
1020
|
},
|
|
1018
1021
|
mounted () {
|
|
1019
1022
|
if (this.dateConfig) {
|
|
1020
|
-
|
|
1023
|
+
warnLog('vxe.error.removeProp', ['date-config'])
|
|
1021
1024
|
}
|
|
1022
1025
|
if (this.isDatePickerType) {
|
|
1023
1026
|
if (this.transfer) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import vSize from '../../mixins/size'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { createResizeEvent } from '../../tools/resize'
|
|
5
|
+
import { GlobalEvent } from '../../tools/event'
|
|
6
|
+
import { browse } from '../../tools/dom'
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
name: 'VxeList',
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
|
-
import
|
|
2
|
+
import UtilTools, { isEnableConf } from '../../tools/utils'
|
|
3
|
+
import DomTools from '../../tools/dom'
|
|
3
4
|
import VXETable from '../../v-x-e-table'
|
|
5
|
+
import { warnLog } from '../../tools/log'
|
|
4
6
|
|
|
5
7
|
export default {
|
|
6
8
|
methods: {
|
|
@@ -104,7 +106,7 @@ export default {
|
|
|
104
106
|
// 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
|
|
105
107
|
if (this.$listeners[`${typePrefix}cell-context-menu`]) {
|
|
106
108
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
107
|
-
|
|
109
|
+
warnLog('vxe.error.delEvent', [`${typePrefix}cell-context-menu`, `${typePrefix}cell-menu`])
|
|
108
110
|
}
|
|
109
111
|
this.emitEvent(`${typePrefix}cell-context-menu`, params, evnt)
|
|
110
112
|
} else {
|
|
@@ -255,7 +257,7 @@ export default {
|
|
|
255
257
|
// 在 v4 中废弃事件 context-menu-click
|
|
256
258
|
if (this.$listeners['context-menu-click']) {
|
|
257
259
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
258
|
-
|
|
260
|
+
warnLog('vxe.error.delEvent', ['context-menu-click', 'menu-click'])
|
|
259
261
|
}
|
|
260
262
|
this.emitEvent('context-menu-click', params, evnt)
|
|
261
263
|
} else {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getFuncText } from '../../tools/utils'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
name: 'VxeTableContextMenu',
|
|
@@ -53,7 +53,7 @@ export default {
|
|
|
53
53
|
}),
|
|
54
54
|
h('span', {
|
|
55
55
|
class: 'vxe-context-menu--link-content'
|
|
56
|
-
},
|
|
56
|
+
}, getFuncText(item.name)),
|
|
57
57
|
h('i', {
|
|
58
58
|
class: ['vxe-context-menu--link-suffix', hasChildMenus ? item.suffixIcon || 'suffix--haschild' : item.suffixIcon]
|
|
59
59
|
})
|
|
@@ -89,7 +89,7 @@ export default {
|
|
|
89
89
|
}),
|
|
90
90
|
h('span', {
|
|
91
91
|
class: 'vxe-context-menu--link-content'
|
|
92
|
-
},
|
|
92
|
+
}, getFuncText(child.name))
|
|
93
93
|
])
|
|
94
94
|
])
|
|
95
95
|
})) : null
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
2
2
|
import vSize from '../../mixins/size'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
|
-
import
|
|
4
|
+
import UtilTools, { getFuncText } from '../../tools/utils'
|
|
5
|
+
import DomTools from '../../tools/dom'
|
|
6
|
+
import { GlobalEvent } from '../../tools/event'
|
|
7
|
+
import { errLog } from '../../tools/log'
|
|
5
8
|
|
|
6
9
|
export const allActivedModals = []
|
|
7
10
|
export const msgQueue = []
|
|
@@ -86,7 +89,7 @@ export default {
|
|
|
86
89
|
},
|
|
87
90
|
created () {
|
|
88
91
|
if (this.storage && !this.id) {
|
|
89
|
-
|
|
92
|
+
errLog('vxe.error.reqProp', ['modal.id'])
|
|
90
93
|
}
|
|
91
94
|
},
|
|
92
95
|
mounted () {
|
|
@@ -167,7 +170,7 @@ export default {
|
|
|
167
170
|
}, headerSlot ? (!inited || (destroyOnClose && !visible) ? [] : headerSlot.call(this, { $modal: this }, h)) : [
|
|
168
171
|
titleSlot ? titleSlot.call(this, { $modal: this }, h) : h('span', {
|
|
169
172
|
class: 'vxe-modal--title'
|
|
170
|
-
}, title ?
|
|
173
|
+
}, title ? getFuncText(title) : GlobalConfig.i18n('vxe.alert.title')),
|
|
171
174
|
showZoom ? h('i', {
|
|
172
175
|
class: ['vxe-modal--zoom-btn', 'trigger--btn', zoomLocat ? GlobalConfig.icon.MODAL_ZOOM_OUT : GlobalConfig.icon.MODAL_ZOOM_IN],
|
|
173
176
|
attrs: {
|
|
@@ -199,7 +202,7 @@ export default {
|
|
|
199
202
|
]) : null,
|
|
200
203
|
h('div', {
|
|
201
204
|
class: 'vxe-modal--content'
|
|
202
|
-
}, defaultSlot ? (!inited || (destroyOnClose && !visible) ? [] : defaultSlot.call(this, { $modal: this }, h)) :
|
|
205
|
+
}, defaultSlot ? (!inited || (destroyOnClose && !visible) ? [] : defaultSlot.call(this, { $modal: this }, h)) : getFuncText(content)),
|
|
203
206
|
!isMsg ? h('div', {
|
|
204
207
|
class: ['vxe-loading', {
|
|
205
208
|
'is--visible': loading
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
2
2
|
import vSize from '../../mixins/size'
|
|
3
|
-
import
|
|
3
|
+
import UtilTools from '../../tools/utils'
|
|
4
|
+
import DomTools from '../../tools/dom'
|
|
5
|
+
import { GlobalEvent } from '../../tools/event'
|
|
4
6
|
|
|
5
7
|
export default {
|
|
6
8
|
name: 'VxePulldown',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getFuncText } from '../../tools/utils'
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
@@ -60,7 +60,7 @@ export default {
|
|
|
60
60
|
}),
|
|
61
61
|
h('span', {
|
|
62
62
|
class: 'vxe-radio--label'
|
|
63
|
-
}, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [
|
|
63
|
+
}, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [getFuncText(content)])
|
|
64
64
|
])
|
|
65
65
|
},
|
|
66
66
|
methods: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getFuncText } from '../../tools/utils'
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import vSize from '../../mixins/size'
|
|
4
4
|
|
|
@@ -63,7 +63,7 @@ export default {
|
|
|
63
63
|
}),
|
|
64
64
|
h('span', {
|
|
65
65
|
class: 'vxe-radio--label'
|
|
66
|
-
}, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [
|
|
66
|
+
}, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [getFuncText(content)])
|
|
67
67
|
])
|
|
68
68
|
},
|
|
69
69
|
methods: {
|
|
@@ -2,7 +2,9 @@ import XEUtils from 'xe-utils'
|
|
|
2
2
|
import VxeInput from '../../input/src/input'
|
|
3
3
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
4
4
|
import vSize from '../../mixins/size'
|
|
5
|
-
import
|
|
5
|
+
import UtilTools, { getFuncText } from '../../tools/utils'
|
|
6
|
+
import DomTools from '../../tools/dom'
|
|
7
|
+
import { GlobalEvent } from '../../tools/event'
|
|
6
8
|
|
|
7
9
|
function isOptionVisible (option) {
|
|
8
10
|
return option.visible !== false
|
|
@@ -13,7 +15,8 @@ function getOptUniqueId () {
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
function getOptkey (_vm) {
|
|
16
|
-
|
|
18
|
+
const { optionOpts } = _vm
|
|
19
|
+
return optionOpts.keyField || _vm.optionId || '_X_OPTION_KEY'
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
function getOptid (_vm, option) {
|
|
@@ -115,7 +118,8 @@ function getSelectLabel (_vm, value) {
|
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
export function renderOption (h, _vm, list, group) {
|
|
118
|
-
const { isGroup, labelField, valueField, optionKey, value, multiple, currentValue } = _vm
|
|
121
|
+
const { isGroup, labelField, valueField, optionKey, value, multiple, currentValue, optionOpts } = _vm
|
|
122
|
+
const { useKey } = optionOpts
|
|
119
123
|
return list.map((option, cIndex) => {
|
|
120
124
|
const { slots } = option
|
|
121
125
|
const isVisible = !isGroup || isOptionVisible(option)
|
|
@@ -124,7 +128,7 @@ export function renderOption (h, _vm, list, group) {
|
|
|
124
128
|
const optid = getOptid(_vm, option)
|
|
125
129
|
const defaultSlot = slots ? slots.default : null
|
|
126
130
|
return isVisible ? h('div', {
|
|
127
|
-
key: optionKey ? optid : cIndex,
|
|
131
|
+
key: useKey || optionKey ? optid : cIndex,
|
|
128
132
|
class: ['vxe-select-option', option.className, {
|
|
129
133
|
'is--disabled': isDisabled,
|
|
130
134
|
'is--selected': multiple ? (value && value.indexOf(optionValue) > -1) : value === optionValue,
|
|
@@ -146,19 +150,20 @@ export function renderOption (h, _vm, list, group) {
|
|
|
146
150
|
}
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
|
-
}, defaultSlot ? _vm.callSlot(defaultSlot, { option, $select: _vm }, h) : UtilTools.formatText(
|
|
153
|
+
}, defaultSlot ? _vm.callSlot(defaultSlot, { option, $select: _vm }, h) : UtilTools.formatText(getFuncText(option[labelField]))) : null
|
|
150
154
|
})
|
|
151
155
|
}
|
|
152
156
|
|
|
153
157
|
export function renderOptgroup (h, _vm) {
|
|
154
|
-
const { optionKey, visibleGroupList, groupLabelField, groupOptionsField } = _vm
|
|
158
|
+
const { optionKey, visibleGroupList, groupLabelField, groupOptionsField, optionOpts } = _vm
|
|
159
|
+
const { useKey } = optionOpts
|
|
155
160
|
return visibleGroupList.map((group, gIndex) => {
|
|
156
161
|
const { slots } = group
|
|
157
162
|
const optid = getOptid(_vm, group)
|
|
158
163
|
const isGroupDisabled = group.disabled
|
|
159
164
|
const defaultSlot = slots ? slots.default : null
|
|
160
165
|
return h('div', {
|
|
161
|
-
key: optionKey ? optid : gIndex,
|
|
166
|
+
key: useKey || optionKey ? optid : gIndex,
|
|
162
167
|
class: ['vxe-optgroup', group.className, {
|
|
163
168
|
'is--disabled': isGroupDisabled
|
|
164
169
|
}],
|
|
@@ -168,7 +173,7 @@ export function renderOptgroup (h, _vm) {
|
|
|
168
173
|
}, [
|
|
169
174
|
h('div', {
|
|
170
175
|
class: 'vxe-optgroup--title'
|
|
171
|
-
}, defaultSlot ? _vm.callSlot(defaultSlot, { option: group, $select: _vm }, h) :
|
|
176
|
+
}, defaultSlot ? _vm.callSlot(defaultSlot, { option: group, $select: _vm }, h) : getFuncText(group[groupLabelField])),
|
|
172
177
|
h('div', {
|
|
173
178
|
class: 'vxe-optgroup--wrapper'
|
|
174
179
|
}, renderOption(h, _vm, group[groupOptionsField], group))
|
|
@@ -211,10 +216,13 @@ export default {
|
|
|
211
216
|
optionProps: Object,
|
|
212
217
|
optionGroups: Array,
|
|
213
218
|
optionGroupProps: Object,
|
|
219
|
+
optionConfig: Object,
|
|
214
220
|
className: [String, Function],
|
|
215
221
|
size: { type: String, default: () => GlobalConfig.select.size || GlobalConfig.size },
|
|
216
222
|
emptyText: String,
|
|
223
|
+
// 已废弃,被 option-config.keyField 替换
|
|
217
224
|
optionId: { type: String, default: () => GlobalConfig.select.optionId },
|
|
225
|
+
// 已废弃,被 option-config.useKey 替换
|
|
218
226
|
optionKey: Boolean,
|
|
219
227
|
transfer: { type: Boolean, default: () => GlobalConfig.select.transfer }
|
|
220
228
|
},
|
|
@@ -262,6 +270,9 @@ export default {
|
|
|
262
270
|
groupOptionsField () {
|
|
263
271
|
return this.groupPropsOpts.options || 'options'
|
|
264
272
|
},
|
|
273
|
+
optionOpts () {
|
|
274
|
+
return Object.assign({}, GlobalConfig.select.optionConfig, this.optionConfig)
|
|
275
|
+
},
|
|
265
276
|
isGroup () {
|
|
266
277
|
return this.fullGroupList.some(item => item.options && item.options.length)
|
|
267
278
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getFuncText } from '../../tools/utils'
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import vSize from '../../mixins/size'
|
|
4
|
-
import { browse } from '../../tools/
|
|
4
|
+
import { browse } from '../../tools/dom'
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
name: 'VxeSwitch',
|
|
@@ -30,10 +30,10 @@ export default {
|
|
|
30
30
|
return this.value === this.openValue
|
|
31
31
|
},
|
|
32
32
|
onShowLabel () {
|
|
33
|
-
return
|
|
33
|
+
return getFuncText(this.openLabel)
|
|
34
34
|
},
|
|
35
35
|
offShowLabel () {
|
|
36
|
-
return
|
|
36
|
+
return getFuncText(this.closeLabel)
|
|
37
37
|
},
|
|
38
38
|
styles () {
|
|
39
39
|
return browse.msie && this.isChecked ? {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import VXETable from '../../v-x-e-table'
|
|
4
|
-
import
|
|
5
|
-
import { getOffsetSize, calcTreeLine, mergeBodyMethod, removeScrollListener, restoreScrollListener } from './util'
|
|
6
|
-
import
|
|
4
|
+
import UtilTools, { isEnableConf } from '../../tools/utils'
|
|
5
|
+
import { getOffsetSize, calcTreeLine, mergeBodyMethod, removeScrollListener, restoreScrollListener, getRowid } from './util'
|
|
6
|
+
import DomTools from '../../tools/dom'
|
|
7
7
|
|
|
8
8
|
const renderType = 'body'
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@ function renderLine (h, _vm, $xetable, params) {
|
|
|
16
16
|
const { row, column } = params
|
|
17
17
|
const { treeOpts, treeConfig, fullAllDataRowIdData } = $xetable
|
|
18
18
|
const { slots, treeNode } = column
|
|
19
|
-
const rowid =
|
|
19
|
+
const rowid = getRowid($xetable, row)
|
|
20
20
|
const rest = fullAllDataRowIdData[rowid]
|
|
21
21
|
let rLevel = 0
|
|
22
22
|
let rIndex = 0
|
|
@@ -83,7 +83,8 @@ function renderColumn (h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, r
|
|
|
83
83
|
editStore,
|
|
84
84
|
validStore,
|
|
85
85
|
tooltipConfig,
|
|
86
|
-
rowOpts
|
|
86
|
+
rowOpts,
|
|
87
|
+
columnOpts
|
|
87
88
|
} = $xetable
|
|
88
89
|
const { type, cellRender, editRender, align, showOverflow, className, treeNode } = column
|
|
89
90
|
const { actived } = editStore
|
|
@@ -267,7 +268,7 @@ function renderColumn (h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, r
|
|
|
267
268
|
'col--valid-error': hasValidError,
|
|
268
269
|
'col--current': currentColumn === column
|
|
269
270
|
}, UtilTools.getClass(className, params), UtilTools.getClass(cellClassName, params)],
|
|
270
|
-
key: columnKey ? column.id : $columnIndex,
|
|
271
|
+
key: columnKey || columnOpts.useKey ? column.id : $columnIndex,
|
|
271
272
|
attrs,
|
|
272
273
|
style: Object.assign({
|
|
273
274
|
height: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
|
@@ -321,7 +322,7 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
321
322
|
$xetable.clearHoverRow()
|
|
322
323
|
}
|
|
323
324
|
}
|
|
324
|
-
const rowid =
|
|
325
|
+
const rowid = getRowid($xetable, row)
|
|
325
326
|
const rest = fullAllDataRowIdData[rowid]
|
|
326
327
|
const rowLevel = rest ? rest.level : 0
|
|
327
328
|
const seq = rest ? rest.seq : -1
|
|
@@ -343,7 +344,7 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
343
344
|
rowid: rowid
|
|
344
345
|
},
|
|
345
346
|
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
|
|
346
|
-
key: rowKey || treeConfig ? rowid : $rowIndex,
|
|
347
|
+
key: (rowKey || rowOpts.useKey) || treeConfig ? rowid : $rowIndex,
|
|
347
348
|
on: trOn
|
|
348
349
|
}, tableColumn.map((column, $columnIndex) => {
|
|
349
350
|
return renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
|
|
@@ -413,26 +414,26 @@ function syncBodyScroll (_vm, fixedType, scrollTop, elem1, elem2) {
|
|
|
413
414
|
}
|
|
414
415
|
clearTimeout(scrollProcessTimeout)
|
|
415
416
|
scrollProcessTimeout = setTimeout(() => {
|
|
416
|
-
const { tableBody, leftBody, rightBody } = _vm.$refs
|
|
417
|
-
const bodyElem = tableBody.$el
|
|
418
|
-
const leftElem = leftBody ? leftBody.$el : null
|
|
419
|
-
const rightElem = rightBody ? rightBody.$el : null
|
|
417
|
+
// const { tableBody, leftBody, rightBody } = _vm.$refs
|
|
418
|
+
// const bodyElem = tableBody.$el
|
|
419
|
+
// const leftElem = leftBody ? leftBody.$el : null
|
|
420
|
+
// const rightElem = rightBody ? rightBody.$el : null
|
|
420
421
|
restoreScrollListener(elem1)
|
|
421
422
|
restoreScrollListener(elem2)
|
|
422
423
|
// 检查滚动条是的同步
|
|
423
|
-
let targetTop = bodyElem.scrollTop
|
|
424
|
-
if (fixedType === 'left') {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
} else if (fixedType === 'right') {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
setScrollTop(bodyElem, targetTop)
|
|
434
|
-
setScrollTop(leftElem, targetTop)
|
|
435
|
-
setScrollTop(rightElem, targetTop)
|
|
424
|
+
// let targetTop = bodyElem.scrollTop
|
|
425
|
+
// if (fixedType === 'left') {
|
|
426
|
+
// if (leftElem) {
|
|
427
|
+
// targetTop = leftElem.scrollTop
|
|
428
|
+
// }
|
|
429
|
+
// } else if (fixedType === 'right') {
|
|
430
|
+
// if (rightElem) {
|
|
431
|
+
// targetTop = rightElem.scrollTop
|
|
432
|
+
// }
|
|
433
|
+
// }
|
|
434
|
+
// setScrollTop(bodyElem, targetTop)
|
|
435
|
+
// setScrollTop(leftElem, targetTop)
|
|
436
|
+
// setScrollTop(rightElem, targetTop)
|
|
436
437
|
}, 300)
|
|
437
438
|
}
|
|
438
439
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import VXETable from '../../v-x-e-table'
|
|
4
|
-
import
|
|
5
|
-
import { eqEmptyValue, isEnableConf } from '../../tools/
|
|
4
|
+
import DomTools from '../../tools/dom'
|
|
5
|
+
import UtilTools, { eqEmptyValue, isEnableConf, getFuncText } from '../../tools/utils'
|
|
6
|
+
import { getColumnConfig } from './util'
|
|
6
7
|
|
|
7
8
|
function renderHelpIcon (h, params) {
|
|
8
9
|
const { $table, column } = params
|
|
9
|
-
const
|
|
10
|
-
return
|
|
10
|
+
const titlePrefix = column.titlePrefix || column.titleHelp
|
|
11
|
+
return titlePrefix ? [
|
|
11
12
|
h('i', {
|
|
12
|
-
class: ['vxe-cell-help-icon',
|
|
13
|
+
class: ['vxe-cell-help-icon', titlePrefix.icon || GlobalConfig.icon.TABLE_HELP],
|
|
13
14
|
on: {
|
|
14
15
|
mouseenter (evnt) {
|
|
15
16
|
$table.triggerHeaderHelpEvent(evnt, params)
|
|
@@ -136,7 +137,7 @@ export const Cell = {
|
|
|
136
137
|
renMaps.renderHeader = this.renderFilterHeader
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
|
-
return
|
|
140
|
+
return getColumnConfig($xetable, _vm, renMaps)
|
|
140
141
|
},
|
|
141
142
|
/**
|
|
142
143
|
* 单元格
|
|
@@ -182,7 +183,7 @@ export const Cell = {
|
|
|
182
183
|
// 如果设置占位符
|
|
183
184
|
h('span', {
|
|
184
185
|
class: 'vxe-cell--placeholder'
|
|
185
|
-
}, UtilTools.formatText(
|
|
186
|
+
}, UtilTools.formatText(getFuncText(cellPlaceholder), 1))
|
|
186
187
|
] : UtilTools.formatText(cellValue, 1))
|
|
187
188
|
]
|
|
188
189
|
},
|