Procházet zdrojové kódy

elective student - code clean

hare8999@163.com před 2 roky
rodič
revize
0b8e688749

+ 12 - 15
src/views/elective/select/components/elective-ai-analysis-dialog.vue

@@ -1,40 +1,37 @@
 <template>
-  <el-dialog
-    v-if="dialogVisible"
-    title="AI分析"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal ="false"
-    width="80%"
-  >
-    <p class="mb10"><el-button type="primary" @click="toReport('all')">整体报告</el-button></p>
-    <ai-table :generation="generation" :optionalMajors="optionalMajors"></ai-table>
+  <el-dialog v-if="dialogVisible" title="AI分析" :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%">
+    <el-button type="primary" @click="toReport('all')" class="mb10">整体报告</el-button>
+    <elective-ai-table ref="aiTable" :generation="generation" :optionalMajors="optionalMajors"></elective-ai-table>
     <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
     </span>
   </el-dialog>
 </template>
 <script>
-import SingleSubjectReport from '../../../system/user/profile/components/single-subject-report'
-import AiTable from './elective-ai-table'
 
 
+import ElectiveAiTable from '@/views/elective/select/components/elective-ai-table'
+
 export default {
   name: 'elective-ai-analysis-dialog',
-  components:{
-    AiTable
+  components: {
+    ElectiveAiTable
   },
   props: {
     generation: Object,
     optionalMajors: { type: Array, default: () => [] }
   },
   data() {
-    return{
-      dialogVisible:false,
+    return {
+      dialogVisible: false
     }
   },
   methods: {
     open(rows) {
       this.dialogVisible = true
+    },
+    toReport(type) {
+      this.$refs.aiTable.toReport(type)
     }
   }
 }

+ 4 - 12
src/views/system/user/profile/components/single-subject-report.vue → src/views/elective/select/components/elective-ai-report-dialog.vue

@@ -47,7 +47,9 @@
                 <p>{{ item.groupName }} : 成绩{{ item.scoreSumGroup }}<span class="f-primary" v-if="index == 0"> (补录成绩最优组合)</span>
                 </p>
                 <p>
-                  在补录学生{{ tipsModel.countNumber }}人中该组合成绩最优学生有{{ item.bestInIndicator }}人,该组合计划人数为{{ item.groupIndicator }}
+                  在补录学生{{ tipsModel.countNumber }}人中该组合成绩最优学生有{{ item.bestInIndicator }}人,该组合计划人数为{{
+                    item.groupIndicator
+                  }}
                   您在该<span v-if="index == 0">最优</span>组合中排名{{ item.rankInBest }},您可以被该组合录取。您的成绩符合该组合。<span
                   v-if="item.colleges.length == 0"
                 >(自选专业不符合)</span>
@@ -70,7 +72,7 @@
 import MxSelectTranslateMixin from '@/components/Cache/modules/mx-select-translate-mixin.js'
 
 export default {
-  name: 'subject-report',
+  name: 'elective-ai-report-dialog',
   mixins: [MxSelectTranslateMixin],
   props: {
     admissionInfo: {
@@ -92,15 +94,6 @@ export default {
         countNumber
       }
     },
-    // isCanSignFlag() {
-    //   // 传入的组合是否能报名
-    //   if (!this.reportInfo.length) return {}
-    //   if (!this.currentGroup) return {}
-    //
-    //   return this.reportInfo.filter(item => {
-    //     return item.groupName == this.currentGroup
-    //   })[0]
-    // },
     canSign() {
       if (!this.reportInfo.length) return []
       return this.reportInfo.filter(item => {
@@ -119,7 +112,6 @@ export default {
       this.aiType = type
       this.dialogVisible = true
       this.singleRow = row
-      console.log(row)
     }
   }
 }

+ 17 - 12
src/views/elective/select/components/elective-ai-table.vue

@@ -1,4 +1,5 @@
 <template>
+  <div>
     <mx-table :propDefines="propDefines" :rows="rows">
       <template #underOver="{value}">
         <over-under-badge :value="value"></over-under-badge>
@@ -21,7 +22,7 @@
       </template>
       <template #group="{row}">
         <el-badge value="荐" :hidden="!row.isRecommend" type="success">
-          <el-tag size="medium" :type="row.allowSelect ? 'warning' : 'danger'" >{{row.groupName}}</el-tag>
+          <el-tag size="medium" :type="row.allowSelect ? 'warning' : 'danger'">{{ row.groupName }}</el-tag>
         </el-badge>
       </template>
       <template #colleges="{row}">
@@ -43,12 +44,15 @@
         </el-row>
       </template>
       <template #report="{row}">
-        <el-button @click="toReport('single',row)" >查看</el-button>
+        <el-button @click="toReport('single',row)">查看</el-button>
       </template>
     </mx-table>
+    <elective-ai-report-dialog ref="aiReportDialog"></elective-ai-report-dialog>
+  </div>
 </template>
 <script>
 import OverUnderBadge from '@/views/elective/publish/components/steps/fauclty/over-under-badge'
+import ElectiveAiReportDialog from '@/views/elective/select/components/elective-ai-report-dialog'
 
 const resolverModules = require.context('./ai-round-select-resolvers', false, /\.js$/)
 const resolvers = resolverModules.keys().map(key => resolverModules(key).default)
@@ -56,7 +60,8 @@ const resolvers = resolverModules.keys().map(key => resolverModules(key).default
 export default {
   mixins: [...resolvers],
   name: 'elective-ai-table',
-  components:{
+  components: {
+    ElectiveAiReportDialog,
     OverUnderBadge
   },
   props: {
@@ -65,8 +70,8 @@ export default {
     optionalMajors: { type: Array, default: () => [] }
   },
   data() {
-    return{
-      rows: [],
+    return {
+      rows: []
     }
   },
   created() {
@@ -83,16 +88,16 @@ export default {
       return {
         groupName: {
           label: '选科组合',
-          width:'120px',
+          width: '120px',
           slot: 'group'
         },
         scoreSumGroup: {
           label: '组合成绩'
-        },
+        }
       }
     },
     resolveTableSuffix() {
-      return{
+      return {
         subjects: {
           label: '自选专业',
           slot: 'subjects',
@@ -132,14 +137,14 @@ export default {
       return {
         ...this.resolveTablePrefix,
         ...this.formatTable,
-        ...this.resolveTableSuffix,
+        ...this.resolveTableSuffix
       }
     }
   },
   methods: {
-    toReport(type,row) {
-      this.$refs.SingleSubjectReport.init(type,row)
-    },
+    toReport(type, row) {
+      this.$refs.aiReportDialog.init(type, row)
+    }
   }
 }
 </script>

+ 11 - 11
src/views/elective/select/components/elective-table.vue

@@ -68,30 +68,29 @@
       <el-button v-if="enableSelect" @click="commitBatch" type="primary" :disabled="!enableCommit">提交</el-button>
     </div>
     <elective-preference-reject v-if="enableReject" :generation="generation"></elective-preference-reject>
-    <esign-dialog ref="esignDialog"></esign-dialog>
+    <elective-esign-dialog ref="esignDialog"></elective-esign-dialog>
     <choose-subject-dialog ref="chooseDialog"></choose-subject-dialog>
     <select-subject-report-dialog ref="reportDialog"></select-subject-report-dialog>
-    <ai-analysis-dialog ref="aiDialog" :optionalMajors="optionalMajors" :prevPreferencesInfo="currentSupplyInfo"
-                        :generation="generation"></ai-analysis-dialog>
+    <elective-ai-analysis-dialog ref="aiDialog" :optionalMajors="optionalMajors"
+                                 :generation="generation"></elective-ai-analysis-dialog>
   </div>
 </template>
 <script>
 import MxSelectTranslate from '@/components/Cache/modules/mx-select-translate-mixin.js'
-import ElectivePreferenceDrag from './elective-preference-drag'
 import ChooseSubjectDialog from '../../../system/user/profile/components/choose-subject-dialog'
 import SelectSubjectReportDialog from '@/views/system/user/profile/components/select-subject-report-dialog'
-import EsignDialog from '@/views/elective/select/components/elective-esign-dialog'
-import ReportStep from '../../../system/user/profile/components/report-step'
 import OverUnderBadge from '@/views/elective/publish/components/steps/fauclty/over-under-badge'
 import { submitElectiveModels } from '@/api/webApi/elective/selected-subject'
 import consts from '@/common/mx-const'
 import { mapGetters } from 'vuex'
 import ElectiveEnrollInfo from '@/views/elective/select/components/elective-enroll-info'
+import ElectivePreferenceDrag from './elective-preference-drag'
 import ElectiveToolsMixin from './elective-tools-mixins'
 import ElectivePreferenceInfo from '@/views/elective/select/components/elective-preference-info'
 import ElectivePreferenceReject from '@/views/elective/select/components/elective-preference-reject'
 import ElectivePreferenceCommand from '@/views/elective/select/components/elective-preference-command'
-import AiAnalysisDialog from '@/views/elective/select/components/elective-ai-analysis-dialog'
+import ElectiveAiAnalysisDialog from '@/views/elective/select/components/elective-ai-analysis-dialog'
+import ElectiveEsignDialog from '@/views/elective/select/components/elective-esign-dialog'
 
 const resolverModules = require.context('./round-select-resolvers', false, /\.js$/)
 const resolvers = resolverModules.keys().map(key => resolverModules(key).default)
@@ -105,15 +104,14 @@ export default {
     optionalMajors: { type: Array, default: () => [] }
   },
   components: {
-    AiAnalysisDialog,
+    ElectiveEsignDialog,
+    ElectiveAiAnalysisDialog,
     ElectivePreferenceCommand,
     ElectivePreferenceReject,
     ElectivePreferenceInfo,
     ElectiveEnrollInfo,
     OverUnderBadge,
     SelectSubjectReportDialog,
-    ReportStep,
-    EsignDialog,
     ElectivePreferenceDrag,
     ChooseSubjectDialog
   },
@@ -176,7 +174,9 @@ export default {
       return this.enableSelect && this.generation.active > this.generation.options.primary.value
     },
     enableAIFeature() {
-      return !this.generation.activeOpt.decisionMaking && this.generation.activeOpt != options.primary && !this.readonly
+      return !this.generation.activeOpt.decisionMaking
+        && this.generation.activeOpt != this.generation.options.primary
+        && !this.readonly
     },
     resolveTablePrefix() {
       return {