doum
2 天以前 fe29cab3d9bf8ddfeb1bc93a25a79c20276d8171
admin/src/components/common/CommonHeader.vue
@@ -2,7 +2,7 @@
  <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>
@@ -81,7 +81,7 @@
<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',
@@ -128,13 +128,13 @@
    }
  },
  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 不需要
@@ -155,13 +155,23 @@
    }
  },
  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) {
@@ -181,11 +191,11 @@
        // } 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 {
@@ -193,11 +203,11 @@
        }
      }
    },
    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) {
@@ -208,7 +218,7 @@
    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)