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