|
|
@@ -212,15 +212,23 @@ const getSpecieList = () => {
|
|
|
VE_API.farm.fetchSpecieList({ agriculturalId: userInfo?.agriculturalId }).then(({ data }) => {
|
|
|
if (data && data.length) {
|
|
|
options.value = data || [];
|
|
|
+ let schemeType = "left"; // 默认使用left
|
|
|
+
|
|
|
if (sessionStorage.getItem("specieValue")) {
|
|
|
specieValue.value = sessionStorage.getItem("specieValue");
|
|
|
currentTabIndex.value = sessionStorage.getItem("currentTabIndex");
|
|
|
sessionStorage.removeItem("specieValue");
|
|
|
sessionStorage.removeItem("currentTabIndex");
|
|
|
+
|
|
|
+ // 判断恢复的specieValue是否是最后一项
|
|
|
+ const currentIndex = data.findIndex(item => item.defaultContainerId === specieValue.value);
|
|
|
+ if (currentIndex === data.length - 1) {
|
|
|
+ schemeType = "right";
|
|
|
+ }
|
|
|
} else {
|
|
|
specieValue.value = data[0]?.defaultContainerId;
|
|
|
}
|
|
|
- getListMySchemes("left");
|
|
|
+ getListMySchemes(schemeType);
|
|
|
}
|
|
|
});
|
|
|
};
|