xh 16 hours ago
parent
commit
c0dbf9efcb
  1. 2
      web/README.md
  2. 2
      web/index.html
  3. 7
      web/src/views/HandDevice/Home/components/constants/map.constants.ts
  4. 9
      web/src/views/HandDevice/Home/components/services/map.service.ts
  5. 12
      web/src/views/HandDevice/Home/components/utils/map.utils.ts
  6. 56
      web/src/views/gas/handdetector/index.vue
  7. 9
      web/src/views/gas/personnel/index.vue

2
web/README.md

@ -1 +1,3 @@
sudo unzip -o /home/zdhlroot/roadmap.zip -d /opt/website/mobile.zdhlcn.com/roadmap/
sudo cp /tmp/xiangheng/* /opt/website/mobile.zdhlcn.com/ -r

2
web/index.html

@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />

7
web/src/views/HandDevice/Home/components/constants/map.constants.ts

@ -1,6 +1,7 @@
/**
*
*/
import type { StatusDictItem, FenceData } from '../types/map.types'
// 状态字典配置
@ -28,11 +29,13 @@ export const STATUS_DICT = {
// 状态优先级定义 (数字越小优先级越高)
export const STATUS_PRIORITY = {
gasStatus_2: 1,
gasStatus_1: 2,
// battery_2: 3,
batteryStatus_1: 4,
// fence_2: 5,
fenceStatus_1: 6,
offline: 7,
normal: 8
@ -46,9 +49,9 @@ export const DEFAULT_MARKERS = []
// 地图默认配置
export const MAP_DEFAULTS = {
tileUrl:'https://webrd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}',
tileUrl: 'https://webrd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}',
// tileUrl: 'http://qtbj.icpcdev.site/roadmap/{z}/{x}/{y}.png',
// tileUrl: 'http://192.168.43.94:8080/{z}/{x}/{y}.png',
center: [116.3912757, 39.906217] as [number, number],
zoom: 10,
maxZoom: 18,

9
web/src/views/HandDevice/Home/components/services/map.service.ts

@ -5,9 +5,11 @@ import { Map, View } from 'ol'
import { Tile as TileLayer } from 'ol/layer'
import { OSM, XYZ } from 'ol/source'
import { fromLonLat,transformExtent } from 'ol/proj'
import { fromLonLat, transformExtent } from 'ol/proj'
import { boundingExtent } from 'ol/extent'
import Overlay from 'ol/Overlay'
import type { MapProps } from '../types/map.types'
@ -36,7 +38,8 @@ export class MapService {
zoom: props.zoom,
maxZoom: props.maxZoom,
minZoom: props.minZoom
})
}),
})
}
@ -94,7 +97,7 @@ export class MapService {
this.map.getView().fit(webMercatorExtent, {
padding: [80, 50, 100, 50],
maxZoom: this.map.getView().getMaxZoom()
maxZoom: this.map.getView().getMaxZoom()
})
}
/**

12
web/src/views/HandDevice/Home/components/utils/map.utils.ts

@ -36,6 +36,11 @@ export const getHighestPriorityStatus = (markerData: {
fenceStatus?: number
onlineStatus?: number
}): keyof typeof STATUS_PRIORITY => {
const onlineStatus = String(markerData.onlineStatus) !== '1' ? 'offline' : null
if (onlineStatus === 'offline') {
return 'offline'
}
const statuses: string[] = []
// 收集非正常状态
@ -53,11 +58,8 @@ export const getHighestPriorityStatus = (markerData: {
const fenceStatusStr = getStatusMapping('fenceStatus', String(markerData.fenceStatus))
fenceStatusStr && statuses.push(fenceStatusStr)
}
// 检查各种状态
const onlineStatus = String(markerData.onlineStatus) !== '1' ? 'offline' : null
if (onlineStatus) {
statuses.push(onlineStatus)
}
// console.log('statuses', statuses)
// 如果没有报警状态,则为正常

56
web/src/views/gas/handdetector/index.vue

@ -27,6 +27,22 @@
class="!w-240px"
/>
</el-form-item>
<el-form-item label="部门" prop="deptId">
<el-cascader
class="!w-240px"
v-model="queryParams.deptId"
:options="deptList"
:props="{
checkStrictly: true,
label: 'name',
value: 'id',
children: 'children',
emitPath: false
}"
clearable
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
@ -87,7 +103,11 @@
<!-- 围栏类型 -->
<el-table-column label="围栏类型" align="center" prop="fenceType">
<template #default="scope">
<DictTag :type="DICT_TYPE.HAND_DETECTOR_FENCE_TYPE" :value="scope.row.fenceType" v-if="scope.row.fenceType" />
<DictTag
:type="DICT_TYPE.HAND_DETECTOR_FENCE_TYPE"
:value="scope.row.fenceType"
v-if="scope.row.fenceType"
/>
</template>
</el-table-column>
<el-table-column label="气体类型" align="center" prop="gasTypeId">
@ -95,13 +115,28 @@
{{ handDetectorStore.getGasTypes.find((item) => item.id === scope.row.gasTypeId)?.name }}
</template>
</el-table-column>
<!-- 部门 -->
<el-table-column label="部门" align="center" prop="deptId">
<template #default="scope">
<span v-if="scope.row.deptId">
{{ deptList.find((dept) => dept.id === scope.row.deptId)?.name || '-' }}
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="启用状态" align="center" prop="enableStatus">
<template #default="scope">
<DictTag :type="DICT_TYPE.HAND_DETECTOR_ENABLE_STATUS" :value="scope.row.enableStatus" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="160px" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="160px"
/>
<el-table-column label="操作" align="center" min-width="120px">
<template #default="scope">
<el-button
@ -140,13 +175,15 @@
import { isEmpty } from '@/utils/is'
import download from '@/utils/download'
import { HandDetectorApi, HandDetector } from '@/api/gas/handdetector'
import { DeptVO, getSimpleDeptList } from '@/api/system/dept'
import HandDetectorForm from './HandDetectorForm.vue'
import { DICT_TYPE } from '@/utils/dict'
import { Fence } from '@/api/gas/fence'
import type { Type } from '@/api/gas/gastype'
import { useHandDetectorStore } from '@/store/modules/handDetector'
import { dateFormatter } from '@/utils/formatTime'
import { handleTree } from '@/utils/tree'
/** GAS手持探测器 列表 */
defineOptions({ name: 'HandDetector' })
const handDetectorStore = useHandDetectorStore()
@ -161,12 +198,20 @@ const queryParams = reactive({
pageSize: 10,
sn: undefined,
name: undefined,
deptId: undefined,
createTime: []
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
const fences = ref<Fence[]>([])
const gasTypes = ref<Type[]>([])
const deptList = ref<DeptVO[]>([]) //
function getDeptList() {
getSimpleDeptList().then((res) => {
deptList.value = handleTree(res || [])
})
}
/** 查询列表 */
const getList = async () => {
loading.value = true
@ -197,10 +242,10 @@ const resetQuery = () => {
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
if(fences.value.length === 0) {
if (fences.value.length === 0) {
getAllFences()
}
if(gasTypes.value.length === 0) {
if (gasTypes.value.length === 0) {
getAllGasTypes()
}
formRef.value.open(type, id)
@ -261,5 +306,6 @@ onMounted(() => {
getList()
getAllFences()
getAllGasTypes()
getDeptList()
})
</script>

9
web/src/views/gas/personnel/index.vue

@ -40,15 +40,6 @@
}"
clearable
/>
<!-- <el-select
v-model="queryParams.deptId"
placeholder="请选择部门"
clearable
filterable
class="!w-240px"
>
<el-option v-for="dept in deptList" :key="dept.id" :label="dept.name" :value="dept.id" />
</el-select> -->
</el-form-item>
<el-form-item label="系统用户" prop="userId">
<el-select

Loading…
Cancel
Save