up
This commit is contained in:
@ -512,6 +512,7 @@ function initonMounted() {
|
||||
theTimes(); //年
|
||||
//地图
|
||||
initmap();
|
||||
showDaChangArea();
|
||||
areachar();
|
||||
typesof();
|
||||
farmland();
|
||||
@ -533,9 +534,11 @@ function initonMounted() {
|
||||
onUpdated(() => {
|
||||
console.log(localStorage.getItem(router.currentRoute.value.path));
|
||||
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';
|
||||
}
|
||||
@ -656,7 +659,7 @@ function QueryData(e, name, url, item) {
|
||||
value.value = code;
|
||||
getTownships();
|
||||
let arr = [];
|
||||
getTownship({ divisions: '370211' }).then(res => {
|
||||
getTownship({ divisions: '370211', yearMonth: oldDatas.value.name }).then(res => {
|
||||
res.data.forEach(item => {
|
||||
console.log(item);
|
||||
if (item.streetCode == code) {
|
||||
@ -673,7 +676,7 @@ function QueryData(e, name, url, item) {
|
||||
) {
|
||||
let code = data.result.recordsets[0].features.features[0].properties.CJQYDM;
|
||||
let arr = [];
|
||||
getvillageChun({ divisions: code }).then(res => {
|
||||
getvillageChun({ divisions: code, yearMonth: oldDatas.value.name }).then(res => {
|
||||
console.log(res.data);
|
||||
res.data.forEach(item => {
|
||||
console.log(item);
|
||||
@ -753,11 +756,20 @@ const alter = () => {
|
||||
});
|
||||
map.addOverlay(overlay);
|
||||
};
|
||||
|
||||
//创建蒙层,凸显黄岛区域
|
||||
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({
|
||||
@ -1390,7 +1402,27 @@ 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];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user