From 69b7012682b65295d0cd454c8b9077db1133985f Mon Sep 17 00:00:00 2001
From: Gary Gu <garygu@Garydebijibendiannao.local>
Date: Fri, 11 Apr 2025 15:25:05 +0800
Subject: [PATCH] feat: 增加协同平台功能
---
public/config.js | 1 +
src/Dashboard.vue | 24 +++++++++++++++++++++---
src/components/Header.vue | 9 +++++++++
3 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/public/config.js b/public/config.js
index 8669c90..ddf2379 100644
--- a/public/config.js
+++ b/public/config.js
@@ -15,4 +15,5 @@
modelUrl: 'http://8.140.54.245:5010/#/Home/sceneManagementDetail?shareUrlToken=69E38706C533C52C84A9F864785953A2AB834465D303010594EF3531C3AE64EE121F5C12AFB6E145D2F72023B59D3999249F65A61D9E4F11F3CD4667FA621262CC361AC0176055077A4C26B78B014EEB', // 模型预览地址
videoUrl: 'http://resources.vothing.com/mp4/12.mp4', // 实况地址
projectId: '7d242691-e6b2-4fbc-b4df-687883eb1a4c', // 项目id
+ xieTongIframeSrc: 'http://8.140.54.245:5010/#/'
}
\ No newline at end of file
diff --git a/src/Dashboard.vue b/src/Dashboard.vue
index fe85677..42568a9 100644
--- a/src/Dashboard.vue
+++ b/src/Dashboard.vue
@@ -19,12 +19,12 @@
}"
>
<!--头部-->
- <app-header class="absolute z-[100] top-0 left-0 right-0" :selected-id="currentProjectId" />
+ <app-header class="absolute z-[100] top-0 left-0 right-0" :selected-id="currentProjectId" @onHomeClick="switchView" />
<!--页面内容-->
- <div class="content-wrapper px-[22px] py-[10px] absolute inset-0 top-[80px] flex gap-[20px]">
+ <div class="content-wrapper px-[22px] py-[10px] absolute inset-0 top-[80px] flex gap-[20px]" v-if="clickTab === 'home'">
<div class="flex-1 min-w-0">
<!-- 左侧模块 -->
<div class="w-full h-full">
@@ -45,6 +45,9 @@
</div>
</div>
+ <div class="absolute inset-0 top-[80px] flex" v-if="clickTab === 'xietong'">
+ <iframe :src="iframeSrc" class="xieTongIframe" frameborder='0'></iframe>
+ </div>
<!--multiverse渲染容器
<div id="renderDom" class="absolute z-[40] top-0 bottom-0 left-0 right-0 w-full h-full"></div>-->
@@ -87,7 +90,9 @@
return {
backgroundImage: new URL('@/assets/images/backgrounds/screen.png', import.meta.url).href,
currentProjectId: '1c179617-a7d9-4243-b813-84fa55a17ce7',
- isReady: false
+ isReady: false,
+ clickTab:'home',
+ iframeSrc: window.ProjectConfig.xieTongIframeSrc
};
},
computed: {
@@ -102,6 +107,13 @@
this.resetEngineRelated();
},
methods: {
+ /**
+ * 切换视图
+ * @param val
+ */
+ switchView(val){
+ this.clickTab = val;
+ },
//重置引擎相关的东西
resetEngineRelated() {
window.scene = window.underlay = null;
@@ -163,3 +175,9 @@
},
};
</script>
+<style lang="scss" scoped>
+ .xieTongIframe{
+ width: 100%;
+ height: 100%;
+ }
+</style>
diff --git a/src/components/Header.vue b/src/components/Header.vue
index 3e8d552..07e9e2c 100644
--- a/src/components/Header.vue
+++ b/src/components/Header.vue
@@ -22,6 +22,14 @@
</div>
<img class="w-[116px] h-[8px] absolute bottom-[-4px]" :src="getImageUrl('home_line.png')" alt="" v-if="activeTab === 'home'">
</div>
+ <div class="flex flex-col items-center ml-[78px] cursor-pointer relative" @click="onHomeClick('xietong')">
+ <div class="flex items-center">
+ <img class="w-[20px] h-[20px]" :src="getImageUrl(activeTab === 'xietong' ? 'zhihui_active.png' : 'zhihui.png')" alt="">
+ <div class="text-[20px] text-[#C8C8C8] ml-[8px]" :class="{'text-[#FFBF00]': activeTab === 'xietong'}">协同平台</div>
+ </div>
+ <img class="w-[116px] h-[8px] absolute bottom-[-4px]" :src="getImageUrl('home_line.png')" alt="" v-if="activeTab === 'xietong'">
+ </div>
+
<div class="flex flex-col items-center ml-[78px] cursor-pointer relative" @click="onHomeClick('zhihui')">
<div class="flex items-center">
<img class="w-[20px] h-[20px]" :src="getImageUrl(activeTab === 'zhihui' ? 'zhihui_active.png' : 'zhihui.png')" alt="">
@@ -80,6 +88,7 @@
},
onHomeClick(tab) {
this.activeTab = tab;
+ this.$emit("onHomeClick", tab);
},
updateTime() {
const now = new Date();
--
Gitblit v1.9.3