Browse Source

更换查询列表

natasha 2 năm trước cách đây
mục cha
commit
c2b58732ef

+ 19 - 1
src/api/api.js

@@ -17,7 +17,7 @@ export function WebFileDownload(data) {
     return request({
         url: `/GCLSFileServer/WebFileDownload?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
         method: 'get',
-        responseType:'blob',
+        responseType: 'blob',
         params: data
     })
 }
@@ -168,6 +168,24 @@ export function materiallist(data) {
         data,
     })
 }
+// 查询所有学习资料列表
+export function materiallistAll(data) {
+    let userInfor = getToken();
+    let UserCode = '',
+        UserType = '',
+        SessionID = ''
+    if (userInfor) {
+        let user = JSON.parse(getToken());
+        UserCode = user.user_code;
+        UserType = user.user_type;
+        SessionID = user.session_id;
+    }
+    return request({
+        url: `/GCLSTCWebSI/ServiceInterface?MethodName=page_query-PageQueryTCMaterialList&&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}`,
+        method: "post",
+        data,
+    })
+}
 // 查询学习资料详情
 export function materialdetail(data) {
     let userInfor = getToken()

+ 1 - 1
src/components/teacher-dev/Teaching.vue

@@ -28,7 +28,7 @@
         <p class="one_name">
           {{ item.name }}
         </p>
-        <p class="price">
+        <p class="price" v-if="item.price*1>0">
           ¥<span class="price_1" v-html="changePrice(item.price*1,24, 16)"></span>
         </p>
       </div>

+ 1 - 1
src/components/teacher-dev/Textbook.vue

@@ -25,7 +25,7 @@
           alt=""
         ></el-image> -->
         <p class="one_name">{{ item.name }}</p>
-        <p class="price">
+        <p class="price" v-if="item.price*1 > 0">
           ¥<span class="price_1" v-html="changePrice(item.price * 1, 24, 16)"></span>
         </p>
       </div>

+ 1 - 1
src/components/teacher-dev/ToolBook.vue

@@ -25,7 +25,7 @@
           alt=""
         ></el-image> -->
         <p class="one_name">{{ item.name }}</p>
-        <p class="price">
+        <p class="price" v-if="item.price * 1>0">
           ¥<span class="price_1" v-html="changePrice(item.price * 1, 24, 16)"></span>
         </p>
       </div>

+ 29 - 13
src/views/teacher-dev/Viewmore.vue

@@ -92,7 +92,7 @@
 import Header from "@/components/Header";
 import HeaderOne from "@/components/teacher-dev/HeaderOne";
 import Teaching from "@/components/teacher-dev/Teaching";
-import { materiallist, teacherlist } from "@/api/api";
+import { materiallistAll, teacherlist } from "@/api/api";
 import { updateWordPack } from "@/utils/i18n";
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -113,13 +113,14 @@ export default {
       DataList: null,
       pageNum: 1,
       pageSize: 10,
-      tag: [],
+      tag: '',
       SeekSuggest: [],
       keycode: "",
       TeacherName: "",
       orderType: "", // DESC降序 ASC升序
       orderColumn: "", //1 名称  2 发布时间 3 浏览次数
       text: "",
+      orderColumnLis: ['name','updata_time','visit_count']
     };
   },
   //计算属性 类似于data概念
@@ -205,17 +206,32 @@ export default {
     },
     getdata() {
       this.loading = true;
-      materiallist({
-        pageNum: this.pageNum,
-        pageSize: this.pageSize,
-        keyWord: this.keycode,
-        tagList: this.tag,
-        orderType: this.orderType,
-        orderColumn: this.orderColumn,
-        teacherList: this.TeacherName ? [`${this.TeacherName}`] : [],
-      })
+      let data = {
+        cur_page: this.pageNum,
+        page_capacity: this.pageSize,
+        name: this.keycode,
+        tag: this.tag,
+        order_column_list: []
+      }
+      if(this.orderColumn){
+        let text = this.orderColumnLis[Number(this.orderColumn)-1]
+        if(this.orderType){
+            // 升序不传值
+            if(this.orderType=='ASC'){
+                data.order_column_list = [text]
+            }else if(this.orderType=='DESC'){
+                data.order_column_list = [text + ':desc']
+            }else{
+                data.order_column_list = []
+            }
+        }
+      }
+      materiallistAll(data)
         .then((res) => {
-          this.DataList = res.data;
+          this.DataList = {
+            data: res.material_list,
+            total: res.total_count
+          };
           this.loading = false;
         })
         .catch((res) => {
@@ -274,7 +290,7 @@ export default {
       if(this.$route.query.classify == "TOOLBOOK"){
         this.text = this.$t("Key555"); //"工具书";
       }
-      this.tag.push(this.$route.query.classify);
+      this.tag = this.$route.query.classify;
     }
     if (this.$route.query.keyWord) {
       this.text = this.$t("Key248"); //"搜索结果";

+ 22 - 22
src/views/teacher-dev/index.vue

@@ -48,13 +48,13 @@
         <TeachingTool v-if="textAnalyseShow" />
       </div> -->
       <div id="TEXTBOOK" v-if="textBookList">
-        <Textbook v-if="textBookList.data" :classList="textBookList.data" />
+        <Textbook v-if="textBookList.material_list" :classList="textBookList.material_list" />
       </div>
       <div id="TEACHING" v-if="teachingList">
-        <Teaching v-if="teachingList.data" :classList="teachingList.data" />
+        <Teaching v-if="teachingList.material_list" :classList="teachingList.material_list" />
       </div>
       <div id="TOOLBOOK" v-if="toolBookList">
-        <ToolBook v-if="toolBookList.data" :classList="toolBookList.data" />
+        <ToolBook v-if="toolBookList.material_list" :classList="toolBookList.material_list" />
       </div>
     </div>
   </div>
@@ -68,7 +68,7 @@ import Teaching from "@/components/teacher-dev/Teaching";
 import ToolBook from "@/components/teacher-dev/ToolBook";
 import TeachingTool from "@/components/teacher-dev/TeachingTool";
 
-import { materiallist } from "@/api/api";
+import { materiallistAll } from "@/api/api";
 import { updateWordPack } from "@/utils/i18n";
 
 export default {
@@ -132,39 +132,39 @@ export default {
     // 获取数据
     getData() {
       this.loading = true;
-      materiallist({
-        pageNum: 1,
-        pageSize: 10,
-        tagList: ["TEXTBOOK"],
-        keyWord: this.keyWord,
+      materiallistAll({
+        cur_page: 1,
+        page_capacity: 10,
+        tag: "TEXTBOOK",
+        name: this.keyWord,
       })
         .then((res) => {
-          this.textBookList = res.data;
+          this.textBookList = res;
         })
         .catch((res) => {
           this.loading = false;
         });
-      materiallist({
-        pageNum: 1,
-        pageSize: 10,
-        tagList: ["TEACHING"],
-        keyWord: this.keyWord,
+      materiallistAll({
+        cur_page: 1,
+        page_capacity: 10,
+        tag: "TEACHING",
+        name: this.keyWord,
       })
         .then((res) => {
-          this.teachingList = res.data;
+          this.teachingList = res;
           this.loading = false;
         })
         .catch((res) => {
           this.loading = false;
         });
-      materiallist({
-        pageNum: 1,
-        pageSize: 10,
-        tagList: ["TOOLBOOK"],
-        keyWord: this.keyWord,
+      materiallistAll({
+        cur_page: 1,
+        page_capacity: 10,
+        tag: "TOOLBOOK",
+        name: this.keyWord,
       })
         .then((res) => {
-          this.toolBookList = res.data;
+          this.toolBookList = res;
           this.loading = false;
         })
         .catch((res) => {