This commit is contained in:
tianlong 2023-04-27 11:47:13 +08:00
commit 7334bbb857

View File

@ -38,10 +38,7 @@
<span>作物类型统计-高标准农田</span> <span>作物类型统计-高标准农田</span>
<p> <p>
下载 &nbsp; 下载 &nbsp;
<img <img src="@/assets/icons/svg/downloads.svg" style="width: 14px; height: 14px; cursor: pointer" />
src="@/assets/icons/svg/downloads.svg"
style="width: 14px; height: 14px; cursor: pointer"
/>
</p> </p>
</div> </div>
<div ref="farmlandDiv" class="farmlandDiv"></div> <div ref="farmlandDiv" class="farmlandDiv"></div>
@ -52,25 +49,12 @@
<span>作物类型统计-行政区划</span> <span>作物类型统计-行政区划</span>
<p> <p>
下载 &nbsp; 下载 &nbsp;
<img <img src="@/assets/icons/svg/downloads.svg" style="width: 14px; height: 14px; cursor: pointer" />
src="@/assets/icons/svg/downloads.svg"
style="width: 14px; height: 14px; cursor: pointer"
/>
</p> </p>
</div> </div>
<el-select <el-select popper-class="select_city" @change="selectTab(item)" v-model="value" clearable placeholder="全部">
popper-class="select_city" <el-option v-for="item in Township.arr" :key="item.properties.XZDM" :label="item.properties.XZMC"
@change="selectTab(item)" :value="item.properties.XZDM" />
v-model="value"
clearable
placeholder="全部"
>
<el-option
v-for="item in Township.arr"
:key="item.properties.XZDM"
:label="item.properties.XZMC"
:value="item.properties.XZDM"
/>
</el-select> </el-select>
<div ref="ASdivisionDiv" class="ASdivision"></div> <div ref="ASdivisionDiv" class="ASdivision"></div>
</div> </div>
@ -83,18 +67,11 @@
<template #title>图例</template> <template #title>图例</template>
<div class="mt-4"> <div class="mt-4">
<el-checkbox-group v-model="checkList" @change="change"> <el-checkbox-group v-model="checkList" @change="change">
<el-checkbox <el-checkbox v-for="(value, item, key) in dic" :key="key" :style="{
v-for="(value, item, key) in dic"
:key="key"
:style="{
background: value.color, background: value.color,
border: `1px solid ${value.color}`, border: `1px solid ${value.color}`,
width: `100%`, width: `100%`,
}" }" v-model="checked3" :disabled="value.disabled" :label="item" />
v-model="checked3"
:disabled="value.disabled"
:label="item"
/>
<!-- <el-checkbox style=" <!-- <el-checkbox style="
background: rgba(251, 171, 60, 1); background: rgba(251, 171, 60, 1);
@ -522,7 +499,7 @@ watch(
); );
// wms // wms
function addWms(layers, customName) { function addWms(layers, customName, bottom) {
let map = new Cesium.WebMapServiceImageryProvider({ let map = new Cesium.WebMapServiceImageryProvider({
url: serverAPI.geoserverUrl + `/shuzisannong/wms?`, url: serverAPI.geoserverUrl + `/shuzisannong/wms?`,
layers: layers, // layers: layers, //
@ -535,9 +512,13 @@ function addWms(layers, customName) {
}); });
map.customName = customName; // map.customName = customName; //
let dd = viewer.imageryLayers.addImageryProvider(map); // let dd = viewer.imageryLayers.addImageryProvider(map); //
if (customName.indexOf('gbznt') > -1) { // if (customName.indexOf('gbznt') > -1) {
console.log('dididididi'); // console.log('dididididi');
// viewer.imageryLayers.lower(dd);// // // viewer.imageryLayers.lower(dd);//
// viewer.imageryLayers.lowerToBottom(dd); //
// viewer.imageryLayers.raise(dd); //
// }
if (bottom) {
viewer.imageryLayers.lowerToBottom(dd); // viewer.imageryLayers.lowerToBottom(dd); //
viewer.imageryLayers.raise(dd); // viewer.imageryLayers.raise(dd); //
} }
@ -844,7 +825,7 @@ function getFarmland() {
console.log('农田:', res); console.log('农田:', res);
formLandRef.value = res.data.features; formLandRef.value = res.data.features;
}) })
.catch(err => {}); .catch(err => { });
} }
// //
function back() { function back() {
@ -943,7 +924,7 @@ const getaArea = () => {
const selectTab = () => { const selectTab = () => {
areachar(); areachar();
if (value.value == '370211') { if (value.value == '370211') {//
getTownships(); getTownships();
classData = [302034, 243990, 42344, 34234, 304235]; classData = [302034, 243990, 42344, 34234, 304235];
deleteEntityByName('townLine'); deleteEntityByName('townLine');
@ -1113,24 +1094,37 @@ const selectTab = () => {
data.title = [...Object.values(brr)]; data.title = [...Object.values(brr)];
ASdivision(); ASdivision();
}); });
const layers = viewer.imageryLayers._layers;
for (let f = layers.length - 1; f >= 0; f--) {
if (layers[f]._imageryProvider.aaa === 'aaa') { // const layers = viewer.imageryLayers._layers;
viewer.imageryLayers.remove(layers[f]); // for (let f = layers.length - 1; f >= 0; f--) {
} // if (layers[f]._imageryProvider.aaa === 'aaa') {
} // viewer.imageryLayers.remove(layers[f]);
let map2 = new Cesium.WebMapServiceImageryProvider({ // }
url: `http://121.36.229.60:9080/geoserver/shuzisannong/wms`, // }
layers: 'shuzisannong:huangdaoqu_village', // // let map2 = new Cesium.WebMapServiceImageryProvider({
parameters: { // url: `http://121.36.229.60:9080/geoserver/shuzisannong/wms`,
service: 'WMS', // layers: 'shuzisannong:huangdaoqu_village', //
format: 'image/png', // parameters: {
transparent: true, // // service: 'WMS',
CQL_FILTER: `XZDM=${value.value}`, // format: 'image/png',
}, // transparent: true, //
}); // CQL_FILTER: `XZDM=${value.value}`,
map2.aaa = 'aaa'; // },
viewer.imageryLayers.addImageryProvider(map2); // });
// map2.aaa = 'aaa';
// viewer.imageryLayers.addImageryProvider(map2);
//
removeWms(['village_CQL']);
//
deleteEntityByName('townLine');
//
addvillage(
`XZDM=${value.value}`,
'village_CQL'
);
}; };
// //
@ -1783,7 +1777,7 @@ function farmland() {
// //
function ChartClick(item) { function ChartClick(item) {
console.log('item:', item); console.log('item:', item);
// //
removeWms(['huangdaoqu_town'], true); removeWms(['huangdaoqu_town'], true);
removeWms(['shuzisannong:huangdaoqu_town']); removeWms(['shuzisannong:huangdaoqu_town']);
selectTab(); selectTab();
@ -1803,7 +1797,7 @@ function ChartClick(item) {
} }
if (!cz) { if (!cz) {
// //
addWms(layername, layername + 'gbznt'); addWms(layername, layername + 'gbznt', true);
} }
// //
let features = formLandRef.value; let features = formLandRef.value;
@ -2177,11 +2171,9 @@ $height: calc(100vh - 100px);
height: 25px; height: 25px;
border-radius: 20px; border-radius: 20px;
font-size: 14px; font-size: 14px;
background: linear-gradient( background: linear-gradient(180deg,
180deg,
rgba(16, 111, 111, 1) 0%, rgba(16, 111, 111, 1) 0%,
rgba(47, 214, 214, 1) 100% rgba(47, 214, 214, 1) 100%);
);
border: 1.5px solid rgba(23, 194, 180, 1); border: 1.5px solid rgba(23, 194, 180, 1);
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -2449,7 +2441,7 @@ $height: calc(100vh - 100px);
display: flex; display: flex;
margin-bottom: 10px; margin-bottom: 10px;
& > span:nth-child(1) { &>span:nth-child(1) {
font-weight: 400; font-weight: 400;
letter-spacing: 0px; letter-spacing: 0px;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
@ -2460,7 +2452,7 @@ $height: calc(100vh - 100px);
margin-right: 10px; margin-right: 10px;
} }
& > span:nth-child(2) { &>span:nth-child(2) {
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
width: 129px; width: 129px;
height: 24px; height: 24px;
@ -2482,6 +2474,7 @@ $height: calc(100vh - 100px);
cursor: pointer; cursor: pointer;
} }
} }
.back_button { .back_button {
position: absolute; position: absolute;
right: 30%; right: 30%;