feat: refs #6891 keep arrayData opts
This commit is contained in:
parent
b5a599c8e7
commit
07c67b0df2
|
@ -42,6 +42,10 @@ const props = defineProps({
|
|||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
keepOpts: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
offset: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
|
@ -76,6 +80,7 @@ const arrayData = useArrayData(props.dataKey, {
|
|||
order: props.order,
|
||||
userParams: props.userParams,
|
||||
exprBuilder: props.exprBuilder,
|
||||
keepOpts: props.keepOpts,
|
||||
});
|
||||
const store = arrayData.store;
|
||||
|
||||
|
|
|
@ -47,7 +47,10 @@ export function useArrayData(key, userOptions) {
|
|||
if (isEmpty || !allowedOptions.includes(option)) continue;
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(store, option)) {
|
||||
store[option] = userOptions[option];
|
||||
const defaultOpts = userOptions[option];
|
||||
store[option] = userOptions.keepOpts?.includes(option)
|
||||
? Object.assign(defaultOpts, store[option])
|
||||
: defaultOpts;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -457,6 +457,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
:limit="12"
|
||||
:expr-builder="exprBuilder"
|
||||
:user-params="params"
|
||||
:keep-opts="['userParams']"
|
||||
:offset="50"
|
||||
auto-load
|
||||
>
|
||||
|
|
|
@ -61,6 +61,7 @@ function navigate(id) {
|
|||
:limit="20"
|
||||
:order="['landed DESC', 'clientFk', 'id DESC']"
|
||||
:user-params="{ showEmpty: false }"
|
||||
:keep-opts="['userParams']"
|
||||
auto-load
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
|
|
Loading…
Reference in New Issue