This commit is contained in:
tianlong 2023-06-13 14:00:48 +08:00
parent 0b17a7ad2d
commit c2ce122a52
11 changed files with 394 additions and 397 deletions

View File

@ -1,6 +1,6 @@
window.serverAPI = {
baseUrl: "http://8.142.26.238:6901", //线上
// baseUrl: "http://192.168.2.46:8080", //本地
// baseUrl: "http://8.142.26.238:6901", //线上
baseUrl: "http://192.168.2.46:8080", //本地
// geoserver
geoserverUrl: "http://36.134.44.75:9080/geoserver",
username: "admin",

BIN
src/assets/images/shouhui.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
src/assets/images/zhankai.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1531,6 +1531,7 @@ function areachar() {
// start: 0,//0
// end: 100,//100
type: 'slider',
zoomLock: true, //
show: false,
// xAxisIndex: [0],
handleSize: 0, // 2

View File

@ -2241,6 +2241,13 @@ function areachar() {
distance: 10,
color: '#fff',
},
emphasis: {
itemStyle: {
// color: '#333FFF',
shadowBlur: 20, //
shadowColor: 'rgba(0, 147, 252, 1)', //
},
},
},
{
data: [1, 1, 1, 1, 1],
@ -3288,6 +3295,7 @@ function chartModes() {
{
type: 'slider',
width: '40%',
zoomLock: true, //
top: '90%',
start: 0,
end: ends,

View File

@ -246,9 +246,6 @@
<el-option label="花生" value="花生" /> -->
</el-select>
</el-form-item>
<el-form-item label="面积(亩)>">
<el-input-number v-model="num" :min="1" @change="handleChange" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
<el-button plain @click="resetForm" :disabled="!SwitchFlag ? true : false">
@ -277,28 +274,18 @@
>
<el-table-column align="center" prop="合计" width="80" />
<el-table-column
v-for="(item, index) in tableItem"
v-for="(item, index) in tableItemAll"
:key="index"
:prop="item.value"
:label="index == 0 ? item.lable : item.lable + '(亩)'"
:label="item.lable"
align="center"
/>
<el-table-column prop="address" v-if="operate" align="center" label="操作">
<template #default="scope">
<span
style="color: rgba(67, 181, 143, 1); cursor: pointer"
@click="download(scope.row)"
>
下载
</span>
</template>
</el-table-column>
</el-table>
</div>
<el-table
:data="tableNewData"
:header-cell-style="{ 'text-align': 'center' }"
height="70%"
height="80%"
highlight-current-row
header-row-class-name="tabth"
>
@ -313,19 +300,9 @@
v-for="(item, index) in tableItem"
:key="index"
:prop="item.value"
:label="index == 0 ? item.lable : item.lable + '(亩)'"
:label="item.lable"
align="center"
/>
<el-table-column prop="address" v-if="operate" align="center" label="操作">
<template #default="scope">
<span
style="color: rgba(67, 181, 143, 1); cursor: pointer"
@click="download(scope.row)"
>
下载
</span>
</template>
</el-table-column>
</el-table>
<div class="example-pagination-block">
{{ insectarr.length }}
@ -358,12 +335,14 @@ import {
getwheatGetAllTowns,
getwheatGetAllVillages,
getparameterEstimationYear,
getparameterEstimation
getparameterEstimation,
} from '@/api/crops/wheat.js';
import axios from 'axios';
import 'echarts-gl';
import { downLoadFile } from '@/utils/download.js';
import { useRouter } from 'vue-router';
const router = useRouter();
let viewer = ref(null);
const areaDiv = ref(null);
const farmlandDiv = ref(null);
@ -385,16 +364,14 @@ let currentPage = ref(1); //当前页
let pageSize = ref(12); //
let tableNewData = ref([]);
let tableItem = ref([]);
let tableItemAll = ref([]);
const num = ref(1);
let operate = ref(true);
const chartModeDiv = ref(null);
let amount = ref([
{
湿润: 0,
适宜: 0,
轻度干旱: 0,
中度干旱: 0,
重度干旱: 0,
wheatUnitOutputValue: 0,
wheatOutput: 0,
},
]);
//
@ -424,6 +401,10 @@ let areatext = '8383894';
//
onMounted(() => {
initonMounted();
});
function initonMounted() {
getwheatTotalYearValues(); //
getwheatHeightStandardFarmlands(); //
getwheatGetAllTownss(); //
@ -434,6 +415,13 @@ onMounted(() => {
// ProgressBar();
ASdivision();
getFarmland();
}
onUpdated(() => {
if (localStorage.getItem(router.currentRoute.value.path) == 'false') {
document.querySelector('.mode').innerText = '地图模式';
} else {
document.querySelector('.mode').innerText = '列表模式';
}
});
/*-------------地图------------------------*/
@ -895,7 +883,7 @@ const getparameterEstimationYears = () => {
console.log(res.data);
formInline.value.time = res.data[res.data.length - 1];
timeArr.value = res.data;
onSubmit()
onSubmit();
});
};
@ -987,6 +975,13 @@ const Deta3 = item => {
});
}
};
const dowcity = () => {
console.log(insectarr);
let arr = JSON.parse(JSON.stringify(amount.value[0]));
console.log(arr);
insectarr.value.push(arr);
exportExcel(insectarr.value, '干旱面积统计表', 'Sheet1');
};
const onSubmit = () => {
let arr = [];
@ -995,10 +990,9 @@ const onSubmit = () => {
getparameterEstimation({
year: formInline.value.time,
statistical: formInline.value.statistical,
type:formInline.value.droughtRating,
type: formInline.value.droughtRating,
area: formInline.value.area,
}).then(res => {
console.log(res.data)
tableItem.value = [
{
lable: '地区',
@ -1006,66 +1000,46 @@ const onSubmit = () => {
},
{
lable: '单产量(斤/亩)',
value: '适宜',
value: 'wheatUnitOutputValue',
},
{
lable: '总产量(吨)',
value: '湿润',
value: 'wheatOutput',
},
];
tableItemAll.value = [
{
lable: '',
value: 'subName',
},
{
lable: '单产量(斤/亩)',
value: 'wheatUnitOutputValue',
},
{
lable: '总产量(吨)',
value: 'wheatOutput',
},
];
res.data.forEach(item => {
if (arr.indexOf(item.region) == -1) {
arr.push(item.region);
}
});
arr.forEach(item => {
brr.push(
Object.create(null, {
regio: {
value: item,
},
})
);
});
brr.forEach(item => {
res.data.map(i => {
if (item.regio === i.region) {
item['region'] = i.region;
item[i.level] = Number(i.area).toFixed(2);
}
});
});
operate.value = false;
insectarr.value = brr;
tableNewData.value = brr.slice(
insectarr.value = res.data;
tableNewData.value = res.data.slice(
(currentPage.value - 1) * pageSize.value,
(currentPage.value - 1) * pageSize.value + pageSize.value
);
amount.value[0]['适宜'] = 0;
amount.value[0]['湿润'] = 0;
amount.value[0]['轻度干旱'] = 0;
amount.value[0]['中度干旱'] = 0;
amount.value[0]['重度干旱'] = 0;
amount.value[0]['region'] = '合计';
brr.forEach(item => {
item.适宜
? (amount.value[0]['适宜'] += Number(item.适宜) !== NaN ? Number(item.适宜) : 0)
amount.value[0]['wheatUnitOutputValue'] = 0;
amount.value[0]['wheatOutput'] = 0;
amount.value[0]['subName'] = '合计';
res.data.forEach(item => {
item.wheatUnitOutputValue
? (amount.value[0]['wheatUnitOutputValue'] +=
Number(item.wheatUnitOutputValue) !== NaN
? Number(item.wheatUnitOutputValue)
: 0)
: 0;
item.湿润
? (amount.value[0]['湿润'] += Number(item.湿润) !== NaN ? Number(item.湿润) : 0)
: 0;
item.轻度干旱
? (amount.value[0]['轻度干旱'] +=
Number(item.轻度干旱) !== NaN ? Number(item.轻度干旱) : 0)
: 0;
item.中度干旱
? (amount.value[0]['中度干旱'] +=
Number(item.中度干旱) !== NaN ? Number(item.中度干旱) : 0)
: 0;
item.重度干旱
? (amount.value[0]['重度干旱'] +=
Number(item.重度干旱) !== NaN ? Number(item.重度干旱) : 0)
item.wheatOutput
? (amount.value[0]['wheatOutput'] +=
Number(item.wheatOutput) !== NaN ? Number(item.wheatOutput) : 0)
: 0;
});
for (const key in amount.value[0]) {
@ -1074,6 +1048,7 @@ const onSubmit = () => {
amount.value[0][key] = amount.value[0][key].toFixed(2);
}
}
console.log(amount);
const statInfo = chartModeDiv.value; //
statInfo.style.width = window.innerWidth - 100 + 'px'; //echarts
statInfo.style.height = window.innerHeight - 100 + 'px';
@ -1738,58 +1713,60 @@ function ASdivision() {
function chartModes() {
const ASdivisionDivIntance = echarts.init(chartModeDiv.value);
let arr = [];
let 湿润 = [];
let 适宜 = [];
let 轻度干旱 = [];
let 中度干旱 = [];
let 重度干旱 = [];
let 单产量 = [];
let 总产量 = [];
insectarr.value.forEach(item => {
console.log(item.重度干旱);
arr.push(item.region);
item.湿润 !== undefined ? 湿润.push(item.湿润) : 湿润.push(0);
item.适宜 !== undefined ? 适宜.push(item.适宜) : 适宜.push(0);
item.轻度干旱 !== undefined ? 轻度干旱.push(item.轻度干旱) : 轻度干旱.push(0);
item.中度干旱 !== undefined ? 中度干旱.push(item.中度干旱) : 中度干旱.push(0);
item.重度干旱 !== undefined ? 重度干旱.push(item.重度干旱) : 重度干旱.push(0);
arr.push(item.subName);
item.wheatUnitOutputValue !== undefined
? 单产量.push(item.wheatUnitOutputValue)
: 单产量.push(0);
item.wheatOutput !== undefined ? 总产量.push(item.wheatOutput) : 总产量.push(0);
});
let ends = (10 / arr.length) * 100;
let option = {
// backgroundColor: 'rgba(5, 38, 75, 0.1)',
color: ['rgba(4, 247, 227, 1)', 'rgba(33, 187, 251, 1)'],
tooltip: {
trigger: 'axis',
formatter: function (params) {
let tipStr = params[0].axisValueLabel + '</br>';
let totalNum = 0;
for (let i = 0; i < params.length; i++) {
totalNum += params[i].value;
if (params[i].seriesName !== '合计') {
tipStr += params[i].seriesName + '' + params[i].value + '</br>';
formatter: function (params, ticket, callback) {
var res = params[0].name;
for (var i = 0, l = params.length; i < l; i++) {
if (params[i].seriesType === 'line') {
res +=
'<br/>' +
params[i].seriesName +
' : ' +
(params[i].value ? params[i].value : '-') +
'h';
} else {
res +=
'<br/>' +
params[i].seriesName +
' : ' +
(params[i].value ? params[i].value : '-');
}
}
for (let i = 0; i < params.length; i++) {
totalNum += Number(params[i].value);
if (params[i].seriesName === '合计') {
tipStr += '合计:' + totalNum;
}
}
return tipStr;
},
axisPointer: {
//
type: 'shadow', // 线'line' | 'shadow'
return res;
},
},
legend: {
top: 5,
left: 10,
icon: 'rect',
itemWidth: 4, //
itemHeight: 12, //
data: [],
grid: {
top: '15%',
bottom: '15%',
},
// legend: {
// data: ['', ''],
// textStyle: {
// color: '#fff',
// fontSize: 12,
// },
// type: 'scroll',
// },
dataZoom: [
{
type: 'slider',
width: '40%',
zoomLock: true,
top: '90%',
start: 0,
end: ends,
@ -1812,142 +1789,101 @@ function chartModes() {
type: 'inside',
},
],
grid: {
left: '3%',
right: '10%',
bottom: '15%',
top: '5%',
containLabel: true,
},
xAxis: {
type: 'category',
name: '区域',
axisLabel: {
fontSize: 12,
interval: 0,
rotate: 0,
},
axisLine: {
lineStyle: {
// color: '#cbeaf6', // x线
},
},
data: arr,
},
yAxis: [
xAxis: [
{
type: 'value',
name: '面积(亩)',
type: 'category',
nameTextStyle: {
fontSize: 12,
},
axisLabel: {
// color: '#cbeaf6', // label
fontSize: 14,
relativeSize: -2,
},
splitLine: {
show: false,
},
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
// color: '#cbeaf6', // y线
color: 'rgba(102, 102, 102, 1)',
},
},
axisPointer: {
type: 'shadow',
},
data: arr,
},
],
yAxis: [
{
type: 'value',
name: '单产量(斤/亩)',
splitLine: {
// 线
show: true,
lineStyle: {
// type: 'dashed', // 线 dotted线 solid:线
// color: '#395367',
type: 'dashed',
},
},
nameTextStyle: {
fontSize: 12,
},
axisLabel: {
fontSize: 14,
relativeSize: -2,
formatter: '{value}',
},
axisLine: {
lineStyle: {
color: 'rgba(102, 102, 102, 1)',
},
},
min: 0,
position: 'top',
},
{
type: 'value',
name: '总产量(吨)',
min: 0,
position: 'bottom',
splitLine: {
show: false,
},
nameTextStyle: {
fontSize: 12,
},
axisLabel: {
fontSize: 14,
relativeSize: -2,
formatter: '{value}',
},
axisLine: {
lineStyle: {
color: 'rgba(102, 102, 102, 1)',
},
show: true, //
},
},
],
series: [
{
name: '湿润',
name: '单产量(斤/亩)',
type: 'bar',
barWidth: 13,
stack: '分类',
itemStyle: {
color: 'rgba(255, 141, 26, 1)',
},
data: 湿润,
yAxisIndex: 0,
data: 单产量,
},
{
name: '适宜',
name: '总产量(吨)',
type: 'bar',
barWidth: 13,
stack: '分类',
itemStyle: {
color: 'rgba(255, 255, 26, 1)',
},
data: 适宜,
},
{
name: '轻度干旱',
type: 'bar',
barWidth: 13,
stack: '分类',
itemStyle: {
color: 'rgba(255, 201, 148, 1)',
},
data: 轻度干旱,
},
{
name: '中度干旱',
type: 'bar',
barWidth: 13,
stack: '分类',
itemStyle: {
color: 'rgba(255, 84, 84, 1)',
},
data: 中度干旱,
},
{
name: '重度干旱',
type: 'bar',
barWidth: 13,
stack: '分类',
itemStyle: {
color: 'rgba(255, 140, 255, 1)',
},
data: 重度干旱,
yAxisIndex: 1,
data: 总产量,
},
],
};
var series = option.series;
var tooltip = option.tooltip;
//
function formatFun(params) {
// console.log('params====>', params)
let tipStr = params[0].axisValueLabel + '</br>'; //
let totalNum = 0; //
// params labelvalue
for (let i = 0; i < params.length; i++) {
if (params[i].seriesName !== '合计') {
const dotHtml = `<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}"></span>`;
totalNum += params[i].value;
tipStr += dotHtml + params[i].seriesName + '' + params[i].value + '</br>';
}
}
//
for (let i = 0; i < params.length; i++) {
if (params[i].seriesName === '合计') {
tipStr += '合计:' + totalNum;
}
}
return tipStr;
}
tooltip.formatter = formatFun;
//
function fun(params) {
var dataSum = 0;
for (var i = 0; i < series.length; i++) {
dataSum += series[i].data[params.dataIndex];
}
return dataSum;
}
// seriesformatter
// series[series.length - 1].label.normal.formatter = fun;
useEcharts(ASdivisionDivIntance, option);
}
/*--------------------------------------------------------------------------------------------*/
function getAreaFenlei() {
let fl = fenleiRef.value;

View File

@ -289,7 +289,7 @@
:data="tableNewData"
:header-cell-style="{ 'text-align': 'center' }"
:cell-style="{ 'text-align': 'center' }"
height="70%"
height="80%"
highlight-current-row
header-row-class-name="tabth"
>
@ -512,7 +512,6 @@ function initonMounted() {
}
onUpdated(() => {
console.log(localStorage.getItem(router.currentRoute.value.path));
if (localStorage.getItem(router.currentRoute.value.path) == 'false') {
document.querySelector('.mode').innerText = '地图模式';
} else {
@ -1507,6 +1506,7 @@ const Deta4 = item => {
getadministrativeDivisions({ divisions: value.value, whetherToDownload: false }).then(
res => {
res.data.forEach(item => {
console.log(item)
arr.push({
region: item.subregionName,
good: item.good,
@ -1534,9 +1534,7 @@ const dowcity = () => {
const changeTableHead = (tableData, fieldName) => {
const list = tableData.map(item => {
const obj = {};
console.log(item);
for (const k in item) {
console.log(k);
if (fieldName[k]) {
obj[fieldName[k]] = item[k];
}
@ -1678,6 +1676,7 @@ function areachar() {
//
{
show: zoomShow,
zoomLock: true, //
type: 'slider',
realtime: true,
startValue: 0,
@ -2569,6 +2568,7 @@ function chartModes() {
type: 'slider',
width: '40%',
top: '90%',
zoomLock: true, //
start: 0,
end: ends,
showDataShadow: false,

View File

@ -1147,7 +1147,7 @@
<el-tab-pane label="全部" name="全部"></el-tab-pane>
<el-tab-pane label="智能孢子仪" name="智能孢子仪" />
<el-tab-pane label="虫情监测仪" name="虫情监测仪" />
<el-tab-pane label="土壤土质" name="土壤土质" />
<el-tab-pane label="土壤墒情、土质" name="土壤墒情、土质" />
</el-tabs>
<div class="tabulationCente">
<div class="left">
@ -1201,15 +1201,15 @@
:header-cell-style="{ 'text-align': 'center' }"
:cell-style="{ 'text-align': 'center' }"
header-row-class-name="tabth"
height="90%"
height="80%"
highlight-current-row
>
<el-table-column fixed="left" width="160" label="监测时间">
<template #default="scope">
<span v-if="label3 == '土壤土质'">
<span v-if="label3 == '土壤墒情、土质'">
{{ scope.row.dataTime }}
</span>
<span v-if="label3 !== '土壤土质'">
<span v-if="label3 !== '土壤墒情、土质'">
{{ scope.row.pictureTime }}
</span>
</template>
@ -1262,9 +1262,9 @@
{{ scope.row.warning }}
</span>
</div>
<div v-if="label3 == '土壤土质'">
<div v-if="label3 == '土壤墒情、土质'">
<span
v-if="scope.row.style == item.value"
v-if="scope.row.style.includes(item.value)"
style="color: red"
>
{{ scope.row[item.value] }}
@ -1299,7 +1299,7 @@
</div>
</div>
<div v-show="!SwitchFlag" class="chartMode">
<div v-if="label3 == '土壤土质'" class="depth">
<div v-if="label3 == '土壤墒情、土质'" class="depth">
<p
:class="active == '1' ? 'SelectedDiv' : ''"
@click="depthclick(1)"
@ -1332,11 +1332,11 @@
</p>
</div>
<div
v-show="label3 == '土壤土质'"
v-show="label3 == '土壤墒情、土质'"
ref="chartModeDiv"
class="chartModeDiv"
></div>
<div class="tableBoxs" v-if="label3 !== '土壤土质'">
<div class="tableBoxs" v-if="label3 !== '土壤墒情、土质'">
<div class="insectDiv">
<el-row class="gutters" :gutter="40">
<el-col
@ -1385,7 +1385,9 @@
style="color: red"
v-if="item.warning == '有'"
>
{{ item.pestName }}
{{
`${item.pestName}:${item.recognition}`
}}
</span>
<span
@ -1416,8 +1418,12 @@
</div>
<div class="centent">
<div class="arrow" @click="foldClick">
<span v-if="!flags"></span>
<span v-if="flags"></span>
<p v-if="!flags">
<img style="width: 300%" src="@/assets/images/shouhui.png" />
</p>
<p v-if="flags">
<img style="width: 300%" src="@/assets/images/zhankai.png" />
</p>
</div>
</div>
<div v-show="!flags" class="cesiumContainersDiv">
@ -1461,7 +1467,7 @@
width="35%"
:before-close="handleClose"
>
<div v-if="label3 !== '土壤土质'" class="rowContent">
<div v-if="label3 !== '土壤墒情、土质'" class="rowContent">
<div class="rowContentTop">
<div class="rowContentchildren">
<p>
@ -1490,7 +1496,7 @@
</div>
</div>
<image-preview
v-if="label3 !== '土壤土质'"
v-if="label3 !== '土壤墒情、土质'"
append-to-body
:src="`${DetailArr.picturePath}`"
:zoom-rate="1.2"
@ -1501,7 +1507,7 @@
</div>
</image-preview>
</div>
<div class="rowContent_bottom" v-if="label3 == '土壤土质'">
<div class="rowContent_bottom" v-if="label3 == '土壤墒情、土质'">
<div class="rowContentTop">
<div class="rowContentchildren">
<p>
@ -1531,10 +1537,15 @@
<span>{{ DetailArr.dataTime }}</span>
</div>
<div v-if="DetailArr.warning == '有'">
<span style="font-size: 16px; font-weight: 00">
{{ dictionary[DetailArr.style] }} :
<span
v-for="(item, index) in DetailArr.style"
:key="index"
style="font-size: 16px; font-weight: 00"
>
&emsp;
{{ dictionary[item] }} :
<span style="color: red; font-size: 18px; font-weight: 700">
{{ DetailArr[DetailArr.style] }}
{{ DetailArr[item] }}
</span>
</span>
</div>
@ -1903,6 +1914,7 @@ let map = L.Map;
const router = useRouter();
const visible = ref(false); //
const visibles = ref(false); //
const url = '@/assets/images/shouhui.png';
let flags = ref(false);
const visibless = ref(false);
let dialogTableVisible = ref(false);
@ -2026,13 +2038,13 @@ const treeData = [
],
},
{
label: '土壤土质',
label: '土壤墒情、土质',
children: [
{
label: '土壤土质监测仪001',
label: '土壤墒情、土质监测仪001',
},
{
label: '土壤土质监测仪002',
label: '土壤墒情、土质监测仪002',
},
],
},
@ -2549,13 +2561,14 @@ const SwitchMode = () => {
const statInfo = chartModeDiv.value; //
statInfo.style.width = document.querySelector('.chartModeFather').offsetWidth + 'px'; //echarts
statInfo.style.height = document.querySelector('.chartModeFather').offsetHeight - 50 + 'px';
statInfo.style.height = document.querySelector('.chartModeFather').offsetHeight - 100 + 'px';
console.log(document.querySelector('.chartModeFather').offsetWidth);
const myChart = echarts.init(statInfo);
//
window.addEventListener('resize', () => {
statInfo.style.width = document.querySelector('.chartModeFather').offsetWidth + 'px';
statInfo.style.height = document.querySelector('.chartModeFather').offsetHeight - 50 + 'px';
statInfo.style.height =
document.querySelector('.chartModeFather').offsetHeight - 100 + 'px';
myChart.resize();
});
chartModes();
@ -2594,7 +2607,12 @@ const handleNodeClick = (data, node, data1, data2) => {
// Entity
res.data.forEach((item, index) => {
L.marker([item.msLatitude, item.msLongitude]).addTo(map).bindPopup(`<b>智能孢子仪</b><br><br>经度:${item.msLongitude}<br><br>纬度:${item.msLatitude}`).openPopup();
L.marker([item.msLatitude, item.msLongitude])
.addTo(map)
.bindPopup(
`<b>智能孢子仪</b><br><br>经度:${item.msLongitude}<br><br>纬度:${item.msLatitude}`
)
.openPopup();
});
});
} else if (label3.value == '虫情监测仪') {
@ -2625,21 +2643,29 @@ const handleNodeClick = (data, node, data1, data2) => {
townZuowu.label = res.data;
// Entity
res.data.forEach((item, index) => {
L.marker([item.msLatitude, item.msLongitude]).addTo(map).bindPopup(`<b>虫情监测仪</b><br><br>经度:${item.msLongitude}<br><br>纬度:${item.msLatitude}`).openPopup();
L.marker([item.msLatitude, item.msLongitude])
.addTo(map)
.bindPopup(
`<b>虫情监测仪</b><br><br>经度:${item.msLongitude}<br><br>纬度:${item.msLatitude}`
)
.openPopup();
});
});
} else if (label3.value == '土壤土质') {
} else if (label3.value == '土壤墒情、土质') {
getfindAllSoil({ equipment: label2.value }).then(res => {
tabulation.value = res.data;
res.data.forEach(item => {
item['style'] = [];
if (item.warning == '有') {
for (const key in item.limitExceeded[0]) {
if (key !== 'eqSoilId') {
if (item.limitExceeded[0][key] != null) {
item['style'] = key;
item.limitExceeded.forEach(i => {
for (const key in i) {
if (key !== 'eqSoilId') {
if (i[key] != null) {
item['style'].push(key);
}
}
}
}
});
}
});
tableNewData.value = res.data.slice(
@ -2647,6 +2673,7 @@ const handleNodeClick = (data, node, data1, data2) => {
(tabulationcurrentPage.value - 1) * tabulationpageSize.value +
tabulationpageSize.value
);
console.log(tableNewData.value);
tableItem.value = [
{
lable: '0cm湿度(%)',
@ -2704,25 +2731,14 @@ const handleNodeClick = (data, node, data1, data2) => {
getequipmentCondition().then(res => {
townZuowu.label = res.data;
// Entity
// res.data.forEach((item, index) => {
// viewers.entities.add({
// name: item.dev_code,
// position: Cesium.Cartesian3.fromDegrees(
// parseFloat(item.msLongitude),
// parseFloat(item.msLatitude)
// ),
// billboard: {
// image: tu,
// scale: 0.9,
// width: 35,
// height: 35,
// disableDepthTestDistance: Number.POSITIVE_INFINITY, //广
// // heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND
// heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, //HeightReferenceCLAMP_TO_GROUND
// },
// });
// angle(item);
// });
res.data.forEach((item, index) => {
L.marker([item.msLatitude, item.msLongitude])
.addTo(map)
.bindPopup(
`<b>土壤墒情、土质</b><br><br>经度:${item.msLongitude}<br><br>纬度:${item.msLatitude}`
)
.openPopup();
});
});
}
}
@ -2778,6 +2794,11 @@ const onSubmit = () => {
early: formInline.value.flag,
equipment: label2.value,
}).then(res => {
res.data.forEach(item => {
if (item.warning == '有') {
item.pestName = item.picturesMark2O1List[0].pestName;
}
});
tabulation.value = res.data;
tableNewData.value = res.data.slice(
(tabulationcurrentPage.value - 1) * tabulationpageSize.value,
@ -2785,7 +2806,7 @@ const onSubmit = () => {
tabulationpageSize.value
);
});
} else if (label3.value == '土壤土质') {
} else if (label3.value == '土壤墒情、土质') {
EcTimeArr.value = [];
EcArr.value = [];
PhArr.value = [];
@ -2810,14 +2831,17 @@ const onSubmit = () => {
equipment: label2.value,
}).then(res => {
res.data.forEach(item => {
item['style'] = [];
if (item.warning == '有') {
for (const key in item.limitExceeded[0]) {
if (key !== 'eqSoilId') {
if (item.limitExceeded[0][key] != null) {
item['style'] = key;
item.limitExceeded.forEach(i => {
for (const key in i) {
if (key !== 'eqSoilId') {
if (i[key] != null) {
item['style'].push(key);
}
}
}
}
});
}
});
tabulation.value = res.data;
@ -2846,14 +2870,14 @@ const onSubmit = () => {
const statInfo = chartModeDiv.value; //
statInfo.style.width = document.querySelector('.chartModeFather').offsetWidth + 'px'; //echarts
statInfo.style.height =
document.querySelector('.chartModeFather').offsetHeight - 50 + 'px';
document.querySelector('.chartModeFather').offsetHeight - 100 + 'px';
const myChart = echarts.init(statInfo);
//
window.addEventListener('resize', () => {
statInfo.style.width =
document.querySelector('.chartModeFather').offsetWidth + 'px';
statInfo.style.height =
document.querySelector('.chartModeFather').offsetHeight - 50 + 'px';
document.querySelector('.chartModeFather').offsetHeight - 100 + 'px';
myChart.resize();
});
chartModes();
@ -2876,7 +2900,7 @@ const onDetail = row => {
DetailArr['pestName'] = row.picturesMark2O1List[0].pestName;
}
let arr = [];
if (label3 == '土壤土质') {
if (label3 == '土壤墒情、土质') {
console.log(DetailArr.limitExceeded);
}
console.log(DetailArr);
@ -2909,17 +2933,20 @@ const cellClick = (row, column, cell, event) => {
//tabs
const foldClick = () => {
flags.value = !flags.value;
const statInfo = chartModeDiv.value; //
statInfo.style.width = document.querySelector('.chartModeFather').offsetWidth + 'px'; //echarts
statInfo.style.height = document.querySelector('.chartModeFather').offsetHeight - 50 + 'px';
const myChart = echarts.init(statInfo);
//
window.addEventListener('resize', () => {
statInfo.style.width = document.querySelector('.chartModeFather').offsetWidth + 'px';
setTimeout(() => {
const statInfo = chartModeDiv.value; //
statInfo.style.width = document.querySelector('.chartModeFather').offsetWidth + 'px'; //echarts
statInfo.style.height = document.querySelector('.chartModeFather').offsetHeight - 50 + 'px';
myChart.resize();
});
chartModes();
const myChart = echarts.init(statInfo);
//
window.addEventListener('resize', () => {
statInfo.style.width = document.querySelector('.chartModeFather').offsetWidth + 'px';
statInfo.style.height =
document.querySelector('.chartModeFather').offsetHeight - 50 + 'px';
myChart.resize();
});
chartModes();
}, 20);
};
//
@ -3061,6 +3088,11 @@ const resetForm = () => {
});
} else if (label3.value == '虫情监测仪') {
getinsect({ equipment: label2.value }).then(res => {
res.data.forEach(item => {
if (item.warning == '有') {
item.pestName = item.picturesMark2O1List[0].pestName;
}
});
tabulation.value = res.data;
tableNewData.value = res.data.slice(
(tabulationcurrentPage.value - 1) * tabulationpageSize.value,
@ -3068,7 +3100,7 @@ const resetForm = () => {
tabulationpageSize.value
);
});
} else if (label3.value == '土壤土质') {
} else if (label3.value == '土壤墒情、土质') {
getfindAllSoil({ equipment: label2.value }).then(res => {
tabulation.value = res.data;
tableNewData.value = res.data.slice(
@ -3182,11 +3214,11 @@ const bugarrsVisible = () => {
const bugarrsVisibles = () => {
currentPage.value = 1;
visibles.value = true;
getinsects();
(value1.value = ''), (value2.value = ''), (deviceValue.value = '');
detectionLightsEquipment().then(res => {
options.value = res.data;
});
// getinsects();
// detectionLightsEquipment().then(res => {
// options.value = res.data;
// });
getinsect().then(res => {
currentPage.value = 1;
bugarr.value = res.data;
@ -3404,7 +3436,7 @@ const handleClick = (tab, event) => {
},
];
getdeviceNumbers('2'); //
} else if (tab.paneName == '土壤土质') {
} else if (tab.paneName == '土壤墒情、土质') {
tableItem.value = [
{
lable: '0cm湿度(%)',
@ -3485,73 +3517,40 @@ const getdeviceNumbers = num => {
getsporeEquipmentCondition().then(res => {
townZuowu.label = res.data;
// Entity
// res.data.forEach((item, index) => {
// viewers.entities.add({
// name: item.dev_code,
// position: Cesium.Cartesian3.fromDegrees(
// parseFloat(item.msLongitude),
// parseFloat(item.msLatitude)
// ),
// billboard: {
// image: chong,
// scale: 0.9,
// width: 35,
// height: 35,
// disableDepthTestDistance: Number.POSITIVE_INFINITY, //广
// // heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND
// heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, //HeightReferenceCLAMP_TO_GROUND
// },
// });
// angle(item);
// });
res.data.forEach((item, index) => {
L.marker([item.msLatitude, item.msLongitude])
.addTo(map)
.bindPopup(
`<b>智能孢子仪</b><br><br>经度:${item.msLongitude}<br><br>纬度:${item.msLatitude}`
)
.openPopup();
});
});
} else if (num == 2) {
geteqLightEquipmentCondition().then(res => {
townZuowu.label = res.data;
// Entity
res.data.forEach((item, index) => {
viewers.entities.add({
name: item.dev_code,
position: Cesium.Cartesian3.fromDegrees(
parseFloat(item.msLongitude),
parseFloat(item.msLatitude)
),
billboard: {
image: baozi,
scale: 0.9,
width: 35,
height: 35,
disableDepthTestDistance: Number.POSITIVE_INFINITY, //广
// heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, //HeightReferenceCLAMP_TO_GROUND
},
});
angle(item);
L.marker([item.msLatitude, item.msLongitude])
.addTo(map)
.bindPopup(
`<b>虫情监测仪</b><br><br>经度:${item.msLongitude}<br><br>纬度:${item.msLatitude}`
)
.openPopup();
});
});
} else if (num == 3) {
getequipmentCondition().then(res => {
townZuowu.label = res.data;
// Entity
// res.data.forEach((item, index) => {
// viewers.entities.add({
// name: item.dev_code,
// position: Cesium.Cartesian3.fromDegrees(
// parseFloat(item.msLongitude),
// parseFloat(item.msLatitude)
// ),
// billboard: {
// image: tu,
// scale: 0.9,
// width: 35,
// height: 35,
// disableDepthTestDistance: Number.POSITIVE_INFINITY, //广
// // heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND
// heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, //HeightReferenceCLAMP_TO_GROUND
// },
// });
// angle(item);
// });
res.data.forEach((item, index) => {
L.marker([item.msLatitude, item.msLongitude])
.addTo(map)
.bindPopup(
`<b>土壤墒情、土质</b><br><br>经度:${item.msLongitude}<br><br>纬度:${item.msLatitude}`
)
.openPopup();
});
});
}
});
@ -3700,7 +3699,6 @@ const geteqLightEquipmentConditions = () => {
}
geteqLightEquipmentCondition().then(res => {
townZuowu.label = res.data;
// Entity
res.data.forEach((item, index) => {
viewer.entities.add({
@ -3801,6 +3799,7 @@ function farmland() {
// end: 100,//100
type: 'slider',
show: false,
zoomLock: true, //
// xAxisIndex: [0],
handleSize: 0, // 2
startValue: 0, //
@ -3997,6 +3996,7 @@ function Ph() {
// start: 0,//0
// end: 100,//100
type: 'slider',
zoomLock: true, //
show: false,
// xAxisIndex: [0],
handleSize: 0, // 2
@ -4171,6 +4171,7 @@ function soil() {
// start: 0,//0
// end: 100,//100
type: 'slider',
zoomLock: true, //
show: false,
// xAxisIndex: [0],
handleSize: 0, // 2
@ -4370,6 +4371,7 @@ function chartModes() {
{
type: 'slider',
width: '40%',
zoomLock: true,
top: '90%',
start: 0,
end: ends,
@ -5075,14 +5077,15 @@ $height: calc(100vh - 110px);
width: 20px;
height: 100%;
position: relative;
z-index: 99;
.arrow {
width: 22px;
height: 22px;
// background: #ccc;
position: absolute;
top: 50%;
transform: translate(10%, -50%);
z-index: 1;
transform: translate(-80%, -50%);
z-index: 99;
border-radius: 50%;
cursor: pointer;
}
@ -5258,10 +5261,10 @@ $height: calc(100vh - 110px);
}
}
}
// .chartModeDiv {
// width: 100%;
// height: 100%;
// }
.chartModeDiv {
width: 100%;
height: 50%;
}
.depth {
width: 50%;
height: 26px;

View File

@ -1762,6 +1762,7 @@ function chartModes() {
width: '40%',
top: '90%',
start: 0,
zoomLock: true, //
end: ends,
showDataShadow: false,
showDetail: false,
@ -1795,7 +1796,7 @@ function chartModes() {
axisLabel: {
fontSize: 12,
interval: 0,
rotate: 40,
rotate: 0,
},
axisLine: {
lineStyle: {

View File

@ -283,14 +283,28 @@
:prop="item.value"
:label="index == 0 ? item.lable : item.lable + '(亩)'"
align="center"
/>
<el-table-column prop="address" v-if="operate" align="center" label="操作">
>
<template #default="scope">
<span
style="color: rgba(67, 181, 143, 1); cursor: pointer"
@click="download(scope.row)"
style="color: rgba(234, 165, 93, 0.8); font-weight: 600"
v-if="item.value == '轻度干旱'"
>
下载
{{ scope.row[item.value] }}
</span>
<span
style="color: rgba(205, 92, 92, 1); font-weight: 700"
v-else-if="item.value == '中度干旱'"
>
{{ scope.row[item.value] }}
</span>
<span
style="color: red; font-weight: 800"
v-else-if="item.value == '重度干旱'"
>
{{ scope.row[item.value] }}
</span>
<span v-else>
{{ scope.row[item.value] }}
</span>
</template>
</el-table-column>
@ -299,7 +313,7 @@
<el-table
:data="tableNewData"
:header-cell-style="{ 'text-align': 'center' }"
height="70%"
height="80%"
highlight-current-row
header-row-class-name="tabth"
>
@ -316,14 +330,28 @@
:prop="item.value"
:label="index == 0 ? item.lable : item.lable + '(亩)'"
align="center"
/>
<el-table-column prop="address" v-if="operate" align="center" label="操作">
>
<template #default="scope">
<span
style="color: rgba(67, 181, 143, 1); cursor: pointer"
@click="download(scope.row)"
style="color: rgba(234, 165, 93, 0.8); font-weight: 600"
v-if="item.value == '轻度干旱'"
>
下载
{{ scope.row[item.value] }}
</span>
<span
style="color: rgba(205, 92, 92, 1); font-weight: 700"
v-else-if="item.value == '中度干旱'"
>
{{ scope.row[item.value] }}
</span>
<span
style="color: red; font-weight: 800"
v-else-if="item.value == '重度干旱'"
>
{{ scope.row[item.value] }}
</span>
<span v-else>
{{ scope.row[item.value] }}
</span>
</template>
</el-table-column>
@ -464,7 +492,7 @@ let layersDic = {
//
onMounted(() => {
initonMounted()
initonMounted();
});
function initonMounted() {
@ -494,7 +522,13 @@ function initonMounted() {
rightWra.style.transform = 'translate(107%,0)';
localStorage.setItem(router.currentRoute.value.path, true);
}
onUpdated(() => {
if (localStorage.getItem(router.currentRoute.value.path) == 'false') {
document.querySelector('.mode').innerText = '地图模式';
} else {
document.querySelector('.mode').innerText = '列表模式';
}
});
/*-------------地图------------------------*/
const mapOption = {
@ -1354,6 +1388,13 @@ const getTownships = city => {
};
//
const getadministratives = city => {
dd = {
适宜: [],
湿润: [],
轻度干旱: [],
中度干旱: [],
重度干旱: [],
};
getadministrative({ divisions: city }).then(res => {
Township.brr = res.data;
let arr = [...res.data];
@ -1364,7 +1405,6 @@ const getadministratives = city => {
}
});
data.title = [...Object.values(brr)];
console.log(res);
data.title.forEach((item, index) => {
let town = res.data.map(i => {
if (item === i.streetName) {
@ -1372,7 +1412,7 @@ const getadministratives = city => {
}
});
Object.keys(dd).forEach(it => {
const index = town.findIndex(a => a && a.type === it);
const index = town.findIndex(a => a && a.type === it && a.area > 0);
if (index > -1) {
dd[it].push(1);
} else {
@ -1534,7 +1574,7 @@ const Deta4 = item => {
region = item.subregionName == '全部' ? '黄岛区' : item.subregionName;
}
});
getTownship({ divisions: value.value}).then(res => {
getTownship({ divisions: value.value }).then(res => {
let arr = [];
let brr = [];
res.data.forEach(item => {
@ -2733,6 +2773,7 @@ function chartModes() {
type: 'slider',
width: '40%',
top: '90%',
zoomLock: true, //
start: 0,
end: ends,
showDataShadow: false,
@ -3001,7 +3042,7 @@ $height: calc(100vh - 100px);
float: right;
margin-right: 10px;
}
:deep(.el-input__wrapper){
:deep(.el-input__wrapper) {
width: 100px;
}
.modeDiv {
@ -3062,7 +3103,7 @@ $height: calc(100vh - 100px);
width: 100%;
display: flex;
flex-direction: column;
height:40%;
height: 40%;
.areaDiv {
width: 100%;
height: 327px;

View File

@ -1310,6 +1310,12 @@ const getTownships = city => {
};
//
const getadministratives = city => {
dd = {
无冻害: [],
轻度冻害: [],
中度冻害: [],
重度冻害: [],
};
getadministrative({ divisions: city }).then(res => {
Township.brr = res.data;
let arr = [...res.data];
@ -1328,7 +1334,7 @@ const getadministratives = city => {
}
});
Object.keys(dd).forEach(it => {
const index = town.findIndex(a => a && a.type === it);
const index = town.findIndex(a => a && a.type === it && a.area > 0);
if (index > -1) {
dd[it].push(1);
} else {
@ -2066,6 +2072,7 @@ function chartModes() {
type: 'slider',
width: '40%',
top: '90%',
zoomLock: true, //
start: 0,
end: ends,
showDataShadow: false,
@ -2108,7 +2115,7 @@ function chartModes() {
axisLabel: {
fontSize: 12,
interval: 0,
rotate: 40,
rotate: 0,
},
axisLine: {
lineStyle: {