diff --git a/src/components/ZooAnimalFormDialog.vue b/src/components/ZooAnimalFormDialog.vue index 0f68036..42194c8 100644 --- a/src/components/ZooAnimalFormDialog.vue +++ b/src/components/ZooAnimalFormDialog.vue @@ -57,7 +57,7 @@ export default { - + diff --git a/src/components/ZooAside.vue b/src/components/ZooAside.vue index 3b583a9..b6a0611 100644 --- a/src/components/ZooAside.vue +++ b/src/components/ZooAside.vue @@ -46,8 +46,7 @@ export default { 饲养员 - - 饲养管理 + 饲养管理 diff --git a/src/components/ZooBreedingPlanFormDialog.vue b/src/components/ZooBreedingPlanFormDialog.vue new file mode 100644 index 0000000..c015ca9 --- /dev/null +++ b/src/components/ZooBreedingPlanFormDialog.vue @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + 雄性 + 雌性 + + + + + + + + + + + + + 正常 + 异常 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/pages/ZooAnimal.vue b/src/pages/ZooAnimal.vue index 417c90f..c8a4402 100644 --- a/src/pages/ZooAnimal.vue +++ b/src/pages/ZooAnimal.vue @@ -1,13 +1,12 @@ + + + + + + 添加饲养计划 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + + + 添加 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index bd6f67a..f8c8844 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -7,6 +7,7 @@ import ZooHome from '../pages/ZooHome.vue' import ZooUser from "@/pages/ZooUser.vue"; import ZooAnimal from "@/pages/ZooAnimal.vue"; import store from "@/store/index.js"; +import ZooBreeding from "@/pages/ZooBreeding.vue"; const router = createRouter({ history: createWebHashHistory(), @@ -27,22 +28,27 @@ const router = createRouter({ { path: '/panel', component:ZooPanel, - meta:{isAuth: true},//需要权限 + // meta:{isAuth: true},//需要权限 children:[ { path: 'home', component: ZooHome, - meta:{isAuth: true},//需要权限 + // meta:{isAuth: true},//需要权限 }, { path:'user', component:ZooUser, - meta:{isAuth: true},//需要权限 + // meta:{isAuth: true},//需要权限 }, { path:'animal', component:ZooAnimal, - meta:{isAuth: true},//需要权限 + // meta:{isAuth: true},//需要权限 + }, + { + path:'breeding', + component:ZooBreeding, + // meta:{isAuth: true},//需要权限 } ] }, @@ -52,14 +58,14 @@ const router = createRouter({ router.beforeEach((to, from, next) => { //判断页面是否需要登录权限才可进入 - if (to.meta.isAuth) { - if (!store.state.loginUser.username) { + //不是登录界面都需要权限。。。 + // console.log(to, from, next); + if (to.path !== '/login') { + if (!store.state.loginUser) { router.replace({ path: '/login', }) - } else { - next() - } + }else next() } else { next() } diff --git a/src/store/index.js b/src/store/index.js index a7b896c..82e8904 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -22,6 +22,10 @@ const actions = { //获取动物数据 getAnimals(context) { context.commit('updateAnimals', generateAnimals()) + }, + //获取饲养计划 + getBreedingPlans(context) { + context.commit('updateBreedingPlans','') } } @@ -37,6 +41,10 @@ const mutations = { //更新动物集合 updateAnimals(state, value) { state.animals = value + }, + //更新饲养计划 + updateBreedingPlans(state, value) { + state.breedingPlans = value } } @@ -50,7 +58,8 @@ const state = { users: [], //动物数据 animals: [], - + //饲养计划 + breedingPlans:[], }