Ver código fonte

现场图新增平面图和方位图

wangfumin 1 mês atrás
pai
commit
abd37eb7d1
3 arquivos alterados com 37 adições e 4 exclusões
  1. 5 0
      src/api/constant.ts
  2. 30 2
      src/api/floder.ts
  3. 2 2
      src/store/floder-type.ts

+ 5 - 0
src/api/constant.ts

@@ -113,6 +113,11 @@ export const FOLDER_TYPE_LIST = `${namespace}/caseFilesType/allList`
 // export const FLODER_LIST = `${namespace}/caseFiles/allList`
 export const FLODER_LIST = `${namespace}/caseFiles/allList`
 
+// 方位图列表
+export const getcaseTabulationList = `${namespace}/caseTabulation/getByCaseId`;
+// 获取平面图列表
+export const getcaseOverviewList = `${namespace}/caseOverview/getByCaseId`;
+
 
 // 文件上传
 export const UPLOAD_FILE = `${namespace}/upload/file`

+ 30 - 2
src/api/floder.ts

@@ -1,5 +1,5 @@
 import { params } from '@/env'
-import { FLODER_LIST } from './constant'
+import { FLODER_LIST, getcaseTabulationList, getcaseOverviewList } from './constant'
 import { addUnsetResErrorURLS,axios } from './instance'
 import {namespace} from '@/env'
 
@@ -17,6 +17,35 @@ export type Floders = Floder[]
 addUnsetResErrorURLS(`${namespace}/caseInquest/downDocx`, `${namespace}/caseExtractDetail/downDocx`, `${namespace}/caseImg/getFfmpegImage`)
 export const fetchFloders = async () => {
   const floders = await axios.get<Floders>(FLODER_LIST, { params: { caseId: params.caseId } })
+  const tabulationList = await axios.get<any>(getcaseTabulationList, { params: { caseId: params.caseId } })
+  const overviewList = await axios.get<any>(getcaseOverviewList, { params: { caseId: params.caseId } })
+  overviewList.forEach((item:any) => {
+    if(item.listCover){
+      floders.unshift({
+        filesId: item.id,
+        filesTypeId: 1,
+        filesTitle: item.title || '平面图',
+        imgType: 1,
+        filesUrl: item.listCover,
+        ...item
+      })
+    }
+  })
+  tabulationList.forEach((item:any) => {
+    if(item.listCover){
+      floders.unshift({
+        filesId: item.id,
+        filesTypeId: 1,
+        filesTitle: item.title,
+        filesUrl: item.listCover,
+        imgType: 1,
+        ...item
+      })
+    }
+  })
+  // console.log('tabulationList', tabulationList)
+  // console.log('overviewList', overviewList)
+  // console.log('floders1111111', floders)
   const otherFloders = [{
     filesId: 88,
     filesTypeId: 3,
@@ -42,7 +71,6 @@ export const fetchFloders = async () => {
       })
     })
   }
-  console.log('floders', floders)
   await Promise.all(otherFloders.map(async of => {
     const kybl = await axios.get(of.ex, { params: { caseId: params.caseId } })
     if (kybl) {

+ 2 - 2
src/store/floder-type.ts

@@ -38,10 +38,10 @@ const gemerateRoot = (parentId: number | null = null) => {
         flat: !!type.flatShow,
         modal: !!type.modalShow,
         floders: getFloderByType(type).map((floder) => {
-          !floder.filesUrl &&console.log(floder.filesUrl)
+          !floder.filesUrl &&console.log(floder.filesUrl, 66666)
           return{
           ...floder,
-          metaType: floder.filesUrl && getUrlType(floder.filesUrl),
+          metaType: (floder.filesUrl && getUrlType(floder.filesUrl)),
         }
         }),
         children: gemerateRoot(type.filesTypeId)