From c6eec67e71f3a89bb2391bc7e59e379708dd8103 Mon Sep 17 00:00:00 2001 From: fangjiakai <450850793@qq.com> Date: Sat, 3 Feb 2024 10:17:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=A5=A8=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/request/map.js | 7 + src/views/BI/components/bottom_options.vue | 12 +- .../dialog/confinedspace_dialog.vue | 412 ++++++++++++++++++ .../BI/components/dialog/highwork_dialog.vue | 401 +++++++++++++++++ .../BI/components/dialog/hotwork_dialog.vue | 4 +- src/views/BI/components/work_safely.vue | 37 +- src/views/BI/js/eight_work.js | 70 ++- src/views/BI/js/map.js | 26 +- src/views/BI/js/trajectory.js | 52 ++- 9 files changed, 980 insertions(+), 41 deletions(-) create mode 100644 src/views/BI/components/dialog/confinedspace_dialog.vue create mode 100644 src/views/BI/components/dialog/highwork_dialog.vue diff --git a/src/request/map.js b/src/request/map.js index 81d5b34..92baed3 100644 --- a/src/request/map.js +++ b/src/request/map.js @@ -1,9 +1,16 @@ import { post } from "./axios"; export const getRealTimeList = (params) => post("/map/getRealTimeList", params); // 获取在线人员列表 +export const getFenceList = (params) => post("/map/getFenceList", params); // 获取围栏列表 + export const getUserByCardNo = (params) => post("/user/getUserByCardNo", params); export const getEightWorks = (params) => post("/map/getEightWorks", params); export const getHotworkList = (params) => post("/map/getHotworkList", params); + +export const getConfinedspaceWorkList = (params) => + post("/map/getConfinedspaceWorkList", params); + +export const getHighWorkList = (params) => post("/map/getHighWorkList", params); diff --git a/src/views/BI/components/bottom_options.vue b/src/views/BI/components/bottom_options.vue index 69a8190..81a89a4 100644 --- a/src/views/BI/components/bottom_options.vue +++ b/src/views/BI/components/bottom_options.vue @@ -37,8 +37,12 @@ import GraveDangerous from "@/views/BI/components/grave_dangerous.vue"; import VideoAIAnalysis from "@/views/BI/components/video_ai_analysis.vue"; import VideoAIAnalysisRight from "@/views/BI/components/video_ai_analysisRight.vue"; import { useVModels } from "@vueuse/core"; -import { handleTrajectory } from "@/views/BI/js/trajectory.js"; -import { handleHortwork } from "@/views/BI/js/eight_work.js"; +import { handleTrajectory,handleFence } from "@/views/BI/js/trajectory.js"; +import { + handleHortwork, + handleConfinedspaceWork, + handleHighWork +} from "@/views/BI/js/eight_work.js"; const props = defineProps({ leftCurrentComponent: { @@ -109,7 +113,7 @@ const bottomOptionsList = [ ).href, title: "电子围栏", type: "electronicFence", - check: false, + action: handleFence, }, ], }, @@ -144,6 +148,7 @@ const bottomOptionsList = [ title: "受限空间作业", type: "acceptance", check: false, + action: handleConfinedspaceWork, }, { img: new URL("/src/assets/images/map/bottom/ico6.png", import.meta.url) @@ -166,6 +171,7 @@ const bottomOptionsList = [ title: "高处作业", type: "workAtHeight", check: false, + action: handleHighWork, }, { img: new URL("/src/assets/images/map/bottom/ico8.png", import.meta.url) diff --git a/src/views/BI/components/dialog/confinedspace_dialog.vue b/src/views/BI/components/dialog/confinedspace_dialog.vue new file mode 100644 index 0000000..fabe2a3 --- /dev/null +++ b/src/views/BI/components/dialog/confinedspace_dialog.vue @@ -0,0 +1,412 @@ + + + + + diff --git a/src/views/BI/components/dialog/highwork_dialog.vue b/src/views/BI/components/dialog/highwork_dialog.vue new file mode 100644 index 0000000..1e72f25 --- /dev/null +++ b/src/views/BI/components/dialog/highwork_dialog.vue @@ -0,0 +1,401 @@ + + + + + diff --git a/src/views/BI/components/dialog/hotwork_dialog.vue b/src/views/BI/components/dialog/hotwork_dialog.vue index e9ac3c8..c5d8225 100644 --- a/src/views/BI/components/dialog/hotwork_dialog.vue +++ b/src/views/BI/components/dialog/hotwork_dialog.vue @@ -363,11 +363,9 @@ const props = defineProps({ default: () => ({}), }, }); - +const VITE_FILE_URL = import.meta.env.VITE_FILE_URL; const data = reactive({ info: {}, - imgList: [], - imgList1: [], measuresList: [], gasList: [], signs: [], diff --git a/src/views/BI/components/work_safely.vue b/src/views/BI/components/work_safely.vue index aef0c39..53b24d4 100644 --- a/src/views/BI/components/work_safely.vue +++ b/src/views/BI/components/work_safely.vue @@ -32,22 +32,24 @@
下一步操作人
-
{{ index + 1 }}
-
- {{ - formatWork(item) - }} -
-
- {{ - item.STEP_NAME - }} -
-
- {{ - item.NEXT_STEP_NAME - }} -
+
@@ -102,6 +104,9 @@ const formatWork = (work) => { case "CONFINEDSPACE": type = "受限空间作业"; break; + case "HIGHWORK": + type = "高处作业"; + break; } return type + "编号:" + work.CHECK_NO; }; diff --git a/src/views/BI/js/eight_work.js b/src/views/BI/js/eight_work.js index 5b19820..4467dee 100644 --- a/src/views/BI/js/eight_work.js +++ b/src/views/BI/js/eight_work.js @@ -1,7 +1,13 @@ -import { getHotworkList } from "@/request/map"; +import { + getHotworkList, + getConfinedspaceWorkList, + getHighWorkList, +} from "@/request/map"; import { addEntity } from "./map.js"; let hotworkList = []; +let confinedspaceList = []; +let highWorkList = []; export const handleHortwork = (b) => { if (b) { @@ -33,3 +39,65 @@ const showHotworkList = async () => { }); hotworkList.show(true); }; + +export const handleConfinedspaceWork = (b) => { + if (b) { + showConfinedspaceWorkList(); + } else { + if (confinedspaceList) { + confinedspaceList.children.forEach((e) => { + e.destroy(); + }); + } + } +}; + +const showConfinedspaceWorkList = async () => { + confinedspaceList = new window.CustomCesium.GroupModel("受限空间作业"); + + const { varList } = await getConfinedspaceWorkList(); + varList.forEach(({ CONFINEDSPACE_ID, CHECK_NO, WORK_POSITION }) => { + addEntity( + confinedspaceList, + CONFINEDSPACE_ID, + "受限空间作业", + CHECK_NO, + WORK_POSITION.split(",")[0], + WORK_POSITION.split(",")[1], + WORK_POSITION.split(",")[2], + "/src/assets/images/map/bottom/ico5_on.png" + ); + }); + confinedspaceList.show(true); +}; + +export const handleHighWork = (b) => { + if (b) { + showHighWorkList(); + } else { + if (highWorkList) { + highWorkList.children.forEach((e) => { + e.destroy(); + }); + } + } +}; + +const showHighWorkList = async () => { + highWorkList = new window.CustomCesium.GroupModel("高处作业"); + + const { varList } = await getHighWorkList(); + varList.forEach(({ HIGHWORK_ID, CHECK_NO, WORK_POSITION }) => { + addEntity( + highWorkList, + HIGHWORK_ID, + "高处作业", + CHECK_NO, + WORK_POSITION.split(",")[0], + WORK_POSITION.split(",")[1], + WORK_POSITION.split(",")[2], + "/src/assets/images/map/bottom/ico7_on.png" + ); + }); + highWorkList.show(true); +}; diff --git a/src/views/BI/js/map.js b/src/views/BI/js/map.js index 34daa9e..0217a6a 100644 --- a/src/views/BI/js/map.js +++ b/src/views/BI/js/map.js @@ -1,10 +1,16 @@ import { h, render, ref } from "vue"; import userDialog from "../components/dialog/user_dialog.vue"; import hotworkDialog from "../components/dialog/hotwork_dialog.vue"; +import confinedspaceDialog from "../components/dialog/confinedspace_dialog.vue"; +import highworkDialog from "../components/dialog/highwork_dialog.vue"; import { Loadglb } from "./loadglb.js"; import { getUserByCardNo } from "@/request/map"; -import { getHotWorkView } from "@/request/eight_work.js"; +import { + getConfinedSpaceView, + getHighWorkView, + getHotWorkView, +} from "@/request/eight_work.js"; // const mapUrl = // "https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s&x={x}&y={y}&z={z}"; const loadMap = 2; @@ -71,6 +77,12 @@ const handleMouseClick = () => { if (model._name.indexOf("动火作业") > -1) { clickHotwork(model); } + if (model._name.indexOf("受限空间作业") > -1) { + clickConfinedspaceWork(model); + } + if (model._name.indexOf("高处作业") > -1) { + clickHighwork(model); + } }); }; @@ -191,6 +203,18 @@ const clickHotwork = async (model) => { handleDialog(hotworkDialog, pd); }; +const clickConfinedspaceWork = async (model) => { + const id = model._id; + const pd = await getConfinedSpaceView({ CONFINEDSPACE_ID: id }); + handleDialog(confinedspaceDialog, pd); +}; + +const clickHighwork = async (model) => { + const id = model._id; + const pd = await getHighWorkView({ HIGHWORK_ID: id }); + handleDialog(highworkDialog, pd); +}; + const handleDialog = (component, pd) => { const visible = ref(false); // 创建一个新节点,用来容纳 modal diff --git a/src/views/BI/js/trajectory.js b/src/views/BI/js/trajectory.js index 8b9fb04..59d3186 100644 --- a/src/views/BI/js/trajectory.js +++ b/src/views/BI/js/trajectory.js @@ -30,6 +30,16 @@ const { open, close } = useWebSocket( addNewPerson(decodedMsg.data); } }, + onDisconnected: () => { + if (entityArr) { + entityArr.children.forEach((e) => { + e.destroy(); + }); + billboardArr.children.forEach((e) => { + e.destroy(); + }); + } + }, } ); export const handleTrajectory = (b) => { @@ -37,14 +47,6 @@ export const handleTrajectory = (b) => { getOnlineUser(); open(); } else { - if (entityArr) { - entityArr.children.forEach((e) => { - e.destroy(); - }); - billboardArr.children.forEach((e) => { - e.destroy(); - }); - } close(); } }; @@ -52,17 +54,29 @@ export const handleTrajectory = (b) => { const getOnlineUser = async () => { entityArr = new window.CustomCesium.GroupModel("人物模型"); billboardArr = new window.CustomCesium.GroupModel("人物姓名"); - - const { data } = await getRealTimeList(); - let userList = data.data; - userList = [ - { id: "8379", name: "大大", lng: 119.44768654, lat: 39.91745908 }, - { id: "9979", name: "小小小小", lng: 119.44758754, lat: 39.91745908 }, + await getRealTimeList(); + // const { data } = await getRealTimeList(); + // let userList = data.data; + const userList = [ + { + cardNo: "8379", + name: "大大", + longitude: 119.44768654, + latitude: 39.91745908, + altitude: 0, + }, + { + cardNo: "9979", + name: "小小小小", + longitude: 119.44758754, + latitude: 39.91745908, + altitude: 0, + }, ]; - userList.forEach(({ id, name, lng, lat }) => { - addEntity(id, name, lng, lat, 0); - addBillboard(id, name, lng, lat, 0 + 2); + userList.forEach(({ cardNo, name, longitude, latitude, altitude }) => { + addEntity(cardNo, name, longitude, latitude, altitude); + addBillboard(cardNo, name, longitude, latitude, altitude + 2); }); entityArr.show(true); billboardArr.show(true); @@ -202,3 +216,7 @@ function peoMovement(moveData) { } }); } + +export const handleFence = () => { + +};