|
@@ -8,6 +8,13 @@
|
|
</div>
|
|
</div>
|
|
<lt-menu v-if="menuWrappers&&menuWrappers.length" v-bind:role="getRole"
|
|
<lt-menu v-if="menuWrappers&&menuWrappers.length" v-bind:role="getRole"
|
|
v-bind:data="menuWrappers"></lt-menu>
|
|
v-bind:data="menuWrappers"></lt-menu>
|
|
|
|
+ <div class="version">
|
|
|
|
+ <p>
|
|
|
|
+ <span>版本信息:</span>
|
|
|
|
+ <a href="javascript:void(0)" @click="showVersion">{{versionName}}</a>
|
|
|
|
+ <i v-if="isNewV"><img src="../../images/new.png" alt=""/></i>
|
|
|
|
+ </p>
|
|
|
|
+ </div>
|
|
</el-aside>
|
|
</el-aside>
|
|
<el-container>
|
|
<el-container>
|
|
<el-header class="clearfix">
|
|
<el-header class="clearfix">
|
|
@@ -26,6 +33,13 @@
|
|
<router-view v-if="ok" v-on:status-change="changeStatus"></router-view>
|
|
<router-view v-if="ok" v-on:status-change="changeStatus"></router-view>
|
|
</el-main>
|
|
</el-main>
|
|
</el-container>
|
|
</el-container>
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="版本信息"
|
|
|
|
+ :visible.sync="versionVisible"
|
|
|
|
+ width="50%"
|
|
|
|
+ class="version-info">
|
|
|
|
+ <div v-html="versionInfo"></div>
|
|
|
|
+ </el-dialog>
|
|
</el-container>
|
|
</el-container>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -35,7 +49,7 @@
|
|
import api from '@api/index.js';
|
|
import api from '@api/index.js';
|
|
import userApi from '@api/user.js';
|
|
import userApi from '@api/user.js';
|
|
import Console from '@components/user/Console.vue';
|
|
import Console from '@components/user/Console.vue';
|
|
-
|
|
|
|
|
|
+ import newIcon from '../../images/new.png';
|
|
export default {
|
|
export default {
|
|
name: 'homepage',
|
|
name: 'homepage',
|
|
components: {
|
|
components: {
|
|
@@ -51,6 +65,11 @@
|
|
authStatus: null,
|
|
authStatus: null,
|
|
authStatusName:'',
|
|
authStatusName:'',
|
|
ok:false, //是否已获取到菜单
|
|
ok:false, //是否已获取到菜单
|
|
|
|
+ versionName:'',
|
|
|
|
+ versionVisible:false,
|
|
|
|
+ versionInfo:'',
|
|
|
|
+ isNewV:false,
|
|
|
|
+ version:null, //版本信息接口返回的数据
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -69,6 +88,7 @@
|
|
}
|
|
}
|
|
if(to.path=='/'){ // 退出时清空菜单
|
|
if(to.path=='/'){ // 退出时清空菜单
|
|
this.menuWrappers=[];
|
|
this.menuWrappers=[];
|
|
|
|
+ this.isNewV = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -91,11 +111,50 @@
|
|
const url = this.getRole=='user'?'/user/YH-KZT':'/admin/LT-KZT';
|
|
const url = this.getRole=='user'?'/user/YH-KZT':'/admin/LT-KZT';
|
|
this.$router.push({path:url});
|
|
this.$router.push({path:url});
|
|
}
|
|
}
|
|
|
|
+ this.getVersionInfo();
|
|
}
|
|
}
|
|
}).catch((error) => {
|
|
}).catch((error) => {
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ isNewVersion(){ //判断是否为新版
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ getVersionInfo(){
|
|
|
|
+ const getInfo = this.getRole=='user'?api.getVersionOuter:api.getVersionInner;
|
|
|
|
+ getInfo().then((res)=>{
|
|
|
|
+ if (res.data.code == '0') {
|
|
|
|
+ const data = res.data.data;
|
|
|
|
+ this.fillVersionInfo(data);
|
|
|
|
+ }else{
|
|
|
|
+ this.$message(res.data.msg);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ fillVersionInfo(data){
|
|
|
|
+ //进入时获取版本信息,如版本时间与localStorage中不一致或者一致但localStorage中未被点过,
|
|
|
|
+ // 则要显示更新图标
|
|
|
|
+ let htl = '<h3>当前版本:'+data.name+'<span>'+data.refreshTime.substr(0,10)+'</span></h3>';
|
|
|
|
+ let prags = data.detail||[];
|
|
|
|
+ this.versionName = data.name;
|
|
|
|
+ const versionTime = JSON.parse(localStorage.getItem('versionInfo-'+this.userLoginDTO.username));
|
|
|
|
+ if(!versionTime||(data.refreshTime===versionTime.date&&!versionTime.showed)){
|
|
|
|
+ this.isNewV = true;
|
|
|
|
+ }else{
|
|
|
|
+ this.isNewV = false
|
|
|
|
+ }
|
|
|
|
+ for(let i=0;i<prags.length;i++){
|
|
|
|
+ htl += '<p>'+prags[i].title+'</p><p>'+prags[i].description+'</p>';
|
|
|
|
+ }
|
|
|
|
+ this.versionInfo = htl;
|
|
|
|
+ this.version = {date:data.refreshTime};
|
|
|
|
+ },
|
|
|
|
+ showVersion(){
|
|
|
|
+ this.versionVisible = true;
|
|
|
|
+ this.version.showed = true;
|
|
|
|
+ this.isNewV = false;
|
|
|
|
+ localStorage.setItem('versionInfo-'+this.userLoginDTO.username,JSON.stringify(this.version));
|
|
|
|
+ },
|
|
/*redirectPage(){
|
|
/*redirectPage(){
|
|
const url = this.getRole=='user'?'/user':'/admin';
|
|
const url = this.getRole=='user'?'/user':'/admin';
|
|
this.$router.push({path:url});
|
|
this.$router.push({path:url});
|
|
@@ -143,9 +202,47 @@
|
|
.admin .username{
|
|
.admin .username{
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
|
|
+ .version-info h3{
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+ span{
|
|
|
|
+ float: right;
|
|
|
|
+ font-weight: normal;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@import '../../less/common.less';
|
|
@import '../../less/common.less';
|
|
|
|
+ .el-menu-vertical-demo.el-menu{
|
|
|
|
+ height: calc(100% - 120px);
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ }
|
|
|
|
+ .version{
|
|
|
|
+ position: fixed;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ width: @aside-width;
|
|
|
|
+ min-width: 270px;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ /*text-indent: 50px;*/
|
|
|
|
+ text-align: center;
|
|
|
|
+ height:54px;
|
|
|
|
+ line-height: 54px;
|
|
|
|
+ background: #fff;
|
|
|
|
+ i{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 20px;
|
|
|
|
+ height: 16px;
|
|
|
|
+ img{
|
|
|
|
+ vertical-align: text-top;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .user .version a{
|
|
|
|
+ color: @userBase;
|
|
|
|
+ }
|
|
|
|
+ .admin .version a{
|
|
|
|
+ color: @adminBase;
|
|
|
|
+ }
|
|
.user .logo {
|
|
.user .logo {
|
|
background: @userBase;
|
|
background: @userBase;
|
|
|
|
|