From ccda9ec2fe70d8f51ef184eafc04b78d22dfbabd Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期三, 26 六月 2024 15:02:28 +0800
Subject: [PATCH] 小程序,教材,课程

---
 assets/js/middleGround/api/resource.js |   89 ++++++++++++++++++++++++++++++++------------
 1 files changed, 64 insertions(+), 25 deletions(-)

diff --git a/assets/js/middleGround/api/resource.js b/assets/js/middleGround/api/resource.js
index afb1189..198c0d3 100644
--- a/assets/js/middleGround/api/resource.js
+++ b/assets/js/middleGround/api/resource.js
@@ -1,7 +1,14 @@
 import request from "../../../request/index";
-import { publicStore, publicRepository } from "../../config";
-import { tokenKey } from "../../config";
-import { handleQueryResourceListData } from "../tool";
+import {
+  publicStore,
+  publicRepository
+} from "../../config";
+import {
+  tokenKey
+} from "../../config";
+import {
+  handleQueryResourceListData
+} from "../tool";
 import toolClass from "../../toolClass";
 const resourceApi = {
   /*
@@ -21,6 +28,8 @@
     repositoryInfo = publicRepository,
     queryType,
     linkType,
+    RefCode,
+    CmsItemType,
     paging,
     sort,
     fields,
@@ -30,14 +39,10 @@
     coverSize,
     itemIdArr,
     SysType,
+
     tourism_isHighQualityResources,
   }) => {
     if (!path) return Promise.reject("鎺ュ彛璇锋眰蹇呰鍙傛暟涓嶈兘涓虹┖锛�");
-
-
-
-
-
     const query = {
       AccessControl: {
         Path: path,
@@ -57,14 +62,14 @@
       Description: [],
       Name: [],
       Icon: [],
-      RefCode: [],
+      // RefCode: [],
       Type: [],
       TypeId: [],
       State: [],
       Tag: [],
       LinkInfo: [],
       LinkFile: [],
-      CmsItemType: [],
+      // CmsItemType: [],
       ChildrenFolderCount: [],
       ChildrenCount: [],
       ...fields,
@@ -78,7 +83,15 @@
     if (itemId) query["Id="] = [`${itemId}`];
     if (itemIds) query["Id="] = itemIds;
     if (itemType) query["Type="] = [`${itemType}`];
-    const body = { query: JSON.stringify({ Query: [{ Q1: query }] }) };
+    if (RefCode) query["RefCode="] = [`${RefCode}`];
+    if (CmsItemType) query["CmsItemType="] = [`${CmsItemType}`];
+    const body = {
+      query: JSON.stringify({
+        Query: [{
+          Q1: query
+        }]
+      })
+    };
     let token = wx.getStorageSync('tokenKey');
     return request({
       url: token ? "/resource/api/ApiAppUserQuery" : "/resource/api/ApiQuery",
@@ -95,14 +108,24 @@
           repositoryInfo,
           coverSize,
         });
-        return { datas, total: data.totalCount };
+        return {
+          datas,
+          total: data.totalCount
+        };
       }
-      return { datas: [], total: 0 };
+      return {
+        datas: [],
+        total: 0
+      };
     });
   },
   // 妯$硦鎼滅储
   EsQuery(query) {
-    let { params, path, paging } = query;
+    let {
+      params,
+      path,
+      paging
+    } = query;
     let queryBody = {
       Type: "*",
       Store: [],
@@ -153,16 +176,20 @@
     // 鍏ㄩ儴鎼滅储  - 鍗曠嫭鐨勬煇涓簱
     if (path != "All") {
       let data = {
-        Path: [
-          {
-            Repository: "tourism_tourismLawsAndRegulationsDatabase",
-            Path: path,
-          },
-        ],
+        Path: [{
+          Repository: "tourism_tourismLawsAndRegulationsDatabase",
+          Path: path,
+        }, ],
       };
       Object.assign(queryBody, data);
     }
-    const body = { query: JSON.stringify({ Query: [{ Q1: queryBody }] }) };
+    const body = {
+      query: JSON.stringify({
+        Query: [{
+          Q1: queryBody
+        }]
+      })
+    };
 
     return request({
       url: "/resource/api/ApiEsQuery",
@@ -176,9 +203,15 @@
           datas: data.datas,
           path,
         });
-        return { datas, total: data.totalCount };
+        return {
+          datas,
+          total: data.totalCount
+        };
       }
-      return { data: [], total: 0 };
+      return {
+        data: [],
+        total: 0
+      };
     });
   },
 
@@ -211,7 +244,13 @@
 
   // 鑾峰彇cms鏀惰棌鍒楄〃
   getCmsCollectList(data) {
-    const body = { query: JSON.stringify({ Query: [{ Q1: data }] }) };
+    const body = {
+      query: JSON.stringify({
+        Query: [{
+          Q1: data
+        }]
+      })
+    };
     return request({
       url: "/resource/api/ApiAppUserQuery",
       method: "post",
@@ -220,4 +259,4 @@
   },
 };
 
-export default resourceApi;
+export default resourceApi;
\ No newline at end of file

--
Gitblit v1.9.1