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 @@ + + +