Kaynağa Gözat

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

shilipojs 3 yıl önce
ebeveyn
işleme
b29c00a1c8

+ 21 - 12
src/views/elective/generation/components/elective-generation-table.vue

@@ -1,16 +1,17 @@
 <template>
   <mx-table ref="table" :prop-defines="resolvedTable.columns" :rows="resolvedTable.rows" border>
     <template #elective-cell="{value, label, prop, key}">
-      <el-tooltip :disabled="(value&&value.disabled)||!!!prop.queryCode" effect="light">
+      <el-tooltip :disabled="!isCellQueryable(value, prop)" effect="light">
         <div slot="content">
           查看名单
         </div>
-        <div v-if="value" class="pointer" :style="getCellStyles(value)" @click="goDetails(value, label, $event)">
+        <div v-if="value" :class="{'pointer': isCellQueryable(value, prop)}" :style="getCellStyles(value)"
+             @click="goDetails(value, prop, true)">
           <template v-if="!useUnderOverBadge(key)">
             <span v-if="value.star">*</span>
             <span>{{ value && value.value }}</span>
           </template>
-          <over-under-badge v-else :value="value.value" exchange></over-under-badge>
+          <over-under-badge v-else :value="value.value"></over-under-badge>
         </div>
       </el-tooltip>
     </template>
@@ -99,6 +100,9 @@ export default {
     }
   },
   methods: {
+    isCellQueryable(value, prop) {
+      return value && value.value && !value.disabled && !!prop.queryCode
+    },
     useUnderOverBadge(label) {
       return ['indicateCount'].some(prop => label.includes(prop))
     },
@@ -144,7 +148,10 @@ export default {
       }
       return styles
     },
-    goDetails(option, label, e) {
+    goDetails(value, column, check = false) {
+      if (check) {
+        if (!this.isCellQueryable(value, column)) return
+      }
       // jump logic
       const path = '/elective/generation/detail'
       const nextData = {
@@ -152,12 +159,12 @@ export default {
         roundId: this.chartBinding.generation.status.roundId,
         roundName: this.chartBinding.generation.status.roundName,
         activeGeneration: this.chartBinding.generation.active,
-        isAccumulate: option.isAccumulate || false,
-        queryGeneration: option.generation,
-        queryGroupId: option.groupId,
-        queryCode: option.queryCode,
-        queryableCategories: option.queryableCategories,
-        ignoreGroupCategories: option.ignoreGroupCategories,
+        isAccumulate: value.isAccumulate || false,
+        queryGeneration: value.generation,
+        queryGroupId: value.groupId,
+        queryCode: value.queryCode,
+        queryableCategories: value.queryableCategories,
+        ignoreGroupCategories: value.ignoreGroupCategories,
         groups: this.chartBinding.generation.roundGroups.map(rg => ({ groupId: rg.groupId, groupName: rg.groupName }))
       }
       this.transferTo(path, nextData)
@@ -174,8 +181,10 @@ export default {
             for (const row of this.resolvedTable.rows) {
               const val = row[subColProp]
               if (val?.generation == current) {
-                this.goDetails(val)
-                return
+                if (this.isCellQueryable(val, column)) {
+                  this.goDetails(val, column, false)
+                  return
+                }
               }
             }
           }

+ 1 - 1
src/views/elective/publish/components/steps/fauclty/faculty-result.vue

@@ -2,7 +2,7 @@
   <div class="fx-column">
     <mx-table :prop-defines="facultyTableDefines" :rows="rows">
       <template #tag="{value}">
-        <over-under-badge :value="value"></over-under-badge>
+        <over-under-badge :value="value" exchange></over-under-badge>
       </template>
     </mx-table>
     <div class="fx-column mt15">

+ 5 - 5
src/views/elective/publish/components/steps/fauclty/over-under-badge.vue

@@ -41,13 +41,13 @@ export default {
     },
     badgeValue() {
       if (!this.valid) return ''
-      if (this.value * 1 > 0) return !this.exchange ? this.underText : this.overText
-      return !this.exchange ? this.overText : this.underText
+      if (this.value * 1 > 0) return this.exchange ? this.underText : this.overText
+      return this.exchange ? this.overText : this.underText
     },
     badgeType() {
-      if (!this.valid) return !this.exchange ? this.overType : this.underType
-      if (this.value * 1 > 0) return !this.exchange ? this.underType : this.overType
-      return !this.exchange ? this.overType : this.underType
+      if (!this.valid) return this.exchange ? this.overType : this.underType
+      if (this.value * 1 > 0) return this.exchange ? this.underType : this.overType
+      return this.exchange ? this.overType : this.underType
     }
   },
   methods: {}