From 2d467016b2400eee505159c451ef6ad8b3128ded Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 1 Aug 2024 09:51:18 +0200 Subject: [PATCH] refs #7355 fix roles --- src/components/VnTable/VnTable.vue | 8 +- src/components/common/VnComponent.vue | 6 +- src/components/ui/VnFilterPanel.vue | 14 +++- src/pages/Account/AccountList.vue | 12 ++- .../Account/Card/AccountDescriptorMenu.vue | 77 +------------------ src/pages/Account/Role/AccountRoles.vue | 7 +- .../Account/Role/Card/RoleDescriptor.vue | 30 ++------ 7 files changed, 41 insertions(+), 113 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 444ca15bd..4e40c0ba6 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -124,7 +124,7 @@ const tableModes = [ ]; onBeforeMount(() => { setUserParams(route.query[$props.searchUrl]); - hasParams.value = Object.keys(params.value).length !== 0; + hasParams.value = params.value && Object.keys(params.value).length !== 0; }); onMounted(() => { @@ -158,7 +158,10 @@ function setUserParams(watchedParams) { if (!watchedParams) return; if (typeof watchedParams == 'string') watchedParams = JSON.parse(watchedParams); - const filter = JSON.parse(watchedParams?.filter); + const filter = + typeof watchedParams?.filter == 'string' + ? JSON.parse(watchedParams?.filter) + : watchedParams?.filter; const where = filter?.where; const order = filter?.order; @@ -281,6 +284,7 @@ defineExpose({ v-model="params" :search-url="searchUrl" :redirect="!!redirect" + @set-user-params="setUserParams" >