This commit is contained in:
2023-07-11 08:43:34 +08:00
parent d0eea9c22a
commit 79894eb7e8
257 changed files with 2056 additions and 1503 deletions

View File

@ -388,6 +388,7 @@ let amount = ref([
wheatOutput: 0,
},
]);
let yearTime = ref('');
//搜索
let formInline = ref({
time: '',
@ -397,7 +398,6 @@ let formInline = ref({
});
let layers = ref(null); //村
// 组件挂载完成后执行
onMounted(() => {
initonMounted();
@ -412,8 +412,10 @@ function initonMounted() {
}
onUpdated(() => {
if (localStorage.getItem(router.currentRoute.value.path) == 'false') {
document.querySelector('.mode').style.display = 'block';
document.querySelector('.mode').innerText = '地图模式';
} else {
document.querySelector('.mode').style.display = 'block';
document.querySelector('.mode').innerText = '列表模式';
}
});
@ -421,9 +423,9 @@ watch(
() => oldDatas.value,
(val, oldVal) => {
value.value = '370211';
getwheatTotalYearValues(value.value,oldDatas.value.name); //作物产量预估
getwheatHeightStandardFarmlands(value.value,oldDatas.value.name); //高标准农田
getwheatGetAllTownss(value.value,oldDatas.value.name); //镇级
getwheatTotalYearValues(value.value, oldDatas.value.name); //作物产量预估
getwheatHeightStandardFarmlands(value.value, oldDatas.value.name); //高标准农田
getwheatGetAllTownss(value.value, oldDatas.value.name); //镇级
}
);
/*-------------地图------------------------*/
@ -597,11 +599,19 @@ const SwitchMode = () => {
chartModes();
};
const resetForm = () => {
(formInline.value.year = yearTime.value), (formInline.value.statistical = '镇');
formInline.value.droughtRating = '小麦';
formInline.value.area = num.value;
onSubmit()
};
/*------------------接口--------------------*/
//列表模式年
const getparameterEstimationYears = () => {
getparameterEstimationYear().then(res => {
yearTime.value = { name: res.data[0] };
oldDatas.value = { name: res.data[0] };
res.data.forEach(item => {
dataSource.value.push({ name: item });
@ -613,22 +623,22 @@ const getparameterEstimationYears = () => {
};
//产量预估
const getwheatTotalYearValues = (city,time) => {
getwheatTotalYearValue({ divisions: city , yearMonth:time}).then(res => {
const getwheatTotalYearValues = (city, time) => {
getwheatTotalYearValue({ divisions: city, yearMonth: time }).then(res => {
estimate.value = res.data;
areachar();
});
};
//高标准农田
const getwheatHeightStandardFarmlands = (city ,time)=> {
getwheatHeightStandardFarmland({ divisions: city , yearMonth:time}).then(res => {
const getwheatHeightStandardFarmlands = (city, time) => {
getwheatHeightStandardFarmland({ divisions: city, yearMonth: time }).then(res => {
standardArr.value = res.data;
farmland();
});
};
//镇
const getwheatGetAllTownss = (city ,time) => {
getwheatGetAllTowns({ divisions: city , yearMonth:time}).then(res => {
const getwheatGetAllTownss = (city, time) => {
getwheatGetAllTowns({ divisions: city, yearMonth: time }).then(res => {
administration.value = res.data;
Township.brr = JSON.parse(JSON.stringify(res.data));
Township.arr = Township.brr.sort((a, b) => {
@ -709,7 +719,6 @@ const Deta3 = item => {
};
const dowcity = () => {
let arr = JSON.parse(JSON.stringify(amount.value[0]));
console.log(arr);
insectarr.value.push(arr);
exportExcel(insectarr.value, '干旱面积统计表', 'Sheet1');
};