防火巡检画面字段及接口对接

main
zhufu 2026-01-14 11:04:19 +08:00
parent 6aa7404792
commit 23aab9f636
5 changed files with 84 additions and 42 deletions

View File

@ -19,6 +19,7 @@ enum Api {
GetClockOnList = '/api/FireGrid/GetClockOnList', GetClockOnList = '/api/FireGrid/GetClockOnList',
GetStatisticsCount = '/api/FireGrid/GetStatisticsCount', GetStatisticsCount = '/api/FireGrid/GetStatisticsCount',
GetStatistics = '/api/FireGrid/GetStatistics', GetStatistics = '/api/FireGrid/GetStatistics',
GetPatrolPointByTime = '/api/FirePatrol/GetPatrolPointByTime',
} }
/** /**
@ -96,3 +97,9 @@ export function getStatisticsCount(params: GetStatisticsCountParams) {
export function getStatistics(params: GetStatisticsParams) { export function getStatistics(params: GetStatisticsParams) {
return defHttp.get({ url: Api.GetStatistics, params }); return defHttp.get({ url: Api.GetStatistics, params });
} }
/**
* @description:
*/
export function GetPatrolPointByTime(params) {
return defHttp.get({ url: Api.GetPatrolPointByTime, params });
}

View File

@ -28,15 +28,15 @@
<img src="@/assets/images/meshing/clockIn-bg.png" /> <img src="@/assets/images/meshing/clockIn-bg.png" />
</div> </div>
<div class="clock-item-info"> <div class="clock-item-info">
<p>打卡点名称{{ item.PointName }}</p> <p>打卡点名称{{ item.pointname }}</p>
<p>创建时间{{ item.CreateTime }}</p> <p>创建时间{{ item.createtime }}</p>
<p>负责人员{{ item.CreateUserName }}</p> <p>负责人员{{ item.usernames }}</p>
<p style="text-align: right"> <p style="text-align: right">
<a-popconfirm <a-popconfirm
title="确定删除吗?" title="确定删除吗?"
ok-text="是" ok-text="是"
cancel-text="否" cancel-text="否"
@confirm="deleteTask(item.Id)" @confirm="deleteTask(item.id)"
> >
<a-button type="primary" danger size="mini">删除</a-button> <a-button type="primary" danger size="mini">删除</a-button>
</a-popconfirm> </a-popconfirm>
@ -52,6 +52,7 @@
</div> </div>
<div class="table-data-pagination m-4"> <div class="table-data-pagination m-4">
<a-pagination <a-pagination
size="small"
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
v-model:current="pageData.current" v-model:current="pageData.current"
@ -173,7 +174,7 @@
const editClockInfo = (row) => { const editClockInfo = (row) => {
openEidtModal(true, { openEidtModal(true, {
isUpdate: true, isUpdate: true,
id: row.Id, id: row.id,
}); });
}; };
// //
@ -187,7 +188,7 @@
// //
const lookClockInfo = (row) => { const lookClockInfo = (row) => {
emits('viewHandle', row); emits('viewHandle', row);
const lnglat = [row.Lng, row.Lat]; const lnglat = [row.lng, row.lat];
EventBus.emit('inspectionMap', lnglat); EventBus.emit('inspectionMap', lnglat);
}; };
// //
@ -245,7 +246,9 @@
position: relative; position: relative;
height: calc(100% - 68px); height: calc(100% - 68px);
.table-data-pagination { .table-data-pagination {
position: absolute; display: flex;
justify-content: end;
position: relative;
bottom: 0px; bottom: 0px;
background-color: @component-background; background-color: @component-background;
} }

View File

