修改个性化列无法重置问题
This commit is contained in:
@@ -138,7 +138,7 @@ export default {
|
||||
customTitle: 'Column settings',
|
||||
customAll: 'All',
|
||||
customConfirm: 'Confirm',
|
||||
customRestore: 'Restore'
|
||||
customRestore: 'Reset'
|
||||
},
|
||||
grid: {
|
||||
selectOneRecord: 'Please choose at least one piece of record!',
|
||||
|
||||
@@ -138,7 +138,7 @@ export default {
|
||||
customTitle: '列设置',
|
||||
customAll: '全部',
|
||||
customConfirm: '确认',
|
||||
customRestore: '还原'
|
||||
customRestore: 'リセット'
|
||||
},
|
||||
grid: {
|
||||
selectOneRecord: '少なくとも1つのレコードを選択してください',
|
||||
|
||||
@@ -247,7 +247,7 @@ export default {
|
||||
custom: '列设置',
|
||||
customAll: '全部',
|
||||
customConfirm: '确认',
|
||||
customRestore: '还原'
|
||||
customRestore: '重置'
|
||||
},
|
||||
input: {
|
||||
date: {
|
||||
|
||||
@@ -138,7 +138,7 @@ export default {
|
||||
customTitle: '列設定',
|
||||
customAll: '全部',
|
||||
customConfirm: '確認',
|
||||
customRestore: '還原'
|
||||
customRestore: '重置'
|
||||
},
|
||||
grid: {
|
||||
selectOneRecord: '請至少選擇一條記錄!',
|
||||
|
||||
@@ -3148,7 +3148,7 @@ export default defineComponent({
|
||||
return 0
|
||||
},
|
||||
/**
|
||||
* 手动重置列的显示隐藏、列宽拖动的状态;
|
||||
* 手动重置列的显示隐藏、列宽拖动的状态、固定列、排序列;
|
||||
* 如果为 true 则重置所有状态
|
||||
* 如果已关联工具栏,则会同步更新
|
||||
*/
|
||||
@@ -3156,11 +3156,18 @@ export default defineComponent({
|
||||
const { tableFullColumn } = internalData
|
||||
const customOpts = computeCustomOpts.value
|
||||
const { checkMethod } = customOpts
|
||||
const opts = Object.assign({ visible: true, resizable: options === true }, options)
|
||||
const opts = Object.assign({
|
||||
visible: true,
|
||||
resizable: options === true,
|
||||
fixed: options === true
|
||||
}, options)
|
||||
tableFullColumn.forEach((column) => {
|
||||
if (opts.resizable) {
|
||||
column.resizeWidth = 0
|
||||
}
|
||||
if (opts.fixed) {
|
||||
column.fixed = column.defaultFixed
|
||||
}
|
||||
if (!checkMethod || checkMethod({ column })) {
|
||||
column.visible = column.defaultVisible
|
||||
}
|
||||
@@ -3168,6 +3175,9 @@ export default defineComponent({
|
||||
if (opts.resizable) {
|
||||
tablePrivateMethods.saveCustomResizable(true)
|
||||
}
|
||||
if (opts.fixed) {
|
||||
tablePrivateMethods.saveCustomFixed()
|
||||
}
|
||||
return tablePrivateMethods.handleCustom()
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -158,18 +158,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
const resetCustomEvent = (evnt: Event) => {
|
||||
const { columns } = reactData
|
||||
const { computeCustomOpts: computeTableCustomOpts } = $xetable.getComputeMaps()
|
||||
const tableCustomOpts = computeTableCustomOpts.value
|
||||
const { checkMethod } = tableCustomOpts
|
||||
XEUtils.eachTree(columns, (column) => {
|
||||
if (!checkMethod || checkMethod({ column })) {
|
||||
column.visible = column.defaultVisible
|
||||
column.halfVisible = false
|
||||
}
|
||||
column.resizeWidth = 0
|
||||
})
|
||||
$xetable.saveCustomResizable(true)
|
||||
$xetable.resetColumn(true)
|
||||
closeCustom()
|
||||
emitCustomEvent('reset', evnt)
|
||||
}
|
||||
|
||||
4
types/v-x-e-table/renderer.d.ts
vendored
4
types/v-x-e-table/renderer.d.ts
vendored
@@ -121,7 +121,7 @@ export namespace VxeGlobalRendererHandles {
|
||||
}
|
||||
|
||||
export type RenderDefaultOptions<D = VxeTableDataRow> = VxeColumnPropTypes.EditRender<D>
|
||||
export type RenderDefaultParams = RenderEditParams
|
||||
export type RenderDefaultParams<D = VxeTableDataRow> = RenderEditParams<D>
|
||||
|
||||
export interface RenderFooterOptions extends VxeGlobalRendererHandles.RenderOptions { }
|
||||
|
||||
@@ -149,7 +149,7 @@ export namespace VxeGlobalRendererHandles {
|
||||
options: VxeTablePropTypes.ExportHandleOptions
|
||||
}
|
||||
|
||||
export type RenderEditOptions = VxeColumnPropTypes.EditRender
|
||||
export type RenderEditOptions<D = VxeTableDataRow> = VxeColumnPropTypes.EditRender<D>
|
||||
|
||||
export interface RenderEditParams<D = VxeTableDataRow> {
|
||||
$table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
|
||||
|
||||
Reference in New Issue
Block a user