0
0
Fork 0

refs #7355 fix accountPrivileges

This commit is contained in:
Carlos Satorres 2024-08-26 11:41:35 +02:00
parent b4d1a4dab4
commit c84786e053
1 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref, watch } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
@ -9,21 +9,28 @@ import VnSelect from 'src/components/common/VnSelect.vue';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const loading = ref(false);
const rolesOptions = ref([]); const rolesOptions = ref([]);
const formModelRef = ref(); const formModelRef = ref();
watch(
() => route.params.id,
() => formModelRef.value.reset()
);
</script> </script>
<template> <template>
<FetchData url="VnRoles" auto-load @on-fetch="(data) => (rolesOptions = data)" /> <FetchData url="VnRoles" auto-load @on-fetch="(data) => (rolesOptions = data)" />
<QSpinner v-if="loading" color="primary" size="md" />
<FormModel <FormModel
ref="formModelRef" ref="formModelRef"
model="AccountPrivileges" model="AccountPrivileges"
:url="`VnUsers/${route.params.id}/privileges`" url="VnUsers/preview"
:url-create="`VnUsers/${route.params.id}/privileges`"
auto-load auto-load
@on-data-saved="formModelRef.fetch()" @on-data-saved="formModelRef.fetch()"
> >
<template #form="{ data }"> <template #form="{ data }">
{{ data }}
<div class="q-gutter-y-sm"> <div class="q-gutter-y-sm">
<QCheckbox <QCheckbox
v-model="data.hasGrant" v-model="data.hasGrant"