releases 4.1.15
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
:tree-config="{children: 'childs'}"
|
||||
:data="demo1.tableData"
|
||||
@toggle-tree-expand="toggleExpandChangeEvent">
|
||||
<vxe-column type="seq" width="80"></vxe-column>
|
||||
<vxe-column field="name" title="app.body.label.name" tree-node></vxe-column>
|
||||
<vxe-column field="size" title="Size"></vxe-column>
|
||||
<vxe-column field="type" title="Type"></vxe-column>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vxe-table",
|
||||
"version": "4.1.14",
|
||||
"version": "4.1.15",
|
||||
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、贼灵活的配置项、扩展接口等...",
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
|
||||
@@ -658,7 +658,7 @@ export default defineComponent({
|
||||
* @param {String/Object} code 字符串或对象
|
||||
*/
|
||||
commitProxy (proxyTarget: string | VxeToolbarPropTypes.ButtonConfig, ...args: any[]) {
|
||||
const { toolbarConfig, pagerConfig } = props
|
||||
const { toolbarConfig, pagerConfig, editRules } = props
|
||||
const { tablePage, formData } = reactData
|
||||
const isMsg = computeIsMsg.value
|
||||
const proxyOpts = computeProxyOpts.value
|
||||
@@ -870,8 +870,12 @@ export default defineComponent({
|
||||
if (pendingRecords.length) {
|
||||
body.insertRecords = insertRecords.filter((row) => $xetable.findRowIndexOf(pendingRecords, row) === -1)
|
||||
}
|
||||
// 只校验新增和修改的数据
|
||||
return $xetable.validate(body.insertRecords.concat(updateRecords)).then((errMap) => {
|
||||
let restPromise: Promise<any> = Promise.resolve()
|
||||
if (editRules) {
|
||||
// 只校验新增和修改的数据
|
||||
restPromise = $xetable.validate(body.insertRecords.concat(updateRecords))
|
||||
}
|
||||
return restPromise.then((errMap) => {
|
||||
if (errMap) {
|
||||
// 如果校验不通过
|
||||
return
|
||||
|
||||
@@ -2148,6 +2148,20 @@ export default defineComponent({
|
||||
changeValue()
|
||||
})
|
||||
|
||||
watch(() => props.type, () => {
|
||||
// 切换类型是重置内置变量
|
||||
Object.assign(reactData, {
|
||||
inputValue: props.modelValue,
|
||||
datetimePanelValue: null,
|
||||
datePanelValue: null,
|
||||
datePanelLabel: '',
|
||||
datePanelType: 'day',
|
||||
selectMonth: null,
|
||||
currentDate: null
|
||||
})
|
||||
initValue()
|
||||
})
|
||||
|
||||
watch(computeDateLabelFormat, () => {
|
||||
dateParseValue(reactData.datePanelValue)
|
||||
reactData.inputValue = reactData.datePanelLabel
|
||||
|
||||
@@ -1308,6 +1308,15 @@ export default defineComponent({
|
||||
tableTree = tableData
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (treeConfig && transform) {
|
||||
// 还原虚拟树
|
||||
tableTree = XEUtils.searchTree(tableFullTreeData, () => true, { ...treeOpts, original: true })
|
||||
tableData = tableTree
|
||||
} else {
|
||||
tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0)
|
||||
tableTree = tableData
|
||||
}
|
||||
}
|
||||
internalData.afterFullData = tableData
|
||||
internalData.afterTreeFullData = tableTree
|
||||
@@ -4444,6 +4453,9 @@ export default defineComponent({
|
||||
* 内部方法
|
||||
*/
|
||||
tablePrivateMethods = {
|
||||
getSetupOptions () {
|
||||
return GlobalConfig
|
||||
},
|
||||
updateAfterDataIndex,
|
||||
callSlot (slotFunc, params) {
|
||||
if (slotFunc) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { nextTick } from 'vue'
|
||||
import GlobalConfig from '../../v-x-e-table/src/conf'
|
||||
import XEUtils from 'xe-utils'
|
||||
import { getFuncText, eqEmptyValue } from '../../tools/utils'
|
||||
import { scrollToView } from '../../tools/dom'
|
||||
@@ -156,14 +157,19 @@ const validatorHook: VxeGlobalHooksHandles.HookOptions = {
|
||||
}
|
||||
})
|
||||
}).catch(firstErrParams => {
|
||||
return new Promise<void>((resolve) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const finish = () => {
|
||||
nextTick(() => {
|
||||
if (cb) {
|
||||
cb(validRest)
|
||||
resolve()
|
||||
} else {
|
||||
resolve(validRest)
|
||||
if (GlobalConfig.validToReject === 'obsolete') {
|
||||
// 已废弃,校验失败将不会执行catch
|
||||
reject(validRest)
|
||||
} else {
|
||||
resolve(validRest)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
3
types/table.d.ts
vendored
3
types/table.d.ts
vendored
@@ -2,7 +2,7 @@ import { RenderFunction, SetupContext, Ref, ComputedRef, ComponentPublicInstance
|
||||
import { VXEComponent, VxeComponentBase, VxeEvent, RecordInfo, SizeType, ValueOf, VNodeStyle } from './component'
|
||||
import { VxeTableProEmits, VxeTableProDefines } from './plugins/pro'
|
||||
import { VxeColumnPropTypes, VxeColumnProps } from './column'
|
||||
import { VxeGlobalRendererHandles } from './v-x-e-table'
|
||||
import { VXETableSetupOptions, VxeGlobalRendererHandles } from './v-x-e-table'
|
||||
import { VxeToolbarConstructor, VxeToolbarInstance } from './toolbar'
|
||||
import { VxeTooltipInstance } from './tooltip'
|
||||
import { VxeGridConstructor } from './grid'
|
||||
@@ -669,6 +669,7 @@ export interface TablePublicMethods {
|
||||
export interface VxeTableMethods extends TableMethods { }
|
||||
|
||||
export interface TablePrivateMethods {
|
||||
getSetupOptions(): VXETableSetupOptions;
|
||||
updateAfterDataIndex(): void;
|
||||
callSlot<T>(slotFunc: ((params: T) => any[]) | string | null, params: T): VNode[];
|
||||
getParentElem(): Element | null;
|
||||
|
||||
Reference in New Issue
Block a user