From ae1cc159a44c7b36f2e8005c77b3819b2f63e417 Mon Sep 17 00:00:00 2001 From: trp <2477421791@qq.com> Date: Mon, 2 Sep 2024 18:43:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?trp:=E8=AE=BE=E5=A4=87hover=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=E9=9D=A2=E6=9D=BF=E6=95=B0=E6=8D=AE=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=92=8C=E6=A8=A1=E6=8B=9F=E6=A8=A1=E5=BC=8F3d=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/tunnel.js | 17 +- .../content/tunnelScene/PreviewScene.vue | 834 +++++++++--------- .../content/tunnelScene/TunnelScene.vue | 60 +- .../tunnelScene/preEquComp/preDialog.vue | 94 +- src/views/tunnel-simulate/index.vue | 693 +++++++++------ src/views/tunnel/index.vue | 666 ++++++++------ 6 files changed, 1395 insertions(+), 969 deletions(-) diff --git a/src/api/tunnel.js b/src/api/tunnel.js index c06d5d4..fe871f0 100644 --- a/src/api/tunnel.js +++ b/src/api/tunnel.js @@ -1,8 +1,17 @@ -import request from '@/utils/request.js' +import request from "@/utils/request.js"; export const getTunnelOption = (siteId) => { return request({ url: `/tunnel/tunnel/option/${siteId}`, - method: 'get' - }) -} + method: "get", + }); +}; + +// 数据3d隧道模拟接口渲染数据源 +export const getTunnelSimulateData = (siteId) => { + return request({ + url: `/tunnel/tunnel/data/${siteId}`, + method: "get", + params, + }); +}; diff --git a/src/components/content/tunnelScene/PreviewScene.vue b/src/components/content/tunnelScene/PreviewScene.vue index 3e7c494..9771bf6 100644 --- a/src/components/content/tunnelScene/PreviewScene.vue +++ b/src/components/content/tunnelScene/PreviewScene.vue @@ -1,35 +1,49 @@ diff --git a/src/components/content/tunnelScene/TunnelScene.vue b/src/components/content/tunnelScene/TunnelScene.vue index 9419cfc..ddaebe6 100644 --- a/src/components/content/tunnelScene/TunnelScene.vue +++ b/src/components/content/tunnelScene/TunnelScene.vue @@ -3,17 +3,34 @@
- - + + " + >

是否确定删除该设备

