Files
admin-sjzx/src/views/pqs/qualityInspeection/panorama/index.vue

278 lines
7.3 KiB
Vue
Raw Normal View History

2024-04-26 09:15:20 +08:00
<template>
2024-05-09 18:00:04 +08:00
<div class="panorama" :style="height">
<div class="mapBox" v-show="lineInfo">
<DatePicker ref="datePickerRef" style="display: none" theCurrentTime />
2024-04-26 09:15:20 +08:00
<el-form :inline="true" :model="form" class="demo-form-inline">
<el-form-item>
2024-11-21 08:56:04 +08:00
<Area ref="areaRef" :show-all-levels="false" v-model="form.orgNo" style="width: 100px"
@changeValue="changeValue" />
2024-04-26 09:15:20 +08:00
</el-form-item>
<el-form-item>
<el-select v-model="form.isUpToGrid" style="width: 100px" @change="info">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
2024-05-16 14:56:04 +08:00
<el-form-item>
2024-05-16 17:55:09 +08:00
<div class="Icon" @click="reset">
<Icon name="fa fa-refresh" />
2024-05-16 14:56:04 +08:00
</div>
</el-form-item>
2024-04-26 09:15:20 +08:00
</el-form>
</div>
<!-- 地图 -->
2024-11-21 08:56:04 +08:00
<Map v-if="VITE_FLAG" ref="mapRef" @changeValue="changeValue" :lineInfo="lineInfo" @drop="drop"
@show="infoShow" />
2024-05-09 18:00:04 +08:00
<div v-show="lineInfo">
<!-- 省级 -->
2024-05-14 18:28:27 +08:00
<div v-show="control == 1">
<mapL ref="mapLRef" class="mapL" @LookMap="LookMap" @GridDiagram="GridDiagram" />
2024-05-09 18:00:04 +08:00
<mapR ref="mapRRef" class="mapR" />
</div>
<!-- 市级 -->
<!-- <div v-show="control == 4"> -->
2024-05-14 18:28:27 +08:00
<div v-show="control == 2">
2024-06-13 13:32:50 +08:00
<cityMapL ref="cityMapLRef" class="mapL" @LookMap="LookMap" @GridDiagram="GridDiagram" />
2024-05-09 18:00:04 +08:00
<cityMapR ref="cityMapRRef" class="mapR" />
</div>
2024-04-29 16:37:07 +08:00
</div>
2024-05-09 18:00:04 +08:00
<Info v-if="!lineInfo" ref="InfoRef" @back="lineInfo = true" />
2024-04-26 09:15:20 +08:00
</div>
</template>
<script setup lang="ts">
2024-05-09 18:00:04 +08:00
import { onMounted, nextTick, ref, provide } from 'vue'
2024-04-26 09:15:20 +08:00
import Area from '@/components/form/area/index.vue'
import Map from './components/map.vue'
2024-04-26 09:15:20 +08:00
import { useDictData } from '@/stores/dictData'
import { mainHeight } from '@/utils/layout'
import { Search, Refresh } from '@element-plus/icons-vue'
import mapL from './components/mapL.vue'
2024-05-09 18:00:04 +08:00
import mapR from './components/mapR.vue'
2024-04-29 16:37:07 +08:00
import cityMapL from './components/cityMapL.vue'
import cityMapR from './components/cityMapR.vue'
2024-05-09 18:00:04 +08:00
import Info from './components/line/info.vue'
2024-04-27 22:18:58 +08:00
import DatePicker from '@/components/form/datePicker/index.vue'
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
2024-05-23 17:30:16 +08:00
2024-04-26 09:15:20 +08:00
const dictData = useDictData()
defineOptions({
2024-05-14 18:28:27 +08:00
name: 'panorama'
2024-04-26 09:15:20 +08:00
})
2024-04-27 22:18:58 +08:00
const datePickerRef = ref()
2024-04-26 09:15:20 +08:00
const areaRef = ref()
2024-05-09 18:00:04 +08:00
const lineInfo = ref(true)
const mapRef = ref()
2024-04-26 09:15:20 +08:00
const mapLRef = ref()
2024-05-09 18:00:04 +08:00
const InfoRef = ref()
2024-04-26 09:15:20 +08:00
const mapRRef = ref()
2024-04-29 16:37:07 +08:00
const cityMapLRef = ref()
const cityMapRRef = ref()
2024-05-14 18:28:27 +08:00
// const list: any = [dictData.state.area[0], ...dictData.state.area[0].children]
2024-04-26 09:15:20 +08:00
const options: any = ref([
{
name: dictData.state.area[0].name,
id: 0
},
{
2024-11-21 08:56:04 +08:00
name: '上送网公司',
2024-04-26 09:15:20 +08:00
id: 1
}
])
2024-05-14 18:28:27 +08:00
const control = ref(1)
2024-04-27 22:18:58 +08:00
const form: any = ref({
2024-04-26 09:15:20 +08:00
name: '',
orgNo: dictData.state.area[0].id,
2024-06-13 13:32:50 +08:00
areaName: dictData.state.area[0]?.name,
2024-04-26 09:15:20 +08:00
isUpToGrid: 0
})
const height = mainHeight(10)
2024-04-29 16:37:07 +08:00
// 获取区域名称
const changeValue = (e: any) => {
VITE_FLAG ? mapRef.value.locatePositions(e) : ''
2024-05-14 18:28:27 +08:00
form.value.orgNo = e.data.id //list.filter((item: any) => item.code == e.orgId)[0]?.id || dictData.state.area[0].id
2024-06-13 13:32:50 +08:00
form.value.areaName = e.data.name
2024-05-14 18:28:27 +08:00
options.value[0].name = e.data.areaName
2024-05-09 18:00:04 +08:00
2024-05-14 18:28:27 +08:00
control.value = e.data.level
2024-05-09 18:00:04 +08:00
2024-04-26 09:15:20 +08:00
info()
}
2024-05-09 18:00:04 +08:00
//点击监测点详情
const drop = (id: string) => {
lineInfo.value = false
nextTick(() => {
InfoRef.value.open(id)
})
}
// 关闭左右数据展示
2024-05-14 18:28:27 +08:00
const infoShow = (e: boolean) => {
2024-05-09 18:00:04 +08:00
mapLRef.value.show = e
mapRRef.value.show = e
cityMapLRef.value.show = e
cityMapRRef.value.show = e
}
2024-05-14 18:28:27 +08:00
// 地图控制图层
2024-05-16 14:56:04 +08:00
const LookMap = (row: any, key?: any) => {
VITE_FLAG ? mapRef.value.addMarkers({ ...row, type: 1 }, key) : ''
2024-04-26 09:15:20 +08:00
}
2024-06-13 13:32:50 +08:00
const LngLat = [
{
name: '唐山',
LngLat: [118.335849137, 39.7513593355],
zoom: 8
},
{
name: '张家口',
LngLat: [115.032504679, 40.8951549951],
zoom: 7
},
{
name: '秦皇岛',
LngLat: [119.185113833, 40.1179119754],
zoom: 8.3
},
{
name: '承德',
LngLat: [117.548498365, 41.3775890632],
zoom: 7.3
},
{
name: '廊坊',
LngLat: [116.628004129, 39.0589378611],
zoom: 8
},
{
name: '超高压',
LngLat: [116.84428600000001, 40.57707185292256],
zoom: 6.709267680647425
},
{
name: '风光储',
LngLat: [116.84428600000001, 40.57707185292256],
zoom: 6.709267680647425
}
]
//区域统计展示切换
2024-06-13 13:32:50 +08:00
const GridDiagram = (k?: number, num?: number) => {
VITE_FLAG ? mapRef.value.radiusPop(k) : ''
2024-06-13 13:32:50 +08:00
if (num == 3) {
// form.value.areaName
let value = LngLat.filter(item => item.name == form.value.areaName)[0]
if (value) VITE_FLAG ? mapRef.value.flyTo({ coordinate: value.LngLat }, value.zoom) : ''
2024-06-13 13:32:50 +08:00
} else {
VITE_FLAG ? mapRef.value.flyTo({ coordinate: [116.84428600000001, 40.57707185292256] }, 6.709267680647425) : ''
2024-06-13 13:32:50 +08:00
}
}
2024-04-26 09:15:20 +08:00
const info = () => {
2024-04-30 11:18:41 +08:00
form.value.startTime = datePickerRef.value.timeValue[0]
form.value.searchBeginTime = datePickerRef.value.timeValue[0]
form.value.endTime = datePickerRef.value.timeValue[1]
form.value.searchEndTime = datePickerRef.value.timeValue[1]
2024-04-27 22:18:58 +08:00
form.value.type = datePickerRef.value.interval
VITE_FLAG ? mapRef.value.grids(form.value) : ''
2024-05-14 18:28:27 +08:00
if (control.value == 1) {
2024-04-29 16:37:07 +08:00
mapLRef.value.info(form.value)
mapRRef.value.info(form.value)
} else {
cityMapRRef.value.info(form.value)
cityMapLRef.value.info(form.value)
}
2024-04-26 09:15:20 +08:00
}
2024-05-16 14:56:04 +08:00
// 重置
const reset = () => {
form.value = {
name: '',
orgNo: dictData.state.area[0].id,
2024-06-13 13:32:50 +08:00
areaName: dictData.state.area[0]?.name,
2024-05-16 14:56:04 +08:00
isUpToGrid: 0
}
changeValue({ data: dictData.state.area[0] })
}
2024-04-26 09:15:20 +08:00
onMounted(() => {
2024-05-14 18:28:27 +08:00
// info()
changeValue({ data: dictData.state.area[0] })
2024-05-09 18:00:04 +08:00
// aaa()
2024-04-26 09:15:20 +08:00
})
</script>
<style lang="scss" scoped>
2024-05-09 18:00:04 +08:00
:deep(.mapBox) {
2024-04-26 09:15:20 +08:00
position: absolute;
top: 10px;
2024-05-16 14:56:04 +08:00
left: calc(50% + 45px);
2024-05-09 18:00:04 +08:00
2024-04-26 09:15:20 +08:00
z-index: 1;
2024-11-21 08:56:04 +08:00
2024-04-26 09:15:20 +08:00
.el-select {
min-width: 100px;
2024-05-09 18:00:04 +08:00
.el-select__wrapper {
2024-11-21 11:36:36 +08:00
height: 46px !important;
2024-05-09 18:00:04 +08:00
border-radius: 8px;
}
2024-04-26 09:15:20 +08:00
}
2024-11-21 08:56:04 +08:00
2024-05-16 14:56:04 +08:00
.Icon {
height: 46px;
width: 46px;
background-color: #fff;
border-radius: 8px;
text-align: center;
line-height: 50px;
cursor: pointer;
2024-11-21 08:56:04 +08:00
2024-05-16 14:56:04 +08:00
.fa-refresh {
color: var(--el-color-primary) !important;
}
}
2024-11-21 08:56:04 +08:00
2024-05-14 18:28:27 +08:00
.el-input__wrapper {
height: 46px;
border-radius: 8px;
}
2024-11-21 08:56:04 +08:00
2024-04-26 09:15:20 +08:00
.el-form-item {
margin-right: 15px;
}
}
2024-11-21 08:56:04 +08:00
2024-04-26 09:15:20 +08:00
.mapL {
position: absolute;
top: 10px;
2024-04-30 11:18:41 +08:00
// z-index: 1;
2024-04-26 09:15:20 +08:00
left: 10px;
}
2024-11-21 08:56:04 +08:00
2024-04-26 09:15:20 +08:00
.mapR {
position: absolute;
top: 10px;
2024-04-30 11:18:41 +08:00
// z-index: 1;
2024-04-26 09:15:20 +08:00
right: 10px;
}
2024-05-09 18:00:04 +08:00
.panorama {
2024-04-26 09:15:20 +08:00
margin: 10px 0 0 0;
2024-05-09 18:00:04 +08:00
position: relative;
2024-04-26 09:15:20 +08:00
}
2024-11-21 08:56:04 +08:00
2024-04-26 09:15:20 +08:00
.el-button:focus {
color: var(--color);
background-color: #fff;
}
2024-11-21 08:56:04 +08:00
2024-04-26 09:15:20 +08:00
.el-button:hover {
color: var(--el-color-white);
border-color: var(--el-button-hover-bg-color);
background-color: var(--el-button-hover-bg-color);
outline: 0;
}
</style>