refactor: refs #8197 adapt AccountAcls to VnCardMain
gitea/salix-front/pipeline/pr-master There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-master There was a failure building this commit
Details
This commit is contained in:
parent
0ab12d7b5d
commit
95420e96d1
|
@ -1,16 +1,15 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import { useValidator } from 'src/composables/useValidator';
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
|
import VnCardMain from 'src/components/common/VnCardMain.vue';
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -21,13 +20,13 @@ defineProps({
|
||||||
|
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const roles = ref();
|
const roles = ref();
|
||||||
const validationsStore = useValidator();
|
const validationsStore = useValidator();
|
||||||
const { models } = validationsStore;
|
const { models } = validationsStore;
|
||||||
|
const dataKey = 'AccountAcls';
|
||||||
const exprBuilder = (param, value) => {
|
const exprBuilder = (param, value) => {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case 'search':
|
case 'search':
|
||||||
|
@ -134,38 +133,41 @@ const deleteAcl = async ({ id }) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
|
||||||
data-key="AccountAcls"
|
|
||||||
url="ACLs"
|
|
||||||
:expr-builder="exprBuilder"
|
|
||||||
:label="t('acls.search')"
|
|
||||||
:info="t('acls.searchInfo')"
|
|
||||||
/>
|
|
||||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
|
||||||
</QDrawer>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="VnRoles?fields=['name']"
|
url="VnRoles?fields=['name']"
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (roles = data)"
|
@on-fetch="(data) => (roles = data)"
|
||||||
/>
|
/>
|
||||||
<VnTable
|
<VnCardMain
|
||||||
ref="tableRef"
|
:section="dataKey"
|
||||||
data-key="AccountAcls"
|
:data-key="dataKey"
|
||||||
:url="`ACLs`"
|
|
||||||
:create="{
|
|
||||||
urlCreate: 'ACLs',
|
|
||||||
title: 'Create ACL',
|
|
||||||
onDataSaved: () => tableRef.reload(),
|
|
||||||
formInitialData: {},
|
|
||||||
}"
|
|
||||||
order="id DESC"
|
|
||||||
:disable-option="{ card: true }"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
default-mode="table"
|
prefix="acls"
|
||||||
:right-search="true"
|
:array-data-props="{
|
||||||
:is-editable="true"
|
url: 'ACLs',
|
||||||
:use-model="true"
|
order: 'id DESC',
|
||||||
/>
|
exprBuilder,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #body>
|
||||||
|
<VnTable
|
||||||
|
ref="tableRef"
|
||||||
|
data-key="AccountAcls"
|
||||||
|
:create="{
|
||||||
|
urlCreate: 'ACLs',
|
||||||
|
title: 'Create ACL',
|
||||||
|
onDataSaved: () => tableRef.reload(),
|
||||||
|
formInitialData: {},
|
||||||
|
}"
|
||||||
|
:disable-option="{ card: true }"
|
||||||
|
:columns="columns"
|
||||||
|
default-mode="table"
|
||||||
|
:right-search="false"
|
||||||
|
:is-editable="true"
|
||||||
|
:use-model="true"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</VnCardMain>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
Loading…
Reference in New Issue