| | |
| | | @change="handleMixClick" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :disabled="!mixActive" |
| | | active-text="风险热力图" |
| | | inactive-text="风险热力图" |
| | | :default-value="false" |
| | | @change="handleHeatMapClick" |
| | | > |
| | | </CheckButton> |
| | | <!-- <CheckButton |
| | | active-text="搜索网格" |
| | | inactive-text="搜索网格" |
| | | :default-value="false" |
| | | @change="handleHeatMapSearchClick" |
| | | > |
| | | </CheckButton> --> |
| | | </el-row> |
| | | <div class="m-t-8">网格要素</div> |
| | | <!-- <div class="m-t-8">网格要素</div> |
| | | <el-row class="m-t-8"> |
| | | <CheckButton |
| | | active-text="显示网格" |
| | |
| | | </el-row> |
| | | <div class="m-t-8">走航要素</div> |
| | | <el-row class="m-t-8"> |
| | | <!-- <el-divider content-position="left"></el-divider> --> |
| | | |
| | | <el-button |
| | | type="primary" |
| | |
| | | > |
| | | {{ underwayVisible ? '隐藏走航路线' : '显示走航路线' }} |
| | | </el-button> |
| | | </el-row> |
| | | </el-row> --> |
| | | </template> |
| | | <template #footer> </template> |
| | | </BaseCard> |
| | |
| | | </el-row> |
| | | </el-col> |
| | | </el-row> |
| | | <GridStyleTool :gridCtrls="gridCtrls"></GridStyleTool> |
| | | <GridStyleTool |
| | | :gridCtrls="gridCtrls" |
| | | @show-underway="handleUnderwayClick" |
| | | ></GridStyleTool> |
| | | </el-row> |
| | | <!-- </div> --> |
| | | </template> |
| | |
| | | import gridApi from '@/api/gridApi'; |
| | | import { SatelliteGrid } from '@/model/SatelliteGrid'; |
| | | import GridStyleTool from './component/GridStyleTool.vue'; |
| | | import { useGridStore } from '@/stores/grid-info'; |
| | | |
| | | const gridStore = useGridStore(); |
| | | |
| | | const satelliteGrid = new SatelliteGrid('走航融合'); |
| | | |
| | | const gridCtrls = ref([satelliteGrid]); |
| | | |
| | | // 借用卫星遥测模块中的100米网格 |
| | |
| | | const gridDataDetailMap = new Map(); |
| | | |
| | | const mixActive = ref(false); |
| | | const heatActive = ref(false); |
| | | const gridVisible = ref(true); |
| | | const underwayVisible = ref(false); |
| | | const rankVisible = ref(false); |
| | |
| | | } |
| | | |
| | | function prepareGrid(gridInfo) { |
| | | satelliteGrid.gridPrepare(gridInfo); |
| | | satelliteGrid.gridPrepare(gridInfo, (polygon) => { |
| | | //鼠标移入事件 |
| | | polygon.on('mouseover', () => { |
| | | polygon.setOptions({ |
| | | //修改多边形属性的方法 |
| | | strokeWeight: 2, |
| | | strokeColor: 'red' |
| | | }); |
| | | }); |
| | | //鼠标移出事件 |
| | | polygon.on('mouseout', () => { |
| | | polygon.setOptions({ |
| | | strokeWeight: 1, |
| | | strokeColor: 'white' |
| | | }); |
| | | }); |
| | | }); |
| | | // satelliteGrid.setGridEvent('click', (gridCell, gridDataDetail) => { |
| | | // // const polygon = e.target |
| | | // // const { gridCell } = polygon.getExtData(); |
| | | // // const cellIndex = gridCell.cellIndex; |
| | | // gridStore.selectedGridCellAndDataDetail = { |
| | | // gridCell, |
| | | // gridDataDetail |
| | | // }; |
| | | // }); |
| | | } |
| | | |
| | | // watch(mission, (nV, oV) => { |
| | |
| | | tag: d.id, |
| | | data: gdd, |
| | | extData: { |
| | | name: `走航网格 - ${d.mixDataId}` |
| | | name: `走航网格 - ${d.mixDataId}`, |
| | | type: 0 |
| | | } |
| | | }); |
| | | satelliteGrid.setGridEvent( |
| | | [d.id], |
| | | 'click', |
| | | (gridCell, gridDataDetail) => { |
| | | gridStore.selectedGridCellAndDataDetail = { |
| | | gridCell, |
| | | gridDataDetail |
| | | }; |
| | | } |
| | | ); |
| | | gridCtrls.value = [satelliteGrid]; |
| | | // gridCtrls.value = Array.from(satelliteGrid.mapViewsMap); |
| | | // console.log(gridCtrls.value); |
| | |
| | | }); |
| | | } |
| | | |
| | | let mixTag; |
| | | function handleMixClick() { |
| | | mixActive.value = !mixActive.value; |
| | | const tags = fusionDataList.value |
| | |
| | | showRankTxt: false |
| | | }); |
| | | if (mixActive.value) { |
| | | satelliteGrid.mixGrid(tags); |
| | | mixTag = satelliteGrid.mixGrid(tags); |
| | | satelliteGrid.setGridEvent( |
| | | [mixTag], |
| | | 'click', |
| | | (gridCell, gridDataDetail) => { |
| | | gridStore.selectedGridCellAndDataDetail = { |
| | | gridCell, |
| | | gridDataDetail |
| | | }; |
| | | } |
| | | ); |
| | | gridCtrls.value = [satelliteGrid]; |
| | | } else { |
| | | satelliteGrid.changeVisibility({ |
| | | tags, |
| | | showGridViews: true |
| | | }); |
| | | } |
| | | } |
| | | |
| | | let heatTag; |
| | | function handleHeatMapClick() { |
| | | heatActive.value = !heatActive.value; |
| | | satelliteGrid.changeVisibility({ |
| | | showGridViews: false, |
| | | showDataTxt: false, |
| | | showRankTxt: false |
| | | }); |
| | | if (heatActive.value) { |
| | | heatTag = satelliteGrid.drawHeatGrid(mixTag); |
| | | satelliteGrid.setGridEvent( |
| | | [heatTag], |
| | | 'click', |
| | | (gridCell, gridDataDetail) => { |
| | | gridStore.selectedGridCellAndDataDetail = { |
| | | gridCell, |
| | | gridDataDetail |
| | | }; |
| | | } |
| | | ); |
| | | gridCtrls.value = [satelliteGrid]; |
| | | } else { |
| | | satelliteGrid.changeVisibility({ |
| | | tags: [mixTag], |
| | | showGridViews: true |
| | | }); |
| | | } |
| | | } |
| | | |
| | | function handleHeatMapSearchClick() { |
| | | const res = satelliteGrid.search( |
| | | { |
| | | groupId: 1, |
| | | cellId: 2893, |
| | | pm25: 50 |
| | | }, |
| | | 120, |
| | | 90, |
| | | 10, |
| | | 10, |
| | | 3 |
| | | ); |
| | | |
| | | console.log(res); |
| | | } |
| | | |
| | | function handleGridClick() { |
| | |
| | | }); |
| | | } |
| | | |
| | | function handleUnderwayClick() { |
| | | function handleUnderwayClick({ isShow, dataId }) { |
| | | underwayVisible.value = !underwayVisible.value; |
| | | underwayVisible.value ? draw() : mapLine.hideLine(); |
| | | |
| | | if (isShow) { |
| | | draw(dataId); |
| | | } else { |
| | | const d = fusionDataList.value.find((v) => v.id == dataId); |
| | | const mission = missionStore.missionList.find((v) => { |
| | | return v.missionCode == d.mixDataId; |
| | | }); |
| | | mapLine.hideLine(mission.missionCode); |
| | | } |
| | | } |
| | | |
| | | function handleRankClick() { |
| | |
| | | }); |
| | | } |
| | | |
| | | function draw() { |
| | | function draw(dataId) { |
| | | if (isUnmounted.value) return; |
| | | |
| | | selectedfusionData.value.forEach((i) => { |
| | | const d = fusionDataList.value[i]; |
| | | // selectedfusionData.value.forEach((i) => { |
| | | // const d = fusionDataList.value[i]; |
| | | |
| | | const mission = missionStore.missionList.find((v) => { |
| | | return v.missionCode == d.mixDataId; |
| | | }); |
| | | // const mission = missionStore.missionList.find((v) => { |
| | | // return v.missionCode == d.mixDataId; |
| | | // }); |
| | | |
| | | if (factorDataMap.has(mission.missionCode)) { |
| | | const fd = factorDataMap.get(mission.missionCode); |
| | | drawLine(mission.missionCode, fd); |
| | | } else { |
| | | search(mission).then((res) => { |
| | | const fd = new FactorDatas(); |
| | | fd.setData(res.data, drawMode.value, () => { |
| | | fd.refreshHeight(factorType.value); |
| | | factorDataMap.set(mission.missionCode, fd); |
| | | drawLine(mission.missionCode, fd); |
| | | }); |
| | | }); |
| | | } |
| | | // if (factorDataMap.has(mission.missionCode)) { |
| | | // const fd = factorDataMap.get(mission.missionCode); |
| | | // drawLine(mission.missionCode, fd); |
| | | // } else { |
| | | // search(mission).then((res) => { |
| | | // const fd = new FactorDatas(); |
| | | // fd.setData(res.data, drawMode.value, () => { |
| | | // fd.refreshHeight(factorType.value); |
| | | // factorDataMap.set(mission.missionCode, fd); |
| | | // drawLine(mission.missionCode, fd); |
| | | // }); |
| | | // }); |
| | | // } |
| | | // }); |
| | | |
| | | const d = fusionDataList.value.find((v) => v.id == dataId); |
| | | const mission = missionStore.missionList.find((v) => { |
| | | return v.missionCode == d.mixDataId; |
| | | }); |
| | | |
| | | if (factorDataMap.has(mission.missionCode)) { |
| | | const fd = factorDataMap.get(mission.missionCode); |
| | | drawLine(mission.missionCode, fd); |
| | | } else { |
| | | search(mission).then((res) => { |
| | | const fd = new FactorDatas(); |
| | | fd.setData(res.data, drawMode.value, () => { |
| | | fd.refreshHeight(factorType.value); |
| | | factorDataMap.set(mission.missionCode, fd); |
| | | drawLine(mission.missionCode, fd); |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | function drawLine(missionCode, fd) { |