From 85391dc1a2458202bdf0fb7a5394022aa17b9126 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期日, 31 七月 2022 15:05:48 +0800 Subject: [PATCH] 完善系统oem配置 --- src/pages/vindicate/views/sysInfo.vue | 232 ++++++++++++++++++++++++++------------------------------- 1 files changed, 105 insertions(+), 127 deletions(-) diff --git a/src/pages/vindicate/views/sysInfo.vue b/src/pages/vindicate/views/sysInfo.vue index 072ad51..901b637 100644 --- a/src/pages/vindicate/views/sysInfo.vue +++ b/src/pages/vindicate/views/sysInfo.vue @@ -4,25 +4,19 @@ <div class="sys-right"> <div class="auto"> <div class="title-bg"> - <div class="title">Smart AIOS</div> - <div class="desc">Copyright 漏 璐濇�濈鎶�鏈湁闄愬叕鍙�</div> + <div class="title">{{ productName }}</div> + <div class="desc">{{ copyright }}</div> </div> <div class="bar" style="background-color: #f2f2f7"> <div class="name">鐗堟湰锛�</div> <div class="desc"> - {{ - serializedNumber == "" ? "SmartAIOS璇曠敤鐗�" : "SmartAIOS姝e紡鐗�" - }} + {{ serializedNumber == "" ? `${productName}璇曠敤鐗坄 : `${productName}姝e紡鐗坄 }} </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 type="primary" size="small" @click="confirmAgain" v-if="serializedNumber != ''" >瀵煎嚭浜у搧瀵嗛挜</el-button > <div class="desc activation"> @@ -32,7 +26,7 @@ </div> <div class="bar"> <div class="name" style="min-width: 65px">璇锋眰鐮侊細</div> - <div class="desc code" style="font-size: 12px">{{ q }}</div> + <div class="desc code" style="font-size: 12px">{{ queryCode }}</div> </div> <div class="bar"> <div class="name">浜у搧瀵嗛挜锛�</div> @@ -48,17 +42,9 @@ </div> </div> - <el-dialog - title="鍐嶆纭" - :visible.sync="dialogVisible" - custom-class="my-confirm" - > + <el-dialog title="鍐嶆纭" :visible.sync="dialogVisible" custom-class="my-confirm"> <div class="ver"> - <span - class="iconfont" - style="color: orangered; font-size: 40px; margin-bottom: 10px" - ></span - > + <span class="iconfont" style="color: orangered; font-size: 40px; margin-bottom: 10px"></span> <span class="ver-text"> 浜у搧瀵嗛挜瀵煎嚭鍚庯紝绯荤粺澶ч儴鍒嗗姛鑳藉皢鏃犳硶浣跨敤锛岃纭鏄惁缁х画锛� </span> @@ -71,7 +57,7 @@ <ul> <li style="list-style: inside">濡傜郴缁熷凡婵�娲伙紝鍦ㄦ縺娲婚〉闈㈠鍑哄嵆鍙紱</li> <li style="list-style: inside"> - 濡傝澶囨湭婵�娲伙紝鍦⊿martAI婵�娲婚〉闈㈡壂鐮佽幏鍙� + {{ `"濡傝澶囨湭婵�娲伙紝璇峰湪${product_name}婵�娲婚〉闈㈡壂鐮佽幏鍙�"` }} </li> </ul> <!-- <span style="color: #8f949a; font-size: 14px" @@ -80,11 +66,7 @@ </div> <!-- --> <div class="pw"> - <el-input - size="small" - placeholder="璇疯緭鍏ョ鐞嗗憳瀵嗙爜" - v-model="password" - ></el-input> + <el-input size="small" placeholder="璇疯緭鍏ョ鐞嗗憳瀵嗙爜" v-model="password"></el-input> </div> <div class="validate"> <form id="myForm"> @@ -97,15 +79,8 @@ > </el-input> </form> - <el-button size="small" @click="txtbtn" type="primary" - >瀵煎叆鏂囦欢</el-button - > - <input - type="file" - @change="loadTextFromFile" - id="txt" - style="display: none" - /> + <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"> @@ -119,10 +94,11 @@ </template> <script> -import { getSN, cancelAuthorization } from "@/api/system"; +import { getSN, cancelAuthorization, getVasystemInfo } from "@/api/system" + export default { mounted() { - this.refreshSn(); + this.refreshSn() }, data() { return { @@ -130,76 +106,81 @@ expireTime: "", serializedNumber: "", secrectKey: "", - q: "", + queryCode: "", activeState: "宸叉縺娲�", password: "", dialogVisible: false, - }; + productName: "", + copyright: "" + } }, 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; + this.authorization = res.data.authorization + this.expireTime = res.data.expireTime + this.serializedNumber = res.data.sn + this.queryCode = res.data.q } - }); + }) + + getVasystemInfo().then((rsp) => { + this.productName = rsp.product_name + this.copyright = rsp.copyright + }) }, confirmAgain() { - this.dialogVisible = true; + this.dialogVisible = true }, txtbtn() { - document.getElementById("txt").click(); + document.getElementById("txt").click() }, loadTextFromFile(e) { - const file = e.target.files[0]; - var reader = new FileReader(); //new涓�涓狥ileReader瀹炰緥 - let that = this; - reader.onload = function () { - that.secrectKey = this.result.trim(); - }; - reader.readAsText(file); + const file = e.target.files[0] + var reader = new FileReader() //new涓�涓狥ileReader瀹炰緥 + 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(); + this.secrectKey = this.secrectKey.trim() + this.password = this.password.trim() if (this.secrectKey == "" || this.password == "") { - this.$message.warning("璇峰厛濉啓瀵嗙爜鍜岃姹傜爜"); - return; + this.$message.warning("璇峰厛濉啓瀵嗙爜鍜岃姹傜爜") + return } cancelAuthorization({ q: this.secrectKey, passwd: this.password, - down: 1, + 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); //杩欎釜灏辨槸瑙f瀽鍑烘潵鐨勬暟鎹� - that.$notify.error(receive_data.msg); - }; - return; + 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" }) - ); - let a = document.createElement("a"); - a.href = url; - a.download = "key.txt"; - a.click(); - window.URL.revokeObjectURL(url); - this.refreshSn(); - window.parent.postMessage({ msg: "checkSN" }, "*"); - this.$notify.success("瀵煎嚭鎴愬姛"); - this.dialogVisible = false; - }); - }, - }, -}; + 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) + this.refreshSn() + window.parent.postMessage({ msg: "checkSN" }, "*") + this.$notify.success("瀵煎嚭鎴愬姛") + this.dialogVisible = false + }) + } + } +} </script> <style lang="scss"> div { @@ -213,8 +194,8 @@ border-left: 4px solid #f2f2f7; .el-dialog { - width: 640px; border-radius: 24px; - + width: 640px; + border-radius: 24px; } .el-dialog__header { @@ -242,38 +223,38 @@ } .el-dialog__footer { padding: 10px 20px 20px; - .btns { - display: flex; - justify-content: right; - .cancel { - width: 140px; - height: 40px; - cursor: pointer; - border-radius: 20px; - line-height: 40px; - font-size: 14px; - color: var(--colorCard); - border-color: var(--colorCard) !important; + .btns { display: flex; - align-items: center; - justify-content: center; - } - .ok { - width: 140px; - height: 40px; - cursor: pointer; - border-radius: 20px; - background-color: var(--colorCard) !important; - border-color: var(--colorCard) !important; - color: #fff; - line-height: 40px; - font-size: 14px; - display: flex; - align-items: center; - justify-content: center; + justify-content: right; + .cancel { + width: 140px; + height: 40px; + cursor: pointer; + border-radius: 20px; + line-height: 40px; + font-size: 14px; + color: var(--colorCard); + border-color: var(--colorCard) !important; + display: flex; + align-items: center; + justify-content: center; + } + .ok { + width: 140px; + height: 40px; + cursor: pointer; + border-radius: 20px; + background-color: var(--colorCard) !important; + border-color: var(--colorCard) !important; + color: #fff; + line-height: 40px; + font-size: 14px; + display: flex; + align-items: center; + justify-content: center; + } } } -} .el-divider--horizontal { margin: 20px 0; } @@ -282,14 +263,14 @@ align-items: baseline; margin-top: 15px; .el-button--small { - font-size: 14px; - border-radius: 3px; - border-radius: 16px; - background-color: var(--colorCard) !important; - border-color: var(--colorCard) !important; - min-width: 120px; padding: 8px 15px; - - } + font-size: 14px; + border-radius: 3px; + border-radius: 16px; + background-color: var(--colorCard) !important; + border-color: var(--colorCard) !important; + min-width: 120px; + padding: 8px 15px; + } } #myForm { display: flex; @@ -356,11 +337,8 @@ 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 { + .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 { -- Gitblit v1.8.0