tangning 7 bulan lalu
induk
melakukan
f3845cac24
4 mengubah file dengan 60 tambahan dan 8 penghapusan
  1. 1 1
      src/request/index.ts
  2. 18 1
      src/store/case.ts
  3. 38 3
      src/view/layout/index.vue
  4. 3 3
      src/view/vrmodel/index.vue

+ 1 - 1
src/request/index.ts

@@ -95,7 +95,7 @@ const responseInterceptor = (res: AxiosResponse<any, any>) => {
       type: "warning",
       showClose: false
     }).then(async () => {
-      window.open(window.location.origin + "/admin/#/login");
+      window.open(window.location.origin + "/admin/#/statistics/scene");
     });
   };
   if (!successCode.includes(res.data.code)) {

+ 18 - 1
src/store/case.ts

@@ -49,6 +49,7 @@ export type Case = {
 };
 
 export const treeList = ref([]);
+export const sceneList = ref([]);
 export const caseInfoData = ref({
   caseTitle: '',
 });
@@ -98,7 +99,8 @@ export const updateCaseInfo = async (caseFile: CaseFile) =>
   });
 
 export const getCaseSceneList = async (caseId: number): Promise<Scene[]> => {
-  return (await axios.get(caseSceneList, { params: { caseId } })).data;
+  sceneList.value = (await axios.get(caseSceneList, { params: { caseId } })).data;
+  return sceneList.value;
 };
 
 export const getFilepageList = async (params): Promise<Scene[]> => {
@@ -233,3 +235,18 @@ export const getSceneListHasAi = (caseId: number) =>
 export const submitMergePhotos = (data) => axios.post(ffmpegMergeImage, { ...data })
 
 export const getCaseInfoData = () => caseInfoData.value
+export const getCaseSceneListData = () => sceneList.value
+
+export const getUrlSrc = (item, caseId) => {
+  let SceneType = {
+    0: `/swkk/spg.html?m=${item.num}`,
+    1: `/swkk/spg.html?m=${item.num}`,
+    2: `/swkk/spg.html?m=${item.num}`,
+    3: `/swss/index.html?m=${item.num}`,
+    4: `/swkk/spg.html?m=${item.num}`,
+    5: `index.html?caseId=${caseId}&modelId=${item.num}#sign-model`,
+    6: `/swss/index.html?m=${item.num}`,
+    7: `/swkk/spg.html?m=${item.num}`,
+  };
+  return SceneType[item.type];
+}

+ 38 - 3
src/view/layout/index.vue

@@ -18,10 +18,24 @@
                 // display: showScene ? 'none' : 'block'
               }"
             >
+            <div class="poprs sceneList">
+              
+              <el-dropdown placement="bottom-start" trigger="click" @command="handleCommand">
+              <el-icon size="24"><Expand /></el-icon>
+              <template #dropdown>
+                <el-dropdown-menu>
+                  <el-dropdown-item v-for="item,index in sceneList" :key="index" :command="item.id">{{ item.name || '多元融合' }}</el-dropdown-item>
+                </el-dropdown-menu>
+              </template>
+            </el-dropdown>
+              <!-- <div v-for="item,index in sceneList" :key="index">
+                {{ item.name }}
+              </div> -->
+            </div>
             <!-- @load="setupSDK($event.target)" -->
               <iframe
                 v-if="caseId"
-                :src="`/code/index.html?caseId=${caseId}&single#/show`"
+                :src="sceneURL || `/code/index.html?caseId=${caseId}&single#/show`"
                 frameborder="0"
                 :style="{ width: '100%', height: '100%' }"
               ></iframe>
@@ -44,9 +58,8 @@ import lySlide from "./slide/index.vue";
 import { routeIsSystem, router } from "@/router";
 import { computed, ref } from "vue";
 import { menuRouteNames } from "@/app";
-import { updateByTreeFileLists } from "@/store/case";
+import { updateByTreeFileLists, getCaseSceneListData, getUrlSrc } from "@/store/case";
 console.log(menuRouteNames, 'menuRouteNames', router.currentRoute.value.name);
-const sceneURL = ref('/code/index.html?caseId=360#/show')
 const isSystem = computed(() => routeIsSystem());
 const caseId = computed(() => {
   const caseId = router.currentRoute.value.params.caseId;
@@ -54,10 +67,23 @@ const caseId = computed(() => {
     return Number(caseId);
   }
 });
+const sceneURL = ref(null)
+const sceneList = computed(() => getCaseSceneListData());
+console.log(sceneList, 'sceneList');
 updateByTreeFileLists()
 const hiddenSlide = computed(
   () => !menuRouteNames.includes(router.currentRoute.value.name as string)
 );
+const handleCommand = (command) => {
+  let item = sceneList.value.find(item => item.id == command);
+  let url = getUrlSrc(item, caseId.value)
+  sceneURL.value = url;
+  console.log('handleCommand', command, item, url);
+}
+const handleClick = (command: string) => {
+  console.log('handleClick', command);
+}
+
 </script>
 
 <style lang="scss" scoped>
@@ -114,6 +140,15 @@ const hiddenSlide = computed(
         background-color: var(--bgColor);
         overflow-y: scroll;
       }
+      .sceneList{
+        width: 48px;
+        height: 38px;
+        padding: 6px 0;
+        line-height: 42px;
+        background: rgba(27, 27, 28, 0.80);
+        text-align: center;
+        cursor: pointer;
+      }
     }
   }
 }

+ 3 - 3
src/view/vrmodel/index.vue

@@ -13,7 +13,7 @@
             v-for="item,index in list"
             :key="index"
           >
-            <span>{{ item.name || item.modelTitle }}</span>
+            <span>{{ item.name || '多元融合' }}</span>
             <div @click="handlegotoEdit(item)" class="cursor-pointer" quaternary type="primary">编辑</div>
           </div>
         </div>
@@ -22,7 +22,7 @@
 </template>
 
 <script setup lang="ts">
-import { getCaseSceneList } from "@/store/case";
+import { getCaseSceneList, getUrlSrc } from "@/store/case";
 import { router } from "@/router";
 import comSelect from "@/components/company-select/index.vue";
 import List from "./list.vue";
@@ -45,7 +45,7 @@ async function geiList() {
   console.log("res", list.value);
 }
 function handlegotoEdit(record) {
-  let url = `/epg.html?m=${record.num}`
+  let url = getUrlSrc(record, caseId.value)
   window.open(url);
 }
 function handleAdddyrh(record) {