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

@ -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]);
});
});
};