Loading src/components/TabBar.vue +52 −70 Original line number Original line Diff line number Diff line <template> <template> <div> <div> <!-- 占位导航栏div,防止导航栏挡住内容 --> <!-- 占位导航栏div,防止导航栏挡住内容 --> <div style="width:100%;height:2rem"></div> <van-tabbar v-model="active" @change="onChange" route> <van-tabbar v-model="active" @change="onChange"> <van-tabbar-item <van-tabbar-item v-for="(item, index) in tabBarList" v-for="(item, index) in tabBarList" :key="index" :key="index" Loading @@ -12,66 +11,49 @@ </van-tabbar> </van-tabbar> </div> </div> </template> </template> <script> <script> export default { export default { props:{ index: { type: Number, default: 0 }, }, data() { data() { return { return { active: "0", active: 0, tabBarList: [ tabBarList: [ { { key: "1", key: "1", name:'0', name: "0", imgUrl: require("@/assets/tabBar/new.png"), imgUrl: require("@/assets/tabBar/new.png"), imgUrlActive: require("@/assets/tabBar/new-active.png"), imgUrlActive: require("@/assets/tabBar/new-active.png"), path: "/message-center", path: "/message-center", text: "消息中心" text: "消息中心", }, }, { { key: "2", key: "2", name:'1', name: "1", imgUrl: require("@/assets/tabBar/workbench.png"), imgUrl: require("@/assets/tabBar/workbench.png"), imgUrlActive: require("@/assets/tabBar/workbench-active.png"), imgUrlActive: require("@/assets/tabBar/workbench-active.png"), path: "/save-workbench", path: "/save-workbench", text: "安全工作台" text: "安全工作台", }, }, { { key: "3", key: "3", name:'2', name: "2", imgUrl: require("@/assets/tabBar/my.png"), imgUrl: require("@/assets/tabBar/my.png"), imgUrlActive: require("@/assets/tabBar/my-active.png"), imgUrlActive: require("@/assets/tabBar/my-active.png"), path: "/my", path: "/my", text: "我的地盘" text: "我的地盘", } ] }; }, }, mounted() { ], this.active = this.index }; }, }, methods: { methods: { onChange(index) { onChange(index) { this.active = index; if (this.active == index) { if (this.active == index) { this.tabBarList.forEach((item) => { this.tabBarList.forEach((item) => { if (item.name == this.active) { if (item.name == this.active) { this.$router.push(item.path) this.$router.push(item.path); } }) }else{ } } } }); } } }, }, }; }; </script> </script> No newline at end of file <style scoped> /* @import url(); 引入css类 */ </style> src/permission.js +1 −1 Original line number Original line Diff line number Diff line Loading @@ -12,7 +12,7 @@ router.beforeEach(async(to, from, next) => { const hasToken = getToken()//确定用户是否已登录 const hasToken = getToken()//确定用户是否已登录 if (hasToken) { if (hasToken) { if (to.path === '/login2') { if (to.path === '/login2') { next({ path: '/save-workbench' }) next({ path: '/message-center' }) } else { } else { next() next() } } Loading src/router/index.js +10 −1 Original line number Original line Diff line number Diff line Loading @@ -445,7 +445,7 @@ const routes = [{ path: '/stand-book', path: '/stand-book', name: 'stand-book', name: 'stand-book', meta: { meta: { title: '隐患历史台账', title: '隐患台账', index: 1 index: 1 }, }, component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook'), Loading Loading @@ -656,6 +656,15 @@ const routes = [{ }, }, component: () => import('@/views/risk/riskAdd/matrixGrad/index') component: () => import('@/views/risk/riskAdd/matrixGrad/index') }, }, { path: '/finish-delay-detail', name: 'finish-delay-detail', meta: { title: '审批详情', index: 1 }, component: () => import('@/views/danger/changeDanger/finishDelayDetail') }, // matrix-grad // matrix-grad ] ] Loading src/service/danger.js +1 −1 Original line number Original line Diff line number Diff line Loading @@ -166,7 +166,7 @@ export function dangerReviewAdd(url, data) { }) }) } } // 隐患历史台账模块 // 隐患台账模块 export function dangerStandBook(url, data) { export function dangerStandBook(url, data) { return request({ return request({ url: url, url: url, Loading src/views/Login2.vue +1 −1 Original line number Original line Diff line number Diff line Loading @@ -85,7 +85,7 @@ export default { setUserInfo(userInfo) setUserInfo(userInfo) }) }) setToken(Response.data) setToken(Response.data) this.$router.push('/save-workbench') this.$router.push('/message-center') }else if(Response.code==301){ }else if(Response.code==301){ this.$toast.clear() this.$toast.clear() this.$toast.fail({ this.$toast.fail({ Loading Loading
src/components/TabBar.vue +52 −70 Original line number Original line Diff line number Diff line <template> <template> <div> <div> <!-- 占位导航栏div,防止导航栏挡住内容 --> <!-- 占位导航栏div,防止导航栏挡住内容 --> <div style="width:100%;height:2rem"></div> <van-tabbar v-model="active" @change="onChange" route> <van-tabbar v-model="active" @change="onChange"> <van-tabbar-item <van-tabbar-item v-for="(item, index) in tabBarList" v-for="(item, index) in tabBarList" :key="index" :key="index" Loading @@ -12,66 +11,49 @@ </van-tabbar> </van-tabbar> </div> </div> </template> </template> <script> <script> export default { export default { props:{ index: { type: Number, default: 0 }, }, data() { data() { return { return { active: "0", active: 0, tabBarList: [ tabBarList: [ { { key: "1", key: "1", name:'0', name: "0", imgUrl: require("@/assets/tabBar/new.png"), imgUrl: require("@/assets/tabBar/new.png"), imgUrlActive: require("@/assets/tabBar/new-active.png"), imgUrlActive: require("@/assets/tabBar/new-active.png"), path: "/message-center", path: "/message-center", text: "消息中心" text: "消息中心", }, }, { { key: "2", key: "2", name:'1', name: "1", imgUrl: require("@/assets/tabBar/workbench.png"), imgUrl: require("@/assets/tabBar/workbench.png"), imgUrlActive: require("@/assets/tabBar/workbench-active.png"), imgUrlActive: require("@/assets/tabBar/workbench-active.png"), path: "/save-workbench", path: "/save-workbench", text: "安全工作台" text: "安全工作台", }, }, { { key: "3", key: "3", name:'2', name: "2", imgUrl: require("@/assets/tabBar/my.png"), imgUrl: require("@/assets/tabBar/my.png"), imgUrlActive: require("@/assets/tabBar/my-active.png"), imgUrlActive: require("@/assets/tabBar/my-active.png"), path: "/my", path: "/my", text: "我的地盘" text: "我的地盘", } ] }; }, }, mounted() { ], this.active = this.index }; }, }, methods: { methods: { onChange(index) { onChange(index) { this.active = index; if (this.active == index) { if (this.active == index) { this.tabBarList.forEach((item) => { this.tabBarList.forEach((item) => { if (item.name == this.active) { if (item.name == this.active) { this.$router.push(item.path) this.$router.push(item.path); } }) }else{ } } } }); } } }, }, }; }; </script> </script> No newline at end of file <style scoped> /* @import url(); 引入css类 */ </style>
src/permission.js +1 −1 Original line number Original line Diff line number Diff line Loading @@ -12,7 +12,7 @@ router.beforeEach(async(to, from, next) => { const hasToken = getToken()//确定用户是否已登录 const hasToken = getToken()//确定用户是否已登录 if (hasToken) { if (hasToken) { if (to.path === '/login2') { if (to.path === '/login2') { next({ path: '/save-workbench' }) next({ path: '/message-center' }) } else { } else { next() next() } } Loading
src/router/index.js +10 −1 Original line number Original line Diff line number Diff line Loading @@ -445,7 +445,7 @@ const routes = [{ path: '/stand-book', path: '/stand-book', name: 'stand-book', name: 'stand-book', meta: { meta: { title: '隐患历史台账', title: '隐患台账', index: 1 index: 1 }, }, component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook'), component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/danger/standBook'), Loading Loading @@ -656,6 +656,15 @@ const routes = [{ }, }, component: () => import('@/views/risk/riskAdd/matrixGrad/index') component: () => import('@/views/risk/riskAdd/matrixGrad/index') }, }, { path: '/finish-delay-detail', name: 'finish-delay-detail', meta: { title: '审批详情', index: 1 }, component: () => import('@/views/danger/changeDanger/finishDelayDetail') }, // matrix-grad // matrix-grad ] ] Loading
src/service/danger.js +1 −1 Original line number Original line Diff line number Diff line Loading @@ -166,7 +166,7 @@ export function dangerReviewAdd(url, data) { }) }) } } // 隐患历史台账模块 // 隐患台账模块 export function dangerStandBook(url, data) { export function dangerStandBook(url, data) { return request({ return request({ url: url, url: url, Loading
src/views/Login2.vue +1 −1 Original line number Original line Diff line number Diff line Loading @@ -85,7 +85,7 @@ export default { setUserInfo(userInfo) setUserInfo(userInfo) }) }) setToken(Response.data) setToken(Response.data) this.$router.push('/save-workbench') this.$router.push('/message-center') }else if(Response.code==301){ }else if(Response.code==301){ this.$toast.clear() this.$toast.clear() this.$toast.fail({ this.$toast.fail({ Loading