vxe-table 3.8.8-beta.1 → 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.1717483712988.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.1717483712988.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/table/style/style.css +3 -1
- package/lib/table/style/style.min.css +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/style/style.css +3 -1
- package/lib/vxe-table/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/styles/table.scss +3 -1
- package/lib/icon/style/iconfont.1717483712988.woff +0 -0
- package/lib/icon/style/iconfont.1717483712988.woff2 +0 -0
- package/lib/iconfont.1717483712988.woff +0 -0
- package/lib/iconfont.1717483712988.woff2 +0 -0
|
@@ -23,11 +23,11 @@ function updateDropHint (_vm, evnt) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
const { $xetable, customStore } = _vm
|
|
28
|
-
const {
|
|
26
|
+
const renderSimplePanel = (h, _vm) => {
|
|
27
|
+
const { _e, $xetable, customStore } = _vm
|
|
28
|
+
const { customColumnList, customOpts, isMaxFixedColumn } = $xetable
|
|
29
29
|
const { maxHeight } = customStore
|
|
30
|
-
const { checkMethod, visibleMethod, trigger } = customOpts
|
|
30
|
+
const { checkMethod, visibleMethod, allowSort, allowFixed, trigger } = customOpts
|
|
31
31
|
const colVNs = []
|
|
32
32
|
const customWrapperOns = {}
|
|
33
33
|
// hover 触发
|
|
@@ -38,7 +38,7 @@ function renderSimplePanel (h, _vm) {
|
|
|
38
38
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
39
39
|
const isVisible = visibleMethod ? visibleMethod({ column }) : true
|
|
40
40
|
if (isVisible) {
|
|
41
|
-
const isChecked = column.
|
|
41
|
+
const isChecked = column.renderVisible
|
|
42
42
|
const isIndeterminate = column.halfVisible
|
|
43
43
|
const isColGroup = column.children && column.children.length
|
|
44
44
|
const colTitle = formatText(column.getTitle(), 1)
|
|
@@ -46,65 +46,100 @@ function renderSimplePanel (h, _vm) {
|
|
|
46
46
|
colVNs.push(
|
|
47
47
|
h('li', {
|
|
48
48
|
key: column.id,
|
|
49
|
+
attrs: {
|
|
50
|
+
colid: column.id
|
|
51
|
+
},
|
|
49
52
|
class: ['vxe-table-custom--option', `level--${column.level}`, {
|
|
50
53
|
'is--group': isColGroup
|
|
51
|
-
}]
|
|
54
|
+
}],
|
|
55
|
+
on: {
|
|
56
|
+
dragstart: _vm.sortDragstartEvent,
|
|
57
|
+
dragend: _vm.sortDragendEvent,
|
|
58
|
+
dragover: _vm.sortDragoverEvent
|
|
59
|
+
}
|
|
52
60
|
}, [
|
|
53
61
|
h('div', {
|
|
54
|
-
title: colTitle,
|
|
55
62
|
class: ['vxe-table-custom--checkbox-option', {
|
|
56
63
|
'is--checked': isChecked,
|
|
57
64
|
'is--indeterminate': isIndeterminate,
|
|
58
65
|
'is--disabled': isDisabled
|
|
59
66
|
}],
|
|
67
|
+
attrs: {
|
|
68
|
+
title: GlobalConfig.i18n('vxe.custom.setting.colVisible')
|
|
69
|
+
},
|
|
60
70
|
on: {
|
|
61
71
|
click: () => {
|
|
62
72
|
if (!isDisabled) {
|
|
63
73
|
_vm.changeCheckboxOption(column)
|
|
64
74
|
}
|
|
65
75
|
}
|
|
66
|
-
|
|
67
76
|
}
|
|
68
77
|
}, [
|
|
69
78
|
h('span', {
|
|
70
79
|
class: ['vxe-checkbox--icon', isIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
|
|
71
|
-
})
|
|
72
|
-
h('span', {
|
|
73
|
-
class: 'vxe-checkbox--label'
|
|
74
|
-
}, colTitle)
|
|
80
|
+
})
|
|
75
81
|
]),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
click: () => {
|
|
89
|
-
_vm.changeFixedOption(column, 'left')
|
|
82
|
+
allowSort && column.level === 1
|
|
83
|
+
? h('div', {
|
|
84
|
+
class: 'vxe-table-custom--sort-option'
|
|
85
|
+
}, [
|
|
86
|
+
h('span', {
|
|
87
|
+
class: 'vxe-table-custom--sort-btn',
|
|
88
|
+
attrs: {
|
|
89
|
+
title: GlobalConfig.i18n('vxe.custom.setting.sortHelpTip')
|
|
90
|
+
},
|
|
91
|
+
on: {
|
|
92
|
+
mousedown: _vm.sortMousedownEvent,
|
|
93
|
+
mouseup: _vm.sortMouseupEvent
|
|
90
94
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
}, [
|
|
96
|
+
h('i', {
|
|
97
|
+
class: GlobalConfig.icon.TABLE_CUSTOM_SORT
|
|
98
|
+
})
|
|
99
|
+
])
|
|
100
|
+
])
|
|
101
|
+
: _e(),
|
|
102
|
+
h('div', {
|
|
103
|
+
class: 'vxe-table-custom--checkbox-label',
|
|
104
|
+
attrs: {
|
|
105
|
+
title: colTitle
|
|
106
|
+
}
|
|
107
|
+
}, colTitle),
|
|
108
|
+
!parent && allowFixed
|
|
109
|
+
? h('div', {
|
|
110
|
+
class: 'vxe-table-custom--fixed-option'
|
|
111
|
+
}, [
|
|
112
|
+
h('span', {
|
|
113
|
+
class: ['vxe-table-custom--fixed-left-option', column.renderFixed === 'left' ? GlobalConfig.icon.TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : GlobalConfig.icon.TOOLBAR_TOOLS_FIXED_LEFT, {
|
|
114
|
+
'is--checked': column.renderFixed === 'left',
|
|
115
|
+
'is--disabled': isMaxFixedColumn && !column.renderFixed
|
|
116
|
+
}],
|
|
117
|
+
attrs: {
|
|
118
|
+
title: GlobalConfig.i18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
|
|
119
|
+
},
|
|
120
|
+
on: {
|
|
121
|
+
click: () => {
|
|
122
|
+
_vm.changeFixedOption(column, 'left')
|
|
123
|
+
}
|
|
104
124
|
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
125
|
+
}),
|
|
126
|
+
h('span', {
|
|
127
|
+
class: ['vxe-table-custom--fixed-right-option', column.renderFixed === 'right' ? GlobalConfig.icon.TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : GlobalConfig.icon.TOOLBAR_TOOLS_FIXED_RIGHT, {
|
|
128
|
+
'is--checked': column.renderFixed === 'right',
|
|
129
|
+
'is--disabled': isMaxFixedColumn && !column.renderFixed
|
|
130
|
+
}],
|
|
131
|
+
attrs: {
|
|
132
|
+
title: GlobalConfig.i18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
|
|
133
|
+
},
|
|
134
|
+
on: {
|
|
135
|
+
|
|
136
|
+
click: () => {
|
|
137
|
+
_vm.changeFixedOption(column, 'right')
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
])
|
|
142
|
+
: _e()
|
|
108
143
|
])
|
|
109
144
|
)
|
|
110
145
|
}
|
|
@@ -116,69 +151,96 @@ function renderSimplePanel (h, _vm) {
|
|
|
116
151
|
class: ['vxe-table-custom-wrapper', {
|
|
117
152
|
'is--active': customStore.visible
|
|
118
153
|
}]
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
154
|
+
}, customStore.visible
|
|
155
|
+
? [
|
|
156
|
+
h('ul', {
|
|
157
|
+
class: 'vxe-table-custom--header'
|
|
158
|
+
}, [
|
|
159
|
+
h('li', {
|
|
160
|
+
class: 'vxe-table-custom--option'
|
|
161
|
+
}, [
|
|
162
|
+
h('div', {
|
|
163
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
164
|
+
'is--checked': isAllChecked,
|
|
165
|
+
'is--indeterminate': isAllIndeterminate
|
|
166
|
+
}],
|
|
167
|
+
attrs: {
|
|
168
|
+
title: GlobalConfig.i18n('vxe.table.allTitle')
|
|
169
|
+
},
|
|
170
|
+
on: {
|
|
171
|
+
click: _vm.allCustomEvent
|
|
172
|
+
}
|
|
173
|
+
}, [
|
|
174
|
+
h('span', {
|
|
175
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
|
|
176
|
+
}),
|
|
177
|
+
h('span', {
|
|
178
|
+
class: 'vxe-checkbox--label'
|
|
179
|
+
}, GlobalConfig.i18n('vxe.toolbar.customAll'))
|
|
180
|
+
])
|
|
181
|
+
])
|
|
182
|
+
]),
|
|
126
183
|
h('div', {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
'is--indeterminate': isAllIndeterminate
|
|
130
|
-
}],
|
|
131
|
-
attrs: {
|
|
132
|
-
title: GlobalConfig.i18n('vxe.table.allTitle')
|
|
133
|
-
},
|
|
134
|
-
on: {
|
|
135
|
-
click: _vm.allCustomEvent
|
|
136
|
-
}
|
|
184
|
+
ref: 'bodyElemRef',
|
|
185
|
+
class: 'vxe-table-custom--list-wrapper'
|
|
137
186
|
}, [
|
|
138
|
-
h('
|
|
139
|
-
class:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
187
|
+
h('transition-group', {
|
|
188
|
+
class: 'vxe-table-custom--body',
|
|
189
|
+
props: {
|
|
190
|
+
name: 'vxe-table-custom--list',
|
|
191
|
+
tag: 'ul'
|
|
192
|
+
},
|
|
193
|
+
style: maxHeight
|
|
194
|
+
? {
|
|
195
|
+
maxHeight: `${maxHeight}px`
|
|
196
|
+
}
|
|
197
|
+
: {},
|
|
198
|
+
on: customWrapperOns
|
|
199
|
+
}, colVNs),
|
|
200
|
+
h('div', {
|
|
201
|
+
ref: 'dragHintElemRef',
|
|
202
|
+
class: 'vxe-table-custom-popup--drag-hint'
|
|
203
|
+
}, GlobalConfig.i18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))
|
|
204
|
+
]),
|
|
205
|
+
customOpts.showFooter
|
|
206
|
+
? h('div', {
|
|
207
|
+
class: 'vxe-table-custom--footer'
|
|
208
|
+
}, [
|
|
209
|
+
h('button', {
|
|
210
|
+
class: 'btn--reset',
|
|
211
|
+
on: {
|
|
212
|
+
click: _vm.resetCustomEvent
|
|
213
|
+
}
|
|
214
|
+
}, customOpts.resetButtonText || GlobalConfig.i18n('vxe.table.customRestore')),
|
|
215
|
+
customOpts.immediate
|
|
216
|
+
? _e()
|
|
217
|
+
: h('button', {
|
|
218
|
+
class: 'btn--cancel',
|
|
219
|
+
on: {
|
|
220
|
+
click: _vm.cancelCustomEvent
|
|
221
|
+
}
|
|
222
|
+
}, customOpts.resetButtonText || GlobalConfig.i18n('vxe.table.customCancel')),
|
|
223
|
+
h('button', {
|
|
224
|
+
class: 'btn--confirm',
|
|
225
|
+
on: {
|
|
226
|
+
click: _vm.confirmCustomEvent
|
|
227
|
+
}
|
|
228
|
+
}, customOpts.confirmButtonText || GlobalConfig.i18n('vxe.table.customConfirm'))
|
|
229
|
+
])
|
|
230
|
+
: null
|
|
231
|
+
]
|
|
232
|
+
: [])
|
|
171
233
|
}
|
|
172
234
|
|
|
173
|
-
|
|
174
|
-
const { $xetable, customStore } = _vm
|
|
235
|
+
const renderPopupPanel = (h, _vm) => {
|
|
236
|
+
const { _e, $xetable, customStore } = _vm
|
|
175
237
|
const { customOpts, customColumnList, columnOpts, isMaxFixedColumn } = $xetable
|
|
176
|
-
const { checkMethod, visibleMethod } = customOpts
|
|
238
|
+
const { allowSort, allowFixed, checkMethod, visibleMethod } = customOpts
|
|
177
239
|
const trVNs = []
|
|
178
240
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
179
241
|
const isVisible = visibleMethod ? visibleMethod({ column }) : true
|
|
180
242
|
if (isVisible) {
|
|
181
|
-
const isChecked = column.
|
|
243
|
+
const isChecked = column.renderVisible
|
|
182
244
|
const isIndeterminate = column.halfVisible
|
|
183
245
|
const colTitle = formatText(column.getTitle(), 1)
|
|
184
246
|
const isColGroup = column.children && column.children.length
|
|
@@ -186,43 +248,18 @@ function renderPopupPanel (h, _vm) {
|
|
|
186
248
|
trVNs.push(
|
|
187
249
|
h('tr', {
|
|
188
250
|
key: column.id,
|
|
189
|
-
class: [`vxe-table-custom-popup--row level--${column.level}`, {
|
|
190
|
-
'is--group': isColGroup
|
|
191
|
-
}],
|
|
192
251
|
attrs: {
|
|
193
252
|
colid: column.id
|
|
194
253
|
},
|
|
254
|
+
class: [`vxe-table-custom-popup--row level--${column.level}`, {
|
|
255
|
+
'is--group': isColGroup
|
|
256
|
+
}],
|
|
195
257
|
on: {
|
|
196
258
|
dragstart: _vm.sortDragstartEvent,
|
|
197
259
|
dragend: _vm.sortDragendEvent,
|
|
198
260
|
dragover: _vm.sortDragoverEvent
|
|
199
261
|
}
|
|
200
262
|
}, [
|
|
201
|
-
h('td', {
|
|
202
|
-
class: 'vxe-table-custom-popup--column-item col--sort'
|
|
203
|
-
}, [
|
|
204
|
-
column.level === 1 ? h('span', {
|
|
205
|
-
class: 'vxe-table-custom-popup--column-sort-btn',
|
|
206
|
-
on: {
|
|
207
|
-
mousedown: _vm.sortMousedownEvent,
|
|
208
|
-
mouseup: _vm.sortMouseupEvent
|
|
209
|
-
}
|
|
210
|
-
}, [
|
|
211
|
-
h('i', {
|
|
212
|
-
class: 'vxe-icon-sort'
|
|
213
|
-
})
|
|
214
|
-
]) : null
|
|
215
|
-
]),
|
|
216
|
-
h('td', {
|
|
217
|
-
class: 'vxe-table-custom-popup--column-item col--name'
|
|
218
|
-
}, [
|
|
219
|
-
h('div', {
|
|
220
|
-
class: 'vxe-table-custom-popup--name',
|
|
221
|
-
attrs: {
|
|
222
|
-
title: colTitle
|
|
223
|
-
}
|
|
224
|
-
}, colTitle)
|
|
225
|
-
]),
|
|
226
263
|
h('td', {
|
|
227
264
|
class: 'vxe-table-custom-popup--column-item col--visible'
|
|
228
265
|
}, [
|
|
@@ -232,6 +269,9 @@ function renderPopupPanel (h, _vm) {
|
|
|
232
269
|
'is--indeterminate': isIndeterminate,
|
|
233
270
|
'is--disabled': isDisabled
|
|
234
271
|
}],
|
|
272
|
+
attrs: {
|
|
273
|
+
title: GlobalConfig.i18n('vxe.custom.setting.colVisible')
|
|
274
|
+
},
|
|
235
275
|
on: {
|
|
236
276
|
click: () => {
|
|
237
277
|
if (!isDisabled) {
|
|
@@ -245,40 +285,78 @@ function renderPopupPanel (h, _vm) {
|
|
|
245
285
|
})
|
|
246
286
|
])
|
|
247
287
|
]),
|
|
288
|
+
allowSort
|
|
289
|
+
? h('td', {
|
|
290
|
+
class: 'vxe-table-custom-popup--column-item col--sort'
|
|
291
|
+
}, [
|
|
292
|
+
column.level === 1
|
|
293
|
+
? h('span', {
|
|
294
|
+
class: 'vxe-table-custom-popup--column-sort-btn',
|
|
295
|
+
attrs: {
|
|
296
|
+
title: GlobalConfig.i18n('vxe.custom.setting.sortHelpTip')
|
|
297
|
+
},
|
|
298
|
+
on: {
|
|
299
|
+
mousedown: _vm.sortMousedownEvent,
|
|
300
|
+
mouseup: _vm.sortMouseupEvent
|
|
301
|
+
}
|
|
302
|
+
}, [
|
|
303
|
+
h('i', {
|
|
304
|
+
class: GlobalConfig.icon.TABLE_CUSTOM_SORT
|
|
305
|
+
})
|
|
306
|
+
])
|
|
307
|
+
: null
|
|
308
|
+
])
|
|
309
|
+
: _e(),
|
|
248
310
|
h('td', {
|
|
249
|
-
class: 'vxe-table-custom-popup--column-item col--
|
|
311
|
+
class: 'vxe-table-custom-popup--column-item col--name'
|
|
250
312
|
}, [
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
size: 'mini',
|
|
256
|
-
options: [
|
|
257
|
-
{ label: GlobalConfig.i18n('vxe.custom.setting.fixedLeft'), value: 'left', disabled: isMaxFixedColumn },
|
|
258
|
-
{ label: GlobalConfig.i18n('vxe.custom.setting.fixedUnset'), value: '' },
|
|
259
|
-
{ label: GlobalConfig.i18n('vxe.custom.setting.fixedRight'), value: 'right', disabled: isMaxFixedColumn }
|
|
260
|
-
]
|
|
261
|
-
},
|
|
262
|
-
on: {
|
|
263
|
-
input (value) {
|
|
264
|
-
column.fixed = value
|
|
265
|
-
},
|
|
266
|
-
change () {
|
|
267
|
-
_vm.changePopupFixedOption(column)
|
|
268
|
-
}
|
|
313
|
+
h('div', {
|
|
314
|
+
class: 'vxe-table-custom-popup--name',
|
|
315
|
+
attrs: {
|
|
316
|
+
title: colTitle
|
|
269
317
|
}
|
|
270
|
-
})
|
|
271
|
-
])
|
|
318
|
+
}, colTitle)
|
|
319
|
+
]),
|
|
320
|
+
allowFixed
|
|
321
|
+
? h('td', {
|
|
322
|
+
class: 'vxe-table-custom-popup--column-item col--fixed'
|
|
323
|
+
}, [
|
|
324
|
+
!parent
|
|
325
|
+
? h('vxe-radio-group', {
|
|
326
|
+
props: {
|
|
327
|
+
value: column.renderFixed || '',
|
|
328
|
+
type: 'button',
|
|
329
|
+
size: 'mini',
|
|
330
|
+
options: [
|
|
331
|
+
{ label: GlobalConfig.i18n('vxe.custom.setting.fixedLeft'), value: 'left', disabled: isMaxFixedColumn },
|
|
332
|
+
{ label: GlobalConfig.i18n('vxe.custom.setting.fixedUnset'), value: '' },
|
|
333
|
+
{ label: GlobalConfig.i18n('vxe.custom.setting.fixedRight'), value: 'right', disabled: isMaxFixedColumn }
|
|
334
|
+
]
|
|
335
|
+
},
|
|
336
|
+
on: {
|
|
337
|
+
input (value) {
|
|
338
|
+
column.renderFixed = value
|
|
339
|
+
}
|
|
340
|
+
// onChange () {
|
|
341
|
+
// changePopupFixedOption(column)
|
|
342
|
+
// }
|
|
343
|
+
}
|
|
344
|
+
})
|
|
345
|
+
: null
|
|
346
|
+
])
|
|
347
|
+
: _e()
|
|
272
348
|
])
|
|
273
349
|
)
|
|
274
350
|
}
|
|
275
351
|
})
|
|
352
|
+
const isAllChecked = customStore.isAll
|
|
353
|
+
const isAllIndeterminate = customStore.isIndeterminate
|
|
276
354
|
return h('vxe-modal', {
|
|
277
355
|
key: 'popup',
|
|
278
356
|
props: {
|
|
357
|
+
className: 'vxe-table-custom-popup-wrapper vxe-table--ignore-clear',
|
|
279
358
|
value: customStore.visible,
|
|
280
359
|
title: GlobalConfig.i18n('vxe.custom.cstmTitle'),
|
|
281
|
-
className: 'vxe-table-custom-popup-wrapper vxe-table--ignore-clear',
|
|
282
360
|
width: '40vw',
|
|
283
361
|
minWidth: 520,
|
|
284
362
|
height: '50vh',
|
|
@@ -311,41 +389,74 @@ function renderPopupPanel (h, _vm) {
|
|
|
311
389
|
width: '80px'
|
|
312
390
|
}
|
|
313
391
|
}),
|
|
314
|
-
|
|
392
|
+
allowSort
|
|
393
|
+
? h('col', {
|
|
394
|
+
style: {
|
|
395
|
+
width: '80px'
|
|
396
|
+
}
|
|
397
|
+
})
|
|
398
|
+
: _e(),
|
|
315
399
|
h('col', {
|
|
316
400
|
style: {
|
|
317
|
-
|
|
401
|
+
minWidth: '120px'
|
|
318
402
|
}
|
|
319
403
|
}),
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
404
|
+
allowFixed
|
|
405
|
+
? h('col', {
|
|
406
|
+
style: {
|
|
407
|
+
width: '200px'
|
|
408
|
+
}
|
|
409
|
+
})
|
|
410
|
+
: _e()
|
|
325
411
|
]),
|
|
326
412
|
h('thead', {}, [
|
|
327
413
|
h('tr', {}, [
|
|
328
414
|
h('th', {}, [
|
|
329
|
-
h('
|
|
330
|
-
class: 'vxe-table-custom
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
415
|
+
h('div', {
|
|
416
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
417
|
+
'is--checked': isAllChecked,
|
|
418
|
+
'is--indeterminate': isAllIndeterminate
|
|
419
|
+
}],
|
|
420
|
+
attrs: {
|
|
421
|
+
title: GlobalConfig.i18n('vxe.table.allTitle')
|
|
336
422
|
},
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
return h('i', {
|
|
340
|
-
class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
|
|
341
|
-
})
|
|
342
|
-
}
|
|
423
|
+
on: {
|
|
424
|
+
click: _vm.allCustomEvent
|
|
343
425
|
}
|
|
344
|
-
|
|
426
|
+
|
|
427
|
+
}, [
|
|
428
|
+
h('span', {
|
|
429
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
|
|
430
|
+
}),
|
|
431
|
+
h('span', {
|
|
432
|
+
class: 'vxe-checkbox--label'
|
|
433
|
+
}, GlobalConfig.i18n('vxe.toolbar.customAll'))
|
|
434
|
+
])
|
|
345
435
|
]),
|
|
436
|
+
allowSort
|
|
437
|
+
? h('th', {}, [
|
|
438
|
+
h('span', {
|
|
439
|
+
class: 'vxe-table-custom-popup--table-sort-help-title'
|
|
440
|
+
}, GlobalConfig.i18n('vxe.custom.setting.colSort')),
|
|
441
|
+
h('vxe-tooltip', {
|
|
442
|
+
props: {
|
|
443
|
+
enterable: true,
|
|
444
|
+
content: GlobalConfig.i18n('vxe.custom.setting.sortHelpTip')
|
|
445
|
+
},
|
|
446
|
+
scopedSlots: {
|
|
447
|
+
default: () => {
|
|
448
|
+
return h('i', {
|
|
449
|
+
class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
|
|
450
|
+
})
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
})
|
|
454
|
+
])
|
|
455
|
+
: _e(),
|
|
346
456
|
h('th', {}, GlobalConfig.i18n('vxe.custom.setting.colTitle')),
|
|
347
|
-
|
|
348
|
-
|
|
457
|
+
allowFixed
|
|
458
|
+
? h('th', {}, GlobalConfig.i18n('vxe.custom.setting.colFixed', [columnOpts.maxFixedSize || 0]))
|
|
459
|
+
: _e()
|
|
349
460
|
])
|
|
350
461
|
]),
|
|
351
462
|
h('transition-group', {
|
|
@@ -372,7 +483,7 @@ function renderPopupPanel (h, _vm) {
|
|
|
372
483
|
content: customOpts.resetButtonText || GlobalConfig.i18n('vxe.custom.cstmRestore')
|
|
373
484
|
},
|
|
374
485
|
on: {
|
|
375
|
-
click: _vm.
|
|
486
|
+
click: _vm.resetCustomEvent
|
|
376
487
|
}
|
|
377
488
|
}),
|
|
378
489
|
h('vxe-button', {
|
|
@@ -441,21 +552,72 @@ export default {
|
|
|
441
552
|
}
|
|
442
553
|
}, 300)
|
|
443
554
|
},
|
|
555
|
+
getStoreData () {
|
|
556
|
+
return {}
|
|
557
|
+
},
|
|
558
|
+
handleSaveStore (type) {
|
|
559
|
+
const { $xetable } = this
|
|
560
|
+
const { id, customOpts } = $xetable
|
|
561
|
+
const { storage, updateStore } = customOpts
|
|
562
|
+
if (storage && id && updateStore) {
|
|
563
|
+
updateStore({
|
|
564
|
+
id,
|
|
565
|
+
type,
|
|
566
|
+
storeData: this.getStoreData()
|
|
567
|
+
})
|
|
568
|
+
}
|
|
569
|
+
},
|
|
444
570
|
confirmCustomEvent (evnt) {
|
|
445
571
|
const { $xetable } = this
|
|
572
|
+
const { customColumnList } = $xetable
|
|
573
|
+
customColumnList.forEach((column, index) => {
|
|
574
|
+
const sortIndex = index + 1
|
|
575
|
+
column.renderSortNumber = sortIndex
|
|
576
|
+
column.fixed = column.renderFixed
|
|
577
|
+
column.visible = column.renderVisible
|
|
578
|
+
})
|
|
446
579
|
$xetable.closeCustom()
|
|
447
580
|
$xetable.emitCustomEvent('confirm', evnt)
|
|
581
|
+
this.handleSaveStore('confirm')
|
|
448
582
|
},
|
|
449
583
|
cancelCustomEvent (evnt) {
|
|
450
584
|
const { $xetable } = this
|
|
585
|
+
const { customStore, customColumnList } = $xetable
|
|
586
|
+
const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore
|
|
587
|
+
XEUtils.eachTree(customColumnList, column => {
|
|
588
|
+
const colid = column.getKey()
|
|
589
|
+
const visible = !!oldVisibleMaps[colid]
|
|
590
|
+
const fixed = oldFixedMaps[colid] || ''
|
|
591
|
+
column.renderVisible = visible
|
|
592
|
+
column.visible = visible
|
|
593
|
+
column.renderFixed = fixed
|
|
594
|
+
column.fixed = fixed
|
|
595
|
+
column.renderSortNumber = oldSortMaps[colid] || 0
|
|
596
|
+
}, { children: 'children' })
|
|
451
597
|
$xetable.closeCustom()
|
|
452
598
|
$xetable.emitCustomEvent('cancel', evnt)
|
|
453
599
|
},
|
|
454
|
-
|
|
600
|
+
handleResetCustomEvent (evnt) {
|
|
455
601
|
const { $xetable } = this
|
|
456
602
|
$xetable.resetColumn(true)
|
|
457
603
|
$xetable.closeCustom()
|
|
458
604
|
$xetable.emitCustomEvent('reset', evnt)
|
|
605
|
+
this.handleSaveStore('confirm')
|
|
606
|
+
},
|
|
607
|
+
resetCustomEvent (evnt) {
|
|
608
|
+
if (VXETable.modal) {
|
|
609
|
+
VXETable.modal.confirm({
|
|
610
|
+
content: GlobalConfig.i18n('vxe.custom.cstmConfirmRestore'),
|
|
611
|
+
className: 'vxe-table--ignore-clear',
|
|
612
|
+
escClosable: true
|
|
613
|
+
}).then(type => {
|
|
614
|
+
if (type === 'confirm') {
|
|
615
|
+
this.handleResetCustomEvent(evnt)
|
|
616
|
+
}
|
|
617
|
+
})
|
|
618
|
+
} else {
|
|
619
|
+
this.handleResetCustomEvent(evnt)
|
|
620
|
+
}
|
|
459
621
|
},
|
|
460
622
|
resetPopupCustomEvent (evnt) {
|
|
461
623
|
if (VXETable.modal) {
|
|
@@ -488,9 +650,9 @@ export default {
|
|
|
488
650
|
changeCheckboxOption (column) {
|
|
489
651
|
const { $xetable } = this
|
|
490
652
|
const { customOpts } = $xetable
|
|
491
|
-
const isChecked = !column.
|
|
653
|
+
const isChecked = !column.renderVisible
|
|
492
654
|
XEUtils.eachTree([column], (item) => {
|
|
493
|
-
item.
|
|
655
|
+
item.renderVisible = isChecked
|
|
494
656
|
item.halfVisible = false
|
|
495
657
|
})
|
|
496
658
|
this.handleOptionCheck(column)
|
|
@@ -502,21 +664,23 @@ export default {
|
|
|
502
664
|
changeFixedOption (column, colFixed) {
|
|
503
665
|
const { $xetable } = this
|
|
504
666
|
const { isMaxFixedColumn } = $xetable
|
|
505
|
-
if (column.
|
|
506
|
-
|
|
667
|
+
if (column.renderFixed === colFixed) {
|
|
668
|
+
column.renderFixed = ''
|
|
669
|
+
// $xeTable.clearColumnFixed(column)
|
|
507
670
|
} else {
|
|
508
|
-
if (!isMaxFixedColumn || column.
|
|
509
|
-
|
|
671
|
+
if (!isMaxFixedColumn || column.renderFixed) {
|
|
672
|
+
column.renderFixed = colFixed
|
|
673
|
+
// $xeTable.setColumnFixed(column, colFixed)
|
|
510
674
|
}
|
|
511
675
|
}
|
|
512
676
|
},
|
|
513
|
-
changePopupFixedOption (column) {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
},
|
|
677
|
+
// changePopupFixedOption (column) {
|
|
678
|
+
// const { $xetable } = this
|
|
679
|
+
// const { isMaxFixedColumn } = $xetable
|
|
680
|
+
// if (!isMaxFixedColumn) {
|
|
681
|
+
// $xetable.setColumnFixed(column, column.fixed)
|
|
682
|
+
// }
|
|
683
|
+
// },
|
|
520
684
|
allCustomEvent () {
|
|
521
685
|
const { $xetable, customStore } = this
|
|
522
686
|
const { customOpts, customColumnList } = $xetable
|
|
@@ -524,7 +688,7 @@ export default {
|
|
|
524
688
|
const isAll = !customStore.isAll
|
|
525
689
|
XEUtils.eachTree(customColumnList, (column) => {
|
|
526
690
|
if (!checkMethod || checkMethod({ column })) {
|
|
527
|
-
column.
|
|
691
|
+
column.renderVisible = isAll
|
|
528
692
|
column.halfVisible = false
|
|
529
693
|
}
|
|
530
694
|
})
|
|
@@ -598,8 +762,6 @@ export default {
|
|
|
598
762
|
}
|
|
599
763
|
removeClass(trEl, 'active--drag-target')
|
|
600
764
|
removeClass(trEl, 'active--drag-origin')
|
|
601
|
-
// 更新顺序
|
|
602
|
-
this.updateColumnSort()
|
|
603
765
|
},
|
|
604
766
|
sortDragoverEvent (evnt) {
|
|
605
767
|
const { $xetable, prevDropTrEl } = this
|
|
@@ -619,15 +781,6 @@ export default {
|
|
|
619
781
|
this.prevDropTrEl = trEl
|
|
620
782
|
}
|
|
621
783
|
updateDropHint(this, evnt)
|
|
622
|
-
},
|
|
623
|
-
updateColumnSort () {
|
|
624
|
-
const { $xetable } = this
|
|
625
|
-
const { customColumnList } = $xetable
|
|
626
|
-
// 更新顺序
|
|
627
|
-
customColumnList.forEach((column, index) => {
|
|
628
|
-
const sortIndex = index + 1
|
|
629
|
-
column.renderSortNumber = sortIndex
|
|
630
|
-
})
|
|
631
784
|
}
|
|
632
785
|
}
|
|
633
786
|
}
|