| 
					
				 | 
			
			
				@@ -0,0 +1,79 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  <div class="app-container" v-loading="loading"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <el-card> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <mx-condition :query-params="queryParams" :require-fields="requireFields" @query="handleQuery" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    @invalid="handleInvalid" label-width="80px"></mx-condition> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </el-card> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <evaluation-empty v-if="emptyTitle" :title="emptyTitle" class="mt20"></evaluation-empty> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <dynamic-table v-else class="mt20"></dynamic-table> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import MxCondition from '@/components/MxCondition/mx-condition' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { getStudentSelected } from '@/api/webApi/elective/selected-subject' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import config from '@/common/mx-config' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { mapGetters } from 'vuex' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import DynamicTable from '@/components/dynamic-table/index' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  name: 'ElectiveReleaseList', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  components: { DynamicTable, MxCondition }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  data() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      loading: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // query params 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      queryParams: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        studentRoundId: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        releaseGeneration: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        releaseQueryCode: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      requireFields: ['studentRoundId', 'releaseGeneration', 'releaseQueryCode'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // status & results 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      electiveStatus: null, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      releaseSummary: null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  computed: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ...mapGetters(['currentUser']), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    mappedParams() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        year: this.currentUser.year, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        roundId: this.queryParams.studentRoundId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        generation: this.queryParams.releaseGeneration, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        queryCode: this.queryParams.releaseQueryCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    currentOpt() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      return Object.values(config.electiveGenerationOptions).find(opt => opt.value == this.electiveStatus?.currentGeneration) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    releaseOpt() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      return Object.values(config.electiveGenerationOptions).find(opt => opt.value == this.queryParams.releaseGeneration) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    emptyTitle() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (!this.electiveStatus) return '暂无数据' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (this.electiveStatus.currentGeneration <= config.electiveGenerationOptions.init.value) return '选科未开启' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (this.queryParams.releaseGeneration > this.electiveStatus.currentGeneration) return '选科还未进行至' + this.releaseOpt.title 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      return '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  methods: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    async handleQuery() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (this.queryParams.studentRoundId != this.electiveStatus?.selectResult?.roundId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const resStatus = await getStudentSelected(this.mappedParams) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.electiveStatus = resStatus.data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.electiveStatus.currentGeneration = 3 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // const summary = await getClass 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    handleInvalid() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.electiveStatus = null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.releaseSummary = null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<style scoped> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</style> 
			 |