up
This commit is contained in:
@ -489,7 +489,7 @@ let tableData = ref([]);
|
||||
// 图层字典
|
||||
let layersDic = {
|
||||
湿润: {
|
||||
setOf: '2022-12-20-ganhan',
|
||||
setOf: `2022-12-20-ganhan`,
|
||||
name: 'T2022_12_20_shirun',
|
||||
},
|
||||
适宜: {
|
||||
@ -518,6 +518,7 @@ function initonMounted() {
|
||||
theTimes(); //年
|
||||
//地图
|
||||
initmap();
|
||||
showDaChangArea();
|
||||
typesof();
|
||||
farmland();
|
||||
// ProgressBar();
|
||||
@ -530,7 +531,6 @@ function initonMounted() {
|
||||
}
|
||||
}
|
||||
checkList.value = checkListdata.value;
|
||||
|
||||
let leftWra = document.querySelector('.leftWra');
|
||||
leftWra ? (leftWra.style.transform = 'translate(-107%,0)') : '';
|
||||
let rightWra = document.querySelector('.rightWra');
|
||||
@ -539,9 +539,11 @@ function initonMounted() {
|
||||
}
|
||||
onUpdated(() => {
|
||||
if (localStorage.getItem(router.currentRoute.value.path) == 'false') {
|
||||
document.querySelector('.mode').style.display = 'block';
|
||||
document.querySelector('.mode').innerText = '地图模式';
|
||||
window.document.querySelector('#screenfull').style.display = 'none';
|
||||
} else {
|
||||
document.querySelector('.mode').style.display = 'block';
|
||||
document.querySelector('.mode').innerText = '列表模式';
|
||||
window.document.querySelector('#screenfull').style.display = 'block';
|
||||
}
|
||||
@ -661,7 +663,7 @@ function QueryData(e, name, url, item) {
|
||||
let code = data.result.recordsets[0].features.features[0].properties.XJQYDM;
|
||||
value.value = code;
|
||||
let arr = [];
|
||||
getTownship().then(res => {
|
||||
getTownship({ divisions: '370211', yearMonth: oldDatas.value.name }).then(res => {
|
||||
res.data.forEach(item => {
|
||||
if (item.streetCode == code) {
|
||||
name = item.streetName;
|
||||
@ -677,16 +679,18 @@ function QueryData(e, name, url, item) {
|
||||
) {
|
||||
let code = data.result.recordsets[0].features.features[0].properties.CJQYDM;
|
||||
let arr = [];
|
||||
getAdministrativeAreaChun({ divisions: code }).then(res => {
|
||||
res.data.forEach(item => {
|
||||
console.log(item);
|
||||
name = item.streetName;
|
||||
arr.push(item);
|
||||
});
|
||||
name = res.data[0].streetName;
|
||||
alterArr.value = arr;
|
||||
alter();
|
||||
});
|
||||
getAdministrativeAreaChun({ divisions: code, yearMonth: oldDatas.value.name }).then(
|
||||
res => {
|
||||
res.data.forEach(item => {
|
||||
console.log(item);
|
||||
name = item.streetName;
|
||||
arr.push(item);
|
||||
});
|
||||
name = res.data[0].streetName;
|
||||
alterArr.value = arr;
|
||||
alter();
|
||||
}
|
||||
);
|
||||
}
|
||||
function alter() {
|
||||
if (data.result.currentCount > 0) {
|
||||
@ -742,11 +746,20 @@ function QueryData(e, name, url, item) {
|
||||
overlay.setPosition(undefined);
|
||||
});
|
||||
}
|
||||
|
||||
//创建蒙层,凸显黄岛区域
|
||||
function showDaChangArea() {
|
||||
axios.get('/json/huangdao.json').then(({ data }) => {
|
||||
const fts = new ol.format.GeoJSON().readFeatures(data);
|
||||
const ft = fts[0];
|
||||
addConver(ft.getGeometry().getCoordinates(), 'huandao');
|
||||
});
|
||||
}
|
||||
//添加遮罩
|
||||
function addConver(data) {
|
||||
function addConver(data, name) {
|
||||
let source = new ol.source.Vector();
|
||||
var converLayer = new ol.layer.Vector({
|
||||
id: 'zhezhao',
|
||||
id: name ? name : 'zhezhao',
|
||||
source: source,
|
||||
style: new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
@ -838,7 +851,32 @@ const changeTableHead = (tableData, fieldName) => {
|
||||
const list = tableData.map(item => {
|
||||
const obj = {};
|
||||
for (const k in item) {
|
||||
if (fieldName[k]) {
|
||||
if (fieldName[k] == '区域名称') {
|
||||
obj[fieldName[k]] = item[k];
|
||||
}
|
||||
}
|
||||
for (const k in item) {
|
||||
if (fieldName[k] == '湿润 (亩)') {
|
||||
obj[fieldName[k]] = item[k];
|
||||
}
|
||||
}
|
||||
for (const k in item) {
|
||||
if (fieldName[k] == '适宜(亩)') {
|
||||
obj[fieldName[k]] = item[k];
|
||||
}
|
||||
}
|
||||
for (const k in item) {
|
||||
if (fieldName[k] == '轻度干旱(亩)') {
|
||||
obj[fieldName[k]] = item[k];
|
||||
}
|
||||
}
|
||||
for (const k in item) {
|
||||
if (fieldName[k] == '中度干旱(亩)') {
|
||||
obj[fieldName[k]] = item[k];
|
||||
}
|
||||
}
|
||||
for (const k in item) {
|
||||
if (fieldName[k] == '重度干旱(亩)') {
|
||||
obj[fieldName[k]] = item[k];
|
||||
}
|
||||
}
|
||||
@ -874,10 +912,12 @@ const exportExcel = (
|
||||
};
|
||||
const list = changeTableHead(tableData, fieldNameObj);
|
||||
// 创建工作表
|
||||
console.log(list);
|
||||
const data = xlsx.utils.json_to_sheet(list);
|
||||
// 创建工作簿
|
||||
const wb = xlsx.utils.book_new();
|
||||
// 将工作表放入工作簿中
|
||||
console.log(data);
|
||||
xlsx.utils.book_append_sheet(wb, data, pageName);
|
||||
// 生成文件并下载
|
||||
xlsx.writeFile(wb, `${fileName}.xlsx`);
|
||||
@ -919,6 +959,35 @@ watch(
|
||||
getproportionOfAreas(value.value, oldDatas.value.name); //干旱等级面积占比
|
||||
geteachFreezingGradeAreas(oldDatas.value.name); //高标准农田干旱等级面积占比
|
||||
getTownships(value.value, oldDatas.value.name); //镇
|
||||
// let str = oldDatas.value.name;
|
||||
// let str1 = str.replace(/-/g, '_');
|
||||
// console.log(str1,)
|
||||
// layersDic = {
|
||||
// 湿润: {
|
||||
// setOf: `${oldDatas.value.name}-ganhan`,
|
||||
// name: 'T2023_01_03_shirun',
|
||||
// },
|
||||
// 适宜: {
|
||||
// setOf: `${oldDatas.value.name}-ganhan`,
|
||||
// name: 'T2023_01_03_shiyi',
|
||||
// },
|
||||
// 轻度干旱: {
|
||||
// setOf: '2022-12-20-ganhan',
|
||||
// name: 'T2022_12_20_qingduganhan',
|
||||
// },
|
||||
// 中度干旱: {
|
||||
// setOf: '2022-12-20-ganhan',
|
||||
// name: 'T2022_12_20_medium_ganhan',
|
||||
// },
|
||||
// 重度干旱: {
|
||||
// setOf: '2022-12-20-ganhan',
|
||||
// name: 'T2022_12_20_serious_ganhan',
|
||||
// },
|
||||
// };
|
||||
// for (const key in checkList.value) {
|
||||
// console.log();
|
||||
// addwms(layersDic[checkList.value[key]]);
|
||||
// }
|
||||
}
|
||||
);
|
||||
let nums = 0;
|
||||
@ -1350,6 +1419,7 @@ const Deta4 = item => {
|
||||
brr = brr.sort((a, b) => {
|
||||
return a.region.length - b.region.length;
|
||||
});
|
||||
console.log(brr);
|
||||
exportExcel(brr, `${region}干旱等级面积-行政区划`, 'Sheet1');
|
||||
});
|
||||
} else {
|
||||
@ -1384,12 +1454,12 @@ const Deta4 = item => {
|
||||
}
|
||||
});
|
||||
});
|
||||
console.log(brr);
|
||||
exportExcel(brr, `${region}作物干旱等级统计-行政区划`, 'Sheet1');
|
||||
});
|
||||
}
|
||||
};
|
||||
const dowcity = () => {
|
||||
console.log(insectarr);
|
||||
let arr = JSON.parse(JSON.stringify(amount.value[0]));
|
||||
arr.region = '合计';
|
||||
insectarr.value.push(arr);
|
||||
|
Reference in New Issue
Block a user