| | |
| | | }, |
| | | mounted() { |
| | | this.setActive(); |
| | | this.tagList.forEach((item, index) => { |
| | | if (item.label == "首页" && (this.userInfo.role_name == "policeAdmin" || this.userInfo.role_name == "administrator")){ |
| | | this.$store.commit("set_hideHome", false); |
| | | }else if (item.label == "首页" && (this.userInfo.role_name == "操作员")) { |
| | | this.tagList.splice(index, 1); |
| | | this.$store.commit("set_hideHome", true); |
| | | var d = this.$router.options.routes, |
| | | path = ""; |
| | | for (var k in d) { |
| | | if (d[k].peixun == true) { |
| | | // console.log(d[k]); |
| | | path = d[k].path; |
| | | } |
| | | } |
| | | this.$router.push({ path: path }); |
| | | } else { |
| | | this.tagList.splice(index, 1); |
| | | this.$store.commit("set_hideHome", true); |
| | | var d = this.$router.options.routes, |
| | | path = ""; |
| | | for (var k in d) { |
| | | if (d[k].kby == true) { |
| | | // console.log(d[k]); |
| | | path = d[k].path; |
| | | } |
| | | } |
| | | this.$router.push({ path: path }); |
| | | } |
| | | }); |
| | | }, |
| | | watch: { |
| | | tag() { |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["tagWel", "tagList", "tag", "website"]), |
| | | ...mapGetters(["tagWel", "tagList", "tag", "website", "userInfo"]), |
| | | ...mapState({ |
| | | showTag: state => state.common.showTag |
| | | }), |
| | |
| | | <template> |
| | | <div class="top-menu"> |
| | | <el-menu :default-active="activeIndex" mode="horizontal" text-color="#333"> |
| | | <el-menu-item index="0" @click.native="openHome(homeItem)" key="0"> |
| | | <el-menu-item index="0" @click.native="openHome(homeItem)" key="0" v-if="!hideHome"> |
| | | <template slot="title"> |
| | | <i |
| | | style="font-size: 20px !important" |
| | |
| | | ...mapState({ |
| | | showMenu: (state) => state.dataL.showdataL, |
| | | }), |
| | | ...mapGetters(["tagCurrent", "menu"]), |
| | | ...mapGetters(["tagCurrent", "menu", "hideHome"]), |
| | | }, |
| | | methods: { |
| | | openHome(itemHome) { |
| | |
| | | }, |
| | | component: () => |
| | | import ( /* webpackChunkName: "views" */ '@/views/wel/home') |
| | | }, { |
| | | path: 'dashboard', |
| | | name: '控制台', |
| | | meta: { |
| | | i18n: 'dashboard', |
| | | menu: false, |
| | | }, |
| | | component: () => |
| | | import( /* webpackChunkName: "views" */ '@/views/article/article') |
| | | }] |
| | | }, |
| | | |
| | |
| | | { |
| | | path: '/test', |
| | | component: Layout, |
| | | kby:true, |
| | | redirect: '/test/index', |
| | | children: [{ |
| | | path: 'index', |
| | |
| | | }, { |
| | | path: '/article', |
| | | component: Layout, |
| | | peixun: true, |
| | | redirect: '/article/index', |
| | | children: [{ |
| | | path: 'index', |
| | |
| | | roles: state => state.user.roles, |
| | | permission: state => state.user.permission, |
| | | menu: state => state.user.menu, |
| | | hideHome: state => state.user.hideHome, |
| | | menuId: state => state.user.menuId, |
| | | menuAll: state => state.user.menuAll, |
| | | logsList: state => state.logs.logsList, |
| | |
| | | menuAll: getStore({name: 'menuAll'}) || [], |
| | | token: getStore({name: 'token'}) || '', |
| | | refreshToken: getStore({name: 'refreshToken'}) || '', |
| | | hideHome: false, |
| | | }, |
| | | actions: { |
| | | //根据用户名登录 |
| | |
| | | }, |
| | | }, |
| | | mutations: { |
| | | set_hideHome: (state, val) => { |
| | | state.hideHome = val; |
| | | }, |
| | | SET_TOKEN: (state, token) => { |
| | | setToken(token); |
| | | state.token = token; |
| | |
| | | { |
| | | label: "发布时间", |
| | | prop: "createTime", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | type: "date", |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | |
| | | <template> |
| | | <div> |
| | | <basic-container>测试页</basic-container> |
| | | <basic-container></basic-container> |
| | | </div> |
| | | </template> |
| | | |