fix(): 修复图层问题

qzc-dev
李神峰 2025-08-07 10:45:42 +08:00
parent bf68ca571e
commit a187c6fec3
3 changed files with 13 additions and 7 deletions

View File

@ -25,7 +25,7 @@ export default function drpOption(data) {
// 显示图例 // 显示图例
show: true, show: true,
// 图例的位置 // 图例的位置
data: ["测管水位", "库水位"], data: ["管水位", "库水位"],
}, },
xAxis: [ xAxis: [
{ {
@ -57,7 +57,7 @@ export default function drpOption(data) {
// gridIndex: 1, // gridIndex: 1,
type: 'value', type: 'value',
position: 'left', position: 'left',
name: "测管水位(m)", name: "管水位(m)",
nameTextStyle: { nameTextStyle: {
padding: [0, 0, 10, 10], padding: [0, 0, 10, 10],
color:'#333333', color:'#333333',
@ -128,7 +128,7 @@ export default function drpOption(data) {
{ {
// xAxisIndex: 1, // xAxisIndex: 1,
yAxisIndex: 0, yAxisIndex: 0,
name: '测管水位', name: '管水位',
type: 'line', type: 'line',
color: "#d6eaec", color: "#d6eaec",
lineStyle: { lineStyle: {

View File

@ -41,7 +41,7 @@ export default function drpOption(data,yjData) {
// 显示图例 // 显示图例
show: true, show: true,
// 图例的位置 // 图例的位置
data: ["测管水位", "库水位"], data: ["管水位", "库水位"],
}, },
xAxis: [ xAxis: [
{ {
@ -73,7 +73,7 @@ export default function drpOption(data,yjData) {
// gridIndex: 1, // gridIndex: 1,
type: 'value', type: 'value',
position: 'left', position: 'left',
name: "测管水位(m)", name: "管水位(m)",
nameTextStyle: { nameTextStyle: {
padding: [0, 0, 10, 10], padding: [0, 0, 10, 10],
color:'#333333', color:'#333333',
@ -144,7 +144,7 @@ export default function drpOption(data,yjData) {
{ {
// xAxisIndex: 1, // xAxisIndex: 1,
yAxisIndex: 0, yAxisIndex: 0,
name: '测管水位', name: '管水位',
type: 'line', type: 'line',
color: "#d6eaec", color: "#d6eaec",
lineStyle: { lineStyle: {

View File

@ -23,6 +23,7 @@ import AnZhiDian from './item_anzhidian'
import QSYDW from './item_qishiyedanwei' import QSYDW from './item_qishiyedanwei'
import YHJMH from './item_yanhejuminhu' import YHJMH from './item_yanhejuminhu'
import SetWxqStation from '../setMapStation/wxq' import SetWxqStation from '../setMapStation/wxq'
import SetDrpStation from '../setMapStation/drp'
import Bzt from '../../gcaqjc/bzt2' import Bzt from '../../gcaqjc/bzt2'
import ShenLiu from '../MapCtrl/Pops/ShenLiu'; import ShenLiu from '../MapCtrl/Pops/ShenLiu';
import ShenYa from '../MapCtrl/Pops/ShenYa'; import ShenYa from '../MapCtrl/Pops/ShenYa';
@ -419,10 +420,13 @@ const HomePage = ({ showPanels }) => {
}); });
// 先清除已存在的同名图层 // 先清除已存在的同名图层
mapObj && mapObj.getLayers().getArray().forEach(layer => { mapObj && mapObj.getLayers().getArray().forEach(layer => {
if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1)) { if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 ||
layer.values_.name.indexOf('ZHZS_YQ') > -1 ||
layer.values_.name.indexOf('ZHZS_YQ_DRP') > -1)) {
mapObj.removeLayer(layer); mapObj.removeLayer(layer);
} }
}); });
debugger
// 根据类型确定弹窗类型和图层 // 根据类型确定弹窗类型和图层
let popType = item.type; let popType = item.type;
let layerToShow = {}; let layerToShow = {};
@ -760,6 +764,8 @@ const HomePage = ({ showPanels }) => {
{checkedObj.label === '沿河居民户' ? <YHJMH /> : null} {checkedObj.label === '沿河居民户' ? <YHJMH /> : null}
{checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户' ? <SetWxqStation /> : null} {checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户' ? <SetWxqStation /> : null}
{checkedObj.label === '搜索结果' ? <SetDrpStation tms={tms} setTableData={()=>{}} /> : null}
</div> </div>
: null : null
} }