| | |
| | | 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 = { |
| | | /* |
| | |
| | | repositoryInfo = publicRepository, |
| | | queryType, |
| | | linkType, |
| | | RefCode, |
| | | CmsItemType, |
| | | paging, |
| | | sort, |
| | | fields, |
| | |
| | | coverSize, |
| | | itemIdArr, |
| | | SysType, |
| | | |
| | | tourism_isHighQualityResources, |
| | | }) => { |
| | | if (!path) return Promise.reject("接口请求必要参数不能为空!"); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const query = { |
| | | AccessControl: { |
| | | Path: path, |
| | |
| | | Description: [], |
| | | Name: [], |
| | | Icon: [], |
| | | RefCode: [], |
| | | // RefCode: [], |
| | | Type: [], |
| | | TypeId: [], |
| | | State: [], |
| | | Tag: [], |
| | | LinkInfo: [], |
| | | LinkFile: [], |
| | | CmsItemType: [], |
| | | // CmsItemType: [], |
| | | ChildrenFolderCount: [], |
| | | ChildrenCount: [], |
| | | ...fields, |
| | |
| | | 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", |
| | |
| | | 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: [], |
| | |
| | | // 全部搜索 - 单独的某个库 |
| | | if (path != "All") { |
| | | let data = { |
| | | 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", |
| | |
| | | datas: data.datas, |
| | | path, |
| | | }); |
| | | return { datas, total: data.totalCount }; |
| | | return { |
| | | datas, |
| | | total: data.totalCount |
| | | }; |
| | | } |
| | | return { data: [], total: 0 }; |
| | | return { |
| | | data: [], |
| | | total: 0 |
| | | }; |
| | | }); |
| | | }, |
| | | |
| | |
| | | |
| | | // 获取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", |