<template>
|
<div class="v-sys-info">
|
<div class="sys-content">
|
<div class="sys-right">
|
<div class="auto">
|
<div class="title-bg">
|
<div class="title">SmartAIOS</div>
|
<div class="desc">Copyright © 贝思科技术有限公司</div>
|
</div>
|
<div class="bar" style="background-color: #F2F2F7;">
|
<div class="name">版本:</div>
|
<div class="desc">
|
{{
|
serializedNumber == "" ? "SmartAIOS试用版" : "SmartAIOS正式版"
|
}}
|
</div>
|
</div>
|
<div class="bar">
|
<div class="name">激活:</div>
|
<div class="right-zone">
|
<el-button
|
type="primary"
|
size="small"
|
@click="confirmAgain"
|
v-if="serializedNumber != ''"
|
>导出产品密钥</el-button
|
>
|
<div class="desc activation">
|
{{ serializedNumber == "" ? "未激活" : "已激活" }}
|
</div>
|
</div>
|
</div>
|
<div class="bar">
|
<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" >
|
{{ authorization || "-" }}
|
</div>
|
</div>
|
<div class="bar">
|
<div class="name">到期时间:</div>
|
<div class="desc" style="font-size: 16px">{{ expireTime }}</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<el-dialog title="再次确认" :visible.sync="dialogVisible">
|
<div class="ver">
|
<span class="icon iconfont" style="color: orangered"></span>
|
产品密钥导出后,系统大部分功能将无法使用,请确认是否继续?
|
</div>
|
<div class="info">
|
如需继续,请输入管理员密码,并导入你想要激活的设备请求码,然后点击“确认”。
|
<span style="color: #8f949a; font-size: 14px"
|
>设备请求码获取方式:如系统已激活,在激活页面导出即可;如设备未激活,在SmartAI激活页面扫码获取。</span
|
>
|
</div>
|
<!-- -->
|
<div class="pw">
|
<el-input
|
size="small"
|
placeholder="请输入管理员密码"
|
v-model="password"
|
style="padding-left: 50px; width: 460px"
|
></el-input>
|
</div>
|
<div class="validate">
|
<form id="myForm">
|
<el-input
|
type="textarea"
|
autosize
|
style="width: 460px"
|
placeholder="将你想要激活的设备请求码粘贴在此处"
|
v-model="secrectKey"
|
>
|
</el-input>
|
</form>
|
<el-button size="small" @click="txtbtn" type="primary"
|
>导入文件</el-button
|
>
|
<input
|
type="file"
|
@change="loadTextFromFile"
|
id="txt"
|
style="display: none"
|
/>
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button type="primary" @click="confirmCancel">确定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { getSN, cancelAuthorization } from "@/api/system";
|
export default {
|
mounted() {
|
this.refreshSn();
|
},
|
data() {
|
return {
|
authorization: "",
|
expireTime: "",
|
serializedNumber: "",
|
secrectKey: "",
|
q: "",
|
// verText: "SmartAIOS正式版",
|
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.dialogVisible = true;
|
},
|
txtbtn() {
|
document.getElementById("txt").click();
|
},
|
loadTextFromFile(e) {
|
const file = e.target.files[0];
|
var reader = new FileReader(); //new一个FileReader实例
|
let that = this;
|
reader.onload = function () {
|
that.secrectKey = this.result.trim();
|
};
|
reader.readAsText(file);
|
},
|
confirmCancel() {
|
this.secrectKey = this.secrectKey.trim();
|
this.password = this.password.trim();
|
if (this.secrectKey == "" || this.password == "") {
|
this.$message.warning("请先填写密码和请求码");
|
return;
|
}
|
cancelAuthorization({
|
q: this.secrectKey,
|
passwd: this.password,
|
down: 1,
|
}).then((res) => {
|
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); //这个就是解析出来的数据
|
that.$notify.error(receive_data.msg);
|
};
|
return;
|
}
|
let url = window.URL.createObjectURL(
|
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: 4px solid #f2f2f7;
|
border-left: 4px solid #f2f2f7;
|
.el-dialog__header {
|
padding: 15px 20px 10px;
|
text-align: left;
|
font-weight: 600;
|
}
|
.el-dialog__body {
|
text-align: left;
|
padding: 0;
|
padding-bottom: 10px;
|
}
|
.el-divider--horizontal {
|
margin: 20px 0;
|
}
|
.validate {
|
padding: 0 50px;
|
display: flex;
|
align-items: baseline;
|
margin-top: 15px;
|
}
|
#myForm {
|
display: flex;
|
align-items: center;
|
margin-right: 10px;
|
.single-input {
|
margin: 0 8px;
|
width: 60px;
|
}
|
}
|
.ver {
|
margin-bottom: 10px;
|
background-color: rgba(242, 242, 242, 1);
|
font-size: 16px;
|
height: 60px;
|
padding-left: 50px;
|
line-height: 60px;
|
.ver-text {
|
font-weight: 600;
|
}
|
}
|
.info {
|
padding: 0 50px;
|
font-size: 15px;
|
line-height: 25px;
|
margin: 15px 0;
|
}
|
.qr-code-img {
|
width: 100px;
|
height: 100px;
|
}
|
.ask {
|
margin-top: 20px;
|
font-size: 15px;
|
}
|
}
|
|
.sys-content {
|
height: 100%;
|
display: flex;
|
flex-direction: row;
|
flex: 1;
|
flex-basis: auto;
|
box-sizing: border-box;
|
.sys-right {
|
flex: 1;
|
flex-basis: auto;
|
overflow: auto;
|
box-sizing: border-box;
|
position: relative;
|
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)
|
.el-form-item__label-wrap
|
> .el-form-item__label:before {
|
display: none;
|
}
|
.el-select {
|
width: 100%;
|
}
|
.el-form-item {
|
margin-bottom: 10px;
|
height: 50px;
|
background: #f8f8f8;
|
padding: 4px 20px;
|
-webkit-box-sizing: border-box;
|
box-sizing: border-box;
|
border-radius: 10px;
|
.el-form-item__label {
|
text-align: left;
|
line-height: 42px;
|
}
|
}
|
.el-form-item__content {
|
line-height: 40px;
|
position: relative;
|
font-size: 14px;
|
}
|
.ip-input-container {
|
max-width: none !important;
|
}
|
.auto {
|
.title-bg {
|
background-color: #fff;
|
height: 110px;
|
border-radius: 8px;
|
margin-bottom: 10px;
|
display: flex;
|
flex-direction: column;
|
justify-content: center;
|
.title {
|
font-size: 24px;
|
font-weight: 700;
|
line-height: 33.6px;
|
}
|
.desc {
|
margin-top:10px ;
|
font-size: 12px;
|
line-height: 16.8px;
|
font-weight: 700;
|
}
|
}
|
.bar {
|
display: flex;
|
align-items: center;
|
padding: 12px 40px;
|
background-color: #fff;
|
justify-content: space-between;
|
border-radius: 12px;
|
margin-bottom: 10px;
|
.right-zone {
|
display: flex;
|
align-items: center;
|
}
|
.name {
|
font-size: 16px;
|
font-weight: 700;
|
text-align: left;
|
min-width: 180px;
|
}
|
.desc {
|
font-size: 16px;
|
font-weight: 700;
|
margin-left: 30px;
|
max-width: 568px;
|
/* overflow: hidden; */
|
/* text-overflow: ellipsis; */
|
/* white-space: nowrap; */
|
line-height: normal;
|
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 {
|
height: auto;
|
}
|
.el-input__inner {
|
border: none;
|
border-radius: 8px;
|
background-color: rgba(240, 240, 240, 1);
|
text-align: left;
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|