Procházet zdrojové kódy

教材添加分类查询

natasha před 2 roky
rodič
revize
a6deed726a
1 změnil soubory, kde provedl 41 přidání a 2 odebrání
  1. 41 2
      src/views/learn-center/ListPage.vue

+ 41 - 2
src/views/learn-center/ListPage.vue

@@ -8,6 +8,22 @@
     </div>
     <!-- 课程列表 -->
     <div class="main" v-if="CourseList" v-loading="loading">
+      <div v-if="navName == 'TEXTBOOK'" class="classify_box">
+        <label>{{$t('Key243')}}</label>
+        <el-select
+            v-model="typeId"
+            :placeholder="$t('Key295')"
+            multiple
+            @change="getData"
+            >
+            <el-option
+                v-for="(item, index) in typeList"
+                :key="'type' + index"
+                :label="item.name"
+                :value="item.id"
+            />
+        </el-select>
+      </div>
       <div>
         <component
           :is="getCurrentQuestionView"
@@ -39,7 +55,7 @@ import Header from '@/components/Header'
 import Course from '@/components/learnCenter/Course'
 import Textbook from '@/components/learnCenter/Textbook'
 
-import { cousrseAPI, TextbookAPI } from '@/api/api'
+import { cousrseAPI, TextbookAPI, getStaticContent } from '@/api/api'
 import HeaderOne from '@/components/learnCenter/HeaderOne'
 import { updateWordPack } from '@/utils/i18n'
 
@@ -66,6 +82,8 @@ export default {
       pageSizes1: [8, 16, 32, 64],
       pageSizes2: [10, 20, 30, 40],
       isData: false,
+      typeList: [],
+      typeId: []
     }
   },
   computed: {
@@ -165,6 +183,7 @@ export default {
           cur_page: this.pageNum,
           publish_status: 1,
           is_control_publish_scope: 'true',
+          type_id_list: this.typeId
         }).then((res) => {
           this.CourseList = res
           this.loading = false
@@ -184,6 +203,14 @@ export default {
         })
       }
     },
+    // 教材类型列表
+    getTypeList() {
+      let MethodName = "dict_manager-GetBookTypeList";
+      let data = {};
+      getStaticContent(MethodName, data).then(res => {
+        this.typeList = res.type_list;
+      });
+    },
   },
   async created() {
     this.navName = this.$route.query.id
@@ -197,6 +224,8 @@ export default {
         'Key46',
         'Key323',
         'Key215',
+        'Key243',
+        'Key295'
       ],
     })
     this.isData = true
@@ -210,6 +239,7 @@ export default {
       this.headerOneTitle = '学习资源' //this.$t("Key44");
     }
 
+    this.getTypeList();
     this.getData()
   },
 }
@@ -220,7 +250,7 @@ export default {
   background: #f6f6f6;
   .main {
     min-height: 100%;
-    padding-top: 52px;
+    padding-top: 24px;
     background: #f6f6f6;
     padding-bottom: 20px;
   }
@@ -242,6 +272,15 @@ export default {
       text-align: center;
     }
   }
+  .classify_box{
+    width: 1200px;
+    margin: 0 auto 24px auto;
+    label{
+        font-size: 14px;
+        line-height: 150%;
+        margin-right: 12px;
+    }
+  }
 }
 </style>
 <style lang="scss">