|
@@ -7,8 +7,57 @@
|
|
<top-semester></top-semester>
|
|
<top-semester></top-semester>
|
|
<!-- 分析列表 -->
|
|
<!-- 分析列表 -->
|
|
<view class="card_view">
|
|
<view class="card_view">
|
|
-<!-- <view class="card_item"></view>
|
|
|
|
- <view class="card_item"></view> -->
|
|
|
|
|
|
+
|
|
|
|
+ <view class="card_item" style="background-color: #4169E1;height: 200rpx;">
|
|
|
|
+ <view class="analysis_box">
|
|
|
|
+ <view class="analysis_text">{{analysisData[0].title}}</view>
|
|
|
|
+
|
|
|
|
+ <view class="flex_baseline">
|
|
|
|
+ <view class="analysis_data" style="font-size: 44rpx;">{{totalSemAvg}}</view>
|
|
|
|
+ <view class="analysis_text" style="margin-right: 20rpx;font-size: 26rpx;">分</view>
|
|
|
|
+ <view class="analysis_text" style="font-size: 26rpx;" v-if="analysisData[0].data != 'btm'">超过</view>
|
|
|
|
+ <view class="analysis_text" style="font-size: 26rpx;" v-if="analysisData[0].data === 'btm'">未超过</view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <view class="flex_baseline">
|
|
|
|
+ <view class="analysis_text">
|
|
|
|
+ {{analysisData[0].data === 'top' ? '班级和年级平均分':(analysisData[0].data === 'midClass'? '班级学期平均分':(analysisData[0].data === 'midGrade'?'年级学期平均分':'班级或年级平均分'))}}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="icon_box">
|
|
|
|
+ <view v-if="analysisData[0].data==='top'" class="t-icon t-icon-a-bianzu6"></view>
|
|
|
|
+ <view v-if="analysisData[0].data==='midGrade'||analysisData[0].data === 'midClass'" class="t-icon t-icon-a-bianzu7">
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="analysisData[0].data==='btm'" class="t-icon t-icon-a-bianzu8"></view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <view class="card_item" style="background-color: #ff8caf;height: 200rpx;">
|
|
|
|
+ <view class="analysis_box">
|
|
|
|
+ <view class="analysis_text">{{analysisData[1].title}}</view>
|
|
|
|
+
|
|
|
|
+ <view class="flex_baseline">
|
|
|
|
+ <view class="analysis_data" style="font-size: 44rpx;">{{singleSemAvg}}</view>
|
|
|
|
+ <view class="analysis_text" style="margin-right: 20rpx;font-size: 26rpx;">分</view>
|
|
|
|
+ <view class="analysis_text" style="font-size: 26rpx;" v-if="analysisData[1].data != 'btm'">超过</view>
|
|
|
|
+ <view class="analysis_text" style="font-size: 26rpx;" v-if="analysisData[1].data === 'btm'">未超过</view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <view class="flex_baseline">
|
|
|
|
+ <view class="analysis_text">
|
|
|
|
+ {{analysisData[1].data === 'top' ? '班级和年级平均分':(analysisData[1].data === 'midClass'? '班级学期平均分':(analysisData[1].data === 'midGrade'?'年级学期平均分':'班级或年级平均分'))}}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="icon_box">
|
|
|
|
+ <view v-if="analysisData[1].data==='top'" class="t-icon t-icon-a-bianzu6"></view>
|
|
|
|
+ <view v-if="analysisData[1].data==='midGrade'||analysisData[1].data === 'midClass'" class="t-icon t-icon-a-bianzu7">
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="analysisData[1].data==='btm'" class="t-icon t-icon-a-bianzu8"></view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
<!-- 总成绩对比 -->
|
|
<!-- 总成绩对比 -->
|
|
<view class="card_item" style="width: 100%;">
|
|
<view class="card_item" style="width: 100%;">
|
|
<view class="card_title">
|
|
<view class="card_title">
|
|
@@ -17,7 +66,8 @@
|
|
<!-- <view class="t-icon t-icon-tishi2" style="margin-left: auto;"></view> -->
|
|
<!-- <view class="t-icon t-icon-tishi2" style="margin-left: auto;"></view> -->
|
|
</view>
|
|
</view>
|
|
<view class="chart_box">
|
|
<view class="chart_box">
|
|
- <qiun-data-charts type="area" ontouch="true" :chartData="examChartData.totalChartData[0]" tooltipFormat='tooltipScore' :canvas2d="true" canvasId="total_chart1" />
|
|
|
|
|
|
+ <qiun-data-charts type="area" ontouch="true" :chartData="examChartData.totalChartData[0]"
|
|
|
|
+ tooltipFormat='tooltipScore' :canvas2d="true" canvasId="total_chart1" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 单科与平均对比 -->
|
|
<!-- 单科与平均对比 -->
|
|
@@ -31,7 +81,8 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="chart_box">
|
|
<view class="chart_box">
|
|
- <qiun-data-charts type="area" ontouch="true" :chartData="examChartData.totalChartData[1]" tooltipFormat='tooltipScore' :canvas2d="true" canvasId="total_chart2" />
|
|
|
|
|
|
+ <qiun-data-charts type="area" ontouch="true" :chartData="examChartData.totalChartData[1]"
|
|
|
|
+ tooltipFormat='tooltipScore' :canvas2d="true" canvasId="total_chart2" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 个人单科对比 -->
|
|
<!-- 个人单科对比 -->
|
|
@@ -45,19 +96,20 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="chart_box" v-if="scoreTypeCurrent === '得分'">
|
|
<view class="chart_box" v-if="scoreTypeCurrent === '得分'">
|
|
- <qiun-data-charts type="line" ontouch="true" :chartData="examChartData.totalChartData[2]" tooltipFormat='tooltipScore' :canvas2d="true" canvasId="total_chart3" />
|
|
|
|
|
|
+ <qiun-data-charts type="line" ontouch="true" :chartData="examChartData.totalChartData[2]"
|
|
|
|
+ tooltipFormat='tooltipScore' :canvas2d="true" canvasId="total_chart3" />
|
|
</view>
|
|
</view>
|
|
<view class="chart_box" v-if="scoreTypeCurrent === '得分率'">
|
|
<view class="chart_box" v-if="scoreTypeCurrent === '得分率'">
|
|
- <qiun-data-charts type="line" ontouch="true" :chartData="examChartData.totalChartData[2]" tooltipFormat='tooltipScoreShort' :canvas2d="true" canvasId="total_chart4" />
|
|
|
|
|
|
+ <qiun-data-charts type="line" ontouch="true" :chartData="examChartData.totalChartData[2]"
|
|
|
|
+ tooltipFormat='tooltipScoreShort' :canvas2d="true" canvasId="total_chart4" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 选择器 -->
|
|
<!-- 选择器 -->
|
|
<!-- 科目选择 -->
|
|
<!-- 科目选择 -->
|
|
- <u-picker :show="subjectPicker" :columns="subjectList" @confirm="subjectConfirm" @cancel="cancel"/>
|
|
|
|
|
|
+ <u-picker :show="subjectPicker" :columns="subjectList" @confirm="subjectConfirm" @cancel="cancel" />
|
|
<!-- 模式选择 -->
|
|
<!-- 模式选择 -->
|
|
- <u-picker :show="scoreTypePicker" :columns="scoreTypeList" @confirm="scoreTypeConfirm"
|
|
|
|
- @cancel="cancel"/>
|
|
|
|
|
|
+ <u-picker :show="scoreTypePicker" :columns="scoreTypeList" @confirm="scoreTypeConfirm" @cancel="cancel" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -69,7 +121,7 @@
|
|
} from 'vuex'
|
|
} from 'vuex'
|
|
export default {
|
|
export default {
|
|
computed: {
|
|
computed: {
|
|
- ...mapState('m_chart', ['examChartData','subjectExamData']),
|
|
|
|
|
|
+ ...mapState('m_chart', ['examChartData', 'subjectExamData']),
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
subjectCurrent: {
|
|
subjectCurrent: {
|
|
@@ -78,6 +130,7 @@
|
|
let temp = this.examChartData
|
|
let temp = this.examChartData
|
|
temp.totalChartData[1] = subjectChartData
|
|
temp.totalChartData[1] = subjectChartData
|
|
this.updateExamChartData(temp)
|
|
this.updateExamChartData(temp)
|
|
|
|
+ this.chooseAnalysisSubject()
|
|
},
|
|
},
|
|
immediate: false
|
|
immediate: false
|
|
},
|
|
},
|
|
@@ -89,44 +142,113 @@
|
|
subjectPicker: false,
|
|
subjectPicker: false,
|
|
scoreTypePicker: false,
|
|
scoreTypePicker: false,
|
|
//选择器内容
|
|
//选择器内容
|
|
- subjectList:'',
|
|
|
|
- scoreTypeList: [['得分', '得分率']],
|
|
|
|
|
|
+ subjectList: '',
|
|
|
|
+ scoreTypeList: [
|
|
|
|
+ ['得分', '得分率']
|
|
|
|
+ ],
|
|
//当前选中
|
|
//当前选中
|
|
subjectCurrent: '',
|
|
subjectCurrent: '',
|
|
scoreTypeCurrent: '',
|
|
scoreTypeCurrent: '',
|
|
|
|
+ //分析模块数据
|
|
|
|
+ analysisData: [{
|
|
|
|
+ title: '学期平均总得分',
|
|
|
|
+ data: '',
|
|
|
|
+ color: '#4169E1',
|
|
|
|
+ }, {
|
|
|
|
+ title: '学期平均分',
|
|
|
|
+ data: '',
|
|
|
|
+ color: '#ff8caf',
|
|
|
|
+ }],
|
|
|
|
+ //学期平均总得分
|
|
|
|
+ totalSemAvg: '',
|
|
|
|
+ //单科学期平均得分
|
|
|
|
+ singleSemAvg: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
this.init()
|
|
this.init()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...mapMutations('m_chart',['updateExamChartData']),
|
|
|
|
- init(){
|
|
|
|
|
|
+ ...mapMutations('m_chart', ['updateExamChartData']),
|
|
|
|
+ init() {
|
|
this.setChartOptions()
|
|
this.setChartOptions()
|
|
|
|
+ this.getAnalysisData()
|
|
|
|
+ },
|
|
|
|
+ //获得分析数据
|
|
|
|
+ getAnalysisData() {
|
|
|
|
+ function arrSum(array) {
|
|
|
|
+ let cont = 0
|
|
|
|
+ for (let i = 0; i < array.length; i++) {
|
|
|
|
+ cont += array[i]
|
|
|
|
+ }
|
|
|
|
+ return cont;
|
|
|
|
+ }
|
|
|
|
+ let totalSemAvg = parseInt((arrSum(this.examChartData.totalChartData[0].series[0].data) / this.examChartData.totalChartData[0].series[0].data.length).toFixed(0))
|
|
|
|
+ this.totalSemAvg = totalSemAvg
|
|
|
|
+ let classSemAvg = parseInt((arrSum(this.examChartData.totalChartData[0].series[1].data) / this.examChartData.totalChartData[0].series[1].data.length).toFixed(0))
|
|
|
|
+ console.log('班级平均总分', classSemAvg);
|
|
|
|
+ let gradeSemAvg = parseInt((arrSum(this.examChartData.totalChartData[0].series[2].data) / this.examChartData.totalChartData[0].series[2].data.length).toFixed(0))
|
|
|
|
+ console.log('年级平均总分', gradeSemAvg);
|
|
|
|
+ if (totalSemAvg > classSemAvg && totalSemAvg > gradeSemAvg) {
|
|
|
|
+ this.analysisData[0].data = 'top'
|
|
|
|
+ } else if (totalSemAvg > classSemAvg && totalSemAvg >= gradeSemAvg) {
|
|
|
|
+ this.analysisData[0].data = 'midClass'
|
|
|
|
+ } else if (totalSemAvg > gradeSemAvg && totalSemAvg >= classSemAvg) {
|
|
|
|
+ this.analysisData[0].data = 'midGrade'
|
|
|
|
+ } else {
|
|
|
|
+ this.analysisData[0].data = 'btm'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ chooseAnalysisSubject(){
|
|
|
|
+ function arrSum(array) {
|
|
|
|
+ let cont = 0
|
|
|
|
+ for (let i = 0; i < array.length; i++) {
|
|
|
|
+ cont += array[i]
|
|
|
|
+ }
|
|
|
|
+ return cont;
|
|
|
|
+ }
|
|
|
|
+ this.analysisData[1].title = this.subjectCurrent + '学期平均分'
|
|
|
|
+ console.log(this.examChartData.totalChartData[1]);
|
|
|
|
+ let singleSemAvg = parseInt((arrSum(this.examChartData.totalChartData[1].series[0].data) / this.examChartData.totalChartData[1].series[0].data.length).toFixed(0))
|
|
|
|
+ this.singleSemAvg = singleSemAvg
|
|
|
|
+ let classSemSinAvg = parseInt((arrSum(this.examChartData.totalChartData[1].series[1].data) / this.examChartData.totalChartData[1].series[1].data.length).toFixed(0))
|
|
|
|
+ console.log('班级平均单科总分', classSemSinAvg);
|
|
|
|
+ let gradeSemSinAvg = parseInt((arrSum(this.examChartData.totalChartData[1].series[2].data) / this.examChartData.totalChartData[1].series[2].data.length).toFixed(0))
|
|
|
|
+ console.log('年级平均单科总分', gradeSemSinAvg);
|
|
|
|
+ if (singleSemAvg > classSemSinAvg && singleSemAvg > gradeSemSinAvg) {
|
|
|
|
+ this.analysisData[1].data = 'top'
|
|
|
|
+ } else if (singleSemAvg > classSemSinAvg && singleSemAvg >= gradeSemSinAvg) {
|
|
|
|
+ this.analysisData[1].data = 'midClass'
|
|
|
|
+ } else if (singleSemAvg > gradeSemSinAvg && singleSemAvg >= classSemSinAvg) {
|
|
|
|
+ this.analysisData[1].data = 'midGrade'
|
|
|
|
+ } else {
|
|
|
|
+ this.analysisData[1].data = 'btm'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//初始化选择器内容(图表配置)
|
|
//初始化选择器内容(图表配置)
|
|
- setChartOptions(){
|
|
|
|
|
|
+ setChartOptions() {
|
|
if (this.scoreTypeCurrent === '')
|
|
if (this.scoreTypeCurrent === '')
|
|
this.scoreTypeCurrent = this.scoreTypeList[0][0]
|
|
this.scoreTypeCurrent = this.scoreTypeList[0][0]
|
|
if (this.subjectList === '') {
|
|
if (this.subjectList === '') {
|
|
let arr = []
|
|
let arr = []
|
|
arr.push(this.subjectExamData.subjectList)
|
|
arr.push(this.subjectExamData.subjectList)
|
|
this.subjectList = arr
|
|
this.subjectList = arr
|
|
- if (this.subjectCurrent === '')
|
|
|
|
- this.subjectCurrent = this.subjectList[0][0]
|
|
|
|
|
|
+ this.subjectCurrent = this.subjectList[0][0]
|
|
|
|
+ }else{
|
|
|
|
+ this.subjectCurrent = this.subjectList[0][0]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//切换科目
|
|
//切换科目
|
|
- subjectConfirm(e){
|
|
|
|
|
|
+ subjectConfirm(e) {
|
|
this.subjectCurrent = e.value[0]
|
|
this.subjectCurrent = e.value[0]
|
|
this.subjectPicker = false
|
|
this.subjectPicker = false
|
|
},
|
|
},
|
|
//切换模式
|
|
//切换模式
|
|
- scoreTypeConfirm(e){
|
|
|
|
|
|
+ scoreTypeConfirm(e) {
|
|
this.scoreTypeCurrent = e.value[0]
|
|
this.scoreTypeCurrent = e.value[0]
|
|
this.scoreTypePicker = false
|
|
this.scoreTypePicker = false
|
|
},
|
|
},
|
|
- cancel(){
|
|
|
|
|
|
+ cancel() {
|
|
this.subjectPicker = false
|
|
this.subjectPicker = false
|
|
this.scoreTypePicker = false
|
|
this.scoreTypePicker = false
|
|
}
|
|
}
|