forked from verdnatura/salix-front
fix: better performance
This commit is contained in:
parent
fd72f4dd45
commit
92e147355f
|
@ -151,8 +151,8 @@ const tableModes = [
|
|||
},
|
||||
];
|
||||
onBeforeMount(() => {
|
||||
setUserParams(route.query[$props.searchUrl]);
|
||||
hasParams.value = params.value && Object.keys(params.value).length !== 0;
|
||||
const urlParams = route.query[$props.searchUrl];
|
||||
hasParams.value = urlParams && Object.keys(urlParams).length !== 0;
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
|
@ -185,7 +185,8 @@ watch(
|
|||
|
||||
watch(
|
||||
() => route.query[$props.searchUrl],
|
||||
(val) => setUserParams(val)
|
||||
(val) => setUserParams(val),
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
|
||||
const isTableMode = computed(() => mode.value == TABLE_MODE);
|
||||
|
|
|
@ -9,6 +9,8 @@ import { useQuasar } from 'quasar';
|
|||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import { useValidator } from 'src/composables/useValidator';
|
||||
|
||||
defineProps({
|
||||
id: {
|
||||
|
@ -23,11 +25,18 @@ const stateStore = useStateStore();
|
|||
const quasar = useQuasar();
|
||||
|
||||
const tableRef = ref();
|
||||
|
||||
const roles = ref();
|
||||
const validationsStore = useValidator();
|
||||
const { models } = validationsStore;
|
||||
const exprBuilder = (param, value) => {
|
||||
switch (param) {
|
||||
case 'search':
|
||||
return { model: { like: `%${value}%` } };
|
||||
return {
|
||||
or: [
|
||||
{ model: { like: `%${value}%` } },
|
||||
{ property: { like: `%${value}%` } },
|
||||
],
|
||||
};
|
||||
default:
|
||||
return { [param]: value };
|
||||
}
|
||||
|
@ -47,6 +56,13 @@ const columns = computed(() => [
|
|||
label: t('model'),
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
columnCreate: {
|
||||
label: t('model'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
options: Object.keys(models),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -55,9 +71,10 @@ const columns = computed(() => [
|
|||
cardVisible: true,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'VnRoles',
|
||||
options: roles,
|
||||
optionLabel: 'name',
|
||||
optionValue: 'name',
|
||||
inputDebounce: 0,
|
||||
},
|
||||
create: true,
|
||||
},
|
||||
|
@ -130,6 +147,11 @@ const deleteAcl = async ({ id }) => {
|
|||
/>
|
||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||
</QDrawer>
|
||||
<FetchData
|
||||
url="VnRoles?fields=['name']"
|
||||
auto-load
|
||||
@on-fetch="(data) => (roles = data)"
|
||||
/>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="AccountAcls"
|
||||
|
|
|
@ -33,6 +33,7 @@ const rolesOptions = ref([]);
|
|||
:search-button="true"
|
||||
:hidden-tags="['search']"
|
||||
:redirect="false"
|
||||
search-url="table"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
|
|
Loading…
Reference in New Issue