完成一半
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
<!-- 一进去的话应该是预览模式,所以引入这个组件1 -->
|
||||
|
||||
<preview-scene id="tunnel-box" :isedit="false" :tunnelId="tunnelId" :key="tunnelId" :tunnelLen="tunnelLen"
|
||||
:tunnelName="tunnelName"></preview-scene>
|
||||
:tunnelName="tunnelName" :largeScreen="largeScreen"></preview-scene>
|
||||
<div class="left">
|
||||
<el-drawer v-model="drawerLeft" direction="ltr" modal-class="modal-box" :modal="false" :show-close="false"
|
||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||
@@ -87,6 +87,7 @@ import { getLargeScreen, getLargeScreenInfo, getTunnelBySiteId } from "@/api/lar
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { getUserInfo } from "@/api/login";
|
||||
import { initSceneData } from "@/api/tunnelScene";
|
||||
import { computed } from "vue";
|
||||
const authStore = useAuthStore();
|
||||
const router = useRouter();
|
||||
const previewId = reactive(router.currentRoute.value.params.tunnelId)
|
||||
@@ -190,9 +191,9 @@ const getOtherInfo = () => {
|
||||
currentSiteId.value = res.data.siteOption[0].value
|
||||
currentSite.value = res.data.siteOption[0].label
|
||||
localStorage.setItem('site', currentSite.value)
|
||||
if(res.data.tunnelOption.length === 0){
|
||||
if (res.data.tunnelOption.length === 0) {
|
||||
getTunnel(res.data.siteOption[0].value)
|
||||
}else {
|
||||
} else {
|
||||
tunnelList.value = res.data.tunnelOption
|
||||
}
|
||||
if (previewId) {
|
||||
@@ -241,6 +242,7 @@ const getScreenInfo = (id) => {
|
||||
showBadLoading.value = 1
|
||||
}
|
||||
largeScreenData.value = res.data;
|
||||
// console.log(largeScreenData.value);
|
||||
} else {
|
||||
ElMessage.warning(res.msg)
|
||||
}
|
||||
@@ -254,13 +256,14 @@ const getScreenInfo = (id) => {
|
||||
}
|
||||
};
|
||||
//根据站点id获取隧道信息
|
||||
let largeScreen = computed(() => largeScreenData)
|
||||
const getTunnel = (id) => {
|
||||
getTunnelBySiteId(id).then((res) => {
|
||||
if (res?.code === 1000) {
|
||||
if(res.data.length === 0){
|
||||
if (res.data.length === 0) {
|
||||
ElMessage.warning('该站点下无隧道, 请新增隧道后再尝试!')
|
||||
tunnelList.value = []
|
||||
}else {
|
||||
} else {
|
||||
getScreenInfo(res.data[0]?.value)
|
||||
tunnelName = res.data[0].label
|
||||
tunnelList.value = res.data
|
||||
|
||||
Reference in New Issue
Block a user