doum
7 天以前 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>
@@ -21,14 +21,14 @@
              </div>
          </div>
          <div class="user-images">
              <img src="@/assets/icons/ic_1.jpg" alt="">
              <img src="@/assets/icons/ic_2.png" alt="">
<!--              <img src="@/assets/icons/ic_1.jpg" alt="">-->
<!--              <img src="@/assets/icons/ic_2.png" alt="">-->
              <img src="@/assets/icons/ic_3.jpg" alt="">
              <img src="@/assets/icons/ic_4.jpg" alt="">
              <img src="@/assets/icons/ic_5.jpg" alt="">
              <img src="@/assets/icons/ic_6.jpg" alt="">
<!--              <img src="@/assets/icons/ic_6.jpg" alt="">-->
              <img src="@/assets/icons/ic_7.jpg" alt="">
              <img src="@/assets/icons/ic_8.jpg" alt="">
<!--              <img src="@/assets/icons/ic_8.jpg" alt="">-->
          </div>
          <el-dropdown v-if="isLogined" trigger="click">
            <span class="el-dropdown-link" style="cursor: pointer; color: rgba(255,255,255,.56);">
@@ -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,10 +218,10 @@
    getHKAFHeaderNav (type, label) {
      getAppHeaderNav(type).then(res => {
        if (label === '安防中心') {
          let openWindow = window.open(res, '_blank')
          setTimeout(() => {
            openWindow.close()
          }, 7 * 1000)
          const openWindow = window.open(res, '_blank')
          // setTimeout(() => {
          //   openWindow.close()
          // }, 7 * 1000)
        } else {
          window.open(res, '_blank')
        }
@@ -334,7 +344,7 @@
@import "@/assets/style/variables.scss";
.common-header {
  background-color: #2080f7;
  background-color: #1E7FFF;
}
.list {
@@ -344,14 +354,14 @@
    display: flex;
    align-items: center;
    .item {
      margin-right: 40px;
      margin-right: 24px;
      font-size: 16px;
      font-weight: 400;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      height: 40px;
      height: 49px;
      cursor: pointer;
      .linellae {
@@ -379,7 +389,7 @@
    box-sizing: border-box;
    min-width: 360px;
    height: 56px;
    padding: 10px 20px;
    padding: 10px 12px;
    // flex-shrink: 0;
    line-height: 36px;
    font-size: 22px;
@@ -484,9 +494,9 @@
        align-items: center;
        img {
            top: 0 !important;
            width: 24px;
            height: 24px;
            margin-right: 15px;
            width: 18px;
            height: 18px;
            margin-right: 12px;
        }
    }
    .el-dropdown {