Browse Source

选科设置--大数据选科数据--年份默认为最新

shilipojs 3 years ago
parent
commit
22cdcf4102

+ 1 - 1
src/views/permission/components/group-query-dialog.vue

@@ -6,7 +6,7 @@
     :visible.sync="dialogVisible"
     width="70%"
   >
-    <group-subject-query :level="level" :year="year"></group-subject-query>
+    <group-subject-query :level="level" ></group-subject-query>
     <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
       </span>

+ 15 - 8
src/views/permission/components/group-subject-query.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div v-if="Object.keys(model).length > 0">
-       <h3>{{`${year}年${model.location}省选科大数据分析`}}</h3>
+       <h3 class="text-center f28">{{`${year}年${model.location}省选科大数据分析`}}</h3>
        <el-row class="mb20" :gutter="10">
          <el-col class="f14" :span="col.span" v-for="col in cols">
            <p class="pb10" style="border-bottom: 1px solid #ebeef5;"> {{col.label}}</p>
@@ -26,6 +26,7 @@
 </template>
 <script>
 import { getSelectCourseBigdata } from '@/api/webApi/selection'
+import { xkcxYears } from '@/api/webApi/webQue'
 
 export default {
   name: 'GroupSubjectQuery',
@@ -33,14 +34,11 @@ export default {
     level:{
       type: String,
       default: ''
-    },
-    year:{
-      type: Number,
-      default: ''
     }
   },
   data() {
     return{
+      year: '',
       model: {},
       propDefines:{
        index:{
@@ -69,12 +67,12 @@ export default {
       const cols = [
         {
           label: '院校',
-          span: 3,
+          span: 4,
           value: this.model.countcollege
         },
         {
           label: '专业',
-          span: 3,
+          span: 4,
           value: this.model.countmajor
         }
       ]
@@ -93,9 +91,18 @@ export default {
   },
   created() {
     console.log(111111111111111)
-    this.getList()
+    this.getYears()
   },
   methods: {
+    // 取有效年份清单
+    getYears() {
+      xkcxYears().then((res) => {
+        this.year = res.data[0]
+        this.$nextTick(_ => {
+          this.getList()
+        })
+      });
+    },
     getList() {
       getSelectCourseBigdata({
         year: this.year,