|
@@ -3,7 +3,10 @@
|
|
|
<el-row>
|
|
|
<el-col :span="8" v-if="$store.state.windowsSize.width >= 1300" class="logoBox">
|
|
|
<div class="logo"></div>
|
|
|
- <div class="title">浦东新区资源环境智慧审计平台 <span class="title_version">Version:20221216_T_1.0.1</span></div>
|
|
|
+ <div class="title">
|
|
|
+ {{ systemInfo.c_system_name ? systemInfo.c_system_name : "浦东新区资源环境智慧审计平台" }}
|
|
|
+ <span class="title_version">Version:{{ systemInfo.c_version ? systemInfo.c_version : "版本信息获取失败!" }}</span>
|
|
|
+ </div>
|
|
|
</el-col>
|
|
|
<el-col :span="2" v-if="$store.state.windowsSize.width < 1300" class="logoBox">
|
|
|
<div class="logo"></div>
|
|
@@ -89,6 +92,7 @@ export default {
|
|
|
name: "Header",
|
|
|
data() {
|
|
|
return {
|
|
|
+ systemInfo: {},
|
|
|
userName: localStorage.getItem("_USER_NAME") ? localStorage.getItem("_USER_NAME") : "未登录",
|
|
|
ActiveIndex: "0",
|
|
|
navData: {
|
|
@@ -109,8 +113,47 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getActiveIndex(true);
|
|
|
+ // 验证是否存在版本更新
|
|
|
+ this.getSystemInfo();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 请求系统信息
|
|
|
+ getSystemInfo() {
|
|
|
+ let params = new FormData();
|
|
|
+ params.append("columnId", "83");
|
|
|
+ params.append("states", "2,3");
|
|
|
+ params.append("pageSize", 10);
|
|
|
+ params.append("page", 0);
|
|
|
+ let sortparam = [{ field: "c_publish_time", orderByType: 2 }];
|
|
|
+ params.append("orderBy", JSON.stringify(sortparam));
|
|
|
+ this.$Post(this.urlsCollection.selectContentList, params).then(
|
|
|
+ res => {
|
|
|
+ if (res.code === 200 && res.content.data.length > 0) {
|
|
|
+ let tableData = res.content.data;
|
|
|
+ if (tableData.length > 0) {
|
|
|
+ this.systemInfo = tableData[0];
|
|
|
+ let systemVersion = localStorage.getItem("SYSTEM_VERSION");
|
|
|
+ if (systemVersion) {
|
|
|
+ if (systemVersion != this.systemInfo.c_version) {
|
|
|
+ this.$message.success("新版本已发布!自动更新中!");
|
|
|
+ localStorage.setItem("SYSTEM_VERSION", this.systemInfo.c_version);
|
|
|
+ window.location.reload();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ localStorage.setItem("SYSTEM_VERSION", this.systemInfo.c_version);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.systemInfo = {};
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.systemInfo = {};
|
|
|
+ this.$message.error(error);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
// 菜单选择记忆(由于不使用路由,为了防止用户刷新页面后页面丢失,故保存并重新赋值当前页)
|
|
|
getActiveIndex(status) {
|
|
|
let _ActiveIndex = "";
|
|
@@ -161,7 +204,6 @@ export default {
|
|
|
},
|
|
|
// 用户菜单
|
|
|
handleCommand(command) {
|
|
|
- console.log(command);
|
|
|
switch (command) {
|
|
|
case "loginOut":
|
|
|
this.loginOut();
|