vxe-table 3.5.8 → 3.5.9-beta.10
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/lib/edit/src/mixin.js +18 -14
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/mixin.js +1 -1
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/filter/src/mixin.js +8 -5
- package/lib/filter/src/mixin.min.js +1 -1
- package/lib/filter/src/panel.js +7 -2
- package/lib/filter/src/panel.min.js +1 -1
- package/lib/form/src/form-config-item.js +2 -1
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form-item.js +3 -1
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +12 -7
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +1 -0
- package/lib/form/src/render.min.js +1 -1
- package/lib/form/style/style.css +2 -1
- package/lib/form/style/style.min.css +1 -1
- package/lib/grid/src/grid.js +14 -8
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +804 -496
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +20 -15
- package/lib/input/src/input.min.js +1 -1
- package/lib/list/src/list.js +12 -7
- package/lib/list/src/list.min.js +1 -1
- package/lib/loading/index.js +19 -0
- package/lib/loading/index.min.js +1 -0
- package/lib/loading/src/loading.js +36 -0
- package/lib/loading/src/loading.min.js +1 -0
- package/lib/locale/lang/en-US.js +5 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +5 -0
- package/lib/locale/lang/ja-JP.js +5 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +5 -0
- package/lib/locale/lang/zh-CN.js +5 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +5 -0
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +5 -0
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +5 -0
- package/lib/locale/lang/zh-TC.js +5 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +5 -0
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +5 -0
- package/lib/modal/src/modal.js +28 -12
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/modal/style/style.css +1 -1
- package/lib/modal/style/style.min.css +1 -1
- package/lib/select/src/select.js +213 -33
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/style/style.css +17 -72
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +6 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +3 -3
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -1
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +84 -62
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +12 -8
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +0 -68
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/style/style.css +13 -10
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/tools/utils.js +2 -2
- package/lib/tools/utils.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 +6 -2
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +10 -5
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/lib/v-x-e-table/style/style.css +590 -0
- package/lib/v-x-e-table/style/style.min.css +1 -0
- package/package.json +1 -1
- package/packages/edit/src/mixin.js +17 -13
- package/packages/export/src/mixin.js +2 -2
- package/packages/filter/src/mixin.js +5 -5
- package/packages/filter/src/panel.js +13 -6
- package/packages/form/src/form-config-item.js +17 -9
- package/packages/form/src/form-item.js +16 -8
- package/packages/form/src/form.js +10 -9
- package/packages/form/src/render.js +1 -1
- package/packages/grid/src/grid.js +9 -7
- package/packages/input/src/input.js +17 -13
- package/packages/list/src/list.js +10 -9
- package/packages/loading/index.js +9 -0
- package/packages/loading/src/loading.js +31 -0
- package/packages/locale/lang/en-US.js +5 -0
- package/packages/locale/lang/ja-JP.js +5 -0
- package/packages/locale/lang/zh-CN.js +5 -0
- package/packages/locale/lang/zh-TC.js +5 -0
- package/packages/modal/src/modal.js +23 -14
- package/packages/select/src/select.js +139 -16
- package/packages/table/src/body.js +39 -24
- package/packages/table/src/cell.js +3 -3
- package/packages/table/src/columnInfo.js +1 -1
- package/packages/table/src/methods.js +68 -57
- package/packages/table/src/table.js +10 -9
- package/packages/tools/utils.js +2 -2
- package/packages/v-x-e-table/src/conf.js +6 -2
- package/packages/v-x-e-table/src/store.js +8 -4
- package/styles/form.scss +1 -0
- package/styles/{base/loading.scss → loading.scss} +17 -4
- package/styles/modal.scss +1 -1
- package/styles/modules.scss +1 -0
- package/styles/select.scss +24 -6
- package/styles/table.scss +0 -1
- package/styles/toolbar.scss +9 -5
- package/styles/v-x-e-table.scss +2 -0
- package/styles/variable.scss +0 -4
- package/types/form-item.d.ts +11 -8
- package/types/form.d.ts +5 -2
- package/types/table.d.ts +5 -0
- package/types/v-x-e-table/renderer.d.ts +15 -2
|
@@ -3,7 +3,7 @@ import VXETable from '../../v-x-e-table'
|
|
|
3
3
|
import UtilTools, { isEnableConf } from '../../tools/utils'
|
|
4
4
|
import { getRowid } from '../../table/src/util'
|
|
5
5
|
import DomTools, { browse } from '../../tools/dom'
|
|
6
|
-
import { warnLog, errLog } from '../../tools/log'
|
|
6
|
+
import { warnLog, errLog, getLog } from '../../tools/log'
|
|
7
7
|
|
|
8
8
|
function insertTreeRow (_vm, newRecords, isAppend) {
|
|
9
9
|
const { tableFullTreeData, afterFullData, fullDataRowIdData, fullAllDataRowIdData, treeOpts } = _vm
|
|
@@ -130,7 +130,7 @@ export default {
|
|
|
130
130
|
}
|
|
131
131
|
} else {
|
|
132
132
|
if (treeConfig) {
|
|
133
|
-
throw new Error(
|
|
133
|
+
throw new Error(getLog('vxe.error.noTree', ['insert']))
|
|
134
134
|
}
|
|
135
135
|
let afIndex = -1
|
|
136
136
|
// 如果是可视索引
|
|
@@ -189,7 +189,7 @@ export default {
|
|
|
189
189
|
const { afterFullData, tableFullData, tableFullTreeData, treeConfig, mergeList, editStore, checkboxOpts, selection, isInsertByRow, treeOpts } = this
|
|
190
190
|
const { transform } = treeOpts
|
|
191
191
|
const { actived, removeList, insertList } = editStore
|
|
192
|
-
const { checkField
|
|
192
|
+
const { checkField } = checkboxOpts
|
|
193
193
|
let rest = []
|
|
194
194
|
if (!rows) {
|
|
195
195
|
rows = tableFullData
|
|
@@ -203,7 +203,7 @@ export default {
|
|
|
203
203
|
}
|
|
204
204
|
})
|
|
205
205
|
// 如果绑定了多选属性,则更新状态
|
|
206
|
-
if (!
|
|
206
|
+
if (!checkField) {
|
|
207
207
|
rows.forEach(row => {
|
|
208
208
|
const sIndex = selection.indexOf(row)
|
|
209
209
|
if (sIndex > -1) {
|
|
@@ -380,16 +380,17 @@ export default {
|
|
|
380
380
|
*/
|
|
381
381
|
handleActived (params, evnt) {
|
|
382
382
|
const { editStore, editOpts, tableColumn, editConfig, mouseConfig } = this
|
|
383
|
-
const { mode
|
|
383
|
+
const { mode } = editOpts
|
|
384
384
|
const { actived } = editStore
|
|
385
385
|
const { row, column } = params
|
|
386
386
|
const { editRender } = column
|
|
387
387
|
const cell = params.cell = (params.cell || this.getCell(row, column))
|
|
388
|
+
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod
|
|
388
389
|
if (isEnableConf(editConfig) && isEnableConf(editRender) && cell) {
|
|
389
390
|
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
390
391
|
// 判断是否禁用编辑
|
|
391
392
|
let type = 'edit-disabled'
|
|
392
|
-
if (!
|
|
393
|
+
if (!beforeEditMethod || beforeEditMethod({ ...params, $table: this })) {
|
|
393
394
|
if (mouseConfig) {
|
|
394
395
|
this.clearSelected(evnt)
|
|
395
396
|
this.clearCellAreas(evnt)
|
|
@@ -542,18 +543,21 @@ export default {
|
|
|
542
543
|
const { editRender } = column
|
|
543
544
|
if (isEnableConf(editRender)) {
|
|
544
545
|
const compRender = VXETable.renderer.get(editRender.name)
|
|
545
|
-
|
|
546
|
+
let { autofocus, autoselect } = editRender
|
|
546
547
|
let inputElem
|
|
548
|
+
if (!autofocus && compRender) {
|
|
549
|
+
autofocus = compRender.autofocus
|
|
550
|
+
}
|
|
547
551
|
// 如果指定了聚焦 class
|
|
548
|
-
if (autofocus) {
|
|
552
|
+
if (XEUtils.isFunction(autofocus)) {
|
|
553
|
+
inputElem = autofocus.call(this, params)
|
|
554
|
+
} else if (autofocus) {
|
|
549
555
|
inputElem = cell.querySelector(autofocus)
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
inputElem = cell.querySelector(compRender.autofocus)
|
|
556
|
+
if (inputElem) {
|
|
557
|
+
inputElem.focus()
|
|
558
|
+
}
|
|
554
559
|
}
|
|
555
560
|
if (inputElem) {
|
|
556
|
-
inputElem.focus()
|
|
557
561
|
if (autoselect) {
|
|
558
562
|
inputElem.select()
|
|
559
563
|
} else {
|
|
@@ -4,7 +4,7 @@ import VXETable from '../../v-x-e-table'
|
|
|
4
4
|
import UtilTools from '../../tools/utils'
|
|
5
5
|
import { mergeBodyMethod, isColumnInfo } from '../../table/src/util'
|
|
6
6
|
import { browse } from '../../tools/dom'
|
|
7
|
-
import { warnLog, errLog } from '../../tools/log'
|
|
7
|
+
import { warnLog, errLog, getLog } from '../../tools/log'
|
|
8
8
|
|
|
9
9
|
const { formatText } = UtilTools
|
|
10
10
|
|
|
@@ -576,7 +576,7 @@ export function saveLocalFile (options) {
|
|
|
576
576
|
}
|
|
577
577
|
return Promise.resolve()
|
|
578
578
|
}
|
|
579
|
-
return Promise.reject(new Error(
|
|
579
|
+
return Promise.reject(new Error(getLog('vxe.error.notExp')))
|
|
580
580
|
}
|
|
581
581
|
|
|
582
582
|
function downloadFile ($xetable, opts, content) {
|
|
@@ -130,13 +130,13 @@ export default {
|
|
|
130
130
|
filterStore.maxHeight = maxHeight
|
|
131
131
|
})
|
|
132
132
|
}
|
|
133
|
-
this.emitEvent('filter-visible', { column, property: column.
|
|
133
|
+
this.emitEvent('filter-visible', { column, field: column.field, property: column.field, filterList: this.getCheckedFilters(), visible: filterStore.visible }, evnt)
|
|
134
134
|
},
|
|
135
135
|
_getCheckedFilters () {
|
|
136
136
|
const { tableFullColumn } = this
|
|
137
137
|
const filterList = []
|
|
138
138
|
tableFullColumn.filter(column => {
|
|
139
|
-
const {
|
|
139
|
+
const { field, filters } = column
|
|
140
140
|
const valueList = []
|
|
141
141
|
const dataList = []
|
|
142
142
|
if (filters && filters.length) {
|
|
@@ -147,7 +147,7 @@ export default {
|
|
|
147
147
|
}
|
|
148
148
|
})
|
|
149
149
|
if (valueList.length) {
|
|
150
|
-
filterList.push({ column, property, values: valueList, datas: dataList })
|
|
150
|
+
filterList.push({ column, field, property: field, values: valueList, datas: dataList })
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
})
|
|
@@ -161,7 +161,7 @@ export default {
|
|
|
161
161
|
confirmFilterEvent (evnt) {
|
|
162
162
|
const { filterStore, filterOpts, scrollXLoad: oldScrollXLoad, scrollYLoad: oldScrollYLoad } = this
|
|
163
163
|
const { column } = filterStore
|
|
164
|
-
const {
|
|
164
|
+
const { field } = column
|
|
165
165
|
const values = []
|
|
166
166
|
const datas = []
|
|
167
167
|
column.filters.forEach(item => {
|
|
@@ -176,7 +176,7 @@ export default {
|
|
|
176
176
|
this.handleTableData(true)
|
|
177
177
|
this.checkSelectionStatus()
|
|
178
178
|
}
|
|
179
|
-
this.emitEvent('filter-change', { column, property, values, datas, filters: filterList, filterList }, evnt)
|
|
179
|
+
this.emitEvent('filter-change', { column, field, property: field, values, datas, filters: filterList, filterList }, evnt)
|
|
180
180
|
this.closeFilter()
|
|
181
181
|
this.updateFooter().then(() => {
|
|
182
182
|
const { scrollXLoad, scrollYLoad } = this
|
|
@@ -16,15 +16,22 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
render (h) {
|
|
18
18
|
const { $parent: $xetable, filterStore } = this
|
|
19
|
-
const { column } = filterStore
|
|
19
|
+
const { args, column } = filterStore
|
|
20
20
|
const filterRender = column ? column.filterRender : null
|
|
21
21
|
const compConf = filterRender ? VXETable.renderer.get(filterRender.name) : null
|
|
22
|
+
const filterClassName = compConf ? compConf.filterClassName : ''
|
|
22
23
|
return h('div', {
|
|
23
|
-
class: [
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
|
|
24
|
+
class: [
|
|
25
|
+
'vxe-table--filter-wrapper',
|
|
26
|
+
'filter--prevent-default',
|
|
27
|
+
compConf && compConf.className ? compConf.className : '',
|
|
28
|
+
UtilTools.getClass(filterClassName, Object.assign({ $panel: this, $table: $xetable }, args)),
|
|
29
|
+
{
|
|
30
|
+
'is--animat': $xetable.animat,
|
|
31
|
+
'is--multiple': filterStore.multiple,
|
|
32
|
+
'is--active': filterStore.visible
|
|
33
|
+
}
|
|
34
|
+
],
|
|
28
35
|
style: filterStore.style
|
|
29
36
|
}, filterStore.visible ? this.renderOptions(h, filterRender, compConf).concat(this.renderFooter(h)) : [])
|
|
30
37
|
},
|
|
@@ -30,6 +30,7 @@ const VxeFormConfigItem = {
|
|
|
30
30
|
const { rules, data, collapseAll, validOpts, titleAlign: allTitleAlign, titleWidth: allTitleWidth, titleColon: allTitleColon, titleAsterisk: allTitleAsterisk, titleOverflow: allTitleOverflow } = $xeform
|
|
31
31
|
const { slots, title, folding, visible, visibleMethod, field, collapseNode, itemRender, showError, errRule, className, titleOverflow, children } = item
|
|
32
32
|
const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
|
|
33
|
+
const itemClassName = compConf ? compConf.itemClassName : ''
|
|
33
34
|
const span = item.span || $xeform.span
|
|
34
35
|
const align = item.align || $xeform.align
|
|
35
36
|
const titleAlign = XEUtils.eqNull(item.titleAlign) ? allTitleAlign : item.titleAlign
|
|
@@ -88,15 +89,22 @@ const VxeFormConfigItem = {
|
|
|
88
89
|
mouseleave: $xeform.handleTitleTipLeaveEvent
|
|
89
90
|
} : {}
|
|
90
91
|
return h('div', {
|
|
91
|
-
class: [
|
|
92
|
-
'
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
'
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
class: [
|
|
93
|
+
'vxe-form--item',
|
|
94
|
+
item.id,
|
|
95
|
+
span ? `vxe-col--${span} is--span` : null,
|
|
96
|
+
className ? (XEUtils.isFunction(className) ? className(params) : className) : '',
|
|
97
|
+
itemClassName ? (XEUtils.isFunction(itemClassName) ? itemClassName(params) : className) : '',
|
|
98
|
+
{
|
|
99
|
+
'is--title': title,
|
|
100
|
+
'is--colon': titleColon,
|
|
101
|
+
'is--asterisk': titleAsterisk,
|
|
102
|
+
'is--required': isRequired,
|
|
103
|
+
'is--hidden': folding && collapseAll,
|
|
104
|
+
'is--active': !itemVisibleMethod || itemVisibleMethod(params),
|
|
105
|
+
'is--error': showError
|
|
106
|
+
}
|
|
107
|
+
],
|
|
100
108
|
props: {
|
|
101
109
|
itemConfig: item
|
|
102
110
|
},
|
|
@@ -44,6 +44,7 @@ const renderItem = (h, _vm, item, slots) => {
|
|
|
44
44
|
const { rules, data, collapseAll, validOpts, titleOverflow: allTitleOverflow } = _vm
|
|
45
45
|
const { title, folding, visible, visibleMethod, field, collapseNode, itemRender, showError, errRule, className, titleOverflow } = item
|
|
46
46
|
const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
|
|
47
|
+
const itemClassName = compConf ? compConf.itemClassName : ''
|
|
47
48
|
const span = item.span || _vm.span
|
|
48
49
|
const align = item.align || _vm.align
|
|
49
50
|
const titleAlign = item.titleAlign || _vm.titleAlign
|
|
@@ -54,7 +55,7 @@ const renderItem = (h, _vm, item, slots) => {
|
|
|
54
55
|
const showTitle = itemOverflow === 'title'
|
|
55
56
|
const showTooltip = itemOverflow === true || itemOverflow === 'tooltip'
|
|
56
57
|
const hasEllipsis = showTitle || showTooltip || showEllipsis
|
|
57
|
-
const params = { data, property: field, item, $form: _vm }
|
|
58
|
+
const params = { data, field, property: field, item, $form: _vm }
|
|
58
59
|
let isRequired
|
|
59
60
|
if (!itemVisibleMethod && compConf && compConf.itemVisibleMethod) {
|
|
60
61
|
itemVisibleMethod = compConf.itemVisibleMethod
|
|
@@ -82,13 +83,20 @@ const renderItem = (h, _vm, item, slots) => {
|
|
|
82
83
|
mouseleave: _vm.handleTitleTipLeaveEvent
|
|
83
84
|
} : {}
|
|
84
85
|
return h('div', {
|
|
85
|
-
class: [
|
|
86
|
-
'
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
'
|
|
91
|
-
|
|
86
|
+
class: [
|
|
87
|
+
'vxe-form--item',
|
|
88
|
+
item.id,
|
|
89
|
+
span ? `vxe-col--${span} is--span` : '',
|
|
90
|
+
className ? (XEUtils.isFunction(className) ? className(params) : className) : '',
|
|
91
|
+
itemClassName ? (XEUtils.isFunction(itemClassName) ? itemClassName(params) : itemClassName) : '',
|
|
92
|
+
{
|
|
93
|
+
'is--title': title,
|
|
94
|
+
'is--required': isRequired,
|
|
95
|
+
'is--hidden': visible === false || (folding && collapseAll),
|
|
96
|
+
'is--active': !itemVisibleMethod || itemVisibleMethod(params),
|
|
97
|
+
'is--error': showError
|
|
98
|
+
}
|
|
99
|
+
]
|
|
92
100
|
}, [
|
|
93
101
|
h('div', {
|
|
94
102
|
class: 'vxe-form--item-inner'
|
|
@@ -7,6 +7,7 @@ import DomTools, { browse } from '../../tools/dom'
|
|
|
7
7
|
import { createItem, handleFieldOrItem } from './util'
|
|
8
8
|
import { errLog } from '../../tools/log'
|
|
9
9
|
import VxeFormConfigItem from './form-config-item'
|
|
10
|
+
import VxeLoading from '../../loading/index'
|
|
10
11
|
|
|
11
12
|
class Rule {
|
|
12
13
|
constructor (rule) {
|
|
@@ -166,15 +167,15 @@ export default {
|
|
|
166
167
|
class: 'vxe-form-slots',
|
|
167
168
|
ref: 'hideItem'
|
|
168
169
|
}, customLayout ? [] : (defaultSlot ? defaultSlot.call(this, h, {}) : [])),
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
170
|
+
/**
|
|
171
|
+
* 加载中
|
|
172
|
+
*/
|
|
173
|
+
h(VxeLoading, {
|
|
174
|
+
class: 'vxe-form--loading',
|
|
175
|
+
props: {
|
|
176
|
+
loading
|
|
177
|
+
}
|
|
178
|
+
}),
|
|
178
179
|
/**
|
|
179
180
|
* 工具提示
|
|
180
181
|
*/
|
|
@@ -26,7 +26,7 @@ export function renderTitle (h, _vm, item) {
|
|
|
26
26
|
const { data, tooltipOpts } = _vm
|
|
27
27
|
const { slots, field, itemRender, titlePrefix, titleSuffix } = item
|
|
28
28
|
const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
|
|
29
|
-
const params = { data, property: field, item, $form: _vm }
|
|
29
|
+
const params = { data, field, property: field, item, $form: _vm }
|
|
30
30
|
const contVNs = []
|
|
31
31
|
const titVNs = []
|
|
32
32
|
if (titlePrefix) {
|
|
@@ -173,7 +173,7 @@ export default {
|
|
|
173
173
|
tZindex: 0,
|
|
174
174
|
tablePage: {
|
|
175
175
|
total: 0,
|
|
176
|
-
pageSize: 10,
|
|
176
|
+
pageSize: GlobalConfig.pager.pageSize || 10,
|
|
177
177
|
currentPage: 1
|
|
178
178
|
}
|
|
179
179
|
}
|
|
@@ -226,7 +226,7 @@ export default {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
if (editConfig) {
|
|
229
|
-
tableProps.editConfig = Object.assign({}, editConfig, {
|
|
229
|
+
tableProps.editConfig = Object.assign({}, editConfig, { beforeEditMethod: this.handleBeforeEditMethod })
|
|
230
230
|
}
|
|
231
231
|
return tableProps
|
|
232
232
|
}
|
|
@@ -266,7 +266,7 @@ export default {
|
|
|
266
266
|
warnLog('vxe.error.errProp', [`grid.toolbar-config=${this.toolbarConfig}`, 'grid.toolbar-config={}'])
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
|
|
269
|
+
this.initPages()
|
|
270
270
|
GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent)
|
|
271
271
|
},
|
|
272
272
|
mounted () {
|
|
@@ -274,7 +274,6 @@ export default {
|
|
|
274
274
|
this.loadColumn(this.columns)
|
|
275
275
|
}
|
|
276
276
|
this.initToolbar()
|
|
277
|
-
this.initPages()
|
|
278
277
|
this.initProxy()
|
|
279
278
|
},
|
|
280
279
|
destroyed () {
|
|
@@ -400,10 +399,13 @@ export default {
|
|
|
400
399
|
clss.push(rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : '')
|
|
401
400
|
return clss
|
|
402
401
|
},
|
|
403
|
-
|
|
402
|
+
handleBeforeEditMethod (params) {
|
|
404
403
|
const { editConfig } = this
|
|
405
|
-
const
|
|
406
|
-
|
|
404
|
+
const beforeEditMethod = editConfig ? (editConfig.beforeEditMethod || editConfig.activeMethod) : null
|
|
405
|
+
if (this.pendingRecords.indexOf(params.row) === -1) {
|
|
406
|
+
return !beforeEditMethod || beforeEditMethod({ ...params, $grid: this })
|
|
407
|
+
}
|
|
408
|
+
return false
|
|
407
409
|
},
|
|
408
410
|
initToolbar () {
|
|
409
411
|
this.$nextTick(() => {
|
|
@@ -647,8 +647,10 @@ export default {
|
|
|
647
647
|
|
|
648
648
|
// date、week、month、year
|
|
649
649
|
dateConfig: Object,
|
|
650
|
-
|
|
651
|
-
|
|
650
|
+
startDate: { type: [String, Number, Date], default: () => GlobalConfig.input.startDate },
|
|
651
|
+
endDate: { type: [String, Number, Date], default: () => GlobalConfig.input.endDate },
|
|
652
|
+
minDate: [String, Number, Date],
|
|
653
|
+
maxDate: [String, Number, Date],
|
|
652
654
|
// 已废弃 startWeek,被 startDay 替换
|
|
653
655
|
startWeek: Number,
|
|
654
656
|
startDay: { type: [String, Number], default: () => GlobalConfig.input.startDay },
|
|
@@ -725,24 +727,24 @@ export default {
|
|
|
725
727
|
return this.clearable && (this.isPawdType || this.isNumType || this.isDatePickerType || this.type === 'text' || this.type === 'search')
|
|
726
728
|
},
|
|
727
729
|
isDisabledPrevDateBtn () {
|
|
728
|
-
const { selectMonth,
|
|
730
|
+
const { selectMonth, dateStartTime } = this
|
|
729
731
|
if (selectMonth) {
|
|
730
|
-
return selectMonth <=
|
|
732
|
+
return selectMonth <= dateStartTime
|
|
731
733
|
}
|
|
732
734
|
return false
|
|
733
735
|
},
|
|
734
736
|
isDisabledNextDateBtn () {
|
|
735
|
-
const { selectMonth,
|
|
737
|
+
const { selectMonth, dateEndTime } = this
|
|
736
738
|
if (selectMonth) {
|
|
737
|
-
return selectMonth >=
|
|
739
|
+
return selectMonth >= dateEndTime
|
|
738
740
|
}
|
|
739
741
|
return false
|
|
740
742
|
},
|
|
741
|
-
|
|
742
|
-
return this.
|
|
743
|
+
dateStartTime () {
|
|
744
|
+
return this.startDate ? XEUtils.toStringDate(this.startDate) : null
|
|
743
745
|
},
|
|
744
|
-
|
|
745
|
-
return this.
|
|
746
|
+
dateEndTime () {
|
|
747
|
+
return this.endDate ? XEUtils.toStringDate(this.endDate) : null
|
|
746
748
|
},
|
|
747
749
|
supportMultiples () {
|
|
748
750
|
return ['date', 'week', 'month', 'quarter', 'year'].includes(this.type)
|
|
@@ -948,9 +950,9 @@ export default {
|
|
|
948
950
|
const selMonth = selectMonth.getMonth()
|
|
949
951
|
const selDay = selectMonth.getDay()
|
|
950
952
|
const prevOffsetDate = -weekDatas.indexOf(selDay)
|
|
951
|
-
const
|
|
953
|
+
const startDayDate = new Date(XEUtils.getWhatDay(selectMonth, prevOffsetDate).getTime() + hmsTime)
|
|
952
954
|
for (let index = 0; index < 42; index++) {
|
|
953
|
-
const date = XEUtils.getWhatDay(
|
|
955
|
+
const date = XEUtils.getWhatDay(startDayDate, index)
|
|
954
956
|
const itemFullYear = date.getFullYear()
|
|
955
957
|
const itemMonth = date.getMonth()
|
|
956
958
|
const itemDate = date.getDate()
|
|
@@ -1652,7 +1654,9 @@ export default {
|
|
|
1652
1654
|
this.dateTimeChangeEvent(evnt)
|
|
1653
1655
|
},
|
|
1654
1656
|
dateConfirmEvent () {
|
|
1655
|
-
|
|
1657
|
+
if (this.isDateTimeType || this.multiple) {
|
|
1658
|
+
this.dateChange(this.dateValue || this.currentDate)
|
|
1659
|
+
}
|
|
1656
1660
|
this.hidePanel()
|
|
1657
1661
|
},
|
|
1658
1662
|
dateMinuteEvent (evnt, item) {
|
|
@@ -4,6 +4,7 @@ import vSize from '../../mixins/size'
|
|
|
4
4
|
import { createResizeEvent } from '../../tools/resize'
|
|
5
5
|
import { GlobalEvent } from '../../tools/event'
|
|
6
6
|
import { browse } from '../../tools/dom'
|
|
7
|
+
import VxeLoading from '../../loading/index'
|
|
7
8
|
|
|
8
9
|
export default {
|
|
9
10
|
name: 'VxeList',
|
|
@@ -113,15 +114,15 @@ export default {
|
|
|
113
114
|
}
|
|
114
115
|
}, $scopedSlots.default ? $scopedSlots.default.call(this, { items, $list: this }, h) : [])
|
|
115
116
|
]),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
117
|
+
/**
|
|
118
|
+
* 加载中
|
|
119
|
+
*/
|
|
120
|
+
h(VxeLoading, {
|
|
121
|
+
class: 'vxe-list--loading',
|
|
122
|
+
props: {
|
|
123
|
+
loading
|
|
124
|
+
}
|
|
125
|
+
})
|
|
125
126
|
])
|
|
126
127
|
},
|
|
127
128
|
methods: {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'VxeLoading',
|
|
5
|
+
props: {
|
|
6
|
+
loading: Boolean
|
|
7
|
+
},
|
|
8
|
+
render (h) {
|
|
9
|
+
const icon = GlobalConfig.icon.LOADING
|
|
10
|
+
const loadingText = GlobalConfig.loadingText
|
|
11
|
+
const text = loadingText === null ? loadingText : GlobalConfig.i18n('vxe.loading.text')
|
|
12
|
+
return h('div', {
|
|
13
|
+
class: ['vxe-loading', {
|
|
14
|
+
'is--visible': this.loading
|
|
15
|
+
}]
|
|
16
|
+
}, [
|
|
17
|
+
h('div', {
|
|
18
|
+
class: 'vxe-loading--chunk'
|
|
19
|
+
}, [
|
|
20
|
+
icon ? h('i', {
|
|
21
|
+
class: icon
|
|
22
|
+
}) : h('div', {
|
|
23
|
+
class: 'vxe-loading--spinner'
|
|
24
|
+
}),
|
|
25
|
+
text ? h('div', {
|
|
26
|
+
class: 'vxe-loading--text'
|
|
27
|
+
}, `${text}`) : null
|
|
28
|
+
])
|
|
29
|
+
])
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
vxe: {
|
|
3
|
+
loading: {
|
|
4
|
+
text: 'Loading'
|
|
5
|
+
},
|
|
3
6
|
error: {
|
|
4
7
|
groupFixed: 'If you use group headers, the fixed columns must be set by group.',
|
|
5
8
|
groupMouseRange: 'Grouping headers and "{0}" cannot be used at the same time, which may cause errors.',
|
|
@@ -146,6 +149,8 @@ export default {
|
|
|
146
149
|
operError: 'Error occurred, operation failed!'
|
|
147
150
|
},
|
|
148
151
|
select: {
|
|
152
|
+
search: 'Search',
|
|
153
|
+
loadingText: 'Loading',
|
|
149
154
|
emptyText: 'No Data'
|
|
150
155
|
},
|
|
151
156
|
pager: {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
vxe: {
|
|
3
|
+
loading: {
|
|
4
|
+
text: 'Loading'
|
|
5
|
+
},
|
|
3
6
|
error: {
|
|
4
7
|
groupFixed: 'グループのヘッダを使用すると、固定列はグループで設定しなければなりません',
|
|
5
8
|
groupMouseRange: 'グループ化ヘッダーと「{0}」は同時に使用できません。これによりエラーが発生する可能性があります',
|
|
@@ -146,6 +149,8 @@ export default {
|
|
|
146
149
|
operError: 'エラーが発生しました。操作が失敗しました'
|
|
147
150
|
},
|
|
148
151
|
select: {
|
|
152
|
+
search: 'Search',
|
|
153
|
+
loadingText: 'Loading',
|
|
149
154
|
emptyText: 'データがありません'
|
|
150
155
|
},
|
|
151
156
|
pager: {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
vxe: {
|
|
3
|
+
loading: {
|
|
4
|
+
text: '加载中'
|
|
5
|
+
},
|
|
3
6
|
error: {
|
|
4
7
|
groupFixed: '如果使用分组表头,固定列必须按组设置',
|
|
5
8
|
groupMouseRange: '分组表头与 "{0}" 不能同时使用,这可能会出现错误',
|
|
@@ -146,6 +149,8 @@ export default {
|
|
|
146
149
|
operError: '发生错误,操作失败!'
|
|
147
150
|
},
|
|
148
151
|
select: {
|
|
152
|
+
search: '搜索',
|
|
153
|
+
loadingText: '加载中',
|
|
149
154
|
emptyText: '暂无数据'
|
|
150
155
|
},
|
|
151
156
|
pager: {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
vxe: {
|
|
3
|
+
loading: {
|
|
4
|
+
text: '加載中'
|
|
5
|
+
},
|
|
3
6
|
error: {
|
|
4
7
|
groupFixed: '如果使用分組表頭,固定列必須按組設定',
|
|
5
8
|
groupMouseRange: '分组表頭與 "{0}" 不能同時使用,這可能會出現錯誤',
|
|
@@ -146,6 +149,8 @@ export default {
|
|
|
146
149
|
operError: '發生錯誤,操作失敗!'
|
|
147
150
|
},
|
|
148
151
|
select: {
|
|
152
|
+
search: '蒐索',
|
|
153
|
+
loadingText: '加載中',
|
|
149
154
|
emptyText: '暫無資料'
|
|
150
155
|
},
|
|
151
156
|
pager: {
|