소스 검색

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

shilipojs 2 년 전
부모
커밋
3fb77e6619

+ 2 - 1
src/common/mx-const.js

@@ -7,7 +7,8 @@ export default {
     activeMenu: 'Active-Menu',
     userInfo: 'User-Info',
     keyPaperShortcutNotified: 'keyPaperShortcutNotified',
-    keyCachePrefix: 'mx-cache-'
+    keyCachePrefix: 'mx-cache-',
+    electiveGlobalChangeEvent: 'electiveGlobalChangeEvent'
   },
   enum: {
     paper: {

+ 7 - 2
src/components/Top/index.vue

@@ -15,7 +15,7 @@
     <div v-else class="fx-row fx-sta-cen">
       <span @click="to('/login')" class="mr20 pointer">首页</span>
       <span v-for="(item, index) in visibleMenus" :key="index" class="mr20 pointer"
-            @click="handleClick(item)">{{ item.meta.title }}</span>
+            :class="{'f-primary':isActiveMenu(item)}" @click="handleClick(item)">{{ item.meta.title }}</span>
     </div>
     <div v-if="userInfo" class="fx-row fx-end-cen">
       <!--您好!-->
@@ -54,7 +54,8 @@ export default {
     return {
       app: false,
       path: '',
-      menuList: []
+      menuList: [],
+      activeLeafMenu: auth.getMenuListAction() || ''
     }
   },
 
@@ -79,6 +80,9 @@ export default {
     this.menuList = this.topMenus()
   },
   methods: {
+    isActiveMenu(menu) {
+      return this.activeLeafMenu.includes(menu.path)
+    },
     logout() {
       this.$confirm('确定注销并退出系统吗?', '提示', {
         confirmButtonText: '确定',
@@ -175,6 +179,7 @@ export default {
           path: path
         })
         auth.setMenuListAction(path)
+        this.activeLeafMenu = path
       } else {
       }
       auth.setMenuList(routes)

+ 1 - 1
src/views/elective/generation/components/elective-generation-table.vue

@@ -75,7 +75,7 @@ export default {
         const prefix = 'accumulate_'
         const ext = {
           roundId: this.chartBinding.generation.status.roundId,
-          generation: -1, // for detail page special display,
+          generation: this.chartBinding.generation.active, // for detail page special display,
           queryableCategories: [], // 本代支持查询的列
           ignoreGroupCategories: [], // 本代支持查询,且与组合无关的列
           isAccumulate: true

+ 7 - 3
src/views/elective/generation/detail.vue

@@ -62,6 +62,7 @@
 
 <script>
 import config from '@/common/mx-config'
+import consts from '@/common/mx-const'
 import transferMixin from '@/components/mx-transfer-mixin'
 import ElectiveToolsMixin from '@/views/elective/select/components/elective-tools-mixins'
 import groupTranslateMixin from '@/components/Cache/modules/mx-select-translate-mixin'
@@ -78,6 +79,7 @@ import ElectiveFlowMajor from '@/views/elective/generation/components/elective-f
 import ElectiveFlowRankDescriptor from '@/views/elective/generation/components/elective-flow-rank-descriptor'
 import { getStudentElectiveModels } from '@/api/webApi/elective/selected-subject'
 import ElectiveAiTable from '@/views/elective/select/components/elective-ai-table'
+import EventBus from '@/components/EventBus'
 
 export default {
   components: {
@@ -104,9 +106,10 @@ export default {
       return Object.values(this.options).find(opt => opt.value == this.prevData.activeGeneration)
     },
     subTitle() {
-      if (this.prevData.isAccumulate) return ''
       const hideGenerations = [this.options.init, this.options.terminate]
-      return hideGenerations.includes(this.activeOpt) ? '' : this.activeOpt?.title || ''
+      let generationDesc = hideGenerations.includes(this.activeOpt) ? '' : this.activeOpt?.title || ''
+      if (this.prevData.isAccumulate && generationDesc) generationDesc = this.options.primary.title + ' 至 ' + generationDesc
+      return generationDesc
     },
     localData() {
       this.queryParams.generation = this.prevData.queryGeneration
@@ -129,7 +132,7 @@ export default {
         index: { label: '序号', slot: 'pagedIndex' },
         className: { label: '班级' },
         studentName: { label: '姓名', slot: 'studentName' },
-        userName: {label: '账号'}
+        userName: { label: '账号' }
       }
       if (!ignoreGroups) {
         columns.groupName = { label: queryCategory.detailName || '组合' }
@@ -307,6 +310,7 @@ export default {
       this.$confirm(message, '强制调剂提醒', { type: 'warning' }).then(() => {
         enrollByForce(group.groupId, row['studentId']).then(res => {
           this.loadGenerationDetails() // refresh
+          EventBus.instance.$emit(consts.keys.electiveGlobalChangeEvent) // global notify for refresh data
         })
       })
       return true

+ 8 - 0
src/views/elective/generation/index.vue

@@ -20,11 +20,13 @@
 
 <script>
 import config from '@/common/mx-config'
+import consts from '@/common/mx-const'
 import { getElectiveStatus, getElectiveSummary, resetMockGeneration } from '@/api/webApi/elective/generation'
 import MxCondition from '@/components/MxCondition/mx-condition'
 import ElectiveGenerationSteps from '@/views/elective/generation/components/elective-generation-steps'
 import ElectiveGenerationMaster from '@/views/elective/generation/components/elective-generation-master'
 import MxGroupTranslateMixin from '@/components/Cache/modules/mx-select-translate-mixin'
+import EventBus from '@/components/EventBus'
 
 export default {
   mixins: [MxGroupTranslateMixin],
@@ -94,6 +96,12 @@ export default {
       refreshData: this.refreshData
     }
   },
+  mounted() {
+    EventBus.instance.$on(consts.keys.electiveGlobalChangeEvent, () => this.refreshData())
+  },
+  beforeDestroy() {
+    EventBus.instance.$off(consts.keys.electiveGlobalChangeEvent)
+  },
   methods: {
     handleInvalid() {
       this.activeStep = ''