Browse Source

Merge branch 'farmer' of http://www.sysuimars.cn:3000/feiniao/feiniao-farm-h5 into farmer

lxf 1 day ago
parent
commit
f26f3f37b2

+ 1 - 5
src/views/old_mini/agri_record/index.vue

@@ -185,11 +185,7 @@ const speechSynthesis = window.speechSynthesis;
 // 组件卸载时停止语音播放
 onDeactivated(() => {
     showFarmPopup.value = false;
-    isDefaultFarm.value = false;
-    if (isSpeaking.value) {
-        speechSynthesis.cancel();
-        isSpeaking.value = false;
-    }
+    regionData.value = null;
 });
 
 const isExpanded = ref(false);

+ 7 - 4
src/views/old_mini/create_farm/index.vue

@@ -690,10 +690,13 @@ function getSpecieList() {
         // 只保留名称包含“荔枝”的品类
         const litchiList = list.filter((item) => item?.name && item.name.includes("荔枝"));
         specieList.value = litchiList;
-        // 非编辑模式且当前未选择品类时,默认选中第一项
-        const noSpeciesSelected =
-            !Array.isArray(ruleForm.speciesItem) || ruleForm.speciesItem.length === 0;
-        if (route.query.type !== "edit" && noSpeciesSelected && litchiList.length > 0) {
+        // 返回空列表时,重置已选品类,避免保留上一次默认项
+        if (litchiList.length === 0) {
+            ruleForm.speciesItem = [];
+            return litchiList;
+        }
+        //列表有值时,默认选中第一项
+        if (litchiList.length > 0) {
             const first = { value: litchiList[0].id, ...litchiList[0] };
             ruleForm.speciesItem = [first];
             // 同步触发品类变更逻辑(加载品种、自动生成农场名等)

+ 1 - 0
src/views/old_mini/monitor/index.vue

@@ -200,6 +200,7 @@ const handleLockClick = () => {
 onDeactivated(() => {
     showFarmPopup.value = false;
     isDefaultFarm.value = false;
+    regionData.value = null;
 });
 
 const isExpanded = ref(false);

+ 2 - 1
src/views/old_mini/monitor/subPages/farmInfo.vue

@@ -227,8 +227,9 @@ const handleEditMap = () => {
 <style lang="scss" scoped>
 .farm-details-page {
     background: #f2f3f5;
-    height: 100vh;
+    height: calc(100vh - 60px);
     padding: 10px 12px;
+    overflow: auto;
 
     .line-title {
         position: relative;