Sfoglia il codice sorgente

调整成绩分析模块的科目切换功能

OnePsycho 4 anni fa
parent
commit
08895fd448

+ 26 - 19
TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseBar.vue

@@ -5,25 +5,28 @@
 <script>
 <script>
     export default {
     export default {
         name: 'hello',
         name: 'hello',
-        props: ['echartsData'],
+		props:{
+			echartsData:{
+				type:Array,
+				default:() => []
+			},
+			subjectIndex:{
+				type:Number,
+				default:NaN
+			}
+		},
         data() {
         data() {
             return {
             return {
                 subjectList: [],
                 subjectList: [],
                 subjectSeries: [],
                 subjectSeries: [],
                 subjectColors: ['#db615e', '#db8dd2', '#42beda', '#1EB58D', '#99ccff', '#dbaf4f'],
                 subjectColors: ['#db615e', '#db8dd2', '#42beda', '#1EB58D', '#99ccff', '#dbaf4f'],
                 lineData: 440,
                 lineData: 440,
-                areaData: 490.5
+                areaData: 490.5,
+				curSubjectIndex:NaN
             }
             }
         },
         },
-        created() {
-            // this.subjectList = this.echartsData
-            // console.log(this.echartsData)
-            // if (this.getBaseBarData) this.handleOptions(this.getBaseBarData)
-
-        },
 
 
         methods: {
         methods: {
-
             // 处理动态配置文件
             // 处理动态配置文件
             handleOptions(val) {
             handleOptions(val) {
                 let subjectList = val.datas
                 let subjectList = val.datas
@@ -110,12 +113,11 @@
                 // 基于准备好的dom,初始化echarts实例
                 // 基于准备好的dom,初始化echarts实例
                 let myBar = this.$echarts.init(document.getElementById('myBar'))
                 let myBar = this.$echarts.init(document.getElementById('myBar'))
                 let that = this
                 let that = this
-
                 // 指定图表的配置项和数据
                 // 指定图表的配置项和数据
                 var option = {
                 var option = {
                     legend: {
                     legend: {
                         // data: data.datas.map(item => item.name).concat([this.$t('totalAnalysis.ach_text5'), this.$t('totalAnalysis.ach_text6')]),
                         // data: data.datas.map(item => item.name).concat([this.$t('totalAnalysis.ach_text5'), this.$t('totalAnalysis.ach_text6')]),
-                        data: data.classes[0].subjects.map(item => item.name).concat([this.$t('totalAnalysis.ach_text5'), this.$t('totalAnalysis.ach_text6')]),
+                        data: this.subjectSeries.map(item => item.name).concat([this.$t('totalAnalysis.ach_text5'), this.$t('totalAnalysis.ach_text6')]),
                         textStyle: {
                         textStyle: {
                             color: '#e4eadb'
                             color: '#e4eadb'
                         }
                         }
@@ -305,6 +307,7 @@
                 }
                 }
 
 
                 // 绘制图表
                 // 绘制图表
+				myBar.clear()
                 myBar.setOption(option)
                 myBar.setOption(option)
                 window.addEventListener('resize', function() {
                 window.addEventListener('resize', function() {
                     myBar.resize()
                     myBar.resize()
@@ -381,7 +384,7 @@
 				    let seriesItem = {
 				    let seriesItem = {
 				        name: item.name,
 				        name: item.name,
 				        type: 'bar',
 				        type: 'bar',
-				        stack: subjectList[0].name,
+				        stack: !isNaN(this.curSubjectIndex) ? item.name : subjectList[0].name,
 				        legendHoverLink: true,
 				        legendHoverLink: true,
 				        itemStyle: {
 				        itemStyle: {
 				            color: this.subjectColors[index],
 				            color: this.subjectColors[index],
@@ -390,7 +393,10 @@
 						barMaxWidth:30,
 						barMaxWidth:30,
 				        data: this.getSeriesData(val,index)
 				        data: this.getSeriesData(val,index)
 				    }
 				    }
-				    this.subjectSeries.push(seriesItem)
+					// 如果是全科情况 或者 是当前单科情况 则加入
+					if(isNaN(this.curSubjectIndex) || (!isNaN(this.curSubjectIndex) && this.curSubjectIndex === index)){
+						this.subjectSeries.push(seriesItem)
+					}
 				})
 				})
 				this.drawLine(val)
 				this.drawLine(val)
 			}
 			}
@@ -408,12 +414,13 @@
             }
             }
         },
         },
         watch: {
         watch: {
-            getBaseBarData(val) {
-                if (!val) return
-				console.log('BaseBar接收到watch的vuex',val)
-				// this.doRender(val)
-                // this.handleOptions(val.average)
-            }
+            subjectIndex:{
+				handler(n,o){
+					console.log(n)
+					this.curSubjectIndex = n
+					this.doRender(this.getBaseBarData)
+				},
+			}
         }
         }
     }
     }
 </script>
 </script>

+ 85 - 67
TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseScoreRateBar.vue

@@ -5,15 +5,27 @@
 <script>
 <script>
 	export default {
 	export default {
 		name: 'hello',
 		name: 'hello',
-		props: ['echartsId','echartsData'],
+		props:{
+			echartsId:{
+				type:String,
+				default:''
+			},
+			echartsData:{
+				type:Array,
+				default:() => []
+			},
+			subjectIndex:{
+				type:Number,
+				default:NaN
+			}
+		},
 		data() {
 		data() {
 			return {
 			return {
-				scoreRateCountArr:[],
-				splitArr:[10,20,30,40,50,60,70,80,90,100]
+				scoreRateCountArr: [],
+				splitArr: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
 			}
 			}
 		},
 		},
-		created() {
-		},
+		created() {},
 
 
 		methods: {
 		methods: {
 
 
@@ -35,13 +47,14 @@
 							},
 							},
 						},
 						},
 						formatter: function(value) {
 						formatter: function(value) {
-							let range = (that.splitArr[value[0].dataIndex] - 10) + '%-' + that.splitArr[value[0].dataIndex] + '%:'
+							let range = (that.splitArr[value[0].dataIndex] - 10) + '%-' + that.splitArr[value[0]
+								.dataIndex] + '%:'
 							return range + '<br>' + value[0].data + that.$t('unit.text7')
 							return range + '<br>' + value[0].data + that.$t('unit.text7')
 						}
 						}
 					},
 					},
 					legend: {
 					legend: {
 						top: '5%',
 						top: '5%',
-						right: '20%',
+						right: '50%',
 						data: ['人数'],
 						data: ['人数'],
 						textStyle: {
 						textStyle: {
 							fontSize: 12,
 							fontSize: 12,
@@ -54,8 +67,7 @@
 						containLabel: true,
 						containLabel: true,
 						height: 300,
 						height: 300,
 						width: '75%',
 						width: '75%',
-						top:'20%',
-						left: '8%',
+						right: '18%',
 						tooltip: {
 						tooltip: {
 							show: true,
 							show: true,
 							trigger: 'axis', // 触发类型
 							trigger: 'axis', // 触发类型
@@ -70,14 +82,14 @@
 						'xAxisIndex': [
 						'xAxisIndex': [
 							0
 							0
 						],
 						],
-						bottom: 40,
+						bottom: 10,
 						'start': 0,
 						'start': 0,
 						'end': 100,
 						'end': 100,
 						handleIcon: 'M512 497.821538m-418.264615 0a418.264615 418.264615 0 1 0 836.52923 0 418.264615 418.264615 0 1 0-836.52923 0Z',
 						handleIcon: 'M512 497.821538m-418.264615 0a418.264615 418.264615 0 1 0 836.52923 0 418.264615 418.264615 0 1 0-836.52923 0Z',
 						handleSize: '160%',
 						handleSize: '160%',
 						handleStyle: {
 						handleStyle: {
 							color: '#d3dee5'
 							color: '#d3dee5'
-					
+
 						},
 						},
 						textStyle: {
 						textStyle: {
 							color: '#fff'
 							color: '#fff'
@@ -101,17 +113,19 @@
 						axisLabel: {
 						axisLabel: {
 							color: '#aaaaaa',
 							color: '#aaaaaa',
 							margin: 10,
 							margin: 10,
-							align:'left'
+							align: 'left'
 						},
 						},
 						splitLine: {
 						splitLine: {
-						    show: true,
-						    lineStyle: {
-						        color: '#4c504a',
-						        width: 0.5,
-						        type: 'solid'
-						    }
+							show: true,
+							lineStyle: {
+								color: '#4c504a',
+								width: 0.5,
+								type: 'solid'
+							}
 						},
 						},
-						data: ['     10%', '     20%', '     30%', '     40%','     50%', '     60%', '     70%', '     80%','     90%', '   100%'],
+						data: ['     10%', '     20%', '     30%', '     40%', '     50%', '     60%',
+							'     70%', '     80%', '     90%', '   100%'
+						],
 
 
 					}],
 					}],
 					yAxis: [{
 					yAxis: [{
@@ -129,82 +143,86 @@
 							fontSize: 12,
 							fontSize: 12,
 						},
 						},
 						splitLine: {
 						splitLine: {
-						    show: true,
-						    lineStyle: {
-						        color: '#4c504a',
-						        width: 0.5,
-						        type: 'solid'
-						    }
+							show: true,
+							lineStyle: {
+								color: '#4c504a',
+								width: 0.5,
+								type: 'solid'
+							}
 						},
 						},
 						axisTick: {
 						axisTick: {
 							show: true
 							show: true
 						}
 						}
 					}],
 					}],
 					series: [{
 					series: [{
-							name: '人数',
-							type: 'bar',
-							label: {
-								show: true,
-								position: 'top',
-								fontSize: 14,
-								color: '#3DC3F0',
-								fontWeight: 'bold'
-							},
-							barMaxWidth: 40,
-							itemStyle: {
-								color: {
-									type: 'linear',
-									x: 0,
-									y: 0,
-									x2: 0,
-									y2: 1,
-									colorStops: [{
-										offset: 0,
-										color: '#3DC3F0' // 0% 处的颜色
-									}, {
-										offset: 1,
-										color: '#3486b1' // 100% 处的颜色
-									}]
-								}
-							},
-							data: that.scoreRateCountArr
+						name: '人数',
+						type: 'bar',
+						label: {
+							show: true,
+							position: 'top',
+							fontSize: 14,
+							color: '#3DC3F0',
+							fontWeight: 'bold'
+						},
+						barMaxWidth: 40,
+						itemStyle: {
+							color: {
+								type: 'linear',
+								x: 0,
+								y: 0,
+								x2: 0,
+								y2: 1,
+								colorStops: [{
+									offset: 0,
+									color: '#3DC3F0' // 0% 处的颜色
+								}, {
+									offset: 1,
+									color: '#3486b1' // 100% 处的颜色
+								}]
+							}
 						},
 						},
-					]
+						data: that.scoreRateCountArr
+					}, ]
 				};
 				};
 				// 绘制图表
 				// 绘制图表
