用户手册等

master V1.0.1
yujialong 3 years ago
parent 529797521d
commit 8ed098c658
  1. 12
      src/layouts/header/index.vue
  2. 21
      src/pages/index/list/index.vue

@ -8,22 +8,28 @@
<span class="username">{{userName}}</span>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="help">用户手册</el-dropdown-item>
<el-dropdown-item command="person">个人资料</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<pdf :visible.sync="pdfVisible" :src.sync="pdfSrc"></pdf>
</div>
</template>
<script>
import { mapState,mapActions } from 'vuex'
import Setting from '@/setting'
import pdf from '@/components/pdf'
export default {
data() {
return {
pdfVisible: false,
pdfSrc: '',
showBackList: Setting.layout.hideNavList,
};
},
components: { pdf },
computed: {
...mapState('user', [
'userId','avatar','userName'
@ -42,8 +48,10 @@ export default {
'logout'
]),
userCommand(command){
console.log(command)
if(command == 'person'){
if(command == 'help'){
this.pdfVisible = true
this.pdfSrc = 'http://39.108.250.202/template/%E8%B6%85%E7%AB%9E%E6%95%B0%E5%AD%97%E5%8C%96%E8%80%83%E8%AF%95%E7%B3%BB%E7%BB%9F-%E6%93%8D%E4%BD%9C%E6%89%8B%E5%86%8C%EF%BC%88%E5%AD%A6%E7%94%9F%E7%AB%AF%EF%BC%89.pdf'
}else if(command == 'person'){
this.$router.push('/setting/person')
}else{
this.logout()

@ -94,10 +94,8 @@
<a class="item active">考试成绩</a>
</div>
<div class="page-content">
<template v-if="assesmentNameList.length">
<div class="chart" id="achievement"></div>
</template>
<div class="none" style="padding: 0;line-height: 400px;" v-else>暂无图标数据</div>
<!-- <div class="none" style="padding: 0;line-height: 400px;" v-else>暂无图标数据</div> -->
</div>
</div>
</div>
@ -300,14 +298,24 @@ export default {
getAchievement() {
this.$post(`${this.api.getMyAchievement}?userId=${this.userId}&pageSize=1000&pageNum=1`).then(res => {
let list = res.data.list.list
this.assesmentNameList = list.map(n => n.assessmentName)
this.assesmentScoreList = list.map(n => n.thisScore)
let acheList = []
list.map(n => {
if(n.thisScore != null){
acheList.push({
assessmentName: n.assessmentName,
score: n.thisScore
})
}
})
this.assesmentNameList = acheList.map(n => n.assessmentName)
this.assesmentScoreList = acheList.map(n => n.score)
this.getAchievementChart()
}).catch(res => {})
},
getAchievementChart(){
let myChart = echarts.init(document.getElementById('achievement'))
myChart.setOption({
tooltip: {},
xAxis: {
name: '考试名称',
type: 'category',
@ -319,7 +327,8 @@ export default {
},
series: [{
data: this.assesmentScoreList,
type: 'bar'
type: 'bar',
areaStyle: {}
}]
});
},

Loading…
Cancel
Save