refactor: refs #8197 adapt AccountAlias
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
5d744ca456
commit
18fd41b82b
|
@ -2,21 +2,12 @@
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnCardMain from 'src/components/common/VnCardMain.vue';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
const dataKey = 'AccountAliasList';
|
||||||
|
|
||||||
const exprBuilder = (param, value) => {
|
|
||||||
switch (param) {
|
|
||||||
case 'search':
|
|
||||||
return /^\d+$/.test(value)
|
|
||||||
? { id: value }
|
|
||||||
: { alias: { like: `%${value}%` } };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -40,40 +31,46 @@ const columns = computed(() => [
|
||||||
create: true,
|
create: true,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const exprBuilder = (param, value) => {
|
||||||
|
switch (param) {
|
||||||
|
case 'search':
|
||||||
|
return /^\d+$/.test(value)
|
||||||
|
? { id: value }
|
||||||
|
: { alias: { like: `%${value}%` } };
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-if="stateStore.isHeaderMounted()">
|
<VnCardMain
|
||||||
<Teleport to="#searchbar">
|
:section="dataKey"
|
||||||
<VnSearchbar
|
:data-key="dataKey"
|
||||||
data-key="AccountAliasList"
|
:columns="columns"
|
||||||
url="MailAliases"
|
prefix="mailAlias"
|
||||||
:expr-builder="exprBuilder"
|
:array-data-props="{ url: 'MailAliases', order: 'id DESC', exprBuilder }"
|
||||||
:label="t('mailAlias.search')"
|
>
|
||||||
:info="t('mailAlias.searchInfo')"
|
<template #body>
|
||||||
/>
|
|
||||||
</Teleport>
|
|
||||||
</template>
|
|
||||||
<VnTable
|
<VnTable
|
||||||
|
:data-key="dataKey"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="AccountAliasList"
|
|
||||||
url="MailAliases"
|
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'MailAliases',
|
urlCreate: 'MailAliases',
|
||||||
title: 'Create MailAlias',
|
title: 'Create MailAlias',
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
formInitialData: {},
|
formInitialData: {},
|
||||||
}"
|
}"
|
||||||
order="id DESC"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
redirect="account/alias"
|
redirect="account/alias"
|
||||||
:is-editable="true"
|
:is-editable="true"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
|
:right-search="false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
</VnCardMain>
|
||||||
|
</template>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Id: Id
|
Id: Id
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
import accountCard from './account/accountCard';
|
import accountCard from './account/accountCard';
|
||||||
import roleCard from './account/roleCard';
|
import roleCard from './account/roleCard';
|
||||||
|
import aliasCard from './account/aliasCard';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/account',
|
path: '/account',
|
||||||
|
@ -12,8 +13,8 @@ export default {
|
||||||
keyBinding: 'u',
|
keyBinding: 'u',
|
||||||
menu: [
|
menu: [
|
||||||
'AccountList',
|
'AccountList',
|
||||||
'AccountAliasList',
|
|
||||||
'AccountRoles',
|
'AccountRoles',
|
||||||
|
'AccountAlias',
|
||||||
'AccountAccounts',
|
'AccountAccounts',
|
||||||
'AccountLdap',
|
'AccountLdap',
|
||||||
'AccountSamba',
|
'AccountSamba',
|
||||||
|
@ -65,13 +66,21 @@ export default {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'alias-list',
|
path: 'alias',
|
||||||
name: 'AccountAliasList',
|
name: 'AccountAlias',
|
||||||
|
redirect: { name: 'AccountAliasList' },
|
||||||
meta: {
|
meta: {
|
||||||
title: 'alias',
|
title: 'alias',
|
||||||
icon: 'email',
|
icon: 'email',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Account/AccountAliasList.vue'),
|
component: () => import('src/pages/Account/AccountAliasList.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'AccountAliasList',
|
||||||
|
path: 'list',
|
||||||
|
},
|
||||||
|
aliasCard,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'acls',
|
path: 'acls',
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
export default {
|
||||||
|
name: 'AliasCard',
|
||||||
|
path: ':id',
|
||||||
|
component: () => import('src/pages/Account/Alias/Card/AliasCard.vue'),
|
||||||
|
redirect: { name: 'AliasSummary' },
|
||||||
|
meta: { menu: ['AliasBasicData', 'AliasUsers'] },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'AliasSummary',
|
||||||
|
path: 'summary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'launch',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Account/Alias/Card/AliasSummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'AliasBasicData',
|
||||||
|
path: 'basic-data',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Account/Alias/Card/AliasBasicData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'AliasUsers',
|
||||||
|
path: 'users',
|
||||||
|
meta: {
|
||||||
|
title: 'aliasUsers',
|
||||||
|
icon: 'group',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Account/Alias/Card/AliasUsers.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
|
@ -20,7 +20,6 @@ import ItemType from './itemType';
|
||||||
import Zone from './zone';
|
import Zone from './zone';
|
||||||
import Account from './account';
|
import Account from './account';
|
||||||
import Monitor from './monitor';
|
import Monitor from './monitor';
|
||||||
import MailAlias from './mailAlias';
|
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
Item,
|
Item,
|
||||||
|
@ -44,6 +43,5 @@ export default [
|
||||||
ItemType,
|
ItemType,
|
||||||
Zone,
|
Zone,
|
||||||
Account,
|
Account,
|
||||||
MailAlias,
|
|
||||||
Monitor,
|
Monitor,
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,57 +0,0 @@
|
||||||
import { RouterView } from 'vue-router';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
path: 'account/alias',
|
|
||||||
name: 'Alias',
|
|
||||||
meta: {
|
|
||||||
title: 'alias',
|
|
||||||
icon: 'email',
|
|
||||||
moduleName: 'Alias',
|
|
||||||
},
|
|
||||||
component: RouterView,
|
|
||||||
redirect: { name: 'AccountAliasList' },
|
|
||||||
menus: {
|
|
||||||
main: [],
|
|
||||||
card: ['AliasBasicData', 'AliasUsers'],
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'AliasCard',
|
|
||||||
path: ':id',
|
|
||||||
component: () => import('src/pages/Account/Alias/Card/AliasCard.vue'),
|
|
||||||
redirect: { name: 'AliasSummary' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'AliasSummary',
|
|
||||||
path: 'summary',
|
|
||||||
meta: {
|
|
||||||
title: 'summary',
|
|
||||||
icon: 'launch',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Account/Alias/Card/AliasSummary.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'AliasBasicData',
|
|
||||||
path: 'basic-data',
|
|
||||||
meta: {
|
|
||||||
title: 'basicData',
|
|
||||||
icon: 'vn:settings',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Account/Alias/Card/AliasBasicData.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'AliasUsers',
|
|
||||||
path: 'users',
|
|
||||||
meta: {
|
|
||||||
title: 'aliasUsers',
|
|
||||||
icon: 'group',
|
|
||||||
},
|
|
||||||
component: () =>
|
|
||||||
import('src/pages/Account/Alias/Card/AliasUsers.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
|
@ -20,7 +20,6 @@ import agency from 'src/router/modules/agency';
|
||||||
import zone from 'src/router/modules/zone';
|
import zone from 'src/router/modules/zone';
|
||||||
import account from './modules/account';
|
import account from './modules/account';
|
||||||
import monitor from 'src/router/modules/monitor';
|
import monitor from 'src/router/modules/monitor';
|
||||||
import mailAlias from './modules/mailAlias';
|
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
|
@ -94,7 +93,6 @@ const routes = [
|
||||||
ItemType,
|
ItemType,
|
||||||
zone,
|
zone,
|
||||||
account,
|
account,
|
||||||
mailAlias,
|
|
||||||
{
|
{
|
||||||
path: '/:catchAll(.*)*',
|
path: '/:catchAll(.*)*',
|
||||||
name: 'NotFound',
|
name: 'NotFound',
|
||||||
|
|
Loading…
Reference in New Issue