@@ -61,7 +78,13 @@ const loader = new OBJLoader(); let hdrLoader = new RGBELoader(); let backColorSet = three.sRGBEncoding; const modelStore = useModelSceneStore(); -const params = defineProps(["isedit", "tunnelId", "tunnelLength", "form"]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理 +const params = defineProps([ + "isedit", + "tunnelId", + "tunnelLength", + "form", + "devRealtimeData", +]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理 let isedit = ref(params.isedit); let tunnelId = reactive(params.tunnelId); @@ -116,11 +139,10 @@ async function handleMounted() { // modelList.value = await initData(params.tunnelId, params.form); console.log("test", modelList.value); demo.editTunnelInit(toRaw(modelList.value)); - demo.SignsInf(params.form.tunnelAlias, String(params.tunnelLength)) + demo.SignsInf(params.form.tunnelAlias, String(params.tunnelLength)); } catch (err) { - console.log(err); ElMessage({ - message: "场景初始化异常---!", + message: "场景初始化异常!", type: "warning", }); } @@ -134,7 +156,7 @@ function loadModel(path) { (obj) => { resolve(obj); }, - (xhr) => { }, + (xhr) => {}, (err) => { reject(err); } @@ -247,14 +269,13 @@ function handleConfirmAddEqu() { type: "success", }); }) - .catch( - (res) => { - console.log(res); - ElMessage({ - message: "删除失败!", - type: "warning", - }); + .catch((res) => { + console.log(res); + ElMessage({ + message: "删除失败!", + type: "warning", }); + }); } // 处理取消关闭编辑框事件 function handleCancel() { @@ -291,6 +312,11 @@ const ThreeConfig = { }, msg: "dda", }; + +//=================实时更新数据 +watch(devRealtimeData, () => { + console.log("devRealtimeData:", devRealtimeData); +}); @@ -680,12 +834,12 @@ const initWebSocket = () => { cursor: pointer; padding: 10px 20px; border-radius: 11px; - border: 2px solid #08B7B8; - color: #0BE9FA; + border: 2px solid #08b7b8; + color: #0be9fa; text-align: center; margin-left: 40px; font-size: 38px; - &:hover{ + &:hover { color: #f7b500; } } @@ -708,7 +862,6 @@ const initWebSocket = () => { :deep(.el-table__body-wrapper) { height: 90px; - } :deep(.el-table--fit) { @@ -734,17 +887,16 @@ const initWebSocket = () => { //display: none; .el-table__empty-text { font-size: 60px; - color: #08B7B8; + color: #08b7b8; } } - .query-form { :deep(.el-form-item__label) { font-size: 45px; height: 70px; line-height: 70px; - color: #FFFFFF; + color: #ffffff; } :deep(.el-select__wrapper.is-hovering) { @@ -756,14 +908,14 @@ const initWebSocket = () => { } :deep(.el-select-dropdown__item.is-hovering) { - background-color: #064B66 !important; + background-color: #064b66 !important; } :deep(.el-select__wrapper) { height: 70px; line-height: 70px; background-color: transparent; - border: 1px solid #08B7B8; + border: 1px solid #08b7b8; font-size: 35px; width: 356px; @@ -774,7 +926,7 @@ const initWebSocket = () => { } .el-select__placeholder { - color: #FFFFFF; + color: #ffffff; height: 70px; line-height: 70px; } @@ -789,21 +941,21 @@ const initWebSocket = () => { .el-select__popper { margin-top: -12px !important; background: #072247 !important; - border: 1px solid #0F82AF !important; + border: 1px solid #0f82af !important; .el-select-dropdown__item { font-size: 38px !important; height: 70px !important; line-height: 70px !important; - >span { - color: #FFFFFF; + > span { + color: #ffffff; } } .el-select-dropdown__item.hover, .el-select-dropdown__item:hover { - background-color: #064B66 !important; + background-color: #064b66 !important; } } @@ -814,7 +966,7 @@ const initWebSocket = () => { } .el-button--primary { - background: #064B66; + background: #064b66; } .el-input { @@ -824,12 +976,12 @@ const initWebSocket = () => { .el-input__wrapper { font-size: 40px; background-color: transparent; - border: 1px solid #08B7B8; + border: 1px solid #08b7b8; box-shadow: none; .el-input__inner { height: 70px; - color: #FFFFFF; + color: #ffffff; } .el-input__suffix-inner { @@ -850,7 +1002,7 @@ const initWebSocket = () => { } .active { - color: #FFFFFF; + color: #ffffff; background: #0f7da9; } @@ -864,13 +1016,13 @@ const initWebSocket = () => { width: 200px; height: 50px; border-radius: 6px; - border: 1px solid #05FEFF; + border: 1px solid #05feff; overflow: hidden; - color: #51A2B3; + color: #51a2b3; line-height: 40px; font-size: 36px; - &>div { + & > div { flex: 1; text-align: center; cursor: pointer; @@ -890,19 +1042,26 @@ const initWebSocket = () => { } :deep(.el-table tr) { - background-color: #1C5971; + background-color: #1c5971; } - :deep(.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell) { - background-color: #1C5971; + :deep( + .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell + ) { + background-color: #1c5971; } :deep(.el-table__row--striped) { - background-color: #13849C !important; + background-color: #13849c !important; } - :deep(.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell) { - background-color: #13849C !important; + :deep( + .el-table--striped + .el-table__body + tr.el-table__row--striped + td.el-table__cell + ) { + background-color: #13849c !important; } :deep(.el-table__cell) { @@ -913,11 +1072,11 @@ const initWebSocket = () => { .el-input__wrapper { border-radius: 6px; - border: 1px solid #05FEFF; + border: 1px solid #05feff; background-color: transparent; .el-input__inner { - color: #FFFFFF; + color: #ffffff; font-size: 40px; height: auto; line-height: normal; @@ -937,12 +1096,11 @@ const initWebSocket = () => { left: 50%; transform: translate(-50%, -50%); bottom: 0; - color: #60DDDE; + color: #60ddde; font-size: 38px; font-weight: bold; :deep(.el-pagination.is-background) { - .btn-next, .btn-prev { background-color: transparent; @@ -954,16 +1112,16 @@ const initWebSocket = () => { } li.is-active { - background-color: #60DDDE; + background-color: #60ddde; } } } - >span:first-child { + > span:first-child { margin-right: 60px; } - >span:last-child { + > span:last-child { margin-left: 71px; } @@ -971,25 +1129,24 @@ const initWebSocket = () => { background-color: transparent; font-size: 38px; font-weight: bold; - color: #60DDDE; + color: #60ddde; margin-right: 20px; - } :deep(.btn-next) { background-color: transparent; font-size: 38px; font-weight: bold; - color: #60DDDE; + color: #60ddde; margin-left: 30px; } :deep(.el-pager li.is-active) { width: 70px; height: 70px; - background: #60DDDE; + background: #60ddde; border-radius: 50%; - color: #071F40; + color: #071f40; font-size: 38px; font-weight: bold; } @@ -1001,12 +1158,12 @@ const initWebSocket = () => { :deep(.el-pager li:not(.is-active)) { width: 70px; height: 70px; - border: 1px solid #60DDDE; + border: 1px solid #60ddde; border-radius: 50%; background-color: transparent; font-size: 38px; font-weight: bold; - color: #60DDDE; + color: #60ddde; } } diff --git a/src/views/tunnel/index.vue b/src/views/tunnel/index.vue index 067aaa3..86a25be 100644 --- a/src/views/tunnel/index.vue +++ b/src/views/tunnel/index.vue @@ -1,7 +1,12 @@