vxe-table 4.1.0 → 4.1.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/README.md +1 -0
- package/README.zh-TW.md +1 -0
- package/es/edit/src/hook.js +2 -2
- package/es/export/src/hook.js +24 -0
- package/es/export/src/util.js +20 -8
- package/es/footer/src/footer.js +4 -4
- package/es/form/src/form.js +13 -6
- package/es/form/src/render.js +4 -4
- package/es/grid/src/grid.js +48 -1
- package/es/header/src/header.js +7 -5
- package/es/select/src/select.js +5 -5
- package/es/table/src/body.js +18 -14
- package/es/table/src/cell.js +70 -54
- package/es/table/src/props.js +4 -1
- package/es/table/src/table.js +208 -97
- package/es/v-x-e-table/src/conf.js +2 -3
- package/es/validator/src/hook.js +12 -5
- package/helper/vetur/attributes.json +16 -8
- package/helper/vetur/tags.json +2 -0
- package/lib/edit/src/hook.js +2 -2
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/export/src/hook.js +28 -0
- package/lib/export/src/hook.min.js +1 -1
- package/lib/export/src/util.js +21 -7
- package/lib/export/src/util.min.js +1 -1
- package/lib/footer/src/footer.js +4 -4
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/src/form.js +23 -6
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +4 -4
- package/lib/form/src/render.min.js +1 -1
- package/lib/grid/src/grid.js +56 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +7 -5
- package/lib/header/src/header.min.js +1 -1
- package/lib/index.umd.js +536 -220
- package/lib/index.umd.min.js +1 -1
- package/lib/select/src/select.js +5 -5
- package/lib/table/src/body.js +18 -14
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +92 -35
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/props.js +4 -1
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +265 -133
- package/lib/table/src/table.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +2 -3
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/validator/src/hook.js +12 -5
- package/lib/validator/src/hook.min.js +1 -1
- package/package.json +2 -2
- package/packages/edit/src/hook.ts +2 -2
- package/packages/export/src/hook.ts +24 -0
- package/packages/export/src/util.ts +17 -5
- package/packages/footer/src/footer.ts +4 -4
- package/packages/form/src/form.ts +10 -6
- package/packages/form/src/render.ts +4 -4
- package/packages/grid/src/grid.ts +48 -1
- package/packages/header/src/header.ts +7 -5
- package/packages/select/src/select.ts +5 -5
- package/packages/table/src/body.ts +18 -14
- package/packages/table/src/cell.ts +77 -44
- package/packages/table/src/props.ts +4 -1
- package/packages/table/src/table.ts +211 -96
- package/packages/v-x-e-table/src/conf.ts +2 -3
- package/packages/validator/src/hook.ts +9 -5
- package/types/column.d.ts +5 -1
- package/types/form-item.d.ts +5 -1
- package/types/form.d.ts +5 -1
- package/types/modal.d.ts +4 -5
- package/types/table.d.ts +49 -14
- package/types/validator.d.ts +5 -1
|
@@ -130,7 +130,7 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
130
130
|
editStore.insertList.unshift(...newRecords)
|
|
131
131
|
reactData.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length
|
|
132
132
|
$xetable.updateFooter()
|
|
133
|
-
$xetable.
|
|
133
|
+
$xetable.cacheRowMap()
|
|
134
134
|
$xetable.handleTableData()
|
|
135
135
|
$xetable.updateAfterDataIndex()
|
|
136
136
|
$xetable.checkSelectionStatus()
|
|
@@ -223,7 +223,7 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
223
223
|
})
|
|
224
224
|
reactData.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length
|
|
225
225
|
$xetable.updateFooter()
|
|
226
|
-
$xetable.
|
|
226
|
+
$xetable.cacheRowMap()
|
|
227
227
|
$xetable.handleTableData()
|
|
228
228
|
$xetable.updateAfterDataIndex()
|
|
229
229
|
$xetable.checkSelectionStatus()
|
|
@@ -728,6 +728,12 @@ const tableExportHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
728
728
|
}
|
|
729
729
|
saveLocalFile({ filename, type, content }).then(() => {
|
|
730
730
|
if (opts.message !== false) {
|
|
731
|
+
// 检测弹窗模块
|
|
732
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
733
|
+
if (!VXETable.modal) {
|
|
734
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
735
|
+
}
|
|
736
|
+
}
|
|
731
737
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.table.expSuccess'), status: 'success' })
|
|
732
738
|
}
|
|
733
739
|
})
|
|
@@ -799,6 +805,12 @@ const tableExportHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
799
805
|
loadRest = $xetable.reloadData(data)
|
|
800
806
|
}
|
|
801
807
|
if (opts.message !== false) {
|
|
808
|
+
// 检测弹窗模块
|
|
809
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
810
|
+
if (!VXETable.modal) {
|
|
811
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
812
|
+
}
|
|
813
|
+
}
|
|
802
814
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.table.impSuccess', [rows.length]), status: 'success' })
|
|
803
815
|
}
|
|
804
816
|
return loadRest.then(() => {
|
|
@@ -808,6 +820,12 @@ const tableExportHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
808
820
|
})
|
|
809
821
|
})
|
|
810
822
|
} else if (opts.message !== false) {
|
|
823
|
+
// 检测弹窗模块
|
|
824
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
825
|
+
if (!VXETable.modal) {
|
|
826
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
827
|
+
}
|
|
828
|
+
}
|
|
811
829
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.error.impFields'), status: 'error' })
|
|
812
830
|
if (_importReject) {
|
|
813
831
|
_importReject({ status: false })
|
|
@@ -822,6 +840,12 @@ const tableExportHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
822
840
|
// 检查类型,如果为自定义导出,则不需要校验类型
|
|
823
841
|
if (!importMethod && !XEUtils.includes(VXETable.config.importTypes, type)) {
|
|
824
842
|
if (opts.message !== false) {
|
|
843
|
+
// 检测弹窗模块
|
|
844
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
845
|
+
if (!VXETable.modal) {
|
|
846
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
847
|
+
}
|
|
848
|
+
}
|
|
825
849
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.error.notType', [type]), status: 'error' })
|
|
826
850
|
}
|
|
827
851
|
const params = { status: false }
|
|
@@ -2,7 +2,7 @@ import XEUtils from 'xe-utils'
|
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import { VXETable } from '../../v-x-e-table'
|
|
4
4
|
import { browse } from '../../tools/dom'
|
|
5
|
-
import { getLog, parseFile } from '../../tools/utils'
|
|
5
|
+
import { getLog, parseFile, errLog } from '../../tools/utils'
|
|
6
6
|
|
|
7
7
|
import { VxeTablePropTypes, SaveFileFunction, ReadFileFunction, VxeTableConstructor } from '../../../types/all'
|
|
8
8
|
|
|
@@ -82,6 +82,12 @@ export const readLocalFile: ReadFileFunction = (options) => {
|
|
|
82
82
|
resolve({ status: true, files, file })
|
|
83
83
|
} else {
|
|
84
84
|
if (opts.message !== false) {
|
|
85
|
+
// 检测弹窗模块
|
|
86
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
87
|
+
if (!VXETable.modal) {
|
|
88
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
89
|
+
}
|
|
90
|
+
}
|
|
85
91
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.error.notType', [errType]), status: 'error' })
|
|
86
92
|
}
|
|
87
93
|
const params = { status: false, files, file }
|
|
@@ -152,16 +158,22 @@ export const saveLocalFile: SaveFileFunction = (options) => {
|
|
|
152
158
|
const name = `${filename}.${type}`
|
|
153
159
|
if (window.Blob) {
|
|
154
160
|
const blob = content instanceof Blob ? content : getExportBlobByContent(XEUtils.toValueString(content), options)
|
|
155
|
-
if (navigator.msSaveBlob) {
|
|
156
|
-
navigator.msSaveBlob(blob, name)
|
|
161
|
+
if ((navigator as any).msSaveBlob) {
|
|
162
|
+
(navigator as any).msSaveBlob(blob, name)
|
|
157
163
|
} else {
|
|
164
|
+
const url = URL.createObjectURL(blob)
|
|
158
165
|
const linkElem = document.createElement('a')
|
|
159
166
|
linkElem.target = '_blank'
|
|
160
167
|
linkElem.download = name
|
|
161
|
-
linkElem.href =
|
|
168
|
+
linkElem.href = url
|
|
162
169
|
document.body.appendChild(linkElem)
|
|
163
170
|
linkElem.click()
|
|
164
|
-
|
|
171
|
+
requestAnimationFrame(() => {
|
|
172
|
+
if (linkElem.parentNode) {
|
|
173
|
+
linkElem.parentNode.removeChild(linkElem)
|
|
174
|
+
}
|
|
175
|
+
URL.revokeObjectURL(url)
|
|
176
|
+
})
|
|
165
177
|
}
|
|
166
178
|
return Promise.resolve()
|
|
167
179
|
}
|
|
@@ -91,11 +91,11 @@ export default defineComponent({
|
|
|
91
91
|
let { fixedType, fixedColumn, tableColumn, footerTableData } = props
|
|
92
92
|
const { footerRowClassName, footerCellClassName, footerRowStyle, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
93
93
|
const { visibleColumn } = tableInternalData
|
|
94
|
-
const {
|
|
94
|
+
const { scrollYLoad, overflowX, scrollbarWidth, currentColumn, mergeFooterList } = tableReactData
|
|
95
95
|
const tooltipOpts = computeTooltipOpts.value
|
|
96
96
|
// 如果是使用优化模式
|
|
97
97
|
if (fixedType) {
|
|
98
|
-
if (
|
|
98
|
+
if (scrollYLoad || allColumnFooterOverflow) {
|
|
99
99
|
if (!mergeFooterList.length || !footerSpanMethod) {
|
|
100
100
|
tableColumn = fixedColumn
|
|
101
101
|
} else {
|
|
@@ -165,8 +165,8 @@ export default defineComponent({
|
|
|
165
165
|
const _columnIndex = $xetable.getVTColumnIndex(column)
|
|
166
166
|
const itemIndex = _columnIndex
|
|
167
167
|
const params: VxeTableDefines.CellRenderFooterParams = { $table: $xetable, _rowIndex, $rowIndex, column, columnIndex, $columnIndex, _columnIndex, itemIndex, items: list, fixed: fixedType, type: renderType, data: footerTableData }
|
|
168
|
-
//
|
|
169
|
-
if (
|
|
168
|
+
// 纵向虚拟滚动不支持动态行高
|
|
169
|
+
if (scrollYLoad && !hasEllipsis) {
|
|
170
170
|
showEllipsis = hasEllipsis = true
|
|
171
171
|
}
|
|
172
172
|
if (showTitle || showTooltip || showAllTip) {
|
|
@@ -25,8 +25,12 @@ class Rule {
|
|
|
25
25
|
})
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
get content () {
|
|
29
|
+
return getFuncText(this.$options.content || this.$options.message)
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
get message () {
|
|
29
|
-
return
|
|
33
|
+
return this.content
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
[key: string]: any
|
|
@@ -69,10 +73,10 @@ export default defineComponent({
|
|
|
69
73
|
loading: Boolean as PropType<VxeFormPropTypes.Loading>,
|
|
70
74
|
data: Object as PropType<VxeFormPropTypes.Data>,
|
|
71
75
|
size: { type: String as PropType<VxeFormPropTypes.Size>, default: () => GlobalConfig.form.size || GlobalConfig.size },
|
|
72
|
-
span: [String, Number] as PropType<VxeFormPropTypes.Span>,
|
|
76
|
+
span: { type: [String, Number] as PropType<VxeFormPropTypes.Span>, default: () => GlobalConfig.form.span },
|
|
73
77
|
align: { type: String as PropType<VxeFormPropTypes.Align>, default: () => GlobalConfig.form.align },
|
|
74
78
|
titleAlign: { type: String as PropType<VxeFormPropTypes.TitleAlign>, default: () => GlobalConfig.form.titleAlign },
|
|
75
|
-
titleWidth: [String, Number] as PropType<VxeFormPropTypes.TitleWidth>,
|
|
79
|
+
titleWidth: { type: [String, Number] as PropType<VxeFormPropTypes.TitleWidth>, default: () => GlobalConfig.form.titleWidth },
|
|
76
80
|
titleColon: { type: Boolean as PropType<VxeFormPropTypes.TitleColon>, default: () => GlobalConfig.form.titleColon },
|
|
77
81
|
titleAsterisk: { type: Boolean as PropType<VxeFormPropTypes.TitleAsterisk>, default: () => GlobalConfig.form.titleAsterisk },
|
|
78
82
|
titleOverflow: { type: [Boolean, String] as PropType<VxeFormPropTypes.TitleOverflow>, default: null },
|
|
@@ -327,12 +331,12 @@ export default defineComponent({
|
|
|
327
331
|
})
|
|
328
332
|
if (customValid) {
|
|
329
333
|
if (XEUtils.isError(customValid)) {
|
|
330
|
-
errorRules.push(new Rule({ type: 'custom', trigger,
|
|
334
|
+
errorRules.push(new Rule({ type: 'custom', trigger, content: customValid.message, rule: new Rule(rule) }))
|
|
331
335
|
} else if (customValid.catch) {
|
|
332
336
|
// 如果为异步校验(注:异步校验是并发无序的)
|
|
333
337
|
syncVailds.push(
|
|
334
338
|
customValid.catch((e: any) => {
|
|
335
|
-
errorRules.push(new Rule({ type: 'custom', trigger,
|
|
339
|
+
errorRules.push(new Rule({ type: 'custom', trigger, content: e ? e.message : (rule.content || rule.message), rule: new Rule(rule) }))
|
|
336
340
|
})
|
|
337
341
|
)
|
|
338
342
|
}
|
|
@@ -585,7 +589,7 @@ export default defineComponent({
|
|
|
585
589
|
style: errRule.maxWidth ? {
|
|
586
590
|
width: `${errRule.maxWidth}px`
|
|
587
591
|
} : null
|
|
588
|
-
}, errRule.
|
|
592
|
+
}, errRule.content)
|
|
589
593
|
)
|
|
590
594
|
}
|
|
591
595
|
const ons = showTooltip ? {
|
|
@@ -35,9 +35,9 @@ export function renderTitle ($xeform: VxeFormConstructor & VxeFormPrivateMethods
|
|
|
35
35
|
const titVNs = []
|
|
36
36
|
if (titlePrefix) {
|
|
37
37
|
titVNs.push(
|
|
38
|
-
titlePrefix.message
|
|
38
|
+
(titlePrefix.content || titlePrefix.message)
|
|
39
39
|
? h(resolveComponent('vxe-tooltip') as ComponentOptions, {
|
|
40
|
-
content: getFuncText(titlePrefix.message),
|
|
40
|
+
content: getFuncText(titlePrefix.content || titlePrefix.message),
|
|
41
41
|
enterable: titlePrefix.enterable,
|
|
42
42
|
theme: titlePrefix.theme
|
|
43
43
|
}, {
|
|
@@ -59,9 +59,9 @@ export function renderTitle ($xeform: VxeFormConstructor & VxeFormPrivateMethods
|
|
|
59
59
|
const fixVNs = []
|
|
60
60
|
if (titleSuffix) {
|
|
61
61
|
fixVNs.push(
|
|
62
|
-
titleSuffix.message
|
|
62
|
+
(titleSuffix.content || titleSuffix.message)
|
|
63
63
|
? h(resolveComponent('vxe-tooltip') as ComponentOptions, {
|
|
64
|
-
content: getFuncText(titleSuffix.message),
|
|
64
|
+
content: getFuncText(titleSuffix.content || titleSuffix.message),
|
|
65
65
|
enterable: titleSuffix.enterable,
|
|
66
66
|
theme: titleSuffix.theme
|
|
67
67
|
}, {
|
|
@@ -13,7 +13,7 @@ import { TableMethods, VxeGridConstructor, VxeGridEmits, GridReactData, VxeGridP
|
|
|
13
13
|
|
|
14
14
|
const tableComponentPropKeys = Object.keys(tableComponentProps as any)
|
|
15
15
|
|
|
16
|
-
const tableComponentMethodKeys: (keyof TableMethods)[] = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getData', 'getCheckboxRecords', 'getRowById', 'getRowid', 'getTableData', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'isCheckedByCheckboxRow', 'isIndeterminateByCheckboxRow', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'setRadioRow', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'sort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isRowExpandLoaded', 'clearRowExpandLoaded', '
|
|
16
|
+
const tableComponentMethodKeys: (keyof TableMethods)[] = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getData', 'getCheckboxRecords', 'getRowById', 'getRowid', 'getTableData', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'isCheckedByCheckboxRow', 'isIndeterminateByCheckboxRow', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'setRadioRow', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'sort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'focus', 'blur', 'connect']
|
|
17
17
|
|
|
18
18
|
const gridComponentEmits: VxeGridEmits = [
|
|
19
19
|
...tableComponentEmits,
|
|
@@ -259,6 +259,12 @@ export default defineComponent({
|
|
|
259
259
|
gridExtendTableMethods.clearCheckboxRow()
|
|
260
260
|
} else {
|
|
261
261
|
if (isMsg) {
|
|
262
|
+
// 检测弹窗模块
|
|
263
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
264
|
+
if (!VXETable.modal) {
|
|
265
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
266
|
+
}
|
|
267
|
+
}
|
|
262
268
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
263
269
|
}
|
|
264
270
|
}
|
|
@@ -285,6 +291,12 @@ export default defineComponent({
|
|
|
285
291
|
}
|
|
286
292
|
})
|
|
287
293
|
} else {
|
|
294
|
+
// 检测弹窗模块
|
|
295
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
296
|
+
if (!VXETable.modal) {
|
|
297
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
298
|
+
}
|
|
299
|
+
}
|
|
288
300
|
VXETable.modal.message({ id: `msg_${code}`, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
289
301
|
}
|
|
290
302
|
} else {
|
|
@@ -800,6 +812,12 @@ export default defineComponent({
|
|
|
800
812
|
reactData.tableLoading = false
|
|
801
813
|
reactData.pendingRecords = reactData.pendingRecords.filter((row) => $xetable.findRowIndexOf(removeRecords, row) === -1)
|
|
802
814
|
if (isMsg) {
|
|
815
|
+
// 检测弹窗模块
|
|
816
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
817
|
+
if (!VXETable.modal) {
|
|
818
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
819
|
+
}
|
|
820
|
+
}
|
|
803
821
|
VXETable.modal.message({ content: getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' })
|
|
804
822
|
}
|
|
805
823
|
if (afterDelete) {
|
|
@@ -811,12 +829,23 @@ export default defineComponent({
|
|
|
811
829
|
.catch(rest => {
|
|
812
830
|
reactData.tableLoading = false
|
|
813
831
|
if (isMsg) {
|
|
832
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
833
|
+
if (!VXETable.modal.message) {
|
|
834
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
835
|
+
}
|
|
836
|
+
}
|
|
814
837
|
VXETable.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
815
838
|
}
|
|
816
839
|
})
|
|
817
840
|
})
|
|
818
841
|
} else {
|
|
819
842
|
if (isMsg) {
|
|
843
|
+
// 检测弹窗模块
|
|
844
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
845
|
+
if (!VXETable.modal) {
|
|
846
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
847
|
+
}
|
|
848
|
+
}
|
|
820
849
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
821
850
|
}
|
|
822
851
|
}
|
|
@@ -850,6 +879,12 @@ export default defineComponent({
|
|
|
850
879
|
reactData.tableLoading = false
|
|
851
880
|
reactData.pendingRecords = []
|
|
852
881
|
if (isMsg) {
|
|
882
|
+
// 检测弹窗模块
|
|
883
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
884
|
+
if (!VXETable.modal) {
|
|
885
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
886
|
+
}
|
|
887
|
+
}
|
|
853
888
|
VXETable.modal.message({ content: getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' })
|
|
854
889
|
}
|
|
855
890
|
if (afterSave) {
|
|
@@ -861,11 +896,23 @@ export default defineComponent({
|
|
|
861
896
|
.catch(rest => {
|
|
862
897
|
reactData.tableLoading = false
|
|
863
898
|
if (isMsg) {
|
|
899
|
+
// 检测弹窗模块
|
|
900
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
901
|
+
if (!VXETable.modal) {
|
|
902
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
903
|
+
}
|
|
904
|
+
}
|
|
864
905
|
VXETable.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
865
906
|
}
|
|
866
907
|
})
|
|
867
908
|
} else {
|
|
868
909
|
if (isMsg) {
|
|
910
|
+
// 检测弹窗模块
|
|
911
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
912
|
+
if (!VXETable.modal) {
|
|
913
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
914
|
+
}
|
|
915
|
+
}
|
|
869
916
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.dataUnchanged'), status: 'info' })
|
|
870
917
|
}
|
|
871
918
|
}
|
|
@@ -22,6 +22,7 @@ export default defineComponent({
|
|
|
22
22
|
|
|
23
23
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xetable
|
|
24
24
|
const { refElem: tableRefElem, refTableBody, refLeftContainer, refRightContainer, refCellResizeBar } = $xetable.getRefMaps()
|
|
25
|
+
const { computeColumnOpts } = $xetable.getComputeMaps()
|
|
25
26
|
|
|
26
27
|
const headerColumn = ref([] as VxeTableDefines.ColumnInfo[][])
|
|
27
28
|
|
|
@@ -146,12 +147,13 @@ export default defineComponent({
|
|
|
146
147
|
const renderVN = () => {
|
|
147
148
|
let { fixedType, fixedColumn, tableColumn } = props
|
|
148
149
|
const { resizable, border, columnKey, headerRowClassName, headerCellClassName, headerRowStyle, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps
|
|
149
|
-
const { isGroup, currentColumn,
|
|
150
|
+
const { isGroup, currentColumn, scrollYLoad, overflowX, scrollbarWidth } = tableReactData
|
|
151
|
+
const columnOpts = computeColumnOpts.value
|
|
150
152
|
let headerGroups: VxeTableDefines.ColumnInfo[][] = headerColumn.value
|
|
151
153
|
// 如果是使用优化模式
|
|
152
154
|
if (!isGroup) {
|
|
153
155
|
if (fixedType) {
|
|
154
|
-
if (
|
|
156
|
+
if (scrollYLoad || allColumnHeaderOverflow) {
|
|
155
157
|
tableColumn = fixedColumn
|
|
156
158
|
}
|
|
157
159
|
}
|
|
@@ -216,8 +218,8 @@ export default defineComponent({
|
|
|
216
218
|
onClick: (evnt: MouseEvent) => $xetable.triggerHeaderCellClickEvent(evnt, params),
|
|
217
219
|
onDblclick: (evnt: MouseEvent) => $xetable.triggerHeaderCellDblclickEvent(evnt, params)
|
|
218
220
|
}
|
|
219
|
-
//
|
|
220
|
-
if (
|
|
221
|
+
// 纵向虚拟滚动不支持动态行高
|
|
222
|
+
if (scrollYLoad && !hasEllipsis) {
|
|
221
223
|
showEllipsis = hasEllipsis = true
|
|
222
224
|
}
|
|
223
225
|
// 按下事件处理
|
|
@@ -258,7 +260,7 @@ export default defineComponent({
|
|
|
258
260
|
/**
|
|
259
261
|
* 列宽拖动
|
|
260
262
|
*/
|
|
261
|
-
!fixedHiddenColumn && !isColGroup && (XEUtils.isBoolean(column.resizable) ? column.resizable : resizable) ? h('div', {
|
|
263
|
+
!fixedHiddenColumn && !isColGroup && (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || resizable)) ? h('div', {
|
|
262
264
|
class: ['vxe-resizable', {
|
|
263
265
|
'is--line': !border || border === 'none'
|
|
264
266
|
}],
|
|
@@ -198,7 +198,7 @@ export default defineComponent({
|
|
|
198
198
|
return nextTick()
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
const
|
|
201
|
+
const cacheItemMap = () => {
|
|
202
202
|
const { fullOptionList, fullGroupList } = reactData
|
|
203
203
|
const groupOptionsField = computeGroupOptionsField.value
|
|
204
204
|
const key = getOptkey()
|
|
@@ -706,19 +706,19 @@ export default defineComponent({
|
|
|
706
706
|
reactData.fullGroupList = []
|
|
707
707
|
reactData.fullOptionList = value || []
|
|
708
708
|
}
|
|
709
|
-
|
|
709
|
+
cacheItemMap()
|
|
710
710
|
})
|
|
711
711
|
|
|
712
712
|
watch(() => props.options, (value) => {
|
|
713
713
|
reactData.fullGroupList = []
|
|
714
714
|
reactData.fullOptionList = value || []
|
|
715
|
-
|
|
715
|
+
cacheItemMap()
|
|
716
716
|
})
|
|
717
717
|
|
|
718
718
|
watch(() => props.optionGroups, (value) => {
|
|
719
719
|
reactData.fullOptionList = []
|
|
720
720
|
reactData.fullGroupList = value || []
|
|
721
|
-
|
|
721
|
+
cacheItemMap()
|
|
722
722
|
})
|
|
723
723
|
|
|
724
724
|
onMounted(() => {
|
|
@@ -729,7 +729,7 @@ export default defineComponent({
|
|
|
729
729
|
} else if (options) {
|
|
730
730
|
reactData.fullOptionList = options
|
|
731
731
|
}
|
|
732
|
-
|
|
732
|
+
cacheItemMap()
|
|
733
733
|
})
|
|
734
734
|
GlobalEvent.on($xeselect, 'mousewheel', handleGlobalMousewheelEvent)
|
|
735
735
|
GlobalEvent.on($xeselect, 'mousedown', handleGlobalMousedownEvent)
|
|
@@ -31,7 +31,7 @@ export default defineComponent({
|
|
|
31
31
|
|
|
32
32
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xetable
|
|
33
33
|
const { refTableHeader, refTableBody, refTableFooter, refTableLeftBody, refTableRightBody, refValidTooltip } = $xetable.getRefMaps()
|
|
34
|
-
const { computeEditOpts, computeMouseOpts, computeSYOpts, computeEmptyOpts, computeKeyboardOpts, computeTooltipOpts, computeRadioOpts, computeTreeOpts, computeCheckboxOpts, computeValidOpts } = $xetable.getComputeMaps()
|
|
34
|
+
const { computeEditOpts, computeMouseOpts, computeSYOpts, computeEmptyOpts, computeKeyboardOpts, computeTooltipOpts, computeRadioOpts, computeTreeOpts, computeCheckboxOpts, computeValidOpts, computeRowOpts } = $xetable.getComputeMaps()
|
|
35
35
|
|
|
36
36
|
const refElem = ref() as Ref<XEBodyScrollElement>
|
|
37
37
|
const refBodyTable = ref() as Ref<HTMLTableElement>
|
|
@@ -110,16 +110,18 @@ export default defineComponent({
|
|
|
110
110
|
*/
|
|
111
111
|
const renderColumn = ($seq: string, seq: number, rowid: string, fixedType: any, rowLevel: number, row: any, rowIndex: number, $rowIndex: number, _rowIndex: number, column: any, $columnIndex: number, columns: any, items: any[]) => {
|
|
112
112
|
const { columnKey, height, showOverflow: allColumnOverflow, cellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig } = tableProps
|
|
113
|
-
const { tableData, overflowX,
|
|
113
|
+
const { tableData, overflowX, scrollYLoad, currentColumn, mergeList, editStore, validStore, isAllOverflow } = tableReactData
|
|
114
114
|
const { afterFullData } = tableInternalData
|
|
115
115
|
const validOpts = computeValidOpts.value
|
|
116
116
|
const checkboxOpts = computeCheckboxOpts.value
|
|
117
117
|
const editOpts = computeEditOpts.value
|
|
118
118
|
const tooltipOpts = computeTooltipOpts.value
|
|
119
|
+
const rowOpts = computeRowOpts.value
|
|
119
120
|
const sYOpts = computeSYOpts.value
|
|
120
121
|
const { type, cellRender, editRender, align, showOverflow, className, treeNode } = column
|
|
121
122
|
const { actived } = editStore
|
|
122
|
-
const { rHeight } = sYOpts
|
|
123
|
+
const { rHeight: scrollYRHeight } = sYOpts
|
|
124
|
+
const { height: rowHeight } = rowOpts
|
|
123
125
|
const showAllTip = tooltipOpts.showAll
|
|
124
126
|
const columnIndex = $xetable.getColumnIndex(column)
|
|
125
127
|
const _columnIndex = $xetable.getVTColumnIndex(column)
|
|
@@ -138,7 +140,7 @@ export default defineComponent({
|
|
|
138
140
|
const attrs: any = { colid: column.id }
|
|
139
141
|
const params: VxeTableDefines.CellRenderBodyParams = { $table: $xetable, $seq, seq, rowid, row, rowIndex, $rowIndex, _rowIndex, column, columnIndex, $columnIndex, _columnIndex, fixed: fixedType, type: renderType, isHidden: fixedHiddenColumn, level: rowLevel, visibleData: afterFullData, data: tableData, items }
|
|
140
142
|
// 虚拟滚动不支持动态高度
|
|
141
|
-
if (
|
|
143
|
+
if (scrollYLoad && !hasEllipsis) {
|
|
142
144
|
showEllipsis = hasEllipsis = true
|
|
143
145
|
}
|
|
144
146
|
// hover 进入事件
|
|
@@ -230,7 +232,7 @@ export default defineComponent({
|
|
|
230
232
|
'c--ellipsis': showEllipsis
|
|
231
233
|
}],
|
|
232
234
|
style: {
|
|
233
|
-
maxHeight: hasEllipsis &&
|
|
235
|
+
maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
|
234
236
|
}
|
|
235
237
|
})
|
|
236
238
|
)
|
|
@@ -245,7 +247,7 @@ export default defineComponent({
|
|
|
245
247
|
'c--ellipsis': showEllipsis
|
|
246
248
|
}],
|
|
247
249
|
style: {
|
|
248
|
-
maxHeight: hasEllipsis &&
|
|
250
|
+
maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
|
249
251
|
},
|
|
250
252
|
title: showTitle ? $xetable.getCellLabel(row, column) : null
|
|
251
253
|
}, column.renderCell(params))
|
|
@@ -283,16 +285,16 @@ export default defineComponent({
|
|
|
283
285
|
key: columnKey ? column.id : $columnIndex,
|
|
284
286
|
...attrs,
|
|
285
287
|
style: Object.assign({
|
|
286
|
-
height: hasEllipsis &&
|
|
288
|
+
height: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
|
287
289
|
}, cellStyle ? (XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle) : null),
|
|
288
290
|
...tdOns
|
|
289
291
|
}, tdVNs)
|
|
290
292
|
}
|
|
291
293
|
|
|
292
|
-
const renderRows = ($seq: string,
|
|
294
|
+
const renderRows = ($seq: string, fixedType: any, tableData: any, tableColumn: any) => {
|
|
293
295
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, showOverflow: allColumnOverflow, editConfig, treeConfig } = tableProps
|
|
294
296
|
const { hasFixedColumn, treeExpandeds, scrollYLoad, editStore, rowExpandeds, expandColumn, selectRow } = tableReactData
|
|
295
|
-
const { scrollYStore } = tableInternalData
|
|
297
|
+
const { fullAllDataRowIdData, scrollYStore } = tableInternalData
|
|
296
298
|
const checkboxOpts = computeCheckboxOpts.value
|
|
297
299
|
const radioOpts = computeRadioOpts.value
|
|
298
300
|
const treeOpts = computeTreeOpts.value
|
|
@@ -324,6 +326,8 @@ export default defineComponent({
|
|
|
324
326
|
}
|
|
325
327
|
}
|
|
326
328
|
const rowid = getRowid($xetable, row)
|
|
329
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
330
|
+
const rowLevel = rest ? rest.level : 0
|
|
327
331
|
const params = { $table: $xetable, $seq, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
328
332
|
let isNewRow = false
|
|
329
333
|
if (editConfig) {
|
|
@@ -382,10 +386,10 @@ export default defineComponent({
|
|
|
382
386
|
)
|
|
383
387
|
}
|
|
384
388
|
// 如果是树形表格
|
|
385
|
-
if (treeConfig && treeExpandeds.length) {
|
|
389
|
+
if (treeConfig && !scrollYLoad && treeExpandeds.length) {
|
|
386
390
|
const rowChildren = row[treeOpts.children]
|
|
387
391
|
if (rowChildren && rowChildren.length && $xetable.findRowIndexOf(treeExpandeds, row) > -1) {
|
|
388
|
-
rows.push(...renderRows($seq ? `${$seq}.${seq}` : `${seq}`,
|
|
392
|
+
rows.push(...renderRows($seq ? `${$seq}.${seq}` : `${seq}`, fixedType, rowChildren, tableColumn))
|
|
389
393
|
}
|
|
390
394
|
}
|
|
391
395
|
})
|
|
@@ -603,7 +607,7 @@ export default defineComponent({
|
|
|
603
607
|
const renderVN = () => {
|
|
604
608
|
let { fixedColumn, fixedType, tableColumn } = props
|
|
605
609
|
const { keyboardConfig, showOverflow: allColumnOverflow, spanMethod, mouseConfig } = tableProps
|
|
606
|
-
const { tableData, mergeList,
|
|
610
|
+
const { tableData, mergeList, scrollYLoad, isAllOverflow } = tableReactData
|
|
607
611
|
const { visibleColumn } = tableInternalData
|
|
608
612
|
const { slots } = tableContext
|
|
609
613
|
const sYOpts = computeSYOpts.value
|
|
@@ -614,7 +618,7 @@ export default defineComponent({
|
|
|
614
618
|
// const isMergeRightFixedExceeded = computeIsMergeRightFixedExceeded.value
|
|
615
619
|
// 如果是使用优化模式
|
|
616
620
|
if (fixedType) {
|
|
617
|
-
if (
|
|
621
|
+
if (scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
|
|
618
622
|
if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
|
|
619
623
|
tableColumn = fixedColumn
|
|
620
624
|
} else {
|
|
@@ -682,7 +686,7 @@ export default defineComponent({
|
|
|
682
686
|
*/
|
|
683
687
|
h('tbody', {
|
|
684
688
|
ref: refBodyTBody
|
|
685
|
-
}, renderRows('',
|
|
689
|
+
}, renderRows('', fixedType, tableData, tableColumn))
|
|
686
690
|
]),
|
|
687
691
|
h('div', {
|
|
688
692
|
class: 'vxe-table--checkbox-range'
|