|
@@ -20,7 +20,12 @@
|
|
|
>
|
|
|
<div class="poprs sceneList" v-if="sceneList.length">
|
|
|
<el-dropdown placement="bottom-start" trigger="click" @command="handleCommand">
|
|
|
- <el-icon size="24"><Expand /></el-icon>
|
|
|
+ <span class="el-dropdown-link">
|
|
|
+ {{sceneListName}}
|
|
|
+ <el-icon class="el-icon--right">
|
|
|
+ <arrow-down />
|
|
|
+ </el-icon>
|
|
|
+ </span>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
<el-dropdown-item v-for="item,index in sceneList" :key="index" :command="item.id">{{ item.name || '多元融合' }}</el-dropdown-item>
|
|
@@ -55,9 +60,9 @@
|
|
|
import lyTop from "./top/index.vue";
|
|
|
import lySlide from "./slide/index.vue";
|
|
|
import { routeIsSystem, router } from "@/router";
|
|
|
-import { computed, ref } from "vue";
|
|
|
+import { computed, ref, onMounted } from "vue";
|
|
|
import { menuRouteNames } from "@/app";
|
|
|
-import { updateByTreeFileLists, getCaseSceneListData, getUrlSrc } from "@/store/case";
|
|
|
+import { updateByTreeFileLists, getCaseSceneListData, getUrlSrc, getcaseLists, getCaseSceneList } from "@/store/case";
|
|
|
console.log(menuRouteNames, 'menuRouteNames', router.currentRoute.value.name);
|
|
|
const isSystem = computed(() => routeIsSystem());
|
|
|
const caseId = computed(() => {
|
|
@@ -66,18 +71,41 @@ const caseId = computed(() => {
|
|
|
return Number(caseId);
|
|
|
}
|
|
|
});
|
|
|
-const sceneURL = ref(`/code/index.html?caseId=${caseId.value}&single#/show`)
|
|
|
-const sceneList = computed(() => {
|
|
|
- let mylist = getCaseSceneListData()
|
|
|
- return [{ id: -1, type: 99, name: '多元融合' }, ...mylist];
|
|
|
-});
|
|
|
+const sceneList = ref([]);
|
|
|
+const sceneURL = ref(``)
|
|
|
+const sceneListName = ref('')
|
|
|
+const modeList = ref([])
|
|
|
+const init = async () => {
|
|
|
+ modeList.value = await getcaseLists(caseId.value as number);
|
|
|
+ sceneList.value = await getCaseSceneList(caseId.value as number);
|
|
|
+ if(modeList.value.length){
|
|
|
+ sceneList.value.unshift({ id: -1, type: 99, name: '多元融合' });
|
|
|
+ }
|
|
|
+ handleCommand()
|
|
|
+ // let url = getUrlSrc({ id: 0 }, caseId.value)
|
|
|
+ // sceneURL.value = url;
|
|
|
+}
|
|
|
+init()
|
|
|
+// const sceneList = computed(() => {
|
|
|
+// let newlist = getCaseSceneListData(caseId.value as number)
|
|
|
+// if(modeList.value?.length){
|
|
|
+// return [{ id: -1, type: 99, name: '多元融合' }, ...newlist];
|
|
|
+// }else{
|
|
|
+// return newlist;
|
|
|
+// }
|
|
|
+// });
|
|
|
console.log(sceneList, 'sceneList');
|
|
|
+onMounted(() => {
|
|
|
+ // setupSDK(document.querySelector('iframe') as HTMLIFrameElement)
|
|
|
+})
|
|
|
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 newid = command || sceneList.value[0].id;
|
|
|
+ let item = sceneList.value.find(item => item.id == newid);
|
|
|
+ sceneListName.value = item.name;
|
|
|
let url = getUrlSrc(item, caseId.value)
|
|
|
sceneURL.value = url;
|
|
|
console.log('handleCommand', command, item, url);
|
|
@@ -146,18 +174,23 @@ const handleClick = (command: string) => {
|
|
|
position: relative;
|
|
|
}
|
|
|
.sceneList{
|
|
|
- width: 48px;
|
|
|
- height: 38px;
|
|
|
position: absolute;
|
|
|
left: 10px;
|
|
|
- top: 10px;
|
|
|
-
|
|
|
- padding: 6px 0;
|
|
|
- line-height: 42px;
|
|
|
- background: rgba(27, 27, 28, 0.80);
|
|
|
- text-align: center;
|
|
|
- cursor: pointer;
|
|
|
+ top: 30px;
|
|
|
}
|
|
|
+ // .sceneList{
|
|
|
+ // width: 48px;
|
|
|
+ // height: 38px;
|
|
|
+ // position: absolute;
|
|
|
+ // left: 10px;
|
|
|
+ // top: 10px;
|
|
|
+
|
|
|
+ // padding: 6px 0;
|
|
|
+ // line-height: 42px;
|
|
|
+ // background: rgba(27, 27, 28, 0.80);
|
|
|
+ // text-align: center;
|
|
|
+ // cursor: pointer;
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
}
|