diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 908157610..c1680bf13 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -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); diff --git a/src/pages/Account/AccountAcls.vue b/src/pages/Account/AccountAcls.vue index dd93a0cb5..63cdac9c7 100644 --- a/src/pages/Account/AccountAcls.vue +++ b/src/pages/Account/AccountAcls.vue @@ -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 }) => { /> +