Compare commits

...

2 Commits

Author SHA1 Message Date
182ce9dbb6 up 2023-04-24 15:54:34 +08:00
90d19e06e6 up 2023-04-24 15:52:28 +08:00
3 changed files with 293 additions and 386 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

View File

@ -17,7 +17,10 @@
<span>作物类型统计-高标准农田</span> <span>作物类型统计-高标准农田</span>
<p> <p>
下载 &nbsp; 下载 &nbsp;
<img src="@/assets/icons/svg/downloads.svg" style="width: 14px; height: 14px; cursor: pointer" /> <img
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>
@ -28,12 +31,25 @@
<span>作物类型统计-行政区划</span> <span>作物类型统计-行政区划</span>
<p> <p>
下载 &nbsp; 下载 &nbsp;
<img src="@/assets/icons/svg/downloads.svg" style="width: 14px; height: 14px; cursor: pointer" /> <img
src="@/assets/icons/svg/downloads.svg"
style="width: 14px; height: 14px; cursor: pointer"
/>
</p> </p>
</div> </div>
<el-select popper-class="select_city" @change="selectTab(item)" v-model="value" clearable placeholder="全部"> <el-select
<el-option v-for="item in Township.arr" :key="item.properties.XZDM" :label="item.properties.XZMC" popper-class="select_city"
:value="item.properties.XZDM" /> @change="selectTab(item)"
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>
@ -43,11 +59,18 @@
<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 v-for="(value, item, key) in dic" :key="key" :style="{ <el-checkbox
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);
@ -156,7 +179,7 @@ const farmlandDiv = ref(null);
const ProgressBarDiv = ref(null); const ProgressBarDiv = ref(null);
const ASdivisionDiv = ref(null); const ASdivisionDiv = ref(null);
let Township = reactive({ arr: [], brr: [], crr: [] }); // let Township = reactive({ arr: [], brr: [], crr: [] }); //
const value = ref(''); const value = ref('370211');
const clickInfoMap = ref({ info: [] }); const clickInfoMap = ref({ info: [] });
let dd = { let dd = {
小麦: [], 小麦: [],
@ -203,7 +226,7 @@ var data = {
wheat: [null, 500, null, 500, null, 500, null, null], wheat: [null, 500, null, 500, null, 500, null, null],
Blueberries: [null, null, null, null, null, null, null, 500], Blueberries: [null, null, null, null, null, null, null, 500],
}; };
let classData = [200, 85, 112, 275, 305]; let classData = [302034, 243990, 42344, 34234, 304235];
const options = [ const options = [
{ {
value: 'Option1', value: 'Option1',
@ -216,7 +239,7 @@ const options = [
]; ];
// //
onMounted(() => { onMounted(() => {
initonMounted() initonMounted();
// checkList.value = Object.keys(dic.filter(item => !item.disabled)) // checkList.value = Object.keys(dic.filter(item => !item.disabled))
}); });
// //
@ -230,7 +253,7 @@ function initonMounted() {
farmland(); // farmland(); //
ASdivision(); // ASdivision(); //
getArea(); // getArea(); //
getFarmland() getFarmland();
checkList.value = Object.keys(dic); checkList.value = Object.keys(dic);
} }
const mapOption = { const mapOption = {
@ -307,19 +330,15 @@ function initMap() {
// logo // logo
viewer.cesiumWidget.creditContainer.style.display = 'none'; viewer.cesiumWidget.creditContainer.style.display = 'none';
viewer.camera.flyTo({ viewer.camera.flyTo({
destination: Cesium.Rectangle.fromDegrees(119.5091, 35.5671, 120.3285, 36.1455), destination: Cesium.Rectangle.fromDegrees(119.5091, 35.5671, 120.3285, 36.1455),
duration: 2, duration: 2,
}); });
// //
layerClick(); layerClick();
// //
addWms('shuzisannong:huangdaoqu_town', 'shuzisannong:huangdaoqu_town') addWms('shuzisannong:huangdaoqu_town', 'shuzisannong:huangdaoqu_town');
} }
const checkList = ref([]); const checkList = ref([]);
@ -406,7 +425,6 @@ watch(
} }
); );
// wms // wms
function addWms(layers, customName) { function addWms(layers, customName) {
let map = new Cesium.WebMapServiceImageryProvider({ let map = new Cesium.WebMapServiceImageryProvider({
@ -422,14 +440,14 @@ 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.lowerToBottom(dd); //
viewer.imageryLayers.raise(dd); // viewer.imageryLayers.raise(dd); //
} }
} }
// //
let XZDM = '' let XZDM = '';
function layerClick() { function layerClick() {
var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas); var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
handler.setInputAction(async function (movement) { handler.setInputAction(async function (movement) {
@ -452,7 +470,12 @@ function layerClick() {
const providerPoint = layers[index]; const providerPoint = layers[index];
// //
let provider = providerPoint._imageryProvider; let provider = providerPoint._imageryProvider;
if (provider && provider.ready && provider._layers && providerPoint.show === true) { if (
provider &&
provider.ready &&
provider._layers &&
providerPoint.show === true
) {
xy = provider.tilingScheme.positionToTileXY(cartographic, level, xy); xy = provider.tilingScheme.positionToTileXY(cartographic, level, xy);
let promise = provider.pickFeatures( let promise = provider.pickFeatures(
xy.x, xy.x,
@ -470,7 +493,7 @@ function layerClick() {
// //
XZDM = newData.properties.XZDM; XZDM = newData.properties.XZDM;
value.value = XZDM; // value.value = XZDM; //
// selectTab(); // selectTab(); //
let item = newData.data; let item = newData.data;
// //
viewer.camera.flyTo({ viewer.camera.flyTo({
@ -499,8 +522,9 @@ function layerClick() {
); );
// pop // pop
hiddenOverlayChart(); hiddenOverlayChart();
} else {// } else {
zuowuClick(layers, cartographic, level, xy, movement) //
zuowuClick(layers, cartographic, level, xy, movement);
} }
} else { } else {
removeWms(['village_CQL']); removeWms(['village_CQL']);
@ -511,7 +535,7 @@ function layerClick() {
} }
} else { } else {
// //
zuowuClick(layers, cartographic, level, xy, movement) zuowuClick(layers, cartographic, level, xy, movement);
} }
} }
} }
@ -523,17 +547,14 @@ async function zuowuClick(layers, cartographic, level, xy, movement) {
let promise = layers.map(async item => { let promise = layers.map(async item => {
if (item._imageryProvider._layers) { if (item._imageryProvider._layers) {
// //
if (Object.values(layersDic).findIndex(it => it === item._imageryProvider._layers) > -1) { if (
Object.values(layersDic).findIndex(it => it === item._imageryProvider._layers) > -1
) {
const providerPoint = item; const providerPoint = item;
// //
let provider = providerPoint._imageryProvider; let provider = providerPoint._imageryProvider;
if (provider && provider.ready && provider._layers && providerPoint.show === true if (provider && provider.ready && provider._layers && providerPoint.show === true) {
) { xy = provider.tilingScheme.positionToTileXY(cartographic, level, xy);
xy = provider.tilingScheme.positionToTileXY(
cartographic,
level,
xy
);
let promise = provider.pickFeatures( let promise = provider.pickFeatures(
xy.x, xy.x,
xy.y, xy.y,
@ -553,9 +574,7 @@ async function zuowuClick(layers, cartographic, level, xy, movement) {
'red' 'red'
); );
let info = data['0'].properties; let info = data['0'].properties;
const ind = newData.findIndex( const ind = newData.findIndex(ii => ii && ii.crop === info.crop);
ii => ii && ii.crop === info.crop
);
if (ind < 0) { if (ind < 0) {
newData.push(info); newData.push(info);
} }
@ -573,12 +592,8 @@ async function zuowuClick(layers, cartographic, level, xy, movement) {
var cartesian = viewer.camera.pickEllipsoid(coordinate, ellipsoid); var cartesian = viewer.camera.pickEllipsoid(coordinate, ellipsoid);
if (cartesian) { if (cartesian) {
let cartographic = ellipsoid.cartesianToCartographic(cartesian); let cartographic = ellipsoid.cartesianToCartographic(cartesian);
let longitudeString = Cesium.Math.toDegrees(cartographic.longitude).toFixed( let longitudeString = Cesium.Math.toDegrees(cartographic.longitude).toFixed(6);
6 let latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(6);
);
let latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(
6
);
clickInfoMap.value = { clickInfoMap.value = {
info: newData, info: newData,
// ...newData['0'], // ...newData['0'],
@ -649,7 +664,11 @@ function removeWms(nameArry, isMohu) {
const layers = viewer.imageryLayers._layers; const layers = viewer.imageryLayers._layers;
for (let f = layers.length - 1; f >= 0; f--) { for (let f = layers.length - 1; f >= 0; f--) {
nameArry.forEach(item => { nameArry.forEach(item => {
if (layers[f] && layers[f]._imageryProvider && layers[f]._imageryProvider.customName) { if (
layers[f] &&
layers[f]._imageryProvider &&
layers[f]._imageryProvider.customName
) {
if (isMohu) { if (isMohu) {
if (layers[f]._imageryProvider.customName.indexOf(item) > -1) { if (layers[f]._imageryProvider.customName.indexOf(item) > -1) {
viewer.imageryLayers.remove(layers[f]); viewer.imageryLayers.remove(layers[f]);
@ -718,11 +737,15 @@ function showOverlayChart(position) {
// //
function getFarmland() { function getFarmland() {
axios({ axios({
url: serverAPI.geoserverUrl + '/shuzisannong/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=shuzisannong%3Afarmland&maxFeatures=50&outputFormat=application%2Fjson', url:
method: 'get' serverAPI.geoserverUrl +
}).then(res => { '/shuzisannong/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=shuzisannong%3Afarmland&maxFeatures=50&outputFormat=application%2Fjson',
console.log('农田:', res) method: 'get',
}).catch(err => { }) })
.then(res => {
console.log('农田:', res);
})
.catch(err => {});
} }
// //
const getArea = (item, index) => { const getArea = (item, index) => {
@ -762,7 +785,7 @@ const getaArea = () => {
let arr = []; let arr = [];
let a = {}; let a = {};
getareas().then(res => { getareas().then(res => {
console.log('res:', res) console.log('res:', res);
Township.crr = res.features; Township.crr = res.features;
data.title.forEach((item, indexs) => { data.title.forEach((item, indexs) => {
let town = res.features.map(i => { let town = res.features.map(i => {
@ -780,15 +803,21 @@ const getaArea = () => {
}); });
}); });
ASdivision(); ASdivision();
selectTab();
}); });
}; };
const selectTab = () => { const selectTab = () => {
classData = [116, 75, 96, 168, 245];
areachar(); areachar();
if (value.value == '370211') { if (value.value == '370211') {
getTownships(); getTownships();
classData = [302034, 243990, 42344, 34234, 304235];
} else if(value.value) {
classData = [102034, 173990, 22344, 14234, 104235];
} }
console.log(classData);
areachar();
let arr = [...Township.arr]; let arr = [...Township.arr];
arr.forEach(item => { arr.forEach(item => {
if (item.properties.XZDM == value.value) { if (item.properties.XZDM == value.value) {
@ -1002,33 +1031,63 @@ function areachar() {
function typesof() { function typesof() {
const typesofDivIntance = echarts.init(typesofDiv.value); const typesofDivIntance = echarts.init(typesofDiv.value);
let selectedIndex = ''; let isSelected = '';
let isHovered = '';
let hoveredIndex = ''; let hoveredIndex = '';
let option = getPie3D( let option = getPie3D(
[ [
{ {
name: '水田', name: '小麦',
value: 60, value: 101,
itemStyle: { itemStyle: {
color: '#1890FF', opacity: 0.5,
color: 'rgba(110, 209, 84, 0.9)',
}, },
}, },
{ {
name: '水浇地', //
value: 44, name: '玉米',
value: 56,
itemStyle: { itemStyle: {
color: '#1EE7E7', //
opacity: 0.5,
//
color: 'rgba(251, 201, 3, 1)',
},
label: {
show: true,
}, },
}, },
{ {
name: '旱地', //
value: 32, name: '大豆',
value: 56,
itemStyle: { itemStyle: {
color: '#F3F62B', //
opacity: 0.5,
//
color: 'rgba(240, 129, 31, 0.9)',
},
label: {
show: true,
},
},
{
//
name: '地瓜',
value: 56,
itemStyle: {
//
opacity: 0.5,
//
color: 'rgba(27, 85, 222, 1)',
},
label: {
show: true,
}, },
}, },
], ],
0 // 0
); );
// //
function getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, h) { function getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, h) {
@ -1054,7 +1113,7 @@ function typesof() {
const offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0; const offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0;
// 1 // 1
const hoverRate = isHovered ? 1.05 : 1; // const hoverRate = isHovered ? 1.05 : 1;
// //
return { return {
@ -1152,6 +1211,7 @@ function typesof() {
} }
// 使 sumValue getParametricEquation // 使 sumValue getParametricEquation
// series-surface series-surface.parametricEquation // series-surface series-surface.parametricEquation
console.log(series);
for (let i = 0; i < series.length; i += 1) { for (let i = 0; i < series.length; i += 1) {
endValue = startValue + series[i].pieData.value; endValue = startValue + series[i].pieData.value;
@ -1174,29 +1234,68 @@ function typesof() {
// legendDataseries // legendDataseries
const option = { const option = {
// animation: false,
legend: { legend: {
show: true, show: true,
bottom: 0,
textStyle: { color: 'rgba(255,255,255,.9)' },
}, },
title: {
text: '年审核问题分布情况',
x: 'center',
top: 170,
textStyle: {
color: '#000',
fontSize: 14,
},
},
// animation: false,
tooltip: { tooltip: {
formatter: params => { formatter: params => {
if (params.seriesName !== 'mouseoutSeries') { if (params.seriesName !== 'mouseoutSeries') {
return `${params.seriesName return `${
}<br/><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${params.color params.seriesName
};"></span>${option.series[params.seriesIndex].pieData.value}`; }<br/><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${
params.color
};"></span>`;
} }
return ''; return '';
}, },
}, },
// visualMap: [
// {
// show: false,
// dimension: 2, // [x, y, z, u, v]
// min: -1,
// seriesIndex: 0,
// max: 1,
// inRange: {
// color: ['#ff0', '#f00'],
// },
// },
// {
// show: false,
// dimension: 4, // [x, y, z, u, v]
// min: 0,
// seriesIndex: 1,
// max: Math.PI * 2,
// inRange: {
// color: ['#0bf', '#0f0', '#0bf'],
// },
// },
// {
// show: false,
// dimension: 3, // [x, y, z, u, v]
// min: 0,
// seriesIndex: 2,
// max: Math.PI * 2,
// inRange: {
// color: [
// '#a50026',
// '#d73027',
// '#f46d43',
// '#fdae61',
// '#fee090',
// '#ffffbf',
// '#e0f3f8',
// '#abd9e9',
// '#74add1',
// '#4575b4',
// '#313695',
// ],
// },
// },
// ],
xAxis3D: { xAxis3D: {
min: -1, min: -1,
max: 1, max: 1,
@ -1211,16 +1310,16 @@ function typesof() {
}, },
grid3D: { grid3D: {
show: false, show: false,
boxHeight: 5, boxHeight: 10,
top: '-20%', top: '-10%',
viewControl: { viewControl: {
// 3d // 3d
alpha: 20, alpha: 35,
// beta: 30, beta: 30,
rotateSensitivity: 1, rotateSensitivity: 1,
zoomSensitivity: 0, zoomSensitivity: 0,
panSensitivity: 0, panSensitivity: 0,
// autoRotate: true, autoRotate: true,
distance: 300, distance: 300,
}, },
// SSAO // SSAO
@ -1247,8 +1346,7 @@ function typesof() {
} }
// bug // bug
// mouseover // mouseover
option.title.text = option.series[0].name + ' ' + option.series[0].pieData.value; typesofDivIntance.on('mouseover', function (params) {
function handleOver(params) {
// //
let isSelected; let isSelected;
let isHovered; let isHovered;
@ -1292,11 +1390,6 @@ function typesof() {
// mouseover option // mouseover option
if (params.seriesName !== 'mouseoutSeries') { if (params.seriesName !== 'mouseoutSeries') {
option.title.text =
' ' +
option.series[seriesIndex].name +
' ' +
option.series[params.seriesIndex].pieData.value;
// option.series true // option.series true
isSelected = option.series[params.seriesIndex].pieStatus.selected; isSelected = option.series[params.seriesIndex].pieStatus.selected;
isHovered = true; isHovered = true;
@ -1322,17 +1415,15 @@ function typesof() {
// 使 option // 使 option
typesofDivIntance.setOption(option); typesofDivIntance.setOption(option);
} }
}
typesofDivIntance.on('mouseover', function (params) {
handleOver(params);
}); });
function handleOut() { // bug
typesofDivIntance.on('globalout', function () {
if (hoveredIndex !== '') { if (hoveredIndex !== '') {
// option.series true // option.series true
isSelected = option.series[hoveredIndex].pieStatus.selected; isSelected = option.series[hoveredIndex].pieStatus.selected;
isHovered = false; isHovered = false;
k = option.series[hoveredIndex].pieStatus.k; let k = option.series[hoveredIndex].pieStatus.k;
startRatio = option.series[hoveredIndex].pieData.startRatio; startRatio = option.series[hoveredIndex].pieData.startRatio;
endRatio = option.series[hoveredIndex].pieData.endRatio; endRatio = option.series[hoveredIndex].pieData.endRatio;
// option // option
@ -1356,19 +1447,7 @@ function typesof() {
// 使 option // 使 option
typesofDivIntance.setOption(option); typesofDivIntance.setOption(option);
}
// bug
typesofDivIntance.on('globalout', function () {
handleOut();
}); });
let seriesIndex = 0;
setInterval(() => {
handleOver({ seriesIndex: seriesIndex });
seriesIndex++;
if (seriesIndex === option.series.length) {
seriesIndex = 0;
}
}, 3000);
// option && typesofDivIntance.setOption(option); // option && typesofDivIntance.setOption(option);
useEcharts(typesofDivIntance, option); useEcharts(typesofDivIntance, option);
@ -1376,322 +1455,146 @@ function typesof() {
// echarts // echarts
function farmland() { function farmland() {
const farmlandDivIntance = echarts.init(farmlandDiv.value); const farmlandDivIntance = echarts.init(farmlandDiv.value);
var option = { let option = {
// // backgroundColor: '#333333',
// tooltip: {},
grid: { grid: {
bottom: '8%', left: '3%',
left: '10%', right: '4%',
right: '6%', bottom: '3%',
top: '6%', top: '10%',
containLabel: true, containLabel: true,
}, },
dataZoom: [ legend: {
{ show: true,
type: 'slider', top: '10',
show: false, left: 'center',
zoomLock: true, // textStyle: { color: 'rgba(255,255,255,.9)' },
width: 8, itemWidth: 20,
yAxisIndex: [0], itemHeight: 12.5,
bottom: 30, icon: 'stack',
top: 20,
right: 10,
startValue: 0,
endValue: 4,
handleIcon:
'M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z',
handleSize: '100%',
handleStyle: {
color: '#DBDBDB',
height: '100%',
}, },
backgroundColor: 'transparent',
fillerColor: '#DBDBDB',
textStyle: {
color: 'transparent',
},
dataBackground: {
lineStyle: {
color: 'transparent',
},
areaStyle: {
color: 'transparent',
},
},
borderColor: 'transparent',
},
{
type: 'inside',
id: 'insideY',
yAxisIndex: 0,
start: 0,
end: 50,
zoomOnMouseWheel: false,
moveOnMouseMove: true,
moveOnMouseWheel: true,
},
],
// X
xAxis: { xAxis: {
type: 'value', // , 'value' type: 'value',
// max: 500,
axisTick: { show: false,
show: false, // // 线
},
// 线
axisLine: { axisLine: {
// 线 show: false,
show: false, // 线 },
// 线
axisTick: {
show: false,
}, },
// 线
splitLine: { splitLine: {
show: false, // 线 // 线线
show: false,
}, },
// // axisLabel:{
axisLabel: { // formatter:'{value}%'
show: false, // // }
}, },
}, yAxis: {
// Y
yAxis: [
// Y
{
// , 'category'
// data
type: 'category', type: 'category',
//
axisTick: {
show: false, //
},
// 线
axisLine: {
// 线
show: false, // 线
lineStyle: {
// 线线
color: '#cdd3ee',
},
},
// 线
splitLine: {
show: false, // 线
},
//
axisLabel: {
show: true, //
fontSize: 12, //
color: 'rgba(255, 255, 255, 1)', //
// 使 {value}
formatter: '{value}',
},
// type: 'category'
data: data.title,
inverse: true, inverse: true,
splitLine: {
show: false,
},
axisTick: {
show: false,
},
axisLine: {
show: false,
},
axisLabel: {
interval: 0,
color: 'rgba(255, 255, 255, 1)',
fontSize: 14,
},
data: ['片区一', '片区二', '片区三', '片区四', '片区五','片区六','片区七'],
}, },
],
//
series: [ series: [
{ {
type: 'bar', // name: '小麦',
name: '玉米', // , tooltip, legend type: 'bar',
// stack barWidth: 12,
stack: '总量', stack: 'stack',
barMaxWidth: 30, // data: [160, 103, 155, 100, 50,122,98],
//
label: {
show: true,
position: '玉米',
textStyle: {
fontSize: 12,
fontWeight: 'bolder',
color: 'rgba(255,255,255,1)',
},
},
//
itemStyle: { itemStyle: {
barBorderRadius: [0, 0, 0, 0], normal: {
barBorderRadius: [0, 0, 0, 0], // barBorderRadius: 0,
borderWidth: 1, // color: new echarts.graphic.LinearGradient(0, 0, 0.9, 0, [
borderColor: 'rgba(4, 247, 227, 0.8)', //
color: {
colorStops: [
{
offset: 0,
color: 'rgba(4, 247, 227, 0.9)', // 0%
},
{ {
offset: 1, offset: 1,
color: 'rgba(4, 247, 227, 0.25)', // 100% color: 'rgba(33, 187, 251, 0.9)',
}, },
],
},
},
data: dd.玉米, //
},
{
type: 'bar', //
name: '大豆', // , tooltip, legend
// stack
stack: '总量',
barMaxWidth: 30, //
//
label: {
show: true,
position: 'inside',
formatter: '大豆',
textStyle: {
fontSize: 12,
fontWeight: 'bolder',
color: 'rgba(255,255,255,1)',
},
},
//
itemStyle: {
barBorderRadius: [0, 0, 0, 0], //
borderWidth: 1, //
borderColor: 'rgba(143, 186, 243, 0.8)', //
color: {
colorStops: [
{ {
offset: 0, offset: 0,
color: 'rgba(143, 186, 243, 0.9)', // 0% color: 'rgba(33, 187, 251, 0.05)',
}, },
]),
},
},
},
{
name: '大豆',
type: 'bar',
barWidth: 12,
stack: 'stack',
data: [160, 103, 155, 100, 50,124,168],
itemStyle: {
normal: {
barBorderRadius: 0,
color: new echarts.graphic.LinearGradient(0, 0, 0.9, 0, [
{ {
offset: 1, offset: 1,
color: 'rgba(143, 186, 243, 0.3)', // 100% color: 'rgba(143, 186, 243, 0.9)',
}, },
],
},
},
data: [1, 2, 4], //
},
{
type: 'bar', //
name: '花生', // , tooltip, legend
// stack
stack: '总量',
barMaxWidth: 30, //
//
label: {
show: true,
position: 'inside',
formatter: '花生',
textStyle: {
fontSize: 12,
fontWeight: 'bolder',
color: 'rgba(255,255,255,1)',
},
},
//
itemStyle: {
barBorderRadius: [0, 0, 0, 0],
barBorderRadius: [0, 0, 0, 0], //
borderWidth: 1, //
borderColor: 'rgba(255, 225, 104, 0.8)', //
color: {
colorStops: [
{ {
offset: 0, offset: 0,
color: 'rgba(255, 225, 104, 0.9)', // 0% color: 'rgba(143, 186, 243, 0.05)',
}, },
]),
},
},
},
{
name: '地瓜',
type: 'bar',
barWidth: 12,
stack: 'stack',
data: [160, 103, 155, 100, 50,45,321],
itemStyle: {
normal: {
barBorderRadius: 0,
color: new echarts.graphic.LinearGradient(0, 0, 0.9, 0, [
{ {
offset: 1, offset: 1,
color: 'rgba(255, 225, 104, 0.25)', // 100% color: 'rgba(255, 225, 104, 1)',
}, },
],
},
},
data: dd.花生, //
},
{
type: 'bar', //
name: '小麦', // , tooltip, legend
// stack
stack: '总量',
barMaxWidth: 30, //
//
label: {
show: true,
position: 'inside',
formatter: '小麦',
textStyle: {
fontSize: 12,
fontWeight: 'bolder',
color: 'rgba(255,255,255,1)',
},
},
//
itemStyle: {
barBorderRadius: [0, 0, 0, 0],
barBorderRadius: [0, 0, 0, 0], //
borderWidth: 1, //
borderColor: 'rgba(33, 187, 251, 0.8)', //
color: {
colorStops: [
{ {
offset: 0, offset: 0,
color: 'rgba(33, 187, 251, 0.9)', // 0% color: 'rgba(255, 225, 104, 0.05)',
}, },
{ ]),
offset: 1,
color: 'rgba(33, 187, 251, 0.25)', // 100%
},
],
}, },
}, },
data: dd.小麦, //
},
{
type: 'bar', //
name: '蓝莓', // , tooltip, legend
// stack
stack: '总量',
barMaxWidth: 30, //
//
label: {
show: true,
position: 'inside',
formatter: '蓝莓',
textStyle: {
fontSize: 12,
fontWeight: 'bolder',
color: 'rgba(255,255,255,1)',
},
},
//
itemStyle: {
barBorderRadius: [0, 0, 0, 0],
barBorderRadius: [0, 0, 0, 0], //
borderWidth: 1, //
borderColor: 'rgba(14, 223, 255, 0.8)', //
color: {
colorStops: [
{
offset: 0,
color: 'rgba(14, 223, 255, 0.9)', // 0%
},
{
offset: 1,
color: 'rgba(14, 223, 255, 0.25)', // 100%
},
],
},
},
data: dd.蓝莓, //
}, },
], ],
}; };
// areaDivIntance.off('click') //, // areaDivIntance.off('click') //,
farmlandDivIntance.on("click", (param) => ChartClick(param)); farmlandDivIntance.on('click', param => ChartClick(param));
useEcharts(farmlandDivIntance, option); useEcharts(farmlandDivIntance, option);
} }
// //
function ChartClick() { function ChartClick() {
// //
removeWms(['huangdaoqu_town'], true); removeWms(['huangdaoqu_town'], true);
let layername = 'shuzisannong:farmland' let layername = 'shuzisannong:farmland';
// //
addWms(layername, layername + 'gbznt'); addWms(layername, layername + 'gbznt');
} }
function ASdivision() { function ASdivision() {
@ -2000,14 +1903,13 @@ function ASdivision() {
}, },
], ],
}; };
ASdivisionDivIntance.on("click", (param) => ChartClickRB(param)); ASdivisionDivIntance.on('click', param => ChartClickRB(param));
// option && ASdivisionDivIntance.setOption(option, true); // option && ASdivisionDivIntance.setOption(option, true);
useEcharts(ASdivisionDivIntance, option); useEcharts(ASdivisionDivIntance, option);
} }
// //
function ChartClickRB(param) { function ChartClickRB(param) {
console.log('右下点击', param) console.log('右下点击', param);
} }
</script> </script>
@ -2044,9 +1946,11 @@ $height: calc(100vh - 100px);
height: 25px; height: 25px;
border-radius: 20px; border-radius: 20px;
font-size: 14px; font-size: 14px;
background: linear-gradient(180deg, background: linear-gradient(
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;
@ -2088,7 +1992,11 @@ $height: calc(100vh - 100px);
.typesofDiv { .typesofDiv {
width: 100%; width: 100%;
height: 267px; height: 397px;
background: url('@/assets/images/bj1_00000_iSpt.png');
background-repeat: no-repeat;
background-size: 85% 85%;
background-position: center;
} }
} }
} }
@ -2344,6 +2252,5 @@ $height: calc(100vh - 100px);
.el-popper__arrow::before { .el-popper__arrow::before {
background: rgba(41, 255, 255, 0.7) !important; background: rgba(41, 255, 255, 0.7) !important;
} }
</style> </style>