@ -15,7 +15,7 @@
<BankOutlined /> <BankOutlined />
打卡点名称 打卡点名称
</template> </template>
{{ itemData.PointName }} {{ itemData.pointname }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item> <a-descriptions-item>
@ -23,14 +23,14 @@
<HistoryOutlined /> <HistoryOutlined />
创建时间 创建时间
</template> </template>
{{ itemData.CreateTime }} {{ itemData.createtime }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item> <a-descriptions-item>
<template v-slot:label> <template v-slot:label>
<EnvironmentOutlined /> <EnvironmentOutlined />
打卡点位置 打卡点位置
</template> </template>
{{ itemData.Lng }},{{ itemData.Lat }}&nbsp;&nbsp; {{ itemData.lng }},{{ itemData.lat }}&nbsp;&nbsp;
<!-- <el-button type="primary" size="mini" round icon="el-icon-location-outline" @click="lookClockInfo(currentClockInfo)"></el-button> --> <!-- <el-button type="primary" size="mini" round icon="el-icon-location-outline" @click="lookClockInfo(currentClockInfo)"></el-button> -->
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
@ -83,14 +83,14 @@
style="float: right; position: relative; top: 8px" style="float: right; position: relative; top: 8px"
>轨迹</a-button >轨迹</a-button
> >
<a-button <!-- <a-button
type="primary" type="primary"
size="mini" size="mini"
round round
@click="getRange(it.phone)" @click="getRange(it.phone)"
style="float: right; position: relative; top: 8px; left: -12px" style="float: right; position: relative; top: 8px; left: -12px"
>范围</a-button >范围</a-button
> > -->
</div> </div>
{{ it.startTime }} {{ it.startTime }}
&nbsp;&nbsp; <SwapRightOutlined style="font-size: 20px" /> &nbsp;&nbsp; <SwapRightOutlined style="font-size: 20px" />
@ -135,18 +135,20 @@
BankOutlined, BankOutlined,
ArrowLeftOutlined, ArrowLeftOutlined,
} from '@ant-design/icons-vue'; } from '@ant-design/icons-vue';
import { getCheckInfoByPointId } from '@/api/firegrid/index'; import { getCheckInfoByPointId, GetPatrolPointByTime } from '@/api/firegrid/index';
import { getPatrolInfoByUserId } from '@/api/firegrid/patrol'; import { getPatrolInfoByUserId } from '@/api/firegrid/patrol';
import { EventBus } from '@/utils/eventBus'; import { EventBus } from '@/utils/eventBus';
import moment from 'moment'; import dayjs from 'dayjs'
import * as mars3d from 'mars3d';
import { message } from 'ant-design-vue';
const props = defineProps({ const props = defineProps(['itemData','map']);
itemData: Object,
});
const emits = defineEmits(['delView']); const emits = defineEmits(['delView']);
const tabActive = ref(1); const tabActive = ref(1);
const currentRouters = ref([]); const currentRouters = ref([]);
const clockInList = ref([]); const clockInList = ref([]);
const value1: any = ref([dayjs().subtract(1, 'month'), dayjs()]);
const polyLineArr = ref([])
// //
interface FormState { interface FormState {
begintime: string | null; begintime: string | null;
@ -163,7 +165,7 @@
}; };
// //
const getPointInfo = () => { const getPointInfo = () => {
getCheckInfoByPointId({ id: props.itemData.Id, page: 1, limit: 999999 }).then((res) => { getCheckInfoByPointId({ id: props.itemData.id, page: 1, limit: 999999 }).then((res) => {
clockInList.value = res.items; clockInList.value = res.items;
}); });
}; };
@ -171,37 +173,60 @@
const getPatrolInfo = () => { const getPatrolInfo = () => {
const params = { const params = {
...formState, ...formState,
id: props.itemData.Id, id: props.itemData.userid,
}; };
getPatrolInfoByUserId(params).then((res) => { getPatrolInfoByUserId(params).then((res) => {
currentRouters.value = res; currentRouters.value = res;
}); });
}; };
const value1: any = ref([]);
onMounted(() => { onMounted(() => {
formState.begintime = dayjs().subtract(1, 'month').format('YYYY-MM-DD HH:mm')
formState.endtime = dayjs().format('YYYY-MM-DD HH:mm')
getPointInfo(); getPointInfo();
getPatrolInfo(); getPatrolInfo();
let start = new Date();
let end = new Date();
const time = [
end.getFullYear() + '-' + (end.getMonth() + 1) + '-' + end.getDate() + ' 00:00:00',
start.getFullYear() +
'-' +
(start.getMonth() + 1) +
'-' +
start.getDate() +
' ' +
start.getHours() +
':' +
start.getMinutes() +
':' +
start.getSeconds(),
];
formState.begintime = time[0];
formState.endtime = time[1];
value1.value = [moment(time[0], 'YYYY-MM-DD HH:mm'), moment(time[1], 'YYYY-MM-DD HH:mm')];
}); });
const getTrajectoryData = (data) => {
if(polyLineArr.value.length > 0){
polyLineArr.value.forEach(item =>{
let graphic = props.map.graphicLayer.getGraphicById(item);
props.map.graphicLayer.removeGraphic(graphic);
})
polyLineArr.value = []
}
let params = {
...formState,
id: data.createId,
}
GetPatrolPointByTime(params).then(res => {
let rel = res
let positionsArr = []
if(rel.length > 0){
rel.forEach(item =>{
let arr = []
arr.push(item.lng,item.lat)
positionsArr.push(arr)
})
const graphic = new mars3d.graphic.PolylineEntity({
id: data.createId,
positions: positionsArr,
style: {
color: '#25F8EE',
depthFail: true,
opacity: 1,
},
attr: { remark: "轨迹" },
flyTo: true
})
props.map.graphicLayer.addGraphic(graphic)
polyLineArr.value.push(data.createId)
}else{
message.warning('暂无巡查轨迹');
}
})
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.item-container { .item-container {

View File

@ -18,6 +18,7 @@
import axios from 'axios'; import axios from 'axios';
const [editModal, { openModal: openEidtModal }] = useModal(); const [editModal, { openModal: openEidtModal }] = useModal();
const emits = defineEmits(['onLoad'])
let map: mars3d.Map; // let map: mars3d.Map; //
@ -270,6 +271,9 @@
// map.setOptions(newData); // map.setOptions(newData);
map.setSceneOptions(newData.scene); map.setSceneOptions(newData.scene);
} }
map.on(mars3d.EventType.load, function (event) {
emits('onLoad', map);
})
isFirstLoad.value = false; isFirstLoad.value = false;
// //
handlerInitEntityLayer(); handlerInitEntityLayer();

View File

@ -1,15 +1,15 @@
<template> <template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<LeftView class="w-1/2 xl:w-1/2" :itemData="viewData" v-if="viewData" @delView="delViewData" /> <LeftView class="w-1/2 xl:w-1/2" :map="map" :itemData="viewData" v-if="viewData" @delView="delViewData" />
<LeftTable class="w-1/2 xl:w-1/2" @viewHandle="viewHandle" v-else /> <LeftTable class="w-1/2 xl:w-1/2" @viewHandle="viewHandle" v-else />
<Map class="w-1/2 xl:w-1/2" /> <Map class="w-1/2 xl:w-1/2" @onLoad="onMapLoad"/>
</PageWrapper> </PageWrapper>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { LeftTable, Map, LeftView } from './index'; import { LeftTable, Map, LeftView } from './index';
const map = ref()
const viewData = ref(null); const viewData = ref(null);
const viewHandle = (data: any) => { const viewHandle = (data: any) => {
console.log(data); console.log(data);
@ -18,5 +18,8 @@
const delViewData = () => { const delViewData = () => {
viewData.value = null; viewData.value = null;
}; };
const onMapLoad = (value) => {
map.value = value
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>