浏览代码

elective report + ai report

hare8999@163.com 2 年之前
父节点
当前提交
2349824f85

+ 44 - 0
src/views/elective/report/components/elective-ai-analysis-step.vue

@@ -0,0 +1,44 @@
+<template>
+  <div class="elective-ai-container">
+    <el-divider><h1>{{ simulateActive.title }}AI分析</h1></el-divider>
+    <index-card :title="`${simulateActive.title}AI分析表`">
+      <elective-ai-table :generation="generation" :optional-majors="inheritOptionalMajors" readonly></elective-ai-table>
+    </index-card>
+    <index-card :title="`${simulateActive.title}AI分析报告`" class="mt20">
+      <elective-ai-report :generation="generation"></elective-ai-report>
+    </index-card>
+  </div>
+</template>
+
+<script>
+import RoundSelect from '@/views/system/user/profile/round-select'
+import ElectiveAiTable from '@/views/elective/select/components/elective-ai-table'
+import ElectiveAiReport from '@/views/elective/select/components/elective-ai-report'
+import IndexCard from '@/views/index/components/index-card'
+
+export default {
+  name: 'elective-ai-analysis-step',
+  components: { IndexCard, ElectiveAiReport, ElectiveAiTable },
+  extends: RoundSelect, // NOTE: 这里也扩展了RoundSelect,是想以最小的代码成本,制造generation的副本
+  props: ['simulateActive', 'inheritGeneration', 'inheritOptionalMajors'],
+  data() {
+    return {
+      autoLoad: false, // NOTE: 重写RoundSelect防止加载完整数据 !!important
+      selectObj: this.inheritGeneration.status,
+      activeStep: this.simulateActive.key,
+      generationModels: this.inheritGeneration.models
+    }
+  }
+}
+</script>
+
+<style scoped>
+/deep/ .elective-ai-container > .el-divider {
+  margin: 40px 0;
+}
+
+h1 {
+  font-size: 36px;
+  margin: 0;
+}
+</style>

+ 43 - 0
src/views/elective/report/components/elective-ai-analysis.vue

