no message

main
HUOJIN\92525 2025-09-30 16:31:12 +08:00
parent e830796e40
commit 0531a03026
1 changed files with 30 additions and 16 deletions

View File

@ -204,25 +204,39 @@ export default {
this.showcolumn(); this.showcolumn();
}, 200) }, 200)
} }
//vm.owner.store.commit('insertColumn', columnConfig, newIndex+myindex + 1 , null)
}, },
showcolumn() { showcolumn() {
const strHidden = sessionStorage.getItem(this.tableKey) try {
this.hiddenColumns = JSON.parse(strHidden); // sessionStoragehiddenColumns
const table = this.crud.props.table const strHidden = sessionStorage.getItem(this.tableKey)
this.hiddenColumns.forEach((column, index) => { if (strHidden) {
const vm = table.$children.find(e => e.prop === column.property) this.hiddenColumns = JSON.parse(strHidden);
const columnConfig = vm.columnConfig } else {
if (column.visible) { //
columnConfig.width = column.width this.hiddenColumns = [];
columnConfig.visible = column.visible
vm.owner.store.commit('insertColumn', columnConfig, index + 1, null)
} }
})
this.updateTableColumns(); const table = this.crud.props.table
//
this.hiddenColumns.forEach((column, index) => {
const vm = table.$children.find(e => e && e.prop === column.property)
if (vm) {
const columnConfig = vm.columnConfig;
// columnConfig
if (columnConfig) {
if (column.visible) {
//
columnConfig.width = column.width;
columnConfig.visible = column.visible;
vm.owner.store.commit('insertColumn', columnConfig, index + 1, null);
}
}
}
});
this.updateTableColumns();
} catch (error) {
console.error("处理列配置时发生错误:", error);
}
}, },
// //
columnDrop() { columnDrop() {