diff --git a/src/App.vue b/src/App.vue index 6a3a9ac..7d9651b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,36 +12,54 @@ const activeMenu = computed(() => route.path) - + - + + + 教练列表 + + + + + 教练新增 + - + + + 会员列表 - + + + 课程列表 @@ -133,7 +151,7 @@ const activeMenu = computed(() => route.path) background: #ffffff; } -.el-main{ +.el-main { display: flex; } diff --git a/src/mock/coach.js b/src/mock/coach.js index 59ea4f7..97b1c7f 100644 --- a/src/mock/coach.js +++ b/src/mock/coach.js @@ -44,4 +44,15 @@ export const getByPage = (query) => { }) const start = (page - 1) * limit return { total: result.length, data: result.slice(start, start + limit) } -} \ No newline at end of file +} + +// 离职 +export const quit = (id) => { + const target = list.find(item => item.id === id) + target.quitDate = new Date().toLocaleDateString() +} +// 复职 +export const rejoin = (id) => { + const target = list.find(item => item.id === id) + target.quitDate = null +} diff --git a/src/router/index.js b/src/router/index.js index 4e1dd8e..60c5fe9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,7 +1,4 @@ import { createRouter, createWebHistory } from 'vue-router' -import CoachView from '../views/CoachView.vue' -import MemberView from '../views/MemberView.vue' -import CourseView from '../views/CourseView.vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -12,18 +9,19 @@ const router = createRouter({ }, { path: '/coach', - name: 'coach', - component: CoachView, + component: ()=>import('../views/CoachView.vue'), }, { path: '/member', - name: 'member', - component: MemberView, + component: ()=>import('../views/MemberView.vue'), }, { path: '/course', - name: 'course', - component: CourseView, + component: ()=>import('../views/CourseView.vue'), + }, + { + path: '/addcoach', + component: ()=>import('../views/AddCoachView.vue'), }, ], }) diff --git a/src/views/AddCoachView.vue b/src/views/AddCoachView.vue new file mode 100644 index 0000000..a8a9308 --- /dev/null +++ b/src/views/AddCoachView.vue @@ -0,0 +1,44 @@ + + + + + + + diff --git a/src/views/CoachView.vue b/src/views/CoachView.vue index f31279e..dcb96ad 100644 --- a/src/views/CoachView.vue +++ b/src/views/CoachView.vue @@ -25,10 +25,13 @@ 查询 + 新增 + - + + @@ -74,8 +77,9 @@ @@ -93,8 +97,9 @@