Compare commits

..

No commits in common. "182ce9dbb608fa0f2a264b1ff803e4127d98794d" and "e5eb1ebb6a058c6f130124da1fac0289e09b9265" have entirely different histories.

3 changed files with 395 additions and 302 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 MiB

View File

@ -17,10 +17,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>
@ -31,25 +28,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>
@ -59,18 +43,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);
@ -179,7 +156,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('370211'); const value = ref('');
const clickInfoMap = ref({ info: [] }); const clickInfoMap = ref({ info: [] });
let dd = { let dd = {
小麦: [], 小麦: [],
@ -226,7 +203,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 = [302034, 243990, 42344, 34234, 304235]; let classData = [200, 85, 112, 275, 305];
const options = [ const options = [
{ {
value: 'Option1', value: 'Option1',
@ -239,7 +216,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))
}); });
// //
@ -253,7 +230,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 = {
@ -330,15 +307,19 @@ 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([]);
@ -425,6 +406,7 @@ watch(
} }
); );
// wms // wms
function addWms(layers, customName) { function addWms(layers, customName) {
let map = new Cesium.WebMapServiceImageryProvider({ let map = new Cesium.WebMapServiceImageryProvider({
@ -440,14 +422,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) {
@ -470,12 +452,7 @@ function layerClick() {
const providerPoint = layers[index]; const providerPoint = layers[index];
// //
let provider = providerPoint._imageryProvider; let provider = providerPoint._imageryProvider;
if ( if (provider && provider.ready && provider._layers && providerPoint.show === true) {
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,
@ -493,7 +470,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({
@ -522,9 +499,8 @@ 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']);
@ -535,7 +511,7 @@ function layerClick() {
} }
} else { } else {
// //
zuowuClick(layers, cartographic, level, xy, movement); zuowuClick(layers, cartographic, level, xy, movement)
} }
} }
} }
@ -547,14 +523,17 @@ 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 ( if (Object.values(layersDic).findIndex(it => it === item._imageryProvider._layers) > -1) {
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,
@ -574,7 +553,9 @@ async function zuowuClick(layers, cartographic, level, xy, movement) {
'red' 'red'
); );
let info = data['0'].properties; let info = data['0'].properties;
const ind = newData.findIndex(ii => ii && ii.crop === info.crop); const ind = newData.findIndex(
ii => ii && ii.crop === info.crop
);
if (ind < 0) { if (ind < 0) {
newData.push(info); newData.push(info);
} }
@ -592,8 +573,12 @@ 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(6); let longitudeString = Cesium.Math.toDegrees(cartographic.longitude).toFixed(
let latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(6); 6
);
let latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(
6
);
clickInfoMap.value = { clickInfoMap.value = {
info: newData, info: newData,
// ...newData['0'], // ...newData['0'],
@ -664,11 +649,7 @@ 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 ( if (layers[f] && layers[f]._imageryProvider && layers[f]._imageryProvider.customName) {
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]);
@ -737,15 +718,11 @@ function showOverlayChart(position) {
// //
function getFarmland() { function getFarmland() {
axios({ axios({
url: url: serverAPI.geoserverUrl + '/shuzisannong/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=shuzisannong%3Afarmland&maxFeatures=50&outputFormat=application%2Fjson',
serverAPI.geoserverUrl + method: 'get'
'/shuzisannong/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=shuzisannong%3Afarmland&maxFeatures=50&outputFormat=application%2Fjson', }).then(res => {
method: 'get', console.log('农田:', res)
}) }).catch(err => { })
.then(res => {
console.log('农田:', res);
})
.catch(err => {});
} }
// //
const getArea = (item, index) => { const getArea = (item, index) => {
@ -785,7 +762,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 => {
@ -803,21 +780,15 @@ 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) {
@ -1031,63 +1002,33 @@ function areachar() {
function typesof() { function typesof() {
const typesofDivIntance = echarts.init(typesofDiv.value); const typesofDivIntance = echarts.init(typesofDiv.value);
let isSelected = ''; let selectedIndex = '';
let isHovered = '';
let hoveredIndex = ''; let hoveredIndex = '';
let option = getPie3D( let option = getPie3D(
[ [
{ {
name: '小麦', name: '水田',
value: 101, value: 60,
itemStyle: { itemStyle: {
opacity: 0.5, color: '#1890FF',
color: 'rgba(110, 209, 84, 0.9)',
}, },
}, },
{ {
// name: '水浇地',
name: '玉米', value: 44,
value: 56,
itemStyle: { itemStyle: {
// color: '#1EE7E7',
opacity: 0.5,
//
color: 'rgba(251, 201, 3, 1)',
},
label: {
show: true,
}, },
}, },
{ {
// name: '旱地',
name: '大豆', value: 32,
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) {
@ -1113,7 +1054,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 {
@ -1211,7 +1152,6 @@ 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;
@ -1234,68 +1174,29 @@ 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 `${ return `${params.seriesName
params.seriesName }<br/><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${params.color
}<br/><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${ };"></span>${option.series[params.seriesIndex].pieData.value}`;
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,
@ -1310,16 +1211,16 @@ function typesof() {
}, },
grid3D: { grid3D: {
show: false, show: false,
boxHeight: 10, boxHeight: 5,
top: '-10%', top: '-20%',
viewControl: { viewControl: {
// 3d // 3d
alpha: 35, alpha: 20,
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
@ -1346,7 +1247,8 @@ function typesof() {
} }
// bug // bug
// mouseover // mouseover
typesofDivIntance.on('mouseover', function (params) { option.title.text = option.series[0].name + ' ' + option.series[0].pieData.value;
function handleOver(params) {
// //
let isSelected; let isSelected;
let isHovered; let isHovered;
@ -1390,6 +1292,11 @@ 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;
@ -1415,15 +1322,17 @@ function typesof() {
// 使 option // 使 option
typesofDivIntance.setOption(option); typesofDivIntance.setOption(option);
} }
}
typesofDivIntance.on('mouseover', function (params) {
handleOver(params);
}); });
// bug function handleOut() {
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;
let k = option.series[hoveredIndex].pieStatus.k; 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
@ -1447,7 +1356,19 @@ 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);
@ -1455,146 +1376,322 @@ function typesof() {
// echarts // echarts
function farmland() { function farmland() {
const farmlandDivIntance = echarts.init(farmlandDiv.value); const farmlandDivIntance = echarts.init(farmlandDiv.value);
let option = { var option = {
// backgroundColor: '#333333', //
// tooltip: {},
grid: { grid: {
left: '3%', bottom: '8%',
right: '4%', left: '10%',
bottom: '3%', right: '6%',
top: '10%', top: '6%',
containLabel: true, containLabel: true,
}, },
legend: { dataZoom: [
show: true, {
top: '10', type: 'slider',
left: 'center', show: false,
textStyle: { color: 'rgba(255,255,255,.9)' }, zoomLock: true, //
itemWidth: 20, width: 8,
itemHeight: 12.5, yAxisIndex: [0],
icon: 'stack', bottom: 30,
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', type: 'value', // , 'value'
max: 500, //
show: false,
// 线
axisLine: {
show: false,
},
// 线
axisTick: { axisTick: {
show: false, show: false, //
},
splitLine: {
// 线线
show: false,
},
// axisLabel:{
// formatter:'{value}%'
// }
},
yAxis: {
type: 'category',
inverse: true,
splitLine: {
show: false,
},
axisTick: {
show: false,
}, },
// 线
axisLine: { axisLine: {
show: false, // 线
show: false, // 线
}, },
// 线
splitLine: {
show: false, // 线
},
//
axisLabel: { axisLabel: {
interval: 0, show: false, //
color: 'rgba(255, 255, 255, 1)',
fontSize: 14,
}, },
data: ['片区一', '片区二', '片区三', '片区四', '片区五','片区六','片区七'],
}, },
// Y
yAxis: [
// Y
{
// , 'category'
// data
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,
},
],
//
series: [ series: [
{ {
name: '小麦', type: 'bar', //
type: 'bar', name: '玉米', // , tooltip, legend
barWidth: 12, // stack
stack: 'stack', stack: '总量',
data: [160, 103, 155, 100, 50,122,98], barMaxWidth: 30, //
itemStyle: { //
normal: { label: {
barBorderRadius: 0, show: true,
color: new echarts.graphic.LinearGradient(0, 0, 0.9, 0, [ position: '玉米',
{ textStyle: {
offset: 1, fontSize: 12,
color: 'rgba(33, 187, 251, 0.9)', fontWeight: 'bolder',
color: 'rgba(255,255,255,1)',
}, },
},
//
itemStyle: {
barBorderRadius: [0, 0, 0, 0],
barBorderRadius: [0, 0, 0, 0], //
borderWidth: 1, //
borderColor: 'rgba(4, 247, 227, 0.8)', //
color: {
colorStops: [
{ {
offset: 0, offset: 0,
color: 'rgba(33, 187, 251, 0.05)', color: 'rgba(4, 247, 227, 0.9)', // 0%
}, },
]),
},
},
},
{
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.9)', color: 'rgba(4, 247, 227, 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], //
borderWidth: 1, //
borderColor: 'rgba(143, 186, 243, 0.8)', //
color: {
colorStops: [
{ {
offset: 0, offset: 0,
color: 'rgba(143, 186, 243, 0.05)', color: 'rgba(143, 186, 243, 0.9)', // 0%
}, },
]),
},
},
},
{
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, 1)', color: 'rgba(143, 186, 243, 0.3)', // 100%
},
],
},
},
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.05)', color: 'rgba(255, 225, 104, 0.9)', // 0%
}, },
]), {
offset: 1,
color: 'rgba(255, 225, 104, 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(33, 187, 251, 0.8)', //
color: {
colorStops: [
{
offset: 0,
color: 'rgba(33, 187, 251, 0.9)', // 0%
},
{
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() {
@ -1903,13 +2000,14 @@ 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>
@ -1946,11 +2044,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;
@ -1992,11 +2088,7 @@ $height: calc(100vh - 100px);
.typesofDiv { .typesofDiv {
width: 100%; width: 100%;
height: 397px; height: 267px;
background: url('@/assets/images/bj1_00000_iSpt.png');
background-repeat: no-repeat;
background-size: 85% 85%;
background-position: center;
} }
} }
} }
@ -2252,5 +2344,6 @@ $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>