vxe-table 3.9.0-rc.8 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/es/grid/src/grid.js +120 -66
- 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 +2 -8
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/hu-HU.d.ts +2 -0
- package/es/locale/lang/hu-HU.js +497 -501
- package/es/locale/lang/ja-JP.js +2 -8
- package/es/locale/lang/ko-KR.d.ts +2 -0
- package/es/locale/lang/ko-KR.js +2 -8
- package/es/locale/lang/pt-BR.js +2 -8
- package/es/locale/lang/ru-RU.d.ts +2 -0
- package/es/locale/lang/ru-RU.js +497 -503
- package/es/locale/lang/uk-UA.d.ts +2 -0
- package/es/locale/lang/uk-UA.js +667 -0
- package/es/locale/lang/vi-VN.js +2 -8
- package/es/locale/lang/zh-CHT.d.ts +2 -0
- package/es/locale/lang/zh-CHT.js +667 -0
- package/es/locale/lang/zh-CN.js +2 -8
- package/es/locale/lang/zh-HK.js +2 -2
- package/es/locale/lang/zh-MO.js +2 -2
- package/es/locale/lang/zh-TC.js +2 -673
- package/es/locale/lang/zh-TW.js +2 -2
- 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 +33 -24
- 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 +54 -42
- package/es/table/src/props.js +65 -15
- package/es/table/src/table.js +175 -60
- 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 +581 -491
- 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 +9212 -17224
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -8
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -8
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/hu-HU.d.ts +2 -0
- package/lib/locale/lang/hu-HU.js +497 -501
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +687 -0
- package/lib/locale/lang/ja-JP.js +2 -8
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -8
- package/lib/locale/lang/ko-KR.d.ts +2 -0
- package/lib/locale/lang/ko-KR.js +2 -8
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +687 -0
- package/lib/locale/lang/pt-BR.js +2 -8
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -8
- package/lib/locale/lang/ru-RU.d.ts +2 -0
- package/lib/locale/lang/ru-RU.js +497 -503
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +687 -0
- package/lib/locale/lang/uk-UA.d.ts +2 -0
- package/lib/locale/lang/uk-UA.js +673 -0
- package/lib/locale/lang/uk-UA.min.js +1 -0
- package/lib/locale/lang/uk-UA.umd.js +687 -0
- package/lib/locale/lang/vi-VN.js +2 -8
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.d.ts +2 -0
- package/lib/locale/lang/zh-CHT.js +673 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -0
- package/lib/locale/lang/zh-CHT.umd.js +687 -0
- package/lib/locale/lang/zh-CN.js +2 -8
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -8
- package/lib/locale/lang/zh-HK.js +2 -2
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +7 -677
- package/lib/locale/lang/zh-MO.js +2 -2
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +7 -677
- package/lib/locale/lang/zh-TC.js +3 -673
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +7 -677
- package/lib/locale/lang/zh-TW.js +2 -2
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +7 -677
- 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 +436 -371
- 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 +2758 -2478
- 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 +519 -397
- 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 +127 -65
- package/packages/locale/lang/en-US.ts +2 -10
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +497 -503
- package/packages/locale/lang/ja-JP.ts +2 -10
- package/packages/locale/lang/ko-KR.ts +2 -10
- package/packages/locale/lang/pt-BR.ts +2 -10
- package/packages/locale/lang/ru-RU.ts +497 -505
- package/packages/locale/lang/uk-UA.ts +667 -0
- package/packages/locale/lang/vi-VN.ts +2 -10
- package/packages/locale/lang/zh-CHT.ts +667 -0
- package/packages/locale/lang/zh-CN.ts +2 -10
- package/packages/locale/lang/zh-HK.ts +2 -2
- package/packages/locale/lang/zh-MO.ts +2 -2
- package/packages/locale/lang/zh-TC.ts +2 -674
- package/packages/locale/lang/zh-TW.ts +2 -2
- package/packages/table/module/custom/panel.ts +186 -175
- package/packages/table/module/edit/mixin.ts +32 -23
- 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 +53 -42
- package/packages/table/src/props.ts +68 -15
- package/packages/table/src/table.ts +183 -57
- 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.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/es/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
- /package/es/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
- /package/lib/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/lib/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
- /package/lib/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
|
@@ -10,19 +10,17 @@ var _ui = require("../../ui");
|
|
|
10
10
|
var _vn = require("../../ui/src/vn");
|
|
11
11
|
var _log = require("../../ui/src/log");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
renderEmptyElement = _ui.VxeUI.renderEmptyElement;
|
|
25
|
-
var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
13
|
+
const {
|
|
14
|
+
getConfig,
|
|
15
|
+
getIcon,
|
|
16
|
+
getI18n,
|
|
17
|
+
renderer,
|
|
18
|
+
commands,
|
|
19
|
+
createEvent,
|
|
20
|
+
globalMixins,
|
|
21
|
+
renderEmptyElement
|
|
22
|
+
} = _ui.VxeUI;
|
|
23
|
+
var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
26
24
|
name: 'VxeToolbar',
|
|
27
25
|
mixins: [globalMixins.sizeMixin],
|
|
28
26
|
props: {
|
|
@@ -35,27 +33,19 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
35
33
|
custom: [Boolean, Object],
|
|
36
34
|
buttons: {
|
|
37
35
|
type: Array,
|
|
38
|
-
default:
|
|
39
|
-
return getConfig().toolbar.buttons;
|
|
40
|
-
}
|
|
36
|
+
default: () => getConfig().toolbar.buttons
|
|
41
37
|
},
|
|
42
38
|
tools: {
|
|
43
39
|
type: Array,
|
|
44
|
-
default:
|
|
45
|
-
return getConfig().toolbar.tools;
|
|
46
|
-
}
|
|
40
|
+
default: () => getConfig().toolbar.tools
|
|
47
41
|
},
|
|
48
42
|
perfect: {
|
|
49
43
|
type: Boolean,
|
|
50
|
-
default:
|
|
51
|
-
return getConfig().toolbar.perfect;
|
|
52
|
-
}
|
|
44
|
+
default: () => getConfig().toolbar.perfect
|
|
53
45
|
},
|
|
54
46
|
size: {
|
|
55
47
|
type: String,
|
|
56
|
-
default:
|
|
57
|
-
return getConfig().toolbar.size || getConfig().size;
|
|
58
|
-
}
|
|
48
|
+
default: () => getConfig().toolbar.size || getConfig().size
|
|
59
49
|
},
|
|
60
50
|
className: [String, Function]
|
|
61
51
|
},
|
|
@@ -64,59 +54,61 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
64
54
|
default: null
|
|
65
55
|
}
|
|
66
56
|
},
|
|
67
|
-
data
|
|
68
|
-
|
|
69
|
-
|
|
57
|
+
data() {
|
|
58
|
+
const xID = _xeUtils.default.uniqueId();
|
|
59
|
+
const reactData = {
|
|
70
60
|
isRefresh: false,
|
|
71
61
|
connectFlag: 0,
|
|
72
62
|
columns: []
|
|
73
63
|
};
|
|
74
|
-
|
|
64
|
+
const internalData = {
|
|
75
65
|
connectTable: null
|
|
76
66
|
};
|
|
77
67
|
return {
|
|
78
|
-
xID
|
|
79
|
-
reactData
|
|
80
|
-
internalData
|
|
68
|
+
xID,
|
|
69
|
+
reactData,
|
|
70
|
+
internalData
|
|
81
71
|
};
|
|
82
72
|
},
|
|
83
73
|
computed: Object.assign(Object.assign({}, {}), {
|
|
84
|
-
computeRefreshOpts
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return Object.assign({}, getConfig().toolbar.refresh, props.refresh);
|
|
88
|
-
},
|
|
89
|
-
computeImportOpts
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return Object.assign({}, getConfig().toolbar.import, props.import);
|
|
93
|
-
},
|
|
94
|
-
computeExportOpts
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return Object.assign({}, getConfig().toolbar.export, props.export);
|
|
98
|
-
},
|
|
99
|
-
computePrintOpts
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return Object.assign({}, getConfig().toolbar.print, props.print);
|
|
103
|
-
},
|
|
104
|
-
computeZoomOpts
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return Object.assign({}, getConfig().toolbar.zoom, props.zoom);
|
|
108
|
-
},
|
|
109
|
-
computeCustomOpts
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return Object.assign({}, getConfig().toolbar.custom, props.custom);
|
|
113
|
-
},
|
|
114
|
-
computeTableCustomOpts
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
74
|
+
computeRefreshOpts() {
|
|
75
|
+
const $xeToolbar = this;
|
|
76
|
+
const props = $xeToolbar;
|
|
77
|
+
return Object.assign({}, _xeUtils.default.clone(getConfig().toolbar.refresh, true), props.refresh);
|
|
78
|
+
},
|
|
79
|
+
computeImportOpts() {
|
|
80
|
+
const $xeToolbar = this;
|
|
81
|
+
const props = $xeToolbar;
|
|
82
|
+
return Object.assign({}, _xeUtils.default.clone(getConfig().toolbar.import, true), props.import);
|
|
83
|
+
},
|
|
84
|
+
computeExportOpts() {
|
|
85
|
+
const $xeToolbar = this;
|
|
86
|
+
const props = $xeToolbar;
|
|
87
|
+
return Object.assign({}, _xeUtils.default.clone(getConfig().toolbar.export, true), props.export);
|
|
88
|
+
},
|
|
89
|
+
computePrintOpts() {
|
|
90
|
+
const $xeToolbar = this;
|
|
91
|
+
const props = $xeToolbar;
|
|
92
|
+
return Object.assign({}, _xeUtils.default.clone(getConfig().toolbar.print, true), props.print);
|
|
93
|
+
},
|
|
94
|
+
computeZoomOpts() {
|
|
95
|
+
const $xeToolbar = this;
|
|
96
|
+
const props = $xeToolbar;
|
|
97
|
+
return Object.assign({}, _xeUtils.default.clone(getConfig().toolbar.zoom, true), props.zoom);
|
|
98
|
+
},
|
|
99
|
+
computeCustomOpts() {
|
|
100
|
+
const $xeToolbar = this;
|
|
101
|
+
const props = $xeToolbar;
|
|
102
|
+
return Object.assign({}, _xeUtils.default.clone(getConfig().toolbar.custom, true), props.custom);
|
|
103
|
+
},
|
|
104
|
+
computeTableCustomOpts() {
|
|
105
|
+
const $xeToolbar = this;
|
|
106
|
+
const reactData = $xeToolbar.reactData;
|
|
107
|
+
const internalData = $xeToolbar.internalData;
|
|
108
|
+
const {
|
|
109
|
+
connectTable
|
|
110
|
+
} = internalData;
|
|
111
|
+
const $table = connectTable;
|
|
120
112
|
if (reactData.connectFlag || $table) {
|
|
121
113
|
if ($table) {
|
|
122
114
|
return $table.computeCustomOpts;
|
|
@@ -126,9 +118,9 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
126
118
|
trigger: ''
|
|
127
119
|
};
|
|
128
120
|
},
|
|
129
|
-
computeTrigger
|
|
130
|
-
|
|
131
|
-
|
|
121
|
+
computeTrigger() {
|
|
122
|
+
const $xeToolbar = this;
|
|
123
|
+
const tableCustomOpts = $xeToolbar.computeTableCustomOpts;
|
|
132
124
|
return tableCustomOpts.trigger;
|
|
133
125
|
}
|
|
134
126
|
}),
|
|
@@ -136,43 +128,48 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
136
128
|
//
|
|
137
129
|
// Method
|
|
138
130
|
//
|
|
139
|
-
dispatchEvent
|
|
140
|
-
|
|
131
|
+
dispatchEvent(type, params, evnt) {
|
|
132
|
+
const $xeToolbar = this;
|
|
141
133
|
$xeToolbar.$emit(type, createEvent(evnt, {
|
|
142
134
|
$toolbar: $xeToolbar
|
|
143
135
|
}, params));
|
|
144
136
|
},
|
|
145
|
-
fintTable
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
syncUpdate
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
137
|
+
fintTable() {
|
|
138
|
+
const {
|
|
139
|
+
$children
|
|
140
|
+
} = this.$parent;
|
|
141
|
+
const selfIndex = $children.indexOf(this);
|
|
142
|
+
return _xeUtils.default.find($children, (comp, index) => comp && comp.loadData && index > selfIndex && comp.$vnode.componentOptions.tag === 'vxe-table');
|
|
143
|
+
},
|
|
144
|
+
syncUpdate(params) {
|
|
145
|
+
const $xeToolbar = this;
|
|
146
|
+
const reactData = $xeToolbar.reactData;
|
|
147
|
+
const internalData = $xeToolbar.internalData;
|
|
156
148
|
internalData.connectTable = params.$table;
|
|
157
149
|
reactData.columns = params.collectColumn;
|
|
158
150
|
reactData.connectFlag++;
|
|
159
151
|
},
|
|
160
|
-
checkTable
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
152
|
+
checkTable() {
|
|
153
|
+
const $xeToolbar = this;
|
|
154
|
+
const internalData = $xeToolbar.internalData;
|
|
155
|
+
const {
|
|
156
|
+
connectTable
|
|
157
|
+
} = internalData;
|
|
158
|
+
const $table = connectTable;
|
|
165
159
|
if ($table) {
|
|
166
160
|
return true;
|
|
167
161
|
}
|
|
168
162
|
(0, _log.errLog)('vxe.error.barUnableLink');
|
|
169
163
|
},
|
|
170
|
-
handleClickSettingEvent
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
164
|
+
handleClickSettingEvent({
|
|
165
|
+
$event
|
|
166
|
+
}) {
|
|
167
|
+
const $xeToolbar = this;
|
|
168
|
+
const internalData = $xeToolbar.internalData;
|
|
169
|
+
const {
|
|
170
|
+
connectTable
|
|
171
|
+
} = internalData;
|
|
172
|
+
const $table = connectTable;
|
|
176
173
|
if ($table) {
|
|
177
174
|
if ($table.triggerCustomEvent) {
|
|
178
175
|
$table.triggerCustomEvent($event);
|
|
@@ -181,49 +178,58 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
181
178
|
}
|
|
182
179
|
}
|
|
183
180
|
},
|
|
184
|
-
handleMouseenterSettingEvent
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
181
|
+
handleMouseenterSettingEvent({
|
|
182
|
+
$event
|
|
183
|
+
}) {
|
|
184
|
+
const $xeToolbar = this;
|
|
185
|
+
const internalData = $xeToolbar.internalData;
|
|
186
|
+
const {
|
|
187
|
+
connectTable
|
|
188
|
+
} = internalData;
|
|
189
|
+
const $table = connectTable;
|
|
190
190
|
if ($table) {
|
|
191
191
|
$table.customOpenEvent($event);
|
|
192
192
|
} else {
|
|
193
193
|
(0, _log.errLog)('vxe.error.reqModule', ['VxeTableCustomModule']);
|
|
194
194
|
}
|
|
195
195
|
},
|
|
196
|
-
handleMouseleaveSettingEvent
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
196
|
+
handleMouseleaveSettingEvent({
|
|
197
|
+
$event
|
|
198
|
+
}) {
|
|
199
|
+
const $xeToolbar = this;
|
|
200
|
+
const internalData = $xeToolbar.internalData;
|
|
201
|
+
const {
|
|
202
|
+
connectTable
|
|
203
|
+
} = internalData;
|
|
204
|
+
const $table = connectTable;
|
|
202
205
|
if ($table) {
|
|
203
|
-
|
|
206
|
+
const {
|
|
207
|
+
customStore
|
|
208
|
+
} = $table.reactData;
|
|
204
209
|
customStore.activeBtn = false;
|
|
205
|
-
setTimeout(
|
|
210
|
+
setTimeout(() => {
|
|
206
211
|
if (!customStore.activeBtn && !customStore.activeWrapper) {
|
|
207
212
|
$table.customCloseEvent($event);
|
|
208
213
|
}
|
|
209
214
|
}, 350);
|
|
210
215
|
}
|
|
211
216
|
},
|
|
212
|
-
refreshEvent
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
refreshEvent({
|
|
218
|
+
$event
|
|
219
|
+
}) {
|
|
220
|
+
const $xeToolbar = this;
|
|
221
|
+
const reactData = $xeToolbar.reactData;
|
|
222
|
+
const $xeGrid = $xeToolbar.$xeGrid;
|
|
223
|
+
const {
|
|
224
|
+
isRefresh
|
|
225
|
+
} = reactData;
|
|
226
|
+
const refreshOpts = $xeToolbar.computeRefreshOpts;
|
|
219
227
|
if (!isRefresh) {
|
|
220
|
-
|
|
228
|
+
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
221
229
|
if (queryMethod) {
|
|
222
230
|
reactData.isRefresh = true;
|
|
223
231
|
try {
|
|
224
|
-
Promise.resolve(queryMethod({})).catch(
|
|
225
|
-
return e;
|
|
226
|
-
}).then(function () {
|
|
232
|
+
Promise.resolve(queryMethod({})).catch(e => e).then(() => {
|
|
227
233
|
reactData.isRefresh = false;
|
|
228
234
|
});
|
|
229
235
|
} catch (e) {
|
|
@@ -233,43 +239,46 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
233
239
|
reactData.isRefresh = true;
|
|
234
240
|
$xeGrid.triggerToolbarCommitEvent({
|
|
235
241
|
code: refreshOpts.code || 'reload'
|
|
236
|
-
}, $event).catch(
|
|
237
|
-
return e;
|
|
238
|
-
}).then(function () {
|
|
242
|
+
}, $event).catch(e => e).then(() => {
|
|
239
243
|
reactData.isRefresh = false;
|
|
240
244
|
});
|
|
241
245
|
}
|
|
242
246
|
}
|
|
243
247
|
},
|
|
244
|
-
zoomEvent
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
+
zoomEvent({
|
|
249
|
+
$event
|
|
250
|
+
}) {
|
|
251
|
+
const $xeToolbar = this;
|
|
252
|
+
const $xeGrid = $xeToolbar.$xeGrid;
|
|
248
253
|
if ($xeGrid) {
|
|
249
254
|
$xeGrid.triggerZoomEvent($event);
|
|
250
255
|
}
|
|
251
256
|
},
|
|
252
|
-
btnEvent
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
btnEvent(evnt, item) {
|
|
258
|
+
const $xeToolbar = this;
|
|
259
|
+
const internalData = $xeToolbar.internalData;
|
|
260
|
+
const $xeGrid = $xeToolbar.$xeGrid;
|
|
261
|
+
const {
|
|
262
|
+
connectTable
|
|
263
|
+
} = internalData;
|
|
264
|
+
const $table = connectTable;
|
|
265
|
+
const {
|
|
266
|
+
code
|
|
267
|
+
} = item;
|
|
259
268
|
if (code) {
|
|
260
269
|
if ($xeGrid) {
|
|
261
270
|
$xeGrid.triggerToolbarBtnEvent(item, evnt);
|
|
262
271
|
} else {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
code
|
|
272
|
+
const gCommandOpts = commands.get(code);
|
|
273
|
+
const params = {
|
|
274
|
+
code,
|
|
266
275
|
button: item,
|
|
267
276
|
$table: $table,
|
|
268
277
|
$grid: $xeGrid,
|
|
269
278
|
$event: evnt
|
|
270
279
|
};
|
|
271
280
|
if (gCommandOpts) {
|
|
272
|
-
|
|
281
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
273
282
|
if (tCommandMethod) {
|
|
274
283
|
tCommandMethod(params);
|
|
275
284
|
} else {
|
|
@@ -282,27 +291,31 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
282
291
|
}
|
|
283
292
|
}
|
|
284
293
|
},
|
|
285
|
-
tolEvent
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
294
|
+
tolEvent(evnt, item) {
|
|
295
|
+
const $xeToolbar = this;
|
|
296
|
+
const internalData = $xeToolbar.internalData;
|
|
297
|
+
const $xeGrid = $xeToolbar.$xeGrid;
|
|
298
|
+
const {
|
|
299
|
+
connectTable
|
|
300
|
+
} = internalData;
|
|
301
|
+
const $table = connectTable;
|
|
302
|
+
const {
|
|
303
|
+
code
|
|
304
|
+
} = item;
|
|
292
305
|
if (code) {
|
|
293
306
|
if ($xeGrid) {
|
|
294
307
|
$xeGrid.triggerToolbarTolEvent(item, evnt);
|
|
295
308
|
} else {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
code
|
|
309
|
+
const gCommandOpts = commands.get(code);
|
|
310
|
+
const params = {
|
|
311
|
+
code,
|
|
299
312
|
tool: item,
|
|
300
313
|
$table: $table,
|
|
301
314
|
$grid: $xeGrid,
|
|
302
315
|
$event: evnt
|
|
303
316
|
};
|
|
304
317
|
if (gCommandOpts) {
|
|
305
|
-
|
|
318
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
306
319
|
if (tCommandMethod) {
|
|
307
320
|
tCommandMethod(params);
|
|
308
321
|
} else {
|
|
@@ -315,34 +328,40 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
315
328
|
}
|
|
316
329
|
}
|
|
317
330
|
},
|
|
318
|
-
importEvent
|
|
319
|
-
|
|
320
|
-
|
|
331
|
+
importEvent() {
|
|
332
|
+
const $xeToolbar = this;
|
|
333
|
+
const internalData = $xeToolbar.internalData;
|
|
321
334
|
if ($xeToolbar.checkTable()) {
|
|
322
|
-
|
|
323
|
-
|
|
335
|
+
const {
|
|
336
|
+
connectTable
|
|
337
|
+
} = internalData;
|
|
338
|
+
const $table = connectTable;
|
|
324
339
|
if ($table) {
|
|
325
340
|
$table.openImport();
|
|
326
341
|
}
|
|
327
342
|
}
|
|
328
343
|
},
|
|
329
|
-
exportEvent
|
|
330
|
-
|
|
331
|
-
|
|
344
|
+
exportEvent() {
|
|
345
|
+
const $xeToolbar = this;
|
|
346
|
+
const internalData = $xeToolbar.internalData;
|
|
332
347
|
if ($xeToolbar.checkTable()) {
|
|
333
|
-
|
|
334
|
-
|
|
348
|
+
const {
|
|
349
|
+
connectTable
|
|
350
|
+
} = internalData;
|
|
351
|
+
const $table = connectTable;
|
|
335
352
|
if ($table) {
|
|
336
353
|
$table.openExport();
|
|
337
354
|
}
|
|
338
355
|
}
|
|
339
356
|
},
|
|
340
|
-
printEvent
|
|
341
|
-
|
|
342
|
-
|
|
357
|
+
printEvent() {
|
|
358
|
+
const $xeToolbar = this;
|
|
359
|
+
const internalData = $xeToolbar.internalData;
|
|
343
360
|
if ($xeToolbar.checkTable()) {
|
|
344
|
-
|
|
345
|
-
|
|
361
|
+
const {
|
|
362
|
+
connectTable
|
|
363
|
+
} = internalData;
|
|
364
|
+
const $table = connectTable;
|
|
346
365
|
if ($table) {
|
|
347
366
|
$table.openPrint();
|
|
348
367
|
}
|
|
@@ -351,14 +370,16 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
351
370
|
//
|
|
352
371
|
// Render
|
|
353
372
|
//
|
|
354
|
-
renderDropdowns
|
|
373
|
+
renderDropdowns(h, item, isBtn) {
|
|
355
374
|
// 使用已安装的组件,如果未安装则不渲染
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
375
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
376
|
+
const $xeToolbar = this;
|
|
377
|
+
const {
|
|
378
|
+
dropdowns
|
|
379
|
+
} = item;
|
|
380
|
+
const downVNs = [];
|
|
360
381
|
if (dropdowns) {
|
|
361
|
-
return dropdowns.map(
|
|
382
|
+
return dropdowns.map((child, index) => {
|
|
362
383
|
if (child.visible === false) {
|
|
363
384
|
return renderEmptyElement($xeToolbar);
|
|
364
385
|
}
|
|
@@ -373,13 +394,17 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
373
394
|
circle: child.circle,
|
|
374
395
|
round: child.round,
|
|
375
396
|
status: child.status,
|
|
376
|
-
content: child.name
|
|
397
|
+
content: child.name,
|
|
398
|
+
title: child.title,
|
|
399
|
+
routerLink: child.routerLink,
|
|
400
|
+
permissionCode: child.permissionCode,
|
|
401
|
+
prefixTooltip: child.prefixTooltip,
|
|
402
|
+
suffixTooltip: child.suffixTooltip
|
|
377
403
|
},
|
|
378
404
|
on: {
|
|
379
|
-
click:
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
405
|
+
click: ({
|
|
406
|
+
$event
|
|
407
|
+
}) => isBtn ? $xeToolbar.btnEvent($event, child) : $xeToolbar.tolEvent($event, child)
|
|
383
408
|
}
|
|
384
409
|
}) : renderEmptyElement($xeToolbar);
|
|
385
410
|
});
|
|
@@ -389,27 +414,32 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
389
414
|
/**
|
|
390
415
|
* 渲染按钮
|
|
391
416
|
*/
|
|
392
|
-
renderBtns
|
|
393
|
-
var _this = this;
|
|
417
|
+
renderBtns(h) {
|
|
394
418
|
// 使用已安装的组件,如果未安装则不渲染
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
419
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
420
|
+
const $xeToolbar = this;
|
|
421
|
+
const props = $xeToolbar;
|
|
422
|
+
const internalData = $xeToolbar.internalData;
|
|
423
|
+
const $xeGrid = $xeToolbar.$xeGrid;
|
|
424
|
+
const {
|
|
425
|
+
buttons
|
|
426
|
+
} = props;
|
|
427
|
+
const {
|
|
428
|
+
connectTable
|
|
429
|
+
} = internalData;
|
|
430
|
+
const $table = connectTable;
|
|
431
|
+
const btnVNs = [];
|
|
404
432
|
if (buttons) {
|
|
405
|
-
buttons.forEach(
|
|
406
|
-
|
|
407
|
-
|
|
433
|
+
buttons.forEach(item => {
|
|
434
|
+
const {
|
|
435
|
+
dropdowns,
|
|
436
|
+
buttonRender
|
|
437
|
+
} = item;
|
|
408
438
|
if (item.visible !== false) {
|
|
409
|
-
|
|
439
|
+
const compConf = buttonRender ? renderer.get(buttonRender.name) : null;
|
|
410
440
|
if (buttonRender && compConf && compConf.renderToolbarButton) {
|
|
411
|
-
|
|
412
|
-
|
|
441
|
+
const toolbarButtonClassName = compConf.toolbarButtonClassName;
|
|
442
|
+
const params = {
|
|
413
443
|
$grid: $xeGrid,
|
|
414
444
|
$table: $table,
|
|
415
445
|
button: item
|
|
@@ -430,21 +460,22 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
430
460
|
round: item.round,
|
|
431
461
|
status: item.status,
|
|
432
462
|
content: item.name,
|
|
463
|
+
title: item.title,
|
|
464
|
+
routerLink: item.routerLink,
|
|
433
465
|
permissionCode: item.permissionCode,
|
|
466
|
+
prefixTooltip: item.prefixTooltip,
|
|
467
|
+
suffixTooltip: item.suffixTooltip,
|
|
434
468
|
destroyOnClose: item.destroyOnClose,
|
|
435
469
|
placement: item.placement,
|
|
436
470
|
transfer: item.transfer
|
|
437
471
|
},
|
|
438
472
|
on: {
|
|
439
|
-
click:
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
}
|
|
473
|
+
click: ({
|
|
474
|
+
$event
|
|
475
|
+
}) => this.btnEvent($event, item)
|
|
443
476
|
},
|
|
444
477
|
scopedSlots: dropdowns && dropdowns.length ? {
|
|
445
|
-
dropdowns:
|
|
446
|
-
return _this.renderDropdowns(h, item, true);
|
|
447
|
-
}
|
|
478
|
+
dropdowns: () => this.renderDropdowns(h, item, true)
|
|
448
479
|
} : {}
|
|
449
480
|
}));
|
|
450
481
|
}
|
|
@@ -457,27 +488,33 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
457
488
|
/**
|
|
458
489
|
* 渲染右侧工具
|
|
459
490
|
*/
|
|
460
|
-
renderRightTools
|
|
491
|
+
renderRightTools(h) {
|
|
461
492
|
// 使用已安装的组件,如果未安装则不渲染
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
493
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
494
|
+
const $xeToolbar = this;
|
|
495
|
+
const props = $xeToolbar;
|
|
496
|
+
const internalData = $xeToolbar.internalData;
|
|
497
|
+
const $xeGrid = $xeToolbar.$xeGrid;
|
|
498
|
+
const {
|
|
499
|
+
tools
|
|
500
|
+
} = props;
|
|
501
|
+
const {
|
|
502
|
+
connectTable
|
|
503
|
+
} = internalData;
|
|
504
|
+
const $table = connectTable;
|
|
505
|
+
const btnVNs = [];
|
|
471
506
|
if (tools) {
|
|
472
|
-
tools.forEach(
|
|
473
|
-
|
|
474
|
-
|
|
507
|
+
tools.forEach((item, tIndex) => {
|
|
508
|
+
const {
|
|
509
|
+
dropdowns,
|
|
510
|
+
toolRender
|
|
511
|
+
} = item;
|
|
475
512
|
if (item.visible !== false) {
|
|
476
|
-
|
|
477
|
-
|
|
513
|
+
const rdName = toolRender ? toolRender.name : null;
|
|
514
|
+
const compConf = toolRender ? renderer.get(rdName) : null;
|
|
478
515
|
if (toolRender && compConf && compConf.renderToolbarTool) {
|
|
479
|
-
|
|
480
|
-
|
|
516
|
+
const toolbarToolClassName = compConf.toolbarToolClassName;
|
|
517
|
+
const params = {
|
|
481
518
|
$grid: $xeGrid,
|
|
482
519
|
$table: $table,
|
|
483
520
|
tool: item
|
|
@@ -500,20 +537,22 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
500
537
|
round: item.round,
|
|
501
538
|
status: item.status,
|
|
502
539
|
content: item.name,
|
|
540
|
+
title: item.title,
|
|
541
|
+
routerLink: item.routerLink,
|
|
542
|
+
permissionCode: item.permissionCode,
|
|
543
|
+
prefixTooltip: item.prefixTooltip,
|
|
544
|
+
suffixTooltip: item.suffixTooltip,
|
|
503
545
|
destroyOnClose: item.destroyOnClose,
|
|
504
546
|
placement: item.placement,
|
|
505
547
|
transfer: item.transfer
|
|
506
548
|
},
|
|
507
549
|
on: {
|
|
508
|
-
click:
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}
|
|
550
|
+
click: ({
|
|
551
|
+
$event
|
|
552
|
+
}) => $xeToolbar.tolEvent($event, item)
|
|
512
553
|
},
|
|
513
554
|
scopedSlots: dropdowns && dropdowns.length ? {
|
|
514
|
-
dropdowns:
|
|
515
|
-
return $xeToolbar.renderDropdowns(h, item, false);
|
|
516
|
-
}
|
|
555
|
+
dropdowns: () => $xeToolbar.renderDropdowns(h, item, false)
|
|
517
556
|
} : {}
|
|
518
557
|
}));
|
|
519
558
|
}
|
|
@@ -523,11 +562,11 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
523
562
|
}
|
|
524
563
|
return btnVNs;
|
|
525
564
|
},
|
|
526
|
-
renderToolImport
|
|
565
|
+
renderToolImport(h) {
|
|
527
566
|
// 使用已安装的组件,如果未安装则不渲染
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
567
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
568
|
+
const $xeToolbar = this;
|
|
569
|
+
const importOpts = $xeToolbar.computeImportOpts;
|
|
531
570
|
return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
532
571
|
key: 'import',
|
|
533
572
|
props: {
|
|
@@ -540,11 +579,11 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
540
579
|
}
|
|
541
580
|
}) : renderEmptyElement($xeToolbar);
|
|
542
581
|
},
|
|
543
|
-
renderToolExport
|
|
582
|
+
renderToolExport(h) {
|
|
544
583
|
// 使用已安装的组件,如果未安装则不渲染
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
584
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
585
|
+
const $xeToolbar = this;
|
|
586
|
+
const exportOpts = $xeToolbar.computeExportOpts;
|
|
548
587
|
return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
549
588
|
key: 'export',
|
|
550
589
|
props: {
|
|
@@ -557,11 +596,11 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
557
596
|
}
|
|
558
597
|
}) : renderEmptyElement($xeToolbar);
|
|
559
598
|
},
|
|
560
|
-
renderToolPrint
|
|
599
|
+
renderToolPrint(h) {
|
|
561
600
|
// 使用已安装的组件,如果未安装则不渲染
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
601
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
602
|
+
const $xeToolbar = this;
|
|
603
|
+
const printOpts = $xeToolbar.computePrintOpts;
|
|
565
604
|
return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
566
605
|
key: 'print',
|
|
567
606
|
props: {
|
|
@@ -574,12 +613,12 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
574
613
|
}
|
|
575
614
|
}) : renderEmptyElement($xeToolbar);
|
|
576
615
|
},
|
|
577
|
-
renderToolRefresh
|
|
616
|
+
renderToolRefresh(h) {
|
|
578
617
|
// 使用已安装的组件,如果未安装则不渲染
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
618
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
619
|
+
const $xeToolbar = this;
|
|
620
|
+
const reactData = $xeToolbar.reactData;
|
|
621
|
+
const refreshOpts = $xeToolbar.computeRefreshOpts;
|
|
583
622
|
return VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
584
623
|
key: 'refresh',
|
|
585
624
|
props: {
|
|
@@ -592,31 +631,31 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
592
631
|
}
|
|
593
632
|
}) : renderEmptyElement($xeToolbar);
|
|
594
633
|
},
|
|
595
|
-
renderToolZoom
|
|
634
|
+
renderToolZoom(h) {
|
|
596
635
|
// 使用已安装的组件,如果未安装则不渲染
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
636
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
637
|
+
const $xeToolbar = this;
|
|
638
|
+
const $xeGrid = $xeToolbar.$xeGrid;
|
|
639
|
+
const zoomOpts = $xeToolbar.computeZoomOpts;
|
|
601
640
|
return $xeGrid && VxeUIButtonComponent ? h(VxeUIButtonComponent, {
|
|
602
641
|
key: 'zoom',
|
|
603
642
|
props: {
|
|
604
643
|
circle: true,
|
|
605
644
|
icon: $xeGrid.isMaximized() ? zoomOpts.iconOut || getIcon().TOOLBAR_TOOLS_MINIMIZE : zoomOpts.iconIn || getIcon().TOOLBAR_TOOLS_FULLSCREEN,
|
|
606
|
-
title: getI18n(
|
|
645
|
+
title: getI18n(`vxe.toolbar.zoom${$xeGrid.isMaximized() ? 'Out' : 'In'}`)
|
|
607
646
|
},
|
|
608
647
|
on: {
|
|
609
648
|
click: $xeToolbar.zoomEvent
|
|
610
649
|
}
|
|
611
650
|
}) : renderEmptyElement($xeToolbar);
|
|
612
651
|
},
|
|
613
|
-
renderToolCustom
|
|
652
|
+
renderToolCustom(h) {
|
|
614
653
|
// 使用已安装的组件,如果未安装则不渲染
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
654
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
655
|
+
const $xeToolbar = this;
|
|
656
|
+
const customOpts = $xeToolbar.computeCustomOpts;
|
|
657
|
+
const btnTrigger = $xeToolbar.computeTrigger;
|
|
658
|
+
const customBtnOns = {};
|
|
620
659
|
if (btnTrigger === 'manual') {
|
|
621
660
|
// 手动触发
|
|
622
661
|
} else if (btnTrigger === 'hover') {
|
|
@@ -638,28 +677,36 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
638
677
|
on: customBtnOns
|
|
639
678
|
}) : renderEmptyElement($xeToolbar);
|
|
640
679
|
},
|
|
641
|
-
renderVN
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
680
|
+
renderVN(h) {
|
|
681
|
+
const $xeToolbar = this;
|
|
682
|
+
const props = $xeToolbar;
|
|
683
|
+
const slots = $xeToolbar.$scopedSlots;
|
|
684
|
+
const internalData = $xeToolbar.internalData;
|
|
685
|
+
const $xeGrid = $xeToolbar.$xeGrid;
|
|
686
|
+
const {
|
|
687
|
+
perfect,
|
|
688
|
+
loading,
|
|
689
|
+
refresh,
|
|
690
|
+
zoom,
|
|
691
|
+
custom,
|
|
692
|
+
className
|
|
693
|
+
} = props;
|
|
694
|
+
const {
|
|
695
|
+
connectTable
|
|
696
|
+
} = internalData;
|
|
697
|
+
const $table = connectTable;
|
|
698
|
+
const toolsSlot = slots.tools;
|
|
699
|
+
const buttonsSlot = slots.buttons;
|
|
700
|
+
const vSize = $xeToolbar.computeSize;
|
|
658
701
|
return h('div', {
|
|
659
702
|
ref: 'refElem',
|
|
660
703
|
class: ['vxe-toolbar', className ? _xeUtils.default.isFunction(className) ? className({
|
|
661
704
|
$toolbar: $xeToolbar
|
|
662
|
-
}) : className : '',
|
|
705
|
+
}) : className : '', {
|
|
706
|
+
[`size--${vSize}`]: vSize,
|
|
707
|
+
'is--perfect': perfect,
|
|
708
|
+
'is--loading': loading
|
|
709
|
+
}]
|
|
663
710
|
}, [h('div', {
|
|
664
711
|
class: 'vxe-buttons--wrapper'
|
|
665
712
|
}, buttonsSlot ? buttonsSlot({
|
|
@@ -675,23 +722,24 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
675
722
|
}, [props.import ? $xeToolbar.renderToolImport(h) : renderEmptyElement($xeToolbar), props.export ? $xeToolbar.renderToolExport(h) : renderEmptyElement($xeToolbar), props.print ? $xeToolbar.renderToolPrint(h) : renderEmptyElement($xeToolbar), refresh ? $xeToolbar.renderToolRefresh(h) : renderEmptyElement($xeToolbar), zoom && $xeGrid ? $xeToolbar.renderToolZoom(h) : renderEmptyElement($xeToolbar), custom ? $xeToolbar.renderToolCustom(h) : renderEmptyElement($xeToolbar)])]);
|
|
676
723
|
}
|
|
677
724
|
},
|
|
678
|
-
created
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
725
|
+
created() {
|
|
726
|
+
const $xeToolbar = this;
|
|
727
|
+
const props = $xeToolbar;
|
|
728
|
+
const $xeGrid = $xeToolbar.$xeGrid;
|
|
729
|
+
$xeToolbar.$nextTick(() => {
|
|
730
|
+
const {
|
|
731
|
+
refresh
|
|
732
|
+
} = props;
|
|
733
|
+
const refreshOpts = $xeToolbar.computeRefreshOpts;
|
|
734
|
+
const $xetable = this.fintTable();
|
|
735
|
+
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
688
736
|
if (refresh && !$xeGrid && !queryMethod) {
|
|
689
737
|
(0, _log.warnLog)('vxe.error.notFunc', ['queryMethod']);
|
|
690
738
|
}
|
|
691
739
|
if ($xetable) {
|
|
692
|
-
$xetable.connect(
|
|
740
|
+
$xetable.connect(this);
|
|
693
741
|
}
|
|
694
|
-
|
|
742
|
+
const customOpts = $xeToolbar.computeCustomOpts;
|
|
695
743
|
if (process.env.NODE_ENV === 'development') {
|
|
696
744
|
if (customOpts.isFooter) {
|
|
697
745
|
(0, _log.warnLog)('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
|
|
@@ -709,7 +757,7 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
709
757
|
});
|
|
710
758
|
if (process.env.NODE_ENV === 'development') {
|
|
711
759
|
// 使用已安装的组件,如果未安装则不渲染
|
|
712
|
-
|
|
760
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
713
761
|
if (props.refresh || props.import || props.export || props.print || props.zoom) {
|
|
714
762
|
if (!VxeUIButtonComponent) {
|
|
715
763
|
(0, _log.errLog)('vxe.error.reqComp', ['vxe-button']);
|
|
@@ -717,7 +765,7 @@ var _default2 = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
717
765
|
}
|
|
718
766
|
}
|
|
719
767
|
},
|
|
720
|
-
render
|
|
768
|
+
render(h) {
|
|
721
769
|
return this.renderVN(h);
|
|
722
770
|
}
|
|
723
771
|
});
|