From 53cdb854a30bcc327f9d432674cee706e033008b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com>
Date: Wed, 3 Jan 2024 19:58:32 +0800
Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81:=20=E9=9A=A7=E9=81=93?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=AD=E7=82=B9=E5=87=BB=E9=A2=84=E8=A7=88?=
=?UTF-8?q?=E9=9A=A7=E9=81=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/content/usedEle/UsedEle.vue | 1 -
src/router/index.js | 9 ++++++++
src/views/tunnel-manage/index.vue | 17 +++++++++------
src/views/tunnel/index.vue | 24 ++++++++++++++++------
4 files changed, 38 insertions(+), 13 deletions(-)
diff --git a/src/components/content/usedEle/UsedEle.vue b/src/components/content/usedEle/UsedEle.vue
index 6108fdd..4e5fe39 100644
--- a/src/components/content/usedEle/UsedEle.vue
+++ b/src/components/content/usedEle/UsedEle.vue
@@ -74,7 +74,6 @@ const bgImage = computed(() =>
: "bg.png"
);
watch(() => props.eleData, (now) => {
- console.log('now.frequencyChangerList',now)
if(now.frequencyChangerList.length===0){
electricityConsumptionMonthly.value=0
}else {
diff --git a/src/router/index.js b/src/router/index.js
index 83a28a1..64ac055 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -23,6 +23,15 @@ const routes = [
breadcrumb: true
},
},
+ {
+ path: '/:tunnelId',
+ name: 'previewTunnel',
+ component: () => import('@/views/tunnel/index.vue'),
+ meta: {
+ title: '隧道预览',
+ breadcrumb: true
+ },
+ },
{
path: '/edit/:tunnelId(\\d+)/:type/:userId(\\d+)',
name: 'tunneledit',
diff --git a/src/views/tunnel-manage/index.vue b/src/views/tunnel-manage/index.vue
index cd1d35d..8030c72 100644
--- a/src/views/tunnel-manage/index.vue
+++ b/src/views/tunnel-manage/index.vue
@@ -31,7 +31,7 @@
-
+
@@ -113,9 +113,10 @@ import {getSiteDetail} from "@/api/site";
const router = useRouter()
const showAddIcon = ref(true)
-const siteId = reactive(router.currentRoute.value.params.siteId)
-const userId = reactive(router.currentRoute.value.params.userId)
-const type = reactive(router.currentRoute.value.params.type)
+const params = router.currentRoute.value.params;
+const siteId = reactive(params.siteId)
+const userId = reactive(params.userId)
+const type = reactive(params.type)
const formRules = ref({
tunnelName: [{required: true, message: '请输入隧道名称', trigger: 'blur'}],
serialNumber: [{required: true, message: '请输入序列号', trigger: 'blur'}]
@@ -256,8 +257,11 @@ const handleSubmit = (instance) => {
// })
}
//预览隧道
-const handlePreview=()=>{
-
+const handlePreview=(id)=>{
+ console.log('预览')
+ if(id){
+ router.push('/'+id)
+ }
}
const handleGoToEditTunnel = (tunnelId) => {
isEdit.value = true
@@ -589,6 +593,7 @@ const handleMoreDelete = () => {
}
.left-img {
+ cursor: pointer;
margin-top: 110px;
margin-right: 50px;
width: 340px;
diff --git a/src/views/tunnel/index.vue b/src/views/tunnel/index.vue
index 178a4f6..40a5797 100644
--- a/src/views/tunnel/index.vue
+++ b/src/views/tunnel/index.vue
@@ -56,7 +56,7 @@
-
+
{{ item.label }}
@@ -85,9 +85,11 @@ import {getUserInfo} from "@/api/login";
import {initSceneData} from "@/api/tunnelScene";
const authStore = useAuthStore();
const router = useRouter();
+const previewId = reactive(router.currentRoute.value.params.tunnelId)
const selectIndex = ref(-1);
const showFan = ref(false);
const drawerLeft = ref(true);
+const initialIndex = ref(0)
const showFanLoading = ref(0)
const showWindLoading = ref(0)
const showBadLoading = ref(0)
@@ -152,11 +154,15 @@ const socketData = reactive({
sensor: [],
});
onMounted(() => {
+ if(previewId){
+ getScreenInfo(previewId)
+
+ }
+ getUser()
+ getOtherInfo()
nextTick(() => {
showFan.value = true;
});
- getUser()
- getOtherInfo()
});
const getUser = () => {
getUserInfo().then(res => {
@@ -185,7 +191,15 @@ const getOtherInfo = () => {
currentSite.value = res.data.siteOption[0].label
localStorage.setItem('site', currentSite.value)
tunnelList.value = res.data.tunnelOption
- getTunnel(res.data.siteOption[0].value)
+ if(previewId){
+ tunnelList.value.forEach((item, index) => {
+ if(item.value == previewId){
+ initialIndex.value = index
+ }
+ })
+ }else{
+ getTunnel(res.data.siteOption[0].value)
+ }
}
});
};
@@ -223,7 +237,6 @@ const getScreenInfo = (id) => {
showBadLoading.value=1
}
largeScreenData.value = res.data;
- console.log('largeScreenData.value',largeScreenData.value)
} else {
ElMessage.warning(res.msg)
}
@@ -243,7 +256,6 @@ const getTunnel = (id) => {
});
}
const changeTunnel = (e) => {
- console.log('tunnelList.value',e,tunnelList.value)
let newObj = {}
tunnelList.value.forEach((item, index) => {
if (index === e) {