This commit is contained in:
2025-07-02 15:34:54 +08:00
parent 392533a3b6
commit 90f815b4f9
2 changed files with 10 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ function useTableQuery({
parameter, parameter,
api, api,
callback, callback,
uuid = false,
immediate = true, immediate = true,
watchParameter = false, watchParameter = false,
}) { }) {
@@ -56,12 +57,14 @@ function useTableQuery({
vo.page = _vo.page; vo.page = _vo.page;
vo.total = _vo.total; vo.total = _vo.total;
vo.rows = [...vo.rows, ..._vo.rows]; vo.rows = [...vo.rows, ..._vo.rows];
vo.rows = Array.from( if (uuid) {
vo.rows.reduce((map, item) => { vo.rows = Array.from(
map.set(item.id, item); vo.rows.reduce((map, item) => {
return map; map.set(item.id, item);
}, new Map()).values() return map;
) }, new Map()).values()
)
}
callback && callback(vo); callback && callback(vo);
} finally { } finally {

View File

@@ -25,6 +25,7 @@ const vo = reactive({
const {loading, pagination, initFetchData, fetchData} = useTableQuery({ const {loading, pagination, initFetchData, fetchData} = useTableQuery({
api: Api.system.getExchangeLog, api: Api.system.getExchangeLog,
uuid: true,
parameter: po, parameter: po,
callback: (data) => { callback: (data) => {
console.log(data); console.log(data);