From c6b64a014fb8bca041d8031523f59c7b3d296bc0 Mon Sep 17 00:00:00 2001 From: mouse <1014893517@qq.com> Date: Sun, 17 Dec 2023 16:05:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/custom-element.scss | 16 ++++- src/assets/css/global.scss | 52 ++++++++++++++ src/components/common-menu.vue | 55 +++++++++++++++ src/components/common-pagination.vue | 27 ++++++++ src/components/page-tabs.vue | 64 +++++++++++++++++ src/components/system-logs.vue | 1 - src/router/index.ts | 18 +++++ src/utils/public-interface.ts | 4 ++ src/views/index.vue | 19 ++++-- .../permissions-manage/doctor-manage.vue | 68 +++++++++++++++++++ src/views/permissions-manage/menu-manage.vue | 15 ++++ .../permissions-manage/permissions-manage.vue | 66 +++++++++++++++++- src/views/permissions-manage/role-manage.vue | 15 ++++ 13 files changed, 406 insertions(+), 14 deletions(-) create mode 100644 src/components/common-menu.vue create mode 100644 src/components/common-pagination.vue create mode 100644 src/components/page-tabs.vue create mode 100644 src/utils/public-interface.ts create mode 100644 src/views/permissions-manage/doctor-manage.vue create mode 100644 src/views/permissions-manage/menu-manage.vue create mode 100644 src/views/permissions-manage/role-manage.vue diff --git a/src/assets/css/custom-element.scss b/src/assets/css/custom-element.scss index 20551ab..de446ad 100644 --- a/src/assets/css/custom-element.scss +++ b/src/assets/css/custom-element.scss @@ -23,22 +23,32 @@ color: $main-color; } } +.el-button.is-link { + color: $main-color; + &:hover, + &:active { + color: rgba($main-color, .8); + } + &:focus { + color: rgba($main-color, .7); + } +} .el-button.el-button--primary { background-color: $main-color; border-color: $main-color; opacity: 1; - transition: all .6; + transition: all .6s; &:hover, &:active { opacity: .7; - transition: all .6; + transition: all .6s; } &:focus { opacity: .9; - transition: all .6; + transition: all .6s; } } .el-form-item { diff --git a/src/assets/css/global.scss b/src/assets/css/global.scss index 56c08e1..3155427 100644 --- a/src/assets/css/global.scss +++ b/src/assets/css/global.scss @@ -152,4 +152,56 @@ body { } } } +} + +.table-page { + width: 100%; + height: 100%; + .search-part { + width: 100%; + height: 40px; + display: flex; + align-items: center; + &>* ~ * { + margin-left: 20px; + } + .search-cell { + display: flex; + align-items: center; + .label { + flex-shrink: 0; + margin-right: 10px; + } + } + } + .button-part { + width: 100%; + height: 40px; + margin-top: 20px; + display: flex; + align-items: center; + &>* ~ * { + margin-left: 20px; + } + } + .table-part { + width: 100%; + height: calc(100% - 170px); + margin-top: 10px; + .el-table { + .el-table__header { + th { + background: rgba($main-color, .05); + } + } + } + } + .pagination-part { + width: 100%; + height: 50px; + margin-top: 20px; + .el-pagination { + justify-content: flex-end; + } + } } \ No newline at end of file diff --git a/src/components/common-menu.vue b/src/components/common-menu.vue new file mode 100644 index 0000000..9123866 --- /dev/null +++ b/src/components/common-menu.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/components/common-pagination.vue b/src/components/common-pagination.vue new file mode 100644 index 0000000..cd0893c --- /dev/null +++ b/src/components/common-pagination.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/components/page-tabs.vue b/src/components/page-tabs.vue new file mode 100644 index 0000000..e00e3a8 --- /dev/null +++ b/src/components/page-tabs.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/src/components/system-logs.vue b/src/components/system-logs.vue index f5e558f..38eacd3 100644 --- a/src/components/system-logs.vue +++ b/src/components/system-logs.vue @@ -19,7 +19,6 @@ while (activities.length < 10) { ip: '127.0.0.1' }) } -console.log(activities) diff --git a/src/router/index.ts b/src/router/index.ts index dbc0376..3b60115 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -23,7 +23,25 @@ const router = createRouter({ { path: '/permissions-manage', name: '权限管理', + redirect: '/permissions-manage/doctor-manage', component: () => import('@/views/permissions-manage/permissions-manage.vue'), + children: [ + { + path: '/permissions-manage/doctor-manage', + name: '医生管理', + component: () => import('@/views/permissions-manage/doctor-manage.vue'), + }, + { + path: '/permissions-manage/role-manage', + name: '角色管理', + component: () => import('@/views/permissions-manage/role-manage.vue'), + }, + { + path: '/permissions-manage/menu-manage', + name: '菜单管理', + component: () => import('@/views/permissions-manage/menu-manage.vue'), + } + ] }, { path: '/patients-manage', diff --git a/src/utils/public-interface.ts b/src/utils/public-interface.ts new file mode 100644 index 0000000..86d8b95 --- /dev/null +++ b/src/utils/public-interface.ts @@ -0,0 +1,4 @@ +export interface MenuItem { + name: string + path: string +} \ No newline at end of file diff --git a/src/views/index.vue b/src/views/index.vue index 85a4ffb..77a1171 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -5,7 +5,7 @@ @@ -82,12 +82,15 @@ const menus = [ ] const isShowUserInfoDrawer = ref(false) -const menuActive = ref('/home') +const menuActive = ref('/') router.isReady().then(() => { - console.log(route) menuActive.value = route.path }) +router.beforeEach((to, from, next) => { + menuActive.value = to.path + next() +}); onMounted(() => { @@ -170,17 +173,19 @@ const userCommand = (e: string) => { line-height: 50px; padding: 0 20px; margin: 0; - transition: all .3s; - -webkit-transition: all .3s; + transition: all .5s; + -webkit-transition: all .5s; &:hover { background: #F5F7FA; - transition: all .3s; - -webkit-transition: all .3s; + transition: all .5s; + -webkit-transition: all .5s; } &.active { background: rgba($main-color, .1); + transition: all .5s; + -webkit-transition: all .5s; } img { diff --git a/src/views/permissions-manage/doctor-manage.vue b/src/views/permissions-manage/doctor-manage.vue new file mode 100644 index 0000000..1c57b68 --- /dev/null +++ b/src/views/permissions-manage/doctor-manage.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/views/permissions-manage/menu-manage.vue b/src/views/permissions-manage/menu-manage.vue new file mode 100644 index 0000000..3c179a6 --- /dev/null +++ b/src/views/permissions-manage/menu-manage.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/src/views/permissions-manage/permissions-manage.vue b/src/views/permissions-manage/permissions-manage.vue index 3acd73a..3ab64c6 100644 --- a/src/views/permissions-manage/permissions-manage.vue +++ b/src/views/permissions-manage/permissions-manage.vue @@ -1,14 +1,74 @@ + .menu-box { + width: 200px; + height: 100%; + background: white; + overflow-x: hidden; + overflow-y: auto; + } + + .content-box { + width: calc(100% - 200px); + height: 100%; + + .header-box { + width: 100%; + height: 50px; + } + + .main-box { + width: 100%; + height: calc(100% - 50px); + padding: 10px; + .background-block { + width: 100%; + height: 100%; + background: white; + border-radius: 15px; + padding: 20px; + } + } + } +} diff --git a/src/views/permissions-manage/role-manage.vue b/src/views/permissions-manage/role-manage.vue new file mode 100644 index 0000000..3c179a6 --- /dev/null +++ b/src/views/permissions-manage/role-manage.vue @@ -0,0 +1,15 @@ + + + + +