| | |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'User_infAction!updatePassword', |
| | | data: "uif.USnId="+ JSON.stringify(AES.encrypt(pwd)), |
| | | data: "uif.USnId="+ encodeURIComponent(AES.encrypt(pwd)), |
| | | }); |
| | | }, |
| | | updateUserPwd2(name, oldPwd, newPwd) { |
| | |
| | | UName: name, |
| | | Upassword: md5(oldPwd), |
| | | UNote: md5(newPwd), |
| | | USnId: AES.encrypt(newPwd), |
| | | USnId: encodeURIComponent(AES.encrypt(newPwd)), |
| | | }), |
| | | }); |
| | | }, |
| | |
| | | * @return {[Promise]} 查询结果 |
| | | */ |
| | | add(data) { |
| | | data.USnId = encodeURIComponent(data.USnId); |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'User_infAction!add', |
| | |
| | | messageCode: { |
| | | label: '短信验证码', |
| | | des: '登录是否启用短信验证码', |
| | | value: false, |
| | | value: true, |
| | | }, |
| | | autoExit: { |
| | | label: "自动退出", |
| | | des: "长时间不操作自动退出", |
| | | value: false |
| | | value: true |
| | | }, |
| | | }; |
| | |
| | | }, |
| | | pwd(rule, value, callback) { |
| | | if (!value) { |
| | | return callback(new Error('用户名不能为空')); |
| | | return callback(new Error('密码不能为空')); |
| | | } |
| | | let pattern = /(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^[^\s\u4e00-\u9fa5]{6,20}$/; |
| | | let pattern = /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\\W_!@#$%^&*`~()-+=]+$)(?![0-9\\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\\W_!@#$%^&*`~()-+=]{8,30}$/; |
| | | if(!pattern.test(value)) { |
| | | return callback(new Error('6位以上密码,数字,字母,字符至少包含两种,不能包含中文和空格')); |
| | | return callback(new Error('长度至少8位,必须符合由数字,大写字母,小写字母,特殊符,至少其中三种组成密码')); |
| | | } |
| | | return callback(); |
| | | } |
| | |
| | | data() { |
| | | let name = this.name; |
| | | let validatePass = (rule, value, callback) => { |
| | | let pwdRegex = /(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^[^\s\u4e00-\u9fa5]{6,20}$/; |
| | | let pwdRegex = /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\\W_!@#$%^&*`~()-+=]+$)(?![0-9\\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\\W_!@#$%^&*`~()-+=]{8,30}$/;; |
| | | let isRepeat = value.indexOf(name); |
| | | if (pwdRegex.test(value)) { |
| | | callback(); |
| | | } else if(isRepeat != -1) { |
| | | callback(new Error("密码中存在用户名信息")); |
| | | } else { |
| | | callback(new Error('6位以上密码,数字,字母,字符至少包含两种,不能包含中文和空格')); |
| | | callback(new Error('长度至少8位,必须符合由数字,大写字母,小写字母,特殊符,至少其中三种组成密码')); |
| | | } |
| | | }; |
| | | return { |
| | |
| | | <div class="table-row"> |
| | | <div class="table-cell text-right w80">测试日期:</div> |
| | | <div class="table-cell"> |
| | | <el-cascader v-model="test_record.value" :options="test_record.list" size="small" |
| | | <el-cascader v-if="isAio" v-model="test_record1.value" :options="test_record1.list" size="small" |
| | | placeholder="请选择测试日期" style="width: 100%; min-width:16rem" |
| | | @change="testRecordChange"> |
| | | <template slot-scope="{ node, data }"> |
| | | <span>{{ data.label }}</span> |
| | | <span v-if="!node.isLeaf"> ({{data.children.length }})</span> |
| | | </template> |
| | | </el-cascader> |
| | | <el-cascader v-else v-model="test_record.value" :options="test_record.list" size="small" |
| | | placeholder="请选择测试日期" style="width: 100%; min-width:16rem" |
| | | @change="testRecordChange"> |
| | | <template slot-scope="{ node, data }"> |
| | |
| | | } |
| | | ] |
| | | }, |
| | | test_record1: { |
| | | value: [], |
| | | list: [ |
| | | { |
| | | value: 0, |
| | | label: "电池组1", |
| | | children: [ |
| | | { |
| | | value: "herongDischarge", |
| | | label: "核容放电", |
| | | children: [] |
| | | }, |
| | | { |
| | | value: "jianceDischarge", |
| | | label: "监测放电", |
| | | children: [] |
| | | }, |
| | | { |
| | | value: "herongCharge", |
| | | label: "核容充电", |
| | | children: [] |
| | | }, |
| | | { |
| | | value: "jianceCharge", |
| | | label: "监测充电", |
| | | children: [] |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 1, |
| | | label: "电池组2", |
| | | children: [ |
| | | { |
| | | value: "herongDischarge", |
| | | label: "核容放电", |
| | | children: [] |
| | | }, |
| | | { |
| | | value: "jianceDischarge", |
| | | label: "监测放电", |
| | | children: [] |
| | | }, |
| | | { |
| | | value: "herongCharge", |
| | | label: "核容充电", |
| | | children: [] |
| | | }, |
| | | { |
| | | value: "jianceCharge", |
| | | label: "监测充电", |
| | | children: [] |
| | | } |
| | | ] |
| | | }, |
| | | ] |
| | | }, |
| | | slider: 100, |
| | | testTimeLong: [], |
| | | battState: { |
| | |
| | | this.test_record.list[1].children = []; |
| | | this.test_record.list[2].children = []; |
| | | this.test_record.list[3].children = []; |
| | | |
| | | // 初始化A059充放电记录 |
| | | if(this.isAio) { |
| | | this.test_record1.value = []; |
| | | this.test_record1.list.map(item=>{ |
| | | item.children.map(item1=>{ |
| | | item1.children = []; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | // 初始化顶部文本框内容 |
| | | this.top = { |
| | | state: "", // 电池状态 |
| | |
| | | this.$layer.msg("未获取到充放电记录"); |
| | | } |
| | | // 充放电记录 |
| | | this.test_record.list[0].children = herongDischarge; |
| | | this.test_record.list[1].children = jianceDischarge; |
| | | this.test_record.list[2].children = herongCharge; |
| | | this.test_record.list[3].children = jianceCharge; |
| | | if(this.isAio) { |
| | | this.setAioTestRecord(herongDischarge, 0); |
| | | this.setAioTestRecord(jianceDischarge, 1); |
| | | this.setAioTestRecord(herongCharge, 2); |
| | | this.setAioTestRecord(jianceCharge, 3); |
| | | }else { |
| | | this.setNormalTestRecord(herongDischarge, jianceDischarge, herongCharge, jianceCharge); |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | this.$layer.close(loading); |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | /** |
| | | * 设置普通类型充放电数据 |
| | | */ |
| | | setNormalTestRecord(herongDischarge, jianceDischarge, herongCharge, jianceCharge) { |
| | | this.test_record.list[0].children = herongDischarge; |
| | | this.test_record.list[1].children = jianceDischarge; |
| | | this.test_record.list[2].children = herongCharge; |
| | | this.test_record.list[3].children = jianceCharge; |
| | | }, |
| | | /** |
| | | * 设置A059充放电数据 |
| | | */ |
| | | setAioTestRecord(data, index) { |
| | | data.map(item=>{ |
| | | // 电池组1充放电数据 |
| | | if(item.upload_client_type == 1) { |
| | | this.test_record1.list[0].children[index].children.push(item); |
| | | }else { |
| | | this.test_record1.list[1].children[index].children.push(item); |
| | | } |
| | | }); |
| | | }, |
| | | // 切换测试信息 |
| | |
| | | // 获取测试的信息 |
| | | getTestRecord() { |
| | | let value = this.test_record.value; |
| | | // A059设备 |
| | | if(this.isAio) { |
| | | value = this.test_record1.value; |
| | | } |
| | | // 没有选择充放电记录,返回-1 |
| | | if (value.length == 0) { |
| | | return -1; |
| | |
| | | let type = value[0]; |
| | | let time = value[1]; |
| | | let list = this.test_record.list; |
| | | // A059设备 |
| | | if(this.isAio) { |
| | | value = this.test_record1.value; |
| | | let index = value[0]; |
| | | type = value[1]; |
| | | time = value[2]; |
| | | list = this.test_record1.list[index].children; |
| | | } |
| | | let result = 0; |
| | | // 遍历list |
| | | for (let i in list) { |
| | |
| | | return ""; |
| | | } |
| | | }, |
| | | isAio() { |
| | | // A059设备 |
| | | let batt = this.batt; |
| | | return regEquipType(batt.FBSDeviceId, ["aio"]); |
| | | } |
| | | }, |
| | | mounted() { |
| | | // 初始化图表 |
| | |
| | | if(rs.code == 1) { |
| | | sessionStorage.setItem("serverStamp", rs.data); |
| | | }else { |
| | | sessionStorage.setItem("serverStamp", new Date().getTime()); |
| | | sessionStorage.setItem("serverStamp", new Date().getTime()+""); |
| | | } |
| | | setTimeout(()=>{ |
| | | callback(); |
| | | }, 500); |
| | | |
| | | }).catch(error => { |
| | | sessionStorage.setItem("serverStamp", new Date().getTime()); |
| | | sessionStorage.setItem("serverStamp", new Date().getTime()+""); |
| | | callback(); |
| | | console.log(error); |
| | | }); |
| | |
| | | } |
| | | }); |
| | | |
| | | // console.log(AES.encrypt("huo1234567")); |
| | | // console.log(AES.decrypt("8tg9f0/tX7/EHYXqLWqvxA==")); |
| | | // console.log(AES.encrypt("sys_123456")); |
| | | // console.log(encodeURIComponent("B17jjjYoBkbfZChw/fHzcA==")); |
| | | // console.log(decodeURIComponent("B17jjjYoBkbfZChw%2FfHzcA%3D%3D")) |
| | | //console.log(AES.decrypt("5OUaEnC33sVNY+jeXlx3Qg==")); |
| | | // console.log(md5("a123456")); |
| | | // console.log(JSON.stringify("5OUaEnC33sVNY+jeXlx3Qg==")); |
| | | }, |