浏览代码

Merge branch 'master' of http://121.4.203.192:9000/mingxue/front

# Conflicts:
#	src/views/system/user/profile/round-select.vue
shilipojs 2 年之前
父节点
当前提交
d5f397a868

+ 15 - 4
src/components/MxCondition/condition-mixins-data.js

@@ -480,10 +480,21 @@ export default {
       }
       // return formRef.validate() 这种方式没有外抛异常明细
       return new Promise((resolve, reject) => {
-        formRef.validate((valid, errors) => {
-          if (valid) resolve(valid)
-          else reject(errors) // 经这一步转化,可以外抛errors
-        })
+        const localFields = Object.keys(this.finalRules)
+        const formFields = formRef.fields
+        const shouldDelay = localFields.length > 0 && formFields.length == 0
+
+        const invoker = function(){
+          formRef.validate((valid, errors) => {
+            //debugger
+            if (valid) resolve(valid)
+            else reject(errors) // 经这一步转化,可以外抛errors
+          })
+        }
+
+        // NOTE: 5.14 hht 这里因为form组件的校验要在子组件加载好之后才能生效
+        if (shouldDelay) this.$nextTick(()=> invoker())
+        else invoker()
       })
     }
   }

+ 7 - 3
src/views/elective/generation/components/elective-generation-steps.vue

@@ -9,8 +9,8 @@
           <div class="rel"
                :class="{'bold':activeStep==idx+1, 'f-333':activeStep==idx+1&&step.value>generation.current}">
             <i v-if="activeStep==idx+1" class="el-icon-thumb current-pointer current-animation abs"></i>
-            <el-popover v-else-if="step.value<generation.current&&step.value<activeStep" trigger="hover"
-                        class="abs current-view">
+            <el-popover v-else-if="!disableHiddenFeature&&step.value<generation.current&&step.value<activeStep"
+                        trigger="hover" class="abs current-view">
               <el-checkbox :value="generation.hiddenGenerations.includes(step.value)"
                            @input="toggleGenerationTableData($event,step)">
                 隐藏{{ step.title }}表格数据
