From ae2d855c89ca722ac7309fdf1aa6ceed370e3b95 Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期一, 11 十月 2021 20:22:30 +0800
Subject: [PATCH] 监控ui
---
src/pages/vindicate/views/sysInfo.vue | 168 +++++++++++++++++++++++++++++++++----------------------
1 files changed, 101 insertions(+), 67 deletions(-)
diff --git a/src/pages/vindicate/views/sysInfo.vue b/src/pages/vindicate/views/sysInfo.vue
index e8ff060..c4eb552 100644
--- a/src/pages/vindicate/views/sysInfo.vue
+++ b/src/pages/vindicate/views/sysInfo.vue
@@ -7,32 +7,42 @@
<div class="title">SmartAIOS</div>
<div class="desc">Copyright 漏 璐濇�濈鎶�鏈湁闄愬叕鍙�</div>
</div>
- <div class="bar">
+ <div class="bar" style="background-color: #F2F2F7;">
<div class="name">鐗堟湰锛�</div>
- <div class="desc">{{ verText }}</div>
+ <div class="desc">
+ {{
+ serializedNumber == "" ? "SmartAIOS璇曠敤鐗�" : "SmartAIOS姝e紡鐗�"
+ }}
+ </div>
</div>
<div class="bar">
<div class="name">婵�娲伙細</div>
<div class="right-zone">
- <el-button type="primary" size="small" @click="confirmAgain"
+ <el-button
+ type="primary"
+ size="small"
+ @click="confirmAgain"
+ v-if="serializedNumber != ''"
>瀵煎嚭浜у搧瀵嗛挜</el-button
>
- <div class="desc" style="color: rgba(71, 153, 247, 1)">
- {{ sn == "" ? "鏈縺娲�" : "宸叉縺娲�" }}
+ <div class="desc activation">
+ {{ serializedNumber == "" ? "鏈縺娲�" : "宸叉縺娲�" }}
</div>
</div>
</div>
<div class="bar">
- <div class="name">璇锋眰鐮侊細</div>
- <div class="desc" style="font-size: 12px">{{ q }}</div>
+ <div class="name" style="min-width: 65px;">璇锋眰鐮侊細</div>
+ <div class="desc code" style="font-size: 12px">{{ q }}</div>
</div>
<div class="bar">
<div class="name">浜у搧瀵嗛挜锛�</div>
- <div class="desc" style="font-size: 12px">{{ authorization }}</div>
+ <div class="desc" >
+ {{ authorization || "-" }}
+ </div>
</div>
<div class="bar">
<div class="name">鍒版湡鏃堕棿锛�</div>
- <div class="desc">{{ expireTime }}</div>
+ <div class="desc" style="font-size: 16px">{{ expireTime }}</div>
</div>
</div>
</div>
@@ -43,7 +53,6 @@
<span class="icon iconfont" style="color: orangered"></span>
浜у搧瀵嗛挜瀵煎嚭鍚庯紝绯荤粺澶ч儴鍒嗗姛鑳藉皢鏃犳硶浣跨敤锛岃纭鏄惁缁х画锛�
</div>
-
<div class="info">
濡傞渶缁х画锛岃杈撳叆绠$悊鍛樺瘑鐮侊紝骞跺鍏ヤ綘鎯宠婵�娲荤殑璁惧璇锋眰鐮侊紝鐒跺悗鐐瑰嚮鈥滅‘璁も�濄��
<span style="color: #8f949a; font-size: 14px"
@@ -56,7 +65,7 @@
size="small"
placeholder="璇疯緭鍏ョ鐞嗗憳瀵嗙爜"
v-model="password"
- style="padding-left: 50px; width: 360px"
+ style="padding-left: 50px; width: 460px"
></el-input>
</div>
<div class="validate">
@@ -64,23 +73,21 @@
<el-input
type="textarea"
autosize
- style="width: 360px"
- placeholder="灏嗕骇鍝佸瘑閽ョ矘璐村湪姝ゅ"
+ style="width: 460px"
+ placeholder="灏嗕綘鎯宠婵�娲荤殑璁惧璇锋眰鐮佺矘璐村湪姝ゅ"
v-model="secrectKey"
>
</el-input>
</form>
-
- <!-- <el-upload
- class="upload-demo"
- action
- :http-request="uploadKey"
- :limit="1"
- :show-file-list="false"
+ <el-button size="small" @click="txtbtn" type="primary"
+ >瀵煎叆鏂囦欢</el-button
>
- </el-upload> -->
- <el-button size="small" @click="txtbtn" type="primary">瀵煎叆鏂囦欢</el-button>
- <input type="file" @change="loadTextFromFile" id="txt" style="display:none"/>
+ <input
+ type="file"
+ @change="loadTextFromFile"
+ id="txt"
+ style="display: none"
+ />
</div>
<span slot="footer" class="dialog-footer">
@@ -95,52 +102,45 @@
import { getSN, cancelAuthorization } from "@/api/system";
export default {
mounted() {
- getSN().then((res) => {
- if (res.code == 200) {
- this.authorization = res.data.authorization;
- this.expireTime = res.data.expireTime;
- this.sn = res.data.sn;
- this.q = res.data.q;
- }
- });
+ this.refreshSn();
},
data() {
return {
authorization: "",
expireTime: "",
- sn: "",
+ serializedNumber: "",
secrectKey: "",
q: "",
- verText: "SmartAIOS姝e紡鐗�",
+ // verText: "SmartAIOS姝e紡鐗�",
activeState: "宸叉縺娲�",
password: "",
dialogVisible: false,
};
},
methods: {
+ refreshSn() {
+ getSN().then((res) => {
+ if (res.code == 200) {
+ this.authorization = res.data.authorization;
+ this.expireTime = res.data.expireTime;
+ this.serializedNumber = res.data.sn;
+ this.q = res.data.q;
+ debugger
+ }
+ });
+ },
confirmAgain() {
- // this.$confirm("鎮ㄦ槸鍚︾‘璁ょ珛鍗冲浠芥墍鏈夊簲鐢ㄧ殑閰嶇疆鏁版嵁锛�", "绔嬪嵆澶囦唤", {
- // confirmButtonText: "纭畾",
- // cancelButtonText: "鍙栨秷",
- // }).then(() => {
- // this.$message({
- // type: "success",
- // message: "澶囦唤鎴愬姛",
- // });
- // });
this.dialogVisible = true;
},
- txtbtn() {
+ txtbtn() {
document.getElementById("txt").click();
},
loadTextFromFile(e) {
const file = e.target.files[0];
var reader = new FileReader(); //new涓�涓狥ileReader瀹炰緥
- let that = this
+ let that = this;
reader.onload = function () {
- debugger
- that.secrectKey = this.result.trim()
- console.log(this.result);
+ that.secrectKey = this.result.trim();
};
reader.readAsText(file);
},
@@ -156,25 +156,44 @@
passwd: this.password,
down: 1,
}).then((res) => {
- debugger;
+ if (res.type=="application/json") {
+ var reader = new FileReader();
+ reader.readAsText(res,"utf-8");
+ let that = this
+ reader.onload = function () {
+ var receive_data = JSON.parse(this.result); //杩欎釜灏辨槸瑙f瀽鍑烘潵鐨勬暟鎹�
+ that.$notify.error(receive_data.msg);
+ };
+ return;
+ }
let url = window.URL.createObjectURL(
- new Blob([res], {
- type: "text/plain",
- })
+ new Blob([res], { type: "text/plain" })
);
let a = document.createElement("a");
a.href = url;
a.download = "key.txt";
a.click();
window.URL.revokeObjectURL(url);
+ debugger
+ this.refreshSn();
+ window.parent.postMessage({ msg: "checkSN" }, "*");
+ this.$notify.success("瀵煎嚭鎴愬姛");
+ this.dialogVisible = false;
});
},
},
};
</script>
<style lang="scss">
+div{
+ color: #333;
+}
+
.v-sys-info {
width: 100%;
+ background-color: #FBFAFF;
+ border-top:2px solid #E1E0E6 ;
+ border-left:2px solid #E1E0E6 ;
.el-dialog__header {
padding: 15px 20px 10px;
text-align: left;
@@ -243,7 +262,7 @@
overflow: auto;
box-sizing: border-box;
position: relative;
- padding: 20px 40px;
+ padding: 10px 15px 0 10px;
.el-form-item.is-required:not(.is-no-asterisk)
> .el-form-item__label:before,
.el-form-item.is-required:not(.is-no-asterisk)
@@ -277,28 +296,30 @@
}
.auto {
.title-bg {
- background-color: #f8f8f8;
- height: 150px;
- border-radius: 12px;
- margin-bottom: 20px;
+ background-color: #fff;
+ height: 110px;
+ border-radius: 8px;
+ margin-bottom: 10px;
display: flex;
flex-direction: column;
justify-content: center;
.title {
- font-size: 34px;
- font-weight: 600;
- line-height: 50px;
+ font-size: 24px;
+ font-weight: 700;
+ line-height: 33.6px;
}
.desc {
- font-size: 16px;
- line-height: 30px;
+ margin-top:10px ;
+ font-size: 12px;
+ line-height: 16.8px;
+ font-weight: 700;
}
}
.bar {
display: flex;
align-items: center;
- padding: 12px 25px;
- background-color: #f8f8f8;
+ padding: 12px 40px;
+ background-color: #fff;
justify-content: space-between;
border-radius: 12px;
margin-bottom: 10px;
@@ -307,14 +328,16 @@
align-items: center;
}
.name {
- font-size: 15px;
+ font-size: 16px;
+ font-weight: 700;
text-align: left;
min-width: 180px;
}
.desc {
- font-size: 15px;
- margin-left: 20px;
- max-width: 600px;
+ font-size: 16px;
+ font-weight: 700;
+ margin-left: 30px;
+ max-width: 568px;
/* overflow: hidden; */
/* text-overflow: ellipsis; */
/* white-space: nowrap; */
@@ -322,6 +345,17 @@
word-wrap: break-word;
text-align: left;
}
+ .activation{
+ width: 90px;
+ height: 28px;
+ background: rgba(78,148,255,0.1);
+ border: 1px solid #4E94FF;
+ border-radius:20px ;
+ text-align: center;
+ line-height: 28px;
+ color: #333;
+ font-size: 14px;
+ }
.el-input {
width: 100%;
.el-input {
--
Gitblit v1.8.0