bill 1 개월 전
부모
커밋
4d790a6b91

+ 2 - 2
src/api/animation.ts

@@ -106,7 +106,7 @@ const localToService = (am: AnimationModel): ServiceAnimationModel => ({
 
 export const fetchAnimationModels = async () => {
   const ams = await axios.get<ServiceAnimationModel[]>(AM_MODEL_LIST, {
-    params: { caseId: params.caseId },
+    params: { fusionId: params.caseId },
   });
   return ams.map(serviceToLocal);
 };
@@ -128,7 +128,7 @@ export const fetchAnimationActions = async () => {
 export const postInsertAnimationModel = async (am: AnimationModel) => {
   const addData = {
     ...localToService(am),
-    caseId: params.caseId,
+    fusionId: params.caseId,
     id: undefined,
   };
   console.log('add', addData)

+ 4 - 3
src/api/constant.ts

@@ -19,8 +19,9 @@ export const UPLOAD_HEADS = {
 
 export const USER_INFO = `${namespace}/web/user/getUserInfo`;
 
-export const CASE_INFO = `${namespace}/case/getInfo`
-export const CASE_FIRE_INFO = `${namespace}/caseInquestInfo/info`
+export const CASE_INFO = `${namespace}/caseFusion/info`
+export const UPDATE_CASE_INFO = `${namespace}/caseFusion/updateInfo`
+// export const CASE_FIRE_INFO = `${namespace}/caseInquestInfo/info`
 
 // 校验密码
 export const AUTH_PWD = `${namespace}/web/fireProject/getDetailWithoutAuth`
@@ -31,7 +32,7 @@ export const FUSE_INSERT_MODEL = `${namespace}/caseFusion/add`
 export const FUSE_UPDATE_MODEL = `${namespace}/caseFusion/update`
 export const FUSE_DELETE_MODEL = `${namespace}/caseFusion/delete`
 // 场景列表
-export const SCENE_LIST_ALL = `${namespace}/api/scene/list`
+export const SCENE_LIST_ALL = `/service/manage/scene/list`
 export const MODEL_LIST = `${namespace}/case/sceneList`
 export const MODEL_SIGN = `${namespace}/model/getInfo`
 export const SYNC_INFO = `${namespace}/caseLive/getTakeLookRoom`;

+ 5 - 5
src/api/fuse-model.ts

@@ -48,7 +48,7 @@ interface ServiceFuseModel {
 }
 
 export const uploadMaterialToModel = async (uploadId: number) => {
-  const model = await axios.post<{modelId: number}>('/fusion/model/addByMediaLibrary', {caseId: params.caseId, uploadId})
+  const model = await axios.post<{modelId: number}>('/fusion/model/addByMediaLibrary', {fusionId: params.caseId, uploadId})
   return model
 }
 
@@ -133,24 +133,24 @@ export type FuseModels = FuseModel[];
 
 export const fetchFuseModels = async () => {
   const serviceModels = await axios.get<ServiceFuseModel[]>(FUSE_MODEL_LIST, {
-    params: { caseId: params.caseId },
+    params: { fusionId: params.caseId },
   });
-  console.log('===>', serviceModels.map((item, index) => serviceToLocal(item, index == 0)))
   return serviceModels.map((item, index) => serviceToLocal(item, index == 0));
 };
 
-export const postAddFuseModel = async (model: FuseModel) => {
+export const postAddFuseModel = async (model: FuseModel, attach: any = {}) => {
   const upload = localToService(model);
   const serviceModel = await axios<ServiceFuseModel>({
     url: FUSE_INSERT_MODEL,
     method: "POST",
     data: {
-      caseId: params.caseId,
+      fusionId: params.caseId,
       modelId: model.modelId,
       hide: upload.hide,
       transform: upload.transform,
       opacity: upload.opacity,
       bottom: upload.bottom,
+      ...attach,
     },
   });
   return serviceToLocal(serviceModel);

+ 1 - 1
src/api/guide-path.ts

@@ -68,7 +68,7 @@ export const fetchGuidePaths = async (guideId: Guide['id']) => {
 }
 
 export const postAddGuidePath = async (path: GuidePath) => {
-  const addData = { ...localToService(path), caseId: params.caseId, guidePathId: undefined }
+  const addData = { ...localToService(path), fusionId: params.caseId, guidePathId: undefined }
    const serviceData = await axios.post<ServiceGuidePath>(INSERT_GUIDE_PATH, addData)
    return serviceToLocal(serviceData)
 }

+ 2 - 2
src/api/guide.ts

@@ -48,12 +48,12 @@ const localToService = (guide: Guide): ServiceGuide => ({
 })
 
 export const fetchGuides = async () => {
-  const guides = await axios.get<ServiceGuide[]>(GUIDE_LIST, { params: { caseId: params.caseId } })
+  const guides = await axios.get<ServiceGuide[]>(GUIDE_LIST, { params: { fusionId: params.caseId } })
   return guides.map(serviceToLocal)
 }
 
 export const postAddGuide = async (guide: Guide) => {
-  const addData = { ...localToService(guide), caseId: params.caseId, fusionGuideId: undefined }
+  const addData = { ...localToService(guide), fusionId: params.caseId, fusionGuideId: undefined }
    const serviceData = await axios.post<ServiceGuide>(INSERT_GUIDE, addData)
    return serviceToLocal(serviceData)
 }

+ 1 - 1
src/api/monitor.ts

@@ -51,7 +51,7 @@ export const fetchMonitors = async () => {
 export const postInsertMonitor = async (monitor: Monitor) => {
   const smonitor = await axios.post<ServiceMonitor>(INSERT_MONITOR, {
     ...localToService(monitor),
-    caseId: params.caseId,
+    fusionId: params.caseId,
   });
   return serviceToLocal(smonitor);
 };

+ 3 - 3
src/api/path.ts

@@ -44,7 +44,7 @@ const localToService = (path: Path): ServerPath => ({
 
 export const fetchPaths = async () => {
   const staggings = await axios.get<ServerPath[]>(PATH_LIST, {
-    params: { caseId: params.caseId },
+    params: { fusionId: params.caseId },
   });
   return staggings.map(serviceToLocal);
 };
@@ -52,7 +52,7 @@ export const fetchPaths = async () => {
 export const postAddPath = async (path: Path) => {
   const stagging = await axios.post<ServerPath>(INSERT_PATH, {
     ...localToService(path),
-    caseId: params.caseId,
+    fusionId: params.caseId,
   });
   return serviceToLocal(stagging);
 };
@@ -60,7 +60,7 @@ export const postAddPath = async (path: Path) => {
 export const postUpdatePath = (path: Path) => {
   return axios.post<undefined>(UPDATE_PATH, {
     ...localToService(path),
-    caseId: params.caseId,
+    fusionId: params.caseId,
   });
 };
 

+ 2 - 2
src/api/record.ts

@@ -50,7 +50,7 @@ const toService = (record: Record, isUpdate = true): PartialProps<ServiceRecord,
 export type Records = Record[]
 
 export const fetchRecords = async () => {
-  const data = await axios.get<ServiceRecord[]>(RECORD_LIST, { params: { caseId: params.caseId } })
+  const data = await axios.get<ServiceRecord[]>(RECORD_LIST, { params: { fusionId: params.caseId } })
   return data.map(toLocal)
 }
 
@@ -82,7 +82,7 @@ export const postMegerRecord = (files: File[], recordId?: Record['id']) => {
     headers: { ...UPLOAD_HEADS },
     data: jsonToForm({
       ...(recordId ? { folderId: recordId && Number(recordId) } : {}),
-      caseId: params.caseId,
+      fusionId: params.caseId,
       files
     })
   })

+ 55 - 50
src/api/scene.ts

@@ -1,6 +1,7 @@
-import axios from './instance'
-import { MODEL_LIST, MODEL_SIGN, SCENE_LIST_ALL, SYNC_INFO } from './constant'
-import { params } from '@/env'
+import axios from "./instance";
+import { MODEL_LIST, MODEL_SIGN, SCENE_LIST_ALL, SYNC_INFO } from "./constant";
+import { params } from "@/env";
+import { caseProject } from "@/store";
 
 export enum SceneStatus {
   DEL = -1,
@@ -21,68 +22,72 @@ export enum SceneType {
   SWYDMX = 6,
   DSFXJ = 7,
 }
-export const SceneTypeDesc: Record<SceneType, string>  = {
-  [SceneType.SWKK]: '四维看看/Mesh',
-  [SceneType.SWKJ]: '四维看见/Mesh',
-  [SceneType.SWSS]: '四维深时/点云',
-  [SceneType.SWMX]: '媒体库',
-  [SceneType.SWSSMX]: '四维深时/Mesh',
-  [SceneType.SWYDSS]: '四维深光/点云',
-  [SceneType.SWYDMX]: '四维深光/Mesh',
-  [SceneType.DSFXJ]: '圆周率/Mesh'
-}
-
-
+export const SceneTypeDesc: Record<SceneType, string> = {
+  [SceneType.SWKK]: "四维看看/Mesh",
+  [SceneType.SWKJ]: "四维看见/Mesh",
+  [SceneType.SWSS]: "四维深时/点云",
+  [SceneType.SWMX]: "媒体库",
+  [SceneType.SWSSMX]: "四维深时/Mesh",
+  [SceneType.SWYDSS]: "四维深光/点云",
+  [SceneType.SWYDMX]: "四维深光/Mesh",
+  [SceneType.DSFXJ]: "圆周率/Mesh",
+};
 
 export interface Scene {
-  createTime: string
-  id: number
-  isLaser: boolean
-  modelDateType: string
-  modelGlbUrl: string
-  raw: any,
+  createTime: string;
+  id: number;
+  isLaser: boolean;
+  modelDateType: string;
+  modelGlbUrl: string;
+  raw: any;
   model3dgsUrl: string;
   modelShpUrl: string;
-  modelId: number
-  modelObjUrl: string
-  modelSize: number
-  status: SceneStatus
-  modelTitle: string
-  name: string
-  num: string
-  sceneName: string
-  snCode: string
-  thumb: string
-  title: string
-  type: SceneType
+  modelId: number;
+  modelObjUrl: string;
+  isObj: number
+  modelSize: number;
+  status: SceneStatus;
+  modelTitle: string;
+  name: string;
+  num: string;
+  sceneName: string;
+  snCode: string;
+  thumb: string;
+  title: string;
+  type: SceneType;
 }
 
-export type Scenes = Scene[]
+export type Scenes = Scene[];
 
 const toLocalScene = (scene: Scene) => ({
   ...scene,
   num: scene.type === SceneType.SWMX ? scene.modelId.toString() : scene.num,
   name: scene.name || scene.sceneName || scene.modelTitle,
-})
-
-
+});
 
 export const getSyncSceneInfo = async (scene: Scene) => {
-  return (await axios.post<string>(SYNC_INFO, { caseId: params.caseId, num: scene.raw.num }));
+  return await axios.post<string>(SYNC_INFO, {
+    fusionId: params.caseId,
+    num: scene.raw.num,
+  });
 };
 
 export const fetchScenes = async () => {
-  const scenes = await axios.get<Scenes>(MODEL_LIST, { params: { caseId: params.caseId } })
-  return scenes.map(toLocalScene)
-}
-
-export const fetchScenesAll = async (params: {numList: Scene['num'][], type: SceneType}) => {
-  const scenes = await axios.post<Scenes>(SCENE_LIST_ALL, params)
-  return scenes.map(toLocalScene)
-}
+  return caseProject.value?.sceneVoList || [];
+};
 
+export const fetchScenesAll = async (params: {
+  numList?: string[];
+  isObj: number;
+  pageNum: number;
+  pageSize: number;
+}) => {
+  const data = await axios.post<{ total: number, list: Scenes  }>(SCENE_LIST_ALL, params);
+  data.list = data.list.map(toLocalScene);
+  return data
+};
 
-export const fetchScene = async (modelId: Scene['modelId']) => {
-  const scene = await axios.get<Scene>(MODEL_SIGN, { params: { modelId } })
-  return toLocalScene(scene)
-}
+export const fetchScene = async (modelId: Scene["modelId"]) => {
+  const scene = await axios.get<Scene>(MODEL_SIGN, { params: { modelId } });
+  return toLocalScene(scene);
+};

+ 2 - 2
src/api/setting.ts

@@ -55,7 +55,7 @@ const toService = (setting: Setting): ServeSetting => ({
 
 export const fetchSetting = async () => {
   let data = await axios.get<ServeSetting[]>(GET_SETTING, {
-    params: { caseId: params.caseId },
+    params: { fusionId: params.caseId },
   });
   const tData = toLocal(data[0] || {})
   if (!tData.back && !tData.mapId) {
@@ -67,7 +67,7 @@ export const fetchSetting = async () => {
 
 export const updateSetting = async (setting: Setting) => {
   await axios.post(UPDATE_SETTING, {
-    caseId: params.caseId,
+    fusionId: params.caseId,
     ...toService(setting),
   });
 };

+ 15 - 41
src/api/sys.ts

@@ -1,7 +1,8 @@
-import { UPLOAD_FILE, UPLOAD_HEADS, CASE_INFO, AUTH_PWD, CASE_FIRE_INFO } from "./constant";
+import { UPLOAD_FILE, UPLOAD_HEADS, CASE_INFO, AUTH_PWD, UPDATE_CASE_INFO } from "./constant";
 import { axios } from "./instance";
 import { jsonToForm } from "@/utils";
 import { params } from "@/env";
+import { Scene } from "./scene";
 
 type UploadFile = LocalFile | string;
 
@@ -24,51 +25,24 @@ export const uploadFile = async (file: UploadFile, suffix = ".png") => {
   }
 };
 
-export enum FireStatus {
-  incomplete = 0,
-  complete = 1,
-}
-
-export type FireProject = {
-  "id": number,
-  "caseId": number,
-  "commandTime": string,
-  "alarmTime": string,
-  "alarmName": string,
-  "inquestDept": string,
-  "assignDept": string,
-  "assignType": string,
-  "times": string[],
-  "inquestAddress": string,
-  "tbStatus": number,
-  "createTime": string,
-  "updateTime": string
-};
-
 export interface Case {
-  caseTitle: string;
-  latAndLong: string;
-  mapUrl: string;
-  showScenes: boolean
-  caseNum: string;
-  caseCategory: string;
-  caseRegion: string;
-  caseAddress: string;
-  homicideCase: number;
-  criminalCase: number;
-  tmProject?: FireProject;
+  sceneVoList: Scene[];
+  createTime: string
+  fusionTitle?: string
+  platformId: null;
 }
 
 export const getCaseInfo = async () => {
-  const [caseInfo, fireInfo] = await Promise.all([
-    axios.get<Case>(CASE_INFO, { params: { caseId: params.caseId } }),
-    axios.get<FireProject>(CASE_FIRE_INFO, { params: { caseId: params.caseId } })
-  ])
-  caseInfo.tmProject = fireInfo
-  return caseInfo
+  const [caseInfo] = await Promise.all([
+    axios.get<Case>(CASE_INFO, { params: { fusionId: params.caseId } }),
+  ]);
+  return caseInfo;
+};
+
+export const updateCaseInfo = async (data: Case) => {
+  return axios.post(UPDATE_CASE_INFO, { ...data })
 }
 
 // 校验密码
 export const authSharePassword = (randCode: string) =>
-  axios<boolean>(AUTH_PWD, { params: { randCode, caseId: params.caseId } });
-
+  axios<boolean>(AUTH_PWD, { params: { randCode, fusionId: params.caseId } });

+ 2 - 2
src/api/tagging-style.ts

@@ -83,7 +83,7 @@ const toService = (style: TaggingStyle): ServiceStyle => ({
 export type TaggingStyles = TaggingStyle[];
 
 export const fetchTaggingStyles = async () => {
-  const reqParams = params.share ? { caseId: params.caseId } : {};
+  const reqParams = params.share ? { fusionId: params.caseId } : {};
   const data = await axios.get<ServiceStyle[]>(TAGGING_STYLE_LIST, {
     params: reqParams,
   });
@@ -101,7 +101,7 @@ export const postAddTaggingStyle = async (props: {
     data: jsonToForm({
       file: new File([props.file], `${props.iconTitle}.png`),
       iconTitle: props.iconTitle.toString(),
-      caseId: params.caseId,
+      fusionId: params.caseId,
     }),
   });
   return toLocal(data);

+ 3 - 3
src/api/tagging.ts

@@ -78,17 +78,17 @@ const localToService = (tagging: Tagging, update = false): PartialProps<ServerTa
 
 
 export const fetchTaggings = async () => {
-  const staggings = await axios.get<ServerTagging[]>(TAGGING_LIST, { params: { caseId: params.caseId } })
+  const staggings = await axios.get<ServerTagging[]>(TAGGING_LIST, { params: { fusionId: params.caseId } })
   return staggings.map(serviceToLocal)
 }
 
 export const postAddTagging = async (tagging: Tagging) => {
-  const stagging = await axios.post<ServerTagging>(INSERT_TAGGING, { ...localToService(tagging), caseId: params.caseId })
+  const stagging = await axios.post<ServerTagging>(INSERT_TAGGING, { ...localToService(tagging), fusionId: params.caseId })
   return serviceToLocal(stagging, )
 }
 
 export const postUpdateTagging = (tagging: Tagging) => {
-  return axios.post<undefined>(UPDATE_TAGGING, { ...localToService(tagging, true), caseId: params.caseId })
+  return axios.post<undefined>(UPDATE_TAGGING, { ...localToService(tagging, true), fusionId: params.caseId })
 }
   
 

+ 2 - 2
src/api/view.ts

@@ -45,12 +45,12 @@ const toService = (view: View, isUpdate = true): PartialProps<ServiceView, 'view
 export type Views = View[]
 
 export const fetchViews = async () => {
-  const data = await axios.get<ServiceView[]>(VIEW_LIST, { params: { caseId: params.caseId } })
+  const data = await axios.get<ServiceView[]>(VIEW_LIST, { params: { fusionId: params.caseId } })
   return data.map(toLocal)
 }
 
 export const postAddView = async (view: View) => {
-  const serviceView = await axios.post<ServiceView>(INSERT_VIEW, { ...toService(view, false), caseId: params.caseId })
+  const serviceView = await axios.post<ServiceView>(INSERT_VIEW, { ...toService(view, false), fusionId: params.caseId })
   return toLocal(serviceView)
 }
 

+ 5 - 2
src/app.vue

@@ -100,7 +100,6 @@ const stopWatch = watch(
     await refreshCase();
     if (caseProject.value) {
       await loadPack(initialSetting);
-      prefix.value = caseProject.value!.caseTitle;
     } else {
       await router.replace({ name: RoutesName.error });
     }
@@ -108,7 +107,11 @@ const stopWatch = watch(
     loaded.value = true;
   },
   { immediate: true }
-);
+); 
+
+watchEffect(() => {
+  prefix.value = caseProject.value?.fusionTitle || "多元融合";
+});
 
 const layoutClassNames = computed(() => {
   return {

+ 75 - 40
src/layout/edit/scene-select.vue

@@ -27,7 +27,7 @@
           <TabPane v-for="current in types" :key="current" :tab="current">
             <Table
               v-if="typeFilterScenes[current].length"
-              :row-key="(record: Scene) => record.modelId"
+              :row-key="(record: Scene) => record.num"
               :columns="cloumns"
               :rowSelection="rowSelection"
               :data-source="typeFilterScenes[current]"
@@ -89,57 +89,79 @@ import {
   initialScenes,
 } from "@/store";
 
-import { SceneType, uploadMaterialToModel, type Scene } from "@/api";
+import { fetchScenesAll, SceneType, uploadMaterialToModel, type Scene } from "@/api";
 import { activeModel, getSceneModel } from "@/sdk";
 import { selectMaterials } from "@/components/materials/quisk";
 import { custom } from "@/env";
 import { actionItems, currentItem } from "@/views/merge";
 
-type Key = Scene["modelId"];
+type Key = string;
 
 const Search = Input.Search;
 
-const selectIds = computed(() => fuseModels.value.filter(item => item.type !== SceneType.SWMX).map((item) => item.modelId));
+const spStr = '----ll----'
+const selectIds = computed(() => fuseModels.value.filter(item => item.type !== SceneType.SWMX).map((item) => item.raw.isObj + spStr + item.raw.num));
 const visible = ref(false);
 const keyword = ref("");
 const SceneGroupTypeDesc: any = {
   [SceneType.SWKK]: 'Mesh场景',
   [SceneType.SWKJ]: 'Mesh场景',
-  [SceneType.SWSS]: '点云场景',
   [SceneType.SWSSMX]: 'Mesh场景',
-  [SceneType.SWYDSS]: '点云场景',
   [SceneType.SWYDMX]: 'Mesh场景',
-  [SceneType.DSFXJ]: 'Mesh场景'
+  [SceneType.DSFXJ]: 'Mesh场景',
+  [SceneType.SWYDSS]: '点云场景',
+  [SceneType.SWSS]: '点云场景',
 }
 
-const origin = computed(() =>
-  scenes.value.filter(scene => scene.type !== SceneType.SWMX).map((scene) => ({
-    ...scene,
-    createTime: scene.createTime.substr(0, 16),
-    type: SceneGroupTypeDesc[scene.type],
-  }))
-);
+const types = computed(() => [
+  ...new Set(Object.values(SceneGroupTypeDesc) as any[]).values(),
+]);
+const type = ref(types.value[0]);
+
+const meshParams = ref({ isObj: 1, pageNum: 1, pageSize: 12, total: 0 })
+const cloudParams = ref({ isObj: 0, pageNum: 1, pageSize: 12, total: 0 })
+const meshList = ref<Scene[]>([])
+const cloudList = ref<Scene[]>([])
+
+console.error('scene-select')
+let loadCount = 0
+watchEffect(() => {
+  const params = type.value === 'Mesh场景' ? meshParams : cloudParams
+  const list = type.value === '点云场景' ? meshList : cloudList
+  const currentCount = ++loadCount
+  fetchScenesAll(params.value).then((data) => {
+    console.log(currentCount, loadCount)
+    if (currentCount === loadCount) {
+
+      params.value.total = data.total
+      list.value = data.list.map(item => ({ ...item, type: type.value, num: item.isObj + spStr + item.num })) as any
+      console.log(data.total, list.value)
+    }
+  })
+})
+
+const origin = computed(() => [...meshList.value, ...cloudList.value]);
 
 const typeFilterScenes = computed(() => {
   const typeScenes: any = {};
   for (const type of types.value) {
     typeScenes[type] = origin.value
-      .filter((item) => item.name && item.modelId && item.name.includes(keyword.value))
+      .filter((item) => item.name && item.num && item.name.includes(keyword.value))
       .filter((item) => item.type === type);
   }
   return typeScenes;
 });
 
-const types = computed(() => [
-  ...new Set(origin.value.map((item) => item.type)).values(),
-]);
-const type = ref(types.value[0]);
+watchEffect(() => {
+  console.log(origin.value, type.value, typeFilterScenes.value)
+})
+
 const cache = {} as any
 
 const selects = ref<Key[]>(selectIds.value);
 const rowSelection: any = ref({
   selectedRowKeys: selects,
-  onChange: (ids: number[]) => {
+  onChange: (ids: string[]) => {
     ids = ids.filter(id => !selectIds.value.includes(id))
     cache[type.value] = ids
     const curIds = [...selectIds.value]
@@ -149,7 +171,7 @@ const rowSelection: any = ref({
     selects.value = curIds
   },
   getCheckboxProps: (record: Scene) => ({
-    disabled: selectIds.value.includes(record.modelId),
+    disabled: selectIds.value.includes(record.num),
   }),
 });
 const cloumns = [
@@ -171,9 +193,14 @@ const cloumns = [
   },
 ];
 
-const addModelHandler = createLoadPack(async (modelIds: number[]) => {
-  const models = modelIds.map((modelId) => createFuseModels({ modelId }));
-  const addPromises = models.map(addFuseModel);
+const addModelHandler = createLoadPack(async (attachs: any[]) => {
+  const items = attachs.map((attach) => {
+    return {
+      data: createFuseModels(),
+      attach
+    }
+  });
+  const addPromises = items.map(item => addFuseModel(item.data, item.attach));
 
   const addModels = await Promise.all(addPromises);
   await new Promise<void>((resolve) => {
@@ -188,9 +215,10 @@ const addModelHandler = createLoadPack(async (modelIds: number[]) => {
       });
     });
   });
-  models.forEach((model) => {
-    if (getSceneModel(model)) {
-      model.rotation = getSceneModel(model)!.getDefaultRotation();
+
+  items.forEach(item => {
+    if (getSceneModel(item.data)) {
+      item.data.rotation = getSceneModel(item.data)!.getDefaultRotation();
     }
   });
   await asyncTimeout(100);
@@ -202,11 +230,14 @@ const addModelHandler = createLoadPack(async (modelIds: number[]) => {
 });
 
 const okHandler = createLoadPack(async () => {
-  console.log(selects.value);
-  const models = selects.value.filter(
-    (modelId) => !fuseModels.value.some((model) => model.modelId === modelId)
-  );
-  await addModelHandler(models);
+  const attachs = selects.value.map(item => {
+    const isObj = Number(item.split(spStr)[0])
+    const num = item.split(spStr)[1]
+    return {isObj, num}
+  }).filter(({isObj, num}) =>
+    !fuseModels.value.some((model) => model.raw.isObj === isObj && model.raw.num === num)
+  )
+  await addModelHandler(attachs);
   visible.value = false;
 });
 
@@ -219,20 +250,23 @@ watch(visible, (visible, oldvisible) => {
 });
 
 const selectModel = async () => {
-  const list = await selectMaterials({
+  let list = await selectMaterials({
     uploadFormat: ["zip"],
     format: ["obj", "ply", "las", "laz", "b3dm", "shp", "osgb", "glb"],
     maxSize: 2 * 1024 * 1024 * 1024,
   });
   if (!list?.length) return;
+  list = list.filter(item => item.uploadId)
 
-  const modelList = await Promise.all(list.filter(item => item.uploadId).map(item => uploadMaterialToModel(item.uploadId!)))
-  const modelIds = modelList
-    .map((item) => item.modelId!)
-    .filter(
-      (modelId) => modelId && !fuseModels.value.some((model) => model.modelId === modelId)
-    );
-  await addModelHandler(modelIds);
+  // const modelList = await Promise.all(list.map(item => uploadMaterialToModel(item.uploadId!)))
+  const attachs: any[] = []
+  for (let i = 0; i < list.length; i++) {
+    const uploadId = list[i].uploadId
+    if (uploadId ) {
+      attachs.push({ uploadId })
+    }
+  }
+  await addModelHandler(attachs);
 };
 </script>
 
@@ -248,6 +282,7 @@ const selectModel = async () => {
   max-height: 500px;
   overflow-y: auto;
 }
+
 .slot-layout {
   display: flex;
   align-items: center;

+ 6 - 6
src/layout/show/index.vue

@@ -32,12 +32,12 @@ import { asyncTimeout } from "@/utils";
 import SlideMenu from "./slide-menu.vue";
 
 import {
-  initialFloders,
-  initialFloderTypes,
+  // initialFloders,
+  // initialFloderTypes,
   initialFuseModels,
   initialRecords,
   initialScenes,
-  initialViews,
+  // initialViews,
   defTitle,
   initialTaggingStyles,
   initialTaggings,
@@ -64,10 +64,10 @@ const initialSys = async () => {
   await Promise.all([
     initialFuseModels(),
     initialScenes(),
-    initialViews(),
+    // initialViews(),
     initialRecords(),
-    initialFloders(),
-    initialFloderTypes(),
+    // initialFloders(),
+    // initialFloderTypes(),
     initialTaggingStyles(),
     initialTaggings(),
     initialGuides(),

+ 5 - 2
src/store/case.ts

@@ -1,7 +1,10 @@
-import { Case, getCaseInfo } from "@/api"
+import { Case, getCaseInfo, updateCaseInfo } from "@/api"
 import { ref } from 'vue'
 
 export const caseProject = ref<Case>()
 export const refreshCase = () => {
   return getCaseInfo().then(data => caseProject.value = data)
-}
+}
+
+export const updateCase = () => 
+  updateCaseInfo(caseProject.value!)

+ 2 - 2
src/store/fuse-model.ts

@@ -167,8 +167,8 @@ export const deleteFuseModel = deleteStoreItem(fuseModels, async (model) => {
   ~index && dynamicAddedModelIds.value.splice(index, 1);
 });
 
-export const addFuseModel = async (model: FuseModel) => {
-  const addModel = reactive(serviceToLocal(await postAddFuseModel(model)));
+export const addFuseModel = async (model: FuseModel, attach?: any) => {
+  const addModel = reactive(serviceToLocal(await postAddFuseModel(model, attach)));
   initFuseModel(addModel);
   unSetModelUpdate(() => {
     fuseModels.value.push(addModel);

+ 2 - 2
src/views/record/shot-imitate.vue

@@ -23,7 +23,7 @@ showTaggingsStack
 } from '@/env'
 import {
   initialScenes,
-  initialViews,
+  // initialViews,
   initialRecords,
   initialFloders,
   initialFloderTypes
@@ -34,7 +34,7 @@ import { currentModel } from '@/model';
 
 
 initialScenes(),
-initialViews(),
+// initialViews(),
 initialFloders(),
 initialFloderTypes()
 

+ 29 - 7
src/views/setting/index.vue

@@ -2,10 +2,14 @@
   <RightFillPano>
     <ui-group title="名称" borderBottom>
       <ui-group-option>
-        <Input v-model:value="setting!.title" style="width: 100%; height: 40px" />
+        <Input
+          :value="caseProject!.fusionTitle"
+          @update:value="(title: string) => changeBack(undefined, title)"
+          style="width: 100%; height: 40px"
+        />
       </ui-group-option>
     </ui-group>
-    <ui-group title="位置" borderBottom>
+    <!-- <ui-group title="位置" borderBottom>
       <ui-group-option>
         <GlobalSearch
           class="gps"
@@ -14,7 +18,7 @@
           @update:data="updateGPS"
         />
       </ui-group-option>
-    </ui-group>
+    </ui-group> -->
 
     <ui-group title="初始画面" borderBottom>
       <ui-group-option>
@@ -36,13 +40,22 @@
 <script lang="ts" setup>
 import GlobalSearch from "@/components/global-search/index.vue";
 import { RightFillPano } from "@/layout";
-import { enterEdit, enterOld, setting, isEdit, updataSetting } from "@/store";
+import {
+  enterEdit,
+  enterOld,
+  setting,
+  isEdit,
+  updataSetting,
+  caseProject,
+  updateCase,
+} from "@/store";
 import { ref } from "vue";
 import { togetherCallback, getFileUrl, loadPack } from "@/utils";
 import { showRightPanoStack, showRightCtrlPanoStack } from "@/env";
 import { analysisPose, sdk } from "@/sdk";
 import selectBack from "./select-back.vue";
 import { Input } from "ant-design-vue";
+import { updateCaseInfo } from "@/api";
 
 const updateGPS = (val: any) => {
   console.log(val);
@@ -71,10 +84,17 @@ const enterSetPic = () => {
 
 let initBack = setting.value!.back;
 let initMapId = setting.value!.mapId;
+let initTitle = caseProject.value?.fusionTitle;
 let isFirst = true;
-const changeBack = ([back, mapId]: [string | null, number | null]) => {
+const changeBack = (mapData?: [string | null, number | null], title?: string) => {
+  const back = mapData ? mapData[0] : setting.value?.back;
+  const mapId = mapData ? mapData[1] : setting.value?.mapId;
+
+  title = title || caseProject.value?.fusionTitle;
+
   setting.value!.back = back;
   setting.value!.mapId = mapId;
+  caseProject.value!.fusionTitle = title;
 
   if (isFirst) {
     let isSave = false;
@@ -83,15 +103,17 @@ const changeBack = ([back, mapId]: [string | null, number | null]) => {
       if (!isSave) {
         setting.value!.back = initBack;
         setting.value!.mapId = initMapId;
+        caseProject.value!.fusionTitle = initTitle;
       }
       isFirst = true;
     });
     enterOld(async () => {
       initBack = setting.value!.back;
       initMapId = setting.value!.mapId;
+      initTitle = caseProject.value?.fusionTitle;
       isSave = true;
-      console.log(initBack, initMapId);
-      await loadPack(updataSetting());
+
+      await loadPack(Promise.all([updataSetting(), updateCase()]));
     });
   }
 };

+ 4 - 10
src/views/sign-model/index.vue

@@ -24,17 +24,11 @@ const loadSignModel = async () => {
   } else if ("m" in params) {
     const SSscenes = await fetchScenesAll({
       numList: [params.m!],
-      type: SceneType.SWSSMX,
+      isObj: 1,
+      pageNum: 1,
+      pageSize: 100,
     });
-    const YDscenes = await fetchScenesAll({
-      numList: [params.m!],
-      type: SceneType.SWYDMX,
-    });
-    const DDscenes = await fetchScenesAll({
-      numList: [params.m!],
-      type: SceneType.DSFXJ,
-    });
-    const scenes = [...SSscenes, ...YDscenes, ...DDscenes];
+    const scenes = [...SSscenes.list];
     scene = scenes.find((scene) => scene.num === params.m);
   } else if ("fileUrl" in params && "type" in params) {
     const url = JSON.stringify([unescape(params.fileUrl!)]);

+ 2 - 2
src/views/view/index.vue

@@ -30,7 +30,7 @@ import {
   views,
   createView,
   autoSaveViews,
-  initialViews,
+  // initialViews,
   initialTaggingStyles,
   initialTaggings,
   initialMeasures,
@@ -47,7 +47,7 @@ import { ref, watch } from "vue";
 
 import type { View } from "@/store";
 
-initialViews();
+// initialViews();
 initialTaggingStyles(), initialTaggings(), initialMeasures();
 const getView = async () => {
   try {

+ 9 - 8
vite.config.ts

@@ -5,7 +5,8 @@ import mkcert from 'vite-plugin-mkcert'
 
 import { resolve } from 'path'
 
-const ip = `https://survey.4dkankan.com/`
+const oss = `https://survey.4dkankan.com/`
+const ip = `http://192.168.0.43:8808`
 const proxy = {
   '/offlineData': {
     target: 'http://192.168.0.43:9000/',
@@ -28,37 +29,37 @@ const proxy = {
     rewrite: path => path.replace(/^\/api/, '')
   },
   '/swkk': {
-    target: `${ip}/`,
+    target: `${oss}/`,
     changeOrigin: true,
     rewrite: path => path.replace(/^\/swkk/, '')
   },
   '/oss': {
-    target: `${ip}/`,
+    target: `${oss}/`,
     changeOrigin: true,
     rewrite: path => path.replace(/^\/oss/, '/oss')
   },
   '/laser': {
-    target: `${ip}/`,
+    target: `${oss}/`,
     changeOrigin: true,
     rewrite: path => path.replace(/^\/laser/, '/laser')
   },
   '/laser-data': {
-    target: `${ip}/`,
+    target: `${oss}/`,
     changeOrigin: true,
     rewrite: path => path.replace(/^\/laser-data/, '/laser-data')
   },
   '/fdkk': {
-    target: `${ip}/`,
+    target: `${oss}/`,
     changeOrigin: true,
     rewrite: path => path.replace(/^\/fdkk/, '/fdkk')
   },
   '/service': {
-    target: ip,
+    target: oss,
     changeOrigin: true,
     rewrite: path => path.replace(/^\/service/, '/service')
   },
   '/swss': {
-    target: `${ip}/mega`,
+    target: `${oss}/mega`,
     changeOrigin: true,
     rewrite: path => path.replace(/^\/swss/, '')
   }