diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue
index 0d80f43ce..88d374c74 100644
--- a/src/components/common/VnCard.vue
+++ b/src/components/common/VnCard.vue
@@ -59,32 +59,16 @@ if (props.baseUrl) {
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/src/components/common/VnCardMain.vue b/src/components/common/VnCardMain.vue
new file mode 100644
index 000000000..6e0231537
--- /dev/null
+++ b/src/components/common/VnCardMain.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/common/VnSectionMain.vue b/src/components/common/VnSectionMain.vue
index 15be6ad9a..c1b9808b5 100644
--- a/src/components/common/VnSectionMain.vue
+++ b/src/components/common/VnSectionMain.vue
@@ -1,6 +1,5 @@
-
-
-
-
+
+
+
-
-
+
+
+
+
diff --git a/src/pages/Account/Card/AccountCard.vue b/src/pages/Account/Card/AccountCard.vue
index 119a7fd07..f69bba778 100644
--- a/src/pages/Account/Card/AccountCard.vue
+++ b/src/pages/Account/Card/AccountCard.vue
@@ -1,20 +1,8 @@
-
+
diff --git a/src/pages/Account/Role/AccountRoles.vue b/src/pages/Account/Role/AccountRoles.vue
index 5a27e2ed6..683de0616 100644
--- a/src/pages/Account/Role/AccountRoles.vue
+++ b/src/pages/Account/Role/AccountRoles.vue
@@ -6,8 +6,11 @@ import { useRoute } from 'vue-router';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RoleSummary from './Card/RoleSummary.vue';
+import VnCardMain from 'src/components/common/VnCardMain.vue';
+
const route = useRoute();
const { t } = useI18n();
+const { viewSummary } = useSummaryDialog();
const $props = defineProps({
id: {
type: Number,
@@ -15,8 +18,10 @@ const $props = defineProps({
},
});
const tableRef = ref();
+const url = 'VnRoles';
+const dataKey = 'AccountRoleList';
+
const entityId = computed(() => $props.id || route.params.id);
-const { viewSummary } = useSummaryDialog();
const columns = computed(() => [
{
align: 'left',
@@ -63,6 +68,7 @@ const columns = computed(() => [
},
]);
const exprBuilder = (param, value) => {
+ console.log('param: ', param);
switch (param) {
case 'search':
return /^\d+$/.test(value)
@@ -81,30 +87,37 @@ const exprBuilder = (param, value) => {
-
-
+
+
+
+
+
+
+
+
diff --git a/src/pages/Account/Role/Card/RoleCard.vue b/src/pages/Account/Role/Card/RoleCard.vue
index a2d5710f4..da6ac61d8 100644
--- a/src/pages/Account/Role/Card/RoleCard.vue
+++ b/src/pages/Account/Role/Card/RoleCard.vue
@@ -1,20 +1,7 @@
-
+
diff --git a/src/pages/Account/Role/Card/RoleDescriptor.vue b/src/pages/Account/Role/Card/RoleDescriptor.vue
index 693fcdf48..b4b4fe316 100644
--- a/src/pages/Account/Role/Card/RoleDescriptor.vue
+++ b/src/pages/Account/Role/Card/RoleDescriptor.vue
@@ -43,7 +43,7 @@ const removeRole = async () => {
:filter="filter"
module="Role"
@on-fetch="setData"
- data-key="accountData"
+ data-key="Role"
:title="data.title"
:subtitle="data.subtitle"
:summary="$props.summary"
diff --git a/src/pages/Account/Role/Card/RoleSummary.vue b/src/pages/Account/Role/Card/RoleSummary.vue
index fef85f919..f0daa77fb 100644
--- a/src/pages/Account/Role/Card/RoleSummary.vue
+++ b/src/pages/Account/Role/Card/RoleSummary.vue
@@ -27,10 +27,10 @@ const filter = {
(role = data)"
- data-key="RoleSummary"
+ data-key="Role"
>
{{ role.id }} - {{ role.name }}
diff --git a/src/router/modules/account.js b/src/router/modules/account.js
index 7200131da..ece0ab2bb 100644
--- a/src/router/modules/account.js
+++ b/src/router/modules/account.js
@@ -1,4 +1,7 @@
import { RouterView } from 'vue-router';
+import accountCard from './account/accountCard';
+import roleCard from './account/roleCard';
+import getSections from 'src/utils/getSections';
export default {
path: '/account',
@@ -22,39 +25,48 @@ export default {
'AccountAcls',
'AccountConnections',
],
- card: [
- 'AccountBasicData',
- 'AccountInheritedRoles',
- 'AccountMailForwarding',
- 'AccountMailAlias',
- 'AccountPrivileges',
- 'AccountLog',
- ],
+ card: getSections(accountCard.children),
},
children: [
{
path: '',
name: 'AccountMain',
component: () => import('src/components/common/VnSectionMain.vue'),
- redirect: { name: 'AccountList' },
+ redirect: { name: 'AccountIndexMain' },
children: [
{
- path: 'list',
- name: 'AccountList',
- meta: {
- title: 'list',
- icon: 'view_list',
- },
+ path: '',
+ name: 'AccountIndexMain',
+ redirect: { name: 'AccountList' },
component: () => import('src/pages/Account/AccountList.vue'),
+ children: [
+ {
+ name: 'AccountList',
+ path: 'list',
+ meta: {
+ title: 'list',
+ icon: 'view_list',
+ },
+ },
+ accountCard,
+ ],
},
{
- path: 'role-list',
+ path: 'role',
name: 'AccountRoles',
+ redirect: { name: 'AccountRoleList' },
meta: {
title: 'roles',
icon: 'group',
},
component: () => import('src/pages/Account/Role/AccountRoles.vue'),
+ children: [
+ {
+ name: 'AccountRoleList',
+ path: 'list',
+ },
+ roleCard,
+ ],
},
{
path: 'alias-list',
@@ -120,81 +132,5 @@ export default {
},
],
},
- {
- name: 'AccountCard',
- path: ':id',
- component: () => import('src/pages/Account/Card/AccountCard.vue'),
- redirect: { name: 'AccountSummary' },
- children: [
- {
- name: 'AccountSummary',
- path: 'summary',
- meta: {
- title: 'summary',
- icon: 'launch',
- },
- component: () => import('src/pages/Account/Card/AccountSummary.vue'),
- },
- {
- name: 'AccountBasicData',
- path: 'basic-data',
- meta: {
- title: 'basicData',
- icon: 'vn:settings',
- },
- component: () =>
- import('src/pages/Account/Card/AccountBasicData.vue'),
- },
- {
- name: 'AccountInheritedRoles',
- path: 'inherited-roles',
- meta: {
- title: 'inheritedRoles',
- icon: 'group',
- },
- component: () =>
- import('src/pages/Account/Card/AccountInheritedRoles.vue'),
- },
- {
- name: 'AccountMailForwarding',
- path: 'mail-forwarding',
- meta: {
- title: 'mailForwarding',
- icon: 'forward',
- },
- component: () =>
- import('src/pages/Account/Card/AccountMailForwarding.vue'),
- },
- {
- name: 'AccountMailAlias',
- path: 'mail-alias',
- meta: {
- title: 'mailAlias',
- icon: 'email',
- },
- component: () =>
- import('src/pages/Account/Card/AccountMailAlias.vue'),
- },
- {
- name: 'AccountPrivileges',
- path: 'privileges',
- meta: {
- title: 'privileges',
- icon: 'badge',
- },
- component: () =>
- import('src/pages/Account/Card/AccountPrivileges.vue'),
- },
- {
- name: 'AccountLog',
- path: 'log',
- meta: {
- title: 'log',
- icon: 'history',
- },
- component: () => import('src/pages/Account/Card/AccountLog.vue'),
- },
- ],
- },
],
};
diff --git a/src/router/modules/account/accountCard.js b/src/router/modules/account/accountCard.js
new file mode 100644
index 000000000..0d8850f10
--- /dev/null
+++ b/src/router/modules/account/accountCard.js
@@ -0,0 +1,71 @@
+export default {
+ name: 'AccountCard',
+ path: ':id',
+ redirect: { name: 'AccountSummary' },
+ component: () => import('src/pages/Account/Card/AccountCard.vue'),
+ children: [
+ {
+ name: 'AccountSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () => import('src/pages/Account/Card/AccountSummary.vue'),
+ },
+ {
+ name: 'AccountBasicData',
+ path: 'basic-data',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () => import('src/pages/Account/Card/AccountBasicData.vue'),
+ },
+ {
+ name: 'AccountInheritedRoles',
+ path: 'inherited-roles',
+ meta: {
+ title: 'inheritedRoles',
+ icon: 'group',
+ },
+ component: () => import('src/pages/Account/Card/AccountInheritedRoles.vue'),
+ },
+ {
+ name: 'AccountMailForwarding',
+ path: 'mail-forwarding',
+ meta: {
+ title: 'mailForwarding',
+ icon: 'forward',
+ },
+ component: () => import('src/pages/Account/Card/AccountMailForwarding.vue'),
+ },
+ {
+ name: 'AccountMailAlias',
+ path: 'mail-alias',
+ meta: {
+ title: 'mailAlias',
+ icon: 'email',
+ },
+ component: () => import('src/pages/Account/Card/AccountMailAlias.vue'),
+ },
+ {
+ name: 'AccountPrivileges',
+ path: 'privileges',
+ meta: {
+ title: 'privileges',
+ icon: 'badge',
+ },
+ component: () => import('src/pages/Account/Card/AccountPrivileges.vue'),
+ },
+ {
+ name: 'AccountLog',
+ path: 'log',
+ meta: {
+ title: 'log',
+ icon: 'history',
+ },
+ component: () => import('src/pages/Account/Card/AccountLog.vue'),
+ },
+ ],
+};
diff --git a/src/router/modules/account/roleCard.js b/src/router/modules/account/roleCard.js
new file mode 100644
index 000000000..2a5387568
--- /dev/null
+++ b/src/router/modules/account/roleCard.js
@@ -0,0 +1,54 @@
+export default {
+ name: 'RoleCard',
+ path: ':id',
+ component: () => import('src/pages/Account/Role/Card/RoleCard.vue'),
+ redirect: { name: 'RoleSummary' },
+ children: [
+ {
+ name: 'RoleSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () => import('src/pages/Account/Role/Card/RoleSummary.vue'),
+ },
+ {
+ name: 'RoleBasicData',
+ path: 'basic-data',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () => import('src/pages/Account/Role/Card/RoleBasicData.vue'),
+ },
+ {
+ name: 'SubRoles',
+ path: 'sub-roles',
+ meta: {
+ title: 'subRoles',
+ icon: 'group',
+ },
+ component: () => import('src/pages/Account/Role/Card/SubRoles.vue'),
+ },
+
+ {
+ name: 'InheritedRoles',
+ path: 'inherited-roles',
+ meta: {
+ title: 'inheritedRoles',
+ icon: 'account_tree',
+ },
+ component: () => import('src/pages/Account/Role/Card/InheritedRoles.vue'),
+ },
+ {
+ name: 'RoleLog',
+ path: 'log',
+ meta: {
+ title: 'log',
+ icon: 'history',
+ },
+ component: () => import('src/pages/Account/Role/Card/RoleLog.vue'),
+ },
+ ],
+};
diff --git a/src/router/modules/index.js b/src/router/modules/index.js
index bf7e46b00..fb1bdc466 100644
--- a/src/router/modules/index.js
+++ b/src/router/modules/index.js
@@ -21,7 +21,6 @@ import Zone from './zone';
import Account from './account';
import Monitor from './monitor';
import MailAlias from './mailAlias';
-import Role from './role';
export default [
Item,
@@ -47,5 +46,4 @@ export default [
Account,
MailAlias,
Monitor,
- Role,
];
diff --git a/src/router/modules/role.js b/src/router/modules/role.js
deleted file mode 100644
index 47cd10b18..000000000
--- a/src/router/modules/role.js
+++ /dev/null
@@ -1,76 +0,0 @@
-import { RouterView } from 'vue-router';
-
-export default {
- path: 'account/role',
- name: 'Role',
- meta: {
- title: 'role',
- icon: 'vn:greuge',
- moduleName: 'Role',
- },
- component: RouterView,
- redirect: { name: 'AccountRoles' },
- menus: {
- main: [],
- card: ['RoleBasicData', 'SubRoles', 'InheritedRoles', 'RoleLog'],
- },
- children: [
- {
- name: 'RoleCard',
- path: ':id',
- component: () => import('src/pages/Account/Role/Card/RoleCard.vue'),
- redirect: { name: 'RoleSummary' },
- children: [
- {
- name: 'RoleSummary',
- path: 'summary',
- meta: {
- title: 'summary',
- icon: 'launch',
- },
- component: () =>
- import('src/pages/Account/Role/Card/RoleSummary.vue'),
- },
- {
- name: 'RoleBasicData',
- path: 'basic-data',
- meta: {
- title: 'basicData',
- icon: 'vn:settings',
- },
- component: () =>
- import('src/pages/Account/Role/Card/RoleBasicData.vue'),
- },
- {
- name: 'SubRoles',
- path: 'sub-roles',
- meta: {
- title: 'subRoles',
- icon: 'group',
- },
- component: () => import('src/pages/Account/Role/Card/SubRoles.vue'),
- },
-
- {
- name: 'InheritedRoles',
- path: 'inherited-roles',
- meta: {
- title: 'inheritedRoles',
- icon: 'account_tree',
- },
- component: () =>
- import('src/pages/Account/Role/Card/InheritedRoles.vue'),
- },
- {
- name: 'RoleLog',
- path: 'log',
- meta: {
- title: 'log',
- icon: 'history',
- },
- component: () => import('src/pages/Account/Role/Card/RoleLog.vue'),
- },
- ],
- },
- ],
-};
diff --git a/src/router/routes.js b/src/router/routes.js
index cced308b5..d332be941 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -10,7 +10,6 @@ import wagon from './modules/wagon';
import supplier from './modules/Supplier';
import travel from './modules/travel';
import department from './modules/department';
-import role from './modules/role';
import ItemType from './modules/itemType';
import shelving from 'src/router/modules/shelving';
import order from 'src/router/modules/order';
@@ -95,7 +94,6 @@ const routes = [
ItemType,
zone,
account,
- role,
mailAlias,
{
path: '/:catchAll(.*)*',
diff --git a/src/utils/getSections.js b/src/utils/getSections.js
new file mode 100644
index 000000000..f70daf468
--- /dev/null
+++ b/src/utils/getSections.js
@@ -0,0 +1,8 @@
+export default (sections) => {
+ const names = [];
+ for (const section of sections) {
+ if (section.path == 'summary') continue;
+ names.push(section.name);
+ }
+ return names;
+};