fix: refs #8113 load map logic
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
4d285499b9
commit
ed8c124bc7
|
@ -126,7 +126,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
}
|
||||
const totalRows = store.data.length;
|
||||
response.data.forEach((row, position) => {
|
||||
const key = row.id;
|
||||
const key = row.clientFk;
|
||||
const val = { ...row, key };
|
||||
|
||||
if (!store.map.has(key)) {
|
||||
|
@ -141,11 +141,20 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
});
|
||||
} else {
|
||||
store.data = [];
|
||||
response.data.forEach((row, position) => {
|
||||
const key = row.id;
|
||||
const val = { ...row, key, position };
|
||||
store.data.push(val);
|
||||
store.map.set(key, val);
|
||||
response.data.forEach((row) => {
|
||||
const key = row.clientFk;
|
||||
const val = { ...row, key };
|
||||
|
||||
if (store.map.has(key)) {
|
||||
const { position } = store.map.get(key);
|
||||
val.position = position;
|
||||
store.map.set(key, val);
|
||||
store.data[position] = val;
|
||||
} else {
|
||||
val.position = store.map.size;
|
||||
store.map.set(key, val);
|
||||
store.data.push(val);
|
||||
}
|
||||
});
|
||||
if (!isDialogOpened()) updateRouter && updateStateParams();
|
||||
}
|
||||
|
|
|
@ -341,6 +341,7 @@ const openTab = (id) =>
|
|||
:row-click="({ id }) => openTab(id)"
|
||||
:disable-option="{ card: true }"
|
||||
:user-params="{ from, to, scopeDays: 1 }"
|
||||
:limit="3"
|
||||
>
|
||||
<template #top-left>
|
||||
<QBtn
|
||||
|
|
Loading…
Reference in New Issue