ソースを参照

elective student - permission update

hare8999@163.com 2 年 前
コミット
69b157768e

+ 1 - 1
src/views/elective/select/components/elective-table-mixins.js

@@ -44,7 +44,7 @@ export default {
         },
         scoreSumGroup: {
           label: '组合成绩',
-          // hidden: this.hasPermissions([consts.enum.electivePermission.rankInGroup.scoreByGroup])
+          hidden: !this.hasPermissions([consts.enum.electivePermission.scoreByGroup])
         },
         classCount: {
           label: '开设班级数'

+ 3 - 3
src/views/elective/select/components/round-select-resolvers/primary-resolver-mixins.js

@@ -19,15 +19,15 @@ export default {
         return {
           applyCount:{
             label:'选科人数比',
-            // hidden: this.hasPermissions([consts.enum.electivePermission.applyCount])
+            hidden: !this.hasPermissions([consts.enum.electivePermission.applyCount])
           },
           rankInGroup: {
             label: '当前组合实时排名',
-            // hidden: this.hasPermissions([consts.enum.electivePermission.rankInGroup])
+            hidden: !this.hasPermissions([consts.enum.electivePermission.rankInGroup])
           },
           rankInGrade: {
             label: '选科全校排名',
-            // hidden: this.hasPermissions([consts.enum.electivePermission.rankInGrade])
+            hidden: !this.hasPermissions([consts.enum.electivePermission.rankInGrade])
           },
         }
       }

+ 2 - 2
src/views/elective/select/components/round-select-resolvers/primaryDM-resolver-mixins.js

@@ -14,11 +14,11 @@ export default {
           },
           rankInGroup: {
             label: '当前组合实时排名',
-            // hidden: this.hasPermissions([consts.enum.electivePermission.rankInGroup])
+            hidden: !this.hasPermissions([consts.enum.electivePermission.rankInGroup])
           },
           rankInGrade: {
             label: '选科全校排名',
-            // hidden: this.hasPermissions([consts.enum.electivePermission.rankInGrade])
+            hidden: !this.hasPermissions([consts.enum.electivePermission.rankInGrade])
           },
         }
       }

+ 14 - 12
src/views/system/user/profile/round-select.vue

@@ -18,15 +18,15 @@
         </el-col>
       </el-row>
     </el-card>
-    <div v-if="allowSelect">
+    <div v-if="electiveVisible">
       <!--  自选专业 推荐专业  -->
       <select-subject class="mt20" :evaluationMajors="evaluationMajors" :optionalMajors="optionalMajors"
                       :list="activeModel ? activeModel.models : []"></select-subject>
       <!--  选科报名表  -->
-      <el-card class="box-card mt20" >
+      <el-card class="box-card mt20">
         <template #header>
-          <elective-generation-steps v-model="activeStep"  v-if="selectObj" :generation="generation"
-                                     disable-hidden-feature ></elective-generation-steps>
+          <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>
@@ -88,13 +88,15 @@ export default {
       evaluationMajors: [],
       //
       selectObj: null,
-      allowSelect: false,
       stepOptions: config.electiveGenerationOptions,
       activeStep: '',
       generationModels: []
     }
   },
   computed: {
+    electiveVisible() {
+      return this.selectObj?.allowSelect || this.selectObj?.currentGeneration > this.stepOptions.init.value
+    },
     emptyTitle() {
       if (!this.activeOpt) return
       if (this.activeModel && !this.activeModel.models && this.activeOpt.decisionMaking) {
@@ -188,13 +190,13 @@ export default {
     loadStudentSelected() {
       getStudentSelected().then(res => {
         console.log('getStudentSelected', res)
+        // 往下转移属性allowSelect、currentGeneration、preferenceCount
         const status = res.data['selectResult']
-        status.currentGeneration = res.data.currentGeneration || 9
-        status.preferenceCount = res.data.preferenceCount || 3
-        this.selectObj = res.data['selectResult']
-        this.allowSelect = res.data.allowSelect
-        if(this.allowSelect || res.data.currentGeneration >= 7) {
-          this.allowSelect  = true
+        status.allowSelect = res.data.allowSelect
+        status.currentGeneration = res.data.currentGeneration
+        status.preferenceCount = res.data.preferenceCount
+        this.selectObj = status
+        if (this.electiveVisible) {
           this.loadStudentElectiveModels()
           this.getOptionalMajors()
           this.getRecommendMajor()
@@ -212,7 +214,7 @@ export default {
     goStudyReportDemoOnline() {
       const path = 'https://online.fliphtml5.com/jkrou/hjig/'
       window.open(path)
-    },
+    }
   }
 }
 </script>