|
|
@@ -104,9 +104,9 @@ const getVarietyTabs = async (isShowPopup = true) => {
|
|
|
});
|
|
|
varietyTabs.value = res.data || []
|
|
|
if (varietyTabs.value.length > 0) {
|
|
|
- handleVarietyClick(varietyTabs.value[activeVariety.value], activeVariety.value)
|
|
|
+ handleVarietyClick(varietyTabs.value[activeVariety.value || 0], activeVariety.value || 0)
|
|
|
if(isShowPopup) {
|
|
|
- agriExecutePopupRef.value.showPopup(varietyTabs.value[activeVariety.value].farmId);
|
|
|
+ agriExecutePopupRef.value.showPopup(varietyTabs.value[activeVariety.value || 0].farmId);
|
|
|
}
|
|
|
}
|
|
|
} catch (error) {
|
|
|
@@ -126,6 +126,9 @@ const handleVarietyClick = (tab, index) => {
|
|
|
if (tab.lastViewTime == null) {
|
|
|
titlePopup.value = `勾选 ${tab.regionName} 区域`;
|
|
|
showSelectRegionPopup.value = true;
|
|
|
+ VE_API.basic_farm.updateLastViewTime({
|
|
|
+ regionId: tab.regionId,
|
|
|
+ })
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -138,12 +141,7 @@ const handleAddVariety = () => {
|
|
|
};
|
|
|
|
|
|
const handleSkipSelectRegion = () => {
|
|
|
- VE_API.basic_farm.updateLastViewTime({
|
|
|
- regionId: currentVariety.value.regionId,
|
|
|
- }).then(() => {
|
|
|
- showSelectRegionPopup.value = false;
|
|
|
- getVarietyTabs(false);
|
|
|
- });
|
|
|
+ showSelectRegionPopup.value = false;
|
|
|
};
|
|
|
|
|
|
const handleGoSelectRegion = () => {
|
|
|
@@ -191,24 +189,11 @@ const handleLockClick = () => {
|
|
|
// });
|
|
|
}
|
|
|
|
|
|
-// 实时播报数据
|
|
|
-const broadcastList = ref([]);
|
|
|
-const finished = ref(false);
|
|
|
-const currentPage = ref(1);
|
|
|
-
|
|
|
-// 播报相关事件
|
|
|
-const isSpeaking = ref(false);
|
|
|
-const speechSynthesis = window.speechSynthesis;
|
|
|
-
|
|
|
|
|
|
// 组件卸载时停止语音播放
|
|
|
onDeactivated(() => {
|
|
|
showFarmPopup.value = false;
|
|
|
isDefaultFarm.value = false;
|
|
|
- if (isSpeaking.value) {
|
|
|
- speechSynthesis.cancel();
|
|
|
- isSpeaking.value = false;
|
|
|
- }
|
|
|
});
|
|
|
|
|
|
const isExpanded = ref(false);
|