From ce76d5afa51b627c0fc829daf4650b7952085f4c Mon Sep 17 00:00:00 2001 From: zhufu <17863654727@163.com> Date: Wed, 14 Jan 2026 16:35:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E8=AE=B0=E5=BD=95=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=B7=A1=E6=9F=A5=E7=BB=9F=E8=AE=A1=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E9=98=B2=E7=81=AB=E5=B7=A1=E6=A3=80=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E6=8E=A5=E5=8F=A3=E5=B9=B6=E6=98=BE=E7=A4=BA=E6=89=93?= =?UTF-8?q?=E5=8D=A1=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/firegrid/index.ts | 2 +- .../demo/meshing/inspection/EditModal.vue | 30 +- .../demo/meshing/inspection/LeftTable.vue | 3 +- src/views/demo/meshing/inspection/Map.vue | 23 +- .../inspectionrecord/InspectionRecordMap.vue | 520 +++++++++++++++ .../demo/meshing/inspectionrecord/data.ts | 83 +++ .../demo/meshing/inspectionrecord/index.ts | 1 + .../demo/meshing/inspectionrecord/index.vue | 239 +++++++ .../demo/meshing/patrolstatistics/Map.vue | 609 ++++++++++++++++++ .../patrolstatistics/PatrolTrackModel.vue | 220 +++++++ .../demo/meshing/patrolstatistics/data.ts | 83 +++ .../demo/meshing/patrolstatistics/index.ts | 3 + .../demo/meshing/patrolstatistics/index.vue | 244 +++++++ 13 files changed, 2049 insertions(+), 11 deletions(-) create mode 100644 src/views/demo/meshing/inspectionrecord/InspectionRecordMap.vue create mode 100644 src/views/demo/meshing/inspectionrecord/data.ts create mode 100644 src/views/demo/meshing/inspectionrecord/index.ts create mode 100644 src/views/demo/meshing/inspectionrecord/index.vue create mode 100644 src/views/demo/meshing/patrolstatistics/Map.vue create mode 100644 src/views/demo/meshing/patrolstatistics/PatrolTrackModel.vue create mode 100644 src/views/demo/meshing/patrolstatistics/data.ts create mode 100644 src/views/demo/meshing/patrolstatistics/index.ts create mode 100644 src/views/demo/meshing/patrolstatistics/index.vue diff --git a/src/api/firegrid/index.ts b/src/api/firegrid/index.ts index c2ed3bb..df2d2cb 100644 --- a/src/api/firegrid/index.ts +++ b/src/api/firegrid/index.ts @@ -44,7 +44,7 @@ export function getCheckPointList(params: GetCheckPointListParams) { */ export function deleteCheckPoint(params: DeleteCheckPointParams) { return defHttp.post({ - url: Api.DeleteCheckPoint, + url: `${Api.DeleteCheckPoint}?id=${params.id}`, params, }); } diff --git a/src/views/demo/meshing/inspection/EditModal.vue b/src/views/demo/meshing/inspection/EditModal.vue index 75a6251..957c068 100644 --- a/src/views/demo/meshing/inspection/EditModal.vue +++ b/src/views/demo/meshing/inspection/EditModal.vue @@ -14,15 +14,14 @@ /> @@ -33,7 +32,7 @@ import { BasicModal, useModalInner } from '@/components/Modal'; import { BasicForm, useForm } from '@/components/Form'; import { formSchema } from './data'; - import { getDeptList } from '@/api/demo/system'; + import { getDeptList, getAccountList } from '@/api/demo/system'; import { useMessage } from '@/hooks/web/useMessage'; import { addCheckPoint, editCheckPoint, getSingleCheckPoint } from '@/api/firegrid/index'; import { EventBus } from '@/utils/eventBus'; @@ -45,6 +44,7 @@ const isUpdate = ref(true); const treeData: any = ref([]); + const userData: any = ref([]) onMounted(() => { getTreeList(); }); @@ -74,12 +74,22 @@ setFieldsValue({ ...res, }); + position.lat = res.lat; + position.lng = res.lng; }); }; const getTreeList = async () => { getDeptList().then((res) => { treeData.value = res; }); + getAccountList({page:1,limit:9999}).then(res => { + userData.value = res.items.map(item => { + return { + label: item.name, + value: item.id + } + }) + }) }; const getTitle = computed(() => (!unref(isUpdate) ? '新增打卡点' : '编辑打卡点')); @@ -87,10 +97,13 @@ try { const values = await validate(); let query: any = values; + if(!(query.userId instanceof Array)){ + query.userId = [query.userId] + } + query.lat = position.lat; + query.lng = position.lng; // 调用接口 if (!unref(isUpdate)) { - query.lat = position.lat; - query.lng = position.lng; const data = await addCheckPoint(query); if (data) { setModalProps({ confirmLoading: true }); @@ -115,4 +128,7 @@ setModalProps({ confirmLoading: false }); } } + const filterOption = (input: string, option: any) => { + return option.label.indexOf(input) >= 0; + } diff --git a/src/views/demo/meshing/inspection/LeftTable.vue b/src/views/demo/meshing/inspection/LeftTable.vue index 23e23a4..ec8f5cf 100644 --- a/src/views/demo/meshing/inspection/LeftTable.vue +++ b/src/views/demo/meshing/inspection/LeftTable.vue @@ -188,8 +188,7 @@ // 查看 const lookClockInfo = (row) => { emits('viewHandle', row); - const lnglat = [row.lng, row.lat]; - EventBus.emit('inspectionMap', lnglat); + EventBus.emit('inspectionMap', row); }; // 巡检 const toInspection = () => { diff --git a/src/views/demo/meshing/inspection/Map.vue b/src/views/demo/meshing/inspection/Map.vue index 89163dc..232b634 100644 --- a/src/views/demo/meshing/inspection/Map.vue +++ b/src/views/demo/meshing/inspection/Map.vue @@ -33,6 +33,11 @@ default: '', }, }); + const dakaPointLayer = new mars3d.layer.GraphicLayer({ + name: 'dakaPointLayer', + hasEdit: false, + isAutoEditing: false, + }); onMounted(() => { let options = { scene: { @@ -245,10 +250,25 @@ initMap(options); // 定位到某个经纬度 EventBus.on('inspectionMap', (data: any) => { - map.flyToPoint(data, { + const lnglat = [data.lng, data.lat]; + map.flyToPoint(lnglat, { radius: 5000, // 距离目标点的距离 duration: 4, }); + dakaPointLayer.clear() + const coordinates = [data.lng, data.lat]; + const pointGraphic = new mars3d.graphic.BillboardEntity({ + position: coordinates, + style: { + pixelSize: 100, + scale: 0.5, + image: '/dakadian.png', + clampToGround: true, + verticalOrigin: mars3d.Cesium.VerticalOrigin.BOTTOM, + horizontalOrigin: mars3d.Cesium.HorizontalOrigin.CENTER, + }, + }); + dakaPointLayer.addGraphic(pointGraphic); }); getPointInfo({ page: 1, @@ -273,6 +293,7 @@ } map.on(mars3d.EventType.load, function (event) { emits('onLoad', map); + map.addLayer(dakaPointLayer); }) isFirstLoad.value = false; // 初始化矢量图层 diff --git a/src/views/demo/meshing/inspectionrecord/InspectionRecordMap.vue b/src/views/demo/meshing/inspectionrecord/InspectionRecordMap.vue new file mode 100644 index 0000000..0264715 --- /dev/null +++ b/src/views/demo/meshing/inspectionrecord/InspectionRecordMap.vue @@ -0,0 +1,520 @@ + + + + diff --git a/src/views/demo/meshing/inspectionrecord/data.ts b/src/views/demo/meshing/inspectionrecord/data.ts new file mode 100644 index 0000000..6e42041 --- /dev/null +++ b/src/views/demo/meshing/inspectionrecord/data.ts @@ -0,0 +1,83 @@ +import { BasicColumn, FormSchema } from '@/components/Table'; +import { Tag } from 'ant-design-vue'; +import { h } from 'vue'; + +export const columns: BasicColumn[] = [ + { + title: '所属班组', + dataIndex: 'areaName', + width: 200, + }, + { + title: '护林员', + dataIndex: 'name', + }, + { + title: '手机号码', + dataIndex: 'account', + }, + { + title: '打卡次数', + dataIndex: 'dakacishu', + }, + { + title: '巡检次数', + dataIndex: 'xunjian', + }, + { + title: '打卡点数量', + dataIndex: 'dakadian', + }, +]; + +export const InspectionColumns: BasicColumn[] = [ + { + title: '乡镇/村庄', + dataIndex: 'townName', + }, + { + title: '护林员姓名', + dataIndex: 'name', + }, + { + title: '在线状态', + dataIndex: 'state', + customRender: ({ record }) => { + const state = record.state; + const enable = ~~state === '在线'; + const color = enable ? 'green' : 'red'; + const text = state; + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '离线时长', + dataIndex: 'onLineTime', + }, +]; + +export const formSchema: FormSchema[] = [ + { + field: 'id', + label: 'id', + component: 'Input', + ifShow: false, + }, + { + field: 'pointName', + label: '打卡点名称', + component: 'Input', + }, + { + field: 'areaId', + label: '行政区划', + required: true, + slot: 'areaId', + }, + { + field: 'userId', + label: '责任人', + slot: 'userId', + required: true, + }, +]; diff --git a/src/views/demo/meshing/inspectionrecord/index.ts b/src/views/demo/meshing/inspectionrecord/index.ts new file mode 100644 index 0000000..a921f74 --- /dev/null +++ b/src/views/demo/meshing/inspectionrecord/index.ts @@ -0,0 +1 @@ +export { default as InspectionMap } from './InspectionRecordMap.vue'; diff --git a/src/views/demo/meshing/inspectionrecord/index.vue b/src/views/demo/meshing/inspectionrecord/index.vue new file mode 100644 index 0000000..2baebfc --- /dev/null +++ b/src/views/demo/meshing/inspectionrecord/index.vue @@ -0,0 +1,239 @@ + + + diff --git a/src/views/demo/meshing/patrolstatistics/Map.vue b/src/views/demo/meshing/patrolstatistics/Map.vue new file mode 100644 index 0000000..4895811 --- /dev/null +++ b/src/views/demo/meshing/patrolstatistics/Map.vue @@ -0,0 +1,609 @@ + + + + diff --git a/src/views/demo/meshing/patrolstatistics/PatrolTrackModel.vue b/src/views/demo/meshing/patrolstatistics/PatrolTrackModel.vue new file mode 100644 index 0000000..575a7c2 --- /dev/null +++ b/src/views/demo/meshing/patrolstatistics/PatrolTrackModel.vue @@ -0,0 +1,220 @@ + + + diff --git a/src/views/demo/meshing/patrolstatistics/data.ts b/src/views/demo/meshing/patrolstatistics/data.ts new file mode 100644 index 0000000..6e42041 --- /dev/null +++ b/src/views/demo/meshing/patrolstatistics/data.ts @@ -0,0 +1,83 @@ +import { BasicColumn, FormSchema } from '@/components/Table'; +import { Tag } from 'ant-design-vue'; +import { h } from 'vue'; + +export const columns: BasicColumn[] = [ + { + title: '所属班组', + dataIndex: 'areaName', + width: 200, + }, + { + title: '护林员', + dataIndex: 'name', + }, + { + title: '手机号码', + dataIndex: 'account', + }, + { + title: '打卡次数', + dataIndex: 'dakacishu', + }, + { + title: '巡检次数', + dataIndex: 'xunjian', + }, + { + title: '打卡点数量', + dataIndex: 'dakadian', + }, +]; + +export const InspectionColumns: BasicColumn[] = [ + { + title: '乡镇/村庄', + dataIndex: 'townName', + }, + { + title: '护林员姓名', + dataIndex: 'name', + }, + { + title: '在线状态', + dataIndex: 'state', + customRender: ({ record }) => { + const state = record.state; + const enable = ~~state === '在线'; + const color = enable ? 'green' : 'red'; + const text = state; + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '离线时长', + dataIndex: 'onLineTime', + }, +]; + +export const formSchema: FormSchema[] = [ + { + field: 'id', + label: 'id', + component: 'Input', + ifShow: false, + }, + { + field: 'pointName', + label: '打卡点名称', + component: 'Input', + }, + { + field: 'areaId', + label: '行政区划', + required: true, + slot: 'areaId', + }, + { + field: 'userId', + label: '责任人', + slot: 'userId', + required: true, + }, +]; diff --git a/src/views/demo/meshing/patrolstatistics/index.ts b/src/views/demo/meshing/patrolstatistics/index.ts new file mode 100644 index 0000000..3402219 --- /dev/null +++ b/src/views/demo/meshing/patrolstatistics/index.ts @@ -0,0 +1,3 @@ + +export { default as Map } from './Map.vue'; +export { default as PatrolTrackModel } from './PatrolTrackModel.vue'; diff --git a/src/views/demo/meshing/patrolstatistics/index.vue b/src/views/demo/meshing/patrolstatistics/index.vue new file mode 100644 index 0000000..2e70f9c --- /dev/null +++ b/src/views/demo/meshing/patrolstatistics/index.vue @@ -0,0 +1,244 @@ + + +