+				myBar.clear()
 				myBar.setOption(option)
 				myBar.setOption(option)
 				window.addEventListener('resize', function() {
 				window.addEventListener('resize', function() {
-				    myBar.resize()
+					myBar.resize()
 				})
 				})
 			},
 			},
 
 
-			
+
 			/* 根据学生总体数据来换取得分率区间分布数据 */
 			/* 根据学生总体数据来换取得分率区间分布数据 */
-			doRender(list) {
-				let sRateArr = list.map(i => i.sRate)
+			doRender(list,isAll) {
+				let sRateArr = isAll ? list.map(i => i.sRate) : list.map(i => i.subjects[this.subjectIndex].sRate)
 				let splitArr = [...new Array(10).keys()]
 				let splitArr = [...new Array(10).keys()]
 				let result = new Array(10).fill(0)
 				let result = new Array(10).fill(0)
 				sRateArr.forEach(rate => {
 				sRateArr.forEach(rate => {
-					splitArr.forEach((j,index) => {
-						if(rate.toString().slice(0,1) === j.toString()){
+					splitArr.forEach((j, index) => {
+						if (rate.toString().slice(0, 1) === j.toString()) {
 							result[index]++
 							result[index]++
 						}
 						}
 					})
 					})
 				})
 				})
 				this.scoreRateCountArr = result
 				this.scoreRateCountArr = result
+				this.drawLine()
 			}
 			}
 		},
 		},
 		mounted() {
 		mounted() {
-			this.doRender(this.echartsData)
-			this.drawLine()
+			this.doRender(this.echartsData,isNaN(this.subjectIndex))
 		},
 		},
 		watch: {
 		watch: {
-			echartsData(val) {
-				this.doRender(val)
-				this.drawLine()
+			echartsData:{
+				handler(n,o){
+					this.doRender(n,isNaN(this.subjectIndex))
+				},
 			},
 			},
-			deep:true,
-			immediate:true
+			subjectIndex:{
+				handler(n,o){
+					this.doRender(this.echartsData,isNaN(n))
+				},
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>
@@ -212,7 +230,7 @@
 <style scoped>
 <style scoped>
 	.myScoreRateBar {
 	.myScoreRateBar {
 		width: 100%;
 		width: 100%;
-		height: 500px;
+		height: 400px;
 		margin: 0 auto;
 		margin: 0 auto;
 		display: block;
 		display: block;
 	}
 	}

+ 0 - 4
TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.vue

@@ -176,10 +176,6 @@
 						message: vm.$t('vote.form.ruleName'),
 						message: vm.$t('vote.form.ruleName'),
 						trigger: 'blur'
 						trigger: 'blur'
 					}],
 					}],
