用户手册等

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> <span class="username">{{userName}}</span>
</div> </div>
<el-dropdown-menu slot="dropdown"> <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="person">个人资料</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item> <el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
<pdf :visible.sync="pdfVisible" :src.sync="pdfSrc"></pdf>
</div> </div>
</template> </template>
<script> <script>
import { mapState,mapActions } from 'vuex' import { mapState,mapActions } from 'vuex'
import Setting from '@/setting' import Setting from '@/setting'
import pdf from '@/components/pdf'
export default { export default {
data() { data() {
return { return {
pdfVisible: false,
pdfSrc: '',
showBackList: Setting.layout.hideNavList, showBackList: Setting.layout.hideNavList,
}; };
}, },
components: { pdf },
computed: { computed: {
...mapState('user', [ ...mapState('user', [
'userId','avatar','userName' 'userId','avatar','userName'
@ -42,8 +48,10 @@ export default {
'logout' 'logout'
]), ]),
userCommand(command){ userCommand(command){
console.log(command) if(command == 'help'){
if(command == 'person'){ 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') this.$router.push('/setting/person')
}else{ }else{
this.logout() this.logout()

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

Loading…
Cancel
Save