vxe-table 3.8.8-beta.2 → 3.8.8-beta.3
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/lib/custom/src/mixin.js +19 -1
- package/lib/custom/src/mixin.min.js +1 -1
- package/lib/custom/src/panel.js +217 -94
- package/lib/custom/src/panel.min.js +1 -1
- package/lib/custom/style/style.css +86 -21
- package/lib/custom/style/style.min.css +1 -1
- package/lib/icon/style/{iconfont.1717485750049.ttf → iconfont.1717666158668.ttf} +0 -0
- package/lib/icon/style/iconfont.1717666158668.woff +0 -0
- package/lib/icon/style/iconfont.1717666158668.woff2 +0 -0
- package/lib/icon/style/style.css +124 -4
- package/lib/icon/style/style.min.css +124 -4
- package/lib/{iconfont.1717485750049.ttf → iconfont.1717666158668.ttf} +0 -0
- package/lib/iconfont.1717666158668.woff +0 -0
- package/lib/iconfont.1717666158668.woff2 +0 -0
- package/lib/index.css +1 -1
- package/lib/index.umd.js +261 -106
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- 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/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +2 -1
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +2 -1
- package/lib/locale/lang/zh-TC.js +2 -1
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +2 -1
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +2 -1
- package/lib/pager/src/pager.js +1 -1
- package/lib/pager/src/pager.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/columnInfo.js +2 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +7 -1
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +4 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +7 -5
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/style/style.css +124 -4
- package/lib/v-x-e-table/style/style.min.css +1 -1
- package/lib/vxe-icon/style/style.css +124 -4
- package/lib/vxe-icon/style/style.min.css +1 -1
- package/lib/vxe-table-custom-module/style/style.css +86 -21
- package/lib/vxe-table-custom-module/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/custom/src/mixin.js +17 -1
- package/packages/custom/src/panel.js +349 -196
- package/packages/locale/lang/en-US.js +2 -1
- package/packages/locale/lang/es-ES.js +2 -1
- package/packages/locale/lang/ja-JP.js +2 -1
- package/packages/locale/lang/pt-BR.js +2 -1
- package/packages/locale/lang/zh-CN.js +2 -1
- package/packages/locale/lang/zh-TC.js +2 -1
- package/packages/pager/src/pager.js +1 -1
- package/packages/table/src/columnInfo.js +3 -0
- package/packages/table/src/methods.js +4 -1
- package/packages/table/src/table.js +4 -1
- package/packages/v-x-e-table/src/conf.js +9 -7
- package/styles/custom.scss +86 -8
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/styles/icon.scss +124 -4
- package/styles/old-icon.scss +2 -2
- package/lib/icon/style/iconfont.1717485750049.woff +0 -0
- package/lib/icon/style/iconfont.1717485750049.woff2 +0 -0
- package/lib/iconfont.1717485750049.woff +0 -0
- package/lib/iconfont.1717485750049.woff2 +0 -0
package/lib/custom/src/mixin.js
CHANGED
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
7
9
|
var _default = exports.default = {
|
|
8
10
|
methods: {
|
|
9
11
|
_openCustom: function _openCustom() {
|
|
@@ -11,9 +13,25 @@ var _default = exports.default = {
|
|
|
11
13
|
var initStore = this.initStore,
|
|
12
14
|
customStore = this.customStore,
|
|
13
15
|
collectColumn = this.collectColumn;
|
|
16
|
+
var sortMaps = {};
|
|
17
|
+
var fixedMaps = {};
|
|
18
|
+
var visibleMaps = {};
|
|
19
|
+
_xeUtils.default.eachTree(collectColumn, function (column) {
|
|
20
|
+
var colid = column.getKey();
|
|
21
|
+
column.renderFixed = column.fixed;
|
|
22
|
+
column.renderVisible = column.visible;
|
|
23
|
+
sortMaps[colid] = column.renderSortNumber;
|
|
24
|
+
fixedMaps[colid] = column.fixed;
|
|
25
|
+
visibleMaps[colid] = column.visible;
|
|
26
|
+
}, {
|
|
27
|
+
children: 'children'
|
|
28
|
+
});
|
|
29
|
+
customStore.oldSortMaps = sortMaps;
|
|
30
|
+
customStore.oldFixedMaps = fixedMaps;
|
|
31
|
+
customStore.oldVisibleMaps = visibleMaps;
|
|
32
|
+
this.customColumnList = collectColumn.slice(0);
|
|
14
33
|
customStore.visible = true;
|
|
15
34
|
initStore.custom = true;
|
|
16
|
-
this.customColumnList = collectColumn.slice(0);
|
|
17
35
|
this.checkCustomStatus();
|
|
18
36
|
this.calcMaxHeight();
|
|
19
37
|
return this.$nextTick().then(function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=exports.default={methods:{_openCustom:function(){var t=this,e=this.initStore,i=this.customStore,s=this.collectColumn;return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}var _default=exports.default={methods:{_openCustom:function(){var t=this,e=this.initStore,i=this.customStore,s=this.collectColumn,o={},n={},u={};return _xeUtils.default.eachTree(s,function(t){var e=t.getKey();t.renderFixed=t.fixed,t.renderVisible=t.visible,o[e]=t.renderSortNumber,n[e]=t.fixed,u[e]=t.visible},{children:"children"}),i.oldSortMaps=o,i.oldFixedMaps=n,i.oldVisibleMaps=u,this.customColumnList=s.slice(0),i.visible=!0,e.custom=!0,this.checkCustomStatus(),this.calcMaxHeight(),this.$nextTick().then(function(){return t.calcMaxHeight()})},_closeCustom:function(){var t=this.customStore,e=this.customOpts;return t.visible&&(t.visible=!1,e.immediate||this.handleCustom()),this.$nextTick()},calcMaxHeight:function(){var t=this.$refs,e=this.customStore,i=t.customWrapper?t.customWrapper.$el:null,s=t.tableHeader?t.tableHeader.$el:null,t=t.tableBody?t.tableBody.$el:null,o=0;s&&(o+=s.clientHeight),t&&(o+=t.clientHeight),e.maxHeight=Math.max(0,i?Math.min(i.clientHeight,o-80):0)},checkCustomStatus:function(){var t=this.customStore,e=this.collectColumn,i=this.customOpts.checkMethod;t.isAll=e.every(function(t){return!!i&&!i({column:t})||t.visible}),t.isIndeterminate=!t.isAll&&e.some(function(t){return(!i||i({column:t}))&&(t.visible||t.halfVisible)})},emitCustomEvent:function(t,e){(this.$xegrid||this).$emit("custom",{type:t,$table:this,$grid:this.$xegrid,$event:e})},triggerCustomEvent:function(t){var e=this.customStore;e.visible?(this.closeCustom(),this.emitCustomEvent("close",t)):(e.btnEl=t.target,this.openCustom(),this.emitCustomEvent("open",t))},customOpenEvent:function(t){var e=this.customStore;e.visible||(e.activeBtn=!0,e.btnEl=t.target,this.openCustom(),this.emitCustomEvent("open",t))},customColseEvent:function(t){var e=this.customStore;e.visible&&(e.activeBtn=!1,this.closeCustom(),this.emitCustomEvent("close",t))}}};
|
package/lib/custom/src/panel.js
CHANGED
|
@@ -28,15 +28,18 @@ function updateDropHint(_vm, evnt) {
|
|
|
28
28
|
dragHintEl.style.left = "".concat(Math.min(wrapperEl.clientWidth - wrapperEl.scrollLeft - dragHintEl.clientWidth - 16, evnt.clientX - wrapperRect.x), "px");
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function renderSimplePanel(h, _vm) {
|
|
32
|
-
var
|
|
31
|
+
var renderSimplePanel = function renderSimplePanel(h, _vm) {
|
|
32
|
+
var _e = _vm._e,
|
|
33
|
+
$xetable = _vm.$xetable,
|
|
33
34
|
customStore = _vm.customStore;
|
|
34
|
-
var
|
|
35
|
-
|
|
35
|
+
var customColumnList = $xetable.customColumnList,
|
|
36
|
+
customOpts = $xetable.customOpts,
|
|
36
37
|
isMaxFixedColumn = $xetable.isMaxFixedColumn;
|
|
37
38
|
var maxHeight = customStore.maxHeight;
|
|
38
39
|
var checkMethod = customOpts.checkMethod,
|
|
39
40
|
visibleMethod = customOpts.visibleMethod,
|
|
41
|
+
allowSort = customOpts.allowSort,
|
|
42
|
+
allowFixed = customOpts.allowFixed,
|
|
40
43
|
trigger = customOpts.trigger;
|
|
41
44
|
var colVNs = [];
|
|
42
45
|
var customWrapperOns = {};
|
|
@@ -50,7 +53,7 @@ function renderSimplePanel(h, _vm) {
|
|
|
50
53
|
column: column
|
|
51
54
|
}) : true;
|
|
52
55
|
if (isVisible) {
|
|
53
|
-
var isChecked = column.
|
|
56
|
+
var isChecked = column.renderVisible;
|
|
54
57
|
var isIndeterminate = column.halfVisible;
|
|
55
58
|
var isColGroup = column.children && column.children.length;
|
|
56
59
|
var colTitle = formatText(column.getTitle(), 1);
|
|
@@ -59,16 +62,26 @@ function renderSimplePanel(h, _vm) {
|
|
|
59
62
|
}) : false;
|
|
60
63
|
colVNs.push(h('li', {
|
|
61
64
|
key: column.id,
|
|
65
|
+
attrs: {
|
|
66
|
+
colid: column.id
|
|
67
|
+
},
|
|
62
68
|
class: ['vxe-table-custom--option', "level--".concat(column.level), {
|
|
63
69
|
'is--group': isColGroup
|
|
64
|
-
}]
|
|
70
|
+
}],
|
|
71
|
+
on: {
|
|
72
|
+
dragstart: _vm.sortDragstartEvent,
|
|
73
|
+
dragend: _vm.sortDragendEvent,
|
|
74
|
+
dragover: _vm.sortDragoverEvent
|
|
75
|
+
}
|
|
65
76
|
}, [h('div', {
|
|
66
|
-
title: colTitle,
|
|
67
77
|
class: ['vxe-table-custom--checkbox-option', {
|
|
68
78
|
'is--checked': isChecked,
|
|
69
79
|
'is--indeterminate': isIndeterminate,
|
|
70
80
|
'is--disabled': isDisabled
|
|
71
81
|
}],
|
|
82
|
+
attrs: {
|
|
83
|
+
title: _conf.default.i18n('vxe.custom.setting.colVisible')
|
|
84
|
+
},
|
|
72
85
|
on: {
|
|
73
86
|
click: function click() {
|
|
74
87
|
if (!isDisabled) {
|
|
@@ -78,17 +91,33 @@ function renderSimplePanel(h, _vm) {
|
|
|
78
91
|
}
|
|
79
92
|
}, [h('span', {
|
|
80
93
|
class: ['vxe-checkbox--icon', isIndeterminate ? _conf.default.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? _conf.default.icon.TABLE_CHECKBOX_CHECKED : _conf.default.icon.TABLE_CHECKBOX_UNCHECKED]
|
|
81
|
-
}), h('
|
|
82
|
-
class: 'vxe-
|
|
83
|
-
},
|
|
94
|
+
})]), allowSort && column.level === 1 ? h('div', {
|
|
95
|
+
class: 'vxe-table-custom--sort-option'
|
|
96
|
+
}, [h('span', {
|
|
97
|
+
class: 'vxe-table-custom--sort-btn',
|
|
98
|
+
attrs: {
|
|
99
|
+
title: _conf.default.i18n('vxe.custom.setting.sortHelpTip')
|
|
100
|
+
},
|
|
101
|
+
on: {
|
|
102
|
+
mousedown: _vm.sortMousedownEvent,
|
|
103
|
+
mouseup: _vm.sortMouseupEvent
|
|
104
|
+
}
|
|
105
|
+
}, [h('i', {
|
|
106
|
+
class: _conf.default.icon.TABLE_CUSTOM_SORT
|
|
107
|
+
})])]) : _e(), h('div', {
|
|
108
|
+
class: 'vxe-table-custom--checkbox-label',
|
|
109
|
+
attrs: {
|
|
110
|
+
title: colTitle
|
|
111
|
+
}
|
|
112
|
+
}, colTitle), !parent && allowFixed ? h('div', {
|
|
84
113
|
class: 'vxe-table-custom--fixed-option'
|
|
85
114
|
}, [h('span', {
|
|
86
|
-
class: ['vxe-table-custom--fixed-left-option', column.
|
|
87
|
-
'is--checked': column.
|
|
88
|
-
'is--disabled': isMaxFixedColumn && !column.
|
|
115
|
+
class: ['vxe-table-custom--fixed-left-option', column.renderFixed === 'left' ? _conf.default.icon.TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : _conf.default.icon.TOOLBAR_TOOLS_FIXED_LEFT, {
|
|
116
|
+
'is--checked': column.renderFixed === 'left',
|
|
117
|
+
'is--disabled': isMaxFixedColumn && !column.renderFixed
|
|
89
118
|
}],
|
|
90
119
|
attrs: {
|
|
91
|
-
title: _conf.default.i18n(column.
|
|
120
|
+
title: _conf.default.i18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
|
|
92
121
|
},
|
|
93
122
|
on: {
|
|
94
123
|
click: function click() {
|
|
@@ -96,19 +125,19 @@ function renderSimplePanel(h, _vm) {
|
|
|
96
125
|
}
|
|
97
126
|
}
|
|
98
127
|
}), h('span', {
|
|
99
|
-
class: ['vxe-table-custom--fixed-right-option', column.
|
|
100
|
-
'is--checked': column.
|
|
101
|
-
'is--disabled': isMaxFixedColumn && !column.
|
|
128
|
+
class: ['vxe-table-custom--fixed-right-option', column.renderFixed === 'right' ? _conf.default.icon.TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : _conf.default.icon.TOOLBAR_TOOLS_FIXED_RIGHT, {
|
|
129
|
+
'is--checked': column.renderFixed === 'right',
|
|
130
|
+
'is--disabled': isMaxFixedColumn && !column.renderFixed
|
|
102
131
|
}],
|
|
103
132
|
attrs: {
|
|
104
|
-
title: _conf.default.i18n(column.
|
|
133
|
+
title: _conf.default.i18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
|
|
105
134
|
},
|
|
106
135
|
on: {
|
|
107
136
|
click: function click() {
|
|
108
137
|
_vm.changeFixedOption(column, 'right');
|
|
109
138
|
}
|
|
110
139
|
}
|
|
111
|
-
})]) :
|
|
140
|
+
})]) : _e()]));
|
|
112
141
|
}
|
|
113
142
|
});
|
|
114
143
|
var isAllChecked = customStore.isAll;
|
|
@@ -118,7 +147,7 @@ function renderSimplePanel(h, _vm) {
|
|
|
118
147
|
class: ['vxe-table-custom-wrapper', {
|
|
119
148
|
'is--active': customStore.visible
|
|
120
149
|
}]
|
|
121
|
-
}, [h('ul', {
|
|
150
|
+
}, customStore.visible ? [h('ul', {
|
|
122
151
|
class: 'vxe-table-custom--header'
|
|
123
152
|
}, [h('li', {
|
|
124
153
|
class: 'vxe-table-custom--option'
|
|
@@ -137,34 +166,52 @@ function renderSimplePanel(h, _vm) {
|
|
|
137
166
|
class: ['vxe-checkbox--icon', isAllIndeterminate ? _conf.default.icon.TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? _conf.default.icon.TABLE_CHECKBOX_CHECKED : _conf.default.icon.TABLE_CHECKBOX_UNCHECKED]
|
|
138
167
|
}), h('span', {
|
|
139
168
|
class: 'vxe-checkbox--label'
|
|
140
|
-
}, _conf.default.i18n('vxe.toolbar.customAll'))])])]), h('
|
|
169
|
+
}, _conf.default.i18n('vxe.toolbar.customAll'))])])]), h('div', {
|
|
170
|
+
ref: 'bodyElemRef',
|
|
171
|
+
class: 'vxe-table-custom--list-wrapper'
|
|
172
|
+
}, [h('transition-group', {
|
|
141
173
|
class: 'vxe-table-custom--body',
|
|
174
|
+
props: {
|
|
175
|
+
name: 'vxe-table-custom--list',
|
|
176
|
+
tag: 'ul'
|
|
177
|
+
},
|
|
142
178
|
style: maxHeight ? {
|
|
143
179
|
maxHeight: "".concat(maxHeight, "px")
|
|
144
180
|
} : {},
|
|
145
181
|
on: customWrapperOns
|
|
146
|
-
}, colVNs),
|
|
182
|
+
}, colVNs), h('div', {
|
|
183
|
+
ref: 'dragHintElemRef',
|
|
184
|
+
class: 'vxe-table-custom-popup--drag-hint'
|
|
185
|
+
}, _conf.default.i18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))]), customOpts.showFooter ? h('div', {
|
|
147
186
|
class: 'vxe-table-custom--footer'
|
|
148
187
|
}, [h('button', {
|
|
149
188
|
class: 'btn--reset',
|
|
150
189
|
on: {
|
|
151
190
|
click: _vm.resetCustomEvent
|
|
152
191
|
}
|
|
153
|
-
}, customOpts.resetButtonText || _conf.default.i18n('vxe.
|
|
192
|
+
}, customOpts.resetButtonText || _conf.default.i18n('vxe.table.customRestore')), customOpts.immediate ? _e() : h('button', {
|
|
193
|
+
class: 'btn--cancel',
|
|
194
|
+
on: {
|
|
195
|
+
click: _vm.cancelCustomEvent
|
|
196
|
+
}
|
|
197
|
+
}, customOpts.resetButtonText || _conf.default.i18n('vxe.table.customCancel')), h('button', {
|
|
154
198
|
class: 'btn--confirm',
|
|
155
199
|
on: {
|
|
156
200
|
click: _vm.confirmCustomEvent
|
|
157
201
|
}
|
|
158
|
-
}, customOpts.confirmButtonText || _conf.default.i18n('vxe.
|
|
159
|
-
}
|
|
160
|
-
function renderPopupPanel(h, _vm) {
|
|
161
|
-
var
|
|
202
|
+
}, customOpts.confirmButtonText || _conf.default.i18n('vxe.table.customConfirm'))]) : null] : []);
|
|
203
|
+
};
|
|
204
|
+
var renderPopupPanel = function renderPopupPanel(h, _vm) {
|
|
205
|
+
var _e = _vm._e,
|
|
206
|
+
$xetable = _vm.$xetable,
|
|
162
207
|
customStore = _vm.customStore;
|
|
163
208
|
var customOpts = $xetable.customOpts,
|
|
164
209
|
customColumnList = $xetable.customColumnList,
|
|
165
210
|
columnOpts = $xetable.columnOpts,
|
|
166
211
|
isMaxFixedColumn = $xetable.isMaxFixedColumn;
|
|
167
|
-
var
|
|
212
|
+
var allowSort = customOpts.allowSort,
|
|
213
|
+
allowFixed = customOpts.allowFixed,
|
|
214
|
+
checkMethod = customOpts.checkMethod,
|
|
168
215
|
visibleMethod = customOpts.visibleMethod;
|
|
169
216
|
var trVNs = [];
|
|
170
217
|
_xeUtils.default.eachTree(customColumnList, function (column, index, items, path, parent) {
|
|
@@ -172,7 +219,7 @@ function renderPopupPanel(h, _vm) {
|
|
|
172
219
|
column: column
|
|
173
220
|
}) : true;
|
|
174
221
|
if (isVisible) {
|
|
175
|
-
var isChecked = column.
|
|
222
|
+
var isChecked = column.renderVisible;
|
|
176
223
|
var isIndeterminate = column.halfVisible;
|
|
177
224
|
var colTitle = formatText(column.getTitle(), 1);
|
|
178
225
|
var isColGroup = column.children && column.children.length;
|
|
@@ -181,35 +228,18 @@ function renderPopupPanel(h, _vm) {
|
|
|
181
228
|
}) : false;
|
|
182
229
|
trVNs.push(h('tr', {
|
|
183
230
|
key: column.id,
|
|
184
|
-
class: ["vxe-table-custom-popup--row level--".concat(column.level), {
|
|
185
|
-
'is--group': isColGroup
|
|
186
|
-
}],
|
|
187
231
|
attrs: {
|
|
188
232
|
colid: column.id
|
|
189
233
|
},
|
|
234
|
+
class: ["vxe-table-custom-popup--row level--".concat(column.level), {
|
|
235
|
+
'is--group': isColGroup
|
|
236
|
+
}],
|
|
190
237
|
on: {
|
|
191
238
|
dragstart: _vm.sortDragstartEvent,
|
|
192
239
|
dragend: _vm.sortDragendEvent,
|
|
193
240
|
dragover: _vm.sortDragoverEvent
|
|
194
241
|
}
|
|
195
242
|
}, [h('td', {
|
|
196
|
-
class: 'vxe-table-custom-popup--column-item col--sort'
|
|
197
|
-
}, [column.level === 1 ? h('span', {
|
|
198
|
-
class: 'vxe-table-custom-popup--column-sort-btn',
|
|
199
|
-
on: {
|
|
200
|
-
mousedown: _vm.sortMousedownEvent,
|
|
201
|
-
mouseup: _vm.sortMouseupEvent
|
|
202
|
-
}
|
|
203
|
-
}, [h('i', {
|
|
204
|
-
class: 'vxe-icon-sort'
|
|
205
|
-
})]) : null]), h('td', {
|
|
206
|
-
class: 'vxe-table-custom-popup--column-item col--name'
|
|
207
|
-
}, [h('div', {
|
|
208
|
-
class: 'vxe-table-custom-popup--name',
|
|
209
|
-
attrs: {
|
|
210
|
-
title: colTitle
|
|
211
|
-
}
|
|
212
|
-
}, colTitle)]), h('td', {
|
|
213
243
|
class: 'vxe-table-custom-popup--column-item col--visible'
|
|
214
244
|
}, [h('div', {
|
|
215
245
|
class: ['vxe-table-custom--checkbox-option', {
|
|
@@ -217,6 +247,9 @@ function renderPopupPanel(h, _vm) {
|
|
|
217
247
|
'is--indeterminate': isIndeterminate,
|
|
218
248
|
'is--disabled': isDisabled
|
|
219
249
|
}],
|
|
250
|
+
attrs: {
|
|
251
|
+
title: _conf.default.i18n('vxe.custom.setting.colVisible')
|
|
252
|
+
},
|
|
220
253
|
on: {
|
|
221
254
|
click: function click() {
|
|
222
255
|
if (!isDisabled) {
|
|
@@ -226,11 +259,31 @@ function renderPopupPanel(h, _vm) {
|
|
|
226
259
|
}
|
|
227
260
|
}, [h('span', {
|
|
228
261
|
class: ['vxe-checkbox--icon', isIndeterminate ? _conf.default.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? _conf.default.icon.TABLE_CHECKBOX_CHECKED : _conf.default.icon.TABLE_CHECKBOX_UNCHECKED]
|
|
229
|
-
})])]), h('td', {
|
|
262
|
+
})])]), allowSort ? h('td', {
|
|
263
|
+
class: 'vxe-table-custom-popup--column-item col--sort'
|
|
264
|
+
}, [column.level === 1 ? h('span', {
|
|
265
|
+
class: 'vxe-table-custom-popup--column-sort-btn',
|
|
266
|
+
attrs: {
|
|
267
|
+
title: _conf.default.i18n('vxe.custom.setting.sortHelpTip')
|
|
268
|
+
},
|
|
269
|
+
on: {
|
|
270
|
+
mousedown: _vm.sortMousedownEvent,
|
|
271
|
+
mouseup: _vm.sortMouseupEvent
|
|
272
|
+
}
|
|
273
|
+
}, [h('i', {
|
|
274
|
+
class: _conf.default.icon.TABLE_CUSTOM_SORT
|
|
275
|
+
})]) : null]) : _e(), h('td', {
|
|
276
|
+
class: 'vxe-table-custom-popup--column-item col--name'
|
|
277
|
+
}, [h('div', {
|
|
278
|
+
class: 'vxe-table-custom-popup--name',
|
|
279
|
+
attrs: {
|
|
280
|
+
title: colTitle
|
|
281
|
+
}
|
|
282
|
+
}, colTitle)]), allowFixed ? h('td', {
|
|
230
283
|
class: 'vxe-table-custom-popup--column-item col--fixed'
|
|
231
|
-
}, [!parent
|
|
284
|
+
}, [!parent ? h('vxe-radio-group', {
|
|
232
285
|
props: {
|
|
233
|
-
value: column.
|
|
286
|
+
value: column.renderFixed || '',
|
|
234
287
|
type: 'button',
|
|
235
288
|
size: 'mini',
|
|
236
289
|
options: [{
|
|
@@ -248,21 +301,22 @@ function renderPopupPanel(h, _vm) {
|
|
|
248
301
|
},
|
|
249
302
|
on: {
|
|
250
303
|
input: function input(value) {
|
|
251
|
-
column.
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
304
|
+
column.renderFixed = value;
|
|
305
|
+
} // onChange () {
|
|
306
|
+
// changePopupFixedOption(column)
|
|
307
|
+
// }
|
|
256
308
|
}
|
|
257
|
-
}) : null])]));
|
|
309
|
+
}) : null]) : _e()]));
|
|
258
310
|
}
|
|
259
311
|
});
|
|
312
|
+
var isAllChecked = customStore.isAll;
|
|
313
|
+
var isAllIndeterminate = customStore.isIndeterminate;
|
|
260
314
|
return h('vxe-modal', {
|
|
261
315
|
key: 'popup',
|
|
262
316
|
props: {
|
|
317
|
+
className: 'vxe-table-custom-popup-wrapper vxe-table--ignore-clear',
|
|
263
318
|
value: customStore.visible,
|
|
264
319
|
title: _conf.default.i18n('vxe.custom.cstmTitle'),
|
|
265
|
-
className: 'vxe-table-custom-popup-wrapper vxe-table--ignore-clear',
|
|
266
320
|
width: '40vw',
|
|
267
321
|
minWidth: 520,
|
|
268
322
|
height: '50vh',
|
|
@@ -290,20 +344,39 @@ function renderPopupPanel(h, _vm) {
|
|
|
290
344
|
style: {
|
|
291
345
|
width: '80px'
|
|
292
346
|
}
|
|
293
|
-
}),
|
|
347
|
+
}), allowSort ? h('col', {
|
|
294
348
|
style: {
|
|
295
349
|
width: '80px'
|
|
296
350
|
}
|
|
297
|
-
}), h('col', {
|
|
351
|
+
}) : _e(), h('col', {
|
|
352
|
+
style: {
|
|
353
|
+
minWidth: '120px'
|
|
354
|
+
}
|
|
355
|
+
}), allowFixed ? h('col', {
|
|
298
356
|
style: {
|
|
299
357
|
width: '200px'
|
|
300
358
|
}
|
|
301
|
-
})]), h('thead', {}, [h('tr', {}, [h('th', {}, [h('
|
|
359
|
+
}) : _e()]), h('thead', {}, [h('tr', {}, [h('th', {}, [h('div', {
|
|
360
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
361
|
+
'is--checked': isAllChecked,
|
|
362
|
+
'is--indeterminate': isAllIndeterminate
|
|
363
|
+
}],
|
|
364
|
+
attrs: {
|
|
365
|
+
title: _conf.default.i18n('vxe.table.allTitle')
|
|
366
|
+
},
|
|
367
|
+
on: {
|
|
368
|
+
click: _vm.allCustomEvent
|
|
369
|
+
}
|
|
370
|
+
}, [h('span', {
|
|
371
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? _conf.default.icon.TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? _conf.default.icon.TABLE_CHECKBOX_CHECKED : _conf.default.icon.TABLE_CHECKBOX_UNCHECKED]
|
|
372
|
+
}), h('span', {
|
|
373
|
+
class: 'vxe-checkbox--label'
|
|
374
|
+
}, _conf.default.i18n('vxe.toolbar.customAll'))])]), allowSort ? h('th', {}, [h('span', {
|
|
302
375
|
class: 'vxe-table-custom-popup--table-sort-help-title'
|
|
303
376
|
}, _conf.default.i18n('vxe.custom.setting.colSort')), h('vxe-tooltip', {
|
|
304
377
|
props: {
|
|
305
378
|
enterable: true,
|
|
306
|
-
content: '
|
|
379
|
+
content: _conf.default.i18n('vxe.custom.setting.sortHelpTip')
|
|
307
380
|
},
|
|
308
381
|
scopedSlots: {
|
|
309
382
|
default: function _default() {
|
|
@@ -312,7 +385,7 @@ function renderPopupPanel(h, _vm) {
|
|
|
312
385
|
});
|
|
313
386
|
}
|
|
314
387
|
}
|
|
315
|
-
})])
|
|
388
|
+
})]) : _e(), h('th', {}, _conf.default.i18n('vxe.custom.setting.colTitle')), allowFixed ? h('th', {}, _conf.default.i18n('vxe.custom.setting.colFixed', [columnOpts.maxFixedSize || 0])) : _e()])]), h('transition-group', {
|
|
316
389
|
class: 'vxe-table-custom--body',
|
|
317
390
|
props: {
|
|
318
391
|
tag: 'tbody',
|
|
@@ -331,7 +404,7 @@ function renderPopupPanel(h, _vm) {
|
|
|
331
404
|
content: customOpts.resetButtonText || _conf.default.i18n('vxe.custom.cstmRestore')
|
|
332
405
|
},
|
|
333
406
|
on: {
|
|
334
|
-
click: _vm.
|
|
407
|
+
click: _vm.resetCustomEvent
|
|
335
408
|
}
|
|
336
409
|
}), h('vxe-button', {
|
|
337
410
|
props: {
|
|
@@ -352,7 +425,7 @@ function renderPopupPanel(h, _vm) {
|
|
|
352
425
|
}
|
|
353
426
|
}
|
|
354
427
|
});
|
|
355
|
-
}
|
|
428
|
+
};
|
|
356
429
|
var _default2 = exports.default = {
|
|
357
430
|
name: 'VxeTableCustomPanel',
|
|
358
431
|
props: {
|
|
@@ -399,23 +472,66 @@ var _default2 = exports.default = {
|
|
|
399
472
|
}
|
|
400
473
|
}, 300);
|
|
401
474
|
},
|
|
475
|
+
getStoreData: function getStoreData() {
|
|
476
|
+
return {};
|
|
477
|
+
},
|
|
478
|
+
handleSaveStore: function handleSaveStore(type) {
|
|
479
|
+
var $xetable = this.$xetable;
|
|
480
|
+
var id = $xetable.id,
|
|
481
|
+
customOpts = $xetable.customOpts;
|
|
482
|
+
var storage = customOpts.storage,
|
|
483
|
+
updateStore = customOpts.updateStore;
|
|
484
|
+
if (storage && id && updateStore) {
|
|
485
|
+
updateStore({
|
|
486
|
+
id: id,
|
|
487
|
+
type: type,
|
|
488
|
+
storeData: this.getStoreData()
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
},
|
|
402
492
|
confirmCustomEvent: function confirmCustomEvent(evnt) {
|
|
403
493
|
var $xetable = this.$xetable;
|
|
494
|
+
var customColumnList = $xetable.customColumnList;
|
|
495
|
+
customColumnList.forEach(function (column, index) {
|
|
496
|
+
var sortIndex = index + 1;
|
|
497
|
+
column.renderSortNumber = sortIndex;
|
|
498
|
+
column.fixed = column.renderFixed;
|
|
499
|
+
column.visible = column.renderVisible;
|
|
500
|
+
});
|
|
404
501
|
$xetable.closeCustom();
|
|
405
502
|
$xetable.emitCustomEvent('confirm', evnt);
|
|
503
|
+
this.handleSaveStore('confirm');
|
|
406
504
|
},
|
|
407
505
|
cancelCustomEvent: function cancelCustomEvent(evnt) {
|
|
408
506
|
var $xetable = this.$xetable;
|
|
507
|
+
var customStore = $xetable.customStore,
|
|
508
|
+
customColumnList = $xetable.customColumnList;
|
|
509
|
+
var oldSortMaps = customStore.oldSortMaps,
|
|
510
|
+
oldFixedMaps = customStore.oldFixedMaps,
|
|
511
|
+
oldVisibleMaps = customStore.oldVisibleMaps;
|
|
512
|
+
_xeUtils.default.eachTree(customColumnList, function (column) {
|
|
513
|
+
var colid = column.getKey();
|
|
514
|
+
var visible = !!oldVisibleMaps[colid];
|
|
515
|
+
var fixed = oldFixedMaps[colid] || '';
|
|
516
|
+
column.renderVisible = visible;
|
|
517
|
+
column.visible = visible;
|
|
518
|
+
column.renderFixed = fixed;
|
|
519
|
+
column.fixed = fixed;
|
|
520
|
+
column.renderSortNumber = oldSortMaps[colid] || 0;
|
|
521
|
+
}, {
|
|
522
|
+
children: 'children'
|
|
523
|
+
});
|
|
409
524
|
$xetable.closeCustom();
|
|
410
525
|
$xetable.emitCustomEvent('cancel', evnt);
|
|
411
526
|
},
|
|
412
|
-
|
|
527
|
+
handleResetCustomEvent: function handleResetCustomEvent(evnt) {
|
|
413
528
|
var $xetable = this.$xetable;
|
|
414
529
|
$xetable.resetColumn(true);
|
|
415
530
|
$xetable.closeCustom();
|
|
416
531
|
$xetable.emitCustomEvent('reset', evnt);
|
|
532
|
+
this.handleSaveStore('confirm');
|
|
417
533
|
},
|
|
418
|
-
|
|
534
|
+
resetCustomEvent: function resetCustomEvent(evnt) {
|
|
419
535
|
var _this = this;
|
|
420
536
|
if (_vXETable.default.modal) {
|
|
421
537
|
_vXETable.default.modal.confirm({
|
|
@@ -424,7 +540,23 @@ var _default2 = exports.default = {
|
|
|
424
540
|
escClosable: true
|
|
425
541
|
}).then(function (type) {
|
|
426
542
|
if (type === 'confirm') {
|
|
427
|
-
_this.
|
|
543
|
+
_this.handleResetCustomEvent(evnt);
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
} else {
|
|
547
|
+
this.handleResetCustomEvent(evnt);
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
resetPopupCustomEvent: function resetPopupCustomEvent(evnt) {
|
|
551
|
+
var _this2 = this;
|
|
552
|
+
if (_vXETable.default.modal) {
|
|
553
|
+
_vXETable.default.modal.confirm({
|
|
554
|
+
content: _conf.default.i18n('vxe.custom.cstmConfirmRestore'),
|
|
555
|
+
className: 'vxe-table--ignore-clear',
|
|
556
|
+
escClosable: true
|
|
557
|
+
}).then(function (type) {
|
|
558
|
+
if (type === 'confirm') {
|
|
559
|
+
_this2.resetCustomEvent(evnt);
|
|
428
560
|
}
|
|
429
561
|
});
|
|
430
562
|
} else {
|
|
@@ -453,9 +585,9 @@ var _default2 = exports.default = {
|
|
|
453
585
|
changeCheckboxOption: function changeCheckboxOption(column) {
|
|
454
586
|
var $xetable = this.$xetable;
|
|
455
587
|
var customOpts = $xetable.customOpts;
|
|
456
|
-
var isChecked = !column.
|
|
588
|
+
var isChecked = !column.renderVisible;
|
|
457
589
|
_xeUtils.default.eachTree([column], function (item) {
|
|
458
|
-
item.
|
|
590
|
+
item.renderVisible = isChecked;
|
|
459
591
|
item.halfVisible = false;
|
|
460
592
|
});
|
|
461
593
|
this.handleOptionCheck(column);
|
|
@@ -467,21 +599,23 @@ var _default2 = exports.default = {
|
|
|
467
599
|
changeFixedOption: function changeFixedOption(column, colFixed) {
|
|
468
600
|
var $xetable = this.$xetable;
|
|
469
601
|
var isMaxFixedColumn = $xetable.isMaxFixedColumn;
|
|
470
|
-
if (column.
|
|
471
|
-
|
|
602
|
+
if (column.renderFixed === colFixed) {
|
|
603
|
+
column.renderFixed = '';
|
|
604
|
+
// $xeTable.clearColumnFixed(column)
|
|
472
605
|
} else {
|
|
473
|
-
if (!isMaxFixedColumn || column.
|
|
474
|
-
|
|
606
|
+
if (!isMaxFixedColumn || column.renderFixed) {
|
|
607
|
+
column.renderFixed = colFixed;
|
|
608
|
+
// $xeTable.setColumnFixed(column, colFixed)
|
|
475
609
|
}
|
|
476
610
|
}
|
|
477
611
|
},
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
},
|
|
612
|
+
// changePopupFixedOption (column) {
|
|
613
|
+
// const { $xetable } = this
|
|
614
|
+
// const { isMaxFixedColumn } = $xetable
|
|
615
|
+
// if (!isMaxFixedColumn) {
|
|
616
|
+
// $xetable.setColumnFixed(column, column.fixed)
|
|
617
|
+
// }
|
|
618
|
+
// },
|
|
485
619
|
allCustomEvent: function allCustomEvent() {
|
|
486
620
|
var $xetable = this.$xetable,
|
|
487
621
|
customStore = this.customStore;
|
|
@@ -493,7 +627,7 @@ var _default2 = exports.default = {
|
|
|
493
627
|
if (!checkMethod || checkMethod({
|
|
494
628
|
column: column
|
|
495
629
|
})) {
|
|
496
|
-
column.
|
|
630
|
+
column.renderVisible = isAll;
|
|
497
631
|
column.halfVisible = false;
|
|
498
632
|
}
|
|
499
633
|
});
|
|
@@ -572,8 +706,6 @@ var _default2 = exports.default = {
|
|
|
572
706
|
}
|
|
573
707
|
removeClass(trEl, 'active--drag-target');
|
|
574
708
|
removeClass(trEl, 'active--drag-origin');
|
|
575
|
-
// 更新顺序
|
|
576
|
-
this.updateColumnSort();
|
|
577
709
|
},
|
|
578
710
|
sortDragoverEvent: function sortDragoverEvent(evnt) {
|
|
579
711
|
var $xetable = this.$xetable,
|
|
@@ -594,15 +726,6 @@ var _default2 = exports.default = {
|
|
|
594
726
|
this.prevDropTrEl = trEl;
|
|
595
727
|
}
|
|
596
728
|
updateDropHint(this, evnt);
|
|
597
|
-
},
|
|
598
|
-
updateColumnSort: function updateColumnSort() {
|
|
599
|
-
var $xetable = this.$xetable;
|
|
600
|
-
var customColumnList = $xetable.customColumnList;
|
|
601
|
-
// 更新顺序
|
|
602
|
-
customColumnList.forEach(function (column, index) {
|
|
603
|
-
var sortIndex = index + 1;
|
|
604
|
-
column.renderSortNumber = sortIndex;
|
|
605
|
-
});
|
|
606
729
|
}
|
|
607
730
|
}
|
|
608
731
|
};
|