| | |
| | | <div class="common-header"> |
| | | <div class="header"> |
| | | <div class="logo"> |
| | | <div class="title"> <img src="@/assets/system.png" alt="" />{{ title }}</div> |
| | | <div class="title"> <img src="@/assets/system.png" alt="" />{{sysConfig.subtitle || title }}</div> |
| | | <div class="list"> |
| | | <div :class="index==currentIndex?'item active':'item'" v-for="(item,index) in topMenuList.list" :key="item.id" @click="getHeaderNav(item,index)" :index="index">{{item.label}} |
| | | <div v-if="index==currentIndex" class="linellae"></div> |
| | |
| | | <script> |
| | | import { mapState, mapMutations } from 'vuex' |
| | | import GlobalAlertWindow from './GlobalAlertWindow' |
| | | import { logout, updatePwd } from '@/api/system/common' |
| | | import { getSystemConfig, logout, updatePwd } from '@/api/system/common' |
| | | import { getAppHeaderNav } from '@/api' |
| | | export default { |
| | | name: 'CommonHeader', |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(['menuData', 'userInfo', 'topMenuList', 'currentIndex']) |
| | | ...mapState(['menuData', 'userInfo', 'topMenuList', 'currentIndex', 'sysConfig']) |
| | | // title () { |
| | | // return this.$route.meta.title |
| | | // } |
| | | }, |
| | | created () { |
| | | |
| | | this.getSystemConfig() |
| | | }, |
| | | mounted () { |
| | | // needChangePwd 0 : 默认密码需要修改,1 不需要 |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent', 'setCurrentIndex']), |
| | | ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent', 'setCurrentIndex', 'setSysconfig']), |
| | | // 修改密码 |
| | | changePwd () { |
| | | this.visible.changePwd = true |
| | | this.$nextTick(() => { |
| | | this.$refs.changePwdDataForm.resetFields() |
| | | }) |
| | | }, |
| | | getSystemConfig () { |
| | | if (!this.sysConfig.subTitle) { |
| | | getSystemConfig() |
| | | .then((res) => { |
| | | if (res && res.subtitle) { |
| | | this.setSysconfig(res) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | validatePassword (rule, value, callback) { |
| | | if (!value) { |
| | |
| | | // } else { |
| | | // callback() // 验证通过 |
| | | // } |
| | | let typeCount = 0; |
| | | if (/[a-z]/.test(value)) typeCount++; // 小写字母 |
| | | if (/[A-Z]/.test(value)) typeCount++; // 大写字母 |
| | | if (/\d/.test(value)) typeCount++; // 数字 |
| | | if (/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(value)) typeCount++; // 特殊字符 |
| | | let typeCount = 0 |
| | | if (/[a-z]/.test(value)) typeCount++ // 小写字母 |
| | | if (/[A-Z]/.test(value)) typeCount++ // 大写字母 |
| | | if (/\d/.test(value)) typeCount++ // 数字 |
| | | if (/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(value)) typeCount++ // 特殊字符 |
| | | if (typeCount >= 3) { |
| | | callback() |
| | | } else { |
| | |
| | | } |
| | | } |
| | | }, |
| | | getHeaderNav (item,index) { |
| | | getHeaderNav (item, index) { |
| | | this.setCurrentIndex(index) |
| | | if(item.linkType === 0){ |
| | | if (item.linkType === 0) { |
| | | this.setTopMenuCurrent(item) |
| | | }else{ |
| | | } else { |
| | | if (item.url && item.url === 'goHKAF' && item.params != null) { |
| | | this.getHKAFHeaderNav(item.params, item.label) |
| | | } else if (item.url && item.url.indexOf('http') === 0) { |
| | |
| | | getHKAFHeaderNav (type, label) { |
| | | getAppHeaderNav(type).then(res => { |
| | | if (label === '安防中心') { |
| | | let openWindow = window.open(res, '_blank') |
| | | const openWindow = window.open(res, '_blank') |
| | | // setTimeout(() => { |
| | | // openWindow.close() |
| | | // }, 7 * 1000) |