|
|
@@ -97,7 +97,7 @@ const handleCommand = ({id, name}) => {
|
|
|
localStorage.setItem('selectedFarmId', id);
|
|
|
localStorage.setItem('selectedFarmName', name);
|
|
|
localStorage.setItem('selectedFarmPoint', selectedFarm.point);
|
|
|
- getLocationName();
|
|
|
+ // getLocationName();
|
|
|
getWeatherData();
|
|
|
emit('changeGarden',{id, name});
|
|
|
};
|
|
|
@@ -125,7 +125,7 @@ async function setFarmByGardenId(gardenIdValue) {
|
|
|
|
|
|
// 先刷新农场列表,确保数据是最新的
|
|
|
return new Promise((resolve) => {
|
|
|
- VE_API.farm.userFarmSelectOption({agriculturalQuery: false}).then(({data}) => {
|
|
|
+ VE_API.farm.listByUserId().then(({data}) => {
|
|
|
// const fullData = data.filter(item => item.userType === 2);
|
|
|
const fullData = data;
|
|
|
farmList.value = fullData || [];
|
|
|
@@ -140,7 +140,7 @@ async function setFarmByGardenId(gardenIdValue) {
|
|
|
localStorage.setItem('selectedFarmName', farmName.value);
|
|
|
localStorage.setItem('selectedFarmPoint', targetFarm.point);
|
|
|
|
|
|
- getLocationName();
|
|
|
+ // getLocationName();
|
|
|
getWeatherData();
|
|
|
emit('changeGarden', { id: farmId.value, name: farmName.value });
|
|
|
resolve(true);
|
|
|
@@ -197,14 +197,14 @@ function selectFarmFromList(data) {
|
|
|
// 如果没有保存的选择,按优先级选择
|
|
|
selectDefaultFarm(data);
|
|
|
}
|
|
|
- getLocationName();
|
|
|
+ // getLocationName();
|
|
|
getWeatherData();
|
|
|
emit('changeGarden',{id: farmId.value, name: farmName.value});
|
|
|
}
|
|
|
|
|
|
// 获取农场列表(不处理传入的gardenId)
|
|
|
function getFarmListWithoutGardenId() {
|
|
|
- VE_API.farm.userFarmSelectOption({agriculturalQuery: false}).then(({data}) => {
|
|
|
+ VE_API.farm.listByUserId().then(({data}) => {
|
|
|
// const fullData = data.filter(item => item.userType === 2);
|
|
|
const fullData = data;
|
|
|
farmList.value = fullData || [];
|
|
|
@@ -245,7 +245,7 @@ function selectDefaultFarm(data) {
|
|
|
localStorage.setItem('selectedFarmId', farmId.value);
|
|
|
localStorage.setItem('selectedFarmName', farmName.value);
|
|
|
localStorage.setItem('selectedFarmPoint', data[0].point);
|
|
|
- getLocationName();
|
|
|
+ // getLocationName();
|
|
|
getWeatherData();
|
|
|
}
|
|
|
|