From f57023a509fd9f4cf15cae265c077030c48b228a Mon Sep 17 00:00:00 2001
From: dj <1042039504@qq.com>
Date: Sat, 7 Dec 2024 23:04:42 +0800
Subject: [PATCH] =?UTF-8?q?feat=20:=20=E9=9A=A7=E9=81=93=E6=A8=A1=E6=8B=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 2 +-
.env.production | 2 +-
src/components/deviceManage/index.vue | 830 ++++++++++++++++++++++++++
src/components/manageBtn/index.vue | 9 +-
src/store/modelSceneStore.js | 2 +-
src/views/debug/index.vue | 2 +-
src/views/tunnel-simulate/index.vue | 320 +++++-----
src/views/tunnel/index.vue | 24 +-
8 files changed, 1016 insertions(+), 175 deletions(-)
create mode 100644 src/components/deviceManage/index.vue
diff --git a/.env.development b/.env.development
index d59e51c..043d5bc 100644
--- a/.env.development
+++ b/.env.development
@@ -3,5 +3,5 @@
VITE_BASE_URL='/api'
# VITE_BASE_URL='http://192.168.101.7:8000'
-#VITE_BASE_WSURL='ws://web-tunnel.feashow.com/api'
+#VITE_BASE_WSURL='ws://tunnel.feashow.com/api'
VITE_BASE_WSURL='/websocket'
diff --git a/.env.production b/.env.production
index 4c27cb7..c545c78 100644
--- a/.env.production
+++ b/.env.production
@@ -4,5 +4,5 @@ VITE_TITLE='fateverse'
VITE_BASE_URL='/api'
-#VITE_BASE_WSURL='ws://web-tunnel.feashow.com/api'
+#VITE_BASE_WSURL='ws://tunnel.feashow.com/api'
VITE_BASE_WSURL='/websocket'
diff --git a/src/components/deviceManage/index.vue b/src/components/deviceManage/index.vue
new file mode 100644
index 0000000..e0f15a5
--- /dev/null
+++ b/src/components/deviceManage/index.vue
@@ -0,0 +1,830 @@
+
+
+
+
+
+
+ 风机
+
+
+ 风压
+
+
+ 其他传感器
+
+
+
+
+
+
+
+
+
风机设备管理
+
+ 采集频率
+
+
+ 秒/次
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
风压设备管理
+
+ 采集频率
+
+
+ 秒/次
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
其他传感器设备管理
+
+ 采集频率
+
+
+ 秒/次
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/manageBtn/index.vue b/src/components/manageBtn/index.vue
index 08f1ac2..f18182e 100644
--- a/src/components/manageBtn/index.vue
+++ b/src/components/manageBtn/index.vue
@@ -51,10 +51,11 @@ const btnList = ref([
// icon: 'sp_icon_xtgl.png',
// name: '系统管理'
// },
- // {
- // icon: 'sp_icon_mngl.png',
- // name: '模拟仿真'
- // },
+ {
+ route: '/simulate',
+ icon: 'sp_icon_mngl.png',
+ name: '模拟仿真'
+ },
])
const newList=ref([])
const selectButton = ref(props.modelValue);
diff --git a/src/store/modelSceneStore.js b/src/store/modelSceneStore.js
index 9999244..d70e7e0 100644
--- a/src/store/modelSceneStore.js
+++ b/src/store/modelSceneStore.js
@@ -44,7 +44,7 @@ export const useModelSceneStore = defineStore("modelSceneData", () => {
return new Promise((resolve, reject) => {
initSceneData(tunnelId)
.then((res) => {
- console.info("🚀 ~method:initSceneData -----", res)
+ // console.info("🚀 ~method:initSceneData -----", res)
serialNumber.value=res.data.serialNumber
serialNumberPrefix.value=res.data.serialNumberPrefix
tunnelGatewayDtoList.value=res.data.tunnelGatewayVoList
diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue
index e737004..e7633ad 100644
--- a/src/views/debug/index.vue
+++ b/src/views/debug/index.vue
@@ -76,7 +76,7 @@ const handleSend = () => {
const initWebSocket = () => {
// let wsUrl = `ws://192.168.31.176:9000/websocket/debug/${token}/${serialNumber.value}`
// let wsUrl = import.meta.env.VITE_BASE_WSURL+`/${token}/${serialNumber.value}`;
- let wsUrl = `ws://web-tunnel.feashow.com/api/wstunnel/websocket/debug/${token}/${serialNumber.value}`
+ let wsUrl = `ws://tunnel.feashow.com/api/wstunnel/websocket/debug/${token}/${serialNumber.value}`
console.log(wsUrl)
socket = new WebSocket(wsUrl)
//连接发生错误的回调方法
diff --git a/src/views/tunnel-simulate/index.vue b/src/views/tunnel-simulate/index.vue
index 5b8137a..c4c54b8 100644
--- a/src/views/tunnel-simulate/index.vue
+++ b/src/views/tunnel-simulate/index.vue
@@ -2,48 +2,44 @@
-
+
隧道总长度: {{ tunnelLength }}米
开始模拟
-
- 模拟爆破
- 结束模拟
-
+ >开始模拟
+
结束模拟
当前站点:
{{ currentSite }}
{{ item.label }}
+ v-for="item in siteList"
+ :key="item.value"
+ :command="item"
+ >{{ item.label }}
-
+
@@ -53,40 +49,40 @@
-
+
@@ -128,12 +124,12 @@
@@ -146,10 +142,10 @@
报警时间:
@@ -163,33 +159,33 @@
-
-
+
+
@@ -198,87 +194,87 @@
{{ scope.row.lookupStatus ? "已读" : "未读" }}
+ >{{ scope.row.lookupStatus ? "已读" : "未读" }}
详情
+ type="primary"
+ size="mini"
+ style="font-weight: bold"
+ @click="handleView(scope.row)"
+ link
+ >详情
删除
+ type="danger"
+ size="mini"
+ v-if="roleKey !== 'administrator'"
+ @click="handleDelete(scope.row)"
+ link
+ >删除
@@ -297,9 +293,9 @@ import AirInfo from "@/components/content/airInfo/AirInfo.vue";
import BadGasInfo from "@/components/content/badGasInfo/BadGasInfo.vue";
import ManageBtn from "@/components/manageBtn/index.vue";
import TunnelTitle from "@/components/tunnelTitle/index.vue";
-import { dateFormat } from "@/utils/date.js";
-import { getToken } from "@/utils/auth";
-import { useAuthStore } from "@/store/userstore.js";
+import {dateFormat} from "@/utils/date.js";
+import {getToken} from "@/utils/auth";
+import {useAuthStore} from "@/store/userstore.js";
import {
getLargeScreen,
getLargeScreenInfo,
@@ -309,11 +305,11 @@ import {
getAlarmDetail,
updateAlarmState,
} from "@/api/largeScreen";
-import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
-import { getUserInfo } from "@/api/login";
-import { initSceneData } from "@/api/tunnelScene";
-import { getTunnelList } from "@/api/tunnelManage";
-import { debounce } from "lodash";
+import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
+import {getUserInfo} from "@/api/login";
+import {initSceneData} from "@/api/tunnelScene";
+import {getTunnelList} from "@/api/tunnelManage";
+import {debounce} from "lodash";
const authStore = useAuthStore();
const router = useRouter();
@@ -324,6 +320,7 @@ const selectIndex = ref(-1);
const isVisited = ref(false);
const isDetailVisited = ref(false);
const showFan = ref(false);
+const showDevice = ref(false);
const drawerLeft = ref(true);
const showTunnelTitle = ref(true);
const isPreview = ref(true);
@@ -378,6 +375,7 @@ const btnList = ref([
// name: '系统管理'
// },
// {
+ // route: '/simulate',
// icon: 'sp_icon_mngl.png',
// name: '模拟仿真'
// },
@@ -417,6 +415,11 @@ onMounted(() => {
});
const startSimulate = () => {
isStartSimulate.value = false;
+ showDevice.value = true;
+};
+const cancelDeviceManage = () => {
+ isStartSimulate.value = true;
+ showDevice.value = false;
};
const endSimulate = () => {
isStartSimulate.value = true;
@@ -570,13 +573,13 @@ const getScreenInfo = (id) => {
// })
res.data.sensorList.forEach((item) => {
if (
- item.equipmentType === "dust" ||
- item.equipmentType === "carbonDioxide" ||
- item.equipmentType === "carbonMonoxide" ||
- item.equipmentType === "hydrogenSulfide" ||
- item.equipmentType === "sulfurDioxide" ||
- item.equipmentType === "sulfurMonoxide" ||
- item.equipmentType === "nitrogenDioxide"
+ item.equipmentType === "dust" ||
+ item.equipmentType === "carbonDioxide" ||
+ item.equipmentType === "carbonMonoxide" ||
+ item.equipmentType === "hydrogenSulfide" ||
+ item.equipmentType === "sulfurDioxide" ||
+ item.equipmentType === "sulfurMonoxide" ||
+ item.equipmentType === "nitrogenDioxide"
) {
showBadLoading.value = 0;
} else {
@@ -672,7 +675,7 @@ const manageSelect = (index) => {
} else if (index === "隧道管理") {
if (currentSiteId.value && currentUserId.value) {
router.push(
- "/tunnel/" +
+ "/tunnel/" +
localStorage.getItem("currentSiteId") +
"/byHome/" +
currentUserId.value
@@ -733,7 +736,7 @@ const nextBtn = () => {
const initWebSocket = () => {
// let wsUrl = `ws://192.168.31.176:9000/websocket/equipment/${token}/${serialNumber.value}`
- let wsUrl = `ws://web-tunnel.feashow.com/api/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
+ let wsUrl = `ws://tunnel.feashow.com/api/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
// let wsUrl = import.meta.env.VITE_BASE_WSURL+`/${token}/${serialNumber.value}`;
// let wsUrl = `ws://clay.frp.feashow.cn/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
socket = new WebSocket(wsUrl);
@@ -843,6 +846,7 @@ const initWebSocket = () => {
text-align: center;
margin-left: 40px;
font-size: 38px;
+
&:hover {
color: #f7b500;
}
diff --git a/src/views/tunnel/index.vue b/src/views/tunnel/index.vue
index 4503123..f119264 100644
--- a/src/views/tunnel/index.vue
+++ b/src/views/tunnel/index.vue
@@ -336,10 +336,11 @@ const btnList = ref([
// icon: 'sp_icon_xtgl.png',
// name: '系统管理'
// },
- // {
- // icon: 'sp_icon_mngl.png',
- // name: '模拟仿真'
- // },
+ {
+ route: '/simulate',
+ icon: 'sp_icon_mngl.png',
+ name: '模拟仿真'
+ },
]);
const serialNumber = ref("");
const roleKey = ref("");
@@ -466,6 +467,7 @@ const getOtherInfo = () => {
getLargeScreenInfo().then((res) => {
if (res?.code === 1000) {
let routeArr = [];
+ res.data.routeList.push('/simulate')
res.data.routeList.forEach((item) => {
for (let btn of btnList.value) {
if (item === btn.route) {
@@ -620,12 +622,12 @@ const changeTunnel = (e) => {
showFan.value = true;
});
};
-const manageSelect = (index) => {
- if (index === "站点管理") {
+const manageSelect = (name) => {
+ if (name === "站点管理") {
if (currentUserId.value) {
router.push("/site/" + currentUserId.value + "/" + currentSiteId.value);
}
- } else if (index === "隧道管理") {
+ } else if (name === "隧道管理") {
if (currentSiteId.value && currentUserId.value) {
router.push(
"/tunnel/" +
@@ -634,10 +636,14 @@ const manageSelect = (index) => {
currentUserId.value
);
}
- } else if (index === "用户管理") {
+ } else if (name === "用户管理") {
if (currentSiteId.value) {
router.push("/user/" + localStorage.getItem("currentSiteId"));
}
+ } else if (name === "模拟仿真") {
+ if (tunnelId.value) {
+ router.push("/simulate/" + tunnelId.value);
+ }
}
if(socket){
socket.close()
@@ -689,7 +695,7 @@ const nextBtn = () => {
const initWebSocket = () => {
// let wsUrl = `ws://192.168.31.176:9000/websocket/equipment/${token}/${serialNumber.value}`
- let wsUrl = `ws://web-tunnel.feashow.com/api/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
+ let wsUrl = `ws://tunnel.feashow.com/api/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
// let wsUrl = import.meta.env.VITE_BASE_WSURL+`/${token}/${serialNumber.value}`;
// let wsUrl = `ws://clay.frp.feashow.cn/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
socket = new WebSocket(wsUrl);