doum
2 天以前 6cd0ea41c86553463a78a2145cc395ca43798b3d
admin/src/components/common/CommonHeader.vue
@@ -2,7 +2,7 @@
  <div class="common-header">
    <div class="header">
      <div class="logo">
        <div class="title">{{ title }}</div>
        <div class="title"> <img src="@/assets/system.png" alt="" />{{ 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>
@@ -66,7 +66,6 @@
    return {
      title: process.env.VUE_APP_TITLE,
      headerNavData: {},
      currentIndex: 0,
      visible: {
        // 修改密码
        changePwd: false
@@ -99,7 +98,7 @@
    }
  },
  computed: {
    ...mapState(['menuData', 'userInfo', 'topMenuList'])
    ...mapState(['menuData', 'userInfo', 'topMenuList', 'currentIndex'])
    // title () {
    //   return this.$route.meta.title
    // }
@@ -126,7 +125,7 @@
    }
  },
  methods: {
    ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent']),
    ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent', 'setCurrentIndex']),
    // 修改密码
    changePwd () {
      this.visible.changePwd = true
@@ -165,20 +164,27 @@
      }
    },
    getHeaderNav (item,index) {
      this.currentIndex = index
      this.setCurrentIndex(index)
      if(item.linkType === 0){
        this.setTopMenuCurrent(item)
      }else{
        if (item.url && item.url === 'goHKAF' && item.params != null) {
          this.getHKAFHeaderNav(item.params)
          this.getHKAFHeaderNav(item.params, item.label)
        } else if (item.url && item.url.indexOf('http') === 0) {
          window.open(item.url, '_blank')
        }
      }
    },
    getHKAFHeaderNav (type) {
    getHKAFHeaderNav (type, label) {
      getAppHeaderNav(type).then(res => {
        window.open(res, '_blank')
        if (label === '安防中心') {
          let openWindow = window.open(res, '_blank')
          setTimeout(() => {
            openWindow.close()
          }, 7 * 1000)
        } else {
          window.open(res, '_blank')
        }
      })
    },
    handleTest () {
@@ -264,8 +270,9 @@
          newPwd: this.changePwdData.form.newPwd
        })
          .then(() => {
            console.log('修改成功')
            this.$tip.apiSuccess('修改成功')
            this.$store.commit('setUserInfo', { needChangePwd: 1 })
            // this.$store.commit('setUserInfo', { needChangePwd: 1 })
            this.visible.changePwd = false
          })
          .catch(e => {
@@ -342,7 +349,7 @@
    box-sizing: border-box;
    min-width: 360px;
    height: 56px;
    padding: 10px 30px;
    padding: 10px 20px;
    // flex-shrink: 0;
    line-height: 36px;
    font-size: 22px;
@@ -352,8 +359,18 @@
    align-items: center;
    .title {
      display: flex;
      color: rgb(255, 255, 255);
      font-size: 18px;
      width: 320px;
      font-weight: 700;
      font-family: "Microsoft Yahei", "sans-serif", "segoe UI", "PingFang SC", arial, Helvetica;
      //font-size: 18px;
      //width: 320px;
      img{
        width:auto ;
        height: 32px;
        margin-right: 5px;
      }
    }
    // display: inline;