| | |
| | | <content-box |
| | | :title-left=true> |
| | | <div class="whyc-breadcrumb" slot="title">当前位置:首页 > 站点查询</div> |
| | | <five-sides-line></five-sides-line> |
| | | <right-triangle></right-triangle> |
| | | <router-view></router-view> |
| | | </content-box> |
| | | </div> |
| | | </div> |
| | |
| | | import PageNav from './components/PageNav' |
| | | import ContentBox from './components/ContentBox' |
| | | import MyTree from './components/tree/Index' |
| | | import FiveSidesLine from './components/FiveSidesLine' |
| | | import RightTriangle from './components/RightTriangle' |
| | | |
| | | export default { |
| | | name: 'App', |
| | |
| | | PageNav, |
| | | ContentBox, |
| | | MyTree, |
| | | FiveSidesLine, |
| | | RightTriangle |
| | | }, |
| | | methods: { |
| | | treeClick: function(res) { |
| | |
| | | <ul> |
| | | <li |
| | | v-for="(nav, key) in navs" :key="key" |
| | | :class="{'active-nav': nav.active}" |
| | | :class="{'active-nav': checkName(nav.name)}" |
| | | @click="navClick(nav)"> |
| | | <a href="javascript:;">{{nav.txt}}</a> |
| | | <router-link :to="nav.router">{{nav.txt}}</router-link> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | |
| | | navs: [ |
| | | { |
| | | txt: '首页', |
| | | active: false |
| | | name: 'PagesHome', |
| | | router: '/' |
| | | }, |
| | | { |
| | | txt: '动环监控中心', |
| | | active: false |
| | | router: '' |
| | | }, |
| | | { |
| | | txt: '动力设备监控', |
| | | active: true |
| | | name: 'PagesEquipmentMonitor', |
| | | router: '/equipment-monitor' |
| | | }, |
| | | { |
| | | txt: '环境设备监控', |
| | | active: false |
| | | router: '' |
| | | }, |
| | | { |
| | | txt: '安防设备监控', |
| | | active: false |
| | | router: '' |
| | | }, |
| | | { |
| | | txt: '报警管理', |
| | | active: false |
| | | router: '' |
| | | }, |
| | | { |
| | | txt: '统计分析', |
| | | active: false |
| | | router: '' |
| | | }, |
| | | { |
| | | txt: '系统管理', |
| | | active: false |
| | | router: '', |
| | | } |
| | | ], |
| | | } |
| | |
| | | this.navs[i].active = true; |
| | | } |
| | | } |
| | | |
| | | }, |
| | | checkName: function(name) { |
| | | if(name) { |
| | | var navName = this.$store.state.navName; |
| | | return navName.indexOf(name) == -1?false:true; |
| | | } |
| | | return false; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | htmlDom.style.fontSize = `${htmlWidth / 7.5}px`; |
| | | }; |
| | | |
| | | // 进入路由前 |
| | | router.beforeEach((to, from, next) => { |
| | | var name = to.name; |
| | | // 修改主导航的激活状态 |
| | | store.dispatch('changeNavName', name); |
| | | next(); |
| | | }); |
| | | |
| | | window.onresize = setHtmlFontSize; |
| | | |
| | | setHtmlFontSize(); |
New file |
| | |
| | | <template> |
| | | <div class="equipment-monitor-index"> |
| | | 动力设备监控 |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | |
| | | |
New file |
| | |
| | | <template> |
| | | <div class="pages-index"> |
| | | {{msg}} |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'PagesIndex', |
| | | data() { |
| | | return { |
| | | msg: '首页内容' |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | export default [] |
| | | export default [ |
| | | { |
| | | path: '', |
| | | name: 'PagesHome', |
| | | meta: { |
| | | title: '首页 > 站点查询' |
| | | }, |
| | | component: (resolve)=>require(['@/pages/home/index.vue'], resolve) |
| | | }, |
| | | { |
| | | path: '/equipment-monitor', |
| | | name: 'PagesEquipmentMonitor', |
| | | meta: { |
| | | title: '动力设备监控' |
| | | }, |
| | | component: (resolve)=>require(['@/pages/equipment-monitor/index.vue'], resolve) |
| | | }, |
| | | ] |
| | |
| | | export default { |
| | | |
| | | // 修改主导航激活状态 |
| | | changeNavName: function(context, name) { |
| | | context.commit('changeNavName', name); |
| | | } |
| | | } |
| | |
| | | export default { |
| | | |
| | | // 修改主导航激活状态 |
| | | changeNavName: function(state, name) { |
| | | state.navName = name; |
| | | } |
| | | } |
| | |
| | | export default { |
| | | |
| | | navName: 'PagesHome' |
| | | } |