2019-07-02 16:29:52 +08:00
|
|
|
<template>
|
|
|
|
<div class="dashboard-container">
|
2019-08-15 14:28:31 +08:00
|
|
|
<div class="item-row" style="margin-top: 20px">
|
|
|
|
<div class="item-col">
|
2019-08-15 15:53:11 +08:00
|
|
|
<echarts-lesson id="lesson" ref="lesson" :size="size" :wxcode="wxcode" />
|
2019-08-15 14:28:31 +08:00
|
|
|
</div>
|
|
|
|
<div class="item-col">
|
2019-08-15 15:53:11 +08:00
|
|
|
<echarts-exam id="exam" ref="exam" :size="size" :wxcode="wxcode" />
|
2019-08-15 14:28:31 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="item-flex">
|
|
|
|
<echarts-demon id="demon" ref="demon" :size="size" :info="demonOption" />
|
|
|
|
</div>
|
2019-07-02 16:29:52 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-08-14 14:52:21 +08:00
|
|
|
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
2019-08-15 14:28:31 +08:00
|
|
|
import EchartsExam from './echarts/exam';
|
2019-08-15 08:58:21 +08:00
|
|
|
import EchartsLesson from './echarts/lesson';
|
|
|
|
import EchartsDemon from './echarts/demonstration';
|
2019-07-02 16:29:52 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Dashboard',
|
2019-08-14 14:52:21 +08:00
|
|
|
components: {
|
2019-08-15 14:28:31 +08:00
|
|
|
EchartsExam,
|
2019-08-15 08:58:21 +08:00
|
|
|
EchartsLesson,
|
|
|
|
EchartsDemon
|
2019-08-14 14:52:21 +08:00
|
|
|
},
|
|
|
|
mixins: [WindowResizeHandler],
|
|
|
|
data() {
|
|
|
|
return {
|
2019-08-15 08:58:21 +08:00
|
|
|
size: {
|
|
|
|
width: 0,
|
|
|
|
height: 0
|
2019-08-15 14:28:31 +08:00
|
|
|
},
|
|
|
|
demonOption: {
|
|
|
|
backgroundColor: '#F0F2F5',
|
|
|
|
title: {
|
|
|
|
text: '仿真统计'
|
|
|
|
},
|
|
|
|
legend: {
|
|
|
|
data: []
|
|
|
|
},
|
|
|
|
xAxis: {
|
|
|
|
data: ['13:00', '13:05', '13:10', '13:15', '13:20', '13:25', '13:30', '13:35', '13:40', '13:45', '13:50', '13:55']
|
|
|
|
},
|
|
|
|
yAxis: {
|
|
|
|
},
|
|
|
|
series: []
|
2019-08-15 08:58:21 +08:00
|
|
|
}
|
2019-08-14 14:52:21 +08:00
|
|
|
};
|
|
|
|
},
|
2019-08-15 14:28:31 +08:00
|
|
|
computed: {
|
|
|
|
wxcode() {
|
2019-08-15 15:53:11 +08:00
|
|
|
return this.$store.state.user.wxUnionId || '';
|
2019-08-15 14:28:31 +08:00
|
|
|
}
|
|
|
|
},
|
2019-08-14 14:52:21 +08:00
|
|
|
methods: {
|
|
|
|
resizeHandler() {
|
2019-08-15 08:58:21 +08:00
|
|
|
this.size = {
|
|
|
|
width: (this._clientWidth - 60) / 2,
|
|
|
|
height: (this._clientHeight - 100) / 2
|
|
|
|
};
|
2019-08-14 14:52:21 +08:00
|
|
|
}
|
2019-07-02 16:29:52 +08:00
|
|
|
}
|
2019-08-13 11:10:55 +08:00
|
|
|
};
|
2019-07-02 16:29:52 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.dashboard {
|
2019-08-15 14:28:31 +08:00
|
|
|
background: #F0F2F5;
|
2019-07-02 16:29:52 +08:00
|
|
|
&-container {
|
2019-08-15 08:58:21 +08:00
|
|
|
margin: 0px;
|
2019-07-02 16:29:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-text {
|
|
|
|
font-size: 30px;
|
|
|
|
line-height: 46px;
|
|
|
|
}
|
|
|
|
}
|
2019-08-15 08:58:21 +08:00
|
|
|
|
|
|
|
.item-col {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item-row {
|
|
|
|
left: 50%;
|
|
|
|
right: 50%;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item-flex {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
2019-07-02 16:29:52 +08:00
|
|
|
</style>
|