|  |  |  | 
|---|
|  |  |  | <div class="logo"> | 
|---|
|  |  |  | <div class="title">{{ title }}</div> | 
|---|
|  |  |  | <div class="list"> | 
|---|
|  |  |  | <div class="item active"> | 
|---|
|  |  |  | <div>服务中心</div> | 
|---|
|  |  |  | <div class="linellae"></div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div  class="item" v-for="(item,index) in topMenuList.list" :key="item.id"  @click="getHeaderNav(item)" :index="index">{{item.label}}</div> | 
|---|
|  |  |  | <!--          <div class="item" @click="getHeaderNav('0')">安防中心</div> | 
|---|
|  |  |  | <div class="item" @click="getHeaderNav('1')">消控中心</div> | 
|---|
|  |  |  | <div class="item" @click="getHeaderNav('2')">能管中心</div> | 
|---|
|  |  |  | <div class="item" @click="getHeaderNav('7')">后勤中心</div> | 
|---|
|  |  |  | <div class="item" @click="getHeaderNav('3')">驾驶舱</div>--> | 
|---|
|  |  |  | <!-- <div class="item" @click="handleTest">测试</div> --> | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!-- <div class="title-en">Diagnosis of Intelligent Manufacturing Integrated Service Platfrom</div> --> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="user"> | 
|---|
|  |  |  | <el-dropdown v-if="isLogined" trigger="click"> | 
|---|
|  |  |  | 
|---|
|  |  |  | show-password></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="新密码" prop="newPwd" required> | 
|---|
|  |  |  | <el-input v-model="changePwdData.form.newPwd" type="password" placeholder="请输入新密码,密码需包含字母、数字及特殊字符中的至少两种" | 
|---|
|  |  |  | <el-input v-model="changePwdData.form.newPwd" type="password" placeholder="请输入新密码,至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数" | 
|---|
|  |  |  | maxlength="20" show-password></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <!-- <div style="font-size: 12px;color:#999999">密码需包含字母、数字及特殊字符中的至少两种</div> --> | 
|---|
|  |  |  | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: process.env.VUE_APP_TITLE, | 
|---|
|  |  |  | headerNavData: {}, | 
|---|
|  |  |  | currentIndex: 0, | 
|---|
|  |  |  | visible: { | 
|---|
|  |  |  | // 修改密码 | 
|---|
|  |  |  | changePwd: false | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo']), | 
|---|
|  |  |  | ...mapMutations(['setUserInfo', 'switchCollapseMenu', 'clearUserInfo', 'setTopMenuCurrent']), | 
|---|
|  |  |  | // 修改密码 | 
|---|
|  |  |  | changePwd () { | 
|---|
|  |  |  | this.visible.changePwd = true | 
|---|
|  |  |  | 
|---|
|  |  |  | if (!value) { | 
|---|
|  |  |  | callback(new Error('请输入密码')) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | const lengthValid = /^.{6,20}$/.test(value) | 
|---|
|  |  |  | const hasLetter = /[a-zA-Z]/.test(value) | 
|---|
|  |  |  | const hasNumber = /[0-9]/.test(value) | 
|---|
|  |  |  | const hasSpecial = /[!@#$%^&*(),.?":{}|<>]/.test(value) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const typesCount = [hasLetter, hasNumber, hasSpecial].filter(Boolean).length | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!lengthValid) { | 
|---|
|  |  |  | callback(new Error('密码长度需为6到20个字符')) | 
|---|
|  |  |  | } else if (typesCount < 2) { | 
|---|
|  |  |  | callback(new Error('密码需包含字母、数字及特殊字符中的至少两种')) | 
|---|
|  |  |  | // const lengthValid = /^.{6,20}$/.test(value) | 
|---|
|  |  |  | // const hasLetter = /[a-zA-Z]/.test(value) | 
|---|
|  |  |  | // const hasNumber = /[0-9]/.test(value) | 
|---|
|  |  |  | // const hasSpecial = /[!@#$%^&*(),.?":{}|<>]/.test(value) | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // const typesCount = [hasLetter, hasNumber, hasSpecial].filter(Boolean).length | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // if (!lengthValid) { | 
|---|
|  |  |  | //   callback(new Error('密码长度需为6到20个字符')) | 
|---|
|  |  |  | // } else if (typesCount < 2) { | 
|---|
|  |  |  | //   callback(new Error('密码需包含字母、数字及特殊字符中的至少两种')) | 
|---|
|  |  |  | // } 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++; // 特殊字符 | 
|---|
|  |  |  | if (typeCount >= 3) { | 
|---|
|  |  |  | callback() | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | callback() // 验证通过 | 
|---|
|  |  |  | callback(new Error('至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数')) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getHeaderNav (item) { | 
|---|
|  |  |  | if (item.url && item.url === 'goHKAF' && item.params != null) { | 
|---|
|  |  |  | this.getHKAFHeaderNav(item.params) | 
|---|
|  |  |  | } else if (item.url && item.url.indexOf('http') === 0) { | 
|---|
|  |  |  | window.open(item.url, '_blank') | 
|---|
|  |  |  | getHeaderNav (item,index) { | 
|---|
|  |  |  | this.currentIndex = index | 
|---|
|  |  |  | if(item.linkType === 0){ | 
|---|
|  |  |  | this.setTopMenuCurrent(item) | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | if (item.url && item.url === 'goHKAF' && item.params != null) { | 
|---|
|  |  |  | this.getHKAFHeaderNav(item.params) | 
|---|
|  |  |  | } else if (item.url && item.url.indexOf('http') === 0) { | 
|---|
|  |  |  | window.open(item.url, '_blank') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getHKAFHeaderNav (type) { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .list { | 
|---|
|  |  |  | flex: 1; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | margin-left: 60px; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .item { | 
|---|
|  |  |  | margin-right: 40px; | 
|---|
|  |  |  | font-size: 16px; | 
|---|
|  |  |  | font-weight: 400; | 
|---|
|  |  |  | margin-top: 10px; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | flex-direction: column; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | justify-content: flex-start; | 
|---|
|  |  |  | height: 40px; | 
|---|
|  |  |  | cursor: pointer; | 
|---|
|  |  |  | .item { | 
|---|
|  |  |  | margin-right: 40px; | 
|---|
|  |  |  | font-size: 16px; | 
|---|
|  |  |  | font-weight: 400; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | flex-direction: column; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | justify-content: flex-start; | 
|---|
|  |  |  | height: 40px; | 
|---|
|  |  |  | cursor: pointer; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .linellae { | 
|---|
|  |  |  | width: 64px; | 
|---|
|  |  |  | height: 2px; | 
|---|
|  |  |  | background: #FFFFFF; | 
|---|
|  |  |  | .linellae { | 
|---|
|  |  |  | width: 64px; | 
|---|
|  |  |  | height: 2px; | 
|---|
|  |  |  | background: #FFFFFF; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .active { | 
|---|
|  |  |  | font-weight: 500; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .active { | 
|---|
|  |  |  | font-weight: 500; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .header { | 
|---|
|  |  |  | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .title { | 
|---|
|  |  |  | width: 240px; | 
|---|
|  |  |  | font-size: 18px; | 
|---|
|  |  |  | width: 320px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // display: inline; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .user { | 
|---|
|  |  |  | width: 212px; | 
|---|
|  |  |  | width: 152px; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|
|  |  |  | height: 56px; | 
|---|
|  |  |  | padding-right: 25px; | 
|---|