fix: 监控大屏 行政区划 查询条件 改 id

This commit is contained in:
nieli 2023-01-16 17:32:31 +08:00
parent b680f1b817
commit 15d172fbee
4 changed files with 41 additions and 3 deletions

View File

@ -42,6 +42,7 @@
"clipboard": "2.0.6",
"core-js": "3.8.1",
"cron-parser": "^3.3.0",
"crypto-js": "^4.1.1",
"debounce": "^1.2.1",
"echarts": "^5.3.3",
"element-ui": "2.14.1",

32
src/utils/ace.js Normal file
View File

@ -0,0 +1,32 @@
import CryptoJS from 'crypto-js';
export default {
//随机生成指定数量的16进制key
generatekey(num) {
let library = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
let key = "";
for (var i = 0; i < num; i++) {
let randomPoz = Math.floor(Math.random() * library.length);
key += library.substring(randomPoz, randomPoz + 1);
}
return key;
},
//加密
encrypt(word, keyStr) {
keyStr = keyStr ? keyStr : 'abcdsxyzhkj12345'; //判断是否存在ksy不存在就用定义好的key
var key = CryptoJS.enc.Utf8.parse(keyStr);
var srcs = CryptoJS.enc.Utf8.parse(word);
console.log('cryptoJS:', CryptoJS);
var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.NoPadding });
return encrypted.toString();
},
//解密
decrypt(word, keyStr) {
keyStr = keyStr ? keyStr : 'abcdsxyzhkj12345';
var key = CryptoJS.enc.Utf8.parse(keyStr);
var decrypt = CryptoJS.AES.decrypt(word, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 });
return CryptoJS.enc.Utf8.stringify(decrypt).toString();
}
}

View File

@ -171,7 +171,7 @@ export default {
projectList: [],
projectId: null,
regionalismId: null,
regionalismLabel: "",
regionalismId: "",
fullscreen: false,
thisScrollTopY: 0,
userLoginType: "",
@ -324,7 +324,7 @@ export default {
},
eventRegionalism(data) {
// this.regionalismId = data;
this.regionalismLabel = data.label;
this.regionalismId = data.id;
this.getProjectList();
},
resize_window() {
@ -351,7 +351,7 @@ export default {
if (this.$store.getters.userType !== "PERSONAL") {
bigScreenProjectList({
// regionalismId: this.regionalismId,
projectAddress: this.regionalismLabel,
regionalismId: this.regionalismId,
}).then((response) => {
this.projectList = response.data;
});

View File

@ -2926,6 +2926,11 @@ crypto-browserify@^3.11.0:
randombytes "^2.0.0"
randomfill "^1.0.3"
crypto-js@^4.1.1:
version "4.1.1"
resolved "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf"
integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==
css-color-names@0.0.4, css-color-names@^0.0.4:
version "0.0.4"
resolved "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz"