fix():修改水库巡查数据
parent
631fb9ef91
commit
e63244a2db
|
|
@ -147,12 +147,14 @@ export default function MapCtrl({ initParams, onLoad }) {
|
||||||
dispatch?.runtime.setInfoDlg({ layerId: 'ByjcLayer', properties: record })
|
dispatch?.runtime.setInfoDlg({ layerId: 'ByjcLayer', properties: record })
|
||||||
}else if (record.stnm == '浮桥河水库') {
|
}else if (record.stnm == '浮桥河水库') {
|
||||||
dispatch?.runtime.setInfoDlg({ layerId: 'RealSkLayer', properties: record })
|
dispatch?.runtime.setInfoDlg({ layerId: 'RealSkLayer', properties: record })
|
||||||
} else if (record.type == 'sw') {
|
}else if (record.type == 'sw') {
|
||||||
dispatch?.runtime.setFeaturePop({ type: 'RealHDPop', properties: record,coordinates: [record.lgtd, record.lttd] })
|
dispatch?.runtime.setFeaturePop({ type: 'RealHDPop', properties: record,coordinates: [record.lgtd, record.lttd] })
|
||||||
} else if (record.type == 'qx') {
|
} else if (record.type == 'qx') {
|
||||||
dispatch?.runtime.setFeaturePop({ type: 'RealDrpPop', properties: record,coordinates: [record.lgtd, record.lttd] })
|
dispatch?.runtime.setFeaturePop({ type: 'RealDrpPop', properties: record,coordinates: [record.lgtd, record.lttd] })
|
||||||
} else if (record.flow == 1) {
|
} else if (record.flow == 1) {
|
||||||
dispatch?.runtime.setInfoDlg({ layerId: 'flowjcLayer', properties: record })
|
dispatch?.runtime.setInfoDlg({ layerId: 'flowjcLayer', properties: record })
|
||||||
|
} else if (record.taskType) {
|
||||||
|
dispatch?.runtime.setInfoDlg({ layerId: 'XcxqLayer', properties: record })
|
||||||
}
|
}
|
||||||
// dispatch.runtime.setFeaturePop({ type: 'RealSkPop', properties: record, coordinates: [record.lgtd, record.lttd] });
|
// dispatch.runtime.setFeaturePop({ type: 'RealSkPop', properties: record, coordinates: [record.lgtd, record.lttd] });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import React, { useMemo, useState } from 'react';
|
||||||
import useRequest from '../../../../utils/useRequest';
|
import useRequest from '../../../../utils/useRequest';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import PanelBox from '../../components/PanelBox';
|
import PanelBox from '../../components/PanelBox';
|
||||||
|
import { parseGeoJSON } from "../../../../utils/tools";
|
||||||
|
|
||||||
import Table from '@material-ui/core/Table';
|
import Table from '@material-ui/core/Table';
|
||||||
import TableContainer from '@material-ui/core/TableContainer';
|
import TableContainer from '@material-ui/core/TableContainer';
|
||||||
|
|
@ -1755,11 +1756,64 @@ function DrpReal({ style }) {
|
||||||
const value = event.target.value;
|
const value = event.target.value;
|
||||||
setDimension(value);
|
setDimension(value);
|
||||||
}
|
}
|
||||||
|
const setLayer = (data = [], type) => {
|
||||||
|
const map = window.__mapref;
|
||||||
|
const layer = map.getLayer('关联站点')
|
||||||
|
if (layer) {
|
||||||
|
map.removeLayer('关联站点');
|
||||||
|
map.removeSource('关联站点');
|
||||||
|
}
|
||||||
|
if (data.length === 0) { return }
|
||||||
|
map.addLayer({
|
||||||
|
'id': '关联站点',//+new Date().getTime(),
|
||||||
|
'type': 'symbol',
|
||||||
|
'source': {
|
||||||
|
'type': 'geojson',
|
||||||
|
'data': {
|
||||||
|
'type': 'FeatureCollection',
|
||||||
|
'features': [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'layout': {
|
||||||
|
'icon-allow-overlap': true,
|
||||||
|
'text-allow-overlap': true,
|
||||||
|
'icon-image': '巡查',
|
||||||
|
'icon-size': [
|
||||||
|
'interpolate', ['linear'], ['zoom'],
|
||||||
|
10, 0.4,
|
||||||
|
14, 0.8,
|
||||||
|
],
|
||||||
|
|
||||||
|
'text-allow-overlap': true,
|
||||||
|
'text-size': [
|
||||||
|
'interpolate', ['linear'], ['zoom'],
|
||||||
|
10, 10,
|
||||||
|
14, 14,
|
||||||
|
],
|
||||||
|
'text-font': ['Roboto Black'],
|
||||||
|
'text-field': [
|
||||||
|
'step',
|
||||||
|
['zoom'],
|
||||||
|
'',
|
||||||
|
12, ['get', 'stnm']
|
||||||
|
],
|
||||||
|
'text-anchor': 'top',
|
||||||
|
'text-offset': [0, 1],
|
||||||
|
},
|
||||||
|
'paint': {
|
||||||
|
'text-color': '#fff'
|
||||||
|
},
|
||||||
|
'visibility': 'visible',
|
||||||
|
});
|
||||||
|
|
||||||
|
map.getSource('关联站点').setData(parseGeoJSON(data))
|
||||||
|
}
|
||||||
const jumpTo = (record) => {
|
const jumpTo = (record) => {
|
||||||
const { lgtd, lttd } = record;
|
const { lgtd, lttd } = record;
|
||||||
const lgtdNum = Number(lgtd);
|
const lgtdNum = Number(lgtd);
|
||||||
const lttdNum = Number(lttd)
|
const lttdNum = Number(lttd)
|
||||||
if (record.code == 1) {
|
if (record.code == 1) {
|
||||||
|
setLayer([{...record,lgtd:lgtdNum,lttd:lttdNum,stnm:"06-02浮桥河水库日常巡查"}])
|
||||||
if (lgtdNum && lttdNum) {
|
if (lgtdNum && lttdNum) {
|
||||||
dispatch.runtime.setCameraTarget({
|
dispatch.runtime.setCameraTarget({
|
||||||
center: [lgtdNum, lttdNum],
|
center: [lgtdNum, lttdNum],
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import React, { useMemo, useState } from 'react';
|
||||||
import useRequest from '../../../../utils/useRequest';
|
import useRequest from '../../../../utils/useRequest';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import PanelBox from '../../components/PanelBox';
|
import PanelBox from '../../components/PanelBox';
|
||||||
|
import { parseGeoJSON } from "../../../../utils/tools";
|
||||||
|
|
||||||
import Table from '@material-ui/core/Table';
|
import Table from '@material-ui/core/Table';
|
||||||
import TableContainer from '@material-ui/core/TableContainer';
|
import TableContainer from '@material-ui/core/TableContainer';
|
||||||
|
|
@ -117,13 +118,67 @@ function DrpReal({ style }) {
|
||||||
},
|
},
|
||||||
'visibility': 'visible',
|
'visibility': 'visible',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const setLayer = (data = [], type) => {
|
||||||
|
const map = window.__mapref;
|
||||||
|
const layer = map.getLayer('关联站点')
|
||||||
|
if (layer) {
|
||||||
|
map.removeLayer('关联站点');
|
||||||
|
map.removeSource('关联站点');
|
||||||
|
}
|
||||||
|
if (data.length === 0) { return }
|
||||||
|
map.addLayer({
|
||||||
|
'id': '关联站点',//+new Date().getTime(),
|
||||||
|
'type': 'symbol',
|
||||||
|
'source': {
|
||||||
|
'type': 'geojson',
|
||||||
|
'data': {
|
||||||
|
'type': 'FeatureCollection',
|
||||||
|
'features': [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'layout': {
|
||||||
|
'icon-allow-overlap': true,
|
||||||
|
'text-allow-overlap': true,
|
||||||
|
'icon-image': '巡查',
|
||||||
|
'icon-size': [
|
||||||
|
'interpolate', ['linear'], ['zoom'],
|
||||||
|
10, 0.4,
|
||||||
|
14, 0.8,
|
||||||
|
],
|
||||||
|
|
||||||
|
'text-allow-overlap': true,
|
||||||
|
'text-size': [
|
||||||
|
'interpolate', ['linear'], ['zoom'],
|
||||||
|
10, 10,
|
||||||
|
14, 14,
|
||||||
|
],
|
||||||
|
'text-font': ['Roboto Black'],
|
||||||
|
'text-field': [
|
||||||
|
'step',
|
||||||
|
['zoom'],
|
||||||
|
'',
|
||||||
|
12, ['get', 'stnm']
|
||||||
|
],
|
||||||
|
'text-anchor': 'top',
|
||||||
|
'text-offset': [0, 1],
|
||||||
|
},
|
||||||
|
'paint': {
|
||||||
|
'text-color': '#fff'
|
||||||
|
},
|
||||||
|
'visibility': 'visible',
|
||||||
|
});
|
||||||
|
|
||||||
|
map.getSource('关联站点').setData(parseGeoJSON(data))
|
||||||
|
}
|
||||||
const jumpTo = (record) => {
|
const jumpTo = (record) => {
|
||||||
const { lgtd, lttd } = record;
|
const { lgtd, lttd } = record;
|
||||||
const lgtdNum = Number(lgtd);
|
const lgtdNum = Number(lgtd);
|
||||||
const lttdNum = Number(lttd)
|
const lttdNum = Number(lttd)
|
||||||
if (record.code == 1) {
|
if (record.code == 1) {
|
||||||
setSkLayer1()
|
setSkLayer1()
|
||||||
|
setLayer([{...record,lgtd:lgtdNum,lttd:lttdNum,stnm:"06-02浮桥河水库日常巡查"}])
|
||||||
if (lgtdNum && lttdNum) {
|
if (lgtdNum && lttdNum) {
|
||||||
dispatch.runtime.setCameraTarget({
|
dispatch.runtime.setCameraTarget({
|
||||||
center: [lgtdNum, lttdNum],
|
center: [lgtdNum, lttdNum],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue