Browse Source

选科报名mockUrl更改

shilipojs 3 years ago
parent
commit
4a99ffff42

+ 2 - 2
mock/modules/elective-subject.js

@@ -904,7 +904,7 @@ module.exports = [
                 actualCount: 0,
                 approved: false,
                 forceAdjusted: false,
-                groupApprovedCount: 201,
+                groupApprovedCount: 200,
                 groupForceAdjustedCount: 0
               },
 
@@ -980,7 +980,7 @@ module.exports = [
                 actualCount: 0,
                 approved: false,
                 forceAdjusted: false,
-                groupApprovedCount: 351,
+                groupApprovedCount: 350,
                 groupForceAdjustedCount: 0
               },
               {

+ 1 - 1
src/api/webApi/elective/selected-subject.js

@@ -38,7 +38,7 @@ export function getStudentSelected() {
 // 学生获取选科状态数据,得到是每个组合最终状态和结果
 export function getStudentElectiveModels(params) {
   return request({
-    url: '/mock/front/elective/enroll/getStudentElectiveModels',
+    url: '/front/elective/enroll/getStudentElectiveModels',
     method: 'get',
     params
   })

+ 8 - 82
src/views/system/user/profile/components/report-table.vue

@@ -2,7 +2,7 @@
   <div>
     <div class="mb10 fx-row fx-end-base">
       <div>
-        <el-button type="primary" @click="toAiAnalysis" v-if="generation > 0">AI分析</el-button>
+        <el-button v-if="aiShow" type="primary" @click="toAiAnalysis" >AI分析</el-button>
         <el-button>选科历史记录</el-button>
       </div>
     </div>
@@ -92,7 +92,7 @@
     <esign-dialog ref="esignDialog"></esign-dialog>
     <choose-subject-dialog ref="chooseDialog"></choose-subject-dialog>
     <select-subject-report-dialog  ref="reportDialog"></select-subject-report-dialog>
-    <!--    <Ai-dialog ref="aiDialog" :prevPreferences="prevPreferences"></Ai-dialog>-->
+    <Ai-dialog ref="aiDialog" :prevPreferences="prevPreferences"></Ai-dialog>
   </div>
 </template>
 <script>
@@ -160,6 +160,11 @@ export default {
     // this.$refs.drage.init(this.selectedList)
   },
   computed: {
+    aiShow() {
+      const active =  this.generation.active
+      if(active == 3 || active == 5 || active == 7) return true
+      return false
+    },
     resolveTablePrefix() {
       return {
         index: {
@@ -269,86 +274,7 @@ export default {
         ...this.resolveTableSuffix
       }
     }
-    // formatTable() {
-    //   // if (!this.models.length) return {}
-    //   // if (!this.optionalMajors) return {}
-    //   return {}
-    //   // 初始化 rows cols
-    //   // let rows = this.models[0].models.map(item => {
-    //   //   item.allowSelectTips = item.allowSelect ? '报名中' : '无法报名'
-    //   //   item.subjects = this.optionalMajors.filter(college => {
-    //   //     if (college.matchedGroupIds.indexOf(item.groupId) != -1) return college.majorCategoryName
-    //   //   }).map(item => item.majorCategoryName)
-    //   //   item.colleges = this.optionalMajors.filter(college => {
-    //   //     if (college.matchedGroupIds.indexOf(item.groupId) != -1) return college.majorCategoryName
-    //   //   }).map(item => {
-    //   //     return {
-    //   //       college: item.collegeName,
-    //   //       major: item.majorCategoryName
-    //   //     }
-    //   //   })
-    //   //   return item
-    //   // })
-    //   // let formatCols  = this.formatCols({})
-    //   // let stateCol = {}
-    //   // // 判断当前步骤
-    //   // const step = this.models.length
-    //   // // step = 1  reutrn cols 选科人数比 组合实时排名 学校实时排名
-    //   // console.log(this.activeOpt)
-    //   // switch (this.activeOpt) {
-    //   //   // 初录报名
-    //   //   case config.electiveGenerationOptions.primary:
-    //   //     console.log(2222222222222)
-    //   //     // cols
-    //   //     stateCol = {
-    //   //       applyCount: {
-    //   //         label: '选科人数比'
-    //   //       },
-    //   //       rankInGroup: {
-    //   //         label: '当前组合实时排名',
-    //   //       },
-    //   //       rankInGrade: {
-    //   //         label: '选科全校排名',
-    //   //       }
-    //   //     }
-    //   //     formatCols = this.formatCols(stateCol)
-    //   //     // rows
-    //   //     console.log(rows)
-    //   //     rows  = rows.map(item => {
-    //   //       item.applyCount = `${item.actualCount}/${item.personCount}`
-    //   //       return item
-    //   //     })
-    //   //     break
-    //   //   // 初录结果
-    //   //   case config.electiveGenerationOptions.primaryDM:
-    //   //     stateCol = {
-    //   //       applyCount: {
-    //   //         label: '选科人数比'
-    //   //       },
-    //   //       groupIndicator: {
-    //   //         label: '超/缺'
-    //   //       },
-    //   //       rankInGroup: {
-    //   //         label: '当前组合实时排名',
-    //   //       },
-    //   //       rankInGrade: {
-    //   //         label: '选科全校排名',
-    //   //       }
-    //   //     }
-    //   //     rows  = rows.map(item => {
-    //   //       item.applyCount = `${item.actualCount}/${item.personCount}`
-    //   //       item.groupIndicator = item.groupIndicator
-    //   //       return item
-    //   //     })
-    //   //     formatCols = this.formatCols(stateCol)
-    //   // }
-    //   //
-    //   // return {
-    //   //   rows,
-    //   //   formatCols
-    //   // }
-    // }
-  },
+   },
   methods: {
     getModelsByStep() {
       return this.models.findIndex()