@@ -45,6 +45,10 @@ export default {
     modelValue: {
       type: String,
       default: '' // active step key.
+    },
+    disableHiddenFeature: {
+      type: Boolean,
+      default: false
     }
   },
   data() {
@@ -86,7 +90,7 @@ export default {
         defaultOpt = options.primary
       } else if (this.generation.current > options.rankBalance.value) {
         statusTip = '选科结束'
-        defaultOpt = options.rankBalance
+        defaultOpt = options.forceAdjust
       }
 
       if (!this.modelValue) {

+ 23 - 6
src/views/elective/generation/detail.vue

@@ -30,7 +30,8 @@
                                        :rank-descriptors="value.rankDescriptors"></elective-flow-rank-descriptor>
       </template>
       <template #flow-action="{row}">
-        <el-link @click="handleFlowLog(row)" :underline="false">查看</el-link>
+        <el-link v-if="enableStudentTableView" @click="handleStudentTable(row)" :underline="false">查看</el-link>
+        <el-link v-if="enableLogView" @click="handleFlowLog(row)" :underline="false">查看</el-link>
         <el-popover v-if="row['enableForce']" :ref="'force_'+row['studentId']" width="80" trigger="click"
                     popper-class="zero-padding-popover">
           <div class="fx-column">
@@ -46,10 +47,11 @@
     </mx-table>
     <pagination :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
                 @pagination="loadGenerationDetails"></pagination>
-    <el-dialog title="选科历史记录" v-if="logVisible" :visible.sync="logVisible" :width="logDialogWidth">
+    <el-dialog title="选科流程明细" v-if="logVisible" :visible.sync="logVisible" :width="logDialogWidth">
       <elective-generation-flow-log :groups="prevData.groups" :histories="logRow.histories"
                                     :matched-majors="this.majorsMap[logRow['studentId']]"/>
     </el-dialog>
+    <el-dialog title="查看详情" :visible.sync="studentTableVisible" :width="logDialogWidth"></el-dialog>
   </div>
 </template>
 
@@ -81,11 +83,16 @@ export default {
       const n = this.prevData.roundName
       return y + s + n
     },
+    options() {
+      return config.electiveGenerationOptions
+    },
+    activeOpt() {
+      return Object.values(this.options).find(opt => opt.value == this.prevData.activeGeneration)
+    },
     subTitle() {
       if (this.prevData.isAccumulate) return ''
-      const g = Object.values(config.electiveGenerationOptions).find(opt => opt.value == this.prevData.activeGeneration)
-      const hideGeneration = g == config.electiveGenerationOptions.init || g == config.electiveGenerationOptions.terminate
-      return hideGeneration ? '' : g?.title || ''
+      const hideGenerations = [this.options.init, this.options.terminate]
+      return hideGenerations.includes(this.activeOpt) ? '' : this.activeOpt?.title || ''
     },
     localData() {
       this.queryParams.generation = this.prevData.queryGeneration
@@ -142,6 +149,12 @@ export default {
       const expectedWidth = (this.prevData.groups.length + 3) * 160 // 假定elective-generation-flow-log 单格宽160
       const finalWidth = Math.min(expectedWidth, window.innerWidth * 0.8)
       return finalWidth + 'px'
+    },
+    enableLogView() {
+      return this.activeOpt?.value >= this.options.forceAdjust.value
+    },
+    enableStudentTableView() {
+      return this.activeOpt?.value < this.options.forceAdjust.value
     }
   },
   data() {
@@ -161,7 +174,8 @@ export default {
       majorsMap: null,
       // log
       logVisible: false,
-      logRow: {}
+      logRow: {},
+      studentTableVisible: false
     }
   },
   methods: {
@@ -235,6 +249,9 @@ export default {
       this.logRow = row
       this.logVisible = true
     },
+    handleStudentTable(row) {
+      this.$alert('待填充')
+    },
     handleForceAdjust(group, row) {
       let message = `确认将'${row.studentName}'调剂至'${group.groupName}'?!`
       if (row['disableForceGroupId'] > 0) {

+ 2 - 2
src/views/elective/generation/index.vue

@@ -65,11 +65,11 @@ export default {
       return this.activeOpt?.value
     },
     roundGroups() {
-      return this.electiveStatus?.roundGroups.map(rg => ({
+      return this.electiveStatus?.roundGroups?.map(rg => ({
         groupId: rg.groupId,
         groupName: this.translateGroup(rg.groupId),
         expectedCount: rg.personCount
-      }))
+      })) || []
     },
     generation() {
       return {

+ 7 - 5
src/views/system/user/profile/round-select.vue

@@ -10,10 +10,10 @@
             <el-form-item label="选科时间" class="form-item-readonly">{{ selectObj.beginTime }} 至 {{ selectObj.endTime }}
             </el-form-item>
             <!--<el-form-item label="选科状态" class="form-item-readonly">-->
-              <!--未选择/已选择<span class="f-red">缺字段</span>-->
+            <!--未选择/已选择<span class="f-red">缺字段</span>-->
             <!--</el-form-item>-->
             <!--<el-form-item label="AI选科" class="form-item-readonly">-->
-              <!--进入/查看<span class="f-red">缺字段</span>-->
+            <!--进入/查看<span class="f-red">缺字段</span>-->
             <!--</el-form-item>-->
           </el-form>
         </el-col>
@@ -32,7 +32,7 @@
     <el-card class="box-card mt20">
       <template #header>
         <elective-generation-steps v-if="allowSelect" v-model="activeStep" :generation="generation"
-        ></elective-generation-steps>
+                                   disable-hidden-feature></elective-generation-steps>
       </template>
       <report-table ref="reportRef" :generation="generation"></report-table>
     </el-card>
@@ -105,7 +105,7 @@
 </template>
 
 <script>
-import {  saveStudentSelected } from '@/api/webApi/selection'
+import { saveStudentSelected } from '@/api/webApi/selection'
 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'
@@ -118,6 +118,7 @@ import {
   getStudentSelected,
   getRecommendMajor
 } from '@/api/webApi/elective/selected-subject'
+
 export default {
   provide() {
     return {
@@ -210,7 +211,8 @@ export default {
   methods: {
     getStudentElectiveModels() {
       getStudentElectiveModels().then(res => {
-        this.generationModels =res.data
+        this.generationModels = res.data
+        this.mode = res.data
       })
     },
     getRecommendMajor() {