😎1、增加本地数据,本地数据优先于远程数据 2、排序配置可自定义 3、升级依赖
This commit is contained in:
parent
d227558515
commit
14a808c9b3
@ -67,7 +67,7 @@
|
||||
"vue-grid-layout": "3.0.0-beta1",
|
||||
"vue-i18n": "^10.0.4",
|
||||
"vue-json-pretty": "^2.4.0",
|
||||
"vue-plugin-hiprint": "^0.0.57-beta31",
|
||||
"vue-plugin-hiprint": "0.0.57-beta31",
|
||||
"vue-router": "^4.4.5",
|
||||
"vue-signature-pad": "^3.0.2",
|
||||
"vue3-tree-org": "^4.2.2",
|
||||
|
||||
@ -220,6 +220,9 @@ table.hiprint-printElement-tableTarget {
|
||||
.hiprint-printElement-tableTarget-border-td-all td:not(:nth-last-child(-n+2)) {
|
||||
border-right: 1px solid;
|
||||
}
|
||||
.hiprint-printElement-tableTarget-border-td-all td:not(last-child) {
|
||||
border-right: 1px solid;
|
||||
}
|
||||
.hiprint-printElement-tableTarget-border-td-all td:last-child {
|
||||
border-left: 1px solid;
|
||||
}
|
||||
|
||||
@ -20,9 +20,11 @@ interface iVxeOption {
|
||||
id?: string;
|
||||
name?: string;
|
||||
columns: VxeGridPropTypes.Columns<any>;
|
||||
data?: VxeTablePropTypes.Data<any>;
|
||||
sortConfig?: VxeTablePropTypes.SortConfig<any>;
|
||||
showFooter?: boolean;
|
||||
footerData?: any;
|
||||
footerMethod?: VxeTablePropTypes.FooterMethod<any>;
|
||||
footerData?: VxeTablePropTypes.FooterData;
|
||||
footerMethod?: VxeTablePropTypes.FooterMethod<D>;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -58,7 +60,7 @@ export const useVxeTable = <T>(opt: iVxeOption, extras?: VxeGridProps<T>) => {
|
||||
custom: true,
|
||||
},
|
||||
checkboxConfig: { range: true },
|
||||
sortConfig: { trigger: 'cell', remote: true },
|
||||
// sortConfig: { trigger: 'cell', remote: true },
|
||||
exportConfig: {
|
||||
remote: false, // 设置使用服务端导出
|
||||
filename: `${opt.name}导出_${dayjs().format('YYMMDDHHmmss')}`,
|
||||
@ -69,7 +71,30 @@ export const useVxeTable = <T>(opt: iVxeOption, extras?: VxeGridProps<T>) => {
|
||||
pageSize: 20,
|
||||
},
|
||||
printConfig: { sheetName: '' },
|
||||
proxyConfig: {
|
||||
// proxyConfig: {
|
||||
// enabled: true,
|
||||
// autoLoad: false,
|
||||
// sort: true,
|
||||
// props: {
|
||||
// list: 'data.result', // 不分页时
|
||||
// result: 'data.result.items', // 分页时
|
||||
// total: 'data.result.total',
|
||||
// message: 'data.message',
|
||||
// },
|
||||
// },
|
||||
customConfig: {
|
||||
storage: {
|
||||
// 是否启用 localStorage 本地保存,会将列操作状态保留在本地(需要有 id)
|
||||
visible: true, // 启用显示/隐藏列状态
|
||||
resizable: true, // 启用列宽状态
|
||||
},
|
||||
},
|
||||
});
|
||||
// data优先级高于proxyConfig
|
||||
if (opt.data) {
|
||||
options.data = opt.data;
|
||||
} else {
|
||||
options.proxyConfig = {
|
||||
enabled: true,
|
||||
autoLoad: false,
|
||||
sort: true,
|
||||
@ -79,14 +104,12 @@ export const useVxeTable = <T>(opt: iVxeOption, extras?: VxeGridProps<T>) => {
|
||||
total: 'data.result.total',
|
||||
message: 'data.message',
|
||||
},
|
||||
},
|
||||
customConfig: {
|
||||
storage: {
|
||||
// 是否启用 localStorage 本地保存,会将列操作状态保留在本地(需要有 id)
|
||||
visible: true, // 启用显示/隐藏列状态
|
||||
resizable: true, // 启用列宽状态
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
if (opt.sortConfig) {
|
||||
options.sortConfig = opt.sortConfig;
|
||||
} else {
|
||||
options.sortConfig = { remote: true };
|
||||
}
|
||||
return extras ? merge(options, extras) : options;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user