vxe-table 3.8.2 → 3.8.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/button/style/style.css +6 -6
- package/lib/button/style/style.min.css +1 -1
- package/lib/checkbox/src/group.js +7 -2
- package/lib/checkbox/src/group.min.js +1 -1
- package/lib/custom/src/mixin.js +3 -1
- package/lib/custom/src/mixin.min.js +1 -1
- package/lib/custom/src/panel.js +198 -45
- package/lib/custom/src/panel.min.js +1 -1
- package/lib/custom/style/style.css +327 -80
- package/lib/custom/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +316 -95
- package/lib/index.umd.min.js +1 -1
- package/lib/input/style/style.css +0 -1
- package/lib/input/style/style.min.css +1 -1
- package/lib/loading/src/loading.js +1 -1
- package/lib/loading/src/loading.min.js +1 -1
- package/lib/loading/style/style.css +1 -1
- package/lib/loading/style/style.min.css +1 -1
- package/lib/locale/lang/en-US.js +18 -7
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +18 -7
- package/lib/locale/lang/es-ES.js +18 -7
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +18 -7
- package/lib/locale/lang/ja-JP.js +18 -6
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +18 -6
- package/lib/locale/lang/pt-BR.js +18 -7
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +18 -7
- package/lib/locale/lang/zh-CN.js +18 -7
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +18 -7
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +18 -7
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +18 -7
- package/lib/locale/lang/zh-TC.js +18 -7
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +18 -7
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +18 -7
- package/lib/modal/src/modal.js +1 -1
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/radio/src/group.js +7 -2
- package/lib/radio/src/group.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/columnInfo.js +10 -1
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +56 -33
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +4 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +4 -4
- package/lib/table/style/style.min.css +1 -1
- package/lib/tools/event.js +3 -3
- package/lib/tools/event.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/style/style.css +1 -1
- package/lib/v-x-e-table/style/style.min.css +1 -1
- package/lib/vxe-button/style/style.css +6 -6
- package/lib/vxe-button/style/style.min.css +1 -1
- package/lib/vxe-input/style/style.css +0 -1
- package/lib/vxe-input/style/style.min.css +1 -1
- package/lib/vxe-loading/style/style.css +1 -1
- package/lib/vxe-loading/style/style.min.css +1 -1
- package/lib/vxe-table/style/style.css +4 -4
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-table-custom-module/style/style.css +327 -80
- package/lib/vxe-table-custom-module/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/checkbox/src/group.js +6 -2
- package/packages/custom/src/mixin.js +2 -1
- package/packages/custom/src/panel.js +214 -52
- package/packages/loading/src/loading.js +1 -1
- package/packages/locale/lang/en-US.js +18 -7
- package/packages/locale/lang/es-ES.js +18 -7
- package/packages/locale/lang/ja-JP.js +18 -6
- package/packages/locale/lang/pt-BR.js +18 -7
- package/packages/locale/lang/zh-CN.js +18 -7
- package/packages/locale/lang/zh-TC.js +18 -7
- package/packages/modal/src/modal.js +1 -1
- package/packages/radio/src/group.js +6 -2
- package/packages/table/src/columnInfo.js +9 -3
- package/packages/table/src/methods.js +51 -33
- package/packages/table/src/table.js +4 -3
- package/packages/tools/event.js +3 -3
- package/styles/base/common.scss +4 -4
- package/styles/button.scss +5 -5
- package/styles/custom.scss +192 -86
- package/styles/helpers/mixin.scss +1 -1
- package/styles/input.scss +1 -2
- package/styles/loading.scss +1 -1
- package/styles/modal.scss +2 -2
- package/styles/select.scss +1 -1
- package/styles/table.scss +2 -2
- /package/lib/icon/style/{iconfont.1714101947757.ttf → iconfont.1714297580334.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1714101947757.woff → iconfont.1714297580334.woff} +0 -0
- /package/lib/icon/style/{iconfont.1714101947757.woff2 → iconfont.1714297580334.woff2} +0 -0
- /package/lib/{iconfont.1714101947757.ttf → iconfont.1714297580334.ttf} +0 -0
- /package/lib/{iconfont.1714101947757.woff → iconfont.1714297580334.woff} +0 -0
- /package/lib/{iconfont.1714101947757.woff2 → iconfont.1714297580334.woff2} +0 -0
|
@@ -1,26 +1,46 @@
|
|
|
1
1
|
import UtilTools from '../../tools/utils'
|
|
2
|
+
import DomTools from '../../tools/dom'
|
|
2
3
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
4
|
import XEUtils from 'xe-utils'
|
|
4
5
|
|
|
6
|
+
const { formatText } = UtilTools
|
|
7
|
+
const { addClass, removeClass } = DomTools
|
|
8
|
+
|
|
9
|
+
function updateDropHint (_vm, evnt) {
|
|
10
|
+
const { $refs } = _vm
|
|
11
|
+
const dragHintEl = $refs.dragHintElemRef
|
|
12
|
+
const bodyEl = $refs.bodyElemRef
|
|
13
|
+
if (!bodyEl) {
|
|
14
|
+
return
|
|
15
|
+
}
|
|
16
|
+
if (dragHintEl) {
|
|
17
|
+
const warpperEl = bodyEl.parentNode
|
|
18
|
+
const warpperRect = warpperEl.getBoundingClientRect()
|
|
19
|
+
dragHintEl.style.display = 'block'
|
|
20
|
+
dragHintEl.style.top = `${Math.min(warpperEl.clientHeight - warpperEl.scrollTop - dragHintEl.clientHeight, evnt.clientY - warpperRect.y)}px`
|
|
21
|
+
dragHintEl.style.left = `${Math.min(warpperEl.clientWidth - warpperEl.scrollLeft - dragHintEl.clientWidth - 16, evnt.clientX - warpperRect.x)}px`
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
5
25
|
function renderSimplePanel (h, _vm) {
|
|
6
26
|
const { $xetable, customStore } = _vm
|
|
7
|
-
const { customOpts,
|
|
27
|
+
const { customOpts, customColumnList, isMaxFixedColumn } = $xetable
|
|
8
28
|
const { maxHeight } = customStore
|
|
9
29
|
const { checkMethod, visibleMethod, trigger } = customOpts
|
|
10
30
|
const colVNs = []
|
|
11
31
|
const customWrapperOns = {}
|
|
12
32
|
// hover 触发
|
|
13
33
|
if (trigger === 'hover') {
|
|
14
|
-
customWrapperOns.
|
|
15
|
-
customWrapperOns.
|
|
34
|
+
customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent
|
|
35
|
+
customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent
|
|
16
36
|
}
|
|
17
|
-
XEUtils.eachTree(
|
|
37
|
+
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
18
38
|
const isVisible = visibleMethod ? visibleMethod({ column }) : true
|
|
19
39
|
if (isVisible) {
|
|
20
40
|
const isChecked = column.visible
|
|
21
41
|
const isIndeterminate = column.halfVisible
|
|
22
|
-
const colTitle = UtilTools.formatText(column.getTitle(), 1)
|
|
23
42
|
const isColGroup = column.children && column.children.length
|
|
43
|
+
const colTitle = formatText(column.getTitle(), 1)
|
|
24
44
|
const isDisabled = checkMethod ? !checkMethod({ column }) : false
|
|
25
45
|
colVNs.push(
|
|
26
46
|
h('li', {
|
|
@@ -30,20 +50,19 @@ function renderSimplePanel (h, _vm) {
|
|
|
30
50
|
}]
|
|
31
51
|
}, [
|
|
32
52
|
h('div', {
|
|
53
|
+
title: colTitle,
|
|
33
54
|
class: ['vxe-table-custom--checkbox-option', {
|
|
34
55
|
'is--checked': isChecked,
|
|
35
56
|
'is--indeterminate': isIndeterminate,
|
|
36
57
|
'is--disabled': isDisabled
|
|
37
58
|
}],
|
|
38
|
-
attrs: {
|
|
39
|
-
title: colTitle
|
|
40
|
-
},
|
|
41
59
|
on: {
|
|
42
60
|
click: () => {
|
|
43
61
|
if (!isDisabled) {
|
|
44
62
|
_vm.changeCheckboxOption(column)
|
|
45
63
|
}
|
|
46
64
|
}
|
|
65
|
+
|
|
47
66
|
}
|
|
48
67
|
}, [
|
|
49
68
|
h('span', {
|
|
@@ -129,7 +148,7 @@ function renderSimplePanel (h, _vm) {
|
|
|
129
148
|
style: maxHeight ? {
|
|
130
149
|
maxHeight: `${maxHeight}px`
|
|
131
150
|
} : {},
|
|
132
|
-
|
|
151
|
+
on: customWrapperOns
|
|
133
152
|
}, colVNs),
|
|
134
153
|
customOpts.showFooter ? h('div', {
|
|
135
154
|
class: 'vxe-table-custom--footer'
|
|
@@ -150,28 +169,51 @@ function renderSimplePanel (h, _vm) {
|
|
|
150
169
|
])
|
|
151
170
|
}
|
|
152
171
|
|
|
153
|
-
|
|
172
|
+
function renderPopupPanel (h, _vm) {
|
|
154
173
|
const { $xetable, customStore } = _vm
|
|
155
|
-
const { customOpts,
|
|
174
|
+
const { customOpts, customColumnList, isMaxFixedColumn } = $xetable
|
|
156
175
|
const { checkMethod, visibleMethod } = customOpts
|
|
157
176
|
const trVNs = []
|
|
158
|
-
XEUtils.eachTree(
|
|
177
|
+
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
159
178
|
const isVisible = visibleMethod ? visibleMethod({ column }) : true
|
|
160
179
|
if (isVisible) {
|
|
161
180
|
const isChecked = column.visible
|
|
162
181
|
const isIndeterminate = column.halfVisible
|
|
163
|
-
const colTitle =
|
|
182
|
+
const colTitle = formatText(column.getTitle(), 1)
|
|
164
183
|
const isColGroup = column.children && column.children.length
|
|
165
184
|
const isDisabled = checkMethod ? !checkMethod({ column }) : false
|
|
166
185
|
trVNs.push(
|
|
167
186
|
h('tr', {
|
|
168
187
|
key: column.id,
|
|
169
|
-
class: [`vxe-table-custom-popup--row
|
|
188
|
+
class: [`vxe-table-custom-popup--row level--${column.level}`, {
|
|
170
189
|
'is--group': isColGroup
|
|
171
|
-
}]
|
|
190
|
+
}],
|
|
191
|
+
attrs: {
|
|
192
|
+
colid: column.id
|
|
193
|
+
},
|
|
194
|
+
on: {
|
|
195
|
+
dragstart: _vm.sortDragstartEvent,
|
|
196
|
+
dragend: _vm.sortDragendEvent,
|
|
197
|
+
dragover: _vm.sortDragoverEvent
|
|
198
|
+
}
|
|
172
199
|
}, [
|
|
173
200
|
h('td', {
|
|
174
|
-
class: 'vxe-table-custom-popup--column-
|
|
201
|
+
class: 'vxe-table-custom-popup--column-item col--sort'
|
|
202
|
+
}, [
|
|
203
|
+
column.level === 1 ? h('span', {
|
|
204
|
+
class: 'vxe-table-custom-popup--column-sort-btn',
|
|
205
|
+
on: {
|
|
206
|
+
mousedown: _vm.sortMousedownEvent,
|
|
207
|
+
mouseup: _vm.sortMouseupEvent
|
|
208
|
+
}
|
|
209
|
+
}, [
|
|
210
|
+
h('i', {
|
|
211
|
+
class: 'vxe-icon-sort'
|
|
212
|
+
})
|
|
213
|
+
]) : null
|
|
214
|
+
]),
|
|
215
|
+
h('td', {
|
|
216
|
+
class: 'vxe-table-custom-popup--column-item col--name'
|
|
175
217
|
}, [
|
|
176
218
|
h('div', {
|
|
177
219
|
class: 'vxe-table-custom-popup--name',
|
|
@@ -181,7 +223,7 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
181
223
|
}, colTitle)
|
|
182
224
|
]),
|
|
183
225
|
h('td', {
|
|
184
|
-
class: 'vxe-table-custom-popup--column-
|
|
226
|
+
class: 'vxe-table-custom-popup--column-item col--visible'
|
|
185
227
|
}, [
|
|
186
228
|
h('div', {
|
|
187
229
|
class: ['vxe-table-custom--checkbox-option', {
|
|
@@ -203,18 +245,17 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
203
245
|
])
|
|
204
246
|
]),
|
|
205
247
|
h('td', {
|
|
206
|
-
class: 'vxe-table-custom-popup--column-fixed'
|
|
248
|
+
class: 'vxe-table-custom-popup--column-item col--fixed'
|
|
207
249
|
}, [
|
|
208
250
|
!parent && customOpts.allowFixed ? h('vxe-radio-group', {
|
|
209
251
|
props: {
|
|
210
252
|
value: column.fixed || '',
|
|
211
|
-
disabled: isMaxFixedColumn,
|
|
212
253
|
type: 'button',
|
|
213
254
|
size: 'mini',
|
|
214
255
|
options: [
|
|
215
|
-
{ label: '
|
|
216
|
-
{ label: '
|
|
217
|
-
{ label: '
|
|
256
|
+
{ label: GlobalConfig.i18n('vxe.custom.setting.fixedLeft'), value: 'left', disabled: isMaxFixedColumn },
|
|
257
|
+
{ label: GlobalConfig.i18n('vxe.custom.setting.fixedUnset'), value: '' },
|
|
258
|
+
{ label: GlobalConfig.i18n('vxe.custom.setting.fixedRight'), value: 'right', disabled: isMaxFixedColumn }
|
|
218
259
|
]
|
|
219
260
|
},
|
|
220
261
|
on: {
|
|
@@ -234,15 +275,19 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
234
275
|
return h('vxe-modal', {
|
|
235
276
|
key: 'popup',
|
|
236
277
|
props: {
|
|
237
|
-
className: 'vxe-table-custom-popup-warpper vxe-table--ignore-clear',
|
|
238
278
|
value: customStore.visible,
|
|
239
279
|
title: GlobalConfig.i18n('vxe.custom.cstmTitle'),
|
|
240
|
-
|
|
241
|
-
|
|
280
|
+
className: 'vxe-table-custom-popup-wrapper vxe-table--ignore-clear',
|
|
281
|
+
width: '40vw',
|
|
282
|
+
minWidth: 500,
|
|
283
|
+
height: '50vh',
|
|
284
|
+
minHeight: 300,
|
|
242
285
|
mask: true,
|
|
243
286
|
lockView: true,
|
|
244
287
|
showFooter: true,
|
|
245
|
-
|
|
288
|
+
resize: true,
|
|
289
|
+
escClosable: true,
|
|
290
|
+
destroyOnClose: true
|
|
246
291
|
},
|
|
247
292
|
on: {
|
|
248
293
|
input (value) {
|
|
@@ -252,32 +297,52 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
252
297
|
scopedSlots: {
|
|
253
298
|
default: () => {
|
|
254
299
|
return h('div', {
|
|
300
|
+
ref: 'bodyElemRef',
|
|
255
301
|
class: 'vxe-table-custom-popup--body'
|
|
256
302
|
}, [
|
|
257
|
-
h('
|
|
303
|
+
h('div', {
|
|
304
|
+
class: 'vxe-table-custom-popup--table-wrapper'
|
|
258
305
|
}, [
|
|
259
|
-
h('
|
|
260
|
-
h('
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
306
|
+
h('table', {}, [
|
|
307
|
+
h('colgroup', {}, [
|
|
308
|
+
h('col', {
|
|
309
|
+
style: {
|
|
310
|
+
width: '60px'
|
|
311
|
+
}
|
|
312
|
+
}),
|
|
313
|
+
h('col'),
|
|
314
|
+
h('col', {
|
|
315
|
+
style: {
|
|
316
|
+
width: '80px'
|
|
317
|
+
}
|
|
318
|
+
}),
|
|
319
|
+
h('col', {
|
|
320
|
+
style: {
|
|
321
|
+
width: '200px'
|
|
322
|
+
}
|
|
323
|
+
})
|
|
324
|
+
]),
|
|
325
|
+
h('thead', {}, [
|
|
326
|
+
h('tr', {}, [
|
|
327
|
+
h('th', {}, GlobalConfig.i18n('vxe.custom.setting.colSort')),
|
|
328
|
+
h('th', {}, GlobalConfig.i18n('vxe.custom.setting.colTitle')),
|
|
329
|
+
h('th', {}, GlobalConfig.i18n('vxe.custom.setting.colVisible')),
|
|
330
|
+
h('th', {}, GlobalConfig.i18n('vxe.custom.setting.colFixed'))
|
|
331
|
+
])
|
|
332
|
+
]),
|
|
333
|
+
h('transition-group', {
|
|
334
|
+
class: 'vxe-table-custom--body',
|
|
335
|
+
props: {
|
|
336
|
+
tag: 'tbody',
|
|
337
|
+
name: 'vxe-table-custom--flip'
|
|
269
338
|
}
|
|
270
|
-
})
|
|
271
|
-
])
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
])
|
|
278
|
-
]),
|
|
279
|
-
h('tbody', {}, trVNs)
|
|
280
|
-
])
|
|
339
|
+
}, trVNs)
|
|
340
|
+
])
|
|
341
|
+
]),
|
|
342
|
+
h('div', {
|
|
343
|
+
ref: 'dragHintElemRef',
|
|
344
|
+
class: 'vxe-table-custom-popup--drag-hint'
|
|
345
|
+
}, GlobalConfig.i18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))
|
|
281
346
|
])
|
|
282
347
|
},
|
|
283
348
|
footer: () => {
|
|
@@ -328,6 +393,11 @@ export default {
|
|
|
328
393
|
default: null
|
|
329
394
|
}
|
|
330
395
|
},
|
|
396
|
+
data () {
|
|
397
|
+
return {
|
|
398
|
+
dragColumn: null
|
|
399
|
+
}
|
|
400
|
+
},
|
|
331
401
|
computed: {
|
|
332
402
|
},
|
|
333
403
|
render (h) {
|
|
@@ -374,8 +444,8 @@ export default {
|
|
|
374
444
|
},
|
|
375
445
|
handleOptionCheck (column) {
|
|
376
446
|
const { $xetable } = this
|
|
377
|
-
const {
|
|
378
|
-
const matchObj = XEUtils.findTree(
|
|
447
|
+
const { customColumnList } = $xetable
|
|
448
|
+
const matchObj = XEUtils.findTree(customColumnList, item => item === column)
|
|
379
449
|
if (matchObj && matchObj.parent) {
|
|
380
450
|
const { parent } = matchObj
|
|
381
451
|
if (parent.children && parent.children.length) {
|
|
@@ -418,10 +488,11 @@ export default {
|
|
|
418
488
|
}
|
|
419
489
|
},
|
|
420
490
|
allCustomEvent () {
|
|
421
|
-
const { $xetable, customStore
|
|
491
|
+
const { $xetable, customStore } = this
|
|
492
|
+
const { customOpts, customColumnList } = $xetable
|
|
422
493
|
const { checkMethod } = customOpts
|
|
423
494
|
const isAll = !customStore.isAll
|
|
424
|
-
XEUtils.eachTree(
|
|
495
|
+
XEUtils.eachTree(customColumnList, (column) => {
|
|
425
496
|
if (!checkMethod || checkMethod({ column })) {
|
|
426
497
|
column.visible = isAll
|
|
427
498
|
column.halfVisible = false
|
|
@@ -429,6 +500,97 @@ export default {
|
|
|
429
500
|
})
|
|
430
501
|
customStore.isAll = isAll
|
|
431
502
|
$xetable.checkCustomStatus()
|
|
503
|
+
},
|
|
504
|
+
sortMousedownEvent (evnt) {
|
|
505
|
+
const { $xetable } = this
|
|
506
|
+
const btnEl = evnt.currentTarget
|
|
507
|
+
const tdEl = btnEl.parentNode
|
|
508
|
+
const trEl = tdEl.parentNode
|
|
509
|
+
const colid = trEl.getAttribute('colid')
|
|
510
|
+
const column = $xetable.getColumnById(colid)
|
|
511
|
+
trEl.draggable = true
|
|
512
|
+
this.dragColumn = column
|
|
513
|
+
addClass(trEl, 'active--drag-origin')
|
|
514
|
+
},
|
|
515
|
+
sortMouseupEvent (evnt) {
|
|
516
|
+
const btnEl = evnt.currentTarget
|
|
517
|
+
const tdEl = btnEl.parentNode
|
|
518
|
+
const trEl = tdEl.parentNode
|
|
519
|
+
const dragHintEl = this.$refs.dragHintElemRef
|
|
520
|
+
trEl.draggable = false
|
|
521
|
+
this.dragColumn = null
|
|
522
|
+
removeClass(trEl, 'active--drag-origin')
|
|
523
|
+
if (dragHintEl) {
|
|
524
|
+
dragHintEl.style.display = ''
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
sortDragstartEvent (evnt) {
|
|
528
|
+
const img = new Image()
|
|
529
|
+
if (evnt.dataTransfer) {
|
|
530
|
+
evnt.dataTransfer.setDragImage(img, 0, 0)
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
sortDragendEvent (evnt) {
|
|
534
|
+
const { $xetable, prevDropTrEl } = this
|
|
535
|
+
const { customColumnList } = $xetable
|
|
536
|
+
const trEl = evnt.currentTarget
|
|
537
|
+
const dragHintEl = this.$refs.dragHintElemRef
|
|
538
|
+
if (prevDropTrEl) {
|
|
539
|
+
// 判断是否有拖动
|
|
540
|
+
if (prevDropTrEl !== trEl) {
|
|
541
|
+
const dragOffset = prevDropTrEl.getAttribute('drag-pos')
|
|
542
|
+
const colid = trEl.getAttribute('colid')
|
|
543
|
+
const column = $xetable.getColumnById(colid)
|
|
544
|
+
if (!column) {
|
|
545
|
+
return
|
|
546
|
+
}
|
|
547
|
+
const cIndex = XEUtils.findIndexOf(customColumnList, item => item.id === column.id)
|
|
548
|
+
const targetColid = prevDropTrEl.getAttribute('colid')
|
|
549
|
+
const targetColumn = $xetable.getColumnById(targetColid)
|
|
550
|
+
if (!targetColumn) {
|
|
551
|
+
return
|
|
552
|
+
}
|
|
553
|
+
// 移出源位置
|
|
554
|
+
customColumnList.splice(cIndex, 1)
|
|
555
|
+
const tcIndex = XEUtils.findIndexOf(customColumnList, item => item.id === targetColumn.id)
|
|
556
|
+
// 插新位置
|
|
557
|
+
customColumnList.splice(tcIndex + (dragOffset === 'bottom' ? 1 : 0), 0, column)
|
|
558
|
+
}
|
|
559
|
+
prevDropTrEl.draggable = false
|
|
560
|
+
prevDropTrEl.removeAttribute('drag-pos')
|
|
561
|
+
removeClass(prevDropTrEl, 'active--drag-target')
|
|
562
|
+
}
|
|
563
|
+
this.dragColumn = null
|
|
564
|
+
trEl.draggable = false
|
|
565
|
+
trEl.removeAttribute('drag-pos')
|
|
566
|
+
if (dragHintEl) {
|
|
567
|
+
dragHintEl.style.display = ''
|
|
568
|
+
}
|
|
569
|
+
removeClass(trEl, 'active--drag-target')
|
|
570
|
+
removeClass(trEl, 'active--drag-origin')
|
|
571
|
+
// 更新顺序
|
|
572
|
+
customColumnList.forEach((column, index) => {
|
|
573
|
+
column.renderSortNumber = index
|
|
574
|
+
})
|
|
575
|
+
},
|
|
576
|
+
sortDragoverEvent (evnt) {
|
|
577
|
+
const { $xetable, prevDropTrEl } = this
|
|
578
|
+
const trEl = evnt.currentTarget
|
|
579
|
+
if (prevDropTrEl !== trEl) {
|
|
580
|
+
removeClass(prevDropTrEl, 'active--drag-target')
|
|
581
|
+
}
|
|
582
|
+
const colid = trEl.getAttribute('colid')
|
|
583
|
+
const column = $xetable.getColumnById(colid)
|
|
584
|
+
// 是否移入有效元行
|
|
585
|
+
if (column && column.level === 1) {
|
|
586
|
+
evnt.preventDefault()
|
|
587
|
+
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y
|
|
588
|
+
const dragOffset = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom'
|
|
589
|
+
addClass(trEl, 'active--drag-target')
|
|
590
|
+
trEl.setAttribute('drag-pos', dragOffset)
|
|
591
|
+
this.prevDropTrEl = trEl
|
|
592
|
+
}
|
|
593
|
+
updateDropHint(this, evnt)
|
|
432
594
|
}
|
|
433
595
|
}
|
|
434
596
|
}
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
text: 'Loading...'
|
|
9
9
|
},
|
|
10
10
|
error: {
|
|
11
|
-
groupFixed: 'If you use group headers, the
|
|
11
|
+
groupFixed: 'If you use group headers, the freeze columns must be set by group.',
|
|
12
12
|
groupMouseRange: 'Grouping headers and "{0}" cannot be used at the same time, which may cause errors.',
|
|
13
13
|
groupTag: 'Grouping column header should use "{0}" instead of "{1}", which may cause errors.',
|
|
14
14
|
scrollErrProp: 'The parameter "{0}" is not supported when virtual scrolling is enabled.',
|
|
@@ -61,7 +61,7 @@ export default {
|
|
|
61
61
|
customAll: 'All',
|
|
62
62
|
customConfirm: 'Confirm',
|
|
63
63
|
customRestore: 'Reset',
|
|
64
|
-
maxFixedCol: 'The maximum number of
|
|
64
|
+
maxFixedCol: 'The maximum number of Freeze columns cannot exceed {0}'
|
|
65
65
|
},
|
|
66
66
|
grid: {
|
|
67
67
|
selectOneRecord: 'Please choose at least one piece of record!',
|
|
@@ -96,7 +96,7 @@ export default {
|
|
|
96
96
|
endPageTitle: 'End'
|
|
97
97
|
},
|
|
98
98
|
alert: {
|
|
99
|
-
title: '
|
|
99
|
+
title: 'System messages'
|
|
100
100
|
},
|
|
101
101
|
button: {
|
|
102
102
|
confirm: 'Confirm',
|
|
@@ -109,7 +109,18 @@ export default {
|
|
|
109
109
|
cstmTitle: 'Column Settings',
|
|
110
110
|
cstmRestore: 'Restore default',
|
|
111
111
|
cstmCancel: 'Cancelar',
|
|
112
|
-
cstmConfirm: 'Confirm'
|
|
112
|
+
cstmConfirm: 'Confirm',
|
|
113
|
+
cstmConfirmRestore: 'Please confirm whether to restore the default column configuration?',
|
|
114
|
+
cstmDragTarget: 'Moving target: {0}',
|
|
115
|
+
setting: {
|
|
116
|
+
colSort: 'Sort',
|
|
117
|
+
colTitle: 'Title',
|
|
118
|
+
colVisible: 'Visible',
|
|
119
|
+
colFixed: 'Freeze column',
|
|
120
|
+
fixedLeft: 'Left',
|
|
121
|
+
fixedUnset: 'Unset',
|
|
122
|
+
fixedRight: 'Right'
|
|
123
|
+
}
|
|
113
124
|
},
|
|
114
125
|
import: {
|
|
115
126
|
modes: {
|
|
@@ -188,9 +199,9 @@ export default {
|
|
|
188
199
|
customAll: 'All',
|
|
189
200
|
customConfirm: 'Confirm',
|
|
190
201
|
customRestore: 'Reset',
|
|
191
|
-
fixedLeft: '
|
|
192
|
-
fixedRight: '
|
|
193
|
-
cancelfixed: '
|
|
202
|
+
fixedLeft: 'Freeze on the left',
|
|
203
|
+
fixedRight: 'Freeze on the right',
|
|
204
|
+
cancelfixed: 'Unfreeze column'
|
|
194
205
|
},
|
|
195
206
|
input: {
|
|
196
207
|
date: {
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
text: 'Cargando...'
|
|
9
9
|
},
|
|
10
10
|
error: {
|
|
11
|
-
groupFixed: '
|
|
11
|
+
groupFixed: 'If you use group headers, the freeze columns must be set by group.',
|
|
12
12
|
groupMouseRange: 'Los encabezados de agrupación y "{0}" no pueden ser utilizados al mismo tiempo, lo que puede causar errores.',
|
|
13
13
|
groupTag: 'El encabezado de columna de agrupación debería utilizar "{0}" en lugar de "{1}", lo que puede causar errores.',
|
|
14
14
|
scrollErrProp: 'El parámetro "{0}" no es compatible cuando el desplazamiento virtual está habilitado.',
|
|
@@ -61,7 +61,7 @@ export default {
|
|
|
61
61
|
customAll: 'Todo',
|
|
62
62
|
customConfirm: 'Confirmar',
|
|
63
63
|
customRestore: 'Restaurar',
|
|
64
|
-
maxFixedCol: '
|
|
64
|
+
maxFixedCol: 'The maximum number of Freeze columns cannot exceed {0}'
|
|
65
65
|
},
|
|
66
66
|
grid: {
|
|
67
67
|
selectOneRecord: '¡Seleccione al menos un registro!',
|
|
@@ -88,7 +88,7 @@ export default {
|
|
|
88
88
|
nextJump: 'Saltar siguiente página'
|
|
89
89
|
},
|
|
90
90
|
alert: {
|
|
91
|
-
title: '
|
|
91
|
+
title: 'System messages'
|
|
92
92
|
},
|
|
93
93
|
button: {
|
|
94
94
|
confirm: 'Confirmar',
|
|
@@ -101,7 +101,18 @@ export default {
|
|
|
101
101
|
cstmTitle: 'Column Settings',
|
|
102
102
|
cstmRestore: 'Restore default',
|
|
103
103
|
cstmCancel: 'Cancelar',
|
|
104
|
-
cstmConfirm: 'Confirm'
|
|
104
|
+
cstmConfirm: 'Confirm',
|
|
105
|
+
cstmConfirmRestore: 'Please confirm whether to restore the default column configuration?',
|
|
106
|
+
cstmDragTarget: 'Moving target: {0}',
|
|
107
|
+
setting: {
|
|
108
|
+
colSort: 'Sort',
|
|
109
|
+
colTitle: 'Title',
|
|
110
|
+
colVisible: 'Visible',
|
|
111
|
+
colFixed: 'Freeze column',
|
|
112
|
+
fixedLeft: 'Left',
|
|
113
|
+
fixedUnset: 'Unset',
|
|
114
|
+
fixedRight: 'Right'
|
|
115
|
+
}
|
|
105
116
|
},
|
|
106
117
|
import: {
|
|
107
118
|
modes: {
|
|
@@ -180,9 +191,9 @@ export default {
|
|
|
180
191
|
customAll: 'Todo',
|
|
181
192
|
customConfirm: 'Confirmar',
|
|
182
193
|
customRestore: 'Restaurar',
|
|
183
|
-
fixedLeft: '
|
|
184
|
-
fixedRight: '
|
|
185
|
-
cancelfixed: '
|
|
194
|
+
fixedLeft: 'Freeze on the left',
|
|
195
|
+
fixedRight: 'Freeze on the right',
|
|
196
|
+
cancelfixed: 'Unfreeze column'
|
|
186
197
|
},
|
|
187
198
|
entrada: {
|
|
188
199
|
fecha: {
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
text: 'Loading...'
|
|
9
9
|
},
|
|
10
10
|
error: {
|
|
11
|
-
groupFixed: '
|
|
11
|
+
groupFixed: 'If you use group headers, the freeze columns must be set by group.',
|
|
12
12
|
groupMouseRange: 'グループ化ヘッダーと「{0}」は同時に使用できません。これによりエラーが発生する可能性があります',
|
|
13
13
|
groupTag: '分组列头应该使用 "{0}" 而不是 "{1}",这可能会出现错误',
|
|
14
14
|
scrollErrProp: '启用虚拟滚动后不支持该参数 "{0}"',
|
|
@@ -61,7 +61,7 @@ export default {
|
|
|
61
61
|
customAll: '全部',
|
|
62
62
|
customConfirm: '确认',
|
|
63
63
|
customRestore: 'リセット',
|
|
64
|
-
maxFixedCol: '
|
|
64
|
+
maxFixedCol: 'The maximum number of Freeze columns cannot exceed {0}'
|
|
65
65
|
},
|
|
66
66
|
grid: {
|
|
67
67
|
selectOneRecord: '少なくとも1つのレコードを選択してください',
|
|
@@ -96,7 +96,7 @@ export default {
|
|
|
96
96
|
endPageTitle: 'End page'
|
|
97
97
|
},
|
|
98
98
|
alert: {
|
|
99
|
-
title: '
|
|
99
|
+
title: 'System messages'
|
|
100
100
|
},
|
|
101
101
|
button: {
|
|
102
102
|
confirm: '完了',
|
|
@@ -109,7 +109,18 @@ export default {
|
|
|
109
109
|
cstmTitle: 'Column Settings',
|
|
110
110
|
cstmRestore: 'Restore default',
|
|
111
111
|
cstmCancel: 'Cancelar',
|
|
112
|
-
cstmConfirm: 'Confirm'
|
|
112
|
+
cstmConfirm: 'Confirm',
|
|
113
|
+
cstmConfirmRestore: 'Please confirm whether to restore the default column configuration?',
|
|
114
|
+
cstmDragTarget: 'Moving target: {0}',
|
|
115
|
+
setting: {
|
|
116
|
+
colSort: 'Sort',
|
|
117
|
+
colTitle: 'Title',
|
|
118
|
+
colVisible: 'Visible',
|
|
119
|
+
colFixed: 'Freeze column',
|
|
120
|
+
fixedLeft: 'Left',
|
|
121
|
+
fixedUnset: 'Unset',
|
|
122
|
+
fixedRight: 'Right'
|
|
123
|
+
}
|
|
113
124
|
},
|
|
114
125
|
import: {
|
|
115
126
|
modes: {
|
|
@@ -188,8 +199,9 @@ export default {
|
|
|
188
199
|
customAll: '全部',
|
|
189
200
|
customConfirm: '確定',
|
|
190
201
|
customRestore: 'リセット',
|
|
191
|
-
fixedLeft: '
|
|
192
|
-
fixedRight: '
|
|
202
|
+
fixedLeft: 'Freeze on the left',
|
|
203
|
+
fixedRight: 'Freeze on the right',
|
|
204
|
+
cancelfixed: 'Unfreeze column'
|
|
193
205
|
},
|
|
194
206
|
input: {
|
|
195
207
|
date: {
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
text: 'Carregando...'
|
|
9
9
|
},
|
|
10
10
|
error: {
|
|
11
|
-
groupFixed: '
|
|
11
|
+
groupFixed: 'If you use group headers, the freeze columns must be set by group.',
|
|
12
12
|
groupMouseRange: 'Agrupar cabeçalhos e "{0}" não podem ser usados ao mesmo tempo, o que pode causar erros.',
|
|
13
13
|
groupTag: 'O cabeçalho da coluna de agrupamento deve usar "{0}" em vez de "{1}", o que pode causar erros.',
|
|
14
14
|
scrollErrProp: 'O parâmetro "{0}" não é suportado quando a rolagem virtual está habilitada.',
|
|
@@ -61,7 +61,7 @@ export default {
|
|
|
61
61
|
customAll: 'Todos',
|
|
62
62
|
customConfirm: 'Confirmar',
|
|
63
63
|
customRestore: 'Redefinir',
|
|
64
|
-
maxFixedCol: '
|
|
64
|
+
maxFixedCol: 'The maximum number of Freeze columns cannot exceed {0}'
|
|
65
65
|
},
|
|
66
66
|
grid: {
|
|
67
67
|
selectOneRecord: 'Por favor, selecione pelo menos um registro!',
|
|
@@ -88,7 +88,7 @@ export default {
|
|
|
88
88
|
nextJump: 'Saltar para próxima página'
|
|
89
89
|
},
|
|
90
90
|
alert: {
|
|
91
|
-
title: '
|
|
91
|
+
title: 'System messages'
|
|
92
92
|
},
|
|
93
93
|
button: {
|
|
94
94
|
confirm: 'Confirmar',
|
|
@@ -101,7 +101,18 @@ export default {
|
|
|
101
101
|
cstmTitle: 'Column Settings',
|
|
102
102
|
cstmRestore: 'Restore default',
|
|
103
103
|
cstmCancel: 'Cancelar',
|
|
104
|
-
cstmConfirm: 'Confirm'
|
|
104
|
+
cstmConfirm: 'Confirm',
|
|
105
|
+
cstmConfirmRestore: 'Please confirm whether to restore the default column configuration?',
|
|
106
|
+
cstmDragTarget: 'Moving target: {0}',
|
|
107
|
+
setting: {
|
|
108
|
+
colSort: 'Sort',
|
|
109
|
+
colTitle: 'Title',
|
|
110
|
+
colVisible: 'Visible',
|
|
111
|
+
colFixed: 'Freeze column',
|
|
112
|
+
fixedLeft: 'Left',
|
|
113
|
+
fixedUnset: 'Unset',
|
|
114
|
+
fixedRight: 'Right'
|
|
115
|
+
}
|
|
105
116
|
},
|
|
106
117
|
import: {
|
|
107
118
|
modes: {
|
|
@@ -180,9 +191,9 @@ export default {
|
|
|
180
191
|
customAll: 'Todos',
|
|
181
192
|
customConfirm: 'Confirmar',
|
|
182
193
|
customRestore: 'Redefinir',
|
|
183
|
-
fixedLeft: '
|
|
184
|
-
fixedRight: '
|
|
185
|
-
cancelfixed: '
|
|
194
|
+
fixedLeft: 'Freeze on the left',
|
|
195
|
+
fixedRight: 'Freeze on the right',
|
|
196
|
+
cancelfixed: 'Unfreeze column'
|
|
186
197
|
},
|
|
187
198
|
input: {
|
|
188
199
|
date: {
|