@@ -0,0 +1,43 @@
+<template>
+  <div>
+    <elective-ai-analysis-step v-for="step in hasAISteps" :key="step.key"
+                               :simulate-active="step" :inherit-generation="generation"
+                               :inherit-optional-majors="optionalMajors"></elective-ai-analysis-step>
+  </div>
+</template>
+
+<script>
+/*
+* NOTE: 此组件主要用于筛选需要展示AI分析报告的步骤,为子组件提供step
+* */
+import ElectiveToolMixin from '@/views/elective/select/components/elective-tools-mixins'
+import ElectiveAiAnalysisStep from '@/views/elective/report/components/elective-ai-analysis-step'
+
+export default {
+  components: { ElectiveAiAnalysisStep },
+  mixins: [ElectiveToolMixin],
+  name: 'elective-ai-analysis',
+  inject: ['getGeneration', 'getOptionalMajors'],
+  computed: {
+    optionalMajors() {
+      return this.getOptionalMajors() || []
+    },
+    generation() {
+      return this.getGeneration() || {}
+    },
+    hasAISteps() {
+      if (!this.generation.models?.length) return []
+      const allOpts = this.generation.options
+      const allModels = this.generation.models
+      const applyOpts = Object.values(allOpts)
+        .filter(opt => !opt.decisionMaking && opt.stepsVisible && opt.value > allOpts.primary.value)
+      const enrollIdx = applyOpts.findIndex(opt => allModels.find(m => m.option == opt).models.some(this.isGroupEnrolled))
+      return enrollIdx > -1 ? applyOpts.slice(0, enrollIdx) : applyOpts
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 16 - 17
src/views/elective/report/index.vue

@@ -1,22 +1,22 @@
 <template>
   <div class="app-container fx-column fx-sta-cen">
     <div class="elective-report-container">
-      <template v-if="false">
-        <el-divider><h1>选科测评报告</h1></el-divider>
-        <elective-test-reports></elective-test-reports>
-        <el-divider><h1>选科大数据分析</h1></el-divider>
-        <group-subject-query></group-subject-query>
-        <el-divider><h1>自选专业</h1></el-divider>
-        <major-match-optional></major-match-optional>
-        <el-divider><h1>专业介绍</h1></el-divider>
-        <major-introduce-batch></major-introduce-batch>
-        <el-divider><h1>选科成绩表</h1></el-divider>
-        <group-score-table></group-score-table>
-        <el-divider><h1>选科进程表</h1></el-divider>
-        <elective-flow-table></elective-flow-table>
-      </template>
+      <el-divider><h1>选科测评报告</h1></el-divider>
+      <elective-test-reports></elective-test-reports>
+      <el-divider><h1>选科大数据分析</h1></el-divider>
+      <group-subject-query></group-subject-query>
+      <el-divider><h1>自选专业</h1></el-divider>
+      <major-match-optional></major-match-optional>
+      <el-divider><h1>专业介绍</h1></el-divider>
+      <major-introduce-batch></major-introduce-batch>
+      <el-divider><h1>选科成绩表</h1></el-divider>
+      <group-score-table></group-score-table>
+      <el-divider><h1>选科进程表</h1></el-divider>
+      <elective-flow-table></elective-flow-table>
       <el-divider><h1>选科录取分析报告</h1></el-divider>
       <elective-enroll-analysis></elective-enroll-analysis>
+      <!-- AI分析可能有也可能没有,在elective-ai-analysis内部控制 -->
+      <elective-ai-analysis></elective-ai-analysis>
     </div>
   </div>
 </template>
@@ -31,11 +31,13 @@ import MajorIntroduceBatch from '@/views/elective/report/components/major-introd
 import GroupScoreTable from '@/views/elective/report/components/group-score-table'
 import ElectiveFlowTable from '@/views/elective/report/components/elective-flow-table'
 import ElectiveEnrollAnalysis from '@/views/elective/report/components/elective-enroll-analysis'
+import ElectiveAiAnalysis from '@/views/elective/report/components/elective-ai-analysis'
 
 export default {
   name: 'report-index',
   extends: RoundSelect,
   components: {
+    ElectiveAiAnalysis,
     ElectiveEnrollAnalysis,
     ElectiveFlowTable,
     GroupScoreTable,
@@ -60,9 +62,6 @@ export default {
       getOptionalMajors: () => this.optionalMajors,
       getEvaluationMajors: () => this.evaluationMajors
     }
-  },
-  mounted() {
-    window.reportVue = this
   }
 }
 </script>

+ 7 - 113
src/views/elective/select/components/elective-ai-report-dialog.vue

@@ -1,79 +1,6 @@
 <template>
-  <el-dialog
-    append-to-body
-    v-if="dialogVisible"
-    title="选科过程报告"
-    :visible.sync="dialogVisible"
-    width="70%"
-  >
-    <div>
-      <div class="mb10" >
-        <p class="mb5">1,报名情况:</p>
-          <span v-if="approved">恭喜</span>
-          <span  v-if="!appliedModel.selectedList.length">
-            <span>您在{{subTitle(appliedModel.option.title)}}阶段未填报,</span>
-          </span>
-          <span  v-else-if="appliedModel.selectedList.some(m=>m.rejected)">
-            <span>您在{{subTitle(appliedModel.option.title)}}阶段拒绝填报了</span>
-            <span class="f-red"> {{apply.toString(',')}} </span>组合,
-          </span>
-          <span v-else>
-            <span>您在{{subTitle(appliedModel.option.title)}}阶段填报的</span>
-            <span :class="approved ? 'f-primary': 'f-red'"> {{apply.toString(',')}}组合 </span>
-            <span  v-if="approved">已被录取</span>
-            <span v-else>未被录取</span>,
-          </span>
-          <span>学校现在所开设的{{activeModel.models.length}}种科目,现有 <span class="f-primary">{{ canSign.map(item => item.groupName).join(',') }} </span> {{canSign.length}}个科目缺额, </span>
-          <span>系统推荐您 <span class="f-primary">{{activeModel.models.find(item => item.isRecommend).groupName}}</span> 科目组合</span>
-      </div>
-      <div>
-        <div class="mb10">
-          <p class="mb5">2,专业符合情况:</p>
-          <div class="mb5" v-for="item in canSign">
-            <div class="f-primary mr5 mb5"> {{item.groupName}}{{item.groupName == recommend ? '(系统推荐科目组合)' : ''}}</div>
-            <div style="display: inline" v-if="item.colleges.length > 0">
-              <span class="mr5" v-for="college in item.colleges">{{ college.college }}:{{college.major}}。</span>
-              符合您的专业要求;
-            </div>
-            <p style="display: inline" class="f-red" v-else>该组合没有您自选的专业</p>
-          </div>
-        </div>
-        <div class="mb10">
-          <p class="mb5">3,成绩情况:</p>
-          <div v-for="(item,index) in canSign" class="mb10">
-            <div class="mb5">{{ item.groupName }}:{{index == 0 ? '(成绩最优)': ''}}</div>
-            <div>成绩{{ item.scoreSumGroup }}</div>
-          </div>
-        </div>
-        <div class="mb10">
-          <p class="mb5">4,录取分析:</p>
-          <p  class="f-primary">系统推荐:{{recommend}}{{canSign[0].groupName == recommend ? '成绩最优组合' : ''}}</p>
-          <p>您所在学校参与{{activeModel.option.title}}的学生共计有{{activeModel.disenrollCount}}人</p>
-          <p>您在未录满的{{canSign.length}}个组合中,全校{{ activeModel.option.title }}人数排名如下:</p>
-          <p v-for="item in canSign">
-            {{item.groupName}} <span class="f-red">{{item.rankInDisenroll}}</span> 名 <span>{{`(${item.rankInDisenroll}/${activeModel.disenrollCount})`}}</span>
-          </p>
-          <p>计划数如下:</p>
-          <p v-for="item in canSign">{{item.groupName}} <span class="f-red">{{item.groupIndicator}}</span> 人</p>
-          <p>成绩最优人数如下:</p>
-          <p v-for="item in canSign">{{item.groupName}} <span class="f-red">{{item.bestInIndicator}}</span> 人</p>
-          <p class="f-red">
-            您在{{canSign.length}}个缺额组合中{{bestAchieve.groupName}}成绩最优组合{{ bestAchieve.scoreSumGroup }}分,
-            在该组合最优人数{{ bestAchieve.bestInIndicator }}人中,排名第{{bestAchieve.rankInBest}}名,
-            全校排名第{{bestAchieve.rankInDisenroll}}名,计划数为{{bestAchieve.groupIndicator}}人
-            <span v-if="section.must">
-              ,您可以被该组合录取。
-            </span>
-            <span v-else-if="section.maybe">
-              ,如果没有其他学生在该组合全校排名比您高且填报该组合,您可以被该组合录取。
-            </span>
-            <span v-else>
-              ,所以您不能被成绩最优组合{{bestAchieve.groupName}}录取,系统推荐您报名{{recommend}}组合
-            </span>
-          </p>
-        </div>
-      </div>
-    </div>
+  <el-dialog v-if="dialogVisible" :visible.sync="dialogVisible" append-to-body title="选科过程报告" width="70%">
+    <elective-ai-report generation="generation"></elective-ai-report>
     <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="dialogVisible =false">确 定</el-button>
       </span>
@@ -83,11 +10,12 @@
 import MxSelectTranslateMixin from '@/components/Cache/modules/mx-select-translate-mixin.js'
 import ElectiveEnrollInfo from '@/views/elective/select/components/elective-enroll-info'
 import ElectiveToolsMixin from '@/views/elective/select/components/elective-tools-mixins'
-// import ElectiveTableMixin from '@/views/elective/select/components/elective-table-mixins'
+import ElectiveAiReport from '@/views/elective/select/components/elective-ai-report'
 
 export default {
   name: 'elective-ai-report-dialog',
-  mixins: [MxSelectTranslateMixin, ElectiveToolsMixin,ElectiveEnrollInfo],
+  components: { ElectiveAiReport },
+  mixins: [MxSelectTranslateMixin, ElectiveToolsMixin, ElectiveEnrollInfo],
   props: {
     generation: {
       type: Object,
@@ -96,46 +24,12 @@ export default {
   },
   data() {
     return {
-      dialogVisible: false,
-      singleRow: {}
-    }
-  },
-  computed: {
-    // 1报名情况 填报组合
-    apply(){
-      return this.appliedModel.selectedList.map(item => item.groupName)
-    },
-    // 1报名情况 推荐组合
-    recommend() {
-      return this.activeModel.models.find(item => item.isRecommend)?.groupName
-    },
-    activeModel() {
-      if (!this.generation) return {}
-      return this.generation.activeModel
-    },
-    // 成绩最优
-    bestAchieve(){
-      return this.canSign[0]
-    },
-    section() {
-      return {
-        must: this.bestAchieve.rankInDisenroll <= this.bestAchieve.groupIndicator, // 可以录
-        maybe: this.bestAchieve.rankInBest <= this.bestAchieve.groupIndicator  && this.bestAchieve.rankInDisenroll > this.bestAchieve.groupIndicator, // 可能录上
-        other: '', // 录不上,可以报推荐
-      }
-    },
-    canSign() {
-      // if (!this.reportInfo.length) return []
-      return this.activeModel.models.filter(item => {
-        return item.allowSelect
-      }).sort((prev, next) => prev.scoreSumGroup < next.scoreSumGroup ? 1 : -1)
+      dialogVisible: false
     }
   },
   methods: {
-    init(type, row) {
-      this.aiType = type
+    init() {
       this.dialogVisible = true
-      this.singleRow = row
     }
   }
 }

+ 123 - 0
src/views/elective/select/components/elective-ai-report.vue

@@ -0,0 +1,123 @@
+<template>
+  <div>
+    <div class="mb10">
+      <p class="mb5">1,报名情况:</p>
+      <span v-if="approved">恭喜</span>
+      <span v-if="!appliedModel.selectedList.length">
+            <span>您在{{ subTitle(appliedModel.option.title) }}阶段未填报,</span>
+          </span>
+      <span v-else-if="appliedModel.selectedList.some(m=>m.rejected)">
+            <span>您在{{ subTitle(appliedModel.option.title) }}阶段拒绝填报了</span>
+            <span class="f-red"> {{ apply.toString(',') }} </span>组合,
+          </span>
+      <span v-else>
+            <span>您在{{ subTitle(appliedModel.option.title) }}阶段填报的</span>
+            <span :class="approved ? 'f-primary': 'f-red'"> {{ apply.toString(',') }}组合 </span>
+            <span v-if="approved">已被录取</span>
+            <span v-else>未被录取</span>,
+          </span>
+      <span>学校现在所开设的{{ activeModel.models.length }}种科目,现有 <span class="f-primary">{{
+          canSign.map(item => item.groupName).join(',')
+        }} </span> {{ canSign.length }}个科目缺额, </span>
+      <span>系统推荐您 <span class="f-primary">{{ activeModel.models.find(item => item.isRecommend).groupName }}</span> 科目组合</span>
+    </div>
+    <div>
+      <div class="mb10">
+        <p class="mb5">2,专业符合情况:</p>
+        <div class="mb5" v-for="item in canSign">
+          <div class="f-primary mr5 mb5"> {{ item.groupName }}{{ item.groupName == recommend ? '(系统推荐科目组合)' : '' }}
+          </div>
+          <div style="display: inline" v-if="item.colleges.length > 0">
+            <span class="mr5" v-for="college in item.colleges">{{ college.college }}:{{ college.major }}。</span>
+            符合您的专业要求;
+          </div>
+          <p style="display: inline" class="f-red" v-else>该组合没有您自选的专业</p>
+        </div>
+      </div>
+      <div class="mb10">
+        <p class="mb5">3,成绩情况:</p>
+        <div v-for="(item,index) in canSign" class="mb10">
+          <div class="mb5">{{ item.groupName }}:{{ index == 0 ? '(成绩最优)' : '' }}</div>
+          <div>成绩{{ item.scoreSumGroup }}</div>
+        </div>
+      </div>
+      <div class="mb10">
+        <p class="mb5">4,录取分析:</p>
+        <p class="f-primary">系统推荐:{{ recommend }}{{ canSign[0].groupName == recommend ? '成绩最优组合' : '' }}</p>
+        <p>您所在学校参与{{ activeModel.option.title }}的学生共计有{{ activeModel.disenrollCount }}人</p>
+        <p>您在未录满的{{ canSign.length }}个组合中,全校{{ activeModel.option.title }}人数排名如下:</p>
+        <p v-for="item in canSign">
+          {{ item.groupName }} <span class="f-red">{{ item.rankInDisenroll }}</span> 名
+          <span>{{ `(${item.rankInDisenroll}/${activeModel.disenrollCount})` }}</span>
+        </p>
+        <p>计划数如下:</p>
+        <p v-for="item in canSign">{{ item.groupName }} <span class="f-red">{{ item.groupIndicator }}</span> 人</p>
+        <p>成绩最优人数如下:</p>
+        <p v-for="item in canSign">{{ item.groupName }} <span class="f-red">{{ item.bestInIndicator }}</span> 人</p>
+        <p class="f-red">
+          您在{{ canSign.length }}个缺额组合中{{ bestAchieve.groupName }}成绩最优组合{{ bestAchieve.scoreSumGroup }}分,
+          在该组合最优人数{{ bestAchieve.bestInIndicator }}人中,排名第{{ bestAchieve.rankInBest }}名,
+          全校排名第{{ bestAchieve.rankInDisenroll }}名,计划数为{{ bestAchieve.groupIndicator }}人
+          <span v-if="section.must">
+              ,您可以被该组合录取。
+            </span>
+          <span v-else-if="section.maybe">
+              ,如果没有其他学生在该组合全校排名比您高且填报该组合,您可以被该组合录取。
+            </span>
+          <span v-else>
+              ,所以您不能被成绩最优组合{{ bestAchieve.groupName }}录取,系统推荐您报名{{ recommend }}组合
+            </span>
+        </p>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import MxSelectTranslateMixin from '@/components/Cache/modules/mx-select-translate-mixin.js'
+import ElectiveEnrollInfo from '@/views/elective/select/components/elective-enroll-info'
+import ElectiveToolsMixin from '@/views/elective/select/components/elective-tools-mixins'
+
+export default {
+  name: 'elective-ai-report',
+  mixins: [MxSelectTranslateMixin, ElectiveToolsMixin, ElectiveEnrollInfo],
+  props: {
+    generation: {
+      type: Object,
+      default: {}
+    }
+  },
+  computed: {
+    // 1报名情况 填报组合
+    apply() {
+      return this.appliedModel.selectedList.map(item => item.groupName)
+    },
+    // 1报名情况 推荐组合
+    recommend() {
+      return this.activeModel.models.find(item => item.isRecommend)?.groupName
+    },
+    activeModel() {
+      if (!this.generation) return {}
+      return this.generation.activeModel
+    },
+    // 成绩最优
+    bestAchieve() {
+      return this.canSign[0]
+    },
+    section() {
+      return {
+        must: this.bestAchieve.rankInDisenroll <= this.bestAchieve.groupIndicator, // 可以录
+        maybe: this.bestAchieve.rankInBest <= this.bestAchieve.groupIndicator && this.bestAchieve.rankInDisenroll > this.bestAchieve.groupIndicator, // 可能录上
+        other: '' // 录不上,可以报推荐
+      }
+    },
+    canSign() {
+      // if (!this.reportInfo.length) return []
+      return this.activeModel.models.filter(item => {
+        return item.allowSelect
+      }).sort((prev, next) => prev.scoreSumGroup < next.scoreSumGroup ? 1 : -1)
+    }
+  }
+}
+</script>
+<style scoped>
+</style>

+ 8 - 4
src/views/system/user/profile/round-select.vue

@@ -35,8 +35,8 @@
           <elective-generation-steps v-model="activeStep" v-if="selectObj" :generation="generation"
                                      disable-hidden-feature></elective-generation-steps>
         </template>
-        <report-table v-if="activeModel&&activeModel.models" :generation="generation"
-                      :optional-majors="optionalMajors"></report-table>
+        <elective-table v-if="activeModel&&activeModel.models" :generation="generation"
+                        :optional-majors="optionalMajors"></elective-table>
         <evaluation-empty v-else :shadow="false" :title="emptyTitle"></evaluation-empty>
       </el-card>
     </div>
@@ -59,7 +59,7 @@
 import TestEntry from '@/views/elective/test/components/test-entry'
 import TestResult from '@/views/elective/test/components/test-result'
 import SelectSubject from '@/views/system/user/profile/components/select-subject'
-import ReportTable from '@/views/elective/select/components/elective-table'
+import ElectiveTable from '@/views/elective/select/components/elective-table'
 import ElectiveGenerationSteps from '@/views/elective/generation/components/elective-generation-steps'
 import TransferMixin from '@/components/mx-transfer-mixin'
 import ElectiveToolsMixin from '../../../elective/select/components/elective-tools-mixins'
@@ -79,10 +79,13 @@ export default {
       refreshData: this.refreshData
     }
   },
-  components: { SelectSubject, TestResult, TestEntry, ReportTable, ElectiveGenerationSteps },
+  components: { SelectSubject, TestResult, TestEntry, ElectiveTable, ElectiveGenerationSteps },
   name: 'round-select',
   data() {
     return {
+      // 22.9.6 新增字段,用来标识组件是否需要自动加载数据(选科elective-ai-analysis需要模拟多种activeStep状态)
+      autoLoad: true,
+      // help fields
       helpVideo: {
         visible: false,
         src: '9fca0b997b8346ce8c3ce69feaf89294',
@@ -166,6 +169,7 @@ export default {
   },
   mounted() {
     try {
+      if (!this.autoLoad) return
       this.loading = true
       this.loadStudentSelected()
     } finally {