-					publishModel: [{
-						required: true,
-						trigger: 'change'
-					}],
 					description: [{
 					description: [{
 						required: true,
 						required: true,
 						message: vm.$t('vote.form.ruleDescription'),
 						message: vm.$t('vote.form.ruleDescription'),

+ 39 - 37
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/AchievementAnalysis/AchievementAnalysis.vue

@@ -5,26 +5,35 @@
             <span class="component-title" style="margin-top:40px">{{$t('totalAnalysis.ach_title1')}}</span>
             <span class="component-title" style="margin-top:40px">{{$t('totalAnalysis.ach_title1')}}</span>
         </Row>
         </Row>
         <Row class-name="component-percents">
         <Row class-name="component-percents">
-            <div class="percent-item" v-for="(item,index) in passRate" :key="index">
-                <div class="fl-col-center">
-                    <span class="percent-name">{{item.name}}</span>
-                    <span class="percent-value"><span class="percent-line" :style="{background:colorList[index]}"></span>{{item.sRate}} <span style="font-size: 22px;">%</span></span>
-					<div style="margin-left: 30px;">
-						<p>{{ $t('totalAnalysis.echarts_text15') }}:{{item.average.toFixed(1)}} </p>
-						<p>{{ $t('totalAnalysis.ach_table_text4') }}:{{item.standard.toFixed(1)}}</p>
-					</div>
-                </div>
-            </div>
+			<div v-for="(item,index) in passRate" :key="index">
+				<div class="percent-item" v-if="isAllSubject || (!isAllSubject && curSubjectIndex === (index - 1))">
+				    <div class="fl-col-center" >
+				        <span class="percent-name">{{item.name}}</span>
+				        <span class="percent-value"><span class="percent-line" :style="{background:colorList[index]}"></span>{{item.sRate}} <span style="font-size: 22px;">%</span></span>
+						<div style="margin-left: 30px;">
+							<p>{{ $t('totalAnalysis.echarts_text15') }}:{{item.average.toFixed(1)}} </p>
+							<p>{{ $t('totalAnalysis.ach_table_text4') }}:{{item.standard.toFixed(1)}}</p>
+						</div>
+				    </div>
+				</div>
+			</div>
+            
         </Row>
         </Row>
 		
 		
         <Row>
         <Row>
 			<Col span="12">
 			<Col span="12">
 				<span class="component-title">{{$t('totalAnalysis.ach_title2')}}</span>
 				<span class="component-title">{{$t('totalAnalysis.ach_title2')}}</span>
-				<BaseBar :echartsData="baseBarData" ref="baseBar"></BaseBar>
+				<BaseBar :echartsData="baseBarData" :subjectIndex="curSubjectIndex" ref="baseBar"></BaseBar>
 			</Col>
 			</Col>
 			<Col span="12">
 			<Col span="12">
-				<span class="component-title">{{$t('totalAnalysis.ach_title3')}}</span>
-				<BaseEntryBar :echartData="classDatas" echartsId="entryNumberBar"></BaseEntryBar>
+				<div v-if="isAllSubject">
+					<span class="component-title">{{$t('totalAnalysis.ach_title3')}}</span>
+					<BaseEntryBar :echartData="classDatas" echartsId="entryNumberBar"></BaseEntryBar>
+				</div>
+				<div v-else>
+					<span class="component-title">{{$t('totalAnalysis.scoreRate')}}</span>
+					<BaseScoreRateBar echartsId="sRateBar1" :subjectIndex="curSubjectIndex" :echartsData="getAnalysisJson.students"></BaseScoreRateBar>
+				</div>
 			</Col>
 			</Col>
 			<!-- <Col span="8">
 			<!-- <Col span="8">
 				<span class="component-title">{{$t('totalAnalysis.ach_title3')}}</span>
 				<span class="component-title">{{$t('totalAnalysis.ach_title3')}}</span>
@@ -33,38 +42,17 @@
         </Row>
         </Row>
 		
 		
 		<Row></Row>
 		<Row></Row>
-		<Row>
+		<Row v-if="isAllSubject">
 			<Col span="12">
 			<Col span="12">
 				<span class="component-title">{{$t('totalAnalysis.scoreRate')}}</span>
 				<span class="component-title">{{$t('totalAnalysis.scoreRate')}}</span>
-				<BaseScoreRateBar echartsId="sRateBar1" :echartsData="getAnalysisJson.students"></BaseScoreRateBar>
+				<BaseScoreRateBar echartsId="sRateBar11" :echartsData="getAnalysisJson.students"></BaseScoreRateBar>
 			</Col>
 			</Col>
 			<Col span="12">
 			<Col span="12">
 				
 				
 			</Col>
 			</Col>
 		</Row>
 		</Row>
-		
-		<!-- 进线人数统计 -->
-<!--        <Row>
-            <span class="component-title">{{$t('totalAnalysis.ach_title3')}}</span>
-            <div>
-                <BaseEntryBar :echartData="classDatas" echartsId="entryNumberBar2"></BaseEntryBar>
-            </div>
-        </Row>
-        <Divider /> -->
-		
 		<!-- 进线情况统计 -->
 		<!-- 进线情况统计 -->
-        <EntryTables ref="entryTable"></EntryTables>
-		
-		<!-- 进线率统计 -->
-<!--        <Row>
-            <span class="component-title">{{$t('totalAnalysis.ach_title6')}}</span>
-        </Row>
-        <Row type="flex" justify="space-around" class-name="base-table-row">
-            <Col span="24" class-name="achievement-table">
-            <BaseTable :columns="tableColumns" :tableDatas="earlyWarningData" ref="achievementTable" :tableName="$t('totalAnalysis.ach_title6')"  tableRef="achievementTable"></BaseTable>
-            </Col>
-        </Row> -->
-
+        <EntryTables ref="entryTable" :subjectIndex="curSubjectIndex"></EntryTables>
     </div>
     </div>
 </template>
 </template>
 
 
@@ -86,6 +74,8 @@
                 earlyWarningData: [],
                 earlyWarningData: [],
                 baseBarData: null,
                 baseBarData: null,
                 classDatas: [],
                 classDatas: [],
+				isAllSubject:true,
+				curSubjectIndex:NaN,
                 tableColumns: [
                 tableColumns: [
                     {
                     {
                         title: this.$t('totalAnalysis.base_class'),
                         title: this.$t('totalAnalysis.base_class'),
@@ -236,6 +226,18 @@
                     this.$refs.achievementTable.exportData(3)
                     this.$refs.achievementTable.exportData(3)
                 }
                 }
             })
             })
+			
+			
+			this.$EventBus.$off('onEarlySubjectChange')
+			this.$EventBus.$on('onEarlySubjectChange', index => {
+				if(index === 0){
+					this.isAllSubject = true
+					this.curSubjectIndex = NaN
+				}else{
+					this.isAllSubject = false
+					this.curSubjectIndex = index - 1
+				}
+			})
         },
         },
         computed: {
         computed: {
 			
 			

+ 5 - 8
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/AchievementAnalysis/EarlyWarning.vue

@@ -79,9 +79,7 @@
 		data() {
 		data() {
 			return {
 			return {
 				isAllSubject:true,
 				isAllSubject:true,
-				scoreRateBarData:{
-					students:[]
-				},
+				scoreRateBarData:[],
 				currentClass:{
 				currentClass:{
 					stuCount:0,
 					stuCount:0,
 					lineCount:0,
 					lineCount:0,
@@ -318,9 +316,8 @@
 						show: false,
 						show: false,
 						containLabel: true,
 						containLabel: true,
 						height: 300,
 						height: 300,
-						width: '80%',
-						top:'20%',
-						left: '8%',
+						width: '75%',
+						right:'18%',
 						tooltip: {
 						tooltip: {
 							show: true,
 							show: true,
 							trigger: 'axis', // 触发类型
 							trigger: 'axis', // 触发类型
@@ -335,7 +332,7 @@
 						'xAxisIndex': [
 						'xAxisIndex': [
 							0
 							0
 						],
 						],
-						bottom: 40,
+						bottom: 10,
 						'start': 0,
 						'start': 0,
 						'end': 100,
 						'end': 100,
 						handleIcon: 'M512 497.821538m-418.264615 0a418.264615 418.264615 0 1 0 836.52923 0 418.264615 418.264615 0 1 0-836.52923 0Z',
 						handleIcon: 'M512 497.821538m-418.264615 0a418.264615 418.264615 0 1 0 836.52923 0 418.264615 418.264615 0 1 0-836.52923 0Z',
@@ -540,7 +537,7 @@
 	}
 	}
 
 
 	#stuAverageBar {
 	#stuAverageBar {
-		height: 500px;
+		height: 400px;
 	}
 	}
 
 
 	.averageBarRow {
 	.averageBarRow {

+ 49 - 10
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/AchievementAnalysis/EntryTables.vue

@@ -27,6 +27,12 @@
 <script>
 <script>
     import BaseTable from '@/components/student-analysis/total/BaseMyTable.vue'
     import BaseTable from '@/components/student-analysis/total/BaseMyTable.vue'
     export default {
     export default {
+		props:{
+			subjectIndex:{
+				type:Number,
+				default:NaN
+			}
+		},
         components: {
         components: {
             BaseTable
             BaseTable
         },
         },
@@ -39,7 +45,11 @@
                 tipContent: '',
                 tipContent: '',
                 classList: [],
                 classList: [],
                 joinNum: 0,
                 joinNum: 0,
+				isAllSubject:true,
+				curSubjectIndex:0,
 				analysisJson:'',
 				analysisJson:'',
+				originNumberColumns:[],
+				originRateColumns:[],
                 entryNumberColumns: [
                 entryNumberColumns: [
                     {
                     {
                         title: this.$t('totalAnalysis.base_name'),
                         title: this.$t('totalAnalysis.base_name'),
@@ -108,7 +118,7 @@
                     {
                     {
                         title: this.$t('totalAnalysis.ach_text8'),
                         title: this.$t('totalAnalysis.ach_text8'),
                         key: 'entryNum',
                         key: 'entryNum',
-                        sortable: true
+                        sortable: true,
                     },
                     },
                     {
                     {
                         title: this.$t('totalAnalysis.ach_text9'),
                         title: this.$t('totalAnalysis.ach_text9'),
@@ -141,6 +151,9 @@
 			
 			
 			this.analysisJson = this.getAnalysisJson
 			this.analysisJson = this.getAnalysisJson
 			console.log(this.analysisJson)
 			console.log(this.analysisJson)
+			
+			this.originNumberColumns = JSON.parse(JSON.stringify(this.entryNumberColumns))
+			this.originRateColumns = JSON.parse(JSON.stringify(this.entryRateColumns))
         },
         },
 
 
         methods: {
         methods: {
@@ -150,16 +163,28 @@
                 // 渲染进线表格
                 // 渲染进线表格
                 let subjectList = data.classes[0].subjects
                 let subjectList = data.classes[0].subjects
 				let subjectColumns = []
 				let subjectColumns = []
-                subjectList.forEach(item => {
+                subjectList.forEach((item,index) => {
                     let subjectColumn = {
                     let subjectColumn = {
                         title: item.name,
                         title: item.name,
                         sortable: 'custom',
                         sortable: 'custom',
                         key: item.name
                         key: item.name
                     }
                     }
-					subjectColumns.push(subjectColumn)
+					if(this.isAllSubject || (!this.isAllSubject && this.curSubjectIndex === index )){
+						subjectColumns.push(subjectColumn)
+					}
                 })
                 })
 				// 清除之前的科目columns 添加当前评测的科目columns
 				// 清除之前的科目columns 添加当前评测的科目columns
 				this.entryNumberColumns.splice(4,this.entryNumberColumns.length - 4,...subjectColumns)
 				this.entryNumberColumns.splice(4,this.entryNumberColumns.length - 4,...subjectColumns)
+				console.log(this.isAllSubject)
+				// if(!this.isAllSubject){
+				// 	this.entryRateColumns = this.originRateColumns.filter(i => i.key !== 'entryNum')
+				// 	this.entryNumberColumns = this.originNumberColumns.filter(i => i.key !== 'score')
+				// }else{
+				// 	this.entryRateColumns = this.originRateColumns
+				// 	this.entryNumberColumns = this.originNumberColumns
+				// }
+				
+				console.log(this.entryRateColumns)
             },
             },
 			
 			
 			/* 获取进线情况统计表格数据 */
 			/* 获取进线情况统计表格数据 */
@@ -170,11 +195,13 @@
 						name:stu.name,
 						name:stu.name,
 						className:stu.className,
 						className:stu.className,
 						gradeRank:0,
 						gradeRank:0,
-						score:stu.total,
+						score:this.isAllSubject ? stu.total : stu.subjects[this.curSubjectIndex].score,
 					})
 					})
 					// 动态添加学生每个科目的得分
 					// 动态添加学生每个科目的得分
-					stu.subjects.forEach(subject => {
-						result[stuIndex][subject.name] = subject.score
+					stu.subjects.forEach((subject,subjectIndex)=> {
+						if(this.isAllSubject || (!this.isAllSubject && this.curSubjectIndex === subjectIndex )){
+							result[stuIndex][subject.name] = subject.score
+						}
 					})
 					})
 				})
 				})
 				/* 根据表格每个学生的总分来进行排序 */
 				/* 根据表格每个学生的总分来进行排序 */
@@ -187,6 +214,7 @@
 			
 			
 			/* 获取进线率统计数据 */
 			/* 获取进线率统计数据 */
 			getEntryBarData(analysisJson){
 			getEntryBarData(analysisJson){
+				console.log(this.isAllSubject)
 				let result = []
 				let result = []
 				analysisJson.classes.forEach((classItem,classIndex) => {
 				analysisJson.classes.forEach((classItem,classIndex) => {
 					result.push({
 					result.push({
@@ -194,10 +222,10 @@
 						className:classItem.className,
 						className:classItem.className,
 						entryNum:classItem.lineCount,
 						entryNum:classItem.lineCount,
 						totalNum:classItem.stuCount,
 						totalNum:classItem.stuCount,
-						csRate:classItem.csRate + '%',
+						csRate:this.isAllSubject ? classItem.csRate + '%' : classItem.subjects[this.curSubjectIndex].sRate + '%',
 						overAverageRate:classItem.stuCount > 0 ? ((classItem.lineCount / classItem.stuCount) * 100).toFixed(2) : 0.00,
 						overAverageRate:classItem.stuCount > 0 ? ((classItem.lineCount / classItem.stuCount) * 100).toFixed(2) : 0.00,
-						average:classItem.totalAverage.toFixed(1),
-						standardDeviation:classItem.standardDeviation.toFixed(1),
+						average:this.isAllSubject ? classItem.totalAverage.toFixed(1) : classItem.subjects[this.curSubjectIndex].average.toFixed(1),
+						standardDeviation:this.isAllSubject ? classItem.standardDeviation.toFixed(1) : classItem.subjects[this.curSubjectIndex].standard.toFixed(1),
 					})
 					})
 				})
 				})
 				/* 根据超均率 来对班级进行年级排名 */
 				/* 根据超均率 来对班级进行年级排名 */
@@ -227,6 +255,7 @@
 				this.entryRateColumns[1].filters = filterArr
 				this.entryRateColumns[1].filters = filterArr
 				this.entryNumberColumns[1].filters = filterArr
 				this.entryNumberColumns[1].filters = filterArr
             }
             }
+			
         },
         },
         computed: {
         computed: {
             getAnalysisJson() {
             getAnalysisJson() {
@@ -239,7 +268,17 @@
 				this.renderColumns(val)
 				this.renderColumns(val)
 				this.entryTableData = this.getTableDatas(val)
 				this.entryTableData = this.getTableDatas(val)
 				this.entryBarData = this.getEntryBarData(val)
 				this.entryBarData = this.getEntryBarData(val)
-            }
+            },
+			subjectIndex:{
+				handler(n,o){
+					this.isAllSubject = isNaN(n)
+					this.curSubjectIndex = n
+					let val = this.$store.state.totalAnalysis.analysisJson
+					this.renderColumns(val)
+					this.entryTableData = this.getTableDatas(val)
+					this.entryBarData = this.getEntryBarData(val)
+				},
+			}
         }
         }
     }
     }
 </script>
 </script>

+ 2 - 2
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/index.vue

@@ -67,7 +67,7 @@
 							<Select v-model="currentClass" @on-change="onClassSelect" class="analysis-select">
 							<Select v-model="currentClass" @on-change="onClassSelect" class="analysis-select">
 								<Option v-for="(item,index) in classList" :value="index" :key="item">{{ item }}</Option>
 								<Option v-for="(item,index) in classList" :value="index" :key="item">{{ item }}</Option>
 							</Select>
 							</Select>
-							<div class="subject-tab" v-if="currentClass !== 0">
+							<div class="subject-tab">
 								<span v-for="(subject,subjectIndex) in getSubjectList" :key="subjectIndex" @click="onEarlySubjectChange(subjectIndex)" :class="['subject-tab-item',curWarningSubjectIndex === subjectIndex ? 'subject-tab-item-active' : '']">{{ subject }}</span>
 								<span v-for="(subject,subjectIndex) in getSubjectList" :key="subjectIndex" @click="onEarlySubjectChange(subjectIndex)" :class="['subject-tab-item',curWarningSubjectIndex === subjectIndex ? 'subject-tab-item-active' : '']">{{ subject }}</span>
 							</div>
 							</div>
 						</div>
 						</div>
@@ -387,7 +387,7 @@
 				this.subjectSelectVal = this.$store.state.totalAnalysis.currentSubject
 				this.subjectSelectVal = this.$store.state.totalAnalysis.currentSubject
 				/* 如果是成绩分析则要加入全科统计栏目 */
 				/* 如果是成绩分析则要加入全科统计栏目 */
 				if(this.dataSelectIndex === '0'){
 				if(this.dataSelectIndex === '0'){
-					return ['全科',...this.$store.state.totalAnalysis.subjectList] 
+					return [this.$t('totalAnalysis.allSubjects'),...this.$store.state.totalAnalysis.subjectList] 
 				}else{
 				}else{
 					return this.$store.state.totalAnalysis.subjectList
 					return this.$store.state.totalAnalysis.subjectList
 				}
 				}