|
|
|
@ -46,11 +46,38 @@ |
|
|
|
|
<el-button size="small" type="primary" @click="editPassword">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<div class="log-mask" v-if="logVisible"></div> |
|
|
|
|
<div class="log-dia" v-if="logVisible"> |
|
|
|
|
<img class="bg1" src="@/assets/img/log-bg.png" alt=""> |
|
|
|
|
<img class="bg2" src="@/assets/img/log-bg1.png" alt=""> |
|
|
|
|
<p class="log-title">更新日志</p> |
|
|
|
|
<div class="log-wrap"> |
|
|
|
|
<div class="logs"> |
|
|
|
|
<div class="item" v-for="(item, i) in list" :key="i" v-show="!i || (i && logAll)"> |
|
|
|
|
<h6>{{ item.versionName }}</h6> |
|
|
|
|
<img v-if="item.coverUrl" :src="item.coverUrl" alt="" class="cover"> |
|
|
|
|
<ul class="detail"> |
|
|
|
|
<li v-for="(item, i) in item.logContents" :key="i"> |
|
|
|
|
<p class="name"><img :src="require('@/assets/img/' + funcList.find(e => e.id === item.type).icon + '.png')" alt=""> {{ funcList.find(e => e.id === item.type).name }}</p> |
|
|
|
|
<div class="val"> |
|
|
|
|
<p v-for="(item, i) in item.content" :key="i">{{ i + 1 }}、{{ item }}</p> |
|
|
|
|
</div> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="more-wrap"> |
|
|
|
|
<p>更多功能介绍,点击 <span class="more" @click="logAll = !logAll">了解更多</span></p> |
|
|
|
|
<el-button class="know" type="primary" size="small" @click="logVisible = false">知道了</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import navbar from '../navbar' |
|
|
|
|
import { mapState, mapActions } from 'vuex' |
|
|
|
|
import { mapState, mapMutations, mapActions } from 'vuex' |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
import util from '@/libs/util' |
|
|
|
|
export default { |
|
|
|
@ -68,12 +95,32 @@ export default { |
|
|
|
|
newPassword: '', |
|
|
|
|
reNewPassword: '' |
|
|
|
|
}, |
|
|
|
|
logVisible: false, |
|
|
|
|
list: [], |
|
|
|
|
logAll: false, |
|
|
|
|
funcList: [ |
|
|
|
|
{ |
|
|
|
|
id: 0, |
|
|
|
|
name: '新功能', |
|
|
|
|
icon: 'func' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: '修复', |
|
|
|
|
icon: 'bug' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, |
|
|
|
|
name: '优化', |
|
|
|
|
icon: 'optimize' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
components: { navbar }, |
|
|
|
|
computed: { |
|
|
|
|
...mapState('user', [ |
|
|
|
|
'avatar', 'schoolId', 'isCustomer', 'userName' |
|
|
|
|
'avatar', 'schoolId', 'isCustomer', 'userName', 'logView' |
|
|
|
|
]), |
|
|
|
|
...mapState('auth', [ |
|
|
|
|
'routes' |
|
|
|
@ -94,15 +141,40 @@ export default { |
|
|
|
|
userName |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.logView || this.getLogStatus() // logView为false才需要查询接口 |
|
|
|
|
// 如果登录了,并且非客户,才调用用户信息的接口。客户是没有用户信息的,但是能进入后台(如果有权限菜单) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.token && !this.isCustomer && this.getUserInfo() |
|
|
|
|
}, 1000) |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
...mapMutations('user', [ |
|
|
|
|
'SET_LOG' |
|
|
|
|
]), |
|
|
|
|
...mapActions('user', [ |
|
|
|
|
'setInfo', 'logout', 'setManager', 'setCustomer' |
|
|
|
|
]), |
|
|
|
|
// 获取日志列表 |
|
|
|
|
getLog() { |
|
|
|
|
this.$get(`${this.api.platformLogList}?platformId=${Setting.platformId}&port=1&versionName=`).then(({ logList }) => { |
|
|
|
|
logList.map((e, i) => { |
|
|
|
|
e.logContents.map(n => { |
|
|
|
|
n.content = n.content.split('\n') |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.list = logList |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
// 获取日志状态 |
|
|
|
|
getLogStatus() { |
|
|
|
|
this.$get(this.api.logNotification).then(({ notification }) => { |
|
|
|
|
this.SET_LOG() // 把查看日志状态设置为true |
|
|
|
|
if (notification) { |
|
|
|
|
this.logVisible = true // 返回true,则显示日志弹框 |
|
|
|
|
this.getLog() |
|
|
|
|
} |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
// 获取个人信息 |
|
|
|
|
getUserInfo() { |
|
|
|
|
this.$get(this.api.userInfo).then(res => { |
|
|
|
@ -194,8 +266,8 @@ export default { |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
$height: 64px; |
|
|
|
|
.header{ |
|
|
|
|
$height: 64px; |
|
|
|
|
.header{ |
|
|
|
|
z-index: 10; |
|
|
|
|
position: fixed; |
|
|
|
|
top: 0; |
|
|
|
@ -292,5 +364,99 @@ export default { |
|
|
|
|
font-size: 14px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.log-mask { |
|
|
|
|
position: fixed; |
|
|
|
|
top: 0; |
|
|
|
|
left: 0; |
|
|
|
|
bottom: 0; |
|
|
|
|
right: 0; |
|
|
|
|
background-color: rgba(0, 0, 0, .4); |
|
|
|
|
} |
|
|
|
|
/deep/.log-dia { |
|
|
|
|
position: absolute; |
|
|
|
|
top: calc((100vh - 500px) / 2); |
|
|
|
|
left: 50%; |
|
|
|
|
width: 500px; |
|
|
|
|
transform: translateX(-50%); |
|
|
|
|
background-color: #fff; |
|
|
|
|
border-radius: 6px; |
|
|
|
|
.bg1 { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 200px; |
|
|
|
|
} |
|
|
|
|
.bg2 { |
|
|
|
|
position: absolute; |
|
|
|
|
top: -150px; |
|
|
|
|
left: 0; |
|
|
|
|
max-width: 100%; |
|
|
|
|
} |
|
|
|
|
.log-title { |
|
|
|
|
position: absolute; |
|
|
|
|
top: 90px; |
|
|
|
|
left: 130px; |
|
|
|
|
font-size: 40px; |
|
|
|
|
color: #fff; |
|
|
|
|
font-weight: 600; |
|
|
|
|
} |
|
|
|
|
.log-wrap { |
|
|
|
|
padding-bottom: 30px; |
|
|
|
|
} |
|
|
|
|
.logs { |
|
|
|
|
max-height: 300px; |
|
|
|
|
padding: 0 60px; |
|
|
|
|
margin: 30px 0; |
|
|
|
|
overflow: auto; |
|
|
|
|
} |
|
|
|
|
h6 { |
|
|
|
|
margin-bottom: 15px; |
|
|
|
|
font-size: 18px; |
|
|
|
|
color: #333; |
|
|
|
|
line-height: 1; |
|
|
|
|
} |
|
|
|
|
.more-wrap { |
|
|
|
|
padding: 0 60px; |
|
|
|
|
font-size: 14px; |
|
|
|
|
color: #333; |
|
|
|
|
} |
|
|
|
|
.more { |
|
|
|
|
font-size: 14px; |
|
|
|
|
color: $main-color; |
|
|
|
|
cursor: pointer; |
|
|
|
|
&:hover { |
|
|
|
|
opacity: .9; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.know { |
|
|
|
|
margin-top: 15px; |
|
|
|
|
} |
|
|
|
|
.cover { |
|
|
|
|
max-width: 400px; |
|
|
|
|
margin: 10px 0 20px; |
|
|
|
|
} |
|
|
|
|
.detail { |
|
|
|
|
li { |
|
|
|
|
margin-bottom: 20px; |
|
|
|
|
} |
|
|
|
|
.name { |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
margin-bottom: 5px; |
|
|
|
|
font-size: 14px; |
|
|
|
|
img { |
|
|
|
|
width: 20px; |
|
|
|
|
margin-right: 8px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.val { |
|
|
|
|
font-size: 15px; |
|
|
|
|
line-height: 1.8; |
|
|
|
|
white-space: pre-wrap; |
|
|
|
|
p { |
|
|
|
|
position: relative; |
|
|
|
|
color: #505050; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |