BI地图页 动火作业标点

pull/1/head
fangjiakai 2024-02-01 15:05:31 +08:00
parent a643da6979
commit 7a55d48a18
7 changed files with 525 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,5 +4,4 @@ export const getTaskSetps = (params) =>
post("/app/eightwork/getTaskSetps", params); // 动火作业管理列表
export const getHotWorkList = (params) => post("/hotwork/list", params); // 动火作业管理列表
export const getHotWorkView = (params) => post("/hotwork/findById", params); // 动火作业管理查看
export const getHotWorkFlow = (params) => post("/hotwork/getFlowList", params); // 动火作业流程图

View File

@ -5,3 +5,5 @@ export const getUserByCardNo = (params) =>
post("/user/getUserByCardNo", params);
export const getEightWorks = (params) => post("/map/getEightWorks", params);
export const getHotworkList = (params) => post("/map/getHotworkList", params);

View File

@ -38,6 +38,7 @@ 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";
const props = defineProps({
leftCurrentComponent: {
@ -65,6 +66,7 @@ const { leftCurrentComponent, rightCurrentComponent, rightOption } = useVModels(
props,
emits
);
const bottomOptionsList = [
{
img: new URL("/src/assets/images/map/bico1.png", import.meta.url).href,
@ -130,6 +132,7 @@ const bottomOptionsList = [
title: "动火作业",
type: "hotWork",
check: false,
action: handleHortwork,
},
{
img: new URL("/src/assets/images/map/bottom/ico5.png", import.meta.url)

View File

@ -0,0 +1,422 @@
<template>
<el-dialog v-model="visible" title="作业票信息">
<table>
<thead>
<tr>
<td colspan="10" style="border: none">
<el-divider content-position="left"> 动火安全作业票 </el-divider>
<div class="tr">编号:{{ data.info.CHECK_NO }}</div>
</td>
</tr>
</thead>
<tr>
<td class="title">作业申请单位</td>
<td>{{ data.info.APPLY_DEPARTMENT_NAME }}</td>
<td class="title">作业申请时间</td>
<td>{{ data.info.CREATTIME }}</td>
</tr>
<tr>
<td class="title">作业内容</td>
<td>{{ data.info.WORK_CONTENT }}</td>
<td class="title">动火地点及动火部位</td>
<td>{{ data.info.WORK_PLACE }}</td>
</tr>
<tr>
<td class="title">动火作业级别</td>
<td>{{ data.info.WORK_LEVEL }}</td>
<td class="title">动火方式</td>
<td>{{ data.info.WORK_FUNCTION }}</td>
</tr>
<tr>
<td class="title">动火人及证书编号</td>
<td colspan="3">{{ data.info.WORK_USER }}</td>
</tr>
<tr>
<td class="title">作业单位</td>
<td>{{ data.info.CONFIRM_DEPARTMENT_NAME }}</td>
<td class="title">作业负责人</td>
<td>{{ data.info.CONFIRM_USER_NAME }}</td>
</tr>
<template v-for="(item, index) in data.gasList" :key="index">
<tr>
<td class="title">气体取样分析时间</td>
<td>{{ item.ANALYZE_TIME }}</td>
<td class="title">代表性气体</td>
<td>{{ item.ANALYZE_PLACE }}</td>
</tr>
<tr>
<td class="title">分析结果/%</td>
<td>{{ item.ANALYZE_RESULT }}</td>
<td class="title">分析人</td>
<td>{{ item.ANALYZE_USER }}</td>
</tr>
</template>
<tr>
<td class="title">关联的其他特殊作业及安全作业票编号</td>
<td colspan="3">{{ data.info.SPECIAL_WORK }}</td>
</tr>
<tr>
<td class="title">风险辨识结果</td>
<td colspan="3">{{ data.info.RISK_IDENTIFICATION }}</td>
</tr>
<tr>
<td class="title">动火作业实施时间</td>
<td colspan="3">
{{ data.info.WORK_START_DATE }}{{ data.info.WORK_END_DATE }}
</td>
</tr>
<tr>
<td colspan="4">
<table class="table-ui">
<tr>
<td style="width: 80px">序号</td>
<td>安全措施</td>
<td style="width: 100px">是否涉及</td>
<td style="width: 100px">确认人</td>
</tr>
<tr v-for="(item, index) in data.measuresList" :key="index">
<td>{{ index + 1 }}</td>
<td>
{{ item.PROTECTIVE_MEASURES }}
<div v-if="item.IMG_PATH">
<template v-for="img in item.IMG_PATH.split(',')" :key="img">
<img
v-viewer
:src="VITE_FILE_URL + img"
alt=""
width="100"
height="100"
/>
</template>
</div>
</td>
<td>
<span v-if="item.STATUS === '1'"> &nbsp;&nbsp;&nbsp; </span>
<span v-if="item.STATUS === '-1'"> </span>
</td>
<td>
<img
v-if="item.SIGN_PATH"
v-viewer
:src="VITE_FILE_URL + item.SIGN_PATH"
alt=""
width="100"
height="100"
/>
</td>
</tr>
<template v-if="data.signs.MEASURES_CONFIRM">
<tr
v-for="(item, index) in data.signs.MEASURES_CONFIRM"
:key="item.BUS_HOTWORK_MEASURES_ID"
>
<td>{{ data.measuresList.length + 1 + index }}</td>
<td colspan="2">
<div style="display: flex; justify-content: space-between">
<span> 其他安全措施 {{ item.DESCR }} </span>
</div>
</td>
<td>
<img
v-if="item.SIGN_PATH[0]"
v-viewer
:src="VITE_FILE_URL + item.SIGN_PATH[0]"
alt=""
width="100"
height="100"
/>
</td>
</tr>
</template>
</table>
</td>
</tr>
<tr v-if="data.signs.GUARDIAN">
<td colspan="10">
<div>监护人{{ data.signs.GUARDIAN[0].DESCR }}</div>
<div
v-for="(item, index) in data.signs.GUARDIAN[0].SIGN_TIME"
:key="index"
class="tr"
>
<span>签字</span>
<img
v-viewer
:src="VITE_FILE_URL + data.signs.GUARDIAN[0].SIGN_PATH[index]"
alt=""
width="100"
height="100"
/>
<span>{{ data.signs.GUARDIAN[0].SIGN_TIME[index] }}</span>
</div>
</td>
</tr>
<tr v-if="data.signs.CONFESS">
<td colspan="10">
<div>
安全交底人{{ data.signs.CONFESS[0].DESCR }}
<div v-if="data.signs.CONFESS[0].IMG_PATH">
<template
v-for="img in data.signs.CONFESS[0].IMG_PATH.split(',')"
:key="img"
>
<img
v-viewer
:src="VITE_FILE_URL + img"
alt=""
width="100"
height="100"
/>
</template>
</div>
</div>
<div
v-for="(item, index) in data.signs.CONFESS[0].SIGN_TIME"
:key="index"
class="tr"
>
<span>签字</span>
<img
v-viewer
:src="VITE_FILE_URL + data.signs.CONFESS[0].SIGN_PATH[index]"
alt=""
width="100"
height="100"
/>
<span>{{ data.signs.CONFESS[0].SIGN_TIME[index] }}</span>
</div>
</td>
</tr>
<tr v-if="data.signs.ACCEPT_CONFESS">
<td colspan="10">
<div>接受交底人{{ data.signs.ACCEPT_CONFESS[0].DESCR }}</div>
<div
v-for="(item, index) in data.signs.ACCEPT_CONFESS[0].SIGN_TIME"
:key="index"
class="tr"
>
<span>签字</span>
<img
v-viewer
:src="
VITE_FILE_URL + data.signs.ACCEPT_CONFESS[0].SIGN_PATH[index]
"
alt=""
width="100"
height="100"
/>
<span>{{ data.signs.ACCEPT_CONFESS[0].SIGN_TIME[index] }}</span>
</div>
</td>
</tr>
<tr v-if="data.signs.CONFIRM">
<td colspan="10">
<div>作业负责人意见{{ data.signs.CONFIRM[0].DESCR }}</div>
<div
v-for="(item, index) in data.signs.CONFIRM[0].SIGN_TIME"
:key="index"
class="tr"
>
<span>签字</span>
<img
v-viewer
:src="VITE_FILE_URL + data.signs.CONFIRM[0].SIGN_PATH[index]"
alt=""
width="100"
height="100"
/>
<span>{{ data.signs.CONFIRM[0].SIGN_TIME[index] }}</span>
</div>
</td>
</tr>
<tr v-if="data.signs.LEADER">
<td colspan="10">
<div>所在单位意见{{ data.signs.LEADER[0].DESCR }}</div>
<div
v-for="(item, index) in data.signs.LEADER[0].SIGN_TIME"
:key="index"
class="tr"
>
<span>签字</span>
<img
v-viewer
:src="VITE_FILE_URL + data.signs.LEADER[0].SIGN_PATH[index]"
alt=""
width="100"
height="100"
/>
<span>{{ data.signs.LEADER[0].SIGN_TIME[index] }}</span>
</div>
</td>
</tr>
<tr v-if="data.signs.AUDIT">
<td colspan="10">
<div>安全管理部门意见{{ data.signs.AUDIT[0].DESCR }}</div>
<div
v-for="(item, index) in data.signs.AUDIT[0].SIGN_TIME"
:key="index"
class="tr"
>
<span>签字</span>
<img
v-viewer
:src="VITE_FILE_URL + data.signs.AUDIT[0].SIGN_PATH[index]"
alt=""
width="100"
height="100"
/>
<span>{{ data.signs.AUDIT[0].SIGN_TIME[index] }}</span>
</div>
</td>
</tr>
<tr v-if="data.signs.APPROVE">
<td colspan="10">
<div>动火审批人意见{{ data.signs.APPROVE[0].DESCR }}</div>
<div
v-for="(item, index) in data.signs.APPROVE[0].SIGN_TIME"
:key="index"
class="tr"
>
<span>签字</span>
<img
v-viewer
:src="VITE_FILE_URL + data.signs.APPROVE[0].SIGN_PATH[index]"
alt=""
width="100"
height="100"
/>
<span>{{ data.signs.APPROVE[0].SIGN_TIME[index] }}</span>
</div>
</td>
</tr>
<tr v-if="data.signs.MONITOR">
<td colspan="10">
<div>动火前在岗班长意见{{ data.signs.MONITOR[0].DESCR }}</div>
<div
v-for="(item, index) in data.signs.MONITOR[0].SIGN_TIME"
:key="index"
class="tr"
>
<span>签字</span>
<img
v-viewer
:src="VITE_FILE_URL + data.signs.MONITOR[0].SIGN_PATH[index]"
alt=""
width="100"
height="100"
/>
<span>{{ data.signs.MONITOR[0].SIGN_TIME[index] }}</span>
</div>
</td>
</tr>
<tr v-if="data.signs.ACCEPT">
<td colspan="10">
<div>完工验收{{ data.signs.ACCEPT[0].DESCR }}</div>
<div
v-for="(item, index) in data.signs.ACCEPT[0].SIGN_TIME"
:key="index"
class="tr"
>
<span>签字</span>
<img
v-viewer
:src="VITE_FILE_URL + data.signs.ACCEPT[0].SIGN_PATH[index]"
alt=""
width="100"
height="100"
/>
<span>{{ data.signs.ACCEPT[0].SIGN_TIME[index] }}</span>
</div>
</td>
</tr>
</table>
<template #footer>
<el-button @click="fnClose"></el-button>
</template>
</el-dialog>
</template>
<script setup>
import { useVModels } from "@vueuse/core";
import { reactive, onMounted } from "vue";
import { findCharIndex } from "@/assets/js/utils.js";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
pd: {
type: Object,
required: true,
default: () => ({}),
},
});
const data = reactive({
info: {},
imgList: [],
imgList1: [],
measuresList: [],
gasList: [],
signs: [],
});
onMounted(() => {
data.info = props.pd.pd;
const measuresList = props.pd.measuresList;
for (let i = 0; i < measuresList.length; i++) {
const PROTECTIVE_MEASURES = measuresList[i].PROTECTIVE_MEASURES.split("");
for (let j = 1; j <= 3; j++) {
if (findCharIndex(PROTECTIVE_MEASURES, "", j) !== -1) {
PROTECTIVE_MEASURES.splice(
findCharIndex(PROTECTIVE_MEASURES, "", j) + 1,
0,
measuresList[i]["ANSWER" + j]
);
}
}
measuresList[i].PROTECTIVE_MEASURES = PROTECTIVE_MEASURES.join("");
}
data.measuresList = measuresList;
data.gasList = props.pd.gasList;
data.signs = props.pd.signs;
});
const emits = defineEmits(["update:visible"]);
const { visible } = useVModels(props, emits);
const fnClose = () => {
visible.value = false;
};
</script>
<style lang="scss" scoped>
table {
border-collapse: collapse;
width: 100%;
td,
th {
border: 1px solid var(--el-border-color);
padding: 8px 12px;
font-size: 14px;
}
.title {
background: var(--el-fill-color-light);
width: 200px;
text-align: center;
}
}
</style>

View File

@ -0,0 +1,35 @@
import { getHotworkList } from "@/request/map";
import { addEntity } from "./map.js";
let hotworkList = [];
export const handleHortwork = (b) => {
if (b) {
showHotworkList();
} else {
if (hotworkList) {
hotworkList.children.forEach((e) => {
e.destroy();
});
}
}
};
const showHotworkList = async () => {
hotworkList = new window.CustomCesium.GroupModel("动火作业");
const { varList } = await getHotworkList();
varList.forEach(({ HOTWORK_ID, CHECK_NO, WORK_POSITION }) => {
addEntity(
hotworkList,
HOTWORK_ID,
"动火作业",
CHECK_NO,
WORK_POSITION.split(",")[0],
WORK_POSITION.split(",")[1],
WORK_POSITION.split(",")[2],
"/src/assets/images/map/bottom/ico4_on.png"
);
});
hotworkList.show(true);
};

View File

@ -1,8 +1,10 @@
import { h, render, ref } from "vue";
import userDialog from "../components/dialog/user_dialog.vue";
import hotworkDialog from "../components/dialog/hotwork_dialog.vue";
import { Loadglb } from "./loadglb.js";
import { getUserByCardNo } from "@/request/map";
import { 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;
@ -59,12 +61,16 @@ const handleMouseClick = () => {
const $mouse = new window.CustomCesium.Mouse(window.$icy);
// 隐藏逻辑
$mouse.mouseLeft((model) => {
console.log(model);
if (model._name === "建筑") {
clickBuilding(model);
}
if (model._name.indexOf("人物") > -1) {
clickPerson(model);
}
if (model._name.indexOf("动火作业") > -1) {
clickHotwork(model);
}
});
};
@ -179,6 +185,12 @@ const clickPerson = async (model) => {
handleDialog(userDialog, pd);
};
const clickHotwork = async (model) => {
const id = model._id;
const pd = await getHotWorkView({ HOTWORK_ID: id });
handleDialog(hotworkDialog, pd);
};
const handleDialog = (component, pd) => {
const visible = ref(false);
// 创建一个新节点,用来容纳 modal
@ -210,3 +222,53 @@ export const reduction = () => {
$entityTransparent = [];
}
};
export const addEntity = (
collection,
id,
name,
label,
lon,
lat,
height,
img
) => {
const labelPixelOffset = new window.Cesium.Cartesian2(0, -55);
const obj = {};
obj.entity = window.$icy.viewer.entities.add(
new window.Cesium.Entity({
id,
name,
position: window.Cesium.Cartesian3.fromDegrees(lon, lat, height),
billboard: {
image: img,
height: 36,
width: 30,
verticalOrigin: window.Cesium.VerticalOrigin.BOTTOM,
horizontalOrigin: window.Cesium.HorizontalOrigin.CENTER,
heightReference: window.Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance: Number.POSITIVE_INFINITY,
},
label: {
text: label,
font: "13px sans-serif",
pixelOffset: labelPixelOffset,
showBackground: true,
// 地图上扎点的名字背景色
// eslint-disable-next-line new-cap
backgroundColor: new window.Cesium.Color.fromCssColorString(
"rgba(20, 58, 142, 1)"
),
backgroundPadding: new window.Cesium.Cartesian2(7, 5),
disableDepthTestDistance: Number.POSITIVE_INFINITY,
},
})
);
obj.show = (e) => {
obj.entity.show = e;
};
obj.destroy = () => {
window.$icy.viewer.entities.remove(obj.entity);
};
collection.add(obj);
};