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

198 lines
5.5 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">
2024-04-27 22:18:58 +08:00
<DatePicker ref="datePickerRef" style="display: none" />
2024-04-26 09:15:20 +08:00
<el-form :inline="true" :model="form" class="demo-form-inline">
<el-form-item>
2024-05-14 18:28:27 +08:00
<Area
2024-04-26 09:15:20 +08:00
ref="areaRef"
:show-all-levels="false"
v-model="form.orgNo"
style="width: 100px"
2024-04-29 16:37:07 +08:00
@changeValue="changeValue"
2024-05-14 18:28:27 +08:00
/>
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-09 18:00:04 +08:00
<!-- <el-form-item>
2024-04-26 09:15:20 +08:00
<el-button icon="el-icon-Refresh" @click="reset"></el-button>
2024-05-09 18:00:04 +08:00
</el-form-item> -->
2024-04-26 09:15:20 +08:00
</el-form>
</div>
<!-- 地图 -->
2024-05-09 18:00:04 +08:00
<!-- <Map ref="mapRef" @changeValue="changeValue" :lineInfo="lineInfo" @drop="drop" @show="infoShow" /> -->
<div v-show="lineInfo">
<!-- 省级 -->
2024-05-14 18:28:27 +08:00
<div v-show="control == 1">
<mapL ref="mapLRef" class="mapL" @LookMap="LookMap" />
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-05-09 18:00:04 +08:00
<cityMapL ref="cityMapLRef" class="mapL" />
<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'
2024-05-14 18:28:27 +08:00
// 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'
2024-05-14 18:28:27 +08:00
import { map } from 'xe-utils'
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
},
{
name: '上送国网',
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,
isUpToGrid: 0
})
const height = mainHeight(10)
2024-04-29 16:37:07 +08:00
// 获取区域名称
const changeValue = (e: any) => {
2024-05-14 18:35:51 +08:00
// 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
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
// 地图控制图层
const LookMap = (row: any) => {
2024-05-14 18:35:51 +08:00
// mapRef.value.addMarkers({ ...row, type: 1 })
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]
// form.value.startTime = `2023-01-01`
// form.value.searchBeginTime = `2023-01-01`
// form.value.endTime = `2024-07-30`
// form.value.searchEndTime = `2024-07-30`
2024-04-27 22:18:58 +08:00
form.value.type = datePickerRef.value.interval
2024-05-14 18:35:51 +08:00
// mapRef.value.addMarkers()
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
}
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-09 18:00:04 +08:00
left: calc(50% + 95px);
2024-04-26 09:15:20 +08:00
z-index: 1;
.el-select {
min-width: 100px;
2024-05-09 18:00:04 +08:00
.el-select__wrapper {
height: 46px;
border-radius: 8px;
}
2024-04-26 09:15:20 +08:00
}
2024-05-14 18:28:27 +08:00
.el-input__wrapper {
height: 46px;
border-radius: 8px;
}
2024-04-26 09:15:20 +08:00
.el-form-item {
margin-right: 15px;
}
}
.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;
}
.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
}
.el-button:focus {
color: var(--color);
background-color: #fff;
}
.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>