This commit is contained in:
2023-07-26 17:29:34 +08:00
parent 5bc7e7c3d1
commit 7a43f39ec8
278 changed files with 981 additions and 541 deletions

View File

@ -93,7 +93,7 @@
</div>
<div ref="farmlandDiv" class="farmlandDiv"></div>
<div v-if="!limits">
<img src='@/assets/images/qx.png' />
<img src="@/assets/images/qx.png" />
</div>
</div>
<div class="rightbottom">
@ -473,7 +473,7 @@ watch(
}
gethighStandards(oldDatas.value.name); //高标准农田
let str = oldDatas.value.name;
let str1 = str.replace(/-/g, '_');
let str1 = str && str.replace(/-/g, '_');
layersDic = {
小麦: {
setOf: `${oldDatas.value.name}-nongzuowufenlei`,
@ -985,34 +985,34 @@ let dic = ref({
});
// 图层字典
let layersDic = {
玉米: {
setOf: '2022-10-01-nongzuowufenlei',
name: 'T2022_10_01_yumi',
},
大豆: {
setOf: '2022-10-01-nongzuowufenlei',
name: 'T2022_10_01_dadou',
},
地瓜: {
setOf: '2022-10-01-nongzuowufenlei',
name: 'T2022_10_01_digua',
},
花生: {
setOf: '2022-10-01-nongzuowufenlei',
name: 'T2022_10_01_huasheng',
},
蓝莓: {
setOf: '2022-10-01-nongzuowufenlei',
name: 'T2022_10_01_lanmei',
},
茶叶: {
setOf: '2022-10-01-nongzuowufenlei',
name: 'T2022_10_01_chaye',
},
其他: {
setOf: '2022-10-01-nongzuowufenlei',
name: 'T2022_10_01_qitanongzuowu',
},
// 玉米: {
// setOf: '2022-10-01-nongzuowufenlei',
// name: 'T2022_10_01_yumi',
// },
// 大豆: {
// setOf: '2022-10-01-nongzuowufenlei',
// name: 'T2022_10_01_dadou',
// },
// 地瓜: {
// setOf: '2022-10-01-nongzuowufenlei',
// name: 'T2022_10_01_digua',
// },
// 花生: {
// setOf: '2022-10-01-nongzuowufenlei',
// name: 'T2022_10_01_huasheng',
// },
// 蓝莓: {
// setOf: '2022-10-01-nongzuowufenlei',
// name: 'T2022_10_01_lanmei',
// },
// 茶叶: {
// setOf: '2022-10-01-nongzuowufenlei',
// name: 'T2022_10_01_chaye',
// },
// 其他: {
// setOf: '2022-10-01-nongzuowufenlei',
// name: 'T2022_10_01_qitanongzuowu',
// },
};
// 图层字典
let dictionary = {
@ -1198,7 +1198,6 @@ function initonMounted() {
showDaChangArea();
areachar(); //图表
typesof(); //图表
ASdivision(); //图表
// getFarmland();
alter();
for (const key in dic.value) {
@ -1671,35 +1670,29 @@ watch(
selectTab();
}
);
const change = () => {
time.value = 0;
};
// 农作物
watch(
() => checkList.value,
(val, oldVal) => {
if (time.value > 0 && val.length < oldVal.length) {
checkList.value.forEach(item => {
addwms(layersDic[item]);
if (val.length > oldVal.length && time.value < 1) {
// 挑选出增多的数据
const newData = val.filter(item => {
const index = oldVal.findIndex(it => it === item);
if (index < 0) {
return item;
}
});
}
if (val.length >= oldVal.length) {
if (val.length == oldVal.length) {
checkList.value.forEach(item => {
newData.forEach(item => {
if (layersDic[item]) {
console.log(layersDic[item]);
addwms(layersDic[item]);
});
} else {
// 挑选出增多的数据
const newData = val.filter(item => {
const index = oldVal.findIndex(it => it === item);
if (index < 0) {
return item;
}
});
newData.forEach(item => {
if (layersDic[item]) {
addwms(layersDic[item]);
}
});
// 添加镇级矢量
}
}
});
// 添加镇级矢量
// }
} else if (val.length < oldVal.length) {
// 挑选出减少的数据
const newData = oldVal.filter(item => {
@ -1795,7 +1788,6 @@ function rightFoldClick() {
rightWra.style.transform = 'translate(107%,0)';
}
}
const handleData = oldData => {
time.value += 1;
checkListdata.value = [];
@ -1825,25 +1817,28 @@ const handleData = oldData => {
}
}
checkList.value = checkListdata.value;
checkList.value.forEach(item => {
addwms(layersDic[item]);
});
});
};
//接口
//镇
const getTownships = (city, time) => {
dd = {
小麦: [],
玉米: [],
大豆: [],
地瓜: [],
花生: [],
蓝莓: [],
茶叶: [],
马铃薯: [],
白菜和萝卜: [],
其他: [],
};
getTownship({ divisions: city, yearMonth: time }).then(res => {
dd = {
小麦: [],
玉米: [],
大豆: [],
地瓜: [],
花生: [],
蓝莓: [],
茶叶: [],
马铃薯: [],
白菜和萝卜: [],
其他: [],
};
res.data.forEach((item, i) => {
for (let index = 0; index < Object.values(item).length; index++) {
if (Object.values(item)[index] == '0.0') {
@ -1900,24 +1895,25 @@ const getTownships = (city, time) => {
}
});
});
console.log(dd, 'dd');
ASdivision();
});
};
//村
const getvillages = (city, time) => {
dd = {
小麦: [],
玉米: [],
大豆: [],
地瓜: [],
花生: [],
蓝莓: [],
茶叶: [],
马铃薯: [],
白菜和萝卜: [],
其他: [],
};
getvillage({ divisions: city, yearMonth: time }).then(res => {
dd = {
小麦: [],
玉米: [],
大豆: [],
地瓜: [],
花生: [],
蓝莓: [],
茶叶: [],
马铃薯: [],
白菜和萝卜: [],
其他: [],
};
Township.brr = res.data;
let arr = [...res.data];
let brr = [];
@ -2014,6 +2010,7 @@ const gethighStandards = time => {
白菜和萝卜: [],
其他: [],
};
// console.log(res.data)
highStandardArr.value = res.data;
highStandard.forEach((item, indexs) => {
let town = res.data.map(i => {
@ -2052,7 +2049,7 @@ const selectTab = () => {
//列表模式-年
const theTimes = () => {
gettheTime().then(res => {
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] };
timeArr.value = res.data;
formInline.value.yearMonth = res.data[0];
getlistModes(res.data[0]);
@ -2060,28 +2057,40 @@ const theTimes = () => {
dataSource.value.push({ name: item });
});
let str = oldDatas.value.name;
let str1 = str.replace(/-/g, '_');
let str1 = str && str.replace(/-/g, '_');
layersDic = {
: {
setOf: `${oldDatas.value.name}-zhangshi`,
name: `T${str1}_hao`,
小麦: {
setOf: `${oldDatas.value.name}-nongzuowufenlei`,
name: `T${str1}_xiaomai`,
},
较好: {
setOf: `${oldDatas.value.name}-zhangshi`,
name: `T${str1}_jiaohao`,
玉米: {
setOf: `${oldDatas.value.name}-nongzuowufenlei`,
name: `T${str1}_yumi`,
},
适中: {
setOf: `${oldDatas.value.name}-zhangshi`,
name: `T${str1}_shizhong`,
大豆: {
setOf: `${oldDatas.value.name}-nongzuowufenlei`,
name: `T${str1}_dadou`,
},
较差: {
setOf: `${oldDatas.value.name}-zhangshi`,
name: `T${str1}_jiaocha`,
地瓜: {
setOf: `${oldDatas.value.name}-nongzuowufenlei`,
name: `T${str1}_digua`,
},
: {
setOf: `${oldDatas.value.name}-zhangshi`,
name: `T${str1}_cha`,
花生: {
setOf: `${oldDatas.value.name}-nongzuowufenlei`,
name: `T${str1}_huasheng`,
},
蓝莓: {
setOf: `${oldDatas.value.name}-nongzuowufenlei`,
name: `T${str1}_lanmei`,
},
茶叶: {
setOf: `${oldDatas.value.name}-nongzuowufenlei`,
name: `T${str1}_chaye`,
},
其他: {
setOf: `${oldDatas.value.name}-nongzuowufenlei`,
name: `T${str1}_qitanongzuowu`,
},
};
});
@ -2818,6 +2827,7 @@ function typesof() {
// 高标准农田echarts
function farmland() {
const farmlandDivIntance = echarts.init(farmlandDiv.value);
console.log(highStandarditem);
let option = {
// backgroundColor: '#333333',
// tooltip: { show: true,},
@ -3134,7 +3144,13 @@ function farmland() {
}
});
});
let arrs = ['2019-2022gaobiaozhunnongtian', 'gbz', 'dianjigaoliang', 'dianjigaoliangs','gao'];
let arrs = [
'2019-2022gaobiaozhunnongtian',
'gbz',
'dianjigaoliang',
'dianjigaoliangs',
'gao',
];
arrs.forEach(item => {
map.getLayers()
.getArray()
@ -3186,6 +3202,7 @@ function farmland() {
function ASdivision() {
const ASdivisionDivIntance = echarts.init(ASdivisionDiv.value);
console.log(dd);
var option = {
// 设置图表的位置
grid: {

View File

@ -1056,7 +1056,7 @@ const resetForm = () => {
const getparameterEstimationYears = () => {
getparameterEstimationYear({ type: '玉米' }).then(res => {
yearTime.value = { name: res.data[0] };
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] }
res.data.forEach(item => {
dataSource.value.push({ name: item });
});

View File

@ -999,7 +999,7 @@ const resetForm = () => {
const getparameterEstimationYears = () => {
getparameterEstimationYear({ type: '花生' }).then(res => {
yearTime.value = { name: res.data[0] };
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] }
res.data.forEach(item => {
dataSource.value.push({ name: item });
});

View File

@ -1055,7 +1055,7 @@ let Back = () => {
const getparameterEstimationYears = () => {
getparameterEstimationYear({ type: '大豆' }).then(res => {
yearTime.value = { name: res.data[0] };
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] }
res.data.forEach(item => {
dataSource.value.push({ name: item });
});

View File

@ -1074,7 +1074,7 @@ const resetForm = () => {
const getparameterEstimationYears = () => {
getparameterEstimationYear({ type: '小麦' }).then(res => {
yearTime.value = { name: res.data[0] };
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] }
res.data.forEach(item => {
dataSource.value.push({ name: item });
});

View File

@ -88,7 +88,7 @@
</div>
<div ref="farmlandDiv" class="farmlandDiv"></div>
<div v-if="!limits">
<img src='@/assets/images/qx.png' />
<img src="@/assets/images/qx.png" />
</div>
</div>
<div class="rightbottom">
@ -428,6 +428,7 @@ let alterArr = ref([]);
let dataSource = ref([]);
let oldDatas = ref('');
let paramCode = ref('');
let time = ref(0);
let limits = window.localStorage.getItem('divisions').length > 6 ? false : true;
let code =
window.localStorage.getItem('deptName') == '青岛西海岸新区'
@ -483,26 +484,26 @@ let dic = {
: { color: 'rgba(255, 0, 255, 1)', disabled: false },
};
let layersDic = {
: {
setOf: '2022-08-05-zhangshi',
name: 'T2022_08_05_hao',
},
较好: {
setOf: '2022-08-05-zhangshi',
name: 'T2022_08_05_jiaohao',
},
适中: {
setOf: '2022-08-05-zhangshi',
name: 'T2022_08_05_shizhong',
},
较差: {
setOf: '2022-08-05-zhangshi',
name: 'T2022_08_05_jiaocha',
},
: {
setOf: '2022-08-05-zhangshi',
name: 'T2022_08_05_cha',
},
// 好: {
// setOf: '2022-08-05-zhangshi',
// name: 'T2022_08_05_hao',
// },
// 较好: {
// setOf: '2022-08-05-zhangshi',
// name: 'T2022_08_05_jiaohao',
// },
// 适中: {
// setOf: '2022-08-05-zhangshi',
// name: 'T2022_08_05_shizhong',
// },
// 较差: {
// setOf: '2022-08-05-zhangshi',
// name: 'T2022_08_05_jiaocha',
// },
// 差: {
// setOf: '2022-08-05-zhangshi',
// name: 'T2022_08_05_cha',
// },
};
let nums = 0;
@ -551,16 +552,19 @@ watch(
},
};
for (const key in checkList.value) {
addwms(layersDic[checkList.value[key]]);
}
// for (const key in checkList.value) {
// addwms(layersDic[checkList.value[key]]);
// }
}
);
const change = () => {
time.value = 0;
};
// 农作物
watch(
() => checkList.value,
(val, oldVal) => {
if (val.length > oldVal.length) {
if (val.length > oldVal.length && time.value < 1) {
// 挑选出增多的数据
const newData = val.filter(item => {
const index = oldVal.findIndex(it => it === item);
@ -617,8 +621,6 @@ let dd = ref({
});
let layers = ref(null); //村
const change = () => {};
//表格数据
let tableData = ref([]);
@ -1320,6 +1322,7 @@ const Nindex = index => {
return index + 1 + (page - 1) * pagesize;
};
const handleData = oldData => {
time.value += 1;
checkListdata.value = [];
for (const key in dic) {
if (dic[key].disabled !== true) {
@ -1337,19 +1340,44 @@ const handleData = oldData => {
});
}
oldDatas.value = oldData;
let str1 = oldData.name.replace(/-/g, '_');
layersDic = {
: {
setOf: `${oldData.name}-zhangshi`,
name: `T${str1}_hao`,
},
较好: {
setOf: `${oldData.name}-zhangshi`,
name: `T${str1}_jiaohao`,
},
适中: {
setOf: `${oldData.name}-zhangshi`,
name: `T${str1}_shizhong`,
},
较差: {
setOf: `${oldData.name}-zhangshi`,
name: `T${str1}_jiaocha`,
},
: {
setOf: `${oldData.name}-zhangshi`,
name: `T${str1}_cha`,
},
};
checkList.value.forEach(item => {
addwms(layersDic[item]);
});
};
/*------------------接口--------------------*/
//获取年
const getgrowthTimes = () => {
getgrowthTime().then(res => {
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] };
res.data.forEach(item => {
dataSource.value.push({ name: item });
});
timeArr.value = res.data;
formInline.value.time = res.data[0];
onSubmit();
let str = oldDatas.value.name;
let str1 = str.replace(/-/g, '_');
@ -2389,7 +2417,6 @@ function farmland() {
map.getLayers()
.getArray()
.forEach((ite, index) => {
console.log(ite.A);
if (ite.A.name == item || ite.A.id == item) {
map.getLayers().removeAt(index);
}

View File

@ -35,6 +35,7 @@
:header-cell-style="{ 'text-align': 'center' }"
:data="tableData"
style="width: 100%"
:key="itemKey"
>
<el-table-column prop="type" label="类型" />
<el-table-column prop="yesFlooding" label="面积" />
@ -86,8 +87,8 @@
/>
</p>
</div>
<div class="farmlandDiv">
<el-table
<div class="farmlandDiv" ref="farmlandDiv">
<!-- <el-table
:cell-style="{ textAlign: 'center' }"
:header-cell-style="{ 'text-align': 'center' }"
:data="highStandardArr"
@ -101,7 +102,7 @@
label="洪涝面积(亩)"
/>
<el-table-column prop="createdTime" label="监测时间" />
</el-table>
</el-table> -->
</div>
<!-- <div ref="ProgressBarDiv" class="ProgressBar"></div> -->
</div>
@ -129,23 +130,7 @@
:value="item.subregion"
/>
</el-select> -->
<div class="ASdivision">
<el-table
:cell-style="{ textAlign: 'center' }"
:header-cell-style="{ 'text-align': 'center' }"
:data="ZoningData"
:key="itemKey"
style="width: 100%; font-size: 12px"
>
<el-table-column prop="name" label="区域名称" />
<el-table-column
prop="yesFloodingPercentage"
width="120"
label="洪涝面积(亩)"
/>
<el-table-column prop="createdTime" width="100" label="监测时间" />
</el-table>
</div>
<div class="ASdivision" ref="ASdivision"></div>
</div>
<div class="rightFoldDiv" @click="rightFoldClick()">
<el-tooltip
@ -338,7 +323,7 @@ import {
gethighStandard,
gettownInformation,
getvillage,
getgarrison,
getvillageChun,
getlistDroughtsDamageYear,
getllistDroughtsDamage,
} from '@/api/meteorological/remoteSense/FloodExtraction.js';
@ -354,6 +339,8 @@ let viewer = ref(null);
const areaDiv = ref(null);
const typesofDiv = ref(null);
const ProgressBarDiv = ref(null);
const farmlandDiv = ref(null);
const ASdivision = ref(null);
const value = ref('370211');
value.value = window.localStorage.getItem('divisions');
const leftProgressBarDiv = ref(null);
@ -386,6 +373,7 @@ let zhengData = ref([]);
let alterArr = ref([]);
let limits = window.localStorage.getItem('divisions').length > 6 ? false : true;
let itemKey = ref([]);
let Tabtime = ref(1);
let code =
window.localStorage.getItem('deptName') == '青岛西海岸新区'
? '黄岛区'
@ -644,24 +632,23 @@ function QueryData(e, name, url, item) {
alter();
}
);
} else if (
item == '村' &&
data.result.recordsets[0].features.features[0].properties.CJQYDM
) {
let code = data.result.recordsets[0].features.features[0].properties.CJQYDM;
let arr = [];
getvillageChun({ divisions: code, yearMonth: oldDatas.value.name }).then(res => {
console.log(res.data);
res.data.forEach(item => {
console.log(item);
arr.push(item);
});
name = res.data[0].name;
alterArr.value = arr;
alter();
});
}
// else if (
// item == '村' &&
// data.result.recordsets[0].features.features[0].properties.CJQYDM
// ) {
// let code = data.result.recordsets[0].features.features[0].properties.CJQYDM;
// let arr = [];
// getvillageChun({ divisions: code }).then(res => {
// console.log(res.data);
// res.data.forEach(item => {
// console.log(item);
// arr.push(item);
// });
// name = res.data[0].streetName;
// alterArr.value = arr;
// alter();
// });
// }
function alter() {
if (data.result.currentCount > 0) {
if (data.result.recordsets[0].features) {
@ -877,11 +864,14 @@ const addwms = name => {
map.addLayer(layer);
};
let nums = 0;
const change = () => {
Tabtime.value = 0;
};
// 农作物
watch(
() => checkList.value,
(val, oldVal) => {
if (val.length > oldVal.length) {
if (val.length > oldVal.length && Tabtime.value < 1) {
// 挑选出增多的数据
const newData = val.filter(item => {
const index = oldVal.findIndex(it => it === item);
@ -911,6 +901,7 @@ watch(
.getArray()
.forEach((ite, index) => {
if (ite.A.name) {
console.log(ite.A.name);
if (ite.A.name == layersDic[item].name) {
map.getLayers().removeAt(index);
}
@ -936,7 +927,7 @@ watch(
gethighStandards(oldDatas.value.name); //高标准农田冷冻等级面积统计
gettownInformations(value.value, oldDatas.value.name); //镇
// if (limits) {
// } else {
// getvillages(value.value, oldDatas.value.name);
// }
@ -948,9 +939,6 @@ watch(
name: `T${str1}_honglao`,
},
};
for (const key in checkList.value) {
addwms(layersDic[checkList.value[key]]);
}
}
);
let townZuowu = ref({ label: [] }); //镇的作物
@ -981,16 +969,12 @@ const handleChange = value => {
formInline.value.area = value;
};
const onSubmit = () => {
if (formInline.value.statistical == '行政区划') {
formInline.value.droughtRating = null;
}
let arr = [];
let brr = [];
getllistDroughtsDamage({
yearMonth: formInline.value.time,
statistical: formInline.value.statistical,
droughtRating:
formInline.value.droughtRating == null ? '1' : formInline.value.droughtRating,
droughtRating: !formInline.value.droughtRating ? '1' : formInline.value.droughtRating,
area: formInline.value.area,
}).then(res => {
if (formInline.value.statistical == '行政区划') {
@ -1131,7 +1115,7 @@ const resetForm = () => {
//列表模式-年
const theTimes = () => {
getlistDroughtsDamageYear().then(res => {
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] };
res.data.forEach(item => {
dataSource.value.push({ name: item });
});
@ -1151,8 +1135,8 @@ const theTimes = () => {
//农作物受灾面积统计
const getydamageAreas = (city, time) => {
areacharData = reactive({ lable: [], value: [] });
getydamageArea({ divisions: city, yearMonth: time }).then(res => {
areacharData = reactive({ lable: [], value: [] });
res.data.forEach(item => {
areacharData.lable.push(item.type);
areacharData.value.push(item.yesFlooding);
@ -1163,22 +1147,25 @@ const getydamageAreas = (city, time) => {
//农作物受灾面积占比
const getproportions = (city, time) => {
typesofData = ref([]);
tableData = ref([]);
totalArea = ref(0);
let tableArr = ref([]);
getproportion({ divisions: city, yearMonth: time }).then(res => {
typesofData = ref([]);
tableData = ref([]);
totalArea = ref(0);
res.data.forEach(item => {
totalArea.value += Number(item.yesFlooding);
typesofData.value.push({
name: item.type,
value: item.yesFlooding,
});
tableData.value.push({
tableArr.value.push({
type: item.type,
yesFlooding: `${item.yesFlooding}`,
zb: `${(item.zb * 100).toFixed(2)}%`,
});
});
tableData.value = tableArr.value;
itemKey.value = Math.random()
typesof();
});
};
@ -1187,6 +1174,7 @@ const getproportions = (city, time) => {
const gethighStandards = time => {
gethighStandard({ yearMonth: time }).then(res => {
highStandardArr.value = JSON.parse(JSON.stringify(res.data));
farmland();
});
};
@ -1229,6 +1217,7 @@ const gettownInformations = (city, time) => {
Township.arr = drr;
selectOption.value = JSON.parse(JSON.stringify(Township.arr));
selectOption.value[0].subregion = null;
ASdivisions();
});
};
//村
@ -1383,6 +1372,7 @@ const exportExcel = (
};
const handleData = oldData => {
checkListdata.value = [];
Tabtime.value += 1;
for (const key in dic) {
if (dic[key].disabled !== true) {
checkListdata.value.push(key);
@ -1399,6 +1389,16 @@ const handleData = oldData => {
});
}
oldDatas.value = oldData;
let str1 = oldData.name.replace(/-/g, '_');
layersDic = {
洪涝区: {
setOf: `${oldData.name}-honglao`,
name: `T${str1}_honglao`,
},
};
checkList.value.forEach(item => {
addwms(layersDic[item]);
});
};
/*-------------echarts--------------*/
function areachar() {
@ -1715,6 +1715,493 @@ function typesof() {
});
});
}
//高标准
function farmland() {
const farmlandDivIntance = echarts.init(farmlandDiv.value);
var labelData = [];
var valueData = [];
let data = [];
highStandardArr.value.forEach(item => {
labelData.push(item.region);
valueData.push(item.yesFlooding);
data.push({
name: item.region,
value: item.yesFlooding,
});
});
const xdata = data.map(v => v.name);
const ydata = data.map(v => v.value);
const icon =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAABI0lEQVQokWXSv0qdQRAF8N+93gQlQQmYzkqwsUlp4zv4KLY+kW2wsdFHkHSKoo2KgkbFP4REo/fKMbPwXTOw7H7fzpk55+z07Iyg51+0ffRuH4tBJU7UOauPIZ5rvXgHbqAP+ITPmCrQH/yq9bcLbpUn8QXLmMN+JV/hErf4XeBh6xTQLL5hFYfYwh6OcIqfeMBTl94MvhbtBczjAOuVky5P0dnvaIuW6Y7emLOINaxU0Y+R00DNwb7/I+YsFf1e65B46bjVjXts4DuOi+JoUDbmIwnXBXjEjzJjFye4K01v7gWUpBucYRub5dYFzqtYnEveMGMUHc2EiI2GRN4l1cMg1DMdefQ3TV16uUzVXDaL2zSMjVED5SLt41D+BZh9fGjxCo/fXmSu3pv5AAAAAElFTkSuQmCC';
const icon1 =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAABSUlEQVQokV2Sv0oDQRDGf3u7EYNBEWJnJdjYWNr4Dj6KrU9kqzY2+gx2iqKNioJ/0QQxudztyneZlUsGlt27mW9mvm/GpeExgGNq+U5z94wFC/T21imACFR2aubAGdQBloAe0DXQCPixM2mDc+ZFYLWq2SWxHgLXFvwOvAJfwK+BY64kUJ/EdlWzHxO3IXBWOK6AO+AReAOGQNlubwXHmsrHyGZZsuE9N8Fz6FwToyqleBYtbl0Hyy2+vq7ZKksOJhV7TVJYEJ0MygoW8/Im6MXITh3p55EE80mZUZqS/zfnGATPifccAffWYgomoz4GwIcBxsFzITGAS+AB+DZOjXoCjYHPlHgqCs47gVPnGrVegGdLJuUUF7VG4qGBSgSR1YBlmouyqwMNWtuhoTec2u3JqaxyZonzNsysUQbJofJSSP8E1D27tMAfmOl6GGh2/cMAAAAASUVORK5CYII=';
const barColor = {
0: ['#F7ECB0', '#FFE86C'],
1: ['rgba(0, 202, 252, 0.3)', 'rgba(0, 202, 252, 1)'],
};
let option = {
grid: {
left: 10,
bottom: 10,
right: 10,
top: 10,
containLabel: false,
},
tooltip: {
trigger: 'item',
formatter: '面积:{c0} 亩',
borderColor: '#458CDC',
borderWidth: 1,
borderRadius: 0,
textStyle: {
color: '#333',
},
},
yAxis: [
{
inverse: true,
data: xdata,
axisLabel: {
textStyle: {
fontSize: 16,
align: 'left',
fontFamily: 'MiSans-Normal',
color: '#fff',
},
padding: [-20, 30, 15, 10],
formatter: (name, index) => {
const _index = index + 1;
if (index === 0) {
return `${name}`;
}
return `${name}`;
},
rich: {
icon: {
width: 7,
height: 8,
backgroundColor: {
image: icon,
},
},
icon1: {
width: 7,
height: 8,
backgroundColor: {
image: icon1,
},
},
num: {
padding: [0, 20, 0, 5],
width: 25,
color: '#fff',
align: 'left',
fontSize: 12,
fontFamily: 'Mohave-BoldItalic',
fontWeight: 400,
},
},
},
offset: 0,
splitLine: {
show: false,
},
axisTick: {
show: false,
},
axisLine: {
show: false,
},
},
],
dataZoom: [
{
type: 'slider',
show: false,
zoomLock: true, //禁止拉伸
width: 8,
yAxisIndex: [0],
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,
},
],
xAxis: {
show: false,
},
series: [
{
z: 1,
type: 'bar',
data: ydata,
barWidth: 7,
showBackground: true,
backgroundStyle: {
color: 'rgba(95, 123, 149, 0.2)',
},
itemStyle: {
color: function (params) {
const { dataIndex } = params;
const colors = dataIndex === 0 ? barColor[0] : barColor[1];
return new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0,
color: 'rgba(25, 120, 229, 0)',
},
{
offset: 1,
color: 'rgba(0, 213, 255, 1)',
},
]);
},
},
},
{
type: 'pictorialBar',
data: ydata,
z: 10,
symbol: 'circle',
symbolRotate: null,
symbolSize: [8, 8],
symbolPosition: 'end',
symbolOffset: [4, 0],
itemStyle: {
color: 'rgba(255,255,255,1)',
},
},
// {
// type: 'pictorialBar',
// data: ydata,
// z: 9,
// symbol: 'circle',
// symbolRotate: null,
// symbolSize: [16, 16],
// symbolPosition: 'end',
// symbolOffset: [8, 0],
// itemStyle: {
// color: 'rgba(255,255,255,0.1)',
// borderColor: 'rgba(255,255,255,0.3)',
// },
// },
// {
// type: 'pictorialBar',
// data: ydata,
// z: 8,
// symbol: 'circle',
// symbolRotate: null,
// symbolSize: [26, 26],
// symbolPosition: 'end',
// symbolOffset: [13, 0],
// itemStyle: {
// color: 'rgba(255,255,255,0.15)',
// borderColor: 'rgba(255,255,255,0.3)',
// },
// },
],
};
useEcharts(farmlandDivIntance, option);
let erd = elementResizeDetectorMaker();
erd.listenTo(farmlandDiv.value, () => {
nextTick(() => {
farmlandDivIntance.resize();
});
});
}
//行政区划
function ASdivisions() {
const ASdivisionIntance = echarts.init(ASdivision.value);
var labelData = [];
var valueData = [];
let data = [];
ZoningData.value.forEach(item => {
labelData.push(item.name);
valueData.push(item.yesFloodingPercentage);
data.push({
name: item.name,
value: item.yesFloodingPercentage,
});
});
const xdata = data.map(v => v.name);
const ydata = data.map(v => v.value);
const icon =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAABI0lEQVQokWXSv0qdQRAF8N+93gQlQQmYzkqwsUlp4zv4KLY+kW2wsdFHkHSKoo2KgkbFP4REo/fKMbPwXTOw7H7fzpk55+z07Iyg51+0ffRuH4tBJU7UOauPIZ5rvXgHbqAP+ITPmCrQH/yq9bcLbpUn8QXLmMN+JV/hErf4XeBh6xTQLL5hFYfYwh6OcIqfeMBTl94MvhbtBczjAOuVky5P0dnvaIuW6Y7emLOINaxU0Y+R00DNwb7/I+YsFf1e65B46bjVjXts4DuOi+JoUDbmIwnXBXjEjzJjFye4K01v7gWUpBucYRub5dYFzqtYnEveMGMUHc2EiI2GRN4l1cMg1DMdefQ3TV16uUzVXDaL2zSMjVED5SLt41D+BZh9fGjxCo/fXmSu3pv5AAAAAElFTkSuQmCC';
const icon1 =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAABSUlEQVQokV2Sv0oDQRDGf3u7EYNBEWJnJdjYWNr4Dj6KrU9kqzY2+gx2iqKNioJ/0QQxudztyneZlUsGlt27mW9mvm/GpeExgGNq+U5z94wFC/T21imACFR2aubAGdQBloAe0DXQCPixM2mDc+ZFYLWq2SWxHgLXFvwOvAJfwK+BY64kUJ/EdlWzHxO3IXBWOK6AO+AReAOGQNlubwXHmsrHyGZZsuE9N8Fz6FwToyqleBYtbl0Hyy2+vq7ZKksOJhV7TVJYEJ0MygoW8/Im6MXITh3p55EE80mZUZqS/zfnGATPifccAffWYgomoz4GwIcBxsFzITGAS+AB+DZOjXoCjYHPlHgqCs47gVPnGrVegGdLJuUUF7VG4qGBSgSR1YBlmouyqwMNWtuhoTec2u3JqaxyZonzNsysUQbJofJSSP8E1D27tMAfmOl6GGh2/cMAAAAASUVORK5CYII=';
const barColor = {
0: ['#F7ECB0', '#FFE86C'],
1: ['rgba(0, 202, 252, 0.3)', 'rgba(0, 202, 252, 1)'],
};
let option = {
grid: {
left: 120,
bottom: 10,
right: 10,
top: 50,
containLabel: false,
},
tooltip: {
trigger: 'item',
formatter: '面积:{c0} 亩',
borderColor: '#458CDC',
borderWidth: 1,
borderRadius: 0,
textStyle: {
color: '#333',
},
},
yAxis: [
{
inverse: true,
data: xdata,
axisLabel: {
textStyle: {
fontSize: 16,
align: 'right',
fontFamily: 'MiSans-Normal',
color: '#fff',
},
padding: [20, 0, 15, 10],
formatter: (name, index) => {
const _index = index + 1;
if (index === 0) {
return `${name}`;
}
return `${name}`;
},
rich: {
icon: {
width: 7,
height: 8,
backgroundColor: {
image: icon,
},
},
icon1: {
width: 7,
height: 8,
backgroundColor: {
image: icon1,
},
},
num: {
padding: [0, 20, 0, 5],
width: 25,
color: '#fff',
align: 'left',
fontSize: 12,
fontFamily: 'Mohave-BoldItalic',
fontWeight: 400,
},
},
},
offset: 0,
splitLine: {
show: false,
},
axisTick: {
show: false,
},
axisLine: {
show: false,
},
},
],
dataZoom: [
{
type: 'slider',
show: false,
zoomLock: true, //禁止拉伸
width: 8,
yAxisIndex: [0],
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,
},
],
xAxis: [
{
position: 'top',
type: 'value',
color: '#59588D',
axisLine: {
show: false,
},
min: 0,
axisLabel: {
color: '#fff',
},
splitLine: {
show: true,
lineStyle: {
type: 'Solid',
color: 'rgba(255, 255, 255, 0.7)',
},
},
name: '',
nameLocation: 'middle',
nameTextStyle: {
fontSize: 14,
align: 'center',
padding: [20, 0, 0, 0],
},
},
],
series: [
{
z: 1,
type: 'bar',
data: ydata,
barWidth: 7,
showBackground: true,
backgroundStyle: {
color: 'rgba(95, 123, 149, 0.2)',
},
itemStyle: {
color: function (params) {
const { dataIndex } = params;
const colors = dataIndex === 0 ? barColor[0] : barColor[1];
return new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0,
color: 'rgba(255, 225, 104, 0)',
},
{
offset: 1,
color: 'rgba(255, 225, 104, 1)',
},
]);
},
},
},
{
type: 'pictorialBar',
data: ydata,
z: 10,
symbol: 'circle',
symbolRotate: null,
symbolSize: [8, 8],
symbolPosition: 'end',
symbolOffset: [4, 0],
itemStyle: {
color: 'rgba(255,255,255,1)',
},
},
// {
// type: 'pictorialBar',
// data: ydata,
// z: 9,
// symbol: 'circle',
// symbolRotate: null,
// symbolSize: [16, 16],
// symbolPosition: 'end',
// symbolOffset: [8, 0],
// itemStyle: {
// color: 'rgba(255,255,255,0.1)',
// borderColor: 'rgba(255,255,255,0.3)',
// },
// },
// {
// type: 'pictorialBar',
// data: ydata,
// z: 8,
// symbol: 'circle',
// symbolRotate: null,
// symbolSize: [26, 26],
// symbolPosition: 'end',
// symbolOffset: [13, 0],
// itemStyle: {
// color: 'rgba(255,255,255,0.15)',
// borderColor: 'rgba(255,255,255,0.3)',
// },
// },
],
};
useEcharts(ASdivisionIntance, option);
let erd = elementResizeDetectorMaker();
erd.listenTo(ASdivision.value, () => {
nextTick(() => {
ASdivisionIntance.resize();
});
});
}
function chartModes() {
const ASdivisionDivIntance = echarts.init(chartModeDiv.value);
@ -1898,122 +2385,6 @@ function chartModes() {
useEcharts(ASdivisionDivIntance, option);
}
//返回
function back() {
deleteEntityByName('villageLine');
removeWms(['village_CQL']);
deleteEntityByName('townLine');
delete townZuowu.value.XZQMC;
removeWms(['gbznt'], true);
removeWms(['aaa']);
value.value = '370211';
selectTab();
if (flag.value === '1') {
addWms('shuzisannong:huangdaoqu_town', 'tl');
}
viewer.camera.flyTo({
destination: Cesium.Rectangle.fromDegrees(119.5091, 35.5671, 120.3285, 36.1455),
duration: 2,
});
flag.value = false;
hiddenOverlayChart();
}
// 图表点击事件
function ChartClick(item) {
delete townZuowu.value;
// 移除作物
removeWms(['huangdaoqu_town'], true);
removeWms(['tl'], true);
let layername = 'shuzisannong:farmland';
// 判断是否存在避免重复添加
let cz = false;
const layers = viewer.imageryLayers._layers;
for (let f = layers.length - 1; f >= 0; f--) {
if (
layers[f] &&
layers[f]._imageryProvider.customName &&
layers[f]._imageryProvider.customName === layername + 'gbznt'
) {
cz = true;
}
}
if (!cz) {
// 添加高标准农田服务
addWms(layername, layername + 'gbznt');
townZuowu.value.label = [
{ crop: '小麦', Shape_Area: '53000' },
{ crop: '地瓜', Shape_Area: '50000' },
];
}
// 定位到地块
let features = formLandRef.value;
features.forEach(it => {
if (it.properties.name === item.name) {
viewer.camera.flyTo({
destination: Cesium.Rectangle.fromDegrees(
it.bbox[0],
it.bbox[1],
it.bbox[2],
it.bbox[3]
),
duration: 2,
});
}
});
flag.value = '1';
showOverlayChart({ x: 642, y: 312 });
}
/*--------------------------------------------------------------------------------------------*/
let fenleiRef = ref({});
// 地图移动时弹窗跟随
function infoWindowPostRender() {
// let viewer = viewers.value;
if (clickInfoMap.value.lon && clickInfoMap.value.lat) {
//经纬度转为世界坐标
const gisPosition = Cesium.Cartesian3.fromDegrees(
Number(clickInfoMap.value.lon),
Number(clickInfoMap.value.lat),
0
); //转化为屏幕坐标
var windowPosition = Cesium.SceneTransforms.wgs84ToWindowCoordinates(
viewer.scene,
gisPosition
);
if (Cesium.defined(windowPosition)) {
const pop = document.getElementById('popup');
if (pop) {
pop.style.top = windowPosition.y - 10 + 'px';
pop.style.left = windowPosition.x + 10 + 'px';
}
}
}
}
// 隐藏弹窗
function hiddenOverlayChart() {
const pop = document.getElementById('popup');
if (pop) {
pop.style.display = 'none'; // 清除监听事件
}
viewer.scene.postRender.removeEventListener(infoWindowPostRender);
deleteEntityByName('townLine');
}
//显示弹窗
function showOverlayChart(position) {
const pop = document.getElementById('popup');
if (pop) {
pop.style.display = 'block';
pop.style.position = 'absolute';
pop.style.top = position.y - 10 + 'px';
pop.style.left = position.x + 10 + 'px';
pop.style.zIndex = 99;
}
}
/*-------------------------------------------------------------------------------------------*/
</script>
@ -2740,7 +3111,6 @@ $height: calc(100vh - 100px);
right: 30%;
top: 20px;
}
</style>
<style lang="scss">
.select_city {

View File

@ -462,7 +462,7 @@ let pageSize = ref(12); //每页条数
const chartModeDiv = ref(null);
let tableItem = ref([]);
let operate = ref(true);
let Tabtime = ref(0);
let Tabtime = ref(1);
let code =
window.localStorage.getItem('deptName') == '青岛西海岸新区'
? '黄岛区'
@ -1217,53 +1217,55 @@ watch(
}
);
let nums = 0;
const change = () => {
Tabtime.value = 0;
};
// 农作物
watch(
() => checkList.value,
(val, oldVal) => {
let layerArr = [];
map.getLayers()
.getArray()
.forEach((ite, index) => {
if (ite.A.name) {
layerArr.push(ite.A.name);
// let layerArr = [];
// map.getLayers()
// .getArray()
// .forEach((ite, index) => {
// if (ite.A.name) {
// layerArr.push(ite.A.name);
// }
// });
// if (
// (Tabtime.value > 0 && val.length < oldVal.length) ||
// (Tabtime.value > 0 && val.length > oldVal.length)
// ) {
// checkList.value.forEach(item => {
// if (layerArr.indexOf(layersDic[item].name) == -1) {
// addwms(layersDic[item]);
// return;
// }
// });
// }
if (val.length >= oldVal.length && Tabtime.value < 1) {
// if (val.length == oldVal.length) {
// checkList.value.forEach(item => {
// if (layerArr.indexOf(layersDic[item].name) == -1) {
// addwms(layersDic[item]);
// }
// });
// } else {
// 挑选出增多的数据
const newData = val.filter(item => {
const index = oldVal.findIndex(it => it === item);
if (index < 0) {
return item;
}
});
if (
(Tabtime.value > 0 && val.length < oldVal.length) ||
(Tabtime.value > 0 && val.length > oldVal.length)
) {
checkList.value.forEach(item => {
if (layerArr.indexOf(layersDic[item].name) == -1) {
newData.forEach(item => {
if (layersDic[item]) {
addwms(layersDic[item]);
return;
}
});
}
if (val.length >= oldVal.length) {
if (val.length == oldVal.length) {
checkList.value.forEach(item => {
if (layerArr.indexOf(layersDic[item].name) == -1) {
addwms(layersDic[item]);
}
});
} else {
// 挑选出增多的数据
const newData = val.filter(item => {
const index = oldVal.findIndex(it => it === item);
if (index < 0) {
return item;
}
});
newData.forEach(item => {
if (layersDic[item]) {
if (layerArr.indexOf(layersDic[item].name) == -1) {
addwms(layersDic[item]);
}
}
});
// 添加镇级矢量
}
// 添加镇级矢量
// }
} else if (val.length < oldVal.length) {
// 挑选出减少的数据
const newData = oldVal.filter(item => {
@ -1507,7 +1509,7 @@ function SQLData(name) {
//列表模式-年
const theTimes = () => {
getlistDroughtsYear().then(res => {
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] };
res.data.forEach(item => {
dataSource.value.push({ name: item });
});
@ -1930,6 +1932,9 @@ const handleData = oldData => {
}
}
checkList.value = checkListdata.value;
checkList.value.forEach(item => {
addwms(layersDic[item]);
});
});
};
/*-------------echarts--------------*/

View File

@ -432,7 +432,7 @@ let dataSource = ref([]);
let oldDatas = ref('');
let paramCode = ref('');
let alterArr = ref([]);
let Tabtime = ref(0);
let Tabtime = ref(1);
let limits = window.localStorage.getItem('divisions').length > 6 ? false : true;
let code =
window.localStorage.getItem('deptName') == '青岛西海岸新区'
@ -1083,53 +1083,26 @@ const addwms = name => {
};
let nums = 0;
const change = () => {
Tabtime.value = 0;
};
// 农作物
watch(
() => checkList.value,
(val, oldVal) => {
let layerArr = [];
map.getLayers()
.getArray()
.forEach((ite, index) => {
if (ite.A.name) {
layerArr.push(ite.A.name);
if (val.length >= oldVal.length && Tabtime.value < 1) {
// 挑选出增多的数据
const newData = val.filter(item => {
const index = oldVal.findIndex(it => it === item);
if (index < 0) {
return item;
}
});
if (
(Tabtime.value > 0 && val.length < oldVal.length) ||
(Tabtime.value > 0 && val.length > oldVal.length)
) {
checkList.value.forEach(item => {
if (layerArr.indexOf(layersDic[item].name) == -1) {
newData.forEach(item => {
if (layersDic[item]) {
addwms(layersDic[item]);
return;
}
});
}
if (val.length >= oldVal.length) {
if (val.length == oldVal.length) {
checkList.value.forEach(item => {
if (layerArr.indexOf(layersDic[item].name) == -1) {
addwms(layersDic[item]);
}
});
} else {
// 挑选出增多的数据
const newData = val.filter(item => {
const index = oldVal.findIndex(it => it === item);
if (index < 0) {
return item;
}
});
newData.forEach(item => {
if (layersDic[item]) {
if (layerArr.indexOf(layersDic[item].name) == -1) {
addwms(layersDic[item]);
}
}
});
// 添加镇级矢量
}
} else if (val.length < oldVal.length) {
// 挑选出减少的数据
const newData = oldVal.filter(item => {
@ -1342,7 +1315,7 @@ const resetForm = () => {
//列表模式-年
const theTimes = () => {
getfreezeWarningYear().then(res => {
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] };
res.data.forEach(item => {
dataSource.value.push({ name: item });
});
@ -1885,6 +1858,9 @@ const handleData = oldData => {
}
}
checkList.value = checkListdata.value;
checkList.value.forEach(item => {
addwms(layersDic[item]);
});
});
};

View File

@ -167,6 +167,7 @@ let checkListdata = ref([]);
let alterArr = ref([]);
let dataSource = ref([]);
let oldDatas = ref('');
let time = ref(1);
let limits = window.localStorage.getItem('divisions').length > 6 ? false : true;
let code =
window.localStorage.getItem('deptName') == '青岛西海岸新区'
@ -196,10 +197,7 @@ let dic = {
};
// 图层字典
let layersDic = {
非粮化: {
setOf: '2022-09-30-gengdi',
name: 'T2022_09_30_feilianghua',
},
};
let layers = ref(null); //村
var data = {
@ -261,9 +259,18 @@ watch(
name: `T${str1}_feilianghua`,
},
};
for (const key in checkList.value) {
addwms(layersDic[checkList.value[key]]);
}
// for (const key in checkList.value) {
// let str = oldDatas.value.name;
// let str1 = str && str.replace(/-/g, '_');
// map.getLayers()
// .getArray()
// .forEach((ite, index) => {
// if (`T${str1}_feilianghua` == ite.A.name) {
// map.getLayers().removeAt(index);
// }
// });
// addwms(layersDic[checkList.value[key]]);
// }
}
);
@ -563,7 +570,6 @@ function QueryData(e, name, url, item) {
res.data.forEach(item => {
if (item.subregionCode == code) {
name = item.subregionName;
console.log(item);
arr.push(item);
}
});
@ -573,10 +579,8 @@ function QueryData(e, name, url, item) {
}
function alter() {
if (data.result.currentCount > 0) {
console.log(data.result.recordsets[0].features);
if (data.result.recordsets[0].features) {
overlay.setPosition(point.flatCoordinates);
console.log(name);
titleDiv.innerHTML = name;
}
layergaoliang = map
@ -672,11 +676,9 @@ function addConver(data, name, color, index) {
//擦除操作,生产遮罩范围
function erase(data) {
console.log(data);
const extent = [-180, -90, 180, 90];
const polygonRing = ol.geom.Polygon.fromExtent(extent);
const coords = data;
console.log(coords);
coords.forEach(coord => {
const linearRing = new ol.geom.LinearRing(coord[0]);
polygonRing.appendLinearRing(linearRing);
@ -690,10 +692,27 @@ watch(
}
);
// 农作物
const change = () => {
time.value = 0;
};
watch(
() => checkList.value,
(val, oldVal) => {
if (val.length > oldVal.length) {
// let str = oldDatas.value.name;
// let str1 = str && str.replace(/-/g, '_');
// map.getLayers()
// .getArray()
// .forEach((ite, index) => {
// if (`T${str1}_feilianghua` == ite.A.name) {
// map.getLayers().removeAt(index);
// }
// });
// if (time.value > 0) {
// checkList.value.forEach(item => {
// addwms(layersDic[item]);
// });
// }
if (val.length > oldVal.length && time.value < 1) {
// 挑选出增多的数据
const newData = val.filter(item => {
const index = oldVal.findIndex(it => it === item);
@ -703,6 +722,7 @@ watch(
});
newData.forEach(item => {
if (layersDic[item]) {
console.log(2);
addwms(layersDic[item]);
}
});
@ -719,7 +739,6 @@ watch(
if (layersDic[item]) {
// 假设要删除的图层为 layerToRemove
var index = map.getLayers().getArray().indexOf(layersDic[item].name);
console.log(map.getLayers().getArray());
map.getLayers()
.getArray()
.forEach((ite, index) => {
@ -752,7 +771,7 @@ function rightFoldClick() {
//时间
const getFlYears = () => {
getFlYear().then(res => {
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] };
res.data.forEach(item => {
dataSource.value.push({ name: item });
});
@ -768,9 +787,9 @@ const getFlYears = () => {
};
//镇
const getNonFoods = time => {
Township.arr = [];
townArr.value = [];
getNonFood({ yearMonth: time }).then(res => {
Township.arr = [];
townArr.value = [];
res.data.forEach(item => {
if (item.farm > 0) {
Township.arr.push(item);
@ -816,6 +835,7 @@ const selectTab = () => {
}
};
const handleData = oldData => {
time.value += 1;
checkListdata.value = [];
for (const key in dic) {
if (dic[key].disabled !== true) {
@ -833,6 +853,16 @@ const handleData = oldData => {
});
}
oldDatas.value = oldData;
let str1 = oldData.name.replace(/-/g, '_');
layersDic = {
非粮化: {
setOf: `${oldData.name}-gengdi`,
name: `T${str1}_feilianghua`,
},
};
checkList.value.forEach(item => {
addwms(layersDic[item]);
});
};
function ASdivision() {
const ASdivisionDivIntance = echarts.init(ASdivisionDiv.value);

View File

@ -747,7 +747,7 @@ function rightFoldClick() {
const getLhdyears = () => {
getLhdyear().then(res => {
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] }
res.data.forEach(item => {
dataSource.value.push({ name: item });
});

View File

@ -198,12 +198,7 @@ let dic = {
非农化: { color: 'rgba(255, 255, 0, 1)', disabled: false },
};
// 图层字典
let layersDic = {
非农化: {
setOf: '2022-09-30-gengdi',
name: 'T2022_09_30_feinonghua',
},
};
let layersDic = {};
let layers = ref(null); //村
var data = {
title: ['区域一', '区域二', '区域三', '区域四', '区域五', '区域六', '区域七', '区域八'],
@ -264,9 +259,6 @@ watch(
name: `T${str1}_feinonghua`,
},
};
for (const key in checkList.value) {
addwms(layersDic[checkList.value[key]]);
}
}
);
@ -325,7 +317,6 @@ function initmap() {
var lat = coodinate[1];
var view = map.getView();
var zoom = map.getView().getZoom();
console.log(lon, lat);
view.animate({
center: [lon, lat],
duration: 1000,
@ -373,7 +364,6 @@ function initmap() {
var lat = coodinate[1];
var view = map.getView();
var zoom = map.getView().getZoom();
console.log(lon, lat);
view.animate({
center: [lon, lat],
duration: 1000,
@ -566,7 +556,6 @@ function QueryData(e, name, url, item) {
res.data.forEach(item => {
if (item.subregionCode == code) {
name = item.subregionName;
console.log(item);
arr.push(item);
}
});
@ -576,10 +565,8 @@ function QueryData(e, name, url, item) {
}
function alter() {
if (data.result.currentCount > 0) {
console.log(data.result.recordsets[0].features);
if (data.result.recordsets[0].features) {
overlay.setPosition(point.flatCoordinates);
console.log(name);
titleDiv.innerHTML = name;
}
layergaoliang = map
@ -675,11 +662,9 @@ function addConver(data, name, color, index) {
//擦除操作,生产遮罩范围
function erase(data) {
console.log(data);
const extent = [-180, -90, 180, 90];
const polygonRing = ol.geom.Polygon.fromExtent(extent);
const coords = data;
console.log(coords);
coords.forEach(coord => {
const linearRing = new ol.geom.LinearRing(coord[0]);
polygonRing.appendLinearRing(linearRing);
@ -693,10 +678,14 @@ watch(
}
);
// 农作物
let time = ref(0);
const change = () => {
time.value = 0;
};
watch(
() => checkList.value,
(val, oldVal) => {
if (val.length > oldVal.length) {
if (val.length > oldVal.length && time.value < 1) {
// 挑选出增多的数据
const newData = val.filter(item => {
const index = oldVal.findIndex(it => it === item);
@ -706,7 +695,6 @@ watch(
});
newData.forEach(item => {
if (layersDic[item]) {
console.log(layersDic[item]);
addwms(layersDic[item]);
}
});
@ -723,7 +711,6 @@ watch(
if (layersDic[item]) {
// 假设要删除的图层为 layerToRemove
var index = map.getLayers().getArray().indexOf(layersDic[item].name);
console.log(map.getLayers().getArray());
map.getLayers()
.getArray()
.forEach((ite, index) => {
@ -755,7 +742,7 @@ function rightFoldClick() {
//时间
const getFnYears = () => {
getFnYear().then(res => {
oldDatas.value = { name: res.data[0] };
oldDatas.value = { name: res.data[res.data.length - 1] };
res.data.forEach(item => {
dataSource.value.push({ name: item });
});
@ -771,10 +758,9 @@ const getFnYears = () => {
};
//镇
const getNonGrains = time => {
Township.arr = [];
townArr.value = [];
getNonGrain({ yearMonth: time }).then(res => {
console.log(res.data);
Township.arr = [];
townArr.value = [];
res.data.forEach(item => {
if (item.nonFarm > 0) {
Township.arr.push(item);
@ -786,7 +772,6 @@ const getNonGrains = time => {
subregionCode: '370211',
subregionName: '全部',
});
console.log(Township.arr);
let arr = [...res.data];
let brr = [];
arr.splice(0, 1);
@ -821,6 +806,7 @@ const selectTab = () => {
}
};
const handleData = oldData => {
time.value += 1;
checkListdata.value = [];
for (const key in dic) {
if (dic[key].disabled !== true) {
@ -838,6 +824,16 @@ const handleData = oldData => {
});
}
oldDatas.value = oldData;
let str1 = oldData.name.replace(/-/g, '_');
layersDic = {
非农化: {
setOf: `${oldData.name}-gengdi`,
name: `T${str1}_feinonghua`,
},
};
checkList.value.forEach(item => {
addwms(layersDic[item]);
});
};
function ASdivision() {

View File

@ -2122,8 +2122,9 @@ const getDistrictsBlockss = flag => {
});
};
const getCityAndCounts = city => {
getCityAndCount({ divisions: city }).then(res => {
getCityAndCount().then(res => {
cityData.value = res.data;
console.log(res.data);
});
};
@ -2692,11 +2693,16 @@ function farmland() {
let options = {
xAxis: arrs.map((item, index) => {
const data = Array(arrs.length).fill('');
data[index] = item;
data[index] = item + '年';
return {
type: 'category',
position: 'bottom',
data: data,
axisLine: {
lineStyle: {
color: 'rgba(207, 227, 252, 1)',
},
},
};
}),
grid: {
@ -2708,6 +2714,10 @@ function farmland() {
},
yAxis: {
type: 'value',
axisLabel: {
interval: 0,
color: 'rgba(207, 227, 252, 1)',
},
},
tooltip: {
trigger: 'axis',
@ -2715,7 +2725,7 @@ function farmland() {
enterable: true, // 鼠标是否可进入提示框浮层中
hideDelay: 200, // 浮层隐藏的延迟
// position: [-100, -150],
extraCssText: 'max-width:200%;max-height:83%; overflow: auto; ', //滚动条
extraCssText: 'max-width:200%;max-height:83%; overflow: auto;', //滚动条
axisPointer: {
type: 'shadow',
},
@ -2735,8 +2745,8 @@ function farmland() {
for (let index = 0; index < chartArr.value.length; index++) {
if (chartArr.value[index].name == item.seriesName) {
htmlStr += `<div style='height: auto;color:${item.color};border:1px solid${item.color};margin:5px 0;padding:5px'><div>${chartArr.value[index].name}:</div>
投资金额:${chartArr.value[index].quantity}<br/>
面积:${chartArr.value[index].sum}
投资金额:${chartArr.value[index].quantity} 万元<br/>
面积:${chartArr.value[index].sum}
</div>`;
}
}
@ -2764,10 +2774,10 @@ function farmland() {
type: 'slider',
width: '40%',
zoomLock: true, //禁止拉伸
top: '90%',
top: '78%',
start: 0,
end: ends / 3,
show: false,
show: true,
showDataShadow: false,
showDetail: false,
fillerColor: 'rgba(64, 158, 255)',