Browse Source

refactor: 删除多余页面和组件

lxf 2 weeks ago
parent
commit
c8637c1db6
63 changed files with 30 additions and 27182 deletions
  1. 0 42
      src/components/album_compoents/albumCarousel.vue
  2. 0 119
      src/components/album_compoents/albumCarousel7d.vue
  3. 0 846
      src/components/album_compoents/albumCarouselItem.vue
  4. 0 823
      src/components/album_compoents/albumDrawBox.vue
  5. 0 88
      src/components/album_compoents/cacheImg.js
  6. 0 327
      src/components/album_compoents/detailDailog.vue
  7. 0 256
      src/components/album_compoents/utils.js
  8. 0 446
      src/components/detailDialog.vue
  9. 0 387
      src/components/gardenList.vue
  10. 0 231
      src/components/pageComponents/AgriculturalInteractionCard.vue
  11. 0 1731
      src/components/pageComponents/ArchivesFarmTimeLine copy.vue
  12. 0 1086
      src/components/pageComponents/ArchivesFarmTimeLine.vue
  13. 0 900
      src/components/pageComponents/FarmWorkPlanTimeline.vue
  14. 0 51
      src/components/pageComponents/FnShareSheet.vue
  15. 0 1072
      src/components/pageComponents/GrowthStageTimeline.vue
  16. 0 158
      src/components/pageComponents/PhenologyTrackTimelineItem copy.vue
  17. 0 187
      src/components/pageComponents/TabList.vue
  18. 30 19
      src/components/pageComponents/locationSearch.vue
  19. 0 426
      src/components/popup/UploadProgressPopup.vue
  20. 0 202
      src/components/popup/agriExecutePopup.vue
  21. 0 317
      src/components/popup/confirmDrawTypePopup.vue
  22. 0 163
      src/components/popup/droneConsultPopup.vue
  23. 0 494
      src/components/popup/farmInfoPopup copy.vue
  24. 0 328
      src/components/popup/farmInfoPopup.vue
  25. 0 385
      src/components/popup/interactPopup.vue
  26. 0 147
      src/components/popup/reviewUploadPopup.vue
  27. 0 161
      src/components/popup/selectRegionPopup.vue
  28. 0 185
      src/components/popup/startInteractPopup.vue
  29. 0 119
      src/components/popup/uploadTips.vue
  30. 0 492
      src/components/recordItem.vue
  31. 0 400
      src/components/weatherChart.vue
  32. 0 673
      src/components/weatherInfo copy.vue
  33. 0 715
      src/components/weatherInfo.vue
  34. 0 126
      src/utils/back/DialogModel1.vue
  35. 0 485
      src/views/old_mini/agri_file/components/remoteSensingChart.vue
  36. 0 403
      src/views/old_mini/agri_file/pages/diagnosisReport copy.vue
  37. 0 23
      src/views/old_mini/agri_file/pages/locationCheckPass.vue
  38. 0 141
      src/views/old_mini/agri_record/components/areaMap.js
  39. 0 94
      src/views/old_mini/agri_record/components/mapInfo.vue
  40. 0 269
      src/views/old_mini/agri_record/index.vue
  41. 0 248
      src/views/old_mini/create_farm/editMap.vue
  42. 0 1311
      src/views/old_mini/create_farm/index copy.vue
  43. 0 1043
      src/views/old_mini/create_farm/index.vue
  44. 0 280
      src/views/old_mini/create_farm/map/editMap copy.js
  45. 0 146
      src/views/old_mini/create_farm/map/editMap.js
  46. 0 98
      src/views/old_mini/create_farm/map/index.js
  47. 0 766
      src/views/old_mini/create_farm/selectCrop.vue
  48. 0 388
      src/views/old_mini/farm_info/index.vue
  49. 0 251
      src/views/old_mini/farm_info/popup/soilPopup.vue
  50. 0 256
      src/views/old_mini/growth_report/adjustPopup.vue
  51. 0 409
      src/views/old_mini/growth_report/components/PlotDetailContent.vue
  52. 0 165
      src/views/old_mini/growth_report/components/RiskReportContent.vue
  53. 0 415
      src/views/old_mini/growth_report/components/RiskReportPanel.vue
  54. 0 190
      src/views/old_mini/interactionList/components/examplePopup.vue
  55. 0 259
      src/views/old_mini/interactionList/components/morePopup.vue
  56. 0 840
      src/views/old_mini/interactionList/drawRegion.vue
  57. 0 233
      src/views/old_mini/interactionList/drawRegion1.vue
  58. 0 1466
      src/views/old_mini/interactionList/index.vue
  59. 0 669
      src/views/old_mini/interactionList/map/drawRegionMap.js
  60. 0 63
      src/views/old_mini/recordDetails/components/RiskAssessPopup.vue
  61. 0 1553
      src/views/old_mini/recordDetails/index.vue
  62. 0 472
      src/views/old_mini/recordDetails/mapManage.vue
  63. 0 144
      src/views/old_mini/work_detail/components/mapInfo.vue

+ 0 - 42
src/components/album_compoents/albumCarousel.vue

@@ -1,42 +0,0 @@
-<template>
-    <album-carousel-item v-if="images" :labelText="labelText" :imgData="imgData" :imgType="imgType" :images="images" :isAchievementImgs="isAchievementImgs" :disableClick="disableClick"></album-carousel-item>
-</template>
-
-<script setup>
-import { toRefs } from "vue";
-import "./cacheImg.js"
-import AlbumCarouselItem from "./albumCarouselItem";
-
-const props =defineProps({
-  images:{
-    type: Array,
-    default: () => [],
-  },
-  labelText:{
-    type: String,
-    default: '',
-  },
-  isAchievementImgs:{
-    type: Boolean,
-    default: false,
-  },
-  imgData:{
-    type: Object,
-    default: () => {},
-  },
-  imgType:{
-    type: String,
-    default: '',
-  },
-  disableClick:{
-    type: Boolean,
-    default: false,
-  },
-})
-const { images } = toRefs(props);
-
-</script>
-
-<style lang="scss" scoped>
-@import "src/styles/index";
-</style>

+ 0 - 119
src/components/album_compoents/albumCarousel7d.vue

@@ -1,119 +0,0 @@
-<template>
-  <template v-for="(images) in imagesList" :key="images.id">
-    <album-carousel-item :farmId="farmId" :lock="lock" :images="images"></album-carousel-item>
-    <div style="height: 5px"></div>
-  </template>
-</template>
-
-<script setup>
-import { ref, computed, onMounted, onUnmounted } from "vue";
-import "./cacheImg.js"
-import AlbumCarouselItem from "./albumCarouselItem";
-import {dateFormat} from "@/utils/date_util.js"
-import eventBus from "@/api/eventBus";
-import { useRoute } from "vue-router";
-const route = useRoute();
-
-const props =defineProps({
-  sampleId:{
-    type: [Number, String],
-    required: false
-  },
-  lock:{
-    type: Boolean,
-    default: true
-  },
-  farmId:{
-    type: [Number, String],
-    required: true
-  },
-  farmWork:{
-    type: Object,
-    required: false
-  }
-})
-const imagesList = ref([]);
-let params = {farmId: props.farmId}
-
-onMounted(() => {
-  if(props.sampleId){
-    params["sampleId"] = props.sampleId
-  }
-  if(props.farmWork?.executeDate){
-    let execcuteDate = new Date(props.farmWork.executeDate)
-    let beforeExecuteDate = new Date(props.farmWork.beforeExecuteDate)
-    const pastDate = new Date(beforeExecuteDate);
-    const futureDate = new Date(execcuteDate);
-    params.startDate = dateFormat(pastDate, "YY-mm-dd");
-    params.endDate = dateFormat(futureDate, "YY-mm-dd");
-  }
-  getImageList(params)
-});
-
-const updateData = () =>{
-  params.farmId = props.farmId
-  getImageList(params)
-}
-
-onUnmounted(()=>{
-  eventBus.off("chart:updateOption",updateData)
-})
-
-const getImageList = (params) =>{
-  imagesList.value = []
-  VE_API.image.list(params).then(res => {
-    if(res.code === 0){
-      let result = splitByWeek(res.data, params.startDate, params.endDate);
-      if(result && result.length > 0){
-        result = result.reverse()
-      }
-      for(let i=0;result != null && i<result.length;i++){
-        if (result[i] && result[i].length > 0){
-          imagesList.value.push(result[i])
-        }
-      }
-    }
-  }).catch(err => {
-    console.log(err)
-  })
-}
-
-// eventBus.off("chart:updateOption",updateData)
-eventBus.on("chart:updateOption",updateData)
-
-function splitByWeek(items, startDate, endDate) {
-  // 将开始时间和结束时间转换为时间戳
-  const start = new Date(startDate).getTime();
-  const end = new Date(endDate).getTime();
-
-  // 创建一个用于存储按周分组的结果
-  const weeklyGroups = [];
-
-  // 遍历每一项
-  items.forEach(item => {
-    const uploadDate = new Date(item.uploadDate).getTime();
-
-    // 确保上传日期在开始日期和结束日期之间
-    if (uploadDate >= start && uploadDate <= end) {
-      // 计算上传日期属于第几周
-      const weekIndex = Math.floor((uploadDate - start) / (7 * 24 * 60 * 60 * 1000));
-
-      // 如果该周的数组不存在,则创建一个
-      if (!weeklyGroups[weekIndex]) {
-        weeklyGroups[weekIndex] = [];
-      }
-
-      // 将当前项添加到对应的周数组中
-      weeklyGroups[weekIndex].push(item);
-    }
-  });
-
-  return weeklyGroups;
-}
-
-
-</script>
-
-<style lang="scss" scoped>
-@import "src/styles/index";
-</style>

+ 0 - 846
src/components/album_compoents/albumCarouselItem.vue

@@ -1,846 +0,0 @@
-<template>
-    <div class="carousel-container">
-        <!-- 图片列表 -->
-        <div class="carousel-wrapper" :style="carouselStyle">
-            <!-- <photo-provider v-if="images" :photo-closable="true" @visibleChange="handleVisibleChange">
-                
-                <template  v-for="(photo, index) in images"
-                   :key="photo.id">
-                    <album-draw-box :isShowNum="0" :farmId="766" :photo="photo" :current="currentIndex" :index="index" :length="images.length"
-                    ></album-draw-box>
-                    </template>
-            </photo-provider> -->
-            <div class="carousel-img" v-for="(photo, index) in images" :key="index">
-                <div class="label-text" v-if="labelText">{{ labelText }}</div>
-                <img class="img-dom" :index="index" @click="clickPhoto(photo)" :src="getPhotoSrc(photo)" alt="" />
-
-                <div class="carousel-img-mask app-mask" v-if="!isAchievementImgs && imgType === 'app'">
-                    <div class="mask-content app-mask-content">
-                        <div class="app-mask-top">
-                            <div class="app-mask-top-left">
-                                <div class="app-year">{{ formatYear(imgData?.createTime || imgData?.updateTime) }}</div>
-                                <div class="app-date-wrapper">
-                                    <div class="app-date-line"></div>
-                                    <div class="app-date">
-                                        {{ formatMonthDay(imgData?.createTime || imgData?.updateTime) }}
-                                    </div>
-                                </div>
-                            </div>
-                            <div>
-                                <!-- <div class="app-mask-top-right">
-                                    <div class="app-phenology">当前处于 {{ imgData?.phenologyName }}</div>
-                                    <div class="app-uploader">上传人:{{ imgData?.sourceDataJson?.userName }}</div>
-                                </div> -->
-                                <!-- 底部中间/右侧:天气信息和位置 -->
-                                <div class="app-mask-bottom">
-                                    <div class="app-weather-info">
-                                        <div class="app-weather-item">
-                                            <img class="app-weather-icon" src="@/assets/watermark/temp.png" alt="" />
-                                            <span
-                                                >{{ imgData?.sourceDataJson?.suitability?.tempMin }}-{{
-                                                    imgData?.sourceDataJson?.suitability?.tempMax
-                                                }}℃ {{ imgData?.sourceDataJson?.suitability?.tempSuitability }}</span
-                                            >
-                                        </div>
-                                        <div class="app-weather-item">
-                                            <img class="app-weather-icon" src="@/assets/watermark/shidu.png" alt="" />
-                                            <span>{{ imgData?.sourceDataJson?.suitability?.humiditySuitability }}</span>
-                                        </div>
-                                        <div class="app-weather-item">
-                                            <img class="app-weather-icon" src="@/assets/watermark/fushe.png" alt="" />
-                                            <span>{{ imgData?.sourceDataJson?.suitability?.vindexSuitability }}</span>
-                                        </div>
-                                        <!-- <span class="app-weather-separator" v-if="imgData?.sourceDataJson?.address">-</span>
-                                        <span class="app-location">
-                                            {{ imgData?.sourceDataJson?.address }}
-                                        </span> -->
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div class="carousel-img-mask app-mask" v-else-if="!isAchievementImgs && imgType === 'dji'">
-                    <div class="mask-content app-mask-content">
-                        <div class="dji-mask-top">
-                            <span>{{ imgData?.sourceDataJson?.resFilename?.[index]?.treeCode }}</span>
-                            <span>蓬径:{{ imgData?.sourceDataJson?.resFilename?.[index]?.pengjing }}m</span>
-                            <span>高度:{{ imgData?.sourceDataJson?.resFilename?.[index]?.height.toFixed(1) }}m</span>
-                            <span>{{ imgData?.sourceDataJson?.resFilename?.[index]?.highYield === 1 ? '高产树' : '低产树' }}</span>
-                            <span>{{ imgData?.sourceDataJson?.resFilename?.[index]?.pingzhong }}</span>
-                        </div>
-                        <div class="app-mask-bottom">
-                            <div class="app-weather-info">
-                                <div class="app-weather-item">
-                                    <img class="app-weather-icon" src="@/assets/watermark/temp.png" alt="" />
-                                    <span
-                                        >{{ imgData?.sourceDataJson?.suitability?.tempMin }}-{{
-                                            imgData?.sourceDataJson?.suitability?.tempMax
-                                        }}℃ {{ imgData?.sourceDataJson?.suitability?.tempSuitability }}</span
-                                    >
-                                </div>
-                                <div class="app-weather-item">
-                                    <img class="app-weather-icon" src="@/assets/watermark/shidu.png" alt="" />
-                                    <span>{{ imgData?.sourceDataJson?.suitability?.humiditySuitability }}</span>
-                                </div>
-                                <div class="app-weather-item">
-                                    <img class="app-weather-icon" src="@/assets/watermark/fushe.png" alt="" />
-                                    <span>{{ imgData?.sourceDataJson?.suitability?.vindexSuitability }}</span>
-                                </div>
-                            </div>
-                        </div>
-                        <div class="garden-info">
-                            <span class="drone-date">{{ imgData?.droneDate }}</span>
-                            <span class="code van-ellipsis">{{ imgData?.sourceDataJson?.resFilename?.[index]?.longCode }}</span>
-                        </div>
-                        <div class="base-map-wrapper" v-if="imgData?.sourceDataJson?.resFilename?.[index]?.baseMap">
-                            <img
-                                class="base-map-img"
-                                :src="imgData?.sourceDataJson?.resFilename?.[index]?.baseMap"
-                                alt=""
-                            />
-                        </div>
-                    </div>
-                </div>
-
-                <template v-else>
-                    <div class="carousel-img-mask" v-if="!isAchievementImgs">
-                        <div class="mask-content">
-                            <div class="mask-line line-top">
-                                <span class="date-text">{{ imgData?.executeDate }}</span>
-                                <span class="line-separator">|</span>
-                                <span class="executor-text">执行人:{{ imgData?.executeName }}</span>
-                            </div>
-                            <div class="mask-line line-middle">
-                                <span class="work-name">{{ imgData?.farmWorkName }}</span>
-                                <span class="line-separator">|</span>
-                                <span class="location-text">
-                                    <img src="@/assets/watermark/address.png" alt="location" class="location-icon" />
-                                    {{ imgData?.farmName }}
-                                </span>
-                            </div>
-                            <div class="mask-line line-bottom">
-                                <span class="prescription-text">药物处方:{{ prescriptionText }}</span>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="carousel-img-mask" v-if="isAchievementImgs && imgData?.reCheckText">
-                        <div class="mask-content">
-                            <div class="review-effect-text">{{ $t('复核成效') }}</div>
-                            <div class="review-effect-content">
-                                <span class="review-effect-content-text">{{ imgData?.reCheckText }}</span>
-                            </div>
-                        </div>
-                    </div>
-                </template>
-            </div>
-        </div>
-
-        <!-- 左右箭头 -->
-        <div @click.stop="prev" v-if="currentIndex !== 0" class="arrow left-arrow">
-            <el-icon color="#F0D09C"><ArrowLeftBold /></el-icon>
-        </div>
-        <div @click.stop="next" v-if="images && currentIndex !== images.length - 1" class="arrow right-arrow">
-            <el-icon color="#F0D09C"><ArrowRightBold /></el-icon>
-        </div>
-
-        <div class="curren-img" v-if="currentPhoto">
-            <div ref="currentImgRef" class="carousel-img" :class="{ noFit: isAchievementImgs }">
-                <img class="img-dom" :src="currentPhoto" alt="" />
-                <img src="@/assets/img/home/qrcode.png" alt="" class="code-icon" />
-                <div class="carousel-img-mask" v-if="!isAchievementImgs">
-                    <div class="mask-content">
-                        <div class="mask-line line-top">
-                            <span class="date-text">{{ imgData?.executeDate }}</span>
-                            <span class="line-separator">|</span>
-                            <span class="executor-text">执行人:{{ imgData?.executeName }}</span>
-                        </div>
-                        <div class="mask-line line-middle">
-                            <span class="work-name">{{ imgData?.farmWorkName }}</span>
-                            <span class="line-separator">|</span>
-                            <span class="location-text">
-                                <img src="@/assets/watermark/address.png" alt="location" class="location-icon" />
-                                {{ imgData?.farmName }}
-                            </span>
-                        </div>
-                        <div class="mask-line line-bottom">
-                            <span class="prescription-text">药物处方:{{ prescriptionText }}</span>
-                        </div>
-                    </div>
-                </div>
-                <div class="carousel-img-mask" v-if="isAchievementImgs && imgData?.reCheckText">
-                    <div class="mask-content">
-                        <div class="review-effect-text">{{ $t('复核成效') }}</div>
-                        <div class="review-effect-content">
-                            <span class="review-effect-content-text">{{ imgData?.reCheckText }}</span>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <popup class="cavans-popup" v-model:show="showPopup" teleport="body" z-index="9999">
-            <div class="cavans-content">
-                <img class="current-img" :src="previewCanvas" alt="" />
-            </div>
-            <!-- 底部操作按钮 -->
-            <div class="bottom-actions" @click.stop="showPopup = false">
-                <div class="action-buttons">
-                    <div class="action-btn text-btn">{{ $t('&lt;&lt;长按图片保存或转发&gt;&gt;') }}</div>
-                    <!-- <div class="action-btn green-btn" @click.stop="handleWechat">
-                        <div class="icon-circle">
-                            <img src="@/assets/img/home/wechat.png" alt="" />
-                        </div>
-                        <span class="btn-label">{{ $t('微信') }}</span>
-                    </div>
-                    <div class="action-btn orange-btn" @click.stop="handleSaveImage">
-                        <div class="icon-circle">
-                            <el-icon :size="24"><Download /></el-icon>
-                        </div>
-                        <span class="btn-label">{{ $t('保存图片') }}</span>
-                    </div> -->
-                </div>
-                <div class="cancel-btn" @click="handleCancel">{{ $t('取消') }}</div>
-            </div>
-        </popup>
-    </div>
-</template>
-
-<script setup>
-import { Popup } from "vant";
-import { toRefs, ref, computed, onMounted, onUnmounted, nextTick, watch } from "vue";
-import AlbumDrawBox from "./albumDrawBox.vue";
-import html2canvas from "html2canvas";
-import { base_img_url2 } from "@/api/config";
-import "./cacheImg.js";
-const props = defineProps({
-    images: {
-        type: Array,
-        required: true,
-    },
-    labelText: {
-        type: String,
-        default: "",
-    },
-    isAchievementImgs: {
-        type: Boolean,
-        default: false,
-    },
-    imgData: {
-        type: Object,
-        default: () => {},
-    },
-    imgType: {
-        type: String,
-        default: "",
-    },
-    disableClick: {
-        type: Boolean,
-        default: false,
-    },
-});
-const { images, labelText, isAchievementImgs, imgType, disableClick } = toRefs(props);
-let timer = null;
-const currentIndex = ref(0);
-
-onMounted(() => {
-    updateImagePosition();
-    clearAndRestartTimer();
-    prescriptionText.value = buildPrescriptionText(props.imgData.prescriptionList);
-});
-onUnmounted(() => {
-    clearInterval(timer);
-});
-
-watch(
-    () => props.imgData,
-    (newVal) => {
-        if (newVal && newVal.prescriptionList) {
-            prescriptionText.value = buildPrescriptionText(newVal.prescriptionList);
-        }
-    }
-);
-
-const prescriptionText = ref("");
-function buildPrescriptionText(list) {
-    if (!list || !Array.isArray(list) || list.length === 0) {
-        return "无处方";
-    }
-    try {
-        // 兼容原有格式:嵌套结构 [{ pesticideFertilizerList: [...] }]
-        if (list[0]?.pesticideFertilizerList) {
-            const result = list
-                .map((group) =>
-                    (group.pesticideFertilizerList || [])
-                        .map((p) => p.defaultName || p.pesticideFertilizerName || "")
-                        .filter(Boolean)
-                        .join("+")
-                )
-                .filter(Boolean)
-                .join("+");
-            return result || "无处方";
-        }
-        
-        // 兼容新格式:直接是字符串数组 ["药物1", "药物2"]
-        if (typeof list[0] === "string") {
-            return list.filter(Boolean).join("+") || "无处方";
-        }
-        
-        // 兼容新格式:对象数组 [{ defaultName: "xxx" }, { defaultName: "yyy" }]
-        if (list[0]?.defaultName || list[0]?.pesticideFertilizerName) {
-            return list
-                .map((p) => p.defaultName || p.pesticideFertilizerName || "")
-                .filter(Boolean)
-                .join("+") || "无处方";
-        }
-        
-        return "无处方";
-    } catch {
-        return "无处方";
-    }
-}
-
-const updateImagePosition = () => {
-    carouselStyle.value.transform = `translateX(-${currentIndex.value * 100}%)`;
-};
-
-const clickPhotoShow = () => {
-    if (timer) {
-        clearInterval(timer);
-    }
-};
-
-// 图片显隐切换回调
-const handleVisibleChange = ({ visible }) => {
-    if (visible.value) {
-        if (timer) {
-            clearInterval(timer);
-        }
-    } else {
-        clearAndRestartTimer();
-    }
-};
-
-// 计算轮播图样式
-const carouselStyle = computed(() => {
-    return {
-        transform: `translateX(-${currentIndex.value * 100}%)`,
-    };
-});
-
-// 下一张图片
-const next = () => {
-    // 图片总数
-    const totalImages = images.value.length;
-    currentIndex.value = (currentIndex.value + 1) % totalImages;
-    updateImagePosition();
-    clearAndRestartTimer();
-};
-
-// 上一张图片
-const prev = () => {
-    // 图片总数
-    const totalImages = images.value.length;
-    currentIndex.value = (currentIndex.value - 1 + totalImages) % totalImages;
-    updateImagePosition();
-    clearAndRestartTimer();
-};
-
-const clearAndRestartTimer = () => {
-    if (timer) {
-        clearInterval(timer);
-    }
-    // timer = setInterval(next, 5000);
-};
-
-const showPopup = ref(false);
-const currentPhoto = ref(null);
-const previewCanvas = ref(null);
-
-const currentImgRef = ref(null);
-const clickPhoto = (photo) => {
-    if (disableClick.value) {
-        return;
-    }
-    currentPhoto.value = getPhotoSrc(photo);
-    nextTick(async () => {
-        const canvas = await html2canvas(currentImgRef.value, {
-            backgroundColor: "#ffffff00",
-            scrollY: -window.scrollY, // 处理滚动条位置
-            allowTaint: true, // 允许跨域图片
-            useCORS: true, // 使用CORS
-            scale: 2, // 提高分辨率(2倍)
-            height: currentImgRef.value.scrollHeight, // 设置完整高度
-            width: currentImgRef.value.scrollWidth, // 设置完整宽度
-            logging: true, // 开启日志(调试用)
-        });
-
-        // 转换为图片并下载
-        const image = canvas.toDataURL("image/png");
-        setTimeout(() => {
-            previewCanvas.value = image;
-            showPopup.value = true;
-        }, 100);
-    });
-};
-
-const handleSaveImage = () => {
-    downloadImage(previewCanvas.value, "执行照片");
-};
-
-function downloadImage(dataUrl, filename) {
-    const link = document.createElement("a");
-    link.href = dataUrl;
-    link.download = filename;
-    document.body.appendChild(link);
-    link.click();
-    document.body.removeChild(link);
-}
-
-const getPhotoSrc = (photo) => {
-    // if (isAchievementImgs.value) {
-    //     return photo;
-    // }
-    return base_img_url2 + (photo.cloudFilename ? photo.cloudFilename : photo);
-};
-
-// 格式化年份
-const formatYear = (dateStr) => {
-    if (!dateStr) return "";
-    const date = new Date(dateStr);
-    if (Number.isNaN(date.getTime())) return "";
-    return date.getFullYear().toString();
-};
-
-// 格式化月/日
-const formatMonthDay = (dateStr) => {
-    if (!dateStr) return "";
-    const date = new Date(dateStr);
-    if (Number.isNaN(date.getTime())) return "";
-    const m = date.getMonth() + 1;
-    const d = date.getDate();
-    return `${m}/${d}`;
-};
-</script>
-
-<style lang="scss" scoped>
-@import "src/styles/index";
-.carousel-container {
-    position: relative;
-    width: 100%;
-    overflow: hidden;
-    margin: 0 auto;
-    .curren-img {
-        position: fixed;
-        bottom: 0;
-        left: 0;
-        right: 0;
-        width: 80%;
-        height: 100%;
-        margin: 0 auto;
-        z-index: -1;
-        pointer-events: none;
-        .carousel-img {
-            width: 100%;
-            position: relative;
-            overflow: hidden;
-        }
-        .img-dom {
-            width: 100%;
-            height: 100%;
-            object-fit: cover;
-            border-radius: 8px;
-        }
-    }
-    .carousel-wrapper {
-        display: flex;
-        transition: transform 0.5s ease;
-        width: 100%;
-        .carousel-img {
-            width: calc(100vw - 48px);
-            min-width: calc(100vw - 48px);
-            // min-width: 312px;
-            // height: 255px;
-            max-height: 90vh;
-            object-fit: cover;
-            position: relative;
-            overflow: hidden;
-            &.noFit {
-                height: auto;
-                object-fit: contain;
-            }
-            .img-dom {
-                width: 100%;
-                height: 100%;
-                object-fit: cover;
-                border-radius: 8px;
-            }
-            &.noFit {
-                .img-dom {
-                    height: auto;
-                    object-fit: contain;
-                }
-            }
-        }
-    }
-    .code-icon {
-        position: absolute;
-        right: 12px;
-        top: 12px;
-        width: 40px;
-    }
-    .carousel-img-mask {
-        position: absolute;
-        bottom: -2px;
-        left: -2px;
-        width: calc(100% + 2px);
-        height: 80%;
-        background: linear-gradient(360deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 25%, rgba(0, 0, 0, 0) 40%);
-        z-index: 1;
-        pointer-events: none;
-        display: flex;
-        align-items: flex-end;
-        padding: 8px 12px;
-        box-sizing: border-box;
-        border-radius: 8px 8px 12px 12px;
-        &.app-mask {
-            padding: 0;
-            height: 100%;
-        }
-        .mask-content {
-            width: 100%;
-            color: #ffffff;
-            font-size: 10px;
-            line-height: 15px;
-            &.app-mask-content {
-                padding: 10px 8px;
-                font-size: 12px;
-                background: rgba(0, 0, 0, 0.2);
-                backdrop-filter: blur(4px);
-                .dji-mask-top {
-                    background: rgba(0, 0, 0, 0.4);
-                    backdrop-filter: blur(4px);
-                    border-radius: 5px 0 5px 0;
-                    padding: 6px 11px;
-                    position: absolute;
-                    top: -203px;
-                    left: 0;
-                    display: flex;
-                    gap: 9px;
-                    font-size: 10px;
-                }
-                .garden-info {
-                    display: flex;
-                    align-items: center;
-                    margin-top: 4px;
-                    width: calc(100% - 125px);
-                    .code {
-                        font-size: 10px;
-                        opacity: 0.5;
-                        margin-left: 5px;
-                        width: 100%;
-                        display: inline-block;
-                    }
-                }
-                .base-map-wrapper {
-                    position: absolute;
-                    bottom: 4px;
-                    right: 0;
-                    width: 125px;
-                    height: 94px;
-                    z-index: 1;
-                    .base-map-img {
-                        width: 100%;
-                        height: 100%;
-                        border-radius: 4px;
-                        border: 1px solid #ffffff;
-                        object-fit: cover;
-                        box-sizing: border-box;
-                    }
-                }
-                .app-mask-top {
-                    display: flex;
-                    align-items: center;
-                    gap: 12px;
-                    .app-mask-top-left {
-                        display: flex;
-                        flex-direction: column;
-                        align-items: flex-start;
-                        .app-year {
-                            font-size: 12px;
-                            color: #ffffff;
-                            margin-bottom: 4px;
-                        }
-                        .app-date-wrapper {
-                            position: relative;
-                            .app-date-line {
-                                position: absolute;
-                                top: -2px;
-                                left: 0;
-                                right: 0;
-                                height: 1px;
-                                background: #ffffff;
-                            }
-                            .app-date {
-                                font-size: 12px;
-                                color: #ffffff;
-                                position: relative;
-                            }
-                        }
-                    }
-                    .app-mask-top-right {
-                        display: flex;
-                        align-items: center;
-                        gap: 12px;
-                        .app-phenology {
-                            color: #f0d09c;
-                            font-weight: 500;
-                        }
-                        .app-uploader {
-                            font-size: 10px;
-                            color: #ffffff;
-                            opacity: 0.5;
-                        }
-                    }
-                }
-                .app-mask-bottom {
-                    display: flex;
-                    align-items: center;
-                    .app-weather-info {
-                        display: flex;
-                        align-items: center;
-                        flex-wrap: wrap;
-                        gap: 5px;
-                        .app-weather-item {
-                            color: #ffffff;
-                            display: flex;
-                            align-items: center;
-                            gap: 2px;
-                            .app-weather-icon {
-                                width: 15px;
-                                height: 15px;
-                            }
-                        }
-                        .app-weather-separator {
-                            font-size: 10px;
-                            color: #ffffff;
-                            margin: 0 4px;
-                        }
-                        .app-location {
-                            font-size: 10px;
-                            color: #ffffff;
-                            opacity: 0.5;
-                        }
-                    }
-                }
-            }
-        }
-        .review-effect-text {
-            font-family: "PangMenZhengDao";
-            font-size: 16px;
-            margin-bottom: 4px;
-        }
-        .review-effect-content {
-            font-size: 10px;
-            line-height: 15px;
-        }
-        .mask-line {
-            display: flex;
-            align-items: center;
-            flex-wrap: wrap;
-        }
-        .prescription-text {
-            display: flex;
-            .prescription-text-label {
-                flex: none;
-            }
-        }
-        .line-middle {
-            margin-top: 4px;
-            .work-name {
-                font-family: "PangMenZhengDao", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial,
-                    sans-serif;
-                font-size: 17px;
-            }
-        }
-        .line-bottom {
-            margin-top: 4px;
-        }
-        .date-text {
-            font-family: "PangMenZhengDao";
-            font-size: 12px;
-        }
-        .date-text,
-        .executor-text,
-        .location-text {
-            white-space: nowrap;
-        }
-        .location-icon {
-            width: 9px;
-            height: 10px;
-            margin-right: 2px;
-        }
-        .line-separator {
-            margin: 0 6px;
-        }
-    }
-    .label-text {
-        position: absolute;
-        top: 0;
-        left: 0;
-        padding: 4px 10px;
-        background: rgba(54, 52, 52, 0.8);
-        color: #fff;
-        font-size: 12px;
-        border-radius: 8px 0 8px 0;
-        z-index: 1;
-    }
-    .blur-bg {
-        position: absolute;
-        top: 0;
-        width: 100%;
-        height: 100%;
-        backdrop-filter: blur(1.4px);
-        .blur-content {
-            border-radius: 8px;
-            background: rgba(0, 0, 0, 0.5);
-            width: 100%;
-            height: 100%;
-            display: flex;
-            flex-direction: column;
-            align-items: center;
-            justify-content: center;
-            font-size: 12px;
-            color: #fff;
-            .blur-img {
-                img {
-                    width: 54px;
-                    position: relative;
-                    left: 4px;
-                    top: 4px;
-                }
-            }
-            .blur-text {
-                padding: 8px 0;
-                text-align: center;
-                line-height: 1.5;
-            }
-            .blur-btn {
-                padding: 0 40px;
-                box-shadow: 0 -2px 2px #86c9ff;
-                height: 28px;
-                line-height: 28px;
-                border-radius: 50px;
-                background: rgba(33, 153, 248, 0.7);
-                // background: linear-gradient(#86C9FF, rgba(255, 255, 255, 0));
-            }
-        }
-    }
-
-    .arrow {
-        position: absolute;
-        top: 50%;
-        transform: translateY(-50%);
-        background: rgba(0, 0, 0, 0.5);
-        width: rpx(72);
-        height: rpx(72);
-        border-radius: 50%;
-        display: inline-flex;
-        align-items: center;
-        justify-content: center;
-        cursor: pointer;
-        pointer-events: all;
-    }
-
-    .left-arrow {
-        left: rpx(32);
-    }
-
-    .right-arrow {
-        right: rpx(32);
-    }
-}
-
-.cavans-popup {
-    width: 100%;
-    max-width: 100%;
-    max-height: 90vh;
-    background: none;
-    border-radius: 12px;
-    overflow: auto;
-    display: flex;
-    flex-direction: column;
-    backdrop-filter: 4px;
-    .cavans-content {
-        text-align: center;
-        padding: 16px;
-        .current-img {
-            width: 100%;
-        }
-    }
-
-    // 底部操作按钮
-    .bottom-actions {
-        flex-shrink: 0;
-
-        .action-buttons {
-            padding: 16px;
-            display: flex;
-            justify-content: space-around;
-
-            .action-btn {
-                display: flex;
-                flex-direction: column;
-                align-items: center;
-                cursor: pointer;
-                &.text-btn {
-                    font-size: 12px;
-                    color: rgba(255, 255, 255, 0.7);
-                }
-
-                .icon-circle {
-                    width: 48px;
-                    height: 48px;
-                    border-radius: 50%;
-                    display: flex;
-                    align-items: center;
-                    justify-content: center;
-                    color: #fff;
-                    margin-bottom: 4px;
-
-                    .el-icon {
-                        color: #fff;
-                    }
-                    img {
-                        width: 50px;
-                    }
-                }
-
-                &.blue-btn .icon-circle {
-                    background: #2199f8;
-                }
-
-                &.green-btn .icon-circle {
-                    background: #07c160;
-                }
-
-                &.orange-btn .icon-circle {
-                    background: #ff790b;
-                }
-
-                .btn-label {
-                    font-size: 12px;
-                    color: #fff;
-                }
-            }
-        }
-
-        .cancel-btn {
-            text-align: center;
-            font-size: 18px;
-            color: #fff;
-            cursor: pointer;
-        }
-    }
-}
-</style>

+ 0 - 823
src/components/album_compoents/albumDrawBox.vue

@@ -1,823 +0,0 @@
-<template>
-    <photo-consumer class="carousel-item" :src="watermark || getPhotoSrc(photo)">
-        <img
-            v-if="Math.abs(current - index) < 3"
-            crossorigin="anonymous"
-            loading="lazy"
-            @load="drawWatermark($event)"
-            :src="watermark || getPhotoSrc(photo)"
-            style="width: 100%; height: 255px; object-fit: cover; display: block; border-radius: 8px"
-        />
-        <canvas
-            ref="canvasRef"
-            @click="handleClick"
-            style="position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 8px"
-        ></canvas>
-        <div class="tag-box right" v-if="isShowNum" :class="{ leftTop: 'leftTop' }">{{ index + 1 }}/{{ length }}</div>
-        <!--    <div class="center-mark">mark</div>-->
-    </photo-consumer>
-
-    <popup class="cavans-popup" v-model:show="showPopup">
-        <div class="cavans-content">
-            <img class="current-img" :src="watermarkWithQRCode || watermark" alt="" />
-        </div>
-        <!-- 底部操作按钮 -->
-        <div class="bottom-actions" @click.stop="showPopup = false">
-            <div class="action-buttons">
-                
-                <div class="action-btn text-btn">
-                    &lt;&lt;长按图片保存或转发&gt;&gt;
-                </div>
-                <!-- <div class="action-btn green-btn" @click.stop="handleWechat">
-                    <div class="icon-circle">
-                        <img src="@/assets/img/home/wechat.png" alt="" />
-                    </div>
-                    <span class="btn-label">{{ t('微信') }}</span>
-                </div>
-                <div class="action-btn orange-btn" @click.stop="handleSaveImage">
-                    <div class="icon-circle">
-                        <el-icon :size="24"><Download /></el-icon>
-                    </div>
-                    <span class="btn-label">{{ t('保存图片') }}</span>
-                </div> -->
-            </div>
-            <div class="cancel-btn" @click="handleCancel">{{ t('取消') }}</div>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { Popup } from "vant";
-import { ref, onMounted, onBeforeUnmount, defineProps } from "vue";
-import { base_img_url2 } from "@/api/config";
-import { imageCache, loadImage } from "./cacheImg.js";
-import { dateFormat } from "@/utils/date_util.js";
-
-import {
-    drawTextInRect,
-    drawBorderImageInRect,
-    drawImageInRect,
-    drawRectInRect,
-    drawHorizontalTextList,
-} from "./utils";
-// const resize = "?x-oss-process=image/resize,p_30/format,webp/quality,q_40";
-const resize = "";
-
-const canvasRef = ref(null);
-const watermark = ref(null);
-const baseMapBig = ref(false);
-
-const props = defineProps({
-    photo: {
-        required: true,
-    },
-    index: {
-        type: Number,
-        required: true,
-    },
-    length: {
-        type: Number,
-        required: true,
-    },
-    current: {
-        type: Number,
-        required: true,
-    },
-    isShowNum: {
-        type: Number,
-        required: true,
-    },
-    isAchievementImgs: {
-        type: Boolean,
-        default: false,
-    },
-    imgData: {
-        type: Object,
-        default: () => ({}),
-    },
-});
-let img = null;
-let ctx = null;
-// 保存原始图片引用,用于重新绘制
-let cachedSourceImg = null;
-let cachedDisplayImg = null;
-
-function getWatermarkKey(photo) {
-    return photo?.resFilename || photo?.cloudFilename || photo;
-}
-
-function getPhotoSrc(photo) {
-    const key = photo?.resFilename || photo?.cloudFilename || photo;
-    if (typeof key === "string" && (key.startsWith("http") || key.startsWith("data:"))) {
-        return key + resize;
-    }
-    return base_img_url2 + key + resize;
-}
-
-const showPopup = ref(false);
-const watermarkWithQRCode = ref(null); // 带二维码的图片,用于弹窗显示
-
-async function handleClick() {
-    // 点击时生成带二维码的图片用于弹窗显示
-    await generateImageWithQRCode();
-    showPopup.value = true;
-}
-
-// 加载二维码图片
-async function loadQRCodeImage() {
-    // 先检查缓存
-    if (imageCache.has("qrcode")) {
-        return imageCache.get("qrcode");
-    }
-    // 使用 loadImage 加载
-    try {
-        await loadImage(require("@/assets/img/home/qrcode.png"), "qrcode");
-        return imageCache.get("qrcode");
-    } catch (error) {
-        console.error("加载二维码失败:", error);
-        // 如果 require 失败,尝试直接创建图片
-        return new Promise((resolve, reject) => {
-            const img = new Image();
-            img.crossOrigin = "anonymous";
-            img.onload = () => {
-                imageCache.set("qrcode", img);
-                resolve(img);
-            };
-            img.onerror = reject;
-            img.src = require("@/assets/img/home/qrcode.png");
-        });
-    }
-}
-
-// 生成带二维码的图片(用于弹窗显示,不影响原图)
-async function generateImageWithQRCode() {
-    if (!cachedSourceImg || !cachedDisplayImg) return;
-    
-    try {
-        // 加载二维码图片
-        const qrCodeImg = await loadQRCodeImage();
-        
-        // 获取显示图片的尺寸
-        const rect = cachedDisplayImg.getBoundingClientRect();
-        const w = rect.width;
-        const h = rect.height;
-        
-        // 创建一个临时的 canvas 用于生成带二维码的图片
-        const tempCanvas = document.createElement("canvas");
-        const tempCtx = tempCanvas.getContext("2d");
-        
-        const dpr = window.devicePixelRatio || 1;
-        
-        // 设置 canvas 尺寸
-        tempCanvas.width = w * dpr;
-        tempCanvas.height = h * dpr;
-        
-        tempCtx.setTransform(dpr, 0, 0, dpr, 0, 0);
-        tempCtx.imageSmoothingEnabled = true;
-        tempCtx.imageSmoothingQuality = "high";
-        
-        // 清空 canvas
-        tempCtx.clearRect(0, 0, w, h);
-        
-        // 重新绘制图片
-        drawImageCoverByNatural(tempCtx, cachedSourceImg, w, h);
-        
-        // 绘制底部遮罩和文字
-        if (props.isAchievementImgs) {
-            if (props.imgData?.reCheckText) {
-                drawBottomMask(tempCtx, w, h);
-                drawReviewEffectText(tempCtx, w, h);
-            }
-        } else {
-            // 先计算文字区域,获取第一行文字的Y坐标
-            const topLineY = calculateTextOverlayTopY(tempCtx, w, h);
-            // 先绘制遮罩(作为背景)
-            drawBottomMask(tempCtx, w, h, topLineY);
-            // 再绘制文字(显示在遮罩上方)
-            drawBottomTextOverlay(tempCtx, w, h);
-        }
-        
-        // 二维码尺寸和位置(参考 albumCarouselItem 的样式)
-        const qrSize = 40;
-        const qrX = w - qrSize - 12; // 距离右边 12px
-        const qrY = 12; // 距离顶部 12px
-        
-        // 绘制二维码到右上角
-        tempCtx.drawImage(qrCodeImg, qrX, qrY, qrSize, qrSize);
-        
-        // 保存为带二维码的图片(不影响原来的 watermark)
-        watermarkWithQRCode.value = tempCanvas.toDataURL("image/jpeg", 0.85);
-    } catch (error) {
-        console.error("生成带二维码的图片失败:", error);
-        // 如果失败,使用原来的 watermark
-        watermarkWithQRCode.value = watermark.value;
-    }
-}
-
-async function drawWatermark(event) {
-    const displayImg = event.target;
-
-    const key = getWatermarkKey(props.photo);
-    if (watermarkCache.has(key)) {
-        watermark.value = watermarkCache.get(key);
-        // 从缓存中恢复图片引用
-        const cachedData = watermarkCache.get(key + "_refs");
-        if (cachedData) {
-            cachedSourceImg = cachedData.sourceImg;
-            cachedDisplayImg = cachedData.displayImg;
-        }
-        return;
-    }
-
-    // ✅ 用原始图片重新创建一个 Image
-    const sourceImg = await loadOriginalImage(displayImg.src);
-    
-    // 保存引用
-    cachedSourceImg = sourceImg;
-    cachedDisplayImg = displayImg;
-
-    drawWatermark2(sourceImg, displayImg);
-
-    watermarkCache.set(key, watermark.value);
-    // 同时保存图片引用
-    watermarkCache.set(key + "_refs", { sourceImg, displayImg });
-}
-
-const watermarkCache = new Map();
-
-function loadOriginalImage(src) {
-    return new Promise((resolve) => {
-        const img = new Image();
-        img.crossOrigin = "anonymous";
-        img.onload = () => resolve(img);
-        img.src = src;
-    });
-}
-
-function drawWatermark2(sourceImg, displayImg) {
-    const canvas = canvasRef.value;
-    const ctx = canvas.getContext("2d");
-
-    const rect = displayImg.getBoundingClientRect();
-    const w = rect.width;
-    const h = rect.height;
-
-    const dpr = window.devicePixelRatio || 1;
-
-    canvas.width = w * dpr;
-    canvas.height = h * dpr;
-    canvas.style.width = w + "px";
-    canvas.style.height = h + "px";
-
-    ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
-    ctx.imageSmoothingEnabled = true;
-    ctx.imageSmoothingQuality = "high";
-
-    ctx.clearRect(0, 0, w, h);
-
-    // ✅ 用「原始像素图」做 cover
-    drawImageCoverByNatural(ctx, sourceImg, w, h);
-
-    if (props.isAchievementImgs) {
-        if (props.imgData?.reCheckText) {
-            drawBottomMask(ctx, w, h);
-            drawReviewEffectText(ctx, w, h);
-        }
-    } else {
-        // 先计算文字区域,获取第一行文字的Y坐标
-        const topLineY = calculateTextOverlayTopY(ctx, w, h);
-        // 先绘制遮罩(作为背景)
-        drawBottomMask(ctx, w, h, topLineY);
-        // 再绘制文字(显示在遮罩上方)
-        drawBottomTextOverlay(ctx, w, h);
-    }
-
-    watermark.value = canvas.toDataURL("image/jpeg", 0.85);
-}
-function drawImageCoverByNatural(ctx, img, w, h) {
-    const imgRatio = img.naturalWidth / img.naturalHeight;
-    const canvasRatio = w / h;
-
-    let sx, sy, sw, sh;
-
-    if (imgRatio > canvasRatio) {
-        sh = img.naturalHeight;
-        sw = sh * canvasRatio;
-        sx = (img.naturalWidth - sw) / 2;
-        sy = 0;
-    } else {
-        sw = img.naturalWidth;
-        sh = sw / canvasRatio;
-        sx = 0;
-        sy = (img.naturalHeight - sh) / 2;
-    }
-
-    ctx.drawImage(img, sx, sy, sw, sh, 0, 0, w, h);
-}
-
-function drawImageCover(ctx, img, w, h) {
-    const imgRatio = img.naturalWidth / img.naturalHeight;
-    const canvasRatio = w / h;
-
-    let sx, sy, sw, sh;
-
-    if (imgRatio > canvasRatio) {
-        sh = img.naturalHeight;
-        sw = sh * canvasRatio;
-        sx = (img.naturalWidth - sw) / 2;
-        sy = 0;
-    } else {
-        sw = img.naturalWidth;
-        sh = sw / canvasRatio;
-        sx = 0;
-        sy = (img.naturalHeight - sh) / 2;
-    }
-
-    ctx.drawImage(img, sx, sy, sw, sh, 0, 0, w, h);
-}
-
-// 计算文字区域的顶部Y坐标(不实际绘制)
-function calculateTextOverlayTopY(ctx, w, h) {
-    const paddingX = 12;
-    const paddingBottom = 12;
-    const lineHeight = 16;
-
-    // ⬇️ 从底部开始,一行一行往上
-    let y = h - paddingBottom;
-
-    // 第三行(最底):药物处方(支持自动换行)
-    ctx.font = "10px sans-serif";
-    const prescriptionFull =
-        "药物处方:" + (buildPrescriptionText(props.imgData?.prescriptionList) || "无处方");
-    
-    // 计算文本最大宽度
-    const maxWidth = w - paddingX * 2;
-    
-    // 自动换行处理
-    const prescriptionLines = [];
-    let line = "";
-    for (let i = 0; i < prescriptionFull.length; i++) {
-        const testLine = line + prescriptionFull[i];
-        const testWidth = ctx.measureText(testLine).width;
-        if (testWidth > maxWidth && line !== "") {
-            prescriptionLines.push(line);
-            line = prescriptionFull[i];
-        } else {
-            line = testLine;
-        }
-    }
-    if (line) {
-        prescriptionLines.push(line);
-    }
-    
-    // 计算药物处方第一行的实际位置(最上面一行的 baseline)
-    const prescriptionFirstLineY = prescriptionLines.length > 1 
-        ? y - (prescriptionLines.length - 1) * lineHeight 
-        : y;
-    
-    // 第二行:农事名称 + 农场名称
-    const spacing = 16;
-    const singleLineY = prescriptionFirstLineY - spacing;
-
-    const workNameText = props.imgData?.farmWorkName || "";
-    let firstLineY = singleLineY;
-
-    // 第一行(最上)的 baseline
-    const topLineY = firstLineY - 20;
-    
-    return topLineY;
-}
-
-function drawBottomTextOverlay(ctx, w, h) {
-    const paddingX = 12;
-    const paddingBottom = 12;
-    const lineHeight = 16;
-
-    ctx.textBaseline = "alphabetic";
-    ctx.fillStyle = "#fff";
-    ctx.shadowColor = "rgba(0,0,0,0.6)";
-    ctx.shadowBlur = 2;
-
-    // ⬇️ 从底部开始,一行一行往上
-    let y = h - paddingBottom;
-
-    // 第三行(最底):药物处方(支持自动换行)
-    ctx.font = "10px sans-serif";
-    const prescriptionFull =
-        "药物处方:" + (buildPrescriptionText(props.imgData?.prescriptionList) || "无处方");
-    
-    // 计算文本最大宽度
-    const maxWidth = w - paddingX * 2;
-    
-    // 自动换行处理
-    const prescriptionLines = [];
-    let line = "";
-    for (let i = 0; i < prescriptionFull.length; i++) {
-        const testLine = line + prescriptionFull[i];
-        const testWidth = ctx.measureText(testLine).width;
-        if (testWidth > maxWidth && line !== "") {
-            prescriptionLines.push(line);
-            line = prescriptionFull[i];
-        } else {
-            line = testLine;
-        }
-    }
-    if (line) {
-        prescriptionLines.push(line);
-    }
-    
-    // 从底部向上绘制多行文本
-    let textY = y;
-    for (let i = prescriptionLines.length - 1; i >= 0; i--) {
-        ctx.fillText(prescriptionLines[i], paddingX, textY);
-        if (i > 0) {
-            textY -= lineHeight; // 向上换行
-        }
-    }
-    
-    // 计算药物处方第一行的实际位置(最上面一行的 baseline)
-    // 单行时:第一行位置 = y(底部位置)
-    // 多行时:第一行位置 = y - (行数 - 1) * lineHeight
-    const prescriptionFirstLineY = prescriptionLines.length > 1 
-        ? y - (prescriptionLines.length - 1) * lineHeight 
-        : y;
-    
-    // 第二行:农事名称 + 农场名称
-    // 在药物处方第一行上方留出足够间距,确保不重叠
-    // 需要考虑字体大小差异:药物处方是 10px,农事名称是 16px
-    // 单行时使用较小间距,多行时使用较大间距
-    const spacing = 16;
-    const singleLineY = prescriptionFirstLineY - spacing;
-
-    ctx.font = "10px sans-serif";
-    const workNameText = props.imgData?.farmWorkName || "";
-    const farmNameText = props.imgData?.farmName || "";
-
-    let firstLineY = singleLineY;
-
-    // 农事名称
-    // ctx.font = "16px PangMenZhengDao";
-    ctx.font = "16px PangMenZhengDao";
-    ctx.fillText(workNameText, paddingX, firstLineY);
-
-    // 农场名称紧跟在名称后面
-    const nameWidth = ctx.measureText(workNameText).width;
-    ctx.font = "10px sans-serif";
-    const gap = 8;
-    ctx.fillText(' |  ', paddingX + nameWidth + gap, firstLineY);
-    ctx.drawImage(imageCache.get("address"), paddingX + nameWidth + gap + 10, firstLineY - 8, 10, 10);
-    ctx.fillText(farmNameText, paddingX + nameWidth + gap + 22, firstLineY);
-
-    // 第一行(最上)的 baseline 在整个"第二行块"之上 17px
-    y = firstLineY - 20;
-    ctx.font = "12px PangMenZhengDao";
-    const timeText = props.imgData?.executeDate;
-    ctx.fillText(timeText, paddingX, y);
-    const executorText = " |   执行人:" + props.imgData?.executeName;
-    ctx.font = "10px sans-serif";
-    ctx.fillText(executorText, paddingX + 90, y);
-
-    ctx.shadowBlur = 0;
-}
-
-// 成果复核文案(水印文字版本)
-// 参考 UI:「复核成效」标题 + 一段说明文字,整体靠底部显示
-function drawReviewEffectText(ctx, w, h) {
-    const paddingX = 12;
-    const paddingBottom = 8; // 底部留白
-
-    ctx.textBaseline = "top";
-    ctx.fillStyle = "#ffffff";
-    ctx.shadowColor = "rgba(0,0,0,0.45)";
-    ctx.shadowBlur = 4;
-
-    // 文案内容
-    const content =
-        props.imgData?.reCheckText;
-
-    // 按宽度自动换行,先得到所有行
-    ctx.font = "10px sans-serif";
-    const lineHeight = 15;
-    const maxWidth = w - paddingX * 2; // 文本最大宽度
-    const lines = [];
-    let line = "";
-    for (let i = 0; i < content.length; i++) {
-        const testLine = line + content[i];
-        const testWidth = ctx.measureText(testLine).width;
-        if (testWidth > maxWidth && line !== "") {
-            lines.push(line);
-            line = content[i];
-        } else {
-            line = testLine;
-        }
-    }
-    if (line) {
-        lines.push(line);
-    }
-
-    // 计算整体高度:标题高度 + 间距 + 正文行高
-    const titleFontSize = 16;
-    const titleGap = 4;
-    const textBlockHeight = lines.length * lineHeight;
-    const totalHeight = titleFontSize + titleGap + textBlockHeight;
-
-    // 从底部往上布局,使整体块贴近底部
-    const baseY = h - paddingBottom - totalHeight;
-
-    // 标题
-    ctx.font = "16px PangMenZhengDao";
-    const titleText = "复核成效";
-    ctx.fillText(titleText, paddingX, baseY);
-
-    // 正文
-    ctx.font = "10px sans-serif";
-    let textY = baseY + titleFontSize + titleGap;
-    lines.forEach((ln) => {
-        ctx.fillText(ln, paddingX, textY);
-        textY += lineHeight;
-    });
-
-    ctx.shadowBlur = 0;
-}
-
-function drawBottomMask(ctx, w, h, topY) {
-    let maskHeight;
-    let maskTop;
-    
-    if (topY !== undefined) {
-        // 遮罩从第一行文字上方一点开始,到图片底部
-        // 第一行文字是 12px 字体,实际高度约 12-14px,留出一些空间
-        const textHeight = 14; // 第一行文字的实际高度
-        maskTop = topY - textHeight; // 从文字上方开始
-        maskHeight = h - maskTop; // 从 maskTop 到图片底部
-    } else {
-        // 默认高度(用于 drawReviewEffectText 等情况)
-        maskHeight = 66;
-        maskTop = h - maskHeight;
-    }
-
-    ctx.fillStyle = "rgba(0,0,0,0.45)";
-    ctx.fillRect(
-        0,
-        maskTop,
-        w,
-        maskHeight
-    );
-}
-
-function buildPrescriptionText(list) {
-    if (!list || !Array.isArray(list) || list.length === 0 || list[0]?.pesticideFertilizerList?.length === 0) {
-        return "无处方";
-    }
-    try {
-        return list
-            .map((group) =>
-                (group.pesticideFertilizerList || [])
-                    .map((p) => p.defaultName || p.pesticideFertilizerName || "")
-                    .filter(Boolean)
-                    .join("+")
-            )
-            .filter(Boolean)
-            .join("+");
-    } catch {
-        return "无处方";
-    }
-}
-
-const showTagBox = ref(true); // 控制 tag-box 的显示状态
-const hideTagBox = (event) => {
-    event.stopPropagation();
-    showTagBox.value = false; // 隐藏 tag-box
-};
-
-const formatDate = (date) => {
-    const year = date.getFullYear();
-    const month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从0开始,需要加1
-    const day = String(date.getDate()).padStart(2, "0");
-    return `${(year + "").substring(2)}${month}${day}`;
-};
-
-const handleSaveImage = () => {
-    // 保存带二维码的图片
-    downloadImage(watermarkWithQRCode.value || watermark.value, "执行照片");
-};
-
-const handleWechat = () => {
-    // 微信分享功能(可以后续实现)
-    console.log("微信分享");
-};
-
-const handleCancel = () => {
-    showPopup.value = false;
-};
-
-function downloadImage(dataUrl, filename) {
-    const link = document.createElement("a");
-    link.href = dataUrl;
-    link.download = filename;
-    document.body.appendChild(link);
-    link.click();
-    document.body.removeChild(link);
-}
-</script>
-
-<style lang="scss" scoped>
-.canvas-container {
-    width: 100%;
-    height: 100%;
-    display: flex;
-    justify-content: center;
-}
-.carousel-item {
-    min-width: 100%;
-    max-height: 100%;
-    flex-shrink: 0;
-    width: 100%;
-    pointer-events: auto;
-    position: relative;
-    .tag-box {
-        position: absolute;
-        bottom: 30%;
-        left: 50%;
-        transform: translate(-50%, 50%); // 确保在高二分之一的位置水平居中
-        height: 18px;
-        padding: 0 6px;
-        background: rgba(108, 108, 108, 0.67);
-        border-radius: 10px;
-        display: flex;
-        align-items: center;
-        color: #ffffff;
-        font-size: 12px;
-
-        &.right {
-            left: auto;
-            right: 10px;
-        }
-        &.leftTop {
-            height: 25px;
-            line-height: 26px;
-            padding: 0 8px;
-            border-radius: 16px;
-            background: rgba(0, 0, 0, 0.6);
-            bottom: auto;
-            top: 6px;
-        }
-    }
-    .tag-text {
-        position: absolute;
-        bottom: 31%;
-        left: 50%;
-        width: 80%;
-        transform: translate(-50%, 50%); // 确保在高二分之一的位置水平居中
-        height: 24px;
-        padding: 10px 0px 10px 0px;
-        background: rgba(0, 0, 0, 0.67);
-        border-radius: 6px;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        text-align: center;
-        color: #ffffff;
-        font-size: 12px;
-    }
-
-    .center-mark {
-        position: absolute;
-        bottom: 10px;
-        left: 50%;
-        transform: translateX(-50%);
-        color: #36402c;
-        font-size: rpx(24);
-        font-weight: bold;
-        padding: rpx(14) rpx(30);
-        background: linear-gradient(
-            90deg,
-            rgba(255, 255, 255, 0) 0%,
-            rgba(255, 255, 255, 0.6) 24%,
-            rgba(255, 255, 255, 0.6) 76%,
-            rgba(255, 255, 255, 0) 100%
-        );
-    }
-}
-.carousel-item img {
-    width: 100%;
-    display: block;
-}
-canvas {
-    position: absolute;
-}
-.close-button {
-    background: transparent;
-    border: none;
-    color: #ffffff;
-    cursor: pointer;
-    font-size: 10px; // 可以根据需求调整大小
-    position: absolute;
-    top: -1px;
-    right: -9px; // 调整为合适的间距
-    transform: translateY(-50%);
-}
-
-.floating-img {
-    position: absolute;
-    bottom: 0;
-    right: 0;
-    width: auto !important;
-    height: 25% !important;
-}
-.floating-img-big {
-    position: fixed !important;
-    z-index: 99999 !important;
-    top: 50% !important;
-    left: 50% !important;
-    width: auto !important;
-    height: 100% !important;
-    transform: translate(-50%, -50%) !important;
-}
-
-.cavans-popup {
-    width: 100%;
-    max-width: 100%;
-    max-height: 90vh;
-    background: none;
-    border-radius: 12px;
-    overflow: auto;
-    display: flex;
-    flex-direction: column;
-    backdrop-filter: 4px;
-    .cavans-content {
-        text-align: center;
-        padding: 16px;
-        .current-img {
-            border-radius: 8px;
-            width: 100%;
-        }
-    }
-
-    // 底部操作按钮
-    .bottom-actions {
-        flex-shrink: 0;
-
-        .action-buttons {
-            padding: 16px;
-            display: flex;
-            justify-content: space-around;
-
-            .action-btn {
-                display: flex;
-                flex-direction: column;
-                align-items: center;
-                cursor: pointer;
-                &.text-btn {
-                    font-size: 12px;
-                    color: rgba(255, 255, 255, 0.7);
-                }
-
-                .icon-circle {
-                    width: 48px;
-                    height: 48px;
-                    border-radius: 50%;
-                    display: flex;
-                    align-items: center;
-                    justify-content: center;
-                    color: #fff;
-                    margin-bottom: 4px;
-
-                    .el-icon {
-                        color: #fff;
-                    }
-                    img {
-                        width: 50px;
-                    }
-                }
-
-                &.blue-btn .icon-circle {
-                    background: #2199f8;
-                }
-
-                &.green-btn .icon-circle {
-                    background: #07c160;
-                }
-
-                &.orange-btn .icon-circle {
-                    background: #ff790b;
-                }
-
-                .btn-label {
-                    font-size: 12px;
-                    color: #fff;
-                }
-            }
-        }
-
-        .cancel-btn {
-            text-align: center;
-            font-size: 18px;
-            color: #fff;
-            cursor: pointer;
-        }
-    }
-}
-</style>

+ 0 - 88
src/components/album_compoents/cacheImg.js

@@ -1,88 +0,0 @@
-// 创建一个全局的图片缓存
-const imageCache = new Map();
-
-function loadImage(url, key) {
-    if (!url) {
-        return Promise.reject('图片地址不能为空');
-    }
-    return new Promise((resolve, reject) => {
-        // 检查缓存中是否存在该key的图片
-        if (imageCache.has(key)) {
-            resolve(imageCache.get(key));
-            return;
-        }
-
-        // 如果缓存中没有,则创建一个新的图片对象
-        const img = new Image();
-        img.src = url;
-        img.crossOrigin = 'anonymous';
-
-        img.onload = () => {
-            // 图片加载完成后,将其存入缓存
-            imageCache.set(key, img);
-            resolve(img);
-        };
-
-        img.onerror = (error) => {
-            reject(error);
-        };
-    }).catch((error) => {
-        console.error('图片加载失败', error);
-    });
-}
-
-// 使用示例
-loadImage(require('@/assets/watermark/feiniao.png'), 'feiniao')
-    .then((img) => {
-        // 在这里使用加载完成的图片
-        // console.log('图片加载成功', img);
-    })
-    .catch((error) => {
-        console.error('图片加载失败', error);
-    });
-loadImage(require('@/assets/watermark/fushe.png'), 'fushe')
-    .then((img) => {
-        // 在这里使用加载完成的图片
-        // console.log('图片加载成功', img);
-    })
-    .catch((error) => {
-        console.error('图片加载失败', error);
-    });
-loadImage(require('@/assets/watermark/shidu.png'), 'shidu')
-    .then((img) => {
-        // 在这里使用加载完成的图片
-        // console.log('图片加载成功', img);
-    })
-    .catch((error) => {
-        console.error('图片加载失败', error);
-    });
-loadImage(require('@/assets/watermark/address.png'), 'address')
-    .then((img) => {
-        // 在这里使用加载完成的图片
-        // console.log('图片加载成功', img);
-    })
-    .catch((error) => {
-        console.error('图片加载失败', error);
-    });
-loadImage(require('@/assets/watermark/temp.png'), 'temp')
-    .then((img) => {
-        // 在这里使用加载完成的图片
-        // console.log('图片加载成功', img);
-    })
-    .catch((error) => {
-        console.error('图片加载失败', error);
-    });
-
-loadImage("https://birdseye-img.sysuimars.com/birdseye-look-mini/base_map/90378.jpg", 'base_map')
-    .then((img) => {
-        // 在这里使用加载完成的图片
-        // console.log('图片加载成功', img);
-    })
-    .catch((error) => {
-        console.error('图片加载失败', error);
-    });
-
-
-export { imageCache ,loadImage};
-
-

+ 0 - 327
src/components/album_compoents/detailDailog.vue

@@ -1,327 +0,0 @@
-<template>
-    <el-dialog v-model="winDialogVisible" lock-scroll modal-class="album-detail-modal" :showClose="false" width="86%" align-center @close="closeDialog">
-        <div class="detail-log">
-            <div class="congratulation-wrap">
-                <div class="congratulation-box">
-                    <div class="win-des">
-                        <!-- <img src="@/assets/img/weather_index/box-top.png" class="win-icon" /> -->
-                    </div>
-                    <div class="album-detail-box">
-                        <div class="detail-title">{{ dialogData.farmWorkName }}</div>
-                        <div class="detail-desc-box">
-                            <!-- <div class="desc-item" v-if="dialogData?.conditionList && dialogData.conditionList.length">
-                                <span class="item-name">{{ $t('触发条件') }}</span>
-                                {{ dialogData.condition || dialogData.conditionList[0].name + dialogData.conditionList[0].value }}
-                            </div> -->
-                            <div class="desc-item">
-                                <span class="item-name">{{ $t('农事编号') }}</span>
-                                {{ dialogData.code }}
-                            </div>
-                            <div class="desc-item">
-                                <span class="item-name">{{ $t('推荐时间') }}</span>
-                                {{ dialogData.executeDate }}
-                            </div>
-                            <!-- <div class="desc-item">
-                                <span class="item-name">{{ $t('农事宗旨') }}</span>
-                                {{ dialogData.purpose || dialogData.condition }}
-                            </div> -->
-                            <div class="desc-item">
-                                <div class="item-name">{{ $t('药物处方') }}</div>
-                                <div class="item-table">
-                                    <el-table :data="pesticideFertilizers" style="width: 100%" :header-cell-style="{background: '#F5F5F5'}">
-                                        <el-table-column prop="pesticideFertilizerCode" :label="$t('类型')" width="62">
-                                            <template #default="scope">
-                                                {{scope.row.typeName}}
-                                            </template>
-                                        </el-table-column>
-                                        <el-table-column prop="defaultName" :label="$t('名称')" />
-                                        <!-- <el-table-column prop="ratio" :label="$t('配比')" width="50">
-                                            <template #default="scope">
-                                                {{scope.row.ratio ? scope.row.ratio : "--"}}
-                                            </template>
-                                        </el-table-column> -->
-                                        <el-table-column prop="ratio" :label="$t('方式')" width="62">
-                                            <template #default="scope">
-                                                {{scope.row.executeStyle ? (scope.row.executeStyle === 2 ? "无人机" : "人工") : "--"}}
-                                            </template>
-                                        </el-table-column>
-                                    </el-table>
-                                </div>
-                            </div>
-
-                            <div class="card-link">
-                                <img :src="dialogData.expertIcon || dialogData.expertUserIcon" />
-                                <div class="expert-name">
-                                    {{ dialogData.expertUserName || dialogData.expertName }}
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-
-            <div class="close-btn" v-show="dialogData.isBtn" @click.stop="winDialogVisible=false">
-                    <!-- <el-icon size="32" color="#fff"><CircleCloseFilled /></el-icon> -->
-                    <el-button v-show="dialogData.typeStr === 'export'" type="primary" class="one-btn" @click.stop="toPage">{{ $t('邀请专家诊断') }}</el-button>
-                    <el-button v-show="dialogData.typeStr === 'activate'" type="primary" class="one-btn" @click.stop="handleAct">{{ $t('立即激活专家农事') }}</el-button>
-                    <!-- <el-button type="primary" class="one-btn" @click.stop="toShare">{{ $t('立即分享') }}</el-button> -->
-            </div>
-        </div>
-        <template #footer>
-            <div class="dialog-footer">
-                <div class="close-btn">
-                    <!-- <el-icon size="32" color="#fff"><CircleCloseFilled /></el-icon> -->
-                    <!-- <el-button type="primary" class="one-btn" @click="toShare">{{ $t('立即分享') }}</el-button> -->
-                </div>
-            </div>
-        </template>
-    </el-dialog>
-</template>
-<script setup>
-import { onActivated, onDeactivated, onMounted, ref } from "vue";
-import eventBus from "@/api/eventBus";
-import wx from "weixin-js-sdk";
-import { useRoute, useRouter } from "vue-router";
-
-const props = defineProps({
-    initReload: {
-        type: Boolean,
-        default: false
-    }
-})
-
-const winDialogVisible = ref(false);
-
-const route = useRoute();
-const router = useRouter();
-const sampleId = route.query.sampleId
-const farmId = route.query.farmId;
-
-const dialogData = ref({});
-const currentCard = ref({});
-const showDialog = (pageParams) => {
-    dialogData.value = pageParams.card;
-    currentCard.value = {
-        activeIndex: pageParams.activeIndex,
-        farmWorkName: dialogData.value.farmWorkName,
-        farmId: farmId,
-        sampleId: sampleId,
-    };
-    settingData()
-    winDialogVisible.value = true;
-};
-
-onMounted(() => {
-    if (props.initReload) {
-        eventBus.on("detailDialog:showDialog", showDialog); 
-    }
-})
-
-onActivated(()=>{
-    eventBus.on("detailDialog:showDialog", showDialog); 
-})
-
-onDeactivated(()=>{
-    eventBus.off("detailDialog:showDialog", showDialog);
-})
-
-//邀请专家诊断
-const toPage = () =>{
-    router.push('/prescription')
-}
-
-//立即激活
-const handleAct = () =>{
-    winDialogVisible.value = false
-    eventBus.emit("uploadUopup:show",{gardenIdVal:dialogData.value.farmId,orderIdVal:dialogData.value.orderId,textVal:dialogData.value.consequenceText});
-}
-
-// 弹窗关闭
-eventBus.on("detailDialog:toCloseDialog", closeDialog);
-
-
-const pesticideFertilizers = ref([])
-const settingData = () => {
-    pesticideFertilizers.value = flattenDomains(dialogData.value.prescriptionList)
-};
-function flattenDomains(data) {
-  return data.reduce((acc, item) => {
-    return acc.concat(item.pesticideFertilizerList);
-  }, []);
-}
-
-function closeDialog() {
-    winDialogVisible.value = false
-    eventBus.emit("detailDialog:closeDialog")
-}
-
-const toShare = () => {
-    wx.miniProgram.navigateTo({
-        url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify(currentCard.value)}&type=album`,
-    });
-}
-</script>
-
-<style lang="less" scoped>
-.congratulation-wrap {
-    border-radius: 12px;
-    background: #f4f5f4;
-    width: 100%;
-}
-.detail-log {
-    width: 100%;
-}
-.close-btn {
-    text-align: center;
-    margin-top: 20px;
-}
-.congratulation-box {
-    border-radius: 12px;
-    background: url("@/assets/img/weather_index/box-top.png") no-repeat top center /contain;
-    .el-message-box__message {
-        padding: 12px 0 24px 0;
-    }
-    .win-title {
-        color: #1d1e1f;
-        font-family: "PangMenZhengDao", sans-serif; /* 使用自定义字体 */
-        text-align: center;
-        font-size: 24px;
-        line-height: 32px;
-    }
-    .win-detail {
-        text-align: center;
-        color: #252525;
-        padding-top: 6px;
-        font-size: 16px;
-        span {
-            font-size: 22px;
-            color: #2199f8;
-            padding: 0 6px;
-            font-weight: bold;
-        }
-    }
-    .win-des {
-        height: 180px;
-        text-align: center;
-    }
-    .win-icon {
-        width: 100%;
-        border-radius: 12px 12px 0 0;
-    }
-}
-.album-detail-box {
-    padding: 0 10px 16px 10px;
-    color: #000;
-    position: relative;
-    // top: -58px;
-    .detail-title {
-        font-size: 24px;
-        font-weight: bold;
-        padding-bottom: 8px;
-        letter-spacing: 1.6px;
-    }
-    .detail-desc-box {
-        position: relative;
-        .desc-item {
-            font-size: 14px;
-            .item-name {
-                color: #999999;
-                margin-right: 12px;
-            }
-            .item-table {
-                margin-top: 8px;
-                border: 1px solid rgba(255, 255, 255, 0.6);
-                border-radius: 4px;
-                ::v-deep {
-                    .el-table th.el-table__cell {
-                        padding: 6px 0;
-                    }
-                    .el-table--default .el-table__cell {
-                        padding: 6px 0;
-                    }
-                    .el-table--default .cell {
-                        padding: 0px 6px;
-                    }
-                }
-            }
-        }
-        .desc-item + .desc-item {
-            padding-top: 8px;
-        }
-        .card-link {
-            display: flex;
-            flex-direction: column;
-            align-items: center;
-            justify-content: center;
-            color: #2199f8;
-            font-size: 12px;
-            position: absolute;
-            right: 6px;
-            top: 0px;
-            .expert-name {
-                background: #d3e8ff;
-                border-radius: 4px;
-                padding: 1px 12px;
-                margin-top: 4px;
-                display: flex;
-                align-items: center;
-            }
-            img {
-                width: 62px;
-                height: 62px;
-                border-radius: 50%;
-                object-fit: cover;
-            }
-            .icon {
-                padding-right: 2px;
-            }
-        }
-    }
-}
-.dialog-footer {
-    position: relative;
-    .close-btn {
-        position: absolute;
-        bottom: -58px;
-        left: 0;
-        right: 0;
-        margin: 0 auto;
-        text-align: center;
-    }
-}
-</style>
-
-<style lang="less">
-.album-detail-modal {
-    .el-overlay-dialog {
-        .el-dialog {
-            padding: 0;
-            border-radius: 12px;
-            background: none;
-            box-shadow: none;
-            margin-bottom: 70px;
-            margin-top: 10px;
-            overflow: auto;
-            scrollbar-width: none;
-            display: flex;
-            flex-direction: column;
-            align-items: center;
-            justify-content: center;
-            pointer-events: none;
-            .el-dialog__header {
-                padding: 0;
-            }
-            .el-dialog__body {
-                pointer-events: all;
-                width: 100%;
-            }
-        }
-
-        .one-btn {
-            width: 210px;
-            height: 40px;
-            line-height: 40px;
-        }
-    }
-}
-</style>

+ 0 - 256
src/components/album_compoents/utils.js

@@ -1,256 +0,0 @@
-/**
- * 在矩形内绘制矩形
- * @param {CanvasRenderingContext2D} ctx - 画布的上下文
- * @param {Object} rect - 矩形范围,包含 { x, y, width, height },以像素为单位
- * @param {number} startXPercent - 内部矩形起始点横坐标,范围从 0 到 100
- * @param {number} startYPercent - 内部矩形起始点纵坐标,范围从 0 到 100
- * @param {number} widthPercent - 内部矩形宽度,范围从 0 到 100
- * @param {number} heightPercent - 内部矩形高度,范围从 0 到 100
- * @param {string} color - 填充颜色,可选参数,默认为黑色
- */
-const drawRectInRect = (ctx, rect, startXPercent, startYPercent, widthPercent, heightPercent, color = 'black') => {
-    // 计算内部矩形的起始坐标
-    const startX = rect.x + (startXPercent / 100) * rect.width;
-    const startY = rect.y + (startYPercent / 100) * rect.height;
-    // 计算内部矩形的宽度和高度
-    const width = (widthPercent / 100) * rect.width;
-    const height = (heightPercent / 100) * rect.height;
-    ctx.fillStyle = color; // 设置填充颜色
-    ctx.fillRect(startX, startY, width, height); // 绘制矩形
-    return { x:startX, y:startY, width, height };
-};
-
-
-
-/**
- * 在矩形内绘制文本
- * @param {CanvasRenderingContext2D} ctx - 画布的上下文
- * @param {Object} rect - 矩形范围,包含 { x, y, width, height },以像素为单位
- * @param {string} text - 要绘制的文本
- * @param {number} startXPercent - 文字起始横坐标,范围从 0 到 100
- * @param {number} startYPercent - 文字起始纵坐标,范围从 0 到 100
- * @param {number} fontSizePercent - 文字大小,范围从 0 到 100,基于矩形高度
- */
-const drawTextInRect = (ctx, rect, text, startXPercent, startYPercent, fontSizePercent) => {
-    // 计算文字起始坐标
-    const startX = rect.x + (startXPercent / 100) * rect.width;
-    const startY = rect.y + (startYPercent / 100) * rect.height;
-
-    // 计算文字大小
-    const fontSize = (fontSizePercent / 100) * rect.height;
-    ctx.font = `${fontSize}px sans-serif`; // 设置字体样式
-    ctx.fillText(text, startX, startY);
-};
-
-/**
- * 在矩形内绘制线
- * @param {CanvasRenderingContext2D} ctx - 画布的上下文
- * @param {Object} rect - 矩形范围,包含 { x, y, width, height },以像素为单位
- * @param {number} startXPercent - 起始点横坐标,范围从 0 到 100
- * @param {number} startYPercent - 起始点纵坐标,范围从 0 到 100
- * @param {number} endXPercent - 结束点横坐标,范围从 0 到 100
- * @param {number} endYPercent - 结束点纵坐标,范围从 0 到 100
- * @param {string} color - 线条颜色,可选参数,默认为黑色
- * @param {number} lineWidth - 线条宽度,可选参数,默认为1像素
- */
-const drawLineInRect = (ctx, rect, startXPercent, startYPercent, endXPercent, endYPercent, color = 'black', lineWidth = 1) => {
-    // 计算起始点坐标
-    const startX = rect.x + (startXPercent / 100) * rect.width;
-    const startY = rect.y + (startYPercent / 100) * rect.height;
-
-    // 计算结束点坐标
-    const endX = rect.x + (endXPercent / 100) * rect.width;
-    const endY = rect.y + (endYPercent / 100) * rect.height;
-
-    // 设置线条样式
-    ctx.strokeStyle = color; // 设置线条颜色
-    ctx.lineWidth = lineWidth; // 设置线条宽度
-
-    // 绘制线
-    ctx.beginPath();
-    ctx.moveTo(startX, startY);
-    ctx.lineTo(endX, endY);
-    ctx.stroke();
-};
-
-/**
- * 在矩形内绘制点
- * @param {CanvasRenderingContext2D} ctx - 画布的上下文
- * @param {Object} rect - 矩形范围,包含 { x, y, width, height },以像素为单位
- * @param {number} xPercent - 点的横坐标,范围从 0 到 100
- * @param {number} yPercent - 点的纵坐标,范围从 0 到 100
- * @param {string} color - 点的颜色,可选参数,默认为黑色
- * @param {number} radius - 点的半径,可选参数,默认为1像素
- */
-const drawPointInRect = (ctx, rect, xPercent, yPercent, color = 'black', radius = 1) => {
-    // 计算点的坐标
-    const x = rect.x + (xPercent / 100) * rect.width;
-    const y = rect.y + (yPercent / 100) * rect.height;
-
-    // 设置点的样式
-    ctx.fillStyle = color; // 设置点的颜色
-
-    // 开始绘制路径
-    ctx.beginPath();
-    ctx.arc(x, y, radius, 0, Math.PI * 2); // 绘制一个圆
-    ctx.fill(); // 填充圆
-};
-
-/**
- * 在矩形内绘制图片
- * @param {CanvasRenderingContext2D} ctx - 画布的上下文
- * @param {Object} rect - 矩形范围,包含 { x, y, width, height },以像素为单位
- * @param {HTMLImageElement} img - 要绘制的图片对象
- * @param {number} imgXPercent - 图片起始横坐标,范围从 0 到 100
- * @param {number} imgYPercent - 图片起始纵坐标,范围从 0 到 100
- * @param {number} imgWidthPercent - 图片宽度百分比,范围从 0 到 100
- * @param {number} imgHeightPercent - 图片高度百分比,范围从 0 到 100
- */
-const drawImageInRect = (ctx, rect, img, imgXPercent, imgYPercent, imgWidthPercent, imgHeightPercent) => {
-    // 计算图片的起始坐标
-    const imgX = rect.x + (imgXPercent / 100) * rect.width;
-    const imgY = rect.y + (imgYPercent / 100) * rect.height;
-    // 计算图片的宽度和高度
-    const imgWidth = (imgWidthPercent / 100) * rect.width;
-    const imgHeight = (imgHeightPercent / 100) * rect.height;
-    // 开始绘制图片
-    ctx.drawImage(img, imgX, imgY, imgWidth, imgHeight);
-};
-
-/**
- * 在矩形内绘制图片,带圆角和白色边框
- * @param {CanvasRenderingContext2D} ctx - 画布的上下文
- * @param {Object} rect - 矩形范围,包含 { x, y, width, height },以像素为单位
- * @param {HTMLImageElement} img - 要绘制的图片对象
- * @param {number} imgXPercent - 图片起始横坐标,范围从 0 到 100
- * @param {number} imgYPercent - 图片起始纵坐标,范围从 0 到 100
- * @param {number} imgWidthPercent - 图片宽度百分比,范围从 0 到 100
- * @param {number} imgHeightPercent - 图片高度百分比,范围从 0 到 100
- * @param {number} borderRadius - 圆角半径,以像素为单位
- * @param {number} borderWidth - 边框宽度,以像素为单位
- */
-const drawBorderImageInRect = (ctx, rect, img, imgXPercent, imgYPercent, imgWidthPercent, imgHeightPercent, borderRadius, borderWidth) => {
-    // 计算图片的起始坐标
-    const imgX = rect.x + (imgXPercent / 100) * rect.width + borderWidth;
-    const imgY = rect.y + (imgYPercent / 100) * rect.height + borderWidth;
-    // 计算图片的宽度和高度
-    const imgWidth = (imgWidthPercent / 100) * rect.width - 2 * borderWidth;
-    const imgHeight = (imgHeightPercent / 100) * rect.height - 2 * borderWidth;
-
-    // 保存画布状态
-    ctx.save();
-
-    // 开始绘制圆角矩形的边框
-    ctx.beginPath();
-    ctx.moveTo(imgX + borderRadius, imgY);
-    ctx.lineTo(imgX + imgWidth - borderRadius, imgY);
-    ctx.arcTo(imgX + imgWidth, imgY, imgX + imgWidth, imgY + borderRadius, borderRadius);
-    ctx.lineTo(imgX + imgWidth, imgY + imgHeight - borderRadius);
-    ctx.arcTo(imgX + imgWidth, imgY + imgHeight, imgX + imgWidth - borderRadius, imgY + imgHeight, borderRadius);
-    ctx.lineTo(imgX + borderRadius, imgY + imgHeight);
-    ctx.arcTo(imgX, imgY + imgHeight, imgX, imgY + imgHeight - borderRadius, borderRadius);
-    ctx.lineTo(imgX, imgY + borderRadius);
-    ctx.arcTo(imgX, imgY, imgX + borderRadius, imgY, borderRadius);
-    ctx.closePath();
-
-    // 设置边框颜色和宽度
-    ctx.strokeStyle = 'white';
-    ctx.lineWidth = borderWidth;
-    ctx.stroke();
-
-    // 开始绘制圆角矩形的填充(可选,如果需要背景)
-    // ctx.fillStyle = 'transparent'; // 或者设置其他背景颜色
-    // ctx.fill();
-
-    // 开始裁剪
-    ctx.clip();
-
-    // 绘制图片
-    ctx.drawImage(img, imgX, imgY, imgWidth, imgHeight);
-
-    // 恢复画布状态
-    ctx.restore();
-};
-
-/**
- * 在矩形内绘制横向文本列表
- * @param {CanvasRenderingContext2D} ctx - 画布的上下文
- * @param {Object} rect - 矩形范围,包含 { x, y, width, height },以像素为单位
- * @param {Array<string>} texts - 要绘制的文本数组
- * @param {number} fontSizePercent - 文字大小,范围从 0 到 100,基于矩形高度
- * @param {number} startXPercent - 文字起始横坐标,范围从 0 到 100,基于矩形宽度
- * @param {number} startYPercent - 文字起始纵坐标,范围从 0 到 100,基于矩形高度
- * @param {number} columnSpacingPercent - 列间距,范围从 0 到 100,基于矩形宽度
- * @param {string} columnSeparator - 列间隔字符,默认为空字符串
- * @param {number} columnSeparatorWidthPercent - 列间隔字符的宽度百分比,范围从 0 到 100,基于矩形宽度
- * @param {number} separatorFontSizePercent - 分隔符字号大小,范围从 0 到 100,基于矩形高度
- * @param {string} separatorColor - 分隔符颜色,默认为黑色
- * @param {number} separatorMarginLeftPercent - 分隔符左边的边距,范围从 0 到 100,基于矩形宽度
- * @param {number} separatorMarginRightPercent - 分隔符右边的边距,范围从 0 到 100,基于矩形宽度
- */
-const drawHorizontalTextList = (ctx, rect,color='white', texts, fontSizePercent, startXPercent = 0, startYPercent = 50, columnSpacingPercent = 0, columnSeparator = '', columnSeparatorWidthPercent = 0, separatorFontSizePercent = fontSizePercent, separatorColor = 'black', separatorMarginLeftPercent = 0, separatorMarginRightPercent = 0) => {
-    // 计算文字大小
-    const fontSize = (fontSizePercent / 100) * rect.height;
-    ctx.font = `${fontSize}px sans-serif`; // 设置字体样式
-
-    // 计算文字的总宽度
-    let totalTextWidth = 0;
-    texts.forEach(text => {
-        totalTextWidth += ctx.measureText(text).width;
-    });
-
-    // 计算分隔符的字体大小
-    const separatorFontSize = (separatorFontSizePercent / 100) * rect.height;
-
-    // 计算分隔符的总宽度
-    ctx.font = `${separatorFontSize}px sans-serif`; // 设置分隔符字体样式
-    const separatorWidth = (columnSeparatorWidthPercent / 100) * rect.width;
-    const totalSeparatorWidth = (texts.length - 1) * separatorWidth;
-
-    // 计算分隔符的左右边距
-    const separatorMarginLeft = (separatorMarginLeftPercent / 100) * rect.width;
-    const separatorMarginRight = (separatorMarginRightPercent / 100) * rect.width;
-
-    // 计算可用的总间距
-    const totalSpacing = (columnSpacingPercent / 100) * rect.width;
-
-    // 计算所有文字和间隔字符以及间距的总宽度
-    const totalWidth = totalTextWidth + totalSeparatorWidth + totalSpacing + (texts.length - 1) * (separatorMarginLeft + separatorMarginRight);
-
-    // 计算实际的起始坐标,使得文本和间隔字符居中于矩形
-    const startX = rect.x + (startXPercent / 100) * rect.width + (rect.width - totalWidth) / 2;
-    const startY = rect.y + (startYPercent / 100) * rect.height - (fontSize / 2); // 绘制文字,纵坐标居中
-
-    // 绘制文本和间隔字符
-    let currentX = startX;
-    texts.forEach((text, index) => {
-        ctx.font = `${fontSize}px sans-serif`; // 设置文字字体样式
-        ctx.fillStyle = color; // 设置文字颜色
-        ctx.fillText(text, currentX, startY + (fontSize / 2)); // 绘制文字,纵坐标居中
-        currentX += ctx.measureText(text).width;
-
-        // 如果不是最后一列,则绘制间隔字符
-        if (index < texts.length - 1) {
-            // 添加左边距
-            currentX += separatorMarginLeft;
-
-            // 设置分隔符颜色和字体样式
-            ctx.fillStyle = separatorColor;
-            ctx.font = `${separatorFontSize}px sans-serif`;
-
-            // 绘制分隔符
-            ctx.fillText(columnSeparator, currentX, startY + (separatorFontSize / 2));
-
-            // 添加右边距
-            currentX += separatorWidth + separatorMarginRight + columnSpacingPercent / 100 * rect.width;
-        }
-    });
-};
-
-
-
-
-
-
-export { drawTextInRect, drawLineInRect, drawPointInRect ,drawImageInRect,drawBorderImageInRect, drawRectInRect, drawHorizontalTextList};
-

+ 0 - 446
src/components/detailDialog.vue

@@ -1,446 +0,0 @@
-<template>
-    <el-dialog
-        v-model="winDialogVisible"
-        lock-scroll
-        modal-class="album-detail-modal"
-        :showClose="false"
-        width="86%"
-        align-center
-        @close="closeDialog"
-    >
-        <div class="detail-log">
-            <div class="congratulation-wrap">
-                <div class="congratulation-box">
-                    <div class="win-des">
-                        <!-- <img src="@/assets/img/weather_index/box-top.png" class="win-icon" /> -->
-                    </div>
-                    <div class="album-detail-box">
-                        <div class="detail-title">{{ dialogData.name }}</div>
-                        <div class="detail-desc-box">
-                            <!-- <div class="desc-item van-ellipsis" v-if="dialogData?.conditionList && dialogData.conditionList.length">
-                                <span class="item-name">{{ $t('触发条件') }}</span>
-                                {{
-                                    dialogData.condition ||
-                                    dialogData.conditionList[0].name + dialogData.conditionList[0].value
-                                }}
-                            </div> -->
-                            <div class="desc-item van-ellipsis">
-                                <span class="item-name">{{ $t('农事编号') }}</span>
-                                {{ dialogData.code }}
-                            </div>
-                            <div class="desc-item">
-                                <span class="item-name">{{ $t('推荐时间') }}</span>
-                                {{ dialogData.executeDate }}
-                            </div>
-                            <div class="desc-item">
-                                <div class="item-name">药物处方
-                                    <span class="no-prescription" v-if="!hasPrescription">{{ $t('暂无处方') }}</span>
-                                </div>
-                                <div class="item-table" v-if="hasPrescription">
-                                    <div class="table">
-                                        <div class="th">
-                                            <div class="td">{{ $t('类型') }}</div>
-                                            <div class="td width">{{ $t('名称') }}</div>
-                                            <div class="td">{{ $t('配比') }}</div>
-                                            <div class="td">{{ $t('方式') }}</div>
-                                        </div>
-                                        <div
-                                            class="tr"
-                                            v-for="(subP, subI) in dialogData.prescription?.pesticideFertilizerList"
-                                            :key="subI"
-                                        >
-                                            <div class="td">{{ subP.typeName }}</div>
-                                            <div class="td width">{{ subP.name }}</div>
-                                            <div class="td">{{ subP.ratio }}</div>
-                                            <div class="td">{{ $t('人工') }}</div>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
-                            <div class="card-link">
-                                <img :src="dialogData.expertIcon || dialogData.expertUserIcon" />
-                                <div class="expert-name">
-                                    {{ dialogData.expertUserName || dialogData.expertName }}
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-
-            <div class="bottom-btn" v-if="showBtn">
-                <div class="btn-item secondary-btn" @click="toPage">{{ btnText }}</div>
-                <div class="btn-item primary-btn" @click="triggerClick">{{ curRole == 0 ? "触发农事" : "下发农事" }}</div>
-            </div>
-        </div>
-        <template #footer>
-            <div class="dialog-footer">
-                <div class="close-btn">
-                    <!-- <el-icon size="32" color="#fff"><CircleCloseFilled /></el-icon> -->
-                    <!-- <el-button type="primary" class="one-btn" @click="toShare">{{ $t('立即分享') }}</el-button> -->
-                </div>
-            </div>
-        </template>
-    </el-dialog>
-
-    <Popup v-model:show="noShow" class="no-popup">
-        <div class="right-icon">
-            <img class="right-img" src="@/assets/img/home/right.png" alt="" />
-        </div>
-        <div class="no-popup-title">
-            <span>{{ curRole == 0 ? "好的,感谢您的配合" : "农事下发成功" }}</span>
-            <div class="no-popup-title-sub" v-if="curRole == 0">{{ $t('请您耐心等待 农事确认') }}</div>
-        </div>
-        <div class="no-popup-btn" @click="handleNoPopupBtn">{{ curRole == 0 ? "我知道了" : "我知道了" }}</div>
-    </Popup>
-</template>
-<script setup>
-import { ref, computed } from "vue";
-import eventBus from "@/api/eventBus";
-import { Popup } from "vant";
-import { useRoute, useRouter } from "vue-router";
-import { ElMessage } from "element-plus";
-
-const props = defineProps({
-    showSuccessOnly: {
-        type: Boolean,
-        default: false,
-    },
-});
-
-const curRole = localStorage.getItem("SET_USER_CUR_ROLE");
-
-const winDialogVisible = ref(false);
-const noShow = ref(false);
-const btnText = ref('');
-const route = useRoute();
-const router = useRouter();
-
-const triggerClick = () => {
-    winDialogVisible.value = false;
-    // 如果只显示成功弹窗(来自 album_recognize 页面)
-    if (props.showSuccessOnly) {
-        noShow.value = true;
-    }
-    emit("triggerFarmWork");
-};
-
-const emit = defineEmits(["triggerFarmWork", "noPopupBtn"]);
-
-const dialogData = ref({})
-const showBtn = ref(true);
-const showDialog = (id,btnTextVal = '转发', showBtnVal = true) => {
-    btnText.value = btnTextVal;
-    showBtn.value = showBtnVal;
-    if (id) {
-        VE_API.farm
-            .getFarmWorkLib({ id })
-            .then(({ code, data }) => {
-                if (code === 0 && data) {
-                    // 将接口返回的数据更新到 dialogData
-                    dialogData.value = data || {};
-                    settingData();
-                }
-            })
-            .catch((error) => {
-                console.error("获取农事详情失败:", error);
-            });
-    }
-    winDialogVisible.value = true;
-};
-
-defineExpose({ showDialog });
-
-//立即激活
-const handleAct = () => {
-    winDialogVisible.value = false;
-    eventBus.emit("uploadUopup:show", {
-        gardenIdVal: dialogData.value.farmId,
-        orderIdVal: dialogData.value.orderId,
-        textVal: dialogData.value.consequenceText,
-    });
-};
-
-const pesticideFertilizers = ref([]);
-
-// 判断是否有处方数据
-const hasPrescription = computed(() => {
-    const pesticideFertilizerList = dialogData.value.prescription?.pesticideFertilizerList;
-    return pesticideFertilizerList && Array.isArray(pesticideFertilizerList) && pesticideFertilizerList.length > 0;
-});
-
-const settingData = () => {
-    const pesticideFertilizerList = dialogData.value.prescription?.pesticideFertilizerList;
-    pesticideFertilizers.value = pesticideFertilizerList || [];
-};
-
-function closeDialog() {
-    winDialogVisible.value = false;
-}
-
-function toPage() {
-    if(btnText.value!='转发'){
-        router.push("/expert_list");
-    }
-    ElMessage.warning("该功能正在升级中,敬请期待");
-}
-
-const handleNoPopupBtn = () => {
-    noShow.value = false;
-    // if(curRole == 0){
-    //     noShow.value = false;
-    // }else{
-    //     noShow.value = false;
-    //     emit("noPopupBtn");
-    // }
-};
-</script>
-
-<style lang="scss" scoped>
-.congratulation-wrap {
-    border-radius: 12px;
-    background: #f4f5f4;
-    width: 100%;
-}
-.detail-log {
-    width: 100%;
-}
-.close-btn {
-    text-align: center;
-    margin-top: 20px;
-}
-.bottom-btn {
-    position: absolute;
-    width: 100%;
-    text-align: center;
-    margin-top: 20px;
-    display: flex;
-    .btn-item {
-        flex: 1;
-        text-align: center;
-        height: 38px;
-        line-height: 38px;
-        border-radius: 30px;
-        font-size: 14px;
-        &.secondary-btn {
-            background: #ffffff;
-            color: #000000;
-        }
-        &.primary-btn {
-            background: linear-gradient(180deg, #76c3ff, #2199f8);
-            color: #ffffff;
-        }
-    }
-    .btn-item + .btn-item {
-        margin-left: 12px;
-    }
-}
-.congratulation-box {
-    border-radius: 12px;
-    background: url("@/assets/img/home/sd-bg.png") no-repeat top center / contain;
-    // background: url("@/assets/img/home/box-top.png") no-repeat top center / contain;
-    .el-message-box__message {
-        padding: 12px 0 24px 0;
-    }
-    .win-title {
-        color: #1d1e1f;
-        font-family: "PangMenZhengDao", sans-serif; /* 使用自定义字体 */
-        text-align: center;
-        font-size: 24px;
-        line-height: 32px;
-    }
-    .win-detail {
-        text-align: center;
-        color: #252525;
-        padding-top: 6px;
-        font-size: 16px;
-        span {
-            font-size: 22px;
-            color: #2199f8;
-            padding: 0 6px;
-            font-weight: bold;
-        }
-    }
-    .win-des {
-        height: 180px;
-        text-align: center;
-    }
-    .win-icon {
-        width: 100%;
-        border-radius: 12px 12px 0 0;
-    }
-}
-.album-detail-box {
-    padding: 0 10px 16px 10px;
-    color: #000;
-    position: relative;
-    // top: -58px;
-    .detail-title {
-        font-size: 24px;
-        font-weight: bold;
-        padding-bottom: 8px;
-        letter-spacing: 1.6px;
-    }
-    .detail-desc-box {
-        position: relative;
-        .desc-item {
-            font-size: 14px;
-            &.van-ellipsis{
-                max-width: calc(100% - 86px);
-            }
-            .item-name {
-                color: #999999;
-                margin-right: 12px;
-            }
-            .no-prescription {
-                margin-left: 12px;
-                color: #000;
-            }
-            .item-table {
-                margin-top: 8px;
-                .table {
-                    border: 1px solid rgba(196, 196, 196, 0.8);
-                    border-radius: 4px;
-                    font-size: 13px;
-                    .th {
-                        background: #f5f5f5;
-                        color: #999999;
-                        display: flex;
-                        justify-content: space-between;
-                        border-radius: 4px 4px 0 0;
-                        padding: 4px 0;
-                    }
-                    .tr {
-                        display: flex;
-                        justify-content: space-between;
-                        align-items: center;
-                        color: #333333;
-                        padding: 6px 0;
-                    }
-
-                    .tr + .tr {
-                        border-top: 1px solid rgba(0, 0, 0, 0.08);
-                    }
-                    .td {
-                        width: 25%;
-                        padding: 0 2px;
-                        text-align: center;
-                    }
-                    .width {
-                        width: 55%;
-                    }
-                }
-            }
-        }
-        .desc-item + .desc-item {
-            padding-top: 4px;
-        }
-        .card-link {
-            display: flex;
-            flex-direction: column;
-            align-items: center;
-            justify-content: center;
-            color: #2199f8;
-            font-size: 12px;
-            position: absolute;
-            right: 6px;
-            top: 0px;
-            .expert-name {
-                background: #d3e8ff;
-                border-radius: 4px;
-                padding: 1px 12px;
-                margin-top: 4px;
-                display: flex;
-                align-items: center;
-            }
-            img {
-                width: 48px;
-                height: 48px;
-                border-radius: 50%;
-                object-fit: cover;
-            }
-            .icon {
-                padding-right: 2px;
-            }
-        }
-    }
-}
-.dialog-footer {
-    position: relative;
-    .close-btn {
-        position: absolute;
-        bottom: -58px;
-        left: 0;
-        right: 0;
-        margin: 0 auto;
-        text-align: center;
-    }
-}
-
-.no-popup {
-    width: 300px;
-    border-radius: 14px;
-    padding: 28px 15px 20px;
-    box-sizing: border-box;
-    .right-icon {
-        text-align: center;
-        padding-bottom: 12px;
-        .right-img {
-            width: 68px;
-        }
-    }
-    .no-popup-title {
-        font-size: 24px;
-        font-weight: 500;
-        text-align: center;
-        .no-popup-title-sub {
-            font-size: 14px;
-            margin-top: 8px;
-        }
-    }
-    .no-popup-btn {
-        background-color: #2199f8;
-        padding: 8px;
-        border-radius: 20px;
-        color: #fff;
-        font-size: 16px;
-        margin-top: 32px;
-        text-align: center;
-    }
-}
-</style>
-
-<style lang="scss">
-.album-detail-modal {
-    .el-overlay-dialog {
-        .el-dialog {
-            padding: 0;
-            border-radius: 12px;
-            background: none;
-            box-shadow: none;
-            margin-bottom: 70px;
-            margin-top: 10px;
-            overflow: auto;
-            scrollbar-width: none;
-            display: flex;
-            flex-direction: column;
-            align-items: center;
-            justify-content: center;
-            pointer-events: none;
-            .el-dialog__header {
-                padding: 0;
-            }
-            .el-dialog__body {
-                pointer-events: all;
-                width: 100%;
-            }
-        }
-
-        .one-btn {
-            width: 210px;
-            height: 40px;
-            line-height: 40px;
-        }
-    }
-}
-</style>

+ 0 - 387
src/components/gardenList.vue

@@ -1,387 +0,0 @@
-<template>
-    <div class="garden-list-page">
-        <div
-            v-for="item in gardenList"
-            :key="item.id"
-            class="garden-card"
-            :class="{ 'is-current': item.isCurrent }"
-            @click="handleSelectFarm(item)"
-        >
-            <div class="garden-card-header">
-                <div class="garden-main">
-                    <div class="garden-top-row">
-                        <span class="garden-name van-ellipsis">{{ item.name }}</span>
-                        <div class="warning-tag">
-                            <span>{{ t("common.droughtWarning") }}</span>
-                            <el-icon size="10"><ArrowRightBold /></el-icon>
-                        </div>
-                    </div>
-                    <div class="garden-address van-ellipsis">{{ item.rawAddress || t("common.noAddress") }}</div>
-                </div>
-                <div
-                    v-if="item.isCurrent"
-                    class="action-btn action-btn-current"
-                    type="button"
-                >
-                    {{ t("garden.currentFarm") }}
-                </div>
-                <div
-                    v-else
-                    class="action-btn action-btn-default"
-                    type="button"
-                    @click.stop="handleSelectFarm(item)"
-                >
-                    {{ t("garden.setDefaultFarm") }}
-                </div>
-            </div>
-
-            <!-- <div class="card-divider"></div>
-
-            <div class="stat-list">
-                <div
-                    v-for="stat in item.stats"
-                    :key="stat.label"
-                    class="stat-item"
-                    :class="[`is-${stat.type}`]"
-                >
-                    <div class="stat-title">{{ stat.title }}</div>
-                    <div class="stat-label">{{ stat.label }}</div>
-                </div>
-            </div> -->
-        </div>
-    </div>
-
-    <!-- 新增农场 -->
-    <div class="garden-btn fixed-btn" @click="handleAddFarm">
-        <span class="add-garden-btn-text">{{ t("garden.addFarm") }}</span>
-    </div>
-</template>
-
-<script setup>
-import { onActivated, ref, watch } from "vue";
-import { useRouter } from "vue-router";
-import { useI18n } from "@/i18n";
-
-const { t, locale } = useI18n();
-const router = useRouter();
-
-const props = defineProps({
-    gardenId: {
-        type: [Number, String],
-        default: null
-    }
-});
-
-const emit = defineEmits(["selectGarden", "loaded"]);
-
-const gardenList = ref([]);
-
-const STAT_CONFIG = [
-    { titleKey: "statFarm11", labelKey: "statSomeRisk", type: "danger" },
-    { titleKey: "statFarm22", labelKey: "statStandardFarm", type: "danger" },
-    { titleKey: "statFarm22", labelKey: "statStandardControl", type: "safe" },
-];
-
-function mapStats() {
-    return STAT_CONFIG.map(({ titleKey, labelKey, type }) => ({
-        title: t(`garden.${titleKey}`),
-        label: t(`garden.${labelKey}`),
-        type,
-    }));
-}
-
-function refreshGardenStats() {
-    if (!gardenList.value.length) return;
-    gardenList.value = gardenList.value.map((farm) => ({
-        ...farm,
-        stats: mapStats(),
-    }));
-}
-
-watch(locale, refreshGardenStats);
-
-function saveSelectedFarm(farm) {
-    localStorage.setItem("selectedFarmId", farm.id);
-    localStorage.setItem("selectedFarmName", farm.name || "");
-    localStorage.setItem("selectedFarmPoint", farm.wkt || "");
-    localStorage.setItem("selectedFarmData", JSON.stringify(farm));
-}
-
-function emitSelectedFarm(farm) {
-    emit("selectGarden", {
-        ...farm,
-        id: Number(farm.id),
-        name: farm.name || "",
-        wkt: farm.wkt || "",
-        defaultOption: !!farm.defaultOption
-    });
-}
-
-function markCurrentFarm(selectedId) {
-    gardenList.value = gardenList.value.map((farm) => ({
-        ...farm,
-        isCurrent: Number(farm.id) === Number(selectedId)
-    }));
-}
-
-function selectDefaultFarm(data) {
-    const defaultFarm = data.find((farm) => farm.defaultOption === true);
-    return defaultFarm || data[0];
-}
-
-function selectFarmFromList(data) {
-    // 1) 传入 gardenId 时优先使用(与 weatherInfo copy 逻辑一致)
-    if (props.gardenId) {
-        const gardenFarm = data.find((farm) => Number(farm.id) === Number(props.gardenId));
-        if (gardenFarm) {
-            return gardenFarm;
-        }
-    }
-
-    // 2) gardenId 不可用时,回退到本地缓存的选中农场
-    const savedFarmId = localStorage.getItem("selectedFarmId");
-    const savedFarmName = localStorage.getItem("selectedFarmName");
-    if (savedFarmId && savedFarmName) {
-        // 名称以最新列表为准,避免改名后仍显示缓存旧值
-        const savedFarm = data.find((farm) => Number(farm.id) === Number(savedFarmId));
-        if (savedFarm) {
-            return savedFarm;
-        }
-    }
-
-    // 3) 都不可用时,按默认农场规则兜底
-    return selectDefaultFarm(data);
-}
-
-function resolveFarmPointWkt(farm) {
-    if (farm.geom_wkt && /^POINT\s*\(/i.test(String(farm.geom_wkt).trim())) {
-        return farm.geom_wkt;
-    }
-    if (farm.farm_location && /^POINT\s*\(/i.test(String(farm.farm_location).trim())) {
-        return farm.farm_location;
-    }
-    return farm.geom_wkt || "";
-}
-
-function normalizeFarmList(data) {
-    return (data || []).map((farm) => ({
-        ...farm,
-        id: farm.farm_id,
-        name: farm.farm_name,
-        wkt: resolveFarmPointWkt(farm),
-        rawAddress: farm.farm_address || farm.city || "",
-        stats: mapStats(),
-        isCurrent: false
-    }));
-}
-
-function getFarmList() {
-    VE_API.farm.getFarmList().then(({ data }) => {
-        const fullData = normalizeFarmList(data);
-        gardenList.value = fullData;
-        if (!fullData.length) {
-            emit("loaded", { hasFarm: false });
-            emit("selectGarden", { farm_id: null, farm_name: "", geom_wkt: "", defaultOption: false });
-            return;
-        }
-
-        const selectedFarm = selectFarmFromList(fullData);
-        markCurrentFarm(selectedFarm.id);
-        saveSelectedFarm(selectedFarm);
-        emit("loaded", { hasFarm: true });
-        emitSelectedFarm(selectedFarm);
-    }).catch(() => {
-        gardenList.value = [];
-        emit("loaded", { hasFarm: false });
-    });
-}
-
-function handleSelectFarm(item) {
-    markCurrentFarm(item.id);
-    saveSelectedFarm(item);
-    emitSelectedFarm(item);
-}
-
-function handleAddFarm() {
-    router.push(`/create_farm?from=growth_report&isReload=true`);
-}
-
-watch(() => props.gardenId, (newGardenId) => {
-    if (!newGardenId || !gardenList.value.length) {
-        return;
-    }
-
-    // 父组件回传的是当前已选农场时,不再重复触发一次选择事件
-    const currentFarm = gardenList.value.find((farm) => farm.isCurrent);
-    if (currentFarm && Number(currentFarm.id) === Number(newGardenId)) {
-        return;
-    }
-
-    const targetFarm = gardenList.value.find((farm) => Number(farm.id) === Number(newGardenId));
-    if (!targetFarm) {
-        return;
-    }
-
-    handleSelectFarm(targetFarm);
-});
-
-onActivated(() => {
-    // getFarmList();
-});
-
-defineExpose({
-    refreshFarmList: getFarmList
-});
-</script>
-
-<style lang="scss" scoped>
-.garden-list-page {
-    height: 100vh;
-    overflow: auto;
-    padding: 115px 10px 120px 10px;
-    box-sizing: border-box;
-    background: linear-gradient(180deg, #2199F8 10%, #F5F5F5 31%, #F5F5F5 73%, #F5F5F5 100%);
-}
-
-.garden-card {
-    margin-bottom: 10px;
-    padding: 10px 12px;
-    border-radius: 8px;
-    border: 1px solid transparent;
-    background: #fff;
-    box-sizing: border-box;
-}
-
-.garden-card.is-current {
-    border-color: #2199f8;
-    .garden-name {
-        color: #2199f8;
-    }
-}
-
-.garden-card-header {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    gap: 6px;
-}
-
-.garden-main {
-    flex: 1;
-    min-width: 0;
-}
-
-.garden-top-row {
-    display: flex;
-    align-items: center;
-    gap: 10px;
-    min-width: 0;
-}
-
-.garden-name {
-    max-width: 220px;
-    font-size: 14px;
-    color: #1D2129;
-}
-
-.warning-tag {
-    display: inline-flex;
-    align-items: center;
-    gap: 4px;
-    height: 20px;
-    padding: 0 8px;
-    border-radius: 4px;
-    background: rgba(255, 149, 61, 0.2);
-    font-size: 12px;
-    color: #FF953D;
-    white-space: nowrap;
-}
-
-.garden-address {
-    margin-top: 2px;
-    font-size: 12px;
-    color: rgba(32, 32, 32, 0.4);
-}
-
-.action-btn {
-    flex-shrink: 0;
-    height: 22px;
-    border: none;
-    font-size: 12px;
-    line-height: 22px;
-}
-
-.action-btn-current {
-    color: #ffffff;
-    padding: 0 8px;
-    border-radius: 2px;
-    background: #2199f8;
-}
-
-.action-btn-default {
-    color: #2199f8;
-}
-
-.card-divider {
-    height: 1px;
-    margin: 10px 0 20px;
-    background: rgba(0, 0, 0, 0.1);
-}
-
-.stat-list {
-    display: flex;
-    gap: 12px;
-}
-
-.stat-item {
-    flex: 1;
-    height: 50px;
-    border-radius: 4px;
-    display: flex;
-    align-items: center;
-    flex-direction: column;
-    justify-content: center;
-    text-align: center;
-    color: #ffffff;
-}
-
-.stat-item.is-danger {
-    background: #fb6669;
-}
-
-.stat-item.is-safe {
-    background: #4cbc32;
-}
-
-.stat-title {
-    font-size: 15px;
-    line-height: 22px;
-}
-
-.stat-label {
-    font-size: 10px;
-    line-height: 14px;
-}
-
-.fixed-btn {
-    position: fixed;
-    bottom: 80px;
-    left: 0;
-    right: 0;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    padding: 0px 32px;
-    box-sizing: border-box;
-    background: #fff;
-    height: 40px;
-    line-height: 40px;
-    border-radius: 20px;
-    background: linear-gradient(180deg, #8ACBFF 0%, #2199F8 100%);
-    color: #fff;
-    font-size: 14px;
-    text-align: center;
-    margin: 0 auto;
-    width: fit-content;
-}
-</style>

+ 0 - 231
src/components/pageComponents/AgriculturalInteractionCard.vue

@@ -1,231 +0,0 @@
-<template>
-    <!-- 只封装时间轴区域 -->
-    <div class="timeline">
-        <div class="timeline-item" v-for="timelineItem in item.timelineList" :key="timelineItem.id">
-            <div class="timeline-left">
-                <div class="dot"></div>
-                <div class="line"></div>
-            </div>
-            <div class="timeline-right">
-                <div class="date">
-                    <span class="work-name">{{ timelineItem.farmWorkName }}</span>
-                    <!-- <span v-show="timelineItem.expectedRisk">({{ timelineItem.expectedRisk }})</span> -->
-                    <span class="ignore-btn" v-if="hasPlanPermission" @click="handleIgnore(item,timelineItem)"> 忽略 </span>
-                </div>
-                <div class="text">
-                    预计报价<span class="price">{{ timelineItem.estimatedCost }}元</span>
-                    <span class="action-detail" @click="toDetail(timelineItem, item)"
-                        >查看详情</span
-                    >
-                    <!-- <span class="action-detail" @click="showPriceSheetPopup(timelineItem.farmWorkId, item)">查看报价单</span> -->
-                </div>
-            </div>
-            <div class="timeline-action" @click="handleTimelineAction(timelineItem, item.farmId)">转入农事任务</div>
-        </div>
-    </div>
-    <popup v-model:show="showTaskPopup" z-index="10000" round class="task-tips-popup">
-        <img class="create-farm-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
-        <div class="create-farm-text">
-            <div>
-                您确认忽略 <span class="main-text">{{ currentTask?.farmName }}</span> 的
-                <span class="main-text">{{ currentTask?.farmWorkName }}</span> 农事吗
-            </div>
-        </div>
-        <div class="create-farm-btn" @click="handlePopupBtn">确认忽略</div>
-    </popup>
-</template>
-
-<script setup>
-import { Popup } from "vant";
-import { computed, ref } from "vue";
-import { ElMessage } from "element-plus";
-import { useRouter } from "vue-router";
-
-const router = useRouter();
-
-const props = defineProps({
-    item: {
-        type: Object,
-        required: true,
-        default: () => ({}),
-    },
-});
-
-// 检查是否有"转入农事"权限
-const hasPlanPermission = computed(() => {
-    try {
-        const userInfoStr = localStorage.getItem("localUserInfo");
-        if (!userInfoStr) return false;
-        const userInfo = JSON.parse(userInfoStr);
-        const permissions = userInfo.agriculturalPermissions || [];
-        return permissions.includes("转入农事");
-    } catch (error) {
-        console.error("解析用户信息失败:", error);
-        return false;
-    }
-});
-
-
-const handleTimelineAction = (timelineItem, farmId) => {
-    if (!hasPlanPermission.value) {
-        ElMessage.warning("您暂无权限操作");
-        return;
-    }
-    router.push({
-        path: "/work_detail",
-        query: {
-            miniJson: JSON.stringify({
-                id: timelineItem.farmWorkId,
-                arrangeId: timelineItem.arrangeId,
-                farmId,
-            }),
-        },
-    });
-};
-
-const emits = defineEmits(["updateList"]);
-
-const handleUploadSuccess = async () => {
-    emits("updateList");
-};
-
-const toDetail = (timelineItem, item) => {
-    router.push({
-        path: "/work_detail",
-        query: {
-            miniJson: JSON.stringify({
-                id: timelineItem.farmWorkId,
-                arrangeId: timelineItem.arrangeId,
-                farmId: item.farmId,
-            }),
-        },
-    });
-};
-
-// 忽略农事库
-const currentTask = ref(null);
-const showTaskPopup = ref(false);
-const handleIgnore = (item, timelineItem) => {
-    currentTask.value = { ...item, ...timelineItem };
-    showTaskPopup.value = true;
-};
-
-const handlePopupBtn = () => {
-    VE_API.home.ignoreFarmWorkLib({ farmWorkLibId: currentTask.value.farmWorkId }).then(({ code }) => {
-        if (code === 0) {
-            showTaskPopup.value = false;
-            ElMessage.success("忽略成功");
-            handleUploadSuccess();
-        }
-    });
-};
-
-</script>
-
-<style scoped lang="scss">
-.timeline {
-    margin-left: -5px;
-    margin-top: 8px;
-    .timeline-item {
-        display: flex;
-        align-items: flex-start;
-        font-size: 14px;
-        color: #ffffff;
-        line-height: 22px;
-        & + .timeline-item {
-            margin-top: 10px;
-        }
-        .timeline-left {
-            width: 22px;
-            display: flex;
-            flex-direction: column;
-            align-items: center;
-            .dot {
-                width: 6px;
-                height: 6px;
-                border-radius: 50%;
-                background: #a2d5fd;
-                margin-top: 6px;
-            }
-            .line {
-                border-left: 1px dashed #a2d5fd;
-                margin-top: 4px;
-                height: 28px;
-            }
-        }
-        .timeline-right {
-            padding-left: 5px;
-            flex: 1;
-            .date {
-                color: #1d2129;
-                font-weight: 500;
-                font-size: 14px;
-                line-height: 22px;
-            }
-            .text {
-                font-size: 12px;
-                color: #d7d7d7;
-                .price {
-                    padding-left: 4px;
-                }
-                .action-detail {
-                    margin-left: 6px;
-                    color: #2199f8;
-                    border-bottom: 1px solid;
-                }
-            }
-            .work-name {
-                padding-left: 4px;
-            }
-            .ignore-btn {
-                margin-left: 6px;
-                color: rgba(29, 33, 41, 0.4);
-                font-size: 13px;
-            }
-        }
-        .timeline-action {
-            align-self: center;
-            height: 28px;
-            line-height: 28px;
-            flex: none;
-            background: rgba(33, 153, 248, 0.1);
-            color: #2199f8;
-            font-size: 12px;
-            padding: 0px 11px;
-            border-radius: 20px;
-        }
-    }
-}
-.task-tips-popup {
-    width: 90%;
-    padding: 28px 28px 20px;
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    justify-content: center;
-    .create-farm-icon {
-        width: 52px;
-        height: 52px;
-        margin-bottom: 12px;
-    }
-    .create-farm-text {
-        font-size: 19px;
-        font-weight: 500;
-        margin-bottom: 32px;
-        text-align: center;
-    }
-    .main-text {
-        color: #2199f8;
-    }
-    .create-farm-btn {
-        width: 100%;
-        box-sizing: border-box;
-        padding: 8px;
-        border-radius: 25px;
-        font-size: 16px;
-        background: #2199f8;
-        color: #fff;
-        text-align: center;
-    }
-}
-</style>

+ 0 - 1731
src/components/pageComponents/ArchivesFarmTimeLine copy.vue

@@ -1,1731 +0,0 @@
-<template>
-    <div class="timeline-container" ref="timelineContainerRef">
-        <div class="timeline-list" ref="timelineListRef">
-            <empty v-if="isEmpty" image="https://birdseye-img.sysuimars.com/birdseye-look-mini/custom-empty-image.png"
-                image-size="80" description="暂无数据" class="empty-state" />
-            <template v-else>
-                <!-- <div class="timeline-middle-line"></div>
-                <div v-for="(t, tIdx) in phenologyStartDates" :key="`term-${uniqueTimestamp}-${tIdx}`"
-                    class="timeline-term" :style="getTermStyle(t, tIdx)">
-                    <span class="term-name">{{ formatDate(t.startDate) }}</span>
-                </div> -->
-                <div v-for="(p, idx) in phenologyList" :key="`phenology-${uniqueTimestamp}-${idx}`"
-                    class="phenology-bar">
-                    <div class="phenology-title" :class="{
-                        'phenology-title--wide': showPhenologyName && !phenologyNeedsTwoLabelColumns(p),
-                        'phenology-red': !shouldShowBlue(p),
-                        'phenology-blue': shouldShowBlue(p),
-                    }" v-if="shouldShowPhenologyBarTitle(idx)">
-                        {{ p.phenologyName }}
-                    </div>
-                    <div v-for="(r, rIdx) in Array.isArray(p.reproductiveList) ? p.reproductiveList : []"
-                        :key="`reproductive-${uniqueTimestamp}-${idx}-${rIdx}`" class="reproductive-item">
-                        <div class="arranges" :class="{ 'arranges-min': !showPhenologyName }">
-                            <div v-for="(fw, aIdx) in Array.isArray(r.farmWorkArrangeList) ? r.farmWorkArrangeList : []"
-                                :key="`arrange-${uniqueTimestamp}-${idx}-${rIdx}-${aIdx}`" class="arrange-card" :class="[
-                                    getArrangeStatusClass(fw),
-                                    {
-                                        'last-card':
-                                            aIdx === r.farmWorkArrangeList.length - 1 &&
-                                            rIdx !== r.farmWorkArrangeList.length - 1,
-                                    },
-                                    // 按单张农事展示日期置灰:晚于今天为 future-card;无日期时回退物候期规则
-                                    { 'future-card': shouldGrayFarmWorkCard(fw, p) },
-                                ]" @click="handleRowClick(fw)">
-                                <div class="card-content">
-                                    <div class="card-left"
-                                        @click.stop="handleStatusDetail(fw)"
-                                        :style="{ width: fw.sourceDataJson && fw.sourceDataJson.resFilename ? 'calc(100% - 45px)' : '100%' }"
-                                        v-if="pageType === 'agri_plan'">
-                                        <div class="left-info">
-                                            <div class="left-date">{{ formatDate(fw.createTime) }}</div>
-                                            <div class="status-tag">{{ archiveTypeObj[fw.archiveType] }}</div>
-                                            <div class="text">
-                                                <span class="van-ellipsis">{{ fw.title }}</span>
-                                            </div>
-                                        </div>
-                                        <div class="title-text van-ellipsis">{{ fw.description }}</div>
-                                        <!-- <div class="title-text van-ellipsis"
-                                            v-if="!shouldGrayFarmWorkCard(fw, p) && fw.sourceType != 4">{{ fw.content }}
-                                        </div>
-                                        <div v-else class="title-text van-ellipsis">点击查看区域</div> -->
-                                    </div>
-                                    <div class="card-left agri-record-card" v-else>
-                                        <div class="left-info">
-                                            <div class="left-date">{{ formatDate(fw.recommendDate) }}</div>
-                                            <div class="text van-ellipsis" @click.stop="handleStatusDetail(fw)">
-                                                <span class="text-name">{{ fw.farmWorkName }}</span>
-                                                <el-icon class="text-icon">
-                                                    <ArrowRight />
-                                                </el-icon>
-                                            </div>
-                                        </div>
-                                        <div class="title-wrap van-ellipsis"
-                                            v-if="fw.flowStatus != null && fw.flowStatus != 0 && fw.flowStatus != -2">
-                                            <div class="title-text">{{ handleTagType(fw.flowStatus,
-                                                fw.executeEvidenceAuditStatus) }}</div>
-                                        </div>
-                                    </div>
-                                    <div class="card-right"
-                                        v-if="fw.sourceDataJson && fw.sourceDataJson.resFilename && fw.sourceDataJson.resFilename.length > 0"
-                                        @click.stop="handleImageClick(fw)">
-                                        <img v-if="fw.sourceType === 7"
-                                            :src="base_img_url2 + fw.sourceDataJson?.executeImageUrls?.[0]" alt="" />
-                                        <img v-else :src="base_img_url2 + fw.sourceDataJson?.resFilename?.[0]?.filename"
-                                            alt="" />
-                                        <div class="num" v-if="fw?.sourceDataJson?.imageIds">
-                                            {{ fw?.sourceDataJson?.imageIds?.length ||
-                                                fw?.sourceDataJson?.executeImageUrls?.length || 0 }}
-                                        </div>
-                                    </div>
-                                    <div class="status-right" v-if="fw.archiveType === 2">待校准</div>
-                                </div>
-                            </div>
-                        </div>
-                        <template v-if="showPhenologyName">
-                            <template v-if="r.name === p.phenologyName">
-                                <template v-if="!shouldShowPhenologyBarTitle(idx)">
-                                    <div class="phenology-name" :class="{
-                                        single: showPhenologyName && !phenologyNeedsTwoLabelColumns(p),
-                                        'phenology-red': !shouldShowBlueLeft(p, r),
-                                        'text-blue': shouldShowBlueLeft(p, r),
-                                    }"
-                                        :style="p.phenologyName === getNextPhenologyName(idx, rIdx) ? 'padding: 6px 0;' : ''">
-                                        {{ p.phenologyName }}
-                                    </div>
-                                </template>
-                            </template>
-                            <template v-else>
-                                <template v-if="p.phenologyName === getNextPhenologyName(idx, rIdx)">
-                                    <div class="phenology-name"
-                                        :class="{ 'text-red': !shouldShowBlueLeft(p, r), 'text-blue': shouldShowBlueLeft(p, r) }">
-                                        {{ r.name }}
-                                    </div>
-                                </template>
-                                <template v-else>
-                                    <div class="phenology-name"
-                                        :class="{ 'text-red': !shouldShowBlueLeft(p, r), 'text-blue': shouldShowBlueLeft(p, r) }">
-                                        {{ r.name }}
-                                    </div>
-                                    <div class="phenology-name mr" :class="{
-                                        'phenology-red': !shouldShowBlueLeft(p, r),
-                                        'phenology-blue': shouldShowBlueLeft(p, r),
-                                    }">
-                                        {{ p.phenologyName }}
-                                    </div>
-                                </template>
-                            </template>
-                        </template>
-                    </div>
-                </div>
-            </template>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { ref, nextTick, watch, onMounted, onUnmounted, onActivated, onDeactivated, computed } from "vue";
-import { useRouter, useRoute, onBeforeRouteLeave } from "vue-router";
-import { ElMessage } from "element-plus";
-import { Empty, showImagePreview } from "vant";
-import { base_img_url2 } from "@/api/config";
-
-const router = useRouter();
-const route = useRoute();
-
-const props = defineProps({
-    // 农场 ID,用于请求农事规划数据
-    farmId: {
-        type: [String, Number],
-        default: null,
-    },
-    // 年份
-    year: {
-        type: [Number, String],
-        default: new Date().getFullYear(),
-    },
-    // 是否是标准农事
-    isStandard: {
-        type: Boolean,
-        default: false,
-    },
-    // 方案ID
-    schemeId: {
-        type: [Number, String],
-        default: null,
-    },
-    // 类型:agri_record / agri_plan
-    pageType: {
-        type: String,
-        default: "agri_plan",
-    },
-    // 区域ID
-    regionId: {
-        type: [Number, String],
-        default: null,
-    },
-    // 容器ID
-    containerId: {
-        type: [Number, String],
-        default: null,
-    },
-    // 类型ID
-    typeId: {
-        type: [Number, String],
-        default: null,
-    },
-    // 问题分区ID
-    problemZoneId: {
-        type: [Number, String],
-        default: null,
-    },
-});
-
-const emits = defineEmits(["row-click", "card-click"]);
-
-const solarTerms = ref([]);
-const phenologyList = ref([]);
-// 从物候期列表中提取起始时间,用于时间轴显示
-const phenologyStartDates = computed(() => {
-    if (!phenologyList.value || phenologyList.value.length === 0) {
-        return [];
-    }
-    // 从每个物候期中提取起始时间,并去重排序
-    const startDatesMap = new Map();
-    phenologyList.value.forEach((phenology) => {
-        if (phenology.startDate) {
-            const dateKey = phenology.startDate;
-            // 如果该日期还没有添加过,或者需要更新信息
-            if (!startDatesMap.has(dateKey)) {
-                startDatesMap.set(dateKey, {
-                    startDate: phenology.startDate,
-                    id: phenology.id || `phenology-${dateKey}`,
-                });
-            }
-        }
-    });
-    // 转换为数组并按时间排序
-    const result = Array.from(startDatesMap.values()).sort((a, b) => {
-        const timeA = safeParseDate(a.startDate);
-        const timeB = safeParseDate(b.startDate);
-        if (isNaN(timeA) || isNaN(timeB)) return 0;
-        return timeA - timeB;
-    });
-    return result;
-});
-const timelineContainerRef = ref(null);
-const timelineListRef = ref(null);
-const getTimelineScrollKey = () =>
-    `timelineScrollTop:${props.pageType}:${props.farmId ?? "none"}:${props.regionId ?? "none"}:${props.containerId ?? "none"}:${route.path}`;
-
-const saveTimelineScrollTop = () => {
-    if (!timelineContainerRef.value) return;
-    const scrollTop = timelineContainerRef.value.scrollTop || 0;
-    sessionStorage.setItem(getTimelineScrollKey(), scrollTop.toString());
-};
-
-const restoreTimelineScrollTop = () => {
-    if (!timelineContainerRef.value) return false;
-    const savedScrollTop = sessionStorage.getItem(getTimelineScrollKey());
-    if (savedScrollTop == null) return false;
-    const scrollTop = Number(savedScrollTop);
-    if (Number.isNaN(scrollTop)) return false;
-    const maxScrollTop = Math.max(
-        0,
-        (timelineContainerRef.value.scrollHeight || 0) - (timelineContainerRef.value.clientHeight || 0)
-    );
-    timelineContainerRef.value.scrollTop = Math.min(scrollTop, maxScrollTop);
-    return true;
-};
-const restoreTimelineScrollTopWithRetry = (retryCount = 4) => {
-    const restored = restoreTimelineScrollTop();
-    if (restored || retryCount <= 0) return restored;
-    setTimeout(() => {
-        restoreTimelineScrollTopWithRetry(retryCount - 1);
-    }, 60);
-    return false;
-};
-// 标记是否为首次加载
-const isInitialLoad = ref(true);
-// 存储timeline-list的实际渲染高度
-const timelineListHeight = ref(0);
-// 生成唯一的时间戳,用于确保key的唯一性
-const uniqueTimestamp = ref(Date.now());
-// ResizeObserver 实例,用于监听高度变化
-let resizeObserver = null;
-// 标记是否为空数据
-const isEmpty = ref(false);
-// 标记是否正在请求数据,防止重复请求
-const isRequesting = ref(false);
-// 记录上一次请求作用域,避免相同参数重复请求
-const lastRequestedFarmId = ref(null);
-
-const farmWorkPlanScopeKey = () =>
-    JSON.stringify([
-        props.pageType ?? null,
-        props.farmId ?? null,
-        props.regionId ?? null,
-        props.problemZoneId ?? null,
-        props.year ?? null,
-        props.containerId ?? null,
-    ]);
-
-const resetTimelineData = () => {
-    solarTerms.value = [];
-    phenologyList.value = [];
-};
-
-const setEmptyTimelineData = () => {
-    resetTimelineData();
-    isEmpty.value = true;
-};
-
-// 获取当前季节
-const getCurrentSeason = () => {
-    const month = new Date().getMonth() + 1; // 1-12
-    if (month >= 1 && month <= 5) {
-        return "spring"; // 春季:3-5月
-    } else if (month >= 6 && month <= 8) {
-        return "summer"; // 夏季:6-8月
-    } else if (month >= 9 && month <= 10) {
-        return "autumn"; // 秋季:9-10月
-    } else {
-        return "winter"; // 冬季:11-2月
-    }
-};
-
-// 安全解析时间到时间戳(ms)
-/** 解析 sourceData JSON,避免大整数(如雪花 ID)被 JSON.parse 精度丢失(>2^53 会变成 500 结尾等) */
-const parseSourceDataSafe = (str) => {
-    if (!str) return null;
-    try {
-        const fixed = str.replace(/"imageIds"\s*:\s*\[([^\]]*)\]/g, (_, arr) => {
-            const quoted = arr.split(",").map((s) => {
-                const t = s.trim().replace(/^["']|["']$/g, "");
-                return /^\d+$/.test(t) ? `"${t}"` : s.trim();
-            }).join(",");
-            return `"imageIds":[${quoted}]`;
-        });
-        return JSON.parse(fixed);
-    } catch {
-        return null;
-    }
-};
-
-const safeParseDate = (val) => {
-    if (!val) return NaN;
-    if (val instanceof Date) return val.getTime();
-    if (typeof val === "number") return val;
-    if (typeof val === "string") {
-        // 兼容 "YYYY-MM-DD HH:mm:ss" -> Safari
-        const s = val.replace(/-/g, "/").replace("T", " ");
-        const d = new Date(s);
-        return isNaN(d.getTime()) ? NaN : d.getTime();
-    }
-    return NaN;
-};
-
-const batchValidateData = ref({});
-const allTrue = ref(false);
-const invalidIds = ref([]);
-const invalidArr = ref([]);
-// 验证农事卡片药肥报价信息是否完整
-const batchValidatePesticideFertilizerQuotes = (ids, items) => {
-    if (props.isStandard) {
-        return;
-    }
-    VE_API.monitor
-        .batchValidatePesticideFertilizerQuotes({ ids, schemeId: props.schemeId })
-        .then(({ data, code }) => {
-            if (code === 0) {
-                batchValidateData.value = data || {};
-                allTrue.value = Object.values(data).every((value) => value === true);
-                invalidIds.value = Object.keys(data).filter((key) => data[key] !== true);
-
-                // 清空之前的arrangeIds
-                invalidArr.value = [];
-                // 遍历items,判断farmWorkId是否在invalidIds中,如果对应上了就把item.id push进去
-                items.forEach((item) => {
-                    // 判断item.farmWorkId是否在invalidIds数组中(需要转换为字符串进行比较)
-                    const farmWorkIdStr = String(item.farmWorkId);
-                    if (invalidIds.value.includes(farmWorkIdStr)) {
-                        invalidArr.value.push({
-                            arrangeId: item.id,
-                            farmWorkId: item.farmWorkId,
-                        });
-                    }
-                });
-            }
-        })
-        .catch(() => { });
-};
-
-// 获取图片 URL 列表
-const fetchImageUrls = async (params) => {
-    try {
-        const res = await VE_API.ali.getTreeImageList(params);
-        if (res.code === 0 && Array.isArray(res.data)) {
-            return res.data.map((item) => {
-                if (item.filename) {
-                    return {
-                        ...item,
-                        cloudFilename: item.filename, // 兼容组件
-                    };
-                }
-                return null;
-            }).filter(item => item !== null);
-        }
-        return [];
-    } catch (error) {
-        console.error("获取图片列表失败:", error);
-        return [];
-    }
-};
-
-// 与 albumCarouselItem.getPhotoSrc 一致:拼 CDN 前缀;无水印预览用 Vant ImagePreview
-const resolveFarmWorkImagePath = (photo) => {
-    if (photo == null) return "";
-    if (typeof photo === "string") return photo;
-    return photo.cloudFilename || photo.filename || "";
-};
-
-const buildFarmWorkPreviewUrls = (fw) => {
-    const sd = fw?.sourceDataJson;
-    if (!sd) return [];
-    const toFullUrl = (path) => {
-        if (!path) return "";
-        if (/^https?:\/\//i.test(path)) return path;
-        return base_img_url2 + path;
-    };
-    if (fw.sourceType === 7) {
-        const arr = sd.executeImageUrls || [];
-        return arr.map((p) => toFullUrl(resolveFarmWorkImagePath(p))).filter(Boolean);
-    }
-    const arr = sd.resFilename || [];
-    return arr.map((p) => toFullUrl(resolveFarmWorkImagePath(p))).filter(Boolean);
-};
-
-const handleImageClick = (fw) => {
-    const images = buildFarmWorkPreviewUrls(fw);
-    if (!images.length) return;
-    showImagePreview({
-        images,
-        startPosition: 0,
-        closeable: true,
-        showIndex: true,
-    });
-};
-
-// 顶部物候标题:相邻两段 phenologyName 相同时只显示一次(保留第一段)
-const shouldShowPhenologyBarTitle = (idx) => {
-    const list = phenologyList.value;
-    if (!list?.length || idx < 0 || idx >= list.length) return false;
-    if (idx === 0) return true;
-    return list[idx]?.phenologyName !== list[idx - 1]?.phenologyName;
-};
-
-// 是否存在与物候期不同的生育期行(需要左右两列竖条);否则物候条占满单列宽度即可
-const phenologyNeedsTwoLabelColumns = (p) => {
-    const list = Array.isArray(p?.reproductiveList) ? p.reproductiveList : [];
-    if (!list.length) return false;
-    return list.some((r) => r.name !== p.phenologyName);
-};
-
-// 获取下一个reproductive-item的phenologyName
-const getNextPhenologyName = (currentPhenologyIdx, currentReproductiveIdx) => {
-    const currentPhenology = phenologyList.value[currentPhenologyIdx];
-    if (!currentPhenology || !Array.isArray(currentPhenology.reproductiveList)) {
-        return null;
-    }
-
-    // 如果当前reproductive-item不是最后一个,获取同一个物候期的下一个
-    if (currentReproductiveIdx < currentPhenology.reproductiveList.length - 1) {
-        const nextReproductive = currentPhenology.reproductiveList[currentReproductiveIdx + 1];
-        return nextReproductive?.phenologyName || null;
-    }
-
-    // 如果当前reproductive-item是最后一个,获取下一个物候期的第一个reproductive-item
-    if (currentPhenologyIdx < phenologyList.value.length - 1) {
-        const nextPhenology = phenologyList.value[currentPhenologyIdx + 1];
-        if (
-            nextPhenology &&
-            Array.isArray(nextPhenology.reproductiveList) &&
-            nextPhenology.reproductiveList.length > 0
-        ) {
-            const firstReproductive = nextPhenology.reproductiveList[0];
-            return firstReproductive?.phenologyName || null;
-        }
-    }
-
-    return null;
-};
-
-// 计算物候期需要的实际高度(基于农事数量)
-const getPhenologyRequiredHeight = (item) => {
-    // 统计该物候期内的农事数量
-    let farmWorkCount = 0;
-
-    if (Array.isArray(item.reproductiveList)) {
-        item.reproductiveList.forEach((reproductive) => {
-            if (Array.isArray(reproductive.farmWorkArrangeList)) {
-                farmWorkCount += reproductive.farmWorkArrangeList.length;
-            }
-        });
-    }
-
-    // 如果没有农事,给一个最小高度
-    if (farmWorkCount === 0) {
-        return 50; // 最小50px
-    }
-
-    // 每个农事卡片的高度(根据实际内容,卡片高度可能因内容而异)
-    // 卡片包含:padding(8px*2) + header(约25px) + content margin(4px+2px) + content(约25-30px) = 约72-77px
-    // 考虑到内容可能换行,实际高度可能更高,设置为120px更安全,避免卡片重叠
-    const farmWorkCardHeight = 120; // 卡片高度估算,确保能容纳内容且不重叠
-    // 卡片之间的间距(与CSS中的gap保持一致)
-    const cardGap = 12;
-
-    // 计算总高度:卡片数量 * 卡片高度 + (卡片数量 - 1) * 间距
-    // 如果有多个卡片,需要加上它们之间的间距
-    const totalHeight = farmWorkCount * farmWorkCardHeight + (farmWorkCount > 1 ? (farmWorkCount - 1) * cardGap : 0);
-
-    // 返回精确的总高度,只保留最小高度限制,不添加额外余量
-    return Math.max(totalHeight, 50); // 最小50px,精确匹配农事卡片高度
-};
-
-// 计算所有物候期的累积位置和总高度
-const calculatePhenologyPositions = () => {
-    let currentTop = 10; // 起始位置,留出顶部间距
-    const positions = new Map();
-
-    // 按progress排序物候期,确保按时间顺序排列
-    const sortedPhenologyList = [...phenologyList.value].sort((a, b) => {
-        const aProgress = Math.min(Number(a?.progress) || 0, Number(a?.progress2) || 0);
-        const bProgress = Math.min(Number(b?.progress) || 0, Number(b?.progress2) || 0);
-        return aProgress - bProgress;
-    });
-
-    sortedPhenologyList.forEach((phenology) => {
-        const height = getPhenologyRequiredHeight(phenology);
-        // 使用与数据生成时相同的ID生成逻辑
-        const itemId =
-            phenology.id ?? phenology.phenologyId ?? phenology.name ?? `${phenology.progress}-${phenology.progress2}`;
-        positions.set(itemId, {
-            top: currentTop,
-            height: height,
-        });
-        currentTop += height; // 紧挨着下一个物候期,不留间距
-    });
-
-    return {
-        positions,
-        totalHeight: currentTop, // 总高度 = 最后一个物候期的底部位置,不添加额外间距
-    };
-};
-
-// 计算所有农事的总高度(基于物候期紧挨排列)
-const calculateTotalHeightByFarmWorks = () => {
-    const { totalHeight } = calculatePhenologyPositions();
-
-    // 如果有物候期数据,直接使用计算出的总高度
-    // totalHeight 已经包含了从 10 开始的起始位置和所有物候期的高度
-    if (totalHeight > 10) {
-        // 确保总高度至少能容纳所有物候期起始时间(每个至少50px)
-        const baseHeight = (phenologyStartDates.value?.length || 0) * 50;
-        // 返回物候期总高度和基础高度的较大值,确保物候期起始时间能正常显示
-        return Math.max(totalHeight, baseHeight);
-    }
-
-    // 如果没有物候期数据,返回基础高度
-    const baseHeight = (phenologyStartDates.value?.length || 0) * 50;
-    return baseHeight || 100; // 至少返回100px,避免为0
-};
-
-const getTermStyle = (t, index) => {
-    // 优先使用实际测量的timeline-list高度,如果没有测量到则使用计算值作为后备
-    const totalHeight = timelineListHeight.value > 0 ? timelineListHeight.value : calculateTotalHeightByFarmWorks();
-    // 获取物候期起始时间总数(使用新数组)
-    const termCount = phenologyStartDates.value?.length || 1;
-
-    // 等分高度:总高度 / 物候期起始时间数量
-    const termHeight = totalHeight / termCount;
-
-    // 计算top位置:索引 * 每个物候期起始时间的高度
-    const top = index * termHeight;
-
-    return {
-        position: "absolute",
-        top: `${top}px`,
-        left: 0,
-        width: "35px",
-        height: `${termHeight}px`, // 高度等分,使用实际测量的高度
-        display: "flex",
-        alignItems: "center",
-    };
-};
-
-// 点击季节 → 滚动到对应节气(立春/立夏/立秋/立冬)
-const handleSeasonClick = (seasonValue) => {
-    const mapping = {
-        spring: "立春",
-        summer: "立夏",
-        autumn: "立秋",
-        winter: "立冬",
-    };
-    const targetName = mapping[seasonValue];
-    if (!targetName) return;
-
-    // 查找对应的节气
-    const targetIndex = solarTerms.value.findIndex((t) => (t?.displayName || "") === targetName);
-    if (targetIndex === -1) return;
-
-    // 计算目标节气的top位置
-    const totalHeight = timelineListHeight.value > 0 ? timelineListHeight.value : calculateTotalHeightByFarmWorks();
-    const termCount = solarTerms.value?.length || 1;
-    const termHeight = totalHeight / termCount;
-    const targetTop = targetIndex * termHeight;
-
-    // 滚动到目标位置
-    const wrap = timelineContainerRef.value;
-    if (!wrap) return;
-    const viewH = wrap.clientHeight || 0;
-    const maxScroll = Math.max(0, wrap.scrollHeight - viewH);
-    // 将目标位置稍微靠上(使用 0.1 视口高度做偏移)
-    let scrollTop = Math.max(0, targetTop - viewH * 0.1);
-    if (scrollTop > maxScroll) scrollTop = maxScroll;
-    wrap.scrollTo({ top: scrollTop, behavior: "smooth" });
-};
-
-
-const archiveTypeObj = {
-    1: "管理信息",
-    2: "物候进程",
-    3: "物候进程",
-    4: "异常发现",
-    5: "气象风险",
-    6: "农事进度",
-};
-
-/**
-    MANAGEMENT_INFO(1, "管理信息"),
-    EXPECTED_PHENOLOGY_PROGRESS(2, "预计物候进程"),
-    PHENOLOGY_PROGRESS(3, "物候进程"),
-    ABNORMAL_DISCOVERY(4, "异常发现"),
-    WEATHER_RISK(5, "气象风险"),
-    FARM_WORK_PROGRESS(6, "农事进度");
- * 农事状态样式映射
- * @param fw 农事
- * @returns 农事状态样式
- */
-// 农事状态样式映射
-const getArrangeStatusClass = (fw) => {
-    const t = props.pageType === 'agri_record' ? fw?.flowStatus : fw?.archiveType;
-    if (props.pageType === 'agri_record') {
-        if (t == null || t == 0 || t == -2) return "status-default";
-        const status = getAuditStatusPriority(fw.executeEvidenceAuditStatus);
-        // 农事记录:内容仍用 status-warning 的红字/红标签,外边框与箭头改为灰色
-        if (t == -1) return "status-warning status-warning-agri-record";
-        if (t == 3 || status === 2 || status === 0) return "status-warning-bg";
-        if (t == 5) return "status-normal";
-        return "status-act";
-    } else {
-        if (t == 1) return "status-green-info";
-        if (t == 4 && fw.sourceDataJson?.abnormalType === '病虫') return "status-warning";
-        if (t == 4 && fw.sourceDataJson?.abnormalType !== '病虫') return "status-complete";
-        if (t == 5) return "status-orange";
-        if (t == 6) return "status-green-farm";
-        return "status-normal";
-    }
-};
-
-const handleRowClick = (item) => {
-    // 跳转前记录当前滚动位置
-    saveTimelineScrollTop();
-    emits("row-click", item);
-};
-
-// 获取农事规划数据
-const getFarmWorkPlan = () => {
-    resetTimelineData();
-    if (!props.farmId) return;
-    const scopeKey = farmWorkPlanScopeKey();
-    if (isRequesting.value || lastRequestedFarmId.value === scopeKey) return;
-    isRequesting.value = true;
-    lastRequestedFarmId.value = scopeKey;
-    // 更新时间戳,确保key变化,触发DOM重新渲染
-    uniqueTimestamp.value = Date.now();
-    // 重置测量高度,等待重新测量
-    timelineListHeight.value = 0;
-    // 重置空数据状态
-    isEmpty.value = false;
-    let savedScrollTop = 0;
-    if (!isInitialLoad.value && timelineContainerRef.value) {
-        savedScrollTop = timelineContainerRef.value.scrollTop || 0;
-    }
-
-    const apiFunc = props.pageType === "agri_record" ? VE_API.monitor.getFarmWorkPlan : VE_API.monitor.getArchivesList;
-
-    const params = {
-        farmId: props.farmId,
-        regionId: props.regionId,
-        problemZoneId: props.problemZoneId,
-        year: props.year,
-    };
-    if (props.pageType === "agri_record") {
-        params.containerId = props.containerId;
-    }
-
-    apiFunc(params)
-        .then(async ({ data, code }) => {
-            if (code === 0) {
-                const list = Array.isArray(data?.solarTermsList) ? data.solarTermsList : [];
-                const filtered = list
-                    .filter((t) => t && t.type === 1)
-                    .map((t) => ({
-                        id:
-                            t.id ??
-                            t.solarTermsId ??
-                            t.termId ??
-                            `${t.name || t.solarTermsName || t.termName || "term"}-${t.createDate || ""}`,
-                        displayName: t.name || t.solarTermsName || t.termName || "节气",
-                        createDate: t.createDate || null,
-                        progress: Number(t.progress) || 0,
-                    }));
-                solarTerms.value = filtered;
-                // 物候期数据
-                const processedPhenologyList = Array.isArray(data?.phenologyList)
-                    ? await Promise.all(
-                        data.phenologyList.map(async (it) => {
-                            const reproductiveList = Array.isArray(it.reproductiveList)
-                                ? await Promise.all(
-                                    it.reproductiveList.map(async (r) => {
-                                        const farmWorkArrangeList = Array.isArray(r.archiveList || r.interactionFarmWorkList)
-                                            ? await Promise.all(
-                                                (r.archiveList || r.interactionFarmWorkList).map(async (fw) => {
-                                                    const sourceDataJson = parseSourceDataSafe(fw.data);
-                                                    // 如果有 imageIds,获取图片 URL
-                                                    if (
-                                                        sourceDataJson &&
-                                                        sourceDataJson.imageIds &&
-                                                        Array.isArray(sourceDataJson.imageIds) &&
-                                                        sourceDataJson.imageIds.length > 0
-                                                    ) {
-                                                        const resFilenameList = await fetchImageUrls(
-                                                            {
-                                                                imageIds: sourceDataJson.imageIds,
-                                                                page: 1,
-                                                                limit: 100,
-                                                            }
-                                                        );
-                                                        sourceDataJson.resFilename = resFilenameList;
-                                                    }
-                                                    return {
-                                                        ...fw,
-                                                        phenologyName: r.phenologyName,
-                                                        sourceDataJson,
-                                                        containerSpaceTimeId: it.containerSpaceTimeId,
-                                                    };
-                                                })
-                                            )
-                                            : [];
-                                        return {
-                                            ...r,
-                                            farmWorkArrangeList,
-                                        };
-                                    })
-                                )
-                                : [];
-                            return {
-                                id: it.id ?? it.phenologyId ?? it.name ?? `${it.progress}-${it.progress2}`,
-                                progress: Number(it.progress) || 0, // 起点 %
-                                progress2: Number(it.progress2) || 0, // 终点 %
-                                phenologyName: it.phenologyName,
-                                startDate: it.startDate,
-                                startTimeMs: safeParseDate(
-                                    it.startDate || it.beginDate || it.startTime || it.start || it.start_at
-                                ),
-                                reproductiveList,
-                            };
-                        })
-                    )
-                    : [];
-                phenologyList.value = processedPhenologyList;
-                // 使用多次 nextTick 和 requestAnimationFrame 确保DOM完全渲染
-                nextTick(() => {
-                    requestAnimationFrame(() => {
-                        nextTick(() => {
-                            requestAnimationFrame(() => {
-                                // 测量timeline-list的实际渲染高度
-                                if (timelineListRef.value) {
-                                    const height =
-                                        timelineListRef.value.offsetHeight || timelineListRef.value.clientHeight;
-                                    if (height > 0) {
-                                        timelineListHeight.value = height;
-                                    }
-                                }
-
-                                const hasRestoredScrollTop = restoreTimelineScrollTopWithRetry();
-                                if (isInitialLoad.value) {
-                                    if (hasRestoredScrollTop) {
-                                        isInitialLoad.value = false;
-                                    } else {
-                                        // 如果测量失败,延迟一下再尝试滚动
-                                        setTimeout(() => {
-                                            if (timelineListRef.value) {
-                                                const height =
-                                                    timelineListRef.value.offsetHeight ||
-                                                    timelineListRef.value.clientHeight;
-                                                if (height > 0) {
-                                                    timelineListHeight.value = height;
-                                                }
-                                            }
-                                            if (!restoreTimelineScrollTopWithRetry()) {
-                                                const currentSeason = getCurrentSeason();
-                                                handleSeasonClick(currentSeason);
-                                            }
-                                            isInitialLoad.value = false;
-                                        }, 200);
-                                    }
-                                } else {
-                                    if (!hasRestoredScrollTop && timelineContainerRef.value && savedScrollTop > 0) {
-                                        timelineContainerRef.value.scrollTop = savedScrollTop;
-                                    }
-                                }
-                            });
-                        });
-                    });
-                });
-
-                const farmWorks = phenologyList.value.flatMap((phenology) =>
-                    (Array.isArray(phenology?.reproductiveList) ? phenology.reproductiveList : []).flatMap((reproductive) =>
-                        Array.isArray(reproductive?.farmWorkArrangeList) ? reproductive.farmWorkArrangeList : []
-                    )
-                );
-                const quoteValidationFarmWorks = farmWorks.filter(
-                    (farmWork) => farmWork?.farmWorkId && farmWork?.isFollow !== 0
-                );
-                const farmWorkIds = quoteValidationFarmWorks.map((farmWork) => farmWork.farmWorkId);
-
-                // 调用验证方法,传入所有ids
-                if (farmWorkIds.length > 0) {
-                    batchValidatePesticideFertilizerQuotes(farmWorkIds, quoteValidationFarmWorks);
-                }
-
-                // 判断是否为空数据:没有节气或没有物候期数据
-                if (solarTerms.value.length === 0 || phenologyList.value.length === 0) {
-                    isEmpty.value = true;
-                } else {
-                    isEmpty.value = false;
-                }
-            } else {
-                // 接口返回错误码,显示暂无数据
-                setEmptyTimelineData();
-            }
-        })
-        .catch((error) => {
-            console.error("获取农事规划数据失败:", error);
-            ElMessage.error("获取农事规划数据失败");
-            // 接口报错,显示暂无数据
-            setEmptyTimelineData();
-        })
-        .finally(() => {
-            // 请求完成,重置请求标志
-            isRequesting.value = false;
-        });
-};
-
-const updateFarmWorkPlan = () => {
-    resetTimelineData();
-    isEmpty.value = false;
-    getFarmWorkPlan();
-};
-
-const showPhenologyName = computed(() => {
-    return !props.problemZoneId;
-});
-
-watch(
-    () => [props.farmId, props.regionId, props.year, props.problemZoneId, props.pageType, props.containerId],
-    (val, oldVal) => {
-        if (!props.farmId) return;
-        const changed =
-            !oldVal ||
-            val.some((item, index) => item !== oldVal[index]);
-        if (changed) {
-            lastRequestedFarmId.value = null;
-        }
-        isInitialLoad.value = true;
-        updateFarmWorkPlan();
-    },
-    { immediate: true }
-);
-
-const handleStatusDetail = (fw) => {
-    // 跳转前记录当前滚动位置
-    saveTimelineScrollTop();
-    emits('card-click');
-    console.log(fw);
-    if (props.pageType === 'agri_plan') {
-        if (fw?.archiveType === 2) {
-            // router.push(`/interaction_list?farmId=${farmIdData.value}&regionId=${popupData.value.regionId}&interactionTypeId=${popupData.value.interactionTypeId}`);
-        }else if(fw?.archiveType === 6){
-            router.push({
-                path: "/work_detail",
-                query: {
-                    miniJson: JSON.stringify({
-                        paramsPage: JSON.stringify({
-                            farmId: 98570,
-                            farmWorkLibId: '832268348690534411',
-                            recordId: "832268363366404096",
-                            reproductiveId: 149,
-                            typeId: props.typeId
-                        }),
-                    }),
-                },
-            });
-        }else{
-            router.push({
-                path: "/agricultural_detail",
-                query: {
-                    id: fw?.id,
-                    title: archiveTypeObj[fw?.archiveType],
-                    content: fw?.description,
-                },
-            });
-        }
-    } else {
-        router.push({
-            path: "/work_detail",
-            query: {
-                miniJson: JSON.stringify({
-                    paramsPage: JSON.stringify({
-                        farmId: props.farmId,
-                        farmWorkLibId: fw?.farmWorkLibId,
-                        recordId: fw?.farmWorkRecordId,
-                        reproductiveId: fw?.reproductiveId,
-                        typeId: props.typeId
-                    }),
-                }),
-            },
-        });
-    }
-};
-
-// 格式化日期为 MM-DD 格式
-const formatDate = (dateStr) => {
-    if (!dateStr) return "--";
-    const date = new Date(dateStr);
-    if (Number.isNaN(date.getTime())) return dateStr;
-    const m = `${date.getMonth() + 1}`.padStart(2, "0");
-    const d = `${date.getDate()}`.padStart(2, "0");
-    return `${m}-${d}`;
-};
-
-// 格式化日期为 YYYY-MM-DD 格式(用于接口调用)
-const formatDateForAPI = (dateStr) => {
-    if (!dateStr) return null;
-    const date = new Date(dateStr);
-    if (Number.isNaN(date.getTime())) return null;
-    const y = date.getFullYear();
-    const m = `${date.getMonth() + 1}`.padStart(2, "0");
-    const d = `${date.getDate()}`.padStart(2, "0");
-    return `${y}-${m}-${d}`;
-};
-
-// 获取下一个即将到来的节气(当前节气)的 progress
-const getNextTermProgress = () => {
-    if (!solarTerms.value || solarTerms.value.length === 0) return Infinity;
-
-    const now = new Date();
-    now.setHours(0, 0, 0, 0);
-
-    let nextTermProgress = Infinity;
-
-    // 找到当前日期之后的下一个节气(当前节气)
-    solarTerms.value.forEach((term) => {
-        const termDate = safeParseDate(term.createDate);
-        if (!isNaN(termDate)) {
-            const termDateObj = new Date(termDate);
-            termDateObj.setHours(0, 0, 0, 0);
-            // 找到大于等于当前日期的第一个节气
-            if (termDateObj >= now) {
-                const termProgress = Number(term.progress) || 0;
-                if (termProgress < nextTermProgress) {
-                    nextTermProgress = termProgress;
-                }
-            }
-        }
-    });
-
-    // 如果没有找到未来的节气,说明所有节气都已过,返回 Infinity(所有物候期都显示蓝色)
-    return nextTermProgress === Infinity ? Infinity : nextTermProgress;
-};
-
-// 根据物候期的 progress 判断它所属节气的 progress
-const getPhenologyTermProgress = (phenologyProgress) => {
-    if (!solarTerms.value || solarTerms.value.length === 0) return -1;
-
-    const progress = Number(phenologyProgress) || 0;
-
-    // 找到物候期所属的节气(progress 最接近且小于等于的节气)
-    let matchedTermProgress = -1;
-    solarTerms.value.forEach((term) => {
-        const termProgress = Number(term.progress) || 0;
-        if (progress >= termProgress && termProgress > matchedTermProgress) {
-            matchedTermProgress = termProgress;
-        }
-    });
-
-    // 如果物候期的 progress 小于所有节气,返回第一个节气的 progress
-    if (matchedTermProgress === -1 && solarTerms.value.length > 0) {
-        const firstTermProgress = Number(solarTerms.value[0].progress) || 0;
-        return firstTermProgress;
-    }
-
-    return matchedTermProgress;
-};
-
-const handleTagType = (tagType, executeEvidenceAuditStatus) => {
-    if (tagType == 0) return "待触发";
-    if (tagType == -1) return "已过期";
-    if (tagType == -2) return "已过期";
-    if (tagType == 3) {
-        const status = getAuditStatusPriority(executeEvidenceAuditStatus);
-        if (status === 2) {
-            return "审核失败";
-        }
-        return "待认证"
-    }
-    if (tagType == 5) {
-        const status = getAuditStatusPriority(executeEvidenceAuditStatus);
-        if (status === 2) {
-            return "审核失败";
-        }
-        if (status === 0) {
-            return "审核中";
-        }
-        return "已认证";
-    }
-    return "待触发"
-}
-
-// 审核状态优先级:2 > 0 > 1
-const getAuditStatusPriority = (auditStatusList) => {
-    if (!Array.isArray(auditStatusList) || !auditStatusList.length) return 1;
-    const normalized = auditStatusList.map((x) => Number(x)).filter((x) => [0, 1, 2].includes(x));
-    if (!normalized.length) return 1;
-    if (normalized.includes(0)) return 0;
-    if (normalized.includes(2)) return 2;
-    return 1;
-};
-
-// 右侧农事卡片展示用日期(与模板 left-date 一致:规划 createTime、记录 recommendDate)
-const getFarmWorkTimelineDateMs = (fw) => {
-    const primary = props.pageType === "agri_plan" ? fw?.createTime : fw?.recommendDate ?? fw?.createTime;
-    let ms = safeParseDate(primary);
-    if (Number.isNaN(ms) || ms <= 0) {
-        ms = safeParseDate(props.pageType === "agri_plan" ? fw?.recommendDate : fw?.createTime);
-    }
-    return ms;
-};
-
-const isFarmWorkDateOnOrBeforeToday = (ms) => {
-    if (Number.isNaN(ms) || ms <= 0) return false;
-    const today = new Date();
-    today.setHours(0, 0, 0, 0);
-    const d = new Date(ms);
-    d.setHours(0, 0, 0, 0);
-    return d.getTime() <= today.getTime();
-};
-
-// 单张卡片:有有效展示日期且晚于今天 → 未来农事,右侧应置灰(与 left-date 同一套字段)
-const isFarmWorkTimelineStrictlyFuture = (fw) => {
-    const ms = getFarmWorkTimelineDateMs(fw);
-    if (Number.isNaN(ms) || ms <= 0) return false;
-    return !isFarmWorkDateOnOrBeforeToday(ms);
-};
-
-// 右侧 arrange-card:未来日期置灰;解析不到日期时回退物候期节气/待认证规则(与旧版整段逻辑一致)
-// 无农事展示日期时的置灰回退:仅用节气/物候期 + 待认证(不含「任一行农事≤今天」),避免右侧卡片被外层标题连带误判
-const isPhenologyActiveWithoutFarmWorkDates = (phenology) =>
-    agriRecordHasPendingAuthInPhenology(phenology) || shouldShowBlueBase(phenology);
-
-const shouldGrayFarmWorkCard = (fw, phenology) => {
-    if (isFarmWorkTimelineStrictlyFuture(fw)) return true;
-    const ms = getFarmWorkTimelineDateMs(fw);
-    if (!Number.isNaN(ms) && ms > 0) {
-        return false;
-    }
-    return !isPhenologyActiveWithoutFarmWorkDates(phenology);
-};
-
-// 某一生育期行下是否存在「农事时间 ≤ 今天」的卡片(与右侧 left-date 字段一致)
-const reproductiveHasFarmWorkOnOrBeforeToday = (reproductive) => {
-    const fws = Array.isArray(reproductive?.farmWorkArrangeList) ? reproductive.farmWorkArrangeList : [];
-    for (const fw of fws) {
-        if (isFarmWorkDateOnOrBeforeToday(getFarmWorkTimelineDateMs(fw))) {
-            return true;
-        }
-    }
-    return false;
-};
-
-// 物候期内是否至少有一行生育期因「农事≤今天」而高亮(用于最外层物候期标题与内层对齐)
-const phenologyHasFarmWorkOnOrBeforeToday = (phenology) => {
-    const reproductives = Array.isArray(phenology?.reproductiveList) ? phenology.reproductiveList : [];
-    return reproductives.some((r) => reproductiveHasFarmWorkOnOrBeforeToday(r));
-};
-
-// 该生育期下:存在农事且「凡有有效展示日期的卡片」全部严格晚于今天 → 左侧本行不因节气规则变蓝(与右侧 future-card 一致)
-const reproductiveAllDatedFarmWorksStrictlyFuture = (reproductive) => {
-    const fws = Array.isArray(reproductive?.farmWorkArrangeList) ? reproductive.farmWorkArrangeList : [];
-    if (fws.length === 0) return false;
-    const dated = fws.filter((fw) => {
-        const ms = getFarmWorkTimelineDateMs(fw);
-        return !Number.isNaN(ms) && ms > 0;
-    });
-    if (dated.length === 0) return false;
-    return dated.every((fw) => isFarmWorkTimelineStrictlyFuture(fw));
-};
-
-// 物候期内:至少有一条农事带有效日期,且全部带有效日期的农事均为「严格未来」(无一 ≤ 今天)→ 最外层标题不因节气单独变蓝
-const phenologyAllDatedFarmWorksStrictlyFuture = (phenology) => {
-    const reproductives = Array.isArray(phenology?.reproductiveList) ? phenology.reproductiveList : [];
-    let anyDated = false;
-    for (const r of reproductives) {
-        const fws = Array.isArray(r?.farmWorkArrangeList) ? r.farmWorkArrangeList : [];
-        for (const fw of fws) {
-            const ms = getFarmWorkTimelineDateMs(fw);
-            if (Number.isNaN(ms) || ms <= 0) continue;
-            anyDated = true;
-            if (isFarmWorkDateOnOrBeforeToday(ms)) return false;
-        }
-    }
-    return anyDated;
-};
-
-// 仅农事记录页(agri_record):该物候期内存在待认证农事时,左侧最外层物候期与各生育期/物候期文案均高亮为蓝;农事规划(agri_plan)不生效
-const agriRecordHasPendingAuthInPhenology = (phenology) => {
-    if (props.pageType !== "agri_record") return false;
-    return (Array.isArray(phenology?.reproductiveList) ? phenology.reproductiveList : []).some((reproductive) =>
-        (Array.isArray(reproductive?.farmWorkArrangeList) ? reproductive.farmWorkArrangeList : []).some((fw) => {
-            const s = fw?.flowStatus;
-            return s === 3 || s === "3";
-        })
-    );
-};
-
-// 单行生育期下是否有待认证农事(仅农事记录页)
-const reproductiveHasPendingAuthFarmWork = (reproductive) => {
-    if (props.pageType !== "agri_record") return false;
-    return (Array.isArray(reproductive?.farmWorkArrangeList) ? reproductive.farmWorkArrangeList : []).some((fw) => {
-        const s = fw?.flowStatus;
-        return s === 3 || s === "3";
-    });
-};
-
-// 物候期底色/节气规则(不含「农事卡片日期」「待认证」扩展)
-const shouldShowBlueBase = (phenology) => {
-    // 优先使用物候期真实日期判断:未来日期不应显示蓝色
-    const phenologyTimeMs =
-        Number(phenology?.startTimeMs) ||
-        safeParseDate(phenology?.startDate || phenology?.beginDate || phenology?.startTime || phenology?.start || phenology?.start_at);
-    if (!Number.isNaN(phenologyTimeMs) && phenologyTimeMs > 0) {
-        const today = new Date();
-        today.setHours(0, 0, 0, 0);
-        return phenologyTimeMs <= today.getTime();
-    }
-
-    // 日期缺失时,回退到 progress 规则(兼容老数据)
-    // 获取下一个即将到来的节气(当前节气)的 progress
-    const nextTermProgress = getNextTermProgress();
-
-    // 如果所有节气都已过(nextTermProgress === Infinity),所有物候期都显示蓝色
-    if (nextTermProgress === Infinity) {
-        return true;
-    }
-
-    // 根据物候期的 progress 判断它属于哪个节气
-    const phenologyProgress = Math.min(Number(phenology?.progress) || 0, Number(phenology?.progress2) || 0);
-    const phenologyTermProgress = getPhenologyTermProgress(phenologyProgress);
-
-    // 找到下一个节气的完整信息,用于判断物候期是否属于当前节气
-    let nextTerm = null;
-    solarTerms.value.forEach((term) => {
-        const termProgress = Number(term.progress) || 0;
-        if (termProgress === nextTermProgress) {
-            nextTerm = term;
-        }
-    });
-
-    // 如果物候期所属的节气的 progress < 下一个节气的 progress,显示蓝色
-    // 如果物候期所属的节气的 progress === 下一个节气的 progress,也显示蓝色(当前节气)
-    // 也就是说,只有属于当前节气或之前节气的物候期才显示蓝色
-    if (phenologyTermProgress === -1) {
-        return false;
-    }
-
-    // 如果物候期正好属于下一个节气,需要判断它的 progress 是否在下一个节气的范围内
-    if (phenologyTermProgress === nextTermProgress && nextTerm) {
-        // 如果物候期的 progress 小于等于下一个节气的 progress,说明它属于当前节气,显示蓝色
-        return phenologyProgress <= nextTermProgress;
-    }
-
-    // 如果物候期所属的节气的 progress < 下一个节气的 progress,显示蓝色
-    return phenologyTermProgress < nextTermProgress;
-};
-
-// 最外层物候期标题:与内层生育期对齐——任一生育行因农事≤今天变蓝;农事记录下有待认证则整段标题也蓝;否则按节气规则(右侧卡片仍按单卡日期置灰)
-const shouldShowBlue = (phenology) => {
-    if (phenologyHasFarmWorkOnOrBeforeToday(phenology)) return true;
-    if (agriRecordHasPendingAuthInPhenology(phenology)) return true;
-    if (phenologyAllDatedFarmWorksStrictlyFuture(phenology)) return false;
-    return shouldShowBlueBase(phenology);
-};
-
-// 左侧生育期/物候期文案:
-// 1) 本行有农事<=今天:蓝;
-// 2) 本行全部有效日期农事均为未来且本行无待认证:灰(与右侧 future-card 一致);
-// 3) 农事记录下物候期内有待认证:蓝;
-// 4) 其余走节气/日期底色规则。
-const shouldShowBlueLeft = (phenology, reproductive) => {
-    if (reproductiveHasFarmWorkOnOrBeforeToday(reproductive)) return true;
-    if (reproductiveAllDatedFarmWorksStrictlyFuture(reproductive) && !reproductiveHasPendingAuthFarmWork(reproductive)) {
-        return false;
-    }
-    if (agriRecordHasPendingAuthInPhenology(phenology)) return true;
-    return shouldShowBlueBase(phenology);
-};
-
-defineExpose({
-    updateFarmWorkPlan,
-});
-
-// 使用 ResizeObserver 监听高度变化,确保在DOM完全渲染后获取准确高度
-const setupResizeObserver = () => {
-    if (!timelineListRef.value || typeof ResizeObserver === "undefined") {
-        return;
-    }
-
-    // 如果已经存在观察者,先断开
-    if (resizeObserver) {
-        resizeObserver.disconnect();
-    }
-
-    // 创建新的观察者
-    resizeObserver = new ResizeObserver((entries) => {
-        for (const entry of entries) {
-            const height = entry.contentRect.height;
-            if (height > 0 && height !== timelineListHeight.value) {
-                timelineListHeight.value = height;
-            }
-        }
-    });
-
-    // 开始观察
-    resizeObserver.observe(timelineListRef.value);
-};
-
-// 组件挂载后设置 ResizeObserver
-onMounted(() => {
-    nextTick(() => {
-        requestAnimationFrame(() => {
-            setupResizeObserver();
-            restoreTimelineScrollTopWithRetry();
-        });
-    });
-});
-
-// 组件卸载前清理 ResizeObserver
-onUnmounted(() => {
-    saveTimelineScrollTop();
-    if (resizeObserver) {
-        resizeObserver.disconnect();
-        resizeObserver = null;
-    }
-});
-
-onActivated(() => {
-    nextTick(() => {
-        requestAnimationFrame(() => {
-            restoreTimelineScrollTopWithRetry();
-        });
-    });
-});
-
-onDeactivated(() => {
-    saveTimelineScrollTop();
-});
-
-onBeforeRouteLeave(() => {
-    saveTimelineScrollTop();
-});
-
-// 在数据更新后重新设置 ResizeObserver
-watch(
-    () => phenologyList.value.length,
-    () => {
-        nextTick(() => {
-            requestAnimationFrame(() => {
-                setupResizeObserver();
-            });
-        });
-    }
-);
-</script>
-
-<style scoped lang="scss">
-@mixin arrange-card-status($color, $title-color: null, $title-bg: null, $text-color: null) {
-    border-color: $color;
-
-    .card-content {
-        @if $text-color !=null {
-            color: $text-color;
-        }
-    }
-
-    .card-left {
-        .left-info {
-            .left-date {
-                color: $color;
-                border-color: $color;
-            }
-            .status-tag {
-                background: $color;
-            }
-        }
-
-        .title-text {
-            @if $title-color !=null {
-                color: $title-color;
-            }
-
-            @if $title-bg !=null {
-                background: $title-bg;
-            }
-        }
-    }
-
-    &::before {
-        border-right-color: $color;
-    }
-}
-
-.timeline-container {
-    height: 100%;
-    overflow: auto;
-    position: relative;
-    box-sizing: border-box;
-
-    .timeline-list {
-        position: relative;
-    }
-
-    .timeline-middle-line {
-        position: absolute;
-        left: 13px;
-        /* 位于节气文字列中间(列宽约30px) */
-        top: 0;
-        bottom: 0;
-        width: 2px;
-        background: #e8e8e8;
-        z-index: 1;
-    }
-
-    .phenology-bar {
-        align-items: stretch;
-        justify-content: center;
-        box-sizing: border-box;
-        position: relative;
-
-        .phenology-title {
-            width: 18px;
-            top: 0;
-            bottom: 0;
-            left: 0;
-            height: auto;
-            color: #fff;
-            font-size: 12px;
-            position: absolute;
-            z-index: 10;
-            text-align: center;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            writing-mode: vertical-rl;
-            text-orientation: upright;
-            letter-spacing: 3px;
-            word-break: break-all;
-
-            &.phenology-blue {
-                background: #2199f8;
-            }
-
-            &.phenology-red {
-                background: #f1f1f1;
-                color: #808080;
-            }
-
-            &.phenology-title--wide {
-                width: 39px;
-            }
-        }
-
-        .reproductive-item {
-            font-size: 12px;
-            text-align: center;
-            word-break: break-all;
-            writing-mode: vertical-rl;
-            text-orientation: upright;
-            letter-spacing: 3px;
-            width: 100%;
-            line-height: 23px;
-            color: inherit;
-            position: relative;
-
-            .phenology-name {
-                width: 18px;
-                line-height: 16px;
-                height: 100%;
-                color: #fff;
-                padding: 4px 0;
-                font-size: 12px;
-                box-sizing: border-box;
-                writing-mode: vertical-rl;
-                text-orientation: upright;
-
-                &.mr {
-                    margin-right: 3px;
-                }
-
-                &.single {
-                    width: 39px;
-                    line-height: 39px;
-
-                    &.text-blue,
-                    &.text-red {
-                        line-height: 16px;
-                    }
-                }
-
-                &.phenology-blue {
-                    background: #2199f8;
-                }
-
-                &.phenology-red {
-                    background: #f1f1f1;
-                    color: #808080;
-                }
-
-                &.text-blue {
-                    background: rgba(33, 153, 248, 0.15);
-                    color: #2199f8;
-                    border: 1px solid #2199f8;
-                    line-height: 16px;
-                    box-sizing: border-box;
-                }
-
-                &.text-red {
-                    background: rgba(128, 128, 128, 0.15);
-                    color: #808080;
-                    border: 1px solid rgba(128, 128, 128, 0.35);
-                    line-height: 16px;
-                    box-sizing: border-box;
-                }
-            }
-
-            .arranges {
-                display: flex;
-                max-width: calc(100vw - 88px);
-                min-width: calc(100vw - 83px);
-                gap: 5px;
-                letter-spacing: 0px;
-
-                &.arranges-min {
-                    max-width: calc(100vw - 58px);
-                }
-
-                // min-height: 90px;
-                .arrange-card {
-                    width: 95%;
-                    border: 0.5px solid #2199f8;
-                    border-radius: 8px;
-                    background: #fff;
-                    box-sizing: border-box;
-                    position: relative;
-                    padding: 8px 15px 8px 10px;
-                    writing-mode: horizontal-tb;
-                    margin-bottom: 10px;
-
-                    // &.last-card {
-                    //     margin-bottom: 0;
-                    // }
-                    .card-content {
-                        color: #242424;
-                        display: flex;
-                        justify-content: space-between;
-                        align-items: center;
-                        font-size: 14px;
-
-                        .card-left {
-                            width: calc(100% - 45px);
-
-                            .left-info {
-                                display: flex;
-                                align-items: center;
-                                gap: 6px;
-
-                                .left-date {
-                                    color: #2199f8;
-                                    border: 1px solid #2199f8;
-                                    border-radius: 2px;
-                                    font-size: 12px;
-                                    width: 36px;
-                                    height: 20px;
-                                    line-height: 20px;
-                                }
-
-                                .status-tag {
-                                    font-size: 12px;
-                                    background: #47B881;
-                                    color: #fff;
-                                    width: 63px;
-                                    border-radius: 2px;
-                                }
-
-                                .text {
-                                    display: flex;
-                                    align-items: center;
-                                    gap: 2px;
-                                    width: calc(100% - 115px);
-                                }
-                            }
-
-                            .title-text {
-                                margin-top: 5px;
-                                width: fit-content;
-                                max-width: 100%;
-                                text-align: left;
-                                color: #2199F8;
-                                padding: 0 6px;
-                                border-radius: 2px;
-                                font-size: 12px;
-                                box-sizing: border-box;
-                                background: rgba(33, 153, 248, 0.1);
-                            }
-
-                            &.agri-record-card {
-                                .text{
-                                    width: 100%;
-                                }
-                                .title-wrap {
-                                    display: flex;
-                                    align-items: flex-end;
-                                    gap: 6px;
-
-                                    .expert-info {
-                                        display: flex;
-                                        align-items: center;
-                                        gap: 2px;
-                                        font-size: 12px;
-                                        color: #B7B7B7;
-                                    }
-
-                                    .blue-tag {
-                                        color: #2199F8;
-                                        background: rgba(33, 153, 248, 0.1);
-                                    }
-                                }
-                            }
-                        }
-
-                        .card-right {
-                            display: flex;
-                            align-items: center;
-                            position: relative;
-
-                            img {
-                                width: 45px;
-                                height: 45px;
-                                border-radius: 4px;
-                                object-fit: cover;
-                            }
-
-                            .num {
-                                position: absolute;
-                                width: 18px;
-                                height: 18px;
-                                box-sizing: border-box;
-                                top: -4px;
-                                right: -6px;
-                                background: #BFBFBF;
-                                color: #fff;
-                                font-size: 12px;
-                                border-radius: 50%;
-                                display: flex;
-                                align-items: center;
-                                justify-content: center;
-                            }
-                        }
-
-                        .status-right {
-                            position: absolute;
-                            right: 0;
-                            top: 0;
-                            font-size: 12px;
-                            color: #fff;
-                            background: #2199F8;
-                            border-radius: 2px;
-                            padding: 0 5px;
-                        }
-                    }
-
-                    &::before {
-                        content: "";
-                        position: absolute;
-                        left: -5px;
-                        top: 50%;
-                        transform: translateY(-50%);
-                        width: 0;
-                        height: 0;
-                        border-top: 5px solid transparent;
-                        border-bottom: 5px solid transparent;
-                        border-right: 5px solid #2199f8;
-                    }
-                }
-
-                .arrange-card.normal-style {
-                    opacity: 0.3;
-                }
-
-                // .arrange-card.status-normal {
-                //     border-color: #2199f8;
-
-                //     &::before {
-                //         border-right-color: #2199f8;
-                //     }
-                // }
-
-                .arrange-card.status-normal {
-                    @include arrange-card-status(#2199f8, #2199f8, rgba(33, 153, 248, 0.1));
-                }
-
-                .arrange-card.status-warning {
-                    @include arrange-card-status(#FF4E4E, #FF4E4E, rgba(255, 78, 78, 0.1));
-                }
-
-                .arrange-card.status-warning.status-warning-agri-record {
-                    border-color: #bbbbbb;
-
-                    .card-left {
-                        .left-info {
-                            .left-date {
-                                color: #bbbbbb;
-                                border-color: #bbbbbb;
-                            }
-                        }
-
-                        .text-name,
-                        .text-icon {
-                            color: #bbbbbb;
-                        }
-                    }
-
-                    &::before {
-                        border-right-color: #bbbbbb;
-                    }
-                }
-
-                .arrange-card.status-complete {
-                    @include arrange-card-status(#FF943D, #FF943D, rgba(255, 149, 61, 0.1));
-                }
-
-                .arrange-card.status-green-info {
-                    @include arrange-card-status(#47B881, #fff, rgba(71, 184, 129, 0.1));
-                }
-
-                .arrange-card.status-orange {
-                    @include arrange-card-status(#FFB129, #FFB129, rgba(253, 181, 55, 0.1));
-                }
-
-                .arrange-card.status-green-farm {
-                    @include arrange-card-status(#5BB349, #5BB349, rgba(91, 179, 73, 0.1));
-                }
-
-                .arrange-card.status-act {
-                    @include arrange-card-status(#FF953D, #fff, #FF953D);
-                }
-
-                .arrange-card.status-default {
-                    @include arrange-card-status(#BBBBBB, #fff, #BBBBBB);
-
-                    .card-left {
-                        .left-info {
-
-                            .text-name,
-                            .text-icon {
-                                color: #BBBBBB;
-                            }
-                        }
-                    }
-                }
-
-                // 未来节气对应的农事卡片:跟随左侧物候期的“未开始”灰色样式
-                .arrange-card.future-card {
-                    @include arrange-card-status(#e4e4e4, null, null, rgba(36, 36, 36, 0.5));
-
-                    .card-left {
-                        .left-info {
-                            .left-date {
-                                color: #CACACA;
-                            }
-                        }
-                    }
-                }
-
-                .arrange-card.status-warning-bg {
-                    @include arrange-card-status(#FF943D, #fff, #FF943D, #000);
-                }
-            }
-        }
-    }
-
-    .reproductive-item+.reproductive-item {
-        margin-top: 4px;
-        padding-top: 0;
-    }
-
-    .phenology-bar+.phenology-bar {
-        margin-top: 4px;
-        padding-top: 0;
-    }
-
-    .timeline-term {
-        position: absolute;
-        width: 34px;
-        display: flex;
-        align-items: flex-start;
-        flex-direction: column;
-        z-index: 2;
-        /* 置于中线之上 */
-        color: rgba(174, 174, 174, 0.6);
-
-        .term-name {
-            display: inline-block;
-            width: 100%;
-            min-height: 20px;
-            line-height: 26px;
-            background: #fff;
-            font-size: 12px;
-        }
-    }
-
-    .empty-state {
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        min-height: 200px;
-        width: 100%;
-    }
-}
-</style>

+ 0 - 1086
src/components/pageComponents/ArchivesFarmTimeLine.vue

@@ -1,1086 +0,0 @@
-<template>
-    <div class="timeline-container" ref="timelineContainerRef">
-        <div class="timeline-list">
-            <empty v-if="isEmpty" image="https://birdseye-img.sysuimars.com/birdseye-look-mini/custom-empty-image.png"
-                image-size="80" description="暂无数据" class="empty-state" />
-            <template v-else>
-                <div v-for="(p, idx) in phenologyList" :key="`phenology-${uniqueTimestamp}-${idx}`"
-                    class="phenology-bar"
-                    :class="{ 'phenology-bar--en-expand': locale === 'en' && shouldExpandEnPhenologyLabel(p, idx) }"
-                    :style="locale === 'en' && shouldShowPhenologyBarTitle(idx) && shouldExpandEnPhenologyLabel(p, idx)
-                        ? getEnPhenologyExpandedStyle(p.phenologyName) : undefined">
-                    <div class="phenology-title" :class="{
-                        'phenology-red': isPhenologyBarGrayByWorkStatus(p),
-                        'phenology-blue': !isPhenologyBarGrayByWorkStatus(p),
-                        'phenology-title--en': locale === 'en',
-                        'phenology-title--en-expand': locale === 'en' && shouldExpandEnPhenologyLabel(p, idx),
-                    }" :style="locale === 'en' && shouldExpandEnPhenologyLabel(p, idx)
-                        ? getEnPhenologyExpandedStyle(p.phenologyName) : undefined"
-                        v-if="shouldShowPhenologyBarTitle(idx)">
-                        <span class="phenology-title__text" :class="{ 'phenology-title__text--en': locale === 'en' }">
-                            {{ p.phenologyName }}
-                        </span>
-                    </div>
-                    <div v-for="(r, rIdx) in Array.isArray(p.reproductiveList) ? p.reproductiveList : []"
-                        :key="`reproductive-${uniqueTimestamp}-${idx}-${rIdx}`" class="reproductive-item"
-                        :style="locale === 'en' && !shouldShowPhenologyBarTitle(idx) && shouldExpandEnPhenologyLabel(p, idx, rIdx)
-                            ? getEnPhenologyExpandedStyle(p.phenologyName) : undefined">
-                        <div class="arranges">
-                            <div v-for="(fw, aIdx) in Array.isArray(r.farmWorkArrangeList) ? r.farmWorkArrangeList : []"
-                                :key="`arrange-${uniqueTimestamp}-${idx}-${rIdx}-${aIdx}`" class="arrange-card" :class="[
-                                    getArrangeStatusClass(fw),
-                                    {
-                                        'last-card':
-                                            aIdx === r.farmWorkArrangeList.length - 1 &&
-                                            rIdx !== r.farmWorkArrangeList.length - 1,
-                                    },
-                                ]" :data-work-status="fw.work_status" @click="handleRowClick(fw)">
-                                <div class="card-content">
-                                    <div class="card-left" @click.stop="handleStatusDetail(fw)" style="width: 100%">
-                                        <div class="left-info">
-                                            <!-- <div class="left-date">{{ formatDate(fw.createTime) }}</div> -->
-                                            <div class="text">
-                                                <span class="van-ellipsis">{{ fw.title }}</span>
-                                                <div class="text-status" v-if="farmWorkTypeObj[fw.farm_work_type]" :style="farmWorkTypeObjColor[fw.farm_work_type]">{{ farmWorkTypeObj[fw.farm_work_type] }}</div>
-                                                <el-icon color="#333333">
-                                                    <ArrowRight />
-                                                </el-icon>
-                                            </div>
-                                        </div>
-                                        <div class="farm-info" v-if="fw.work_status === 0 || fw.work_status === 1">
-                                            <div class="info-left">
-                                                <div>{{ fw.work_reason }}</div>
-                                            </div>
-                                            <div class="info-right">{{ fw.interaction_issue }}</div>
-                                        </div>
-                                        <div class="text-display" v-if="fw.zone.length">
-                                            <div class="title-text" v-for="(zone,index) in fw.zone" :key="index">
-                                                <span>{{ zone }}</span>
-                                                <div class="check-icon" v-if="fw.work_status === 6">
-                                                    <el-icon size="8" color="#fff"><Select /></el-icon>
-                                                </div>
-                                            </div>
-                                        </div>
-                                    </div>
-                                    <div class="status-right" :style="getStatusColorObj(fw)"
-                                        v-if="fw.work_status !== 3 && fw.work_status !== 5">
-                                        <img v-if="fw.work_status === 4" src="@/assets/img/common/rz-icon.png" alt="">
-                                        <span>{{ workStatusObj[fw.work_status] }}</span>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                        <!-- <template v-if="!shouldShowPhenologyBarTitle(idx)">
-                            <div class="phenology-name" :class="{
-                                'phenology-red': isPhenologyRowGrayByWorkStatus(r),
-                                'text-blue': !isPhenologyRowGrayByWorkStatus(r),
-                                'phenology-name--en': locale === 'en',
-                                'phenology-name--en-expand': locale === 'en' && shouldExpandEnPhenologyLabel(p, idx, rIdx),
-                            }" :style="locale === 'en' && shouldExpandEnPhenologyLabel(p, idx, rIdx)
-                                ? getEnPhenologyExpandedStyle(p.phenologyName) : undefined">
-                                <span class="phenology-name__text" :class="{ 'phenology-name__text--en': locale === 'en' }">
-                                    {{ p.phenologyName }}
-                                </span>
-                            </div>
-                        </template> -->
-                        <template v-if="!shouldShowPhenologyBarTitle(idx)">
-                            <div class="phenology-name" :class="{
-                                'phenology-red': isPhenologyRowGrayByWorkStatus(r),
-                                'text-blue': !isPhenologyRowGrayByWorkStatus(r),
-                                'phenology-name--en': locale === 'en',
-                                'phenology-name--en-expand': locale === 'en' && shouldExpandEnPhenologyLabel(p, idx, rIdx),
-                            }" :style="locale === 'en' && shouldExpandEnPhenologyLabel(p, idx, rIdx)
-                                ? getEnPhenologyExpandedStyle(p.phenologyName) : undefined">
-                                <span class="phenology-name__text" :class="{ 'phenology-name__text--en': locale === 'en' }">
-                                    {{ p.phenologyName }}
-                                </span>
-                            </div>
-                        </template>
-                    </div>
-                </div>
-            </template>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { ref, computed, nextTick, watch, onMounted, onUnmounted, onActivated, onDeactivated } from "vue";
-import { useRouter, useRoute, onBeforeRouteLeave } from "vue-router";
-import { ElMessage } from "element-plus";
-import { Empty } from "vant";
-import { useI18n } from "@/i18n";
-
-const { locale, t } = useI18n();
-
-const PHENOLOGY_LABEL_FONT = "500 12px PingFang SC, -apple-system, BlinkMacSystemFont, sans-serif";
-const PHENOLOGY_LABEL_PADDING = 16;
-let measureCanvas = null;
-
-const measurePhenologyTextWidth = (text) => {
-    if (!text) return 0;
-    if (typeof document === "undefined") return String(text).length * 7;
-    if (!measureCanvas) measureCanvas = document.createElement("canvas");
-    const ctx = measureCanvas.getContext("2d");
-    ctx.font = PHENOLOGY_LABEL_FONT;
-    return ctx.measureText(String(text)).width;
-};
-
-const getEnLabelRequiredHeight = (text) =>
-    measurePhenologyTextWidth(text) + PHENOLOGY_LABEL_PADDING;
-
-const getEnPhenologyExpandedStyle = (text) => {
-    if (locale.value !== "en" || !text) return undefined;
-    return { minHeight: `${Math.ceil(getEnLabelRequiredHeight(text))}px` };
-};
-
-const CARD_ESTIMATED_HEIGHT = 68;
-
-const estimateReproductiveRowHeight = (r) => {
-    const cards = Array.isArray(r?.farmWorkArrangeList) ? r.farmWorkArrangeList : [];
-    return cards.length * CARD_ESTIMATED_HEIGHT + 4;
-};
-
-const estimatePhenologyBarHeight = (p) => {
-    const reps = Array.isArray(p?.reproductiveList) ? p.reproductiveList : [];
-    return reps.reduce((sum, r) => sum + estimateReproductiveRowHeight(r), 0);
-};
-
-const shouldExpandEnPhenologyLabel = (p, idx, rIdx = null) => {
-    if (locale.value !== "en" || !p?.phenologyName) return false;
-    const requiredHeight = getEnLabelRequiredHeight(p.phenologyName);
-    const availableHeight = shouldShowPhenologyBarTitle(idx)
-        ? estimatePhenologyBarHeight(p)
-        : estimateReproductiveRowHeight(p.reproductiveList?.[rIdx]);
-    return requiredHeight > availableHeight;
-};
-
-const router = useRouter();
-const route = useRoute();
-
-const props = defineProps({
-    // 农场 ID,用于请求农事规划数据
-    farmId: {
-        type: [String, Number],
-        default: null,
-    },
-    activeFarmWorkTab: {
-        type: [String, Number],
-        default: '0',
-    },
-});
-
-const emits = defineEmits(["row-click", "card-click"]);
-
-const phenologyList = ref([]);
-const timelineContainerRef = ref(null);
-const getTimelineScrollKey = () =>
-    `timelineScrollTop:${props.farmId ?? "none"}:${route.path}`;
-
-const saveTimelineScrollTop = () => {
-    if (!timelineContainerRef.value) return;
-    const scrollTop = timelineContainerRef.value.scrollTop || 0;
-    sessionStorage.setItem(getTimelineScrollKey(), scrollTop.toString());
-};
-
-const restoreTimelineScrollTop = () => {
-    if (!timelineContainerRef.value) return false;
-    const savedScrollTop = sessionStorage.getItem(getTimelineScrollKey());
-    if (savedScrollTop == null) return false;
-    const scrollTop = Number(savedScrollTop);
-    if (Number.isNaN(scrollTop)) return false;
-    const maxScrollTop = Math.max(
-        0,
-        (timelineContainerRef.value.scrollHeight || 0) - (timelineContainerRef.value.clientHeight || 0)
-    );
-    timelineContainerRef.value.scrollTop = Math.min(scrollTop, maxScrollTop);
-    return true;
-};
-const restoreTimelineScrollTopWithRetry = (retryCount = 4) => {
-    const restored = restoreTimelineScrollTop();
-    if (restored || retryCount <= 0) return restored;
-    setTimeout(() => {
-        restoreTimelineScrollTopWithRetry(retryCount - 1);
-    }, 60);
-    return false;
-};
-
-/** 时间轴内部滚动:仅当明显离开过顶部时才视为有效缓存,避免首屏请求尚未返回时 deactivate 写入 0 误挡首次定位 */
-const hasSavedTimelineScrollBeyondTop = () => {
-    const raw = sessionStorage.getItem(getTimelineScrollKey());
-    if (raw == null) return false;
-    const n = Number(raw);
-    return !Number.isNaN(n) && n > 4;
-};
-
-/** 农事记录页父级 `.archives-time-line` 的滚动缓存 key,与 agri_record/index.vue 一致;存在有效值时避免 scrollIntoView 抢滚动 */
-const getAgriRecordParentScrollKey = () =>
-    `agriRecordArchivesOuterScroll:${props.farmId ?? "none"}:${route.path}`;
-
-/** 外层滚动:仅当明显离开过顶部时才视为有效缓存,避免 scrollTop=0 误挡首次定位 */
-const hasSavedParentArchivesScrollBeyondTop = () => {
-    const raw = sessionStorage.getItem(getAgriRecordParentScrollKey());
-    if (raw == null) return false;
-    const n = Number(raw);
-    return !Number.isNaN(n) && n > 4;
-};
-
-const clearSavedParentArchivesScroll = () => {
-    sessionStorage.removeItem(getAgriRecordParentScrollKey());
-};
-
-/** 查找可滚动的祖先容器(优先匹配农事记录页外层 `.archives-time-line-content`) */
-const findScrollParentForCard = (card) => {
-    if (!card) return null;
-    const archivesArea = card.closest(".archives-time-line-content");
-    if (archivesArea) return archivesArea;
-    let node = card.parentElement;
-    while (node && node !== document.body) {
-        const style = window.getComputedStyle(node);
-        const canScrollY =
-            (style.overflowY === "auto" || style.overflowY === "scroll") &&
-            node.scrollHeight > node.clientHeight + 1;
-        const canScrollX =
-            (style.overflowX === "auto" || style.overflowX === "scroll") &&
-            node.scrollWidth > node.clientWidth + 1;
-        if (canScrollY || canScrollX) return node;
-        node = node.parentElement;
-    }
-    return null;
-};
-
-/**
- * 在「农事记录」等页面中,真正滚动的是外层 `.archives-time-line-content`,本组件 `.timeline-container` 往往随内容撑开、不产生内部滚动条。
- * 手动计算 scrollTop / scrollLeft,将目标卡片对齐到滚动区域顶部。
- */
-const scrollCardIntoNearestScrollportTop = (card) => {
-    const scrollParent = findScrollParentForCard(card);
-    if (!scrollParent) {
-        card.scrollIntoView({ block: "start", behavior: "auto", inline: "start" });
-        return;
-    }
-    const cardRect = card.getBoundingClientRect();
-    const parentRect = scrollParent.getBoundingClientRect();
-    scrollParent.scrollTop += cardRect.top - parentRect.top;
-    scrollParent.scrollLeft += cardRect.left - parentRect.left;
-};
-
-/** 默认滚动到首个「待执行」(work_status=2),并在可视滚动区域内对齐顶部;若无则回退到首个右侧有状态标签的卡片(3、5 不展示标签) */
-const scrollToFirstVisibleStatusCard = () => {
-    const root = timelineContainerRef.value;
-    if (!root || isEmpty.value) return;
-    if (hasSavedTimelineScrollBeyondTop()) return;
-    if (hasSavedParentArchivesScrollBeyondTop()) return;
-    const cards = root.querySelectorAll(".arrange-card[data-work-status]");
-
-    let target = null;
-    for (const card of cards) {
-        const raw = card.getAttribute("data-work-status");
-        if (raw == null || raw === "") continue;
-        const n = Number(raw);
-        if (Number.isNaN(n) || n !== 2) continue;
-        target = card;
-        break;
-    }
-    if (!target) {
-        for (const card of cards) {
-            const raw = card.getAttribute("data-work-status");
-            if (raw == null || raw === "") continue;
-            const n = Number(raw);
-            if (Number.isNaN(n) || n === 3 || n === 5) continue;
-            target = card;
-            break;
-        }
-    }
-    if (!target) return;
-    scrollCardIntoNearestScrollportTop(target);
-};
-
-const scrollToFirstVisibleStatusCardAfterPaint = () => {
-    const tryScroll = () => scrollToFirstVisibleStatusCard();
-    nextTick(() => {
-        requestAnimationFrame(() => {
-            tryScroll();
-            requestAnimationFrame(tryScroll);
-            // 与父页 restoreArchivesOuterScrollTopWithRetry 异步布局错开,多次尝试确保滚到位
-            [120, 300, 500, 800].forEach((ms) => {
-                window.setTimeout(tryScroll, ms);
-            });
-        });
-    });
-};
-// 生成唯一的时间戳,用于确保 key 的唯一性
-const uniqueTimestamp = ref(Date.now());
-// 标记是否为空数据
-const isEmpty = ref(false);
-// 标记是否正在请求数据,防止重复请求
-const isRequesting = ref(false);
-// 记录上一次请求作用域(含语言),避免相同参数重复请求
-const lastRequestedScopeKey = ref(null);
-const lastFetchedLocale = ref(null);
-
-const farmWorkPlanScopeKey = () =>
-    JSON.stringify([props.farmId ?? null, props.activeFarmWorkTab ?? "0", locale.value ?? "zh"]);
-
-const resetTimelineData = () => {
-    phenologyList.value = [];
-};
-
-const setEmptyTimelineData = () => {
-    resetTimelineData();
-    isEmpty.value = true;
-};
-
-const safeParseDate = (val) => {
-    if (!val) return NaN;
-    if (val instanceof Date) return val.getTime();
-    if (typeof val === "number") return val;
-    if (typeof val === "string") {
-        // 兼容 "YYYY-MM-DD HH:mm:ss" -> Safari
-        const s = val.replace(/-/g, "/").replace("T", " ");
-        const d = new Date(s);
-        return isNaN(d.getTime()) ? NaN : d.getTime();
-    }
-    return NaN;
-};
-
-// 顶部物候标题:相邻两段 phenologyName 相同时只显示一次(保留第一段)
-const shouldShowPhenologyBarTitle = (idx) => {
-    const list = phenologyList.value;
-    if (!list?.length || idx < 0 || idx >= list.length) return false;
-    if (idx === 0) return true;
-    return list[idx]?.phenologyName !== list[idx - 1]?.phenologyName;
-};
-
-const workStatusObj = computed(() =>
-    Object.fromEntries([0, 1, 2, 3, 4, 5, 6].map((s) => [s, t(`agriRecord.workStatus.${s}`)]))
-);
-
-// 农事类型颜色
-const farmWorkTypeObjColor = {
-    3: {
-        color: "#FF943D",
-        background: "rgba(255, 148, 61, 0.1)",
-        borderColor: "rgba(255, 132, 0, 0.1)",
-    },
-    4: {
-        color: "#FF943D",
-        background: "rgba(255, 148, 61, 0.1)",
-        borderColor: "rgba(255, 132, 0, 0.1)",
-    },
-    5: {
-        color: "#FF6A6A",
-        background: "rgba(255, 106, 106, 0.1)",
-        borderColor: "rgba(255, 106, 106, 0.1)",
-    },
-}
-
-// 农事卡片状态样式(work_status)
-const getStatusColorObj = (fw) => {
-    let color = "#fff";
-    let background = "#2199F8";
-    const status = fw?.work_status; // 农事状态
-    const type = fw?.farm_work_type; // 农事类型
-    if (status == 2){
-        if(type === 3 || type === 4){
-            color = "#fff";
-            background = "#FF943D";
-        }else if(type == 5){
-            color = "#fff";
-            background = "#FF6A6A";
-        }else{
-            color = "#fff";
-            background = "#2199F8";
-        }
-    }
-    if (status == 4){
-        color = "#2FC510";
-        background = "#fff";
-    }
-    if (status == 6){
-        if(type === 3 || type === 4){
-            color = "#FF953D";
-            background = "#fff";
-        }else if(type == 5){
-            color = "#FF6A6A";
-            background = "#fff";
-        }else{
-            color = "#8B8B8B";
-            background = "#fff";
-        }
-    }
-
-    return {color, background};
-}
-
-// 农事卡片状态样式(work_status)
-const getArrangeStatusClass = (fw) => {
-    const status = fw?.work_status; // 农事状态
-    const type = fw?.farm_work_type; // 农事类型
-    if(status === 6){
-        if(type === 3 || type === 4){
-            return "status-orange-bg";
-        }else if(type === 5){
-            return "status-danger-bg";
-        }else{
-            return "status-normal-farm";
-        }
-    }else if(status === 2){
-        if(type === 3 || type === 4){
-            return "status-orange";
-        }else if(type === 5){
-            return "status-danger";
-        }else{
-            return "status-normal";
-        }
-    }
-    if (status === 0 || status === 1 || status === 4) return "status-normal";
-    return "future-card";
-};
-
-const handleRowClick = (item) => {
-    // 跳转前记录当前滚动位置
-    saveTimelineScrollTop();
-    emits("row-click", item);
-};
-
-/**
- * 新接口 farm_works:`data` 为物候阶段数组,每项含 `phenology_name`、`works`(农事明细)。
- * 转为本组件使用的 phenologyName + reproductiveList[].farmWorkArrangeList 结构。
- */
-const pickPhenologyStageName = (stage) => {
-    const candidates = [stage.phenology_name, stage.phenelogy_name, stage.phenologyName];
-    for (const c of candidates) {
-        if (c != null && String(c).trim() !== "") return String(c).trim();
-    }
-    return "";
-};
-
-const workTimeToCreateTimeIso = (workTime) => {
-    if (workTime == null || workTime === "") return null;
-    const s = String(workTime).trim();
-    if (!s) return null;
-    const y = new Date().getFullYear();
-    const parts = s.split(/[-/]/).map((p) => p.trim());
-    if (parts.length >= 3 && parts[0].length === 4) {
-        const yy = parts[0];
-        const mo = parts[1].padStart(2, "0");
-        const da = parts[2].padStart(2, "0");
-        return `${yy}-${mo}-${da}`;
-    }
-    if (parts.length >= 2) {
-        const mo = parts[0].padStart(2, "0");
-        const da = parts[1].padStart(2, "0");
-        return `${y}-${mo}-${da}`;
-    }
-    return null;
-};
-
-const mapWorkStatusToArchiveType = (workStatus) => {
-    const n = Number(workStatus);
-    // 新接口 work_status 与档案 archiveType 含义不一定一致;仅对「待执行」沿用原 UI
-    if (n === 2) return 2;
-    return 6;
-};
-
-const normalizeFarmWorksPhenologyList = (data) => {
-    const list = Array.isArray(data) ? data : [];
-    return list.map((stage, idx) => {
-        const name = pickPhenologyStageName(stage);
-        const works = Array.isArray(stage.works) ? stage.works : [];
-        const farmWorkArrangeList = works.map((w) => {
-            const title = String(w.work_name ?? "").trim();
-            const iso = workTimeToCreateTimeIso(w.work_time);
-            return {
-                ...w,
-                createTime: iso,
-                title: title || "农事",
-                archiveType: mapWorkStatusToArchiveType(w.work_status),
-            };
-        });
-        const timesMs = farmWorkArrangeList
-            .map((fw) => safeParseDate(fw.createTime))
-            .filter((ms) => !Number.isNaN(ms) && ms > 0);
-        const minMs = timesMs.length ? Math.min(...timesMs) : NaN;
-        const startDate =
-            !Number.isNaN(minMs) && minMs > 0
-                ? (() => {
-                    const d = new Date(minMs);
-                    const m = `${d.getMonth() + 1}`.padStart(2, "0");
-                    const day = `${d.getDate()}`.padStart(2, "0");
-                    return `${d.getFullYear()}-${m}-${day}`;
-                })()
-                : null;
-        return {
-            id: stage.id ?? works[0]?.phenology_code ?? `phenology-${idx}`,
-            phenologyName: name || `物候期${idx + 1}`,
-            startDate,
-            startTimeMs: !Number.isNaN(minMs) && minMs > 0 ? minMs : undefined,
-            reproductiveList: [
-                {
-                    phenologyName: name || `物候期${idx + 1}`,
-                    farmWorkArrangeList,
-                },
-            ],
-        };
-    });
-};
-
-/** 侧栏物候条颜色:该组内所有农事 work_status 均为 3 时为灰,否则为蓝 */
-const isPhenologyRowGrayByWorkStatus = (reproductive) => {
-    const fws = Array.isArray(reproductive?.farmWorkArrangeList) ? reproductive.farmWorkArrangeList : [];
-    if (fws.length === 0) return false;
-    return fws.every((fw) => Number(fw?.work_status) === 3);
-};
-
-/** 顶部物候标题条:同一物候下全部农事 work_status 均为 3 时为灰,否则为蓝 */
-const isPhenologyBarGrayByWorkStatus = (phenology) => {
-    const reps = Array.isArray(phenology?.reproductiveList) ? phenology.reproductiveList : [];
-    const all = reps.flatMap((r) => (Array.isArray(r?.farmWorkArrangeList) ? r.farmWorkArrangeList : []));
-    if (all.length === 0) return false;
-    return all.every((fw) => Number(fw?.work_status) === 3);
-};
-
-const farmWorkTypeObj = {
-    1: "标准农事",
-    2: "机动农事",
-    3: "气象预警农事",
-    4: "气象恢复农事",
-    5: "异常农事",
-    6: "标准施肥类",
-    7: "标准防治类",
-    8: "标准调节类",
-}
-
-// 获取农事规划数据
-const getFarmWorkPlan = () => {
-    resetTimelineData();
-    if (!props.farmId) return;
-    const scopeKey = farmWorkPlanScopeKey();
-    if (isRequesting.value || lastRequestedScopeKey.value === scopeKey) return;
-    isRequesting.value = true;
-    lastRequestedScopeKey.value = scopeKey;
-    uniqueTimestamp.value = Date.now();
-    isEmpty.value = false;
-
-    const params = {
-        farm_id: props.farmId,
-        is_suyuan: props.activeFarmWorkTab,
-        crop_variety: Number(props.farmId) === 329
-            ? 4
-            : JSON.parse(localStorage.getItem("selectedFarmData")).farm_variety,
-    };
-    VE_API.monitor.getPhenologyList(params)
-        .then(({ data, code }) => {
-            const ok = code === 200 || code === 0;
-            if (ok) {
-                lastFetchedLocale.value = locale.value;
-                phenologyList.value = normalizeFarmWorksPhenologyList(data);
-                isEmpty.value = phenologyList.value.length === 0;
-                if (!isEmpty.value) {
-                    scrollToFirstVisibleStatusCardAfterPaint();
-                }
-            } else {
-                setEmptyTimelineData();
-            }
-        })
-        .catch((error) => {
-            console.error("获取农事规划数据失败:", error);
-            ElMessage.error("获取农事规划数据失败");
-            setEmptyTimelineData();
-        })
-        .finally(() => {
-            isRequesting.value = false;
-        });
-};
-
-const updateFarmWorkPlan = () => {
-    resetTimelineData();
-    isEmpty.value = false;
-    getFarmWorkPlan();
-};
-
-watch(
-    () => [props.farmId, props.activeFarmWorkTab],
-    ([farmId, tab], oldVal) => {
-        if (!farmId) return;
-        const [oldFarmId, oldTab] = oldVal ?? [];
-        const scopeChanged =
-            oldFarmId == null || farmId !== oldFarmId || tab !== oldTab;
-        if (scopeChanged) {
-            lastRequestedScopeKey.value = null;
-            clearSavedParentArchivesScroll();
-        }
-        updateFarmWorkPlan();
-    },
-    { immediate: true }
-);
-
-watch(locale, () => {
-    if (!props.farmId) return;
-    lastRequestedScopeKey.value = null;
-    updateFarmWorkPlan();
-});
-
-const handleStatusDetail = (fw) => {
-    saveTimelineScrollTop();
-    emits('card-click');
-    router.push({
-        path: "/work_detail",
-        query: {
-            id: fw?.id,
-        },
-    });
-};
-
-// 格式化日期为 MM-DD 格式
-const formatDate = (dateStr) => {
-    if (!dateStr) return "--";
-    const date = new Date(dateStr);
-    if (Number.isNaN(date.getTime())) return dateStr;
-    const m = `${date.getMonth() + 1}`.padStart(2, "0");
-    const d = `${date.getDate()}`.padStart(2, "0");
-    return `${m}-${d}`;
-};
-
-defineExpose({
-    updateFarmWorkPlan,
-});
-
-onMounted(() => {
-    nextTick(() => {
-        requestAnimationFrame(() => {
-            restoreTimelineScrollTopWithRetry();
-        });
-    });
-});
-
-onUnmounted(() => {
-    saveTimelineScrollTop();
-});
-
-onActivated(() => {
-    if (props.farmId && lastFetchedLocale.value != null && lastFetchedLocale.value !== locale.value) {
-        lastRequestedScopeKey.value = null;
-        updateFarmWorkPlan();
-    }
-    nextTick(() => {
-        requestAnimationFrame(() => {
-            restoreTimelineScrollTopWithRetry();
-        });
-    });
-});
-
-onDeactivated(() => {
-    saveTimelineScrollTop();
-});
-
-onBeforeRouteLeave(() => {
-    saveTimelineScrollTop();
-});
-</script>
-
-<style scoped lang="scss">
-@mixin arrange-card-status($color, $content-color: null, $border-color: null, $content-bg: null) {
-    border-color: $color;
-
-    @if $content-bg !=null {
-        background: $content-bg;
-    }
-
-    // .card-left {
-    //     .title-text {
-    //         @if $color !=null {
-    //             color: $color;
-    //         }
-
-    //         @if $content-color !=null {
-    //             background: $content-color;
-    //         }
-
-    //         @if $border-color !=null {
-    //             border-color: $border-color;
-    //         }
-    //     }
-    // }
-
-    &::before {
-        border-right-color: $color;
-    }
-}
-
-.timeline-container {
-    height: 100%;
-    overflow: auto;
-    position: relative;
-    box-sizing: border-box;
-
-    .timeline-list {
-        position: relative;
-    }
-
-    .phenology-bar {
-        align-items: stretch;
-        justify-content: center;
-        box-sizing: border-box;
-        position: relative;
-
-        &--en-expand {
-            overflow: visible;
-        }
-
-        .phenology-title {
-            width: 18px;
-            top: 0;
-            bottom: 0;
-            left: 0;
-            height: auto;
-            color: #fff;
-            font-size: 12px;
-            position: absolute;
-            z-index: 10;
-            text-align: center;
-            display: flex;
-            align-items: baseline;
-            justify-content: center;
-            writing-mode: vertical-rl;
-            text-orientation: upright;
-            letter-spacing: 3px;
-            word-break: break-all;
-
-            &.phenology-blue {
-                background: #2199f8;
-            }
-
-            &.phenology-red {
-                background: #f1f1f1;
-                color: #808080;
-            }
-
-            &--en {
-                overflow: visible;
-                word-break: normal;
-                align-items: center;
-                justify-content: center;
-            }
-
-            &--en-expand {
-                bottom: auto;
-                height: auto;
-                min-height: 100%;
-                overflow: visible;
-            }
-
-            &__text {
-                display: inline-block;
-
-                &--en {
-                    writing-mode: horizontal-tb;
-                    text-orientation: mixed;
-                    letter-spacing: 0;
-                    white-space: nowrap;
-                    word-break: normal;
-                    line-height: 1;
-                    position: static;
-                    transform: rotate(90deg);
-                    transform-origin: center center;
-                }
-            }
-
-        }
-
-        .reproductive-item {
-            font-size: 12px;
-            text-align: center;
-            word-break: break-all;
-            writing-mode: vertical-rl;
-            text-orientation: upright;
-            letter-spacing: 3px;
-            width: 100%;
-            line-height: 23px;
-            color: inherit;
-            position: relative;
-
-            .phenology-name {
-                width: 18px;
-                line-height: 16px;
-                height: 100%;
-                color: #fff;
-                padding: 4px 0;
-                font-size: 12px;
-                box-sizing: border-box;
-                writing-mode: vertical-rl;
-                text-orientation: upright;
-                top: 0;
-                bottom: 0;
-                left: 0;
-                position: absolute;
-
-
-                &.phenology-red {
-                    background: #f1f1f1;
-                    color: #808080;
-                }
-
-                &.text-blue {
-                    background: #2199f8;
-                    color: #fff;
-                    border: 1px solid #2199f8;
-                    line-height: 16px;
-                    box-sizing: border-box;
-                }
-
-                &--en {
-                    overflow: visible;
-                    word-break: normal;
-                    display: flex;
-                    align-items: center;
-                    justify-content: center;
-                }
-
-                &--en-expand {
-                    bottom: auto;
-                    height: auto;
-                    min-height: 100%;
-                    overflow: visible;
-                }
-
-                &__text {
-                    display: inline-block;
-
-                    &--en {
-                        writing-mode: horizontal-tb;
-                        text-orientation: mixed;
-                        letter-spacing: 0;
-                        white-space: nowrap;
-                        word-break: normal;
-                        line-height: 1;
-                        position: static;
-                        transform: rotate(90deg);
-                        transform-origin: center center;
-                    }
-                }
-            }
-
-            .arranges {
-                display: flex;
-                max-width: calc(100vw - 63px);
-                min-width: calc(100vw - 58px);
-                gap: 5px;
-                letter-spacing: 0px;
-
-                .arrange-card {
-                    width: 95%;
-                    border: 0.5px solid #2199f8;
-                    border-radius: 8px;
-                    background: #fff;
-                    box-sizing: border-box;
-                    position: relative;
-                    padding: 8px 15px 8px 10px;
-                    writing-mode: horizontal-tb;
-                    margin-bottom: 10px;
-
-                    .card-content {
-                        display: flex;
-                        justify-content: space-between;
-                        align-items: center;
-                        font-size: 14px;
-
-                        .card-left {
-                            width: 100%;
-
-                            .left-info {
-                                display: flex;
-                                align-items: center;
-                                gap: 6px;
-
-                                .left-date {
-                                    border: 0.5px solid rgba(0, 0, 0, 0.4);
-                                    border-radius: 2px;
-                                    font-size: 12px;
-                                    width: 36px;
-                                    height: 20px;
-                                    line-height: 20px;
-                                }
-
-                                .text {
-                                    display: flex;
-                                    align-items: center;
-                                    gap: 4px;
-                                    width: calc(100% - 90px);
-                                    color: #414141;
-                                }
-                                .text-status {
-                                    background: rgba(33, 153, 248, 0.1);
-                                    color: #2199F8;
-                                    border-radius: 2px;
-                                    padding: 0 5px;
-                                    font-size: 10px;
-                                    min-width: fit-content;
-                                    height: 16px;
-                                    line-height: 16px;
-                                    border: 0.5px solid rgba(33, 153, 248, 0.4);
-                                }
-                            }
-
-                            .text-display {
-                                display: flex;
-                                gap: 6px;
-                                margin-top: 3px;
-                                .check-icon{
-                                    position: absolute;
-                                    right: -5px;
-                                    top: -5px;
-                                    width: 13px;
-                                    height: 13px;
-                                    background: #C5C5C5;
-                                    border-radius: 50%;
-                                    display: flex;
-                                    align-items: center;
-                                    justify-content: center;
-                                }
-                            }
-
-                            .title-text {
-                                margin-top: 5px;
-                                width: fit-content;
-                                max-width: 100%;
-                                text-align: left;
-                                color: rgba(91, 91, 91, 0.6);
-                                padding: 0 6px;
-                                border-radius: 2px;
-                                font-size: 12px;
-                                box-sizing: border-box;
-                                border: 0.5px solid rgba(91, 91, 91, 0.2);
-                                position: relative;
-                            }
-
-                            .farm-info {
-                                font-size: 12px;
-                                color: #626262;
-                                background: #F7F7F7;
-                                padding: 5px;
-                                border-radius: 5px;
-                                display: flex;
-                                align-items: center;
-                                justify-content: space-between;
-                                text-align: left;
-                                margin-top: 6px;
-
-                                .info-right {
-                                    background: #2199F8;
-                                    border-radius: 2px;
-                                    padding: 1px 5px;
-                                    color: #fff;
-                                }
-                            }
-                        }
-
-                        .status-right {
-                            position: absolute;
-                            right: 0;
-                            top: 0;
-                            font-size: 12px;
-                            color: #fff;
-                            background: #FF953D;
-                            border-radius: 0 8px 0 4px;
-                            padding: 0 5px;
-                            display: flex;
-                            align-items: center;
-                            gap: 3px;
-                            img{
-                                width: 12px;
-                                height: 13px;
-                            }
-                        }
-                    }
-
-                    &::before {
-                        content: "";
-                        position: absolute;
-                        left: -5px;
-                        top: 50%;
-                        transform: translateY(-50%);
-                        width: 0;
-                        height: 0;
-                        border-top: 5px solid transparent;
-                        border-bottom: 5px solid transparent;
-                        border-right: 5px solid #2199f8;
-                    }
-                }
-
-                .arrange-card.status-normal {
-                    @include arrange-card-status(#2199F8, null, #2199F8, rgba(33, 153, 248, 0.1));
-                    border-width: 0.8px;
-                }
-
-                .arrange-card.status-orange {
-                    @include arrange-card-status(#FF953D, null, #FF953D, rgba(255, 149, 61, 0.1));
-                }
-
-                .arrange-card.status-orange-bg {
-                    @include arrange-card-status(#FF953D, null, #FF953D, rgba(255, 149, 61, 0.1));
-                    .check-icon{
-                        background: #FF953D !important;
-                    }
-                }
-
-                .arrange-card.status-danger {
-                    @include arrange-card-status(#FF6A6A, null, #FF6A6A, rgba(255, 106, 106, 0.1));
-                }
-
-                .arrange-card.status-danger-bg {
-                    @include arrange-card-status(#FF6A6A, null, #FF6A6A, rgba(255, 106, 106, 0.1));
-                    .check-icon{
-                        background: #FF6A6A !important;
-                    }
-                }
-
-                .arrange-card.status-normal-farm {
-                    @include arrange-card-status(#2199F8, #E9F5FF, #2199F8, rgba(33, 153, 248, 0.1));
-                }
-
-                // 未激活等:灰色描边卡片
-                .arrange-card.future-card {
-                    @include arrange-card-status(rgba(184, 182, 182, 0.9), null, rgba(184, 182, 182, 0.9), #fff);
-
-                    .card-content {
-                        color: rgba(184, 182, 182, 0.9);
-                    }
-
-                    .card-left {
-                        .left-info {
-                            .left-date {
-                                color: rgba(184, 182, 182, 0.9);
-                                border-color: rgba(184, 182, 182, 0.9);
-                            }
-
-                            .text {
-                                color: rgba(184, 182, 182, 0.9);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    .reproductive-item+.reproductive-item {
-        margin-top: 4px;
-        padding-top: 0;
-    }
-
-    .phenology-bar+.phenology-bar {
-        margin-top: 4px;
-        padding-top: 0;
-    }
-
-
-    .empty-state {
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        min-height: 200px;
-        width: 100%;
-    }
-}
-</style>

+ 0 - 900
src/components/pageComponents/FarmWorkPlanTimeline.vue

@@ -1,900 +0,0 @@
-<template>
-    <div class="timeline-container" ref="timelineContainerRef">
-        <div class="timeline-list" ref="timelineListRef">
-            <div class="timeline-middle-line"></div>
-            <div
-                v-for="(t, tIdx) in solarTerms"
-                :key="`term-${uniqueTimestamp}-${tIdx}`"
-                class="timeline-term"
-                :style="getTermStyle(t, tIdx)"
-            >
-                <span class="term-name">{{ t.displayName }}</span>
-            </div>
-            <div v-for="(p, idx) in phenologyList" :key="`phenology-${uniqueTimestamp}-${idx}`" class="phenology-bar">
-                <div class="start-time">
-                    <div class="time-text">{{ $t('起始时间') }}</div>
-                    <span>{{ p.startDate }}</span>
-                </div>
-                <div class="phenology-title" v-if="p.reproductiveList[0]?.phenologyName === getNextPhenologyName(idx, 0)">
-                    {{ p.reproductiveList[0]?.phenologyName }}
-                </div>
-                <div
-                    v-for="(r, rIdx) in Array.isArray(p.reproductiveList) ? p.reproductiveList : []"
-                    :key="`reproductive-${uniqueTimestamp}-${idx}-${rIdx}`"
-                    class="reproductive-item"
-                >
-                    <div class="arranges" :style="p.startDate && rIdx === 0 ? 'padding-top: 30px;' : ''">
-                        <div
-                            v-for="(fw, aIdx) in Array.isArray(r.farmWorkArrangeList) ? r.farmWorkArrangeList : []"
-                            :key="`arrange-${uniqueTimestamp}-${idx}-${rIdx}-${aIdx}`"
-                            class="arrange-card"
-                            :style="
-                                shouldShowIncompleteStatus(fw.farmWorkId)
-                                    ? 'padding-bottom: 25px;'
-                                    : 'padding-bottom: 10px'
-                            "
-                            :class="[getArrangeStatusClass(fw), { 'first-card': aIdx === 0 && rIdx !== 0 }, { 'last-card': aIdx === r.farmWorkArrangeList.length - 1 && rIdx !== r.farmWorkArrangeList.length - 1 }]"
-                            @click="handleRowClick(fw)"
-                        >
-                            <div class="card-header">
-                                <div class="header-left">
-                                    <span class="farm-work-name van-ellipsis">{{ fw.farmWorkName || "--" }}</span>
-                                    <span class="tag-standard">{{ farmWorkType[fw.type] }}</span>
-                                </div>
-                                <div class="header-right" v-if="!isStandard">
-                                    {{ fw.isFollow == 1 ? "已关注" : fw.isFollow == 2 ? "托管农事" : "" }}
-                                </div>
-                            </div>
-                            <div class="card-content">
-                                <span>{{ fw.interactionQuestion || "暂无提示" }}</span>
-                                <span
-                                    v-if="!disableClick"
-                                    :class="shouldShowIncompleteStatus(fw.farmWorkId) ? 'link-warning' : 'edit-link'"
-                                    @click.stop="handleEdit(fw)"
-                                    >{{ $t('点击编辑') }}</span
-                                >
-                            </div>
-                            <div class="card-status" v-if="shouldShowIncompleteStatus(fw.farmWorkId)">
-                                <el-icon color="#FF953D" size="13"><WarningFilled /></el-icon>
-                                <span>{{ $t('未完善') }}</span>
-                            </div>
-                        </div>
-                    </div>
-                    <template v-if="r.name === r.phenologyName">
-                        <div 
-                            class="phenology-name single" 
-                            :style="r.phenologyName === getNextPhenologyName(idx, rIdx) ? 'padding: 6px 0;' : ''"
-                        >
-                            {{ r.name }}
-                        </div>
-                    </template>
-                    <template v-else>
-                        <template v-if="r.phenologyName === getNextPhenologyName(idx, rIdx)">
-                            <div class="phenology-name text-blue">
-                                {{ r.name }}
-                            </div>
-                        </template>
-                        <template v-else>
-                            <div class="phenology-name text-blue">{{ r.name }}</div>
-                            <div class="phenology-name mr">
-                                {{ r.phenologyName }}
-                            </div>
-                        </template>
-                    </template>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!-- 互动设置弹窗 -->
-    <interact-popup ref="interactPopupRef" @handleSaveSuccess="updateFarmWorkPlan"></interact-popup>
-</template>
-
-<script setup>
-import { ref, nextTick, watch, onMounted, onUnmounted } from "vue";
-import interactPopup from "@/components/popup/interactPopup.vue";
-import { ElMessage } from "element-plus";
-import { WarningFilled } from "@element-plus/icons-vue";
-
-const props = defineProps({
-    // 农场 ID,用于请求农事规划数据
-    farmId: {
-        type: [String, Number],
-        default: null,
-    },
-    // 页面类型:种植方案 / 农事规划,用来控制高度样式
-    pageType: {
-        type: String,
-        default: "",
-    },
-    // 是否禁用所有点击事件(用于只读展示)
-    disableClick: {
-        type: Boolean,
-        default: false,
-    },
-    containerId: {
-        type: [Number, String],
-        default: null,
-    },
-    // 是否是标准农事
-    isStandard: {
-        type: Boolean,
-        default: false,
-    },
-    // 方案ID
-    schemeId: {
-        type: [Number, String],
-        default: null,
-    },
-});
-
-const farmWorkType = {
-    0: "预警农事",
-    1: "标准农事",
-    2: "建议农事",
-    3: "自建农事",
-};
-
-const emits = defineEmits(["row-click"]);
-
-const solarTerms = ref([]);
-const phenologyList = ref([]);
-const timelineContainerRef = ref(null);
-const timelineListRef = ref(null);
-// 标记是否为首次加载
-const isInitialLoad = ref(true);
-// 存储timeline-list的实际渲染高度
-const timelineListHeight = ref(0);
-// 生成唯一的时间戳,用于确保key的唯一性
-const uniqueTimestamp = ref(Date.now());
-// ResizeObserver 实例,用于监听高度变化
-let resizeObserver = null;
-
-// 获取当前季节
-const getCurrentSeason = () => {
-    const month = new Date().getMonth() + 1; // 1-12
-    if (month >= 3 && month <= 5) {
-        return "spring"; // 春季:3-5月
-    } else if (month >= 6 && month <= 8) {
-        return "summer"; // 夏季:6-8月
-    } else if (month >= 9 && month <= 10) {
-        return "autumn"; // 秋季:9-10月
-    } else {
-        return "winter"; // 冬季:11-2月
-    }
-};
-
-// 安全解析时间到时间戳(ms)
-const safeParseDate = (val) => {
-    if (!val) return NaN;
-    if (val instanceof Date) return val.getTime();
-    if (typeof val === "number") return val;
-    if (typeof val === "string") {
-        // 兼容 "YYYY-MM-DD HH:mm:ss" -> Safari
-        const s = val.replace(/-/g, "/").replace("T", " ");
-        const d = new Date(s);
-        return isNaN(d.getTime()) ? NaN : d.getTime();
-    }
-    return NaN;
-};
-
-const batchValidateData = ref({});
-const allTrue = ref(false);
-const invalidIds = ref([]);
-const invalidArr = ref([]);
-// 验证农事卡片药肥报价信息是否完整
-const batchValidatePesticideFertilizerQuotes = (ids, items) => {
-    if (props.isStandard) {
-        return;
-    }
-    VE_API.monitor
-        .batchValidatePesticideFertilizerQuotes({ ids, schemeId: props.schemeId })
-        .then(({ data, code }) => {
-            if (code === 0) {
-                batchValidateData.value = data || {};
-                allTrue.value = Object.values(data).every((value) => value === true);
-                invalidIds.value = Object.keys(data).filter((key) => data[key] !== true);
-
-                // 清空之前的arrangeIds
-                invalidArr.value = [];
-                // 遍历items,判断farmWorkId是否在invalidIds中,如果对应上了就把item.id push进去
-                items.forEach((item) => {
-                    // 判断item.farmWorkId是否在invalidIds数组中(需要转换为字符串进行比较)
-                    const farmWorkIdStr = String(item.farmWorkId);
-                    if (invalidIds.value.includes(farmWorkIdStr)) {
-                        invalidArr.value.push({
-                            arrangeId: item.id,
-                            farmWorkId: item.farmWorkId,
-                        });
-                    }
-                });
-            }
-        })
-        .catch(() => {});
-};
-
-// 判断是否应该显示"未完善"状态
-// 如果batchValidateData中对应的farmWorkId验证结果为true(已完善),则不显示
-// 如果验证结果为false(未完善)或不存在,则显示
-const shouldShowIncompleteStatus = (farmWorkId) => {
-    if (!farmWorkId || !batchValidateData.value || typeof batchValidateData.value !== "object") {
-        // 如果没有验证数据,默认不显示
-        return false;
-    }
-
-    // 从对象中直接获取验证结果,支持字符串和数字类型的key
-    const isValid =
-        batchValidateData.value[farmWorkId] !== undefined
-            ? batchValidateData.value[farmWorkId]
-            : batchValidateData.value[String(farmWorkId)] !== undefined
-            ? batchValidateData.value[String(farmWorkId)]
-            : undefined;
-
-    // 如果找到了验证结果
-    if (isValid !== undefined) {
-        // 如果验证结果为true(已完善),返回false(不显示)
-        // 如果验证结果为false(未完善),返回true(显示)
-        return !isValid;
-    }
-
-    // 如果没有找到验证结果,默认不显示
-    return false;
-};
-
-// 获取下一个reproductive-item的phenologyName
-const getNextPhenologyName = (currentPhenologyIdx, currentReproductiveIdx) => {
-    const currentPhenology = phenologyList.value[currentPhenologyIdx];
-    if (!currentPhenology || !Array.isArray(currentPhenology.reproductiveList)) {
-        return null;
-    }
-    
-    // 如果当前reproductive-item不是最后一个,获取同一个物候期的下一个
-    if (currentReproductiveIdx < currentPhenology.reproductiveList.length - 1) {
-        const nextReproductive = currentPhenology.reproductiveList[currentReproductiveIdx + 1];
-        return nextReproductive?.phenologyName || null;
-    }
-    
-    // 如果当前reproductive-item是最后一个,获取下一个物候期的第一个reproductive-item
-    if (currentPhenologyIdx < phenologyList.value.length - 1) {
-        const nextPhenology = phenologyList.value[currentPhenologyIdx + 1];
-        if (nextPhenology && Array.isArray(nextPhenology.reproductiveList) && nextPhenology.reproductiveList.length > 0) {
-            const firstReproductive = nextPhenology.reproductiveList[0];
-            return firstReproductive?.phenologyName || null;
-        }
-    }
-    
-    return null;
-};
-
-// 计算物候期需要的实际高度(基于农事数量)
-const getPhenologyRequiredHeight = (item) => {
-    // 统计该物候期内的农事数量
-    let farmWorkCount = 0;
-
-    if (Array.isArray(item.reproductiveList)) {
-        item.reproductiveList.forEach((reproductive) => {
-            if (Array.isArray(reproductive.farmWorkArrangeList)) {
-                farmWorkCount += reproductive.farmWorkArrangeList.length;
-            }
-        });
-    }
-
-    // 如果没有农事,给一个最小高度
-    if (farmWorkCount === 0) {
-        return 50; // 最小50px
-    }
-
-    // 每个农事卡片的高度(根据实际内容,卡片高度可能因内容而异)
-    // 卡片包含:padding(8px*2) + header(约25px) + content margin(4px+2px) + content(约25-30px) = 约72-77px
-    // 考虑到内容可能换行,实际高度可能更高,设置为120px更安全,避免卡片重叠
-    const farmWorkCardHeight = 120; // 卡片高度估算,确保能容纳内容且不重叠
-    // 卡片之间的间距(与CSS中的gap保持一致)
-    const cardGap = 12;
-
-    // 计算总高度:卡片数量 * 卡片高度 + (卡片数量 - 1) * 间距
-    // 如果有多个卡片,需要加上它们之间的间距
-    const totalHeight = farmWorkCount * farmWorkCardHeight + (farmWorkCount > 1 ? (farmWorkCount - 1) * cardGap : 0);
-
-    // 返回精确的总高度,只保留最小高度限制,不添加额外余量
-    return Math.max(totalHeight, 50); // 最小50px,精确匹配农事卡片高度
-};
-
-// 计算所有物候期的累积位置和总高度
-const calculatePhenologyPositions = () => {
-    let currentTop = 10; // 起始位置,留出顶部间距
-    const positions = new Map();
-
-    // 按progress排序物候期,确保按时间顺序排列
-    const sortedPhenologyList = [...phenologyList.value].sort((a, b) => {
-        const aProgress = Math.min(Number(a?.progress) || 0, Number(a?.progress2) || 0);
-        const bProgress = Math.min(Number(b?.progress) || 0, Number(b?.progress2) || 0);
-        return aProgress - bProgress;
-    });
-
-    sortedPhenologyList.forEach((phenology) => {
-        const height = getPhenologyRequiredHeight(phenology);
-        // 使用与数据生成时相同的ID生成逻辑
-        const itemId =
-            phenology.id ?? phenology.phenologyId ?? phenology.name ?? `${phenology.progress}-${phenology.progress2}`;
-        positions.set(itemId, {
-            top: currentTop,
-            height: height,
-        });
-        currentTop += height; // 紧挨着下一个物候期,不留间距
-    });
-
-    return {
-        positions,
-        totalHeight: currentTop, // 总高度 = 最后一个物候期的底部位置,不添加额外间距
-    };
-};
-
-// 计算所有农事的总高度(基于物候期紧挨排列)
-const calculateTotalHeightByFarmWorks = () => {
-    const { totalHeight } = calculatePhenologyPositions();
-
-    // 如果有物候期数据,直接使用计算出的总高度
-    // totalHeight 已经包含了从 10 开始的起始位置和所有物候期的高度
-    if (totalHeight > 10) {
-        // 确保总高度至少能容纳所有节气(每个节气至少50px)
-        const baseHeight = (solarTerms.value?.length || 0) * 50;
-        // 返回物候期总高度和基础高度的较大值,确保节气能正常显示
-        return Math.max(totalHeight, baseHeight);
-    }
-
-    // 如果没有物候期数据,返回基础高度
-    const baseHeight = (solarTerms.value?.length || 0) * 50;
-    return baseHeight || 100; // 至少返回100px,避免为0
-};
-
-const getTermStyle = (t, index) => {
-    // 优先使用实际测量的timeline-list高度,如果没有测量到则使用计算值作为后备
-    const totalHeight = timelineListHeight.value > 0 ? timelineListHeight.value : calculateTotalHeightByFarmWorks();
-    // 获取节气总数
-    const termCount = solarTerms.value?.length || 1;
-
-    // 等分高度:总高度 / 节气数量
-    const termHeight = totalHeight / termCount;
-
-    // 计算top位置:索引 * 每个节气的高度
-    const top = index * termHeight;
-
-    return {
-        position: "absolute",
-        top: `${top}px`,
-        left: 0,
-        width: "30px",
-        height: `${termHeight}px`, // 高度等分,使用实际测量的高度
-        display: "flex",
-        alignItems: "center",
-    };
-};
-
-// 点击季节 → 滚动到对应节气(立春/立夏/立秋/立冬)
-const handleSeasonClick = (seasonValue) => {
-    const mapping = {
-        spring: "立春",
-        summer: "立夏",
-        autumn: "立秋",
-        winter: "立冬",
-    };
-    const targetName = mapping[seasonValue];
-    if (!targetName) return;
-
-    // 查找对应的节气
-    const targetIndex = solarTerms.value.findIndex((t) => (t?.displayName || "") === targetName);
-    if (targetIndex === -1) return;
-
-    // 计算目标节气的top位置
-    const totalHeight = timelineListHeight.value > 0 ? timelineListHeight.value : calculateTotalHeightByFarmWorks();
-    const termCount = solarTerms.value?.length || 1;
-    const termHeight = totalHeight / termCount;
-    const targetTop = targetIndex * termHeight;
-
-    // 滚动到目标位置
-    const wrap = timelineContainerRef.value;
-    if (!wrap) return;
-    const viewH = wrap.clientHeight || 0;
-    const maxScroll = Math.max(0, wrap.scrollHeight - viewH);
-    // 将目标位置稍微靠上(使用 0.1 视口高度做偏移)
-    let scrollTop = Math.max(0, targetTop - viewH * 0.1);
-    if (scrollTop > maxScroll) scrollTop = maxScroll;
-    wrap.scrollTo({ top: scrollTop, behavior: "smooth" });
-};
-
-// 农事状态样式映射(0:取消关注,1:关注,2:托管农事,)
-const getArrangeStatusClass = (fw) => {
-    const t = fw?.isFollow;
-    const warningStatus = shouldShowIncompleteStatus(fw.farmWorkId);
-    if (t == 0) return "normal-style";
-    if (warningStatus) return "status-warning";
-    // if (t >= 0 && t <= 4) return "status-normal";
-    // if (t === 5) return "status-complete";
-    return "status-normal";
-};
-
-const handleRowClick = (item) => {
-    // 记录当前页面滚动位置
-    if (timelineContainerRef.value) {
-        const scrollTop = timelineContainerRef.value.scrollTop || 0;
-        sessionStorage.setItem('timelineScrollTop', scrollTop.toString());
-    }
-    
-    item.isEdit = shouldShowIncompleteStatus(item.farmWorkId);
-    item.invalidIds = invalidIds.value;
-    item.invalidArr = invalidArr.value;
-    emits("row-click", item);
-};
-
-const interactPopupRef = ref(null);
-const handleEdit = (item) => {
-    if (props.disableClick) return;
-    if (interactPopupRef.value) {
-        interactPopupRef.value.showPopup(item);
-    }
-};
-
-// 获取农事规划数据
-const getFarmWorkPlan = () => {
-    if (!props.farmId && !props.containerId) return;
-    // 更新时间戳,确保key变化,触发DOM重新渲染
-    uniqueTimestamp.value = Date.now();
-    // 重置测量高度,等待重新测量
-    timelineListHeight.value = 0;
-    let savedScrollTop = 0;
-    if (!isInitialLoad.value && timelineContainerRef.value) {
-        savedScrollTop = timelineContainerRef.value.scrollTop || 0;
-    }
-
-    VE_API.monitor
-        .farmWorkPlan({ farmId: props.farmId, containerId: props.containerId, schemeId: props.schemeId })
-        .then(({ data, code }) => {
-            if (code === 0) {
-                const list = Array.isArray(data?.solarTermsList) ? data.solarTermsList : [];
-                const filtered = list
-                    .filter((t) => t && t.type === 1)
-                    .map((t) => ({
-                        id:
-                            t.id ??
-                            t.solarTermsId ??
-                            t.termId ??
-                            `${t.name || t.solarTermsName || t.termName || "term"}-${t.createDate || ""}`,
-                        displayName: t.name || t.solarTermsName || t.termName || "节气",
-                        createDate: t.createDate || null,
-                        progress: Number(t.progress) || 0,
-                    }));
-                solarTerms.value = filtered;
-                // 物候期数据
-                phenologyList.value = Array.isArray(data?.phenologyList)
-                    ? data.phenologyList.map((it) => {
-                          const reproductiveList = Array.isArray(it.reproductiveList)
-                              ? it.reproductiveList.map((r) => {
-                                    const farmWorkArrangeList = Array.isArray(r.farmWorkArrangeList)
-                                        ? r.farmWorkArrangeList.map((fw) => ({
-                                              ...fw,
-                                              containerSpaceTimeId: it.containerSpaceTimeId,
-                                          }))
-                                        : [];
-                                    return {
-                                        ...r,
-                                        farmWorkArrangeList,
-                                    };
-                                })
-                              : [];
-                          return {
-                              id: it.id ?? it.phenologyId ?? it.name ?? `${it.progress}-${it.progress2}`,
-                              progress: Number(it.progress) || 0, // 起点 %
-                              progress2: Number(it.progress2) || 0, // 终点 %
-                              startDate: it.startDate,
-                              startTimeMs: safeParseDate(
-                                  it.startDate || it.beginDate || it.start || it.start_at
-                              ),
-                              reproductiveList,
-                          };
-                      })
-                    : [];
-                // 使用多次 nextTick 和 requestAnimationFrame 确保DOM完全渲染
-                nextTick(() => {
-                    requestAnimationFrame(() => {
-                        nextTick(() => {
-                            requestAnimationFrame(() => {
-                                // 测量timeline-list的实际渲染高度
-                                if (timelineListRef.value) {
-                                    const height =
-                                        timelineListRef.value.offsetHeight || timelineListRef.value.clientHeight;
-                                    if (height > 0) {
-                                        timelineListHeight.value = height;
-
-                                        // 如果是首次加载,滚动到当前季节对应的节气
-                                        if (isInitialLoad.value) {
-                                            const currentSeason = getCurrentSeason();
-                                            handleSeasonClick(currentSeason);
-                                            isInitialLoad.value = false;
-                                        }
-                                    }
-                                }
-
-                                if (isInitialLoad.value) {
-                                    // 如果测量失败,延迟一下再尝试滚动
-                                    setTimeout(() => {
-                                        if (timelineListRef.value) {
-                                            const height =
-                                                timelineListRef.value.offsetHeight ||
-                                                timelineListRef.value.clientHeight;
-                                            if (height > 0) {
-                                                timelineListHeight.value = height;
-                                            }
-                                        }
-                                        const currentSeason = getCurrentSeason();
-                                        handleSeasonClick(currentSeason);
-                                        isInitialLoad.value = false;
-                                    }, 200);
-                                } else {
-                                    // 尝试恢复之前保存的滚动位置
-                                    const savedScrollTopFromStorage = sessionStorage.getItem('timelineScrollTop');
-                                    if (savedScrollTopFromStorage) {
-                                        // 等待 DOM 完全渲染后再恢复滚动位置
-                                        nextTick(() => {
-                                            requestAnimationFrame(() => {
-                                                if (timelineContainerRef.value) {
-                                                    const scrollTop = Number(savedScrollTopFromStorage);
-                                                    timelineContainerRef.value.scrollTop = scrollTop;
-                                                    // 恢复后清除保存的位置,避免下次误恢复
-                                                    sessionStorage.removeItem('timelineScrollTop');
-                                                }
-                                            });
-                                        });
-                                    } else if (timelineContainerRef.value && savedScrollTop > 0) {
-                                        timelineContainerRef.value.scrollTop = savedScrollTop;
-                                    }
-                                }
-                            });
-                        });
-                    });
-                });
-
-                // 收集所有farmWorkId
-                const farmWorkIds = [];
-                const farmWorks = [];
-                phenologyList.value.forEach((phenology) => {
-                    if (Array.isArray(phenology.reproductiveList)) {
-                        phenology.reproductiveList.forEach((reproductive) => {
-                            if (Array.isArray(reproductive.farmWorkArrangeList)) {
-                                reproductive.farmWorkArrangeList.forEach((farmWork) => {
-                                    if (farmWork.farmWorkId && farmWork.isFollow !== 0) {
-                                        farmWorkIds.push(farmWork.farmWorkId);
-                                        farmWorks.push(farmWork);
-                                    }
-                                });
-                            }
-                        });
-                    }
-                });
-
-                // 调用验证方法,传入所有ids
-                if (farmWorkIds.length > 0) {
-                    batchValidatePesticideFertilizerQuotes(farmWorkIds, farmWorks);
-                }
-            }
-        })
-        .catch((error) => {
-            console.error("获取农事规划数据失败:", error);
-            ElMessage.error("获取农事规划数据失败");
-        });
-};
-
-const updateFarmWorkPlan = () => {
-    solarTerms.value = [];
-    phenologyList.value = [];
-    getFarmWorkPlan();
-};
-
-watch(
-    () => props.farmId || props.containerId,
-    (val) => {
-        if (val) {
-            isInitialLoad.value = true;
-            updateFarmWorkPlan();
-        }
-    },
-    { immediate: true }
-);
-watch(
-    () => props.schemeId,
-    (val) => {
-        // if (val) {
-            updateFarmWorkPlan();
-        // }
-    }
-);
-
-defineExpose({
-    updateFarmWorkPlan,
-});
-
-// 使用 ResizeObserver 监听高度变化,确保在DOM完全渲染后获取准确高度
-const setupResizeObserver = () => {
-    if (!timelineListRef.value || typeof ResizeObserver === "undefined") {
-        return;
-    }
-
-    // 如果已经存在观察者,先断开
-    if (resizeObserver) {
-        resizeObserver.disconnect();
-    }
-
-    // 创建新的观察者
-    resizeObserver = new ResizeObserver((entries) => {
-        for (const entry of entries) {
-            const height = entry.contentRect.height;
-            if (height > 0 && height !== timelineListHeight.value) {
-                timelineListHeight.value = height;
-            }
-        }
-    });
-
-    // 开始观察
-    resizeObserver.observe(timelineListRef.value);
-};
-
-// 组件挂载后设置 ResizeObserver
-onMounted(() => {
-    nextTick(() => {
-        requestAnimationFrame(() => {
-            setupResizeObserver();
-        });
-    });
-});
-
-// 组件卸载前清理 ResizeObserver
-onUnmounted(() => {
-    if (resizeObserver) {
-        resizeObserver.disconnect();
-        resizeObserver = null;
-    }
-});
-
-// 在数据更新后重新设置 ResizeObserver
-watch(
-    () => phenologyList.value.length,
-    () => {
-        nextTick(() => {
-            requestAnimationFrame(() => {
-                setupResizeObserver();
-            });
-        });
-    }
-);
-</script>
-
-<style scoped lang="scss">
-.timeline-container {
-    height: 100%;
-    overflow: auto;
-    position: relative;
-    box-sizing: border-box;
-    .timeline-list {
-        position: relative;
-    }
-    .timeline-middle-line {
-        position: absolute;
-        left: 15px; /* 位于节气文字列中间(列宽约30px) */
-        top: 0;
-        bottom: 0;
-        width: 2px;
-        background: #e8e8e8;
-        z-index: 1;
-    }
-    .phenology-bar {
-        align-items: stretch;
-        justify-content: center;
-        box-sizing: border-box;
-        position: relative;
-        .start-time{
-            position: absolute;
-            left: 88px;
-            z-index: 1;
-            letter-spacing: 0px;
-            writing-mode: initial;
-            line-height: normal;
-            display: flex;
-            align-items: center;
-            gap: 10px;
-            font-size: 12px;
-            .time-text{
-                padding: 2px 6px;
-                color: #2199f8;
-                background: rgba(33, 153, 248, 0.1);
-            }
-        }
-        .phenology-title{
-            width: 20px;
-            height: 99%;
-            background: #2199f8;
-            color: #fff;
-            font-size: 12px;
-            position: absolute;
-            left: 35px;
-            z-index: 10;
-            text-align: center;
-            display: flex;
-            align-items: center;
-        }
-        .reproductive-item {
-            font-size: 12px;
-            text-align: center;
-            word-break: break-all;
-            writing-mode: vertical-rl;
-            text-orientation: upright;
-            letter-spacing: 3px;
-            width: 100%;
-            line-height: 23px;
-            color: inherit;
-            position: relative;
-            .phenology-name {
-                width: 20px;
-                line-height: 20px;
-                height: 100%;
-                background: #2199f8;
-                color: #fff;
-                padding: 4px 0;
-                font-size: 12px;
-                box-sizing: border-box;
-                &.mr{
-                    margin-right: 3px;
-                }
-                &.single{
-                    width: 43px;
-                    line-height: 43px;
-                }
-                &.text-blue{
-                    background: rgba(33, 153, 248, 0.15);
-                    color: #2199f8;
-                    border: 1px solid #2199f8;
-                    line-height: 18px;
-                    box-sizing: border-box;
-                }
-            }
-            .arranges {
-                display: flex;
-                max-width: calc(100vw - 92px);
-                min-width: calc(100vw - 92px);
-                gap: 5px;
-                letter-spacing: 0px;
-                .arrange-card {
-                    width: 93%;
-                    border: 0.5px solid #2199f8;
-                    border-radius: 8px;
-                    background: #fff;
-                    box-sizing: border-box;
-                    position: relative;
-                    padding: 8px;
-                    writing-mode: horizontal-tb;
-                    &.first-card{
-                        margin-top: 10px;
-                    }
-                    &.last-card{
-                        margin-bottom: 10px;
-                    }
-                    .card-header {
-                        display: flex;
-                        justify-content: space-between;
-                        align-items: center;
-                        width: 100%;
-                        .header-left {
-                            display: flex;
-                            align-items: center;
-                            gap: 8px;
-                            width: calc(100% - 50px);
-                            .farm-work-name {
-                                font-size: 14px;
-                                font-weight: 500;
-                                color: #1d2129;
-                                max-width: calc(100% - 74px);
-                            }
-                            .tag-standard {
-                                padding: 0 8px;
-                                background: rgba(119, 119, 119, 0.1);
-                                border-radius: 25px;
-                                font-weight: 400;
-                                font-size: 12px;
-                                color: #000;
-                            }
-                        }
-                        .header-right {
-                            font-size: 12px;
-                            color: #808080;
-                            border-radius: 25px;
-                        }
-                    }
-                    .card-content {
-                        color: #909090;
-                        text-align: left;
-                        line-height: 1.55;
-                        margin: 4px 0 2px 0;
-                        .edit-link {
-                            color: #2199f8;
-                            margin-left: 5px;
-                        }
-                        .link-warning {
-                            color: #ff953d;
-                            margin-left: 5px;
-                        }
-                    }
-                    .card-status {
-                        position: absolute;
-                        bottom: 0;
-                        right: 0;
-                        background: rgba(255, 149, 61, 0.1);
-                        border-radius: 3px;
-                        color: #ff953d;
-                        padding: 0 6px;
-                        display: flex;
-                        align-items: center;
-                        gap: 4px;
-                        font-size: 12px;
-                    }
-                    &::before {
-                        content: "";
-                        position: absolute;
-                        left: -5px;
-                        top: 50%;
-                        transform: translateY(-50%);
-                        width: 0;
-                        height: 0;
-                        border-top: 5px solid transparent;
-                        border-bottom: 5px solid transparent;
-                        border-right: 5px solid #2199f8;
-                    }
-                }
-                .arrange-card.normal-style {
-                    opacity: 0.3;
-                }
-                .arrange-card.status-warning {
-                    border-color: #ff953d;
-                    &::before {
-                        border-right-color: #ff953d;
-                    }
-                }
-                .arrange-card.status-complete {
-                    border-color: #1ca900;
-                    &::before {
-                        border-right-color: #1ca900;
-                    }
-                }
-                .arrange-card.status-normal {
-                    border-color: #2199f8;
-                    &::before {
-                        border-right-color: #2199f8;
-                    }
-                }
-            }
-        }
-    }
-    .reproductive-item + .reproductive-item {
-        padding-top: 3px;
-    }
-    .phenology-bar + .phenology-bar {
-        padding-top: 3px;
-    }
-    .timeline-term {
-        position: absolute;
-        width: 30px;
-        display: flex;
-        align-items: flex-start;
-        z-index: 2; /* 置于中线之上 */
-        .term-name {
-            display: inline-block;
-            width: 100%;
-            min-height: 35px;
-            line-height: 30px;
-            background: #f5f7fb;
-            font-size: 13px;
-            word-break: break-all;
-            writing-mode: vertical-rl;
-            text-orientation: upright;
-            color: rgba(174, 174, 174, 0.6);
-            text-align: center;
-        }
-    }
-}
-</style>

+ 0 - 51
src/components/pageComponents/FnShareSheet.vue

@@ -1,51 +0,0 @@
-<template>
-    <share-sheet
-        teleport="#app"
-        v-model:show="internalShow"
-        :title="t('立即分享给好友')"
-        :options="options"
-        @select="handleSelect"
-    />
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { ShareSheet } from "vant";
-import { computed } from "vue";
-
-const props = defineProps({
-    show: {
-        type: Boolean,
-        default: false,
-    },
-    options: {
-        type: Array,
-        default: () => [
-            { name: "飞鸟用户", icon: "https://birdseye-img.sysuimars.com/birdseye-look-mini/Group%201321316260.png" ,type: "birdseye"},
-            { name: "微信", icon: "wechat", type: "wechat" },
-        ],
-    },
-});
-
-const emit = defineEmits(["update:show", "select"]);
-
-const internalShow = computed({
-    get() {
-        return props.show;
-    },
-    set(val) {
-        emit("update:show", val);
-    },
-});
-
-function handleSelect(option) {
-    emit("update:show", false);
-    emit("select", option);
-}
-</script>
-
-<style scoped>
-</style>
-
-

+ 0 - 1072
src/components/pageComponents/GrowthStageTimeline.vue

@@ -1,1072 +0,0 @@
-<template>
-    <div class="growth-stage-timeline">
-        <div class="growth-stage-timeline__scroll" ref="scrollRef">
-            <div class="growth-stage-timeline__inner" :style="innerStyle">
-                <!-- 轨道:横线 + 节点 + 拖动手柄 -->
-                <div class="growth-stage-timeline__track" ref="trackRef">
-                    <div class="growth-stage-timeline__track-line" aria-hidden="true"></div>
-                    <div
-                        class="growth-stage-timeline__track-grid"
-                        :style="{ gridTemplateColumns: gridCols }"
-                    >
-                        <div
-                            v-for="(_, i) in normalizedStages"
-                            :key="'dot-' + i"
-                            class="growth-stage-timeline__dot-wrap"
-                        >
-                            <span class="growth-stage-timeline__dot"></span>
-                        </div>
-                    </div>
-
-                    <div
-                        ref="handleRef"
-                        class="growth-stage-timeline__handle"
-                        :style="handleStyle"
-                        @pointerdown.stop.prevent="onHandlePointerDown"
-                    >
-                        <div class="growth-stage-timeline__handle-core">
-                            <div
-                                v-if="showHandleTooltip"
-                                class="growth-stage-timeline__tooltip-wrap"
-                            >
-                                <div
-                                    ref="tooltipBubbleRef"
-                                    class="growth-stage-timeline__tooltip"
-                                    :style="tooltipBubbleStyle"
-                                >
-                                    {{ displayTooltipText }}
-                                </div>
-                                <div
-                                    class="growth-stage-timeline__tooltip-caret"
-                                    aria-hidden="true"
-                                ></div>
-                            </div>
-                            <div
-                                class="growth-stage-timeline__handle-body"
-                                :class="{
-                                    'growth-stage-timeline__handle-body--wide':
-                                        activeLabelIsShort,
-                                }"
-                            >
-                                <span class="growth-stage-timeline__handle-bar"></span>
-                                <span class="growth-stage-timeline__handle-bar"></span>
-                                <span class="growth-stage-timeline__handle-bar"></span>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-
-                <!-- 阶段文案 + 绿色标签 -->
-                <div
-                    class="growth-stage-timeline__labels"
-                    :style="{ gridTemplateColumns: gridCols }"
-                >
-                    <div
-                        v-for="(stage, i) in normalizedStages"
-                        :key="'lb-' + i"
-                        class="growth-stage-timeline__label-col"
-                        :class="{
-                            'growth-stage-timeline__label-col--wide':
-                                isShortStageLabel(stage.label),
-                        }"
-                    >
-                        <div
-                            class="growth-stage-timeline__label-text"
-                            :class="{
-                                'growth-stage-timeline__label-text--active':
-                                    i === activeIndex,
-                            }"
-                        >
-                            {{ stage.label }}
-                        </div>
-                        <div
-                            v-if="stage.tags && stage.tags.length"
-                            class="growth-stage-timeline__tags"
-                        >
-                            <span
-                                v-for="(tag, ti) in stage.tags"
-                                :key="ti"
-                                class="growth-stage-timeline__tag"
-                            >{{ tag }}</span>
-                        </div>
-                    </div>
-                </div>
-
-                <!-- 生育期卡片:与上方阶段列同网格对齐,随横向滚动联动 -->
-                <div
-                    class="growth-stage-timeline__bg"
-                    :style="{ gridTemplateColumns: gridCols }"
-                >
-                    <div
-                        v-for="(run, ri) in periodRuns"
-                        :key="'bg-run-' + ri"
-                        class="growth-stage-timeline__bg-cell growth-stage-timeline__bg-cell--period"
-                        :class="{
-                            'growth-stage-timeline__bg-cell--active':
-                                ri === activePeriodRunIndex,
-                        }"
-                        :style="{ gridColumn: `span ${run.span}` }"
-                    >
-                        <div class="growth-stage-timeline__period-title">
-                            {{ run.periodTitle }}
-                        </div>
-                        <div class="growth-stage-timeline__period-sub">
-                            {{ run.periodSubtitle }}
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import {
-    computed,
-    ref,
-    watch,
-    onMounted,
-    onBeforeUnmount,
-    nextTick,
-} from "vue";
-import { useI18n } from "@/i18n";
-
-/**
- * @typedef {Object} GrowthStageItem
- * @property {string} label 节点文案,如「60%展开」
- * @property {string[]} [tags] 绿色标签,如 ['最佳给肥点']
- * @property {string} periodTitle 生育期大标题
- * @property {string} periodSubtitle 生育期描述小字
- * @property {string} [phenophase_code] 物候期编码,由接口/父组件写入
- */
-
-const props = defineProps({
-    /** @type {import('vue').PropType<GrowthStageItem[]>} */
-    stages: {
-        type: Array,
-        default: () => [],
-    },
-    /** 当前选中的阶段索引(与 v-model 同步);不传时为中间一档 */
-    modelValue: {
-        type: Number,
-        default: undefined,
-    },
-    tooltipText: {
-        type: String,
-        default: "此为预估进程,请左右移动进行校准!",
-    },
-    /** 每列最小宽度(px),列数多时可横向滚动 */
-    minColWidth: {
-        type: Number,
-        default: 72,
-    },
-});
-
-const emit = defineEmits(["update:modelValue", "change", "scrollSettled", "locale-change"]);
-
-const { t, locale } = useI18n();
-
-const DEFAULT_TOOLTIP_ZH = "此为预估进程,请左右移动进行校准!";
-
-const displayTooltipText = computed(() => {
-    if (!props.tooltipText || props.tooltipText === DEFAULT_TOOLTIP_ZH) {
-        return t("growthStageTimeline.tooltipHint");
-    }
-    return t(props.tooltipText);
-});
-
-watch(locale, () => {
-    emit("locale-change");
-});
-
-const scrollRef = ref(null);
-const trackRef = ref(null);
-const handleRef = ref(null);
-const tooltipBubbleRef = ref(null);
-
-/** 气泡相对手柄水平中心的额外偏移(px),用于避免贴边时被 overflow 裁切 */
-const tooltipShiftPx = ref(0);
-
-const TOOLTIP_EDGE_MARGIN_PX = 8;
-
-/** 本次进入页面内展示;拖动手柄产生位移后关闭,下次路由/页面再进入会重新挂载并再次显示 */
-const showHandleTooltip = ref(true);
-
-const normalizedStages = computed(() =>
-    Array.isArray(props.stages) ? props.stages : []
-);
-
-const colCount = computed(() =>
-    Math.max(1, normalizedStages.value.length)
-);
-
-/** time_discribe 文案过短(<3 字)时,该列占 3 个普通点宽度,便于下方标签展示 */
-const SHORT_LABEL_MAX_LEN = 3;
-const SHORT_LABEL_COL_WEIGHT = 3;
-
-function isShortStageLabel(label) {
-    return String(label ?? "").length < SHORT_LABEL_MAX_LEN;
-}
-
-function getStageColumnWeight(stage) {
-    return isShortStageLabel(stage?.label) ? SHORT_LABEL_COL_WEIGHT : 1;
-}
-
-const columnWeights = computed(() =>
-    normalizedStages.value.map((stage) => getStageColumnWeight(stage))
-);
-
-const totalColumnWeight = computed(() =>
-    Math.max(
-        1,
-        columnWeights.value.reduce((sum, weight) => sum + weight, 0)
-    )
-);
-
-const gridCols = computed(() => {
-    const stages = normalizedStages.value;
-    if (!stages.length) {
-        return `minmax(${props.minColWidth}px, 1fr)`;
-    }
-    return stages
-        .map((stage) => {
-            const weight = getStageColumnWeight(stage);
-            return `minmax(${weight * props.minColWidth}px, ${weight}fr)`;
-        })
-        .join(" ");
-});
-
-/** 左右留白:手柄 translate(-50%) 与气泡在首尾否则会溢出滚动宽度,且气泡换行会拉高整列导致视觉上“掉下去” */
-const INNER_EDGE_PAD_PX = 12;
-
-const innerStyle = computed(() => {
-    const minContentWidth = columnWeights.value.reduce(
-        (sum, weight) => sum + weight * props.minColWidth,
-        0
-    );
-    return {
-        boxSizing: "border-box",
-        minWidth: `${minContentWidth + INNER_EDGE_PAD_PX * 2}px`,
-        paddingLeft: `${INNER_EDGE_PAD_PX}px`,
-        paddingRight: `${INNER_EDGE_PAD_PX}px`,
-    };
-});
-
-function periodKey(stage) {
-    const s = stage || {};
-    return `${s.periodTitle || ""}\0${s.periodSubtitle || ""}`;
-}
-
-/** 连续相同生育期合并为一段,用于背景区 grid-column span */
-const periodRuns = computed(() => {
-    const list = normalizedStages.value;
-    if (!list.length) {
-        return [
-            {
-                span: 1,
-                periodTitle: "",
-                periodSubtitle: "",
-            },
-        ];
-    }
-    const runs = [];
-    let i = 0;
-    while (i < list.length) {
-        const key = periodKey(list[i]);
-        let span = 1;
-        let j = i + 1;
-        while (j < list.length && periodKey(list[j]) === key) {
-            span++;
-            j++;
-        }
-        runs.push({
-            span,
-            periodTitle: list[i].periodTitle ?? "",
-            periodSubtitle: list[i].periodSubtitle ?? "",
-        });
-        i = j;
-    }
-    return runs;
-});
-
-/** 生育期卡片列宽与上方阶段列对齐:每段占 span 列,fr 比例与阶段网格一致 */
-const periodGridCols = computed(() => {
-    const runs = periodRuns.value;
-    if (!runs.length) {
-        return `minmax(${props.minColWidth}px, 1fr)`;
-    }
-    return runs
-        .map(
-            (run) =>
-                `minmax(${run.span * props.minColWidth}px, ${run.span}fr)`
-        )
-        .join(" ");
-});
-
-function clampStageIndex(v) {
-    const last = Math.max(0, colCount.value - 1);
-    return Math.min(Math.max(0, v), last);
-}
-
-/** 项数为 n 时默认选中索引 floor((n-1)/2),偶数个时偏左中间 */
-function middleStageIndex() {
-    const n = colCount.value;
-    return Math.max(0, Math.floor((n - 1) / 2));
-}
-
-const activeIndex = ref(0);
-
-const activeLabelIsShort = computed(() =>
-    isShortStageLabel(normalizedStages.value[activeIndex.value]?.label)
-);
-
-watch(
-    [colCount, () => props.modelValue],
-    () => {
-        const mv = props.modelValue;
-        const hasParentIndex = mv !== undefined && mv !== null;
-        const next = hasParentIndex
-            ? clampStageIndex(mv)
-            : middleStageIndex();
-        activeIndex.value = next;
-        // 仅在没有父级索引时回写默认档,避免覆盖父组件按物候编码算好的下标
-        if (!hasParentIndex) {
-            nextTick(() => {
-                emit("update:modelValue", next);
-            });
-        }
-    },
-    { immediate: true }
-);
-
-/** 手柄水平位置:0~1,对应轨道宽度 */
-const handleRatio = ref(0);
-
-function stageIndexToPeriodRunIndex(stageIdx) {
-    let start = 0;
-    for (let ri = 0; ri < periodRuns.value.length; ri++) {
-        const span = periodRuns.value[ri].span;
-        if (stageIdx >= start && stageIdx < start + span) {
-            return ri;
-        }
-        start += span;
-    }
-    return 0;
-}
-
-/** 视口中心(手柄)所在生育期段索引,随滚动/拖动实时高亮 */
-const activePeriodRunIndex = computed(() =>
-    stageIndexToPeriodRunIndex(ratioToIndex(handleRatio.value))
-);
-
-function indexToRatio(idx) {
-    const weights = columnWeights.value;
-    const total = totalColumnWeight.value;
-    if (weights.length <= 1) return 0.5;
-    let start = 0;
-    for (let i = 0; i < idx; i++) {
-        start += weights[i] ?? 1;
-    }
-    const center = start + (weights[idx] ?? 1) / 2;
-    return center / total;
-}
-
-function ratioToIndex(r) {
-    const weights = columnWeights.value;
-    const total = totalColumnWeight.value;
-    const n = weights.length;
-    if (n <= 1) return 0;
-    const target = Math.min(Math.max(0, r), 1) * total;
-    let acc = 0;
-    let bestIdx = 0;
-    let bestDist = Infinity;
-    for (let i = 0; i < n; i++) {
-        const center = acc + (weights[i] ?? 1) / 2;
-        const dist = Math.abs(target - center);
-        if (dist < bestDist) {
-            bestDist = dist;
-            bestIdx = i;
-        }
-        acc += weights[i] ?? 1;
-    }
-    return bestIdx;
-}
-
-/** 禁止在轨道上横向拖滚:仅在手柄拖动时由脚本更新 scrollLeft */
-let scrollAreaTouchStartX = 0;
-let scrollAreaTouchStartY = 0;
-
-function onScrollAreaTouchStart(e) {
-    if (!e.touches?.length) return;
-    scrollAreaTouchStartX = e.touches[0].clientX;
-    scrollAreaTouchStartY = e.touches[0].clientY;
-}
-
-function onScrollAreaTouchMove(e) {
-    if (!e.touches?.length) return;
-    const dx = e.touches[0].clientX - scrollAreaTouchStartX;
-    const dy = e.touches[0].clientY - scrollAreaTouchStartY;
-    if (Math.abs(dx) > Math.abs(dy)) {
-        e.preventDefault();
-    }
-}
-
-function getScrollLayout() {
-    const scrollEl = scrollRef.value;
-    if (!scrollEl) return null;
-    const inner = scrollEl.querySelector(".growth-stage-timeline__inner");
-    if (!inner) return null;
-    const w = inner.offsetWidth;
-    const cw = scrollEl.clientWidth;
-    const maxScroll = Math.max(0, scrollEl.scrollWidth - cw);
-    const pad = INNER_EDGE_PAD_PX;
-    const contentW = Math.max(0, w - pad * 2);
-    return { scrollEl, cw, maxScroll, pad, contentW };
-}
-
-/** 滚动缓动系数,越小滚动越慢(0~1) */
-const SCROLL_LERP = 0.08;
-
-let scrollTargetLeft = null;
-let scrollAnimRafId = null;
-
-function getPeriodRunBounds(runIdx) {
-    let stageStart = 0;
-    for (let ri = 0; ri < runIdx; ri++) {
-        stageStart += periodRuns.value[ri].span;
-    }
-    const span = periodRuns.value[runIdx]?.span ?? 1;
-    const weights = columnWeights.value;
-    const total = totalColumnWeight.value;
-    if (!weights.length) {
-        return { startRatio: 0, endRatio: 1, centerRatio: 0.5 };
-    }
-    let weightStart = 0;
-    for (let i = 0; i < stageStart; i++) {
-        weightStart += weights[i] ?? 1;
-    }
-    let weightSpan = 0;
-    for (let i = stageStart; i < stageStart + span; i++) {
-        weightSpan += weights[i] ?? 1;
-    }
-    return {
-        startRatio: weightStart / total,
-        endRatio: (weightStart + weightSpan) / total,
-        centerRatio: (weightStart + weightSpan / 2) / total,
-    };
-}
-
-function ratioToScrollLeft(ratio, stageIdx = null) {
-    const m = getScrollLayout();
-    if (!m) return null;
-    const { cw, maxScroll, pad, contentW } = m;
-    const r = Math.min(Math.max(0, ratio), 1);
-    const handleCenterX = pad + r * contentW;
-
-    const idx =
-        stageIdx != null
-            ? clampStageIndex(stageIdx)
-            : ratioToIndex(ratio);
-    const runIdx = stageIndexToPeriodRunIndex(idx);
-    const { startRatio, endRatio } = getPeriodRunBounds(runIdx);
-    const periodLeft = pad + startRatio * contentW;
-    const periodRight = pad + endRatio * contentW;
-    const periodWidth = periodRight - periodLeft;
-
-    let left = handleCenterX - cw / 2;
-    if (periodWidth <= cw) {
-        if (periodLeft < left) left = periodLeft;
-        if (periodRight > left + cw) left = periodRight - cw;
-    } else {
-        left = Math.max(periodLeft, Math.min(left, periodRight - cw));
-    }
-
-    return Math.max(0, Math.min(left, maxScroll));
-}
-
-function cancelScrollAnimation() {
-    if (scrollAnimRafId != null) {
-        cancelAnimationFrame(scrollAnimRafId);
-        scrollAnimRafId = null;
-    }
-}
-
-function runScrollAnimation() {
-    const scrollEl = scrollRef.value;
-    if (!scrollEl || scrollTargetLeft == null) {
-        scrollAnimRafId = null;
-        return;
-    }
-    const current = scrollEl.scrollLeft;
-    const diff = scrollTargetLeft - current;
-    if (Math.abs(diff) < 0.5) {
-        scrollEl.scrollLeft = scrollTargetLeft;
-        scrollTargetLeft = null;
-        scrollAnimRafId = null;
-        return;
-    }
-    scrollEl.scrollLeft = current + diff * SCROLL_LERP;
-    scrollAnimRafId = requestAnimationFrame(runScrollAnimation);
-}
-
-function applyScrollToRatio(ratio, immediate = false, stageIdx = null) {
-    const left = ratioToScrollLeft(ratio, stageIdx);
-    if (left == null) return;
-    const scrollEl = scrollRef.value;
-    if (!scrollEl) return;
-
-    scrollTargetLeft = left;
-    if (immediate) {
-        cancelScrollAnimation();
-        scrollEl.scrollLeft = left;
-        scrollTargetLeft = null;
-        return;
-    }
-    if (scrollAnimRafId == null) {
-        scrollAnimRafId = requestAnimationFrame(runScrollAnimation);
-    }
-}
-
-/** 将轨道上的比例位置(0~1,与手柄 left 一致)滚到视口水平中央 */
-function scrollToCenterRatio(ratio, behavior = "smooth", stageIdx = null) {
-    applyScrollToRatio(ratio, behavior === "auto", stageIdx);
-}
-
-function syncScrollToRatio(ratio, immediate = false) {
-    applyScrollToRatio(ratio, immediate, ratioToIndex(ratio));
-}
-
-function onTimelineWheel(e) {
-    if (Math.abs(e.deltaX) > Math.abs(e.deltaY)) {
-        e.preventDefault();
-    }
-}
-
-watch(
-    [activeIndex, colCount],
-    () => {
-        handleRatio.value = indexToRatio(activeIndex.value);
-        nextTick(() => {
-            scrollToCenterRatio(
-                indexToRatio(activeIndex.value),
-                "smooth",
-                activeIndex.value
-            );
-            clampTooltipToScrollArea();
-        });
-    },
-    { immediate: true }
-);
-
-watch(showHandleTooltip, (v) => {
-    if (v) clampTooltipToScrollArea();
-});
-
-watch(
-    () => handleRatio.value,
-    () => {
-        if (showHandleTooltip.value) clampTooltipToScrollArea();
-    }
-);
-
-let resizeObserver = null;
-
-const handleStyle = computed(() => ({
-    left: `${handleRatio.value * 100}%`,
-}));
-
-const tooltipBubbleStyle = computed(() => ({
-    transform: `translateX(${tooltipShiftPx.value}px)`,
-}));
-
-/**
- * 以滚动可视区为边界,将气泡水平平移最小距离使其完整可见;箭头留在手柄中心(见模板结构)。
- */
-function clampTooltipToScrollArea() {
-    if (!showHandleTooltip.value) return;
-    const scrollEl = scrollRef.value;
-    const bubbleEl = tooltipBubbleRef.value;
-    if (!scrollEl || !bubbleEl) return;
-
-    tooltipShiftPx.value = 0;
-    nextTick(() => {
-        requestAnimationFrame(() => {
-            const b = scrollEl.getBoundingClientRect();
-            const t = bubbleEl.getBoundingClientRect();
-            const pad = TOOLTIP_EDGE_MARGIN_PX;
-            const sLow = b.left + pad - t.left;
-            const sHigh = b.right - pad - t.right;
-            let s = 0;
-            if (sLow <= sHigh) {
-                if (sLow <= 0 && sHigh >= 0) s = 0;
-                else if (sLow > 0) s = sLow;
-                else s = sHigh;
-            } else {
-                s = (sLow + sHigh) / 2;
-            }
-            tooltipShiftPx.value = s;
-        });
-    });
-}
-
-let dragging = false;
-let activePointerId = null;
-/** 本次按下后是否发生过 pointermove(视为“移动过”) */
-let movedDuringHandleDrag = false;
-
-function getTrackRect() {
-    return trackRef.value?.getBoundingClientRect() || null;
-}
-
-function clientXToRatio(clientX) {
-    const rect = getTrackRect();
-    if (!rect || rect.width <= 0) return handleRatio.value;
-    const x = clientX - rect.left;
-    const r = x / rect.width;
-    return Math.min(Math.max(0, r), 1);
-}
-
-function onHandlePointerDown(e) {
-    if (!trackRef.value) return;
-    dragging = true;
-    movedDuringHandleDrag = false;
-    activePointerId = e.pointerId;
-    try {
-        handleRef.value?.setPointerCapture(e.pointerId);
-    } catch (_) {
-        /* ignore */
-    }
-    handleRatio.value = clientXToRatio(e.clientX);
-    syncScrollToRatio(handleRatio.value);
-    document.body.style.userSelect = "none";
-}
-
-function onPointerMove(e) {
-    if (!dragging || e.pointerId !== activePointerId) return;
-    movedDuringHandleDrag = true;
-    handleRatio.value = clientXToRatio(e.clientX);
-    syncScrollToRatio(handleRatio.value);
-    if (showHandleTooltip.value) clampTooltipToScrollArea();
-}
-
-function onPointerUp(e) {
-    if (!dragging || e.pointerId !== activePointerId) return;
-    dragging = false;
-    activePointerId = null;
-    document.body.style.userSelect = "";
-    try {
-        handleRef.value?.releasePointerCapture(e.pointerId);
-    } catch (_) {
-        /* ignore */
-    }
-    const nextIdx = ratioToIndex(handleRatio.value);
-    activeIndex.value = nextIdx;
-    handleRatio.value = indexToRatio(nextIdx);
-    syncScrollToRatio(handleRatio.value);
-    if (movedDuringHandleDrag) {
-        showHandleTooltip.value = false;
-    }
-    movedDuringHandleDrag = false;
-    emit("update:modelValue", nextIdx);
-    armScrollSettledAfterHandle();
-}
-
-/** 手柄松开后待「横向滚动结束」再向父组件派发 change / scrollSettled */
-let pendingScrollSettled = false;
-let scrollSettledFallbackTimer = null;
-let scrollSettledDebounceTimer = null;
-
-function clearScrollSettledTimers() {
-    if (scrollSettledFallbackTimer != null) {
-        clearTimeout(scrollSettledFallbackTimer);
-        scrollSettledFallbackTimer = null;
-    }
-    if (scrollSettledDebounceTimer != null) {
-        clearTimeout(scrollSettledDebounceTimer);
-        scrollSettledDebounceTimer = null;
-    }
-}
-
-function emitScrollSettledIfPending() {
-    if (!pendingScrollSettled) return;
-    pendingScrollSettled = false;
-    clearScrollSettledTimers();
-    const idx = activeIndex.value;
-    const stage = normalizedStages.value[idx];
-    const phenophaseCode = stage?.phenophase_code;
-    emit("change", idx, stage, phenophaseCode);
-    emit("scrollSettled", idx, stage, phenophaseCode);
-}
-
-function armScrollSettledAfterHandle() {
-    pendingScrollSettled = true;
-    clearScrollSettledTimers();
-    scrollSettledFallbackTimer = setTimeout(() => {
-        scrollSettledFallbackTimer = null;
-        emitScrollSettledIfPending();
-    }, 200);
-}
-
-function onScrollAreaScroll() {
-    if (showHandleTooltip.value) clampTooltipToScrollArea();
-    if (!pendingScrollSettled) return;
-    if (scrollSettledDebounceTimer != null) {
-        clearTimeout(scrollSettledDebounceTimer);
-    }
-    scrollSettledDebounceTimer = setTimeout(() => {
-        scrollSettledDebounceTimer = null;
-        emitScrollSettledIfPending();
-    }, 80);
-}
-
-function onScrollAreaScrollEnd() {
-    emitScrollSettledIfPending();
-}
-
-function onWindowResize() {
-    if (showHandleTooltip.value) clampTooltipToScrollArea();
-}
-
-onMounted(() => {
-    window.addEventListener("pointermove", onPointerMove);
-    window.addEventListener("pointerup", onPointerUp);
-    window.addEventListener("pointercancel", onPointerUp);
-    window.addEventListener("resize", onWindowResize);
-    const el = scrollRef.value;
-    el?.addEventListener("scroll", onScrollAreaScroll, { passive: true });
-    el?.addEventListener("scrollend", onScrollAreaScrollEnd, { passive: true });
-    el?.addEventListener("wheel", onTimelineWheel, { passive: false });
-    nextTick(() => clampTooltipToScrollArea());
-    el?.addEventListener("touchstart", onScrollAreaTouchStart, {
-        passive: true,
-    });
-    el?.addEventListener("touchmove", onScrollAreaTouchMove, {
-        passive: false,
-    });
-    resizeObserver =
-        typeof ResizeObserver !== "undefined"
-            ? new ResizeObserver(() => {
-                  nextTick(() => {
-                      scrollToCenterRatio(
-                          indexToRatio(activeIndex.value),
-                          "auto",
-                          activeIndex.value
-                      );
-                      clampTooltipToScrollArea();
-                  });
-              })
-            : null;
-    if (el && resizeObserver) {
-        resizeObserver.observe(el);
-    }
-});
-
-onBeforeUnmount(() => {
-    window.removeEventListener("pointermove", onPointerMove);
-    window.removeEventListener("pointerup", onPointerUp);
-    window.removeEventListener("pointercancel", onPointerUp);
-    window.removeEventListener("resize", onWindowResize);
-    const el = scrollRef.value;
-    el?.removeEventListener("scroll", onScrollAreaScroll);
-    el?.removeEventListener("scrollend", onScrollAreaScrollEnd);
-    el?.removeEventListener("wheel", onTimelineWheel);
-    el?.removeEventListener("touchstart", onScrollAreaTouchStart);
-    el?.removeEventListener("touchmove", onScrollAreaTouchMove);
-    resizeObserver?.disconnect();
-    resizeObserver = null;
-    cancelScrollAnimation();
-    clearScrollSettledTimers();
-    pendingScrollSettled = false;
-});
-</script>
-
-<style scoped lang="scss">
-.growth-stage-timeline {
-    width: 100%;
-    overflow: hidden;
-}
-
-.growth-stage-timeline__scroll {
-    overflow-x: hidden;
-    overflow-y: visible;
-    touch-action: pan-y;
-    overscroll-behavior-x: none;
-    -webkit-overflow-scrolling: touch;
-}
-
-.growth-stage-timeline__inner {
-    display: flex;
-    flex-direction: column;
-    gap: 0;
-    padding-top: 36px;
-    padding-bottom: 8px;
-    width: 100%;
-}
-
-.growth-stage-timeline__bg {
-    display: grid;
-    align-items: stretch;
-    width: 100%;
-    margin-top: 8px;
-    gap: 0;
-}
-
-.growth-stage-timeline__bg-cell {
-    background: #f5f5f5;
-    padding: 12px 8px;
-    text-align: left;
-    box-sizing: border-box;
-    border: none;
-    border-top: 1px solid #d9d9d9;
-    border-radius: 8px;
-    min-width: 0;
-    margin: 0 2px;
-    transition: background-color 0.2s, border-color 0.2s;
-
-    &:first-child {
-        margin-left: 0;
-    }
-
-    &:last-child {
-        margin-right: 0;
-    }
-
-    &--period {
-        display: flex;
-        flex-direction: column;
-        align-items: flex-start;
-        justify-content: flex-start;
-        gap: 3px;
-    }
-
-    &--active {
-        background: #e6f4ff;
-        border-top-width: 3px;
-        border-top-color: #1890ff;
-
-        .growth-stage-timeline__period-title {
-            color: #1d2129;
-            font-weight: 600;
-        }
-
-        .growth-stage-timeline__period-sub {
-            color: #666;
-        }
-    }
-
-    &:not(&--active) {
-        .growth-stage-timeline__period-title {
-            color: #8c8c8c;
-            font-weight: 500;
-        }
-
-        .growth-stage-timeline__period-sub {
-            color: #bfbfbf;
-        }
-    }
-}
-
-.growth-stage-timeline__period-title {
-    font-size: 15px;
-    font-weight: 600;
-    color: #1d2129;
-    text-align: left;
-    max-width: 100%;
-    word-break: break-word;
-}
-
-.growth-stage-timeline__period-sub {
-    font-size: 12px;
-    color: #666;
-    text-align: left;
-    max-width: 100%;
-    word-break: break-word;
-    white-space: normal;
-}
-
-.growth-stage-timeline__track {
-    position: relative;
-    min-height: 48px;
-}
-
-.growth-stage-timeline__track-line {
-    position: absolute;
-    left: 0;
-    right: 0;
-    top: 50%;
-    height: 1px;
-    margin-top: -0.5px;
-    background: #e8e8e8;
-    pointer-events: none;
-    z-index: 0;
-}
-
-.growth-stage-timeline__track-grid {
-    position: relative;
-    z-index: 1;
-    display: grid;
-    align-items: center;
-    min-height: 48px;
-    width: 100%;
-}
-
-.growth-stage-timeline__dot-wrap {
-    position: relative;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    pointer-events: none;
-}
-
-.growth-stage-timeline__dot {
-    width: 10px;
-    height: 10px;
-    border-radius: 50%;
-    background: #CDCDCD;
-    border: 1px solid #fff;
-    box-sizing: border-box;
-    box-shadow: 0px 2px 3px 0px #00000012;
-
-}
-
-.growth-stage-timeline__handle {
-    position: absolute;
-    top: 50%;
-    z-index: 2;
-    transform: translate(-50%, -50%);
-    touch-action: none;
-    cursor: grab;
-
-    &:active {
-        cursor: grabbing;
-    }
-}
-
-.growth-stage-timeline__handle-core {
-    position: relative;
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-}
-
-.growth-stage-timeline__tooltip-wrap {
-    position: absolute;
-    left: 50%;
-    bottom: 100%;
-    transform: translateX(-50%);
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    margin-bottom: 8px;
-    pointer-events: none;
-    z-index: 3;
-}
-
-.growth-stage-timeline__tooltip {
-    max-width: min(240px, calc(100vw - 24px));
-    white-space: nowrap;
-    padding: 6px 12px;
-    border-radius: 999px;
-    background: #8c8c8c;
-    color: #fff;
-    font-size: 11px;
-    line-height: 1.4;
-    text-align: center;
-}
-
-.growth-stage-timeline__tooltip-caret {
-    width: 0;
-    height: 0;
-    margin-top: -1px;
-    border-width: 5px 5px 0 5px;
-    border-style: solid;
-    border-color: #8c8c8c transparent transparent transparent;
-}
-
-.growth-stage-timeline__handle-body {
-    display: flex;
-    flex-direction: row;
-    align-items: center;
-    justify-content: center;
-    gap: 2px;
-    width: 16px;
-    height: 30px;
-    border-radius: 7px;
-    background: #1890ff;
-    box-shadow: 0 2px 6px rgba(24, 144, 255, 0.35);
-    transition: width 0.2s;
-
-    &--wide {
-        width: 48px;
-        gap: 4px;
-        border-radius: 10px;
-    }
-}
-
-.growth-stage-timeline__handle-bar {
-    display: block;
-    width: 2px;
-    height: 10px;
-    border-radius: 1px;
-    background: #fff;
-}
-
-.growth-stage-timeline__labels {
-    display: grid;
-    margin-top: 2px;
-    gap: 0;
-    width: 100%;
-}
-
-.growth-stage-timeline__label-col {
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    text-align: center;
-    padding: 0 4px 4px;
-    box-sizing: border-box;
-    min-width: 0;
-
-    &--wide {
-        .growth-stage-timeline__label-text {
-            max-width: 100%;
-            white-space: nowrap;
-        }
-    }
-}
-
-.growth-stage-timeline__label-text {
-    font-size: 11px;
-    color: #bfbfbf;
-    width: max-content;
-    word-break: break-all;
-    transition: color 0.2s, font-size 0.2s;
-
-    &--active {
-        font-size: 14px;
-        color: #1890ff;
-        font-weight: 600;
-    }
-}
-
-.growth-stage-timeline__tags {
-    margin-top: 6px;
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    gap: 4px;
-    width: 100%;
-}
-
-.growth-stage-timeline__tag {
-    display: inline-block;
-    max-width: 100%;
-    padding: 2px 6px;
-    border-radius: 4px;
-    background: #00a870;
-    color: #fff;
-    font-size: 10px;
-    line-height: 1.3;
-    word-break: break-all;
-}
-</style>

+ 0 - 158
src/components/pageComponents/PhenologyTrackTimelineItem copy.vue

@@ -1,158 +0,0 @@
-<template>
-    <template v-if="imageList.length">
-        <div class="phenology-track-item" v-for="item in imageList" :key="item.id">
-            <div class="track-axis">
-                <span class="track-date-side">{{ item?.latest_time?.slice(5, 10) }}</span>
-                <div class="track-line-wrap">
-                    <span class="track-dot"></span>
-                    <div class="track-line"></div>
-                </div>
-            </div>
-            <div class="track-card">
-                <div class="track-card-inner">
-                    <span class="track-badge">{{ item?.latest_time?.slice(5, 10) }}</span>
-                    <span class="track-content">{{ item.zone_name }}</span>
-                </div>
-                <div class="track-images">
-                    <img v-for="(src, i) in item.images" :key="i" class="track-thumb" :src="src.cloud_url" alt="" />
-                </div>
-            </div>
-        </div>
-    </template>
-    <div v-else-if="dataLoaded" class="track-empty">{{ t('agriFile.noData') }}</div>
-</template>
-
-<script setup>
-import { onActivated, ref } from "vue";
-import { useI18n } from "@/i18n";
-
-const { t } = useI18n();
-
-const props = defineProps({
-    abnormalType: {
-        type: [String, Number],
-        default: 1,
-    },
-});
-
-const imageList = ref([]);
-const dataLoaded = ref(false);
-
-const getFarmImages = async () => {
-    const farmData = JSON.parse(localStorage.getItem('selectedFarmData'));
-    const params = {
-        farm_id: farmData.farm_id,
-        variety_code: farmData.farm_variety,
-        abnormal_type: props.abnormalType,
-        record_id: 21,
-    };
-    try {
-        const res = await VE_API.record.farmImages(params);
-        if (res.code === 200) {
-            imageList.value = res.data.zones || [];
-        }
-    } finally {
-        dataLoaded.value = true;
-    }
-};
-
-onActivated(() => {
-    getFarmImages();
-});
-
-defineExpose({
-    refresh: getFarmImages,
-});
-</script>
-
-<style scoped lang="scss">
-.track-empty {
-    padding: 24px 0;
-    text-align: center;
-    font-size: 14px;
-    color: rgba(60, 60, 60, 0.45);
-}
-
-/* Grid:左侧时间轴整列与右侧卡片等高,竖线随卡片高度自适应 */
-.phenology-track-item {
-    display: grid;
-    grid-template-columns: auto 1fr;
-    gap: 10px;
-    align-items: stretch;
-
-    .track-axis {
-        display: flex;
-        flex-direction: column;
-
-        .track-date-side {
-            color: #7e7e7e;
-        }
-
-        .track-line-wrap {
-            display: flex;
-            flex: 1;
-            flex-direction: column;
-            align-items: center;
-            margin-top: 3px;
-
-            .track-dot {
-                width: 6px;
-                height: 6px;
-                border-radius: 50%;
-                background: rgba(29, 33, 41, 0.2);
-                z-index: 1;
-            }
-
-            .track-line {
-                flex: 1;
-                margin-top: 2px;
-                border-left: 1px dashed rgba(29, 33, 41, 0.2);
-            }
-        }
-    }
-
-    .track-card {
-        flex: 1;
-        padding: 10px;
-        border-radius: 6px;
-        background: #f5f5f5;
-
-        .track-card-inner {
-            display: flex;
-            align-items: center;
-            gap: 8px;
-            padding: 5px 8px;
-            border-radius: 5px;
-            background: #ffffff;
-
-            .track-badge {
-                padding: 2px 4px;
-                border-radius: 2px;
-                font-size: 13px;
-                color: #ffffff;
-                background: #2199f8;
-                min-width: 42px;
-                box-sizing: border-box;
-            }
-
-            .track-content {
-                color: rgba(60, 60, 60, 0.5);
-            }
-        }
-
-        .track-images {
-            display: flex;
-            flex-wrap: wrap;
-            gap: 12px;
-            margin-top: 10px;
-
-            .track-thumb {
-                width: 56px;
-                height: 56px;
-                border-radius: 8px;
-                object-fit: cover;
-            }
-        }
-    }
-}
-</style>

+ 0 - 187
src/components/pageComponents/TabList.vue

@@ -1,187 +0,0 @@
-<template>
-    <div
-        class="tabs-container"
-        :class="[`tabs-type-${type}`, { 'tabs-small': tabs.length <= 2 }]"
-        ref="tabsContainerRef"
-    >
-        <div 
-            v-for="(tab, index) in tabs" 
-            :key="index"
-            class="tab-item"
-            :class="{ active: isActive(index, tab) }"
-            @click="handleTabClick(index, tab)"
-        >
-            {{ getTabTitle(tab) }}
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { ref, watch, nextTick } from "vue";
-
-const props = defineProps({
-    tabs: {
-        type: Array,
-        required: true,
-        default: () => [],
-    },
-    modelValue: {
-        type: [Number, String],
-        default: 0,
-    },
-    type: {
-        type: String,
-        default: "default", // 'default' | 'light'
-        validator: (value) => ["default", "light"].includes(value),
-    },
-    // 控制滚动方向:'left' | 'right' | 'auto' | ''
-    scrollType: {
-        type: String,
-        default: "",
-    },
-});
-
-const emit = defineEmits(["update:modelValue", "change"]);
-
-const tabsContainerRef = ref(null);
-
-// 判断是否为对象格式的 tab
-const isObjectTab = (tab) => {
-    return (
-        typeof tab === "object" &&
-        tab !== null &&
-        (tab.title !== undefined || tab.label !== undefined || tab.name !== undefined)
-    );
-};
-
-// 获取 tab 的标题
-const getTabTitle = (tab) => {
-    if (isObjectTab(tab)) {
-        return tab.title || tab.label || tab.name || "";
-    }
-    return tab;
-};
-
-// 判断当前 tab 是否激活
-const isActive = (index, tab) => {
-    if (isObjectTab(tab)) {
-        // 对象格式:比较 value 或 id
-        if (tab.value) {
-            return props.modelValue === tab.value;
-        } else {
-            return props.modelValue === tab.id;
-        }
-    }
-    // 字符串/简单格式:比较索引
-    return props.modelValue === index;
-};
-
-const handleTabClick = (index, tab) => {
-    if (isObjectTab(tab)) {
-        // 对象格式:传递 value
-        emit("update:modelValue", tab.value);
-        emit("change", tab.value || tab.id, tab, index);
-    } else {
-        // 字符串/简单格式:传递索引
-        emit("update:modelValue", index);
-        emit("change", index, tab);
-    }
-};
-
-// 根据 scrollType 控制滚动:left -> 最左边;right -> 最右边;auto/空 -> 不动
-const scrollByType = (type) => {
-    const wrap = tabsContainerRef.value;
-    if (!wrap) return;
-
-    if (type === "left") {
-        wrap.scrollTo({
-            left: 0,
-            behavior: "smooth",
-        });
-        return;
-    }
-
-    if (type === "right") {
-        wrap.scrollTo({
-            left: wrap.scrollWidth,
-            behavior: "smooth",
-        });
-    }
-};
-
-watch(
-    () => props.scrollType,
-    (val) => {
-        if (!val || val === "auto") return;
-        nextTick(() => {
-            scrollByType(val);
-        });
-    }
-);
-</script>
-
-<style scoped lang="scss">
-.tabs-container {
-    display: flex;
-    align-items: center;
-    gap: 8px;
-    overflow-x: auto;
-    overflow-y: hidden;
-    -webkit-overflow-scrolling: touch;
-    scrollbar-width: none; /* Firefox */
-    -ms-overflow-style: none; /* IE and Edge */
-    
-    &::-webkit-scrollbar {
-        display: none; /* Chrome, Safari, Opera */
-    }
-    
-    .tab-item {
-        border-radius: 20px;
-        text-align: center;
-        white-space: nowrap;
-        flex-shrink: 0;
-    }
-    
-    // 标签数量 <= 2 时的样式
-    &.tabs-small {
-        gap: 8px;
-        
-        .tab-item {
-            padding: 4px 8px;
-        }
-    }
-    
-    // 默认样式
-    &.tabs-type-default {
-        justify-content: center;
-        background: #fff;
-        padding: 5px 0;
-        .tab-item {
-            padding: 4px 12px;
-            color: rgba(0, 0, 0, 0.5);
-            border: 1px solid transparent;
-            
-            &.active {
-                background: rgba(33, 153, 248, 0.1);
-                color: #2199F8;
-                border: 1px solid #2199F8;
-            }
-        }
-    }
-    
-    // 浅色样式(激活:浅蓝色背景+深蓝色文字,未激活:浅灰色背景+中灰色文字)
-    &.tabs-type-light {
-        .tab-item {
-            background: #F7F8FA;
-            color: #8B8B8B;
-            padding: 4px 12px;
-            
-            &.active {
-                background: rgba(33, 153, 248, 0.1);
-                color: #2199F8;
-            }
-        }
-    }
-}
-</style>
-

+ 30 - 19
src/components/pageComponents/locationSearch.vue

@@ -16,8 +16,7 @@
 <script setup>
 import { ref, reactive } from "vue";
 import { transformFromGCJToWGS } from "@/utils/WSCoordinate.js";
-
-const MAP_KEY = "CZLBZ-LJICQ-R4A5J-BN62X-YXCRJ-GNBUT";
+import { fetchPlaceSuggestion } from "@/utils/tiandituLocation";
 
 const props = defineProps({
     userLocation: {
@@ -42,26 +41,29 @@ const remoteMethod = async (keyword) => {
     if (keyword) {
         locationOptions.list = [];
         loading.value = true;
-        const params = {
-            key: MAP_KEY,
-            keyword,
-            location: props.userLocation,
-        };
-        await VE_API.old_mini_map.getCtiyList({ word: keyword }).then(({ data }) => {
-            if (data && data.length) {
-                data.forEach((item) => {
-                    item.point = item.location.lat + "," + item.location.lng;
-                    locationOptions.list.push(item);
-                });
-            }
-        });
-        VE_API.old_mini_map.search(params).then(({ data }) => {
-            loading.value = false;
+        try {
+            await VE_API.old_mini_map.getCtiyList({ word: keyword }).then(({ data }) => {
+                if (data && data.length) {
+                    data.forEach((item) => {
+                        // 后端城市库历史数据按 GCJ-02
+                        item.coordSys = "gcj02";
+                        item.point = item.location.lat + "," + item.location.lng;
+                        locationOptions.list.push(item);
+                    });
+                }
+            });
+        } catch {
+            // 城市列表失败不影响天地图地点搜索
+        }
+        try {
+            const { data } = await fetchPlaceSuggestion(keyword, props.userLocation);
             data.forEach((item) => {
                 item.point = item.location.lat + "," + item.location.lng;
                 locationOptions.list.push(item);
             });
-        });
+        } finally {
+            loading.value = false;
+        }
     } else {
         locationOptions.list = [];
     }
@@ -70,7 +72,16 @@ const remoteMethod = async (keyword) => {
 const handleSearchRes = (v) => {
     if (!v) return;
     const parts = v.value.split(",");
-    let { latitude, longitude } = transformFromGCJToWGS(parseFloat(parts[0]), parseFloat(parts[1]));
+    const lat0 = parseFloat(parts[0]);
+    const lng0 = parseFloat(parts[1]);
+    // 天地图为 WGS84;后端城市列表仍为 GCJ-02,需转换
+    let latitude = lat0;
+    let longitude = lng0;
+    if (v.item?.coordSys === "gcj02") {
+        const wgs = transformFromGCJToWGS(lat0, lng0);
+        latitude = wgs.latitude;
+        longitude = wgs.longitude;
+    }
     const coordinateArray = [longitude, latitude];
 
     emit("change", {

+ 0 - 426
src/components/popup/UploadProgressPopup.vue

@@ -1,426 +0,0 @@
-<template>
-    <popup :show="show" round :close-on-click-overlay="false" class="upload-progress-popup"
-        @update:show="emit('update:show', $event)">
-        <slot name="header"></slot>
-        <div class="upload-box">
-            <div class="box-header">
-                <div class="upload-title">
-                    <span>{{ t('uploadPopup.uploadPhotos') }}</span>
-                    <span v-if="!uploadRequired" class="optional">{{ t('uploadPopup.optional') }}</span>
-                </div>
-            </div>
-            <uploader class="popup-uploader" :class="{ 'popup-uploader-identify': enableIdentify }" v-model="fileList"
-                multiple :max-count="10" :after-read="afterReadUpload"
-                :preview-full-image="!enableIdentify" @delete="onDeleteUpload" @click-preview="openIdentifyPreview">
-                <template v-if="enableIdentify" #preview-cover="previewItem">
-                    <div v-if="previewItem?.identifyStatus" class="identify-preview-cover"
-                        :class="{ 'is-done': previewItem.identifyStatus === 'done' }">
-                        <div class="identify-status-bar"
-                            @click.stop="previewItem.identifyStatus === 'done' && openIdentifyPreview(previewItem)">
-                            <template v-if="previewItem.identifyStatus === 'identifying'">
-                                <span class="identify-status-text">{{ t('正在识别中..') }}</span>
-                            </template>
-                            <template v-else-if="previewItem.identifyStatus === 'done'">
-                                <el-icon class="identify-done-icon" :size="14">
-                                    <CircleCheck />
-                                </el-icon>
-                                <span class="identify-status-text">{{ t('识别完成') }}</span>
-                                <el-icon class="identify-arrow-icon" :size="12">
-                                    <ArrowRight />
-                                </el-icon>
-                            </template>
-                            <template v-else-if="previewItem.identifyStatus === 'failed'">
-                                <span class="identify-status-text">{{ t('识别失败') }}</span>
-                            </template>
-                        </div>
-                    </div>
-                </template>
-                <img class="plus" src="@/assets/img/home/plus.png" alt="">
-            </uploader>
-        </div>
-        <slot name="footer"></slot>
-        <div class="upload-action-btns">
-            <div class="cancel-btn" @click="emit('cancel')">{{ t('取消') }}</div>
-            <div class="confirm-btn" @click="handleConfirm">{{ confirmText }}</div>
-        </div>
-    </popup>
-
-    <ImagePreviewPopup v-if="enableIdentify" v-model:show="showIdentifyPreview" :images="identifyPreviewImages">
-        <template #footer>
-            <div class="identify-result-panel" v-if="previewResult">
-                <div class="result-header">
-                    <span class="accent-bar"></span>
-                    <span class="result-name">{{ t('病虫名称:') }}{{ getIdentifyField(previewResult, ['disease_name', 'name', 'pest_name']) }}</span>
-                </div>
-                <div class="result-content">{{ getIdentifyField(previewResult, ['kepu', 'harm', 'harm_desc', 'phenotype', 'phenotypic_characteristics']) }}</div>
-            </div>
-        </template>
-    </ImagePreviewPopup>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { ref, computed, watch } from 'vue';
-import { Popup, Uploader } from 'vant';
-import { ElMessage } from 'element-plus';
-import { CircleCheck, ArrowRight } from '@element-plus/icons-vue';
-import ImagePreviewPopup from '@/components/popup/ImagePreviewPopup.vue';
-import UploadFile from "@/utils/upliadFile";
-import 'vant/lib/uploader/style';
-import { getFileExt } from "@/utils/util";
-import { base_img_url2 } from '@/api/config';
-
-const props = defineProps({
-    show: {
-        type: Boolean,
-        default: false,
-    },
-    initImgArr: {
-        type: Array,
-        default: () => [],
-    },
-    confirmText: {
-        type: String,
-        default: '确认信息',
-    },
-    /** 是否必传图片,默认必传 */
-    uploadRequired: {
-        type: Boolean,
-        default: true,
-    },
-    /** 是否开启上传后 AI 病虫识别(物候上传等场景关闭) */
-    enableIdentify: {
-        type: Boolean,
-        default: false,
-    },
-});
-
-const emit = defineEmits(['update:show', 'cancel', 'confirm', 'reset']);
-
-const fileList = ref([]);
-const popupInnerImgArr = ref([]);
-/** 用户已上传/删除过图片后,以 popupInnerImgArr 为准,不再回退 props.initImgArr */
-const imgTouched = ref(false);
-const uploadFileObj = new UploadFile();
-const miniUserId = localStorage.getItem("MINI_USER_ID");
-
-const showIdentifyPreview = ref(false);
-const previewImageUrl = ref('');
-const previewResult = ref(null);
-
-const identifyPreviewImages = computed(() => (
-    previewImageUrl.value ? [previewImageUrl.value] : []
-));
-
-function getIdentifyField(result, fields) {
-    for (const field of fields) {
-        const value = result?.[field];
-        if (value !== undefined && value !== null && value !== '') {
-            return value;
-        }
-    }
-    return '-';
-}
-
-function getConfirmImgArr() {
-    if (imgTouched.value || popupInnerImgArr.value.length) {
-        return popupInnerImgArr.value.map((item) => base_img_url2 + item);
-    }
-    return [...(props.initImgArr || [])];
-}
-
-function onDeleteUpload(_file, detail) {
-    imgTouched.value = true;
-    popupInnerImgArr.value.splice(detail.index, 1);
-}
-
-const afterReadUpload = async (data) => {
-    if (!Array.isArray(data)) {
-        data = [data];
-    }
-    for (const file of data) {
-        const fileVal = file.file;
-        file.status = "uploading";
-        file.message = "上传中...";
-        const ext = getFileExt(fileVal.name);
-        const key = `birdseye-look-mini/${miniUserId}/${new Date().getTime()}.${ext}`;
-        const resFilename = await uploadFileObj.put(key, fileVal);
-        if (resFilename) {
-            file.status = "done";
-            file.message = "";
-            file.resFilename = resFilename;
-            file.url = base_img_url2 + resFilename;
-            imgTouched.value = true;
-            popupInnerImgArr.value.push(resFilename);
-            if (props.enableIdentify) {
-                file.identifyStatus = 'identifying';
-                identifySingleImage(file, resFilename);
-            }
-        } else {
-            file.status = "failed";
-            file.message = "上传失败";
-            ElMessage.error("图片上传失败,请稍后再试!");
-        }
-    }
-};
-
-function patchFileItem(resFilename, patch) {
-    let index = fileList.value.findIndex((item) => item.resFilename === resFilename);
-    if (index === -1) {
-        index = fileList.value.findIndex((item) => item.url?.includes(resFilename));
-    }
-    if (index === -1) return;
-    Object.assign(fileList.value[index], patch);
-}
-
-async function identifySingleImage(file, resFilename) {
-    let farmData = {};
-    try {
-        farmData = JSON.parse(localStorage.getItem('selectedFarmData') || '{}');
-    } catch {
-        farmData = {};
-    }
-    const params = {
-        image_urls: [base_img_url2 + resFilename],
-        crop_type: farmData.farm_variety,
-    };
-    try {
-        const res = await VE_API.record.batchPestIdentify(params);
-        if (res.code === 200 && res.results?.length) {
-            const patch = { identifyStatus: 'done', identifyResult: res.results[0] };
-            Object.assign(file, patch);
-            patchFileItem(resFilename, patch);
-        } else {
-            const patch = { identifyStatus: 'failed' };
-            Object.assign(file, patch);
-            patchFileItem(resFilename, patch);
-            ElMessage.error(t('AI识别失败,请稍后再试!'));
-        }
-    } catch {
-        const patch = { identifyStatus: 'failed' };
-        Object.assign(file, patch);
-        patchFileItem(resFilename, patch);
-        ElMessage.error(t('AI识别失败,请稍后再试!'));
-    }
-}
-
-function openIdentifyPreview(file) {
-    previewImageUrl.value = file.url || base_img_url2 + (file.resFilename || '');
-    previewResult.value = file.identifyResult || null;
-    showIdentifyPreview.value = true;
-}
-
-function handleConfirm() {
-    const imgArr = getConfirmImgArr();
-    if (props.uploadRequired && !imgArr.length) {
-        ElMessage.warning(t('请先上传照片'));
-        return;
-    }
-    emit('confirm', imgArr);
-}
-
-function uploadReset() {
-    fileList.value = [];
-    popupInnerImgArr.value = [];
-    imgTouched.value = false;
-    showIdentifyPreview.value = false;
-    previewImageUrl.value = '';
-    previewResult.value = null;
-}
-
-watch(
-    () => props.initImgArr,
-    (val) => {
-        if (imgTouched.value || !val?.length) {
-            return;
-        }
-        fileList.value = val.map((item) => ({
-            url: base_img_url2 + item,
-            isImage: true,
-            resFilename: item,
-        }));
-        popupInnerImgArr.value = [...val];
-    },
-    { immediate: true, deep: true },
-);
-
-watch(
-    () => props.show,
-    (val) => {
-        if (val) {
-            uploadReset();
-            emit('reset');
-        }
-    },
-);
-
-defineExpose({
-    uploadReset,
-});
-</script>
-
-<style scoped lang="scss">
-.upload-progress-popup {
-    width: 100%;
-    padding: 24px 16px;
-    background: linear-gradient(360deg, #FFFFFF 74.2%, #D1EBFF 100%);
-
-    .upload-box {
-        margin-bottom: 12px;
-        position: relative;
-        min-height: 88px;
-
-        .box-header {
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
-            margin-bottom: 12px;
-
-            .upload-title {
-                font-size: 16px;
-
-                .optional {
-                    font-size: 12px;
-                    color: rgba(18, 18, 18, 0.2);
-                }
-            }
-        }
-
-        .popup-uploader {
-            .plus {
-                width: calc((100vw - 68px) / 4);
-                height: calc((100vw - 68px) / 4);
-            }
-
-            ::v-deep {
-                .van-uploader__wrapper {
-                    --van-uploader-size: 76.7px;
-                    --van-padding-xs: 6px;
-                }
-            }
-
-            &.popup-uploader-identify {
-                ::v-deep {
-                    .van-uploader__preview-cover {
-                        position: absolute;
-                        left: 0;
-                        right: 0;
-                        top: 0;
-                        bottom: 0;
-                        height: 100%;
-                        pointer-events: none;
-                    }
-
-                    .van-uploader__preview-delete {
-                        z-index: 3;
-                    }
-                }
-            }
-        }
-
-        .identify-preview-cover {
-            display: flex;
-            flex-direction: column;
-            justify-content: flex-end;
-            width: 100%;
-            height: 100%;
-            position: relative;
-        }
-
-        .identify-status-bar {
-            pointer-events: auto;
-            display: flex;
-            align-items: center;
-            justify-content: flex-start;
-            gap: 4px;
-            width: 100%;
-            padding: 4px 6px;
-            box-sizing: border-box;
-            background: rgba(0, 0, 0, 0.55);
-            color: #fff;
-            font-size: 11px;
-            text-align: center;
-
-
-            .identify-status-text {
-                flex: 1;
-                overflow: hidden;
-                text-overflow: ellipsis;
-                white-space: nowrap;
-            }
-
-            .identify-done-icon {
-                color: #52c41a;
-                flex-shrink: 0;
-            }
-
-            .identify-arrow-icon {
-                flex-shrink: 0;
-                margin-left: auto;
-            }
-        }
-    }
-
-    .upload-action-btns {
-        display: flex;
-        gap: 10px;
-        margin-top: 16px;
-
-        .cancel-btn,
-        .confirm-btn {
-            flex: 1;
-            border-radius: 4px;
-            padding: 8px;
-            text-align: center;
-            font-size: 16px;
-        }
-
-        .cancel-btn {
-            border: 1px solid #dcdfe6;
-            color: #606266;
-            background: #ffffff;
-        }
-
-        .confirm-btn {
-            background: #2199f8;
-            color: #ffffff;
-        }
-    }
-}
-
-.identify-result-panel {
-    padding: 8px 10px;
-    background: rgba(0, 0, 0, 0.4);
-    border-radius: 6px;
-    box-sizing: border-box;
-    margin: 18px 12px;
-
-    .result-header {
-        display: flex;
-        align-items: center;
-        gap: 6px;
-        margin-bottom: 7px;
-
-        .accent-bar {
-            width: 4px;
-            height: 15px;
-            border-radius: 2px;
-            background: #FFD786;
-            flex-shrink: 0;
-        }
-
-        .result-name {
-            color: #FFD786;
-            font-size: 18px;
-            font-weight: 500;
-            line-height: 22px;
-        }
-    }
-
-    .result-content {
-        color: #ffffff;
-        font-size: 13px;
-    }
-}
-</style>

+ 0 - 202
src/components/popup/agriExecutePopup.vue

@@ -1,202 +0,0 @@
-<template>
-    <popup v-model:show="showValue" round class="agri-execute-popup" :z-index="zIndex" teleport="body">
-        <div class="popup-content">
-            <!-- 头部区域 -->
-            <div class="popup-header">
-                <img class="expert-logo" src="@/assets/img/home/bird.png" alt="" />
-                <!-- <img class="expert-logo" :src="popupData?.expertAvatar" alt="" /> -->
-                <div class="expert-info">
-                    <!-- <span>{{ popupData?.expertName || "韦帮稳" }}专家</span> -->
-                    <span>{{ t('飞鸟') }}</span>
-                    <span class="invite-text">{{ t('邀请您进行农情互动') }}</span>
-                </div>
-            </div>
-            <div class="popup-tips">{{ t('为了更好校准您的农事执行时间') }}</div>
-
-
-            <!-- 标题 -->
-            <div class="popup-title">{{ popupData.subjectName }}</div>
-
-            <!-- 异常信息区域 -->
-            <div class="abnormal-info" v-if="popupData.subjectRemark">
-                {{ popupData.subjectRemark }}
-            </div>
-
-            <!-- 图片区域 -->
-            <img :src="popupData.exampleImg" alt="农事执行图片" class="execute-image" />
-
-            <!-- 按钮区域 -->
-            <div class="popup-buttons">
-                <div class="btn-later" @click="handleLater" v-if="popupData.laterBtn">
-                    {{ popupData.laterButtonText || "稍后执行" }}
-                </div>
-                <div class="btn-executed" @click="handleExecuted">
-                    开始采集
-                </div>
-            </div>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { Popup } from "vant";
-import { ref } from "vue";
-import { useRouter } from "vue-router";
-
-const router = useRouter();
-
-const props = defineProps({
-    // 遮罩层z-index
-    zIndex: {
-        type: Number,
-        default: 9999,
-    },
-});
-
-const emit = defineEmits(["later"]);
-
-const showValue = ref(false);
-
-// 稍后执行
-const handleLater = () => {
-    emit("later");
-    emit("update:show", false);
-};
-
-// 我已执行
-const handleExecuted = () => {
-    showValue.value = false;
-    router.push(`/interaction_list?farmId=${farmIdData.value}&regionId=${popupData.value.regionId}&interactionTypeId=${popupData.value.interactionTypeId}`);
-};
-
-const popupData = ref({});
-const farmIdData = ref(null);
-const showPopup = async (farmId) => {
-    farmIdData.value = farmId;
-    const { data } = await VE_API.home.hasUnrepliedTriggeredInteraction({ subjectId: localStorage.getItem("selectedFarmId") });
-    if (data && data.id != null) {
-        popupData.value = data;
-        showValue.value = true;
-        popupData.value.exampleImg = JSON.parse(data.exampleImagesJson)[0];
-    }
-};
-
-// const handleClosePopup = () => {
-//     VE_API.monitor.closeTodayPopup({
-//         interactionId: popupData.value.id,
-//     });
-// }
-
-defineExpose({
-    showPopup,
-});
-
-</script>
-
-<style scoped lang="scss">
-.agri-execute-popup {
-    width: 100%;
-    padding: 16px;
-    border-radius: 12px;
-
-    .popup-content {
-        display: flex;
-        flex-direction: column;
-    }
-
-    .popup-tips {
-        color: #000;
-        font-size: 16px;
-        margin-bottom: 5px;
-    }
-
-    .popup-header {
-        margin-bottom: 5px;
-        display: flex;
-        align-items: center;
-        gap: 6px;
-
-        .expert-logo {
-            width: 22px;
-            height: 22px;
-            border-radius: 50%;
-            object-fit: cover;
-        }
-
-        .expert-info {
-            font-size: 12px;
-            color: #000;
-
-            .invite-text {
-                margin-left: 6px;
-                color: rgba(0, 0, 0, 0.4);
-            }
-        }
-    }
-
-    .popup-title {
-        font-size: 26px;
-        // margin-bottom: 14px;
-        font-family: "PangMenZhengDao";
-        color: #0785E8;
-    }
-
-    .abnormal-info {
-        padding: 12px;
-        color: #2199f8;
-        background: rgba(33, 153, 248, 0.1);
-        padding: 3px 9px 9px;
-        border-radius: 8px;
-        position: relative;
-        margin-top: 15px;
-
-        // 三角形小尖尖
-        &::before {
-            content: "";
-            position: absolute;
-            top: -8px;
-            left: 20px;
-            width: 0;
-            height: 0;
-            border-left: 15px solid transparent;
-            border-right: 2px solid transparent;
-            border-bottom: 8px solid rgba(33, 153, 248, 0.1);
-        }
-    }
-
-    .execute-image {
-        width: 100%;
-        height: 200px;
-        border-radius: 5px;
-        object-fit: cover;
-        margin: 11px 0 13px 0;
-    }
-
-    .popup-buttons {
-        display: flex;
-        gap: 13px;
-
-        .btn-later,
-        .btn-executed {
-            flex: 1;
-            padding: 8px;
-            border-radius: 4px;
-            font-size: 16px;
-            text-align: center;
-        }
-
-        .btn-later {
-            border: 1px solid #d7d7d7;
-            color: #9d9d9d;
-        }
-
-        .btn-executed {
-            background: #2199f8;
-            color: #ffffff;
-            border: 1px solid #2199f8;
-        }
-    }
-}
-</style>

+ 0 - 317
src/components/popup/confirmDrawTypePopup.vue

@@ -1,317 +0,0 @@
-<template>
-    <popup v-model:show="showValue" round class="confirm-draw-type-popup" teleport="body">
-        <div class="popup-title">{{ $t('请确认勾画类型') }}</div>
-        <div class="type-list">
-            <div
-                v-for="item in typeOptions"
-                :key="item.code"
-                class="type-item"
-                :class="{ 'type-item--active': selectedType === item.code }"
-                @click="handleTypeClick(item)"
-            >
-                {{ item.name }}
-            </div>
-        </div>
-
-        <template v-if="selectedType !== 'DORMANCY'">
-            <div class="popup-sub-title">{{ $t('请确认 具体勾画类别') }}</div>
-            <div class="category-list">
-                <div
-                    v-for="(item, index) in currentCategoryOptions"
-                    :key="`${selectedType}-${index}`"
-                    class="category-item"
-                    :class="{ 'category-item--active': selectedCategory === index }"
-                    @click="selectedCategory = index"
-                >
-                    {{ item.regionName || item.problemZoneTypeName }}
-                </div>
-            </div>
-        </template>
-
-        <textarea v-if="selectedType !== 'ABNORMAL'" v-model="remark" class="remark-input" maxlength="200"
-            :placeholder="$t('添加备注')"></textarea>
-
-        <div class="confirm-btn" @click="handleConfirm">{{ $t('确认') }}</div>
-    </popup>
-
-    <!-- 异常问题区:点击确认后弹出的照片上传进度弹窗 -->
-    <popup v-model:show="showUploadProgressPopup" round class="upload-progress-popup" teleport="body">
-        <div class="upload-progress-title">
-            <span>{{ uploadPromptText }}</span>
-            <el-progress class="upload-progress" :percentage="uploadPercentage" :stroke-width="10" :format="format" />
-        </div>
-        <div class="upload-box">
-            <upload
-                ref="abnormalUploadRef"
-                :maxCount="10"
-                :initImgArr="initImgArr"
-                @handleUpload="handleUploadSuccess"
-            />
-        </div>
-        <textarea v-model="remark" class="remark-input" maxlength="200" :placeholder="$t('添加备注')"></textarea>
-        <div class="confirm-btn" :class="{ 'confirm-btn-loading': confirmUploadLoading }" @click="handleConfirmUpload">
-            {{ confirmUploadLoading ? '上传中...' : '确认上传' }}
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { Popup } from "vant";
-import { computed, ref } from "vue";
-import { ElMessage } from "element-plus";
-import upload from "@/components/upload.vue";
-
-const emit = defineEmits(["confirm"]);
-
-const showValue = ref(false);
-
-const typeOptions = ref([])
-const currentCategoryOptions = ref([]);
-const tempCategoryOptions = ref({});
-
-const openPopup = (payload) => {
-    tempCategoryOptions.value = payload;
-    remark.value = payload.remark || "";
-    // remark.value = "";
-    typeOptions.value = payload.regionInfo.problemZoneList;
-
-    if(payload.activeRegionType === 'variety'){
-        currentCategoryOptions.value = payload.regionInfo.regionList;
-    }else{
-        const arr = payload.regionInfo.problemZoneList.filter(item => item.code === payload.activeRegionType);
-        currentCategoryOptions.value = arr[0].children;
-    }
-
-    selectedType.value = payload.activeRegionType;
-    selectedCategory.value = payload.activeVarietyIndex;
-
-    showValue.value = true;
-};
-
-const close = () => {
-    showValue.value = false;
-};
-
-defineExpose({
-    openPopup,
-    close,
-});
-
-
-const selectedType = ref("");
-const selectedCategory = ref(null);
-const remark = ref("");
-
-const handleTypeClick = (item) => {
-    selectedType.value = item.code;
-    if(item.code === 'variety'){
-        currentCategoryOptions.value = tempCategoryOptions.value.regionInfo.regionList;
-    }else{
-        currentCategoryOptions.value = item.children;
-    }
-    selectedCategory.value = 0;
-};
-
-const handleConfirm = () => {
-    if (!selectedType.value || selectedCategory.value == null) {
-        ElMessage.warning("请选择勾画类型和类别");
-        return;
-    }
-
-    const payload = {
-        type: selectedType.value,
-        category: currentCategoryOptions.value[selectedCategory.value],
-        remark: remark.value.trim(),
-    };
-
-    // 异常问题区:先打开上传弹窗,再发出 confirm
-    if (selectedType.value === "ABNORMAL") {
-        pendingConfirmPayload.value = payload;
-        initImgArr.value = [];
-        uploadData.value = [];
-        totalUploadCount.value = 0;
-        uploadedSuccessCount.value = 0;
-        showUploadProgressPopup.value = true;
-        close();
-        return;
-    }
-
-    emit("confirm", payload);
-    close();
-};
-
-// ---------------- 上传进度弹窗逻辑(只用于异常问题区) ----------------
-const showUploadProgressPopup = ref(false);
-const pendingConfirmPayload = ref(null);
-
-const uploadPromptText = computed(() => {
-    const c = pendingConfirmPayload.value?.category;
-    const name = c?.regionName || c?.problemZoneTypeName || c?.name || c?.title || c?.label || "";
-    return name ? `请上传 ${name} 照片` : "请上传照片";
-});
-
-const totalUploadCount = ref(0);
-const uploadedSuccessCount = ref(0);
-const uploadPercentage = computed(() => {
-    if (!totalUploadCount.value) return 0;
-    return Math.round((uploadedSuccessCount.value / totalUploadCount.value) * 100);
-});
-const format = () => {
-    if (!totalUploadCount.value) return "0/0";
-    return `${uploadedSuccessCount.value}/${totalUploadCount.value}`;
-};
-
-const initImgArr = ref([]);
-const uploadData = ref([]);
-const confirmUploadLoading = ref(false);
-const abnormalUploadRef = ref(null);
-
-const handleUploadSuccess = (data) => {
-    uploadData.value = data?.imgArr || [];
-    const len = (data?.imgArr && data.imgArr.length) || 0;
-    totalUploadCount.value = len;
-    uploadedSuccessCount.value = len;
-};
-
-const handleConfirmUpload = async () => {
-    if (confirmUploadLoading.value) return;
-    if (!uploadData.value || uploadData.value.length === 0) {
-        ElMessage.warning("请先上传照片");
-        return;
-    }
-    confirmUploadLoading.value = true;
-    try {
-        const payload = pendingConfirmPayload.value;
-        if (pendingConfirmPayload.value) {
-            pendingConfirmPayload.value.remark = remark.value.trim();
-        }
-        const images = [...uploadData.value];
-        abnormalUploadRef.value?.uploadReset();
-        initImgArr.value = [];
-        uploadData.value = [];
-        totalUploadCount.value = 0;
-        uploadedSuccessCount.value = 0;
-        showUploadProgressPopup.value = false;
-        pendingConfirmPayload.value = null;
-        emit("confirm", {
-            ...(payload || {}),
-            images, // 预留字段,父组件当前逻辑不受影响
-        });
-    } finally {
-        confirmUploadLoading.value = false;
-    }
-};
-</script>
-
-<style scoped lang="scss">
-.confirm-draw-type-popup {
-    width: 100%;
-    padding: 16px 10px;
-
-    .popup-title,
-    .popup-sub-title {
-        font-size: 16px;
-    }
-
-    .popup-sub-title {
-        margin-top: 12px;
-    }
-
-    .type-list,
-    .category-list {
-        margin-top: 12px;
-        display: flex;
-        gap: 6px;
-        flex-wrap: wrap;
-    }
-
-    .type-item,
-    .category-item {
-        padding: 7px 12px;
-        border-radius: 2px;
-        font-size: 12px;
-        color: #575757;
-        background: #F4F4F4;
-        border: 1px solid transparent;
-        box-sizing: border-box;
-    }
-
-    .type-item--active,
-    .category-item--active {
-        color: #2199f8;
-        border-color: #2199f8;
-        background: rgba(33, 153, 248, 0.1);
-    }
-
-    .remark-input {
-        margin-top:20px;
-        width: 100%;
-        height: 72px;
-        resize: none;
-        border: 1px solid #e6e6e6;
-        border-radius: 8px;
-        padding: 10px 12px;
-        box-sizing: border-box;
-        font-size: 14px;
-        color: #333;
-    }
-
-    .remark-input::placeholder {
-        color: #c9c9c9;
-    }
-
-    .confirm-btn {
-        margin-top: 20px;
-        padding: 8px;       
-        text-align: center;
-        color: #fff;
-        background: #2199f8;
-        border-radius: 25px;
-        font-size: 16px;
-    }
-}
-
-.upload-progress-popup {
-    width: 100%;
-    padding: 16px 10px;
-
-    .upload-progress-title {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        margin-bottom: 12px;
-    }
-
-    .upload-box {
-        margin: 10px 0 16px;
-    }
-
-    // 上传弹窗里的备注输入框样式:保持与主弹窗输入框一致
-    .remark-input {
-        margin-bottom: 20px;
-        width: 100%;
-        height: 72px;
-        resize: none;
-        border: 1px solid #e6e6e6;
-        border-radius: 8px;
-        padding: 10px 12px;
-        box-sizing: border-box;
-        font-size: 14px;
-        color: #333;
-    }
-
-    .remark-input::placeholder {
-        color: #c9c9c9;
-    }
-
-    .confirm-btn {
-        width: 100%;
-        text-align: center;
-        color: #fff;
-        background: #2199f8;
-        border-radius: 25px;
-        padding: 10px 0;
-        font-size: 16px;
-    }
-}
-</style>

+ 0 - 163
src/components/popup/droneConsultPopup.vue

@@ -1,163 +0,0 @@
-<template>
-    <popup v-model:show="showValue" round class="drone-consult-popup" :close-on-click-overlay="true" teleport="body">
-        <div class="popup-content">
-            <!-- 无人机咨询:飞鸟购买 -->
-            <template v-if="type === 'droneConsult'">
-                <div class="top-text">{{ $t('未监测您果园有配套的无人机,您可咨询飞鸟购买') }}</div>
-                <div class="code-wrap">
-                    <img class="code-img" src="@/assets/img/home/qrcode.png" alt="">
-                </div>
-                <div class="hint-bubble">{{ $t('长按可添加客服,咨询相关问题') }}</div>
-                <div class="action-btn" @click="handleCopy">{{ $t('一键复制微信号') }}</div>
-            </template>
-            <!-- 地形/建模航线 -->
-            <template v-else-if="type === 'terrainRoute'">
-                <div class="top-text">
-                    <div>{{ $t('需要获取精细的地形信息才可以规划航') }}</div>
-                    <div>{{ $t('线,点击获取建模航线') }}</div>
-                </div>
-                <div class="action-btn" @click="handleConfirm">{{ $t('立即获取') }}</div>
-            </template>
-            <!-- 航线已生成(兼容图片 UI:中间区域不展示,仅文案 + 我知道了) -->
-            <template v-else-if="type === 'terrainRouteSuccess'">
-                <div class="top-text">{{ $t('果园三维建模航线已经生成,航线已经推送到遥控器上,请您按照规划的航线起飞即可') }}</div>
-                <div class="video-wrap"></div>
-                <div class="action-btn" @click="handleConfirm">{{ $t('我知道了') }}</div>
-            </template>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { Popup } from "vant";
-import { computed } from "vue";
-
-const props = defineProps({
-    show: {
-        type: Boolean,
-        default: false,
-    },
-    /** 弹窗类型:droneConsult 无人机咨询 | terrainRoute 地形/建模航线 | terrainRouteSuccess 航线已生成(兼容图片 UI,中间区域不展示) */
-    type: {
-        type: String,
-        default: "droneConsult",
-    },
-    /** 要复制的微信号(仅 type=droneConsult 时有效),不传则复制默认客服号 */
-    wechatId: {
-        type: String,
-        default: "",
-    },
-});
-
-const emit = defineEmits(["update:show", "copy", "confirm"]);
-
-const showValue = computed({
-    get: () => props.show,
-    set: (value) => emit("update:show", value),
-});
-
-const handleCopy = async () => {
-    const id = props.wechatId || "feiniao-kefu";
-    try {
-        await navigator.clipboard.writeText(id);
-        emit("copy", id);
-        emit("update:show", false);
-    } catch (e) {
-        console.error("复制失败", e);
-        emit("copy", id);
-        emit("update:show", false);
-    }
-};
-
-const handleConfirm = () => {
-    emit("confirm");
-    emit("update:show", false);
-};
-</script>
-
-<style scoped lang="scss">
-.drone-consult-popup {
-    width: 89%;
-    padding: 20px 16px;
-
-    .popup-content {
-        display: flex;
-        flex-direction: column;
-        align-items: center;
-    }
-
-    .top-text {
-        font-size: 16px;
-        color: #333;
-        text-align: left;
-        line-height: 1.6;
-        margin-bottom: 20px;
-        width: 100%;
-    }
-
-    .code-wrap{
-        width: 186px;
-        height: 186px;
-        background: #f5f5f5;
-        border-radius: 4px;
-        border: 0.86px solid rgba(33, 153, 248, 0.2);
-        background: rgba(33, 153, 248, 0.04);
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        .code-img{
-            width: 176px;
-            height: 176px;
-            object-fit: cover;
-        }
-    }
-
-    .hint-bubble {
-        padding: 12px;
-        color: #2199f8;
-        background: rgba(33, 153, 248, 0.1);
-        padding: 3px 9px 9px;
-        border-radius: 8px;
-        position: relative;
-        margin-top: 5px;
-        margin: 16px 0;
-
-        // 三角形小尖尖
-        &::before {
-            content: "";
-            position: absolute;
-            top: -8px;
-            left: 20px;
-            width: 0;
-            height: 0;
-            border-left: 15px solid transparent;
-            border-right: 2px solid transparent;
-            border-bottom: 8px solid rgba(33, 153, 248, 0.1);
-        }
-    }
-
-    .video-wrap{
-        width: 100%;
-        height: 220px;
-        background: rgba(33, 153, 248, 0.05);
-        border-radius: 5px;
-        border: 1px solid rgba(33, 153, 248, 0.2);
-        margin-bottom: 16px;
-    }
-
-    .action-btn {
-        width: 100%;
-        box-sizing: border-box;
-        font-size: 16px;
-        background: #2199f8;
-        color: #fff;
-        text-align: center;
-        padding: 8px;
-        border-radius: 4px;
-    }
-
-    .top-text > div {
-        margin-bottom: 0;
-    }
-}
-</style>

+ 0 - 494
src/components/popup/farmInfoPopup copy.vue

@@ -1,494 +0,0 @@
-<template>
-    <popup
-        v-model:show="showValue"
-        round
-        class="farm-info-popup"
-        :close-on-click-overlay="true"
-        teleport="body"
-    >
-        <!-- 第一步:农场信息填写 -->
-        <template v-if="currentStep === 1">
-            <!-- 标题 -->
-            <div class="popup-title">{{ $t('完善以下信息,生成智能种植方案') }}</div>
-
-            <!-- 表单区域 -->
-            <el-form ref="formRef" :model="formData" :rules="rules" class="farm-form">
-                <!-- 农场位置 -->
-                <el-form-item :label="$t('农场位置')" prop="address">
-                    <el-input v-model="formData.address" :placeholder="$t('请输入农场位置')" clearable />
-                </el-form-item>
-
-                <!-- 农场品种 -->
-                <el-form-item :label="$t('农场品种')" prop="speciesId">
-                    <el-select
-                        v-model="formData.speciesId"
-                        :placeholder="$t('请选择')"
-                        @change="handleSpecieChange"
-                    >
-                        <el-option
-                            v-for="item in specieList"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.id"
-                        />
-                    </el-select>
-                </el-form-item>
-
-                <!-- 农场品类 -->
-                <el-form-item :label="$t('农场品类')" prop="typeIds">
-                    <el-select
-                        v-model="formData.typeIds"
-                        multiple
-                        collapse-tags
-                        :placeholder="$t('请选择')"
-                        :disabled="!formData.speciesId"
-                        @change="handleFruitsChange"
-                    >
-                        <el-option
-                            v-for="item in fruitsList"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.id"
-                        />
-                    </el-select>
-                </el-form-item>
-
-                <!-- 农场亩数 -->
-                <el-form-item :label="$t('农场亩数')" prop="mu">
-                    <el-input v-model="formData.mu" :placeholder="$t('请输入')" type="number">
-                        <template #suffix>
-                            <span class="unit">{{ $t('亩') }}</span>
-                        </template>
-                    </el-input>
-                </el-form-item>
-
-                <!-- 农场名称 -->
-                <el-form-item :label="$t('农场名称')" prop="name">
-                    <el-input
-                        v-model="formData.name"
-                        :placeholder="$t('请输入农场名称')"
-                        clearable
-                        @input="handleNameInput"
-                    />
-                </el-form-item>
-            </el-form>
-        </template>
-
-        <!-- 第二步:物候期起始时间填写 -->
-        <template v-else>
-            <!-- 提示文字 -->
-            <div class="popup-title">{{ $t('为了精准匹配种植方案,完善物候信息') }}</div>
-
-            <!-- 物候期表单 -->
-            <el-form ref="phenologyFormRef" :model="phenologyData" label-width="92px" :rules="phenologyRules" class="farm-form">
-                <!-- 物候期选择器 -->
-                <el-form-item
-                    :label="$t('当下物候期')"
-                    prop="phenologyId"
-                >
-                    <el-select
-                        v-model="phenologyData.phenologyId"
-                        :placeholder="$t('选择物候期')"
-                        style="width: 100%"
-                        @change="handlePhenologyChange"
-                    >
-                        <el-option
-                            v-for="phenology in phenologyList"
-                            :key="phenology.phenologyId"
-                            :label="phenology.phenologyName"
-                            :value="phenology.phenologyId"
-                        />
-                    </el-select>
-                </el-form-item>
-
-                <!-- 日期选择器 -->
-                <el-form-item
-                    :label="$t('起始时间')"
-                    prop="phenologyStartDate"
-                >
-                    <el-date-picker
-                        v-model="phenologyData.phenologyStartDate"
-                        type="date"
-                        :placeholder="$t('选择时间')"
-                        format="YYYY-MM-DD"
-                        value-format="YYYY-MM-DD"
-                        style="width: 100%"
-                    />
-                </el-form-item>
-            </el-form>
-        </template>
-
-        <!-- 确认按钮 -->
-        <div class="btn-confirm" @click="handleConfirm">{{ $t('确认信息') }}</div>
-    </popup>
-</template>
-
-<script setup>
-import { Popup } from "vant";
-import { computed, ref, watch, nextTick ,onMounted} from "vue";
-import { ElMessage } from "element-plus";
-import { convertPointToArray } from "@/utils/index";
-import { useStore } from "vuex";
-
-const store = useStore();
-
-const props = defineProps({
-    // 控制弹窗显示/隐藏
-    show: {
-        type: Boolean,
-        default: false,
-    },
-    // 是否在点击遮罩层后关闭弹窗
-    closeOnClickOverlay: {
-        type: Boolean,
-        default: false,
-    },
-    // 初始表单数据
-    initialData: {
-        type: Object,
-        default: () => ({}),
-    },
-    expertMiniUserId: {
-        type: [String, Number],
-        default: "",
-    },
-    oldUser: {
-        type: Boolean,
-        default: false,
-    },
-});
-
-const city = ref("");
-const MAP_KEY = "CZLBZ-LJICQ-R4A5J-BN62X-YXCRJ-GNBUT";
-function getLocationName(location) {
-    const params = {
-        key: MAP_KEY,
-        location,
-    };
-    VE_API.old_mini_map.location(params).then(({ result }) => {
-        const add = result.formatted_addresses?.recommend ? result.formatted_addresses.recommend : result.address + "";
-        formData.value.address = add;
-        city.value = result.address_component?.city + result.address_component?.district || "";
-    });
-}
-
-onMounted(() => {
-    const arr = convertPointToArray(store.state.home.miniUserLocationPoint);
-    getLocationName(`${arr[1]},${arr[0]}`);
-    getSpecieList();
-});
-
-function getSpecieList() {
-    return VE_API.farm.fetchSpecieList({ point: store.state.home.miniUserLocationPoint }).then(({ data }) => {
-        specieList.value = data || [];
-        return data;
-    });
-}
-
-function getFruitsList(parentId) {
-    VE_API.farm.fruitsTypeItemList({ parentId }).then(({ data }) => {
-        fruitsList.value = data;
-    });
-}
-
-const emit = defineEmits(["update:show"]);
-
-// 处理v-model双向绑定
-const showValue = computed({
-    get: () => props.show,
-    set: (value) => emit("update:show", value),
-});
-
-const formRef = ref(null);
-const phenologyFormRef = ref(null);
-
-// 当前步骤:1-填写农场信息,2-填写物候期时间
-const currentStep = ref(1);
-
-// 用户是否手动修改过农场名称
-const isNameEdited = ref(false);
-
-// 表单数据
-const formData = ref({
-    address: "",
-    speciesId: "",
-    typeIds: [],
-    mu: "",
-    name: "",
-});
-
-// 物候期列表
-const phenologyList = ref([]);
-
-// 物候期表单数据
-const phenologyData = ref({});
-
-const specieList = ref([]);
-const fruitsList = ref([]);
-
-// 规范化多选品种 typeId(支持字符串/数组),确保最终一定是数组
-const normalizeTypeId = (value) => {
-    if (Array.isArray(value)) return value;
-    if (value === null || value === undefined || value === "") return [];
-    return [value];
-};
-
-// 自定义验证器:验证农场品种(只校验 speciesId)
-const validateSpeciesId = (rule, value, callback) => {
-    if (!value) {
-        callback(new Error("请选择农场品种"));
-    } else {
-        callback();
-    }
-};
-
-// 自定义验证器:验证农场品类(只校验 typeIds)
-const validateTypeIds = (rule, value, callback) => {
-    const hasType =
-        Array.isArray(value)
-            ? value.length > 0
-            : !!value;
-    if (!hasType) {
-        callback(new Error("请选择农场品类"));
-    } else {
-        callback();
-    }
-};
-
-// 表单验证规则
-const rules = {
-    address: [{ required: true, message: "请输入农场位置", trigger: "blur" }],
-    speciesId: [{ required: true, validator: validateSpeciesId, trigger: "change" }],
-    typeIds: [{ required: true, validator: validateTypeIds, trigger: "change" }],
-    mu: [
-        { required: true, message: "请输入农场亩数", trigger: "blur" },
-        { pattern: /^\d+(\.\d+)?$/, message: "请输入有效的数字", trigger: "blur" },
-    ],
-    name: [{ required: true, message: "请输入农场名称", trigger: "blur" }],
-};
-
-// 物候期表单验证规则
-const phenologyRules = {
-    phenologyId: [{ required: true, message: "请选择物候期", trigger: "change" }],
-    phenologyStartDate: [{ required: true, message: "请选择起始时间", trigger: "change" }],
-};
-
-// 监听初始数据变化
-watch(
-    () => props.initialData,
-    (newData) => {
-        if (newData && Object.keys(newData).length > 0) {
-            Object.assign(formData.value, newData);
-            formData.value.typeIds = normalizeTypeId(formData.value.typeIds);
-        }
-    },
-    { immediate: true, deep: true }
-);
-
-// 无论选择几个品类,始终保证 formData.typeIds 为数组
-watch(
-    () => formData.value.typeIds,
-    (newVal) => {
-        // 仅在不是数组时进行规范化,避免死循环
-        if (!Array.isArray(newVal)) {
-            formData.value.typeIds = normalizeTypeId(newVal);
-        }
-    }
-);
-
-// 监听弹窗显示状态,重置表单
-watch(
-    () => props.show,
-    (newVal) => {
-        if (newVal) {
-            // 重置物候期列表和表单数据
-            phenologyList.value = [];
-            phenologyData.value = {};
-            // 重置名称编辑状态
-            isNameEdited.value = false;
-            // 弹窗打开时,如果有初始数据则使用,否则使用默认值
-            if (props.initialData && Object.keys(props.initialData).length > 0) {
-                Object.assign(formData.value, props.initialData);
-                formData.value.typeIds = normalizeTypeId(formData.value.typeIds);
-            } else {
-                formData.value = {
-                    address: "",
-                    speciesId: "",
-                    typeIds: [],
-                    mu: "",
-                    name: "",
-                };
-            }
-            // 清除验证状态
-            nextTick(() => {
-                formRef.value?.clearValidate();
-                phenologyFormRef.value?.clearValidate();
-            });
-
-            if(props.oldUser){
-                currentStep.value = 2;
-                getCurrentAndNextPhenology()
-            }else{
-                currentStep.value = 1;
-            }
-        }
-    }
-);
-
-// 品种1变化时,重置品种2并触发验证
-const handleSpecieChange = (val) => {
-    formData.value.typeIds = [];
-    const specie = specieList.value.find(item => item.id === val);
-    // 只有在用户没有手动修改名称时,才自动带出默认名称
-    if (specie && !isNameEdited.value) {
-        formData.value.name = city.value + specie.name + "农场";
-    }
-    getFruitsList(val);
-    // 触发品种验证
-    nextTick(() => {
-        formRef.value?.validateField("speciesId");
-    });
-};
-
-// 品种2变化时,触发验证
-const handleFruitsChange = () => {
-    nextTick(() => {
-        // 只校验当前字段(农场品类)
-        formRef.value?.validateField("typeIds");
-    });
-};
-
-// 农场名称输入时,标记为用户已手动修改
-const handleNameInput = () => {
-    isNameEdited.value = true;
-};
-
-// 确认信息
-const handleConfirm = async () => {
-    // 第一步:验证农场信息表单
-    if (currentStep.value === 1) {
-        if (!formRef.value) return;
-        try {
-            await formRef.value.validate();
-            
-            // 验证通过,获取物候期数据并切换到第二步
-            await getCurrentAndNextPhenology();
-            currentStep.value = 2;
-        } catch (error) {
-            console.log("表单验证失败", error);
-        }
-    } 
-    // 第二步:验证物候期表单并关闭弹窗
-    else {
-        if (!phenologyFormRef.value) return;
-        try {
-            await phenologyFormRef.value.validate();
-            // 验证通过,提交所有数据并关闭弹窗
-            const params = {
-                ...formData.value,
-                ...phenologyData.value,
-                wkt: store.state.home.miniUserLocationPoint,
-                expertMiniUserId: props.expertMiniUserId,
-                containerId: specieList.value.find(item => item.id === formData.value.speciesId)?.defaultContainerId,
-            }
-            if(!props.oldUser){
-                const { code, msg } = await VE_API.farm.saveFarm(params);
-                if (code === 0) {
-                    ElMessage.success("农场信息确认成功");
-                    emit("update:show", false);
-                } else {
-                    ElMessage.error(msg || '农场信息确认失败');
-                }
-            }else{
-                ElMessage.success("农场信息确认成功");
-                emit("update:show", false);
-            }
-        } catch (error) {
-            console.log("物候期表单验证失败", error);
-        }
-    }
-};
-
-// 获取当前日期(YYYY-MM-DD格式)
-const getTodayDate = () => {
-    const today = new Date();
-    const year = today.getFullYear();
-    const month = String(today.getMonth() + 1).padStart(2, "0");
-    const day = String(today.getDate()).padStart(2, "0");
-    return `${year}-${month}-${day}`;
-};
-
-// 物候期变化时,更新日期为对应物候期的 startDate
-const handlePhenologyChange = (phenologyId) => {
-    const selectedPhenology = phenologyList.value.find(item => item.phenologyId === phenologyId);
-    if (selectedPhenology && selectedPhenology.startDate) {
-        phenologyData.value.phenologyStartDate = selectedPhenology.startDate;
-    }
-};
-
-// 获取当前和下一个物候期
-const getCurrentAndNextPhenology = async () => {
-    try {
-        const { data } = await VE_API.home.getCurrentAndNextPhenology({ 
-            expertMiniUserId: props.expertMiniUserId,
-            containerId: specieList.value.find(item => item.id === formData.value.speciesId)?.defaultContainerId || '26',
-        });
-        if (data && Array.isArray(data)) {
-            phenologyList.value = data;
-            // 初始化物候期表单数据,日期使用第一个物候期的 startDate
-            const firstPhenology = data[0];
-            phenologyData.value = {
-                phenologyId: firstPhenology?.phenologyId || "",
-                phenologyStartDate: firstPhenology?.startDate || getTodayDate(),
-            };
-        }
-    } catch (error) {
-        console.error("获取物候期数据失败", error);
-        ElMessage.error("获取物候期数据失败");
-    }
-};
-</script>
-
-<style scoped lang="scss">
-.farm-info-popup {
-    width: 100%;
-    padding: 20px 16px;
-    border-radius: 12px;
-
-    .popup-title {
-        font-size: 16px;
-        color: #121212;
-    }
-
-    .farm-form {
-        margin: 16px 0;
-        background: rgba(33, 153, 248, 0.05);
-        padding: 10px;
-        border-radius: 5px;
-        border: 1px solid rgba(33, 153, 248, 0.2);
-        :deep(.el-form-item__label) {
-            color: #1d2129;
-        }
-        .variety-select-wrap {
-            display: flex;
-            gap: 10px;
-            width: 100%;
-        }
-
-        .unit {
-            color: #666;
-            font-size: 14px;
-            padding-right: 8px;
-        }
-    }
-
-    .btn-confirm {
-        padding: 10px;
-        background: #2199f8;
-        color: #ffffff;
-        border-radius: 4px;
-        font-size: 16px;
-        text-align: center;
-    }
-}
-</style>

+ 0 - 328
src/components/popup/farmInfoPopup.vue

@@ -1,328 +0,0 @@
-<template>
-    <Popup v-model:show="show" :overlay-style="{ zIndex: 9999 }" teleport="body" class="farm-info-popup" closeable>
-        <div class="popup-content-box">
-            <div class="popup-title">{{ $t('基本信息') }}</div>
-            <div class="popup-content">
-                <!-- <div class="map-box">
-                    <div class="map" ref="mapContainer"></div>
-                </div> -->
-                <cell-group inset class="cell-group">
-                    <field v-model="farmInfo.subjectName" :label="$t('农场名称')" />
-                    <field readonly :label="$t('农场面积')">
-                        <template #input>
-                            <span>{{ farmInfo.farmArea }}亩</span>
-                        </template>
-                    </field>
-                    <field readonly :label="$t('种植作物')" class="crop-field">
-                        <template #input>
-                            <template v-if="farmInfo.regionList && farmInfo.regionList.length">
-                                <template v-for="(item, index) in farmInfo.regionList" :key="index">
-                                    <span>{{ item.regionName }}</span>
-                                    <span v-if="index !== farmInfo.regionList.length - 1">、</span>
-                                </template>
-                            </template>
-                            <template v-else>
-                                <span>-</span>
-                            </template>
-                        </template>
-                    </field>
-                    <field v-model="farmInfo.contactName" :label="$t('联系人')" />
-                    <field
-                        ref="contactPhoneFieldRef"
-                        v-model="farmInfo.contactPhone"
-                        :label="$t('联系电话')"
-                        type="tel"
-                        maxlength="11"
-                        :rules="contactPhoneRules"
-                    />
-                    <field class="address-field" v-model="farmInfo.farmAddress" readonly :label="$t('农场位置')" />
-                    <!-- <field :label="$t('基地类别')" class="base-type-field">
-                        <template #input>
-                            <el-select
-                                v-model="farmInfo.baseType"
-                                :placeholder="$t('请选择')"
-                                class="base-type-select"
-                                autocomplete="off"
-                                teleported
-                                popper-class="farm-info-base-type-popper"
-                            >
-                                <el-option
-                                    v-for="opt in baseTypeOptions"
-                                    :key="opt.id"
-                                    :label="opt.name"
-                                    :value="opt.id"
-                                />
-                            </el-select>
-                        </template>
-                    </field> -->
-                </cell-group>
-            </div>
-            <div class="popup-footer">
-                <div class="footer-btn no-btn" @click="handleCancel">{{ $t('取消') }}</div>
-                <div class="footer-btn yes-btn" @click="handleEdit">{{ $t('确认修改') }}</div>
-            </div>
-        </div>
-    </Popup>
-</template>
-
-<script setup>
-import { Popup, Field, CellGroup, Checkbox } from "vant";
-import { ref, nextTick } from "vue";
-import { useRouter } from "vue-router";
-// import IndexMap from "../map/index.js";
-import { useStore } from "vuex";
-import { ElMessage } from "element-plus";
-
-/** 与 create_farm 联系电话规则一致 */
-const contactPhoneRules = [
-    { required: true, message: "请输入联系电话" },
-    {
-        pattern: /^1[3-9]\d{9}$/,
-        message: "请输入正确的手机号码",
-    },
-];
-
-const baseTypeOptions = ref([]);
-function getBaseTypeList() {
-    return VE_API.farm.fetchBaseTypeList().then(({ data }) => {
-        baseTypeOptions.value = data || [];
-        return data;
-    });
-}
-
-const props = defineProps({
-    farmId: {
-        type: [Number, String],
-        default: null,
-    },
-});
-
-const store = useStore();
-const router = useRouter();
-const show = ref(false);
-const mapContainer = ref(null);
-const contactPhoneFieldRef = ref(null);
-// const indexMap = new IndexMap();
-
-// 农场信息
-const farmInfo = ref();
-const handleShow = () => {
-    VE_API.basic_farm.fetchFarmSubjectDetail({ subjectId: props.farmId }).then((res) => {
-        if (res.code === 0) {
-            farmInfo.value = res.data;
-            getBaseTypeList();
-            show.value = true;
-            // nextTick(() => {
-            //     const point = farmInfo.value.farmLocation;
-            //     let geometryArr = [];
-
-            //     if (Array.isArray(farmInfo.value.regionList) && farmInfo.value.regionList.length > 0) {
-            //         farmInfo.value.regionList.forEach((item) => {
-            //             if (item?.geom) {
-            //                 geometryArr.push(item?.geom)
-            //             }
-            //         });
-            //     }
-
-            //     console.log('geometryArr', geometryArr);
-            //     // 如果地图已经初始化,则更新中心点和地块;否则初始化地图
-            //     if (indexMap.kmap) {
-            //         indexMap.updateCenter(point);
-            //         // 如果有地块数据,则添加地块
-            //         if (geometryArr && geometryArr.length > 0) {
-            //             indexMap.setAreaGeometry([geometryArr]);
-            //         }
-            //     } else {
-            //         indexMap.initMap(point, mapContainer.value);
-            //         // 初始化地图后,如果有地块数据,则添加地块
-            //         if (geometryArr && geometryArr.length > 0) {
-            //             indexMap.setAreaGeometry([geometryArr]);
-            //         }
-            //     }
-            // });
-        }
-    });
-};
-
-const emit = defineEmits(['success']);
-
-const handleEdit = async () => {
-    const phoneErr = await contactPhoneFieldRef.value?.validate();
-    if (phoneErr?.message) {
-        return;
-    }
-    const paramsData = {
-        id: props.farmId,
-        name: farmInfo.value.subjectName,
-        fzr: farmInfo.value.contactName,
-        tel: farmInfo.value.contactPhone,
-        baseType: farmInfo.value.baseType,
-        expertMiniUserId: 81881,
-    }
-    VE_API.basic_farm.saveBasicFarmInfoByExpertV3(paramsData).then((res) => {
-        if (res.code === 0) {
-            ElMessage.success('修改成功');
-            show.value = false;
-            emit('success', {
-                id: props.farmId,
-                name: farmInfo.value.subjectName,
-            });
-        }
-    });
-    // setTimeout(() => {
-    //     show.value = false;
-    // }, 150);
-
-    // // 在跳转前,将当前农场的地块数据存储到store中
-    // if (farmInfo.value.geomWkt) {
-    //     const polygonData = {
-    //         geometryArr: [farmInfo.value.geomWkt],
-    //         mianji: farmInfo.value.mianji,
-    //         isConfirmed: true, // 编辑模式下标记为已确认
-    //     };
-    //     store.commit("home/SET_FARM_POLYGON", polygonData);
-    // }
-
-    // // 将农场数据存储到store中,供编辑页面使用
-    // store.commit("home/SET_EDIT_FARM_DATA", farmInfo.value);
-
-    // const from = props.showEditBtn ? "details" : "monitor";
-    // router.push(`/create_farm?type=edit&farmId=${props.farmId}&from=${from}`);
-};
-
-const handleCancel = () => {
-    show.value = false;
-};
-
-defineExpose({ handleShow });
-</script>
-
-<style lang="scss" scoped>
-.farm-info-popup {
-    width: 100%;
-    border-radius: 8px;
-    z-index: 9999 !important;
-    overflow: hidden;
-
-    .popup-content-box {
-        background: url("@/assets/img/home/popup-mask.png") no-repeat center left / 100% 100%;
-        padding: 20px;
-    }
-
-    ::v-deep {
-        .van-popup__close-icon {
-            color: #000;
-        }
-    }
-
-    .popup-title {
-        text-align: center;
-        font-size: 24px;
-        font-family: "PangMenZhengDao";
-    }
-
-    .popup-content {
-        margin: 12px 0;
-
-        .map-box {
-            width: 100%;
-            height: 150px;
-            position: relative;
-
-            .map {
-                width: 100%;
-                height: 100%;
-                clip-path: inset(0px round 5px);
-                pointer-events: none;
-            }
-
-            .map-text {
-                position: absolute;
-                right: 6px;
-                bottom: 8px;
-                font-size: 12px;
-                color: #ffffff;
-                padding: 8px 12px;
-                border-radius: 20px;
-                background: rgba(0, 0, 0, 0.5);
-                border: 1px solid rgba(255, 255, 255, 0.5);
-            }
-        }
-
-        .cell-group {
-            margin: 12px 0 0;
-
-            .crop-field {
-                ::v-deep {
-                    .van-field__control--custom {
-                        flex-wrap: wrap;
-                    }
-                }
-            }
-
-            .base-type-field {
-                ::v-deep {
-                    .el-select {
-                        width: 100%;
-                    }
-                    .el-select__wrapper {
-                        min-height: 24px;
-                        box-shadow: none;
-                        padding-left: 0;
-                    }
-                }
-            }
-
-            .address-field {
-                position: relative;
-
-                &::before {
-                    position: absolute;
-                    box-sizing: border-box;
-                    content: " ";
-                    pointer-events: none;
-                    right: 16px;
-                    bottom: 0;
-                    left: 16px;
-                    border-bottom: 1px solid #ebedf0;
-                    transform: scaleY(0.5);
-                }
-            }
-        }
-    }
-
-    .checkbox {
-        pointer-events: none;
-        padding: 12px 14px;
-    }
-
-    .popup-footer {
-        display: flex;
-        gap: 13px;
-
-        .footer-btn {
-            text-align: center;
-            flex: 1;
-            padding: 8px 0;
-            border-radius: 25px;
-        }
-
-        .no-btn {
-            color: #666666;
-            border: 1px solid #999999;
-        }
-
-        .yes-btn {
-            background: #2199f8;
-            color: #fff;
-        }
-    }
-}
-</style>
-
-<!-- 下拉挂载在 body,需非 scoped 才能盖住 van-popup(z-index: 9999) -->
-<style lang="scss">
-.farm-info-base-type-popper {
-    z-index: 10050 !important;
-}
-</style>

+ 0 - 385
src/components/popup/interactPopup.vue

@@ -1,385 +0,0 @@
-<template>
-    <popup class="interact-popup" v-model:show="show" closeable :close-on-click-overlay="false" @closed="handleClosed">
-        <div class="interact-header">
-            <div class="interact-title">{{ currentData.farmWorkName || currentData.name }}</div>
-        </div>
-        <div class="interact-form">
-            <div class="form-item">
-                <div class="form-label">
-                    <span class="required">*</span>
-                    请选择互动阶段
-                </div>
-                <div class="form-input-wrapper two-select">
-                    <div class="select-item">
-                        <el-select
-                            v-model="formData.phenologyId"
-                            size="large"
-                            :placeholder="t('请选择物候期')"
-                            @change="handlePhenologyChange"
-                            :editable="false"
-                        >
-                            <el-option
-                                v-for="item in phenologyList"
-                                :key="item.id"
-                                :label="item.name"
-                                :value="item.id"
-                            ></el-option>
-                        </el-select>
-                    </div>
-                    <div class="select-item">
-                        <el-select v-model="formData.reproductiveId" size="large" :placeholder="t('请选择')" :editable="false">
-                            <el-option
-                                v-for="item in reproductiveList"
-                                :key="item.id"
-                                :label="item.name"
-                                :value="item.id"
-                            ></el-option>
-                        </el-select>
-                    </div>
-                </div>
-            </div>
-            <div class="form-item">
-                <div class="form-label">
-                    <span class="required">*</span>
-                    请选择互动时间
-                </div>
-                <div class="form-input-wrapper">
-                    <el-date-picker
-                        v-model="formData.interactionTime"
-                        size="large"
-                        style="width: 100%"
-                        disabled
-                        type="date"
-                        :placeholder="t('请选择日期')"
-                        :editable="false"
-                    />
-                </div>
-            </div>
-            <div class="form-item">
-                <div class="form-label">
-                    <span class="required">*</span>
-                    请设置互动问题
-                </div>
-                <el-input
-                    v-model="formData.interactionQuestion"
-                    type="textarea"
-                    :rows="3"
-                    maxlength="35"
-                    show-word-limit
-                    :placeholder="t('请设置互动问题')"
-                    class="question-textarea"
-                />
-            </div>
-        </div>
-        <div class="interact-buttons">
-            <div class="btn-delete" @click="handleCancelInteract">{{ t('取消修改') }}</div>
-            <div class="btn-save" :class="{ disabled: isSaving }" @click="handleSaveInteract">
-                {{ saveButtonText }}
-            </div>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { Popup } from "vant";
-import { ref, computed } from "vue";
-import { ElMessage, ElMessageBox } from "element-plus";
-
-// Emits
-const emit = defineEmits(["handleSaveSuccess"]);
-
-// 响应式数据
-const show = ref(false);
-const arrangeId = ref(null);
-const isSaving = ref(false);
-
-const formData = ref({
-    phenologyId: "",
-    reproductiveId: "",
-    interactionTime: "",
-    interactionQuestion: "",
-});
-
-const reproductiveList = ref([]);
-const handlePhenologyChange = async (val) => {
-    formData.value.reproductiveId = "";
-    const { data } = await VE_API.farm.listByPhenologyId({ phenologyId: val });
-    if (!data || !Array.isArray(data)) return;
-    reproductiveList.value = data;
-};
-
-// 计算属性
-const saveButtonText = computed(() => (isSaving.value ? "保存中..." : "保存修改"));
-
-// 工具函数
-const resetInteractData = () => {
-    formData.value = {
-        phenologyId: "",
-        reproductiveId: "",
-        interactionTime: "",
-        interactionQuestion: "",
-    };
-};
-
-// 验证函数
-const validateInteractForm = () => {
-    if (!formData.value.phenologyId) {
-        ElMessage.warning({ message: t('请选择互动阶段'), type: 'warning' });
-        return false;
-    }
-    if (!formData.value.reproductiveId) {
-        ElMessage.warning({ message: t('请选择互动阶段'), type: 'warning' });
-        return false;
-    }
-    if (!formData.value.interactionTime) {
-        ElMessage.warning({ message: t('请选择互动时间'), type: 'warning' });
-        return false;
-    }
-    if (!formData.value.interactionQuestion?.trim()) {
-        ElMessage.warning({ message: t('请设置互动问题'), type: 'warning' });
-        return false;
-    }
-    return true;
-};
-
-const phenologyList = ref(null);
-const getPhenologyList = async (containerSpaceTimeId) => {
-    if (!containerSpaceTimeId) {
-        phenologyList.value = [];
-        return;
-    }
-    const res = await VE_API.monitor.listPhenology({ containerSpaceTimeId });
-    if (res.code === 0) {
-        phenologyList.value = res.data || [];
-    }
-};
-
-const getFarmWorkArrangeDetail = async (id) => {
-    const { data, code } = await VE_API.farm.getFarmWorkArrangeDetail({ id });
-    if(code === 0) {
-        await handlePhenologyChange(data.phenologyId);
-        formData.value = {
-            phenologyId: data.phenologyId,
-            reproductiveId: data.reproductiveId,
-            interactionTime: data.interactionTime,
-            interactionQuestion: data.interactionQuestion || "",
-        };
-    }
-};
-
-const currentData = ref(null);
-// 显示弹窗方法
-const showPopup = async (data) => {
-    // 重置数据
-    resetInteractData();
-    await getPhenologyList(data.containerSpaceTimeId);
-    await getFarmWorkArrangeDetail(data.id);
-    // 设置数据
-    currentData.value = data;
-
-    isSaving.value = false;
-
-    show.value = true;
-};
-
-// 事件处理函数
-const handleCancelInteract = () => {
-    show.value = false;
-};
-
-function formatDate(date) {
-    // 如果已经是字符串格式 YYYY-MM-DD,直接返回
-    if (typeof date === "string" && /^\d{4}-\d{2}-\d{2}$/.test(date)) {
-        return date;
-    }
-    // 如果是 Date 对象,进行转换
-    if (date instanceof Date) {
-        let year = date.getFullYear();
-        let month = String(date.getMonth() + 1).padStart(2, "0");
-        let day = String(date.getDate()).padStart(2, "0");
-        return `${year}-${month}-${day}`;
-    }
-    // 其他情况返回原值
-    return date;
-}
-
-const handleSaveInteract = () => {
-    if (isSaving.value || !validateInteractForm()) return;
-
-    isSaving.value = true;
-
-    const paramsObj = {
-        id: currentData.value.id,
-        ...formData.value,
-        interactionTime: formatDate(formData.value.interactionTime),
-    };
-
-    VE_API.monitor
-        .updateFarmWorkArrange(paramsObj)
-        .then((res) => {
-            if (res.code === 0) {
-                ElMessage.success({ message: t('保存成功'), type: 'success' });
-                show.value = false;
-                emit("handleSaveSuccess", paramsObj);
-            } else {
-                ElMessage.error(res.message || "保存失败");
-            }
-        })
-        .catch((error) => {
-            console.error("保存互动设置失败:", error);
-            ElMessage.error({ message: t('保存失败,请重试'), type: 'error' });
-        })
-        .finally(() => {
-            isSaving.value = false;
-        });
-};
-
-const handleClosed = () => {
-    resetInteractData();
-};
-
-// 暴露方法
-defineExpose({
-    showPopup,
-});
-</script>
-
-<style lang="scss" scoped>
-.interact-popup {
-    width: 90%;
-    box-sizing: border-box;
-    background: #ffffff;
-    padding: 0;
-    border-radius: 10px;
-
-    ::v-deep {
-        .van-popup__close-icon {
-            color: #000;
-        }
-    }
-
-    .interact-header {
-        background: linear-gradient(180deg, #d1ebff 0%, #ffffff 100%);
-        padding: 20px 18px;
-        text-align: center;
-        border-radius: 10px 10px 0 0;
-
-        .interact-title {
-            font-size: 18px;
-            font-weight: 600;
-            color: #000;
-        }
-    }
-
-    .interact-form {
-        padding: 0 18px 20px;
-
-        .form-item {
-            margin-bottom: 16px;
-
-            &:last-child {
-                margin-bottom: 0;
-            }
-
-            .form-label {
-                color: #000;
-                font-weight: 500;
-                margin-bottom: 12px;
-                display: flex;
-                align-items: center;
-
-                .required {
-                    color: #ff4d4f;
-                    margin-right: 4px;
-                }
-            }
-
-            .form-input-wrapper {
-                position: relative;
-                &.two-select {
-                    display: flex;
-                    gap: 10px;
-                    .select-item {
-                        flex: 1;
-                    }
-                }
-                ::v-deep {
-                    .el-input__inner {
-                        caret-color: transparent;
-                        padding-right: 40px;
-                    }
-
-                    .el-input__suffix {
-                        display: none;
-                    }
-                }
-
-                .time-icon {
-                    position: absolute;
-                    right: 12px;
-                    top: 50%;
-                    transform: translateY(-50%);
-                    color: #909399;
-                    pointer-events: none;
-                    z-index: 1;
-                    font-size: 16px;
-                }
-            }
-
-            .question-textarea {
-                ::v-deep {
-                    .el-textarea__inner {
-                        resize: none;
-                        line-height: 1.5;
-                        min-height: 80px;
-                    }
-                }
-            }
-        }
-    }
-
-    .interact-buttons {
-        display: flex;
-        gap: 12px;
-        padding: 0 18px 20px;
-
-        .btn-delete,
-        .btn-save {
-            flex: 1;
-            padding: 8px;
-            border-radius: 25px;
-            font-size: 16px;
-            text-align: center;
-        }
-
-        .btn-delete {
-            background: #ffffff;
-            border: 1px solid rgba(153, 153, 153, 0.5);
-            color: #666666;
-        }
-
-        .btn-save {
-            background: #2199f8;
-            color: #fff;
-            border: none;
-
-            &:hover:not(.disabled) {
-                background: #1a8ae6;
-            }
-
-            &:active:not(.disabled) {
-                opacity: 0.9;
-                transform: scale(0.98);
-            }
-
-            &.disabled {
-                opacity: 0.6;
-                cursor: not-allowed;
-                pointer-events: none;
-            }
-        }
-    }
-}
-</style>

+ 0 - 147
src/components/popup/reviewUploadPopup.vue

@@ -1,147 +0,0 @@
-<template>
-    <popup v-model:show="show" closeable :close-on-click-overlay="false" class="upload-popup" @closed="handleClosed">
-        <div class="upload-content">
-            <div class="upload-tips"><span class="required">*</span>{{ tipText }}</div>
-            <upload :exampleImg="showExampleImg" :maxCount="maxCount" class="upload-wrap" @handleUpload="handleUpload">
-                <img v-if="showExampleImg" class="example" src="@/assets/img/home/example-4.png" alt="" />
-                <img class="example" src="@/assets/img/home/plus.png" alt="" />
-            </upload>
-            <div class="upload-footer">
-                <div class="btn" @click="handleUploadConfirm">{{ t('确认上传') }}</div>
-            </div>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { ref, watch } from "vue";
-import { Popup } from "vant";
-import upload from "@/components/upload";
-import { ElMessage } from "element-plus";
-import eventBus from "@/api/eventBus";
-
-const props = defineProps({
-    modelValue: {
-        type: Boolean,
-        default: false,
-    },
-    recordId: {
-        type: [String, Number],
-        default: null,
-    },
-    tipText: {
-        type: String,
-        default: "请上传复核照片",
-    },
-    showExampleImg: {
-        type: Boolean,
-        default: true,
-    },
-    maxCount: {
-        type: Number,
-        default: 3,
-    },
-});
-
-const emit = defineEmits(["update:modelValue", "success"]);
-
-const show = ref(false);
-const images = ref([]);
-
-watch(
-    () => props.modelValue,
-    (val) => {
-        show.value = val;
-        if (!val) {
-            images.value = [];
-        }
-    }
-);
-
-watch(show, (val) => {
-    emit("update:modelValue", val);
-});
-
-function handleUpload({ imgArr }) {
-    images.value = imgArr;
-}
-
-// 确认上传处理函数
-const handleUploadConfirm = () => {
-    if (images.value.length === 0) {
-        ElMessage.warning({ message: t('请上传照片'), type: 'warning' });
-        return;
-    }
-    if(props.recordId){
-        const params = {
-            recordId: props.recordId,
-            executeEvidence: images.value,
-        };
-        VE_API.monitor.addReviewImg(params).then((res) => {
-            if (res.code === 0) {
-                ElMessage.success({ message: t('上传成功'), type: 'success' });
-                show.value = false;
-                emit("success");
-            }
-        });
-    }else{
-        show.value = false;
-        emit("success", images.value);  
-    }
-};
-
-const handleClosed = () => {
-    eventBus.emit("upload:reset");
-};
-</script>
-
-<style lang="scss" scoped>
-.upload-popup {
-    width: 90%;
-    box-sizing: border-box;
-    padding: 20px 18px;
-    background: linear-gradient(0deg, #ffffff 70%, #d1ebff 100%);
-    border-radius: 10px;
-
-    .upload-content {
-        .upload-tips {
-            font-size: 16px;
-            font-weight: 500;
-            color: #000;
-            margin-bottom: 8px;
-            .required {
-                color: #ff4d4f;
-                margin-right: 4px;
-            }
-        }
-        .upload-wrap {
-            margin: 12px 0 24px;
-            .example {
-                width: 80px;
-                height: 80px;
-            }
-            .example + .example {
-                margin-left: 12px;
-            }
-        }
-        .upload-footer {
-            margin-top: 20px;
-            display: flex;
-            justify-content: center;
-
-            .btn {
-                width: 80%;
-                padding: 12px;
-                background: #2199f8;
-                border-radius: 25px;
-                color: #fff;
-                font-size: 16px;
-                text-align: center;
-            }
-        }
-    }
-}
-</style>
-

+ 0 - 161
src/components/popup/selectRegionPopup.vue

@@ -1,161 +0,0 @@
-<template>
-    <popup v-model:show="showValue" round class="select-region-popup" z-index="10000" teleport="body">
-        <div class="image-wrapper">
-            <div class="map-container" ref="mapContainer"></div>
-        </div>
-        <div class="content">
-            <div class="title">{{ title }}</div>
-            <div class="sub-title">{{ subTitle }}</div>
-        </div>
-        <div class="actions">
-            <div class="btn btn-ghost" @click="handleSkip">{{ t('跳过') }}</div>
-            <div class="btn btn-primary" @click="handleConfirm">{{ t('去勾选') }}</div>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { Popup } from "vant";
-import { computed, ref, watch, onMounted, onBeforeUnmount, nextTick } from "vue";
-import DrawRegionMap from "@/views/old_mini/interactionList/map/drawRegionMap.js";
-
-const props = defineProps({
-    show: {
-        type: Boolean,
-        default: false,
-    },
-    title: {
-        type: String,
-        default: "勾选 区域",
-    },
-    subTitle: {
-        type: String,
-        default: "精准匹配农情信息,高效管理分区",
-    },
-    /** 地图中心点,WKT POINT 格式 */
-    centerPoint: {
-        type: String,
-        default: "POINT (113.6142086995688 23.585836479509055)",
-    },
-});
-
-const emit = defineEmits(["update:show", "skip", "confirm"]);
-
-const mapContainer = ref(null);
-const drawRegionMap = new DrawRegionMap();
-
-const showValue = computed({
-    get: () => props.show,
-    set: (value) => emit("update:show", value),
-});
-
-const handleSkip = () => {
-    emit("skip");
-    emit("update:show", false);
-};
-
-const handleConfirm = () => {
-    emit("confirm");
-    emit("update:show", false);
-};
-
-const initMap = () => {
-    if (!mapContainer.value) return;
-    if (drawRegionMap.kmap) return;
-    // 在弹窗中以只读模式展示地图(仅中心点,不回显地块)
-    drawRegionMap.initMap(props.centerPoint, mapContainer.value, false, false, true);
-};
-
-const destroyMap = () => {
-    if (drawRegionMap && drawRegionMap.kmap && drawRegionMap.destroyMap) {
-        drawRegionMap.destroyMap();
-    }
-};
-
-onMounted(() => {
-    if (showValue.value) {
-        nextTick(() => {
-            initMap();
-        });
-    }
-});
-
-watch(
-    () => showValue.value,
-    (val) => {
-        if (val) {
-            nextTick(() => {
-                destroyMap();
-                initMap();
-            });
-        } else {
-            destroyMap();
-        }
-    }
-);
-
-onBeforeUnmount(() => {
-    destroyMap();
-});
-</script>
-
-<style scoped lang="scss">
-.select-region-popup {
-    width: 100%;
-    padding: 20px;
-
-    .image-wrapper {
-        width: 100%;
-        background: #ffffff;
-    }
-
-    .map-container {
-        width: 100%;
-        height: 180px;
-        border-radius: 8px;
-        overflow: hidden;
-    }
-
-    .content {
-        margin-top: 12px;
-        text-align: center;
-
-        .title {
-            font-size: 22px;
-            margin-bottom: 4px;
-        }
-
-        .sub-title {
-            font-size: 20px;
-        }
-    }
-
-    .actions {
-        display: flex;
-        justify-content: space-between;
-        margin-top: 28px;
-        gap: 10px;
-        .btn {
-            height: 40px;
-            line-height: 40px;
-            border-radius: 25px;
-            text-align: center;
-        }
-
-        .btn-ghost {
-            width: 110px;
-            border: 1px solid rgba(153, 153, 153, 0.5);
-            color: #666666;
-        }
-
-        .btn-primary {
-            width: 162px;
-            background: #2199f8;
-            color: #ffffff;
-            border: 1px solid #2199f8;
-        }
-    }
-}
-</style>

+ 0 - 185
src/components/popup/startInteractPopup.vue

@@ -1,185 +0,0 @@
-<template>
-    <popup
-        v-model:show="showValue"
-        round
-        class="start-interact-popup"
-        teleport="body"
-        z-index="9999"
-    >
-        <div class="popup-content">
-            <!-- 头部区域 -->
-            <div class="popup-header">
-                <img class="expert-logo" src="@/assets/img/home/bird.png" alt="" />
-                <!-- <img class="expert-logo" :src="popupData?.expertAvatar" alt="" /> -->
-                <!-- <el-avatar :size="26" :src="popupData?.expertAvatar" /> -->
-                <div class="expert-info">
-                    <!-- <span>{{ popupData?.expertName || "韦帮稳" }}专家</span> -->
-                    <span>{{ t('飞鸟') }}</span>
-                    <span class="invite-text">{{ t('邀请您进行农情互动') }}</span>
-                </div>
-            </div>
-            <div class="popup-tips">{{ t('为了将农事方案与您的品种匹配,请您录入品种信息') }}</div>
-
-
-            <!-- 标题 -->
-            <div class="popup-title">{{ t('农情互动') }}</div>
-
-            <!-- 异常信息区域 -->
-            <div class="abnormal-info">
-                完善作物品种以及物候信息,精准匹配种植方案,实现精细化管理
-            </div>
-
-            <!-- 图片区域 -->
-            <img src="@/assets/img/home/start.png" alt="农事执行图片" class="execute-image" />
-
-            <!-- 按钮区域 -->
-            <div class="popup-buttons">
-                <div class="btn-executed" @click="handleExecuted">
-                    开始采集
-                </div>
-            </div>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { Popup } from "vant";
-import { ref } from "vue";
-import { useRouter } from "vue-router";
-
-const router = useRouter();
-
-const popupData = ref({
-    expertName: "",
-    expertAvatar: "",
-});
-
-const showValue = ref(false);
-
-// 开始采集
-const handleExecuted = () => {
-    
-    showValue.value = false;
-    router.push("/interaction?subjectId=" + localStorage.getItem("selectedFarmId"));
-};
-
-const getPhenologyInitOrConfirmStatus = async () => {
-    const { data } = await VE_API.farm_v3.phenologyInitOrConfirmStatus({ subjectId: localStorage.getItem("selectedFarmId") });
-    if (!data?.farms ||!data.farms.length) {
-        // showValue.value = false;
-        return;
-    }
-    popupData.value = data.farms[0];
-    showValue.value = true;
-}
-
-defineExpose({
-    getPhenologyInitOrConfirmStatus,
-});
-</script>
-
-<style scoped lang="scss">
-.start-interact-popup {
-    width: 100%;
-    padding: 13px 16px;
-    border-radius: 12px;
-
-    .popup-content {
-        display: flex;
-        flex-direction: column;
-    }
-
-    .popup-tips{
-        color: #000;
-        font-size: 16px;
-        margin-bottom: 5px;
-    }
-
-    .popup-header {
-        margin-bottom: 5px;
-        display: flex;
-        align-items: center;
-        gap: 6px;
-        .expert-logo {
-            width: 22px;
-            height: 22px;
-            border-radius: 50%;
-            object-fit: cover;
-        }
-
-        .expert-info {
-            font-size: 12px;
-            color: #000;
-            .invite-text {
-                margin-left: 6px;
-                color: rgba(0, 0, 0, 0.4);
-            }
-        }
-    }
-
-    .popup-title {
-        font-size: 24px;
-        margin-bottom: 6px;
-        font-family: "PangMenZhengDao";
-        color: #0785E8;
-    }
-
-    .abnormal-info {
-        padding: 12px;
-        color: #2199f8;
-        background: rgba(33, 153, 248, 0.1);
-        padding: 3px 9px 9px;
-        border-radius: 8px;
-        position: relative;
-        margin-top: 5px;
-        
-        // 三角形小尖尖
-        &::before {
-            content: "";
-            position: absolute;
-            top: -7.5px;
-            left: 20px;
-            width: 0;
-            height: 0;
-            border-left: 15px solid transparent;
-            border-right: 2px solid transparent;
-            border-bottom: 8px solid rgba(33, 153, 248, 0.1);
-        }
-    }
-
-    .execute-image {
-        width: 100%;
-        height: 170px;
-        border-radius: 5px;
-        object-fit: cover;
-        margin: 11px 0 13px 0;
-    }
-
-    .popup-buttons {
-        display: flex;
-        gap: 13px;
-
-        .btn-later,
-        .btn-executed {
-            flex: 1;
-            padding: 8px;
-            border-radius: 4px;
-            font-size: 16px;
-            text-align: center;
-        }
-
-        .btn-later {
-            border: 1px solid #d7d7d7;
-            color: #9d9d9d;
-        }
-
-        .btn-executed {
-            background: #2199f8;
-            color: #ffffff;
-            border: 1px solid #2199f8;
-        }
-    }
-}
-</style>

+ 0 - 119
src/components/popup/uploadTips.vue

@@ -1,119 +0,0 @@
-<template>
-    <popup v-model:show="showValue" round class="upload-tips-popup" teleport="body">
-        <div class="title">{{ t('上传提示') }}</div>
-        <div class="tips-box">
-            <Highlight class="tips-text" source-string="请使用 水印相机 APP 进行拍摄照片照片需要显示 时间和位置 水印"
-                :keywords="['水印相机 APP', '时间和位置']" />
-        </div>
-        <div class="img-box">
-            <img src="@/assets/img/monitor/upload-tip-img.png" alt="">
-            <div class="img-text">{{ t('示例图片') }}</div>
-            <div class="img-info">
-                <span class="img-time">14:33</span>
-                <div class="info-text">
-                    <span>{{ t('2026.03.11 星期三') }}</span>
-                    <span class="address">{{ t('广州市从化区江埔街九里步') }}</span>
-                </div>
-            </div>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { Popup, Highlight } from "vant";
-import { computed } from "vue";
-
-const props = defineProps({
-    show: {
-        type: Boolean,
-        default: false,
-    },
-});
-
-const emit = defineEmits(["update:show", "know", "next"]);
-
-const showValue = computed({
-    get: () => props.show,
-    set: (value) => emit("update:show", value),
-});
-
-const handleKnow = () => {
-    emit("know");
-    emit("update:show", false);
-};
-
-const handleNext = () => {
-    emit("next");
-    emit("update:show", false);
-};
-</script>
-
-<style scoped lang="scss">
-.upload-tips-popup {
-    width: 100%;
-    padding: 20px 18px;
-
-    .title {
-        font-size: 28px;
-        color: #2F2F2F;
-        font-family: "PangMenZhengDao";
-        text-align: center;
-    }
-
-    .tips-box {
-        padding: 12px 10px;
-        background: rgba(33, 153, 248, 0.1);
-        border-radius: 5px;
-        margin: 10px 0 12px 0;
-
-        .tips-text {
-            font-size: 16px;
-            line-height: 30px;
-            text-align: center;
-        }
-    }
-
-    .img-box {
-        width: 100%;
-        height: 210px;
-        position: relative;
-
-        img {
-            width: 100%;
-            height: 100%;
-        }
-
-        .img-text {
-            position: absolute;
-            top: 0;
-            left: 0;
-            background: rgba(0, 0, 0, 0.7);
-            color: #fff;
-            font-size: 12px;
-            padding: 4px 12px;
-            border-radius: 8px 0 8px 0;
-        }
-
-        .img-info {
-            position: absolute;
-            bottom: 15px;
-            left: 0;
-            color: #fff;
-            text-align: center;
-            width: 100%;
-            .img-time {
-                font-size: 36px;
-            }
-            .info-text {
-                font-size: 13px;
-                margin-top: 5px;
-                .address{
-                    margin-left: 12px;
-                }
-            }
-        }
-    }
-}
-</style>

+ 0 - 492
src/components/recordItem.vue

@@ -1,492 +0,0 @@
-<template>
-    <div class="record-item">
-        <div class="record-title">
-            <!-- 内置标题模板 -->
-            <div v-if="titleMode === 'default'" class="box-title">
-                <div class="title-l">
-                    {{ recordItemData.farmWorkName || recordItemData.name }}
-                    <span class="parent-text" v-if="recordItemData.type!=null || recordItemData.farmWorkType!=null">
-                        {{ farmWorkType[recordItemData.type!=null ? recordItemData.type : recordItemData.farmWorkType] }}
-                    </span>
-                </div>
-                <!-- 按钮样式 -->
-                <div
-                    v-if="titleRightText && titleRightType !== 'dot'"
-                    class="title-r title-r-button"
-                    @click.stop="handleTitleRightClick(recordItemData)"
-                >
-                    {{ titleRightText }}
-                </div>
-                <!-- 点样式 -->
-                <div v-if="titleRightDotText && titleRightType === 'dot'" class="title-r title-r-dot">
-                    <span class="r-dot"></span>
-                    {{ titleRightDotText }}
-                </div>
-            </div>
-            <!-- 自定义标题插槽 -->
-            <slot v-else name="title"></slot>
-        </div>
-        <!-- 服务详情模式的内容 -->
-        <div v-if="contentMode === 'serviceDetail'" class="record-content service-detail-content">
-            <div class="content-info">
-                <div class="info-line">
-                    药物处方:<span class="info-val">{{ getPrescriptionInfo(recordItemData) }}</span>
-                </div>
-                <div
-                    class="review-image"
-                    v-if="
-                        (showFarmImage && recordItemData.executeEvidence?.length) ||
-                        recordItemData.executeEvidenceList?.length
-                    "
-                >
-                    <!-- <div class="image-wrapper" v-if="currentImageUrl">
-                        <span class="image-label">{{ t('执行照片') }}</span>
-                        <img :src="currentImageUrl" alt="" />
-                    </div> -->
-                    <div class="image-wrapper">
-                        <span class="image-label">{{ t('执行照片') }}</span>
-                        <img
-                            v-if="recordItemData.executeEvidence?.[0]"
-                            :src="base_img_url2 + recordItemData.executeEvidence?.[0]"
-                            alt=""
-                        />
-                        <img v-else :src="base_img_url2 + recordItemData.executeEvidenceList?.[0]" alt="" />
-                    </div>
-                    <div class="image-wrapper">
-                        <span class="image-label">{{ t('执行照片') }}</span>
-                        <img
-                            v-if="recordItemData.executeEvidence?.[1]"
-                            :src="base_img_url2 + recordItemData.executeEvidence?.[1]"
-                            alt=""
-                        />
-                        <img v-else :src="base_img_url2 + recordItemData.executeEvidenceList?.[1]" alt="" />
-                    </div>
-                </div>
-            </div>
-        </div>
-        <!-- 自定义内容插槽 -->
-        <slot name="content" v-else-if="showContent"></slot>
-        <!-- 默认内容 -->
-        <div class="record-content" v-else>
-            <div class="info-item">
-                推荐时间:
-                <span class="info-val">{{ recordItemData?.executeDate || recordItemData?.interactionTime || "--" }}</span>
-            </div>
-            <div
-                class="info-item recipe-name"
-                v-if="onlyRecipeName && recordItemData?.prescriptionList && recordItemData?.prescriptionList.length"
-            >
-                <span class="name-text">{{ t('药物处方:') }}</span>
-                <div class="rescription info-val">
-                    <span v-for="(fertilizer, fertilizerI) in recordItemData.prescriptionList" :key="fertilizerI">
-                        <span v-for="(pest, pestI) in fertilizer.pesticideFertilizerList" :key="'sub' + pestI">
-                            {{ pest.defaultName || pest.pesticideFertilizerName || '暂无处方' }}
-                            <span
-                                v-if="
-                                    pestI !== fertilizer.pesticideFertilizerList.length - 1 ||
-                                    fertilizerI !== recordItemData.prescriptionList.length - 1
-                                "
-                            >
-                                +
-                            </span>
-                        </span>
-                    </span>
-                    <span v-if="!recordItemData.prescriptionList || !recordItemData.prescriptionList?.length || recordItemData.prescriptionList[0]?.pesticideFertilizerList?.length === 0">{{ t('无处方') }}</span>
-                </div>
-            </div>
-            <div
-                class="info-item recipe-name"
-                v-if="onlyRecipeName && recordItemData?.prescription && recordItemData?.prescription?.id != null"
-            >
-                <span class="name-text">{{ t('药物处方:') }}</span>
-                <div class="rescription info-val" v-if="recordItemData?.prescription?.pesticideFertilizerList.length > 0">
-                    <span
-                        v-for="(pest, pestI) in recordItemData.prescription.pesticideFertilizerList"
-                        :key="'sub' + pestI"
-                    >
-                        {{ pest.name || '暂无处方' }}
-                        <span v-if="pestI !== recordItemData.prescription.pesticideFertilizerList.length - 1"> + </span>
-                    </span>
-                </div>
-                <div class="rescription info-val" v-else>
-                    暂无处方
-                </div>
-            </div>
-            <div
-                class="info-item"
-                v-if="
-                    !onlyRecipeName &&
-                    recordItemData?.farmWorkDetail?.prescription &&
-                    recordItemData?.farmWorkDetail?.prescription
-                "
-            >
-                药物处方
-                <div class="info-table">
-                    <div class="table">
-                        <div class="th">
-                            <div class="td">{{ t('类型') }}</div>
-                            <div class="td width">{{ t('名称') }}</div>
-                            <div class="td">{{ t('配比') }}</div>
-                            <div class="td">{{ t('方式') }}</div>
-                        </div>
-                        <div>
-                            <div
-                                class="tr"
-                                v-for="(subP, subI) in recordItemData.farmWorkDetail.prescription
-                                    .pesticideFertilizerList"
-                                :key="subI"
-                            >
-                                <div class="td">{{ subP.typeName }}</div>
-                                <div class="td width">{{ subP.name }}</div>
-                                <div class="td">{{ subP.ratio }}</div>
-                                <div class="td">{{ t('人工') }}</div>
-                            </div>
-                        </div>
-                        <!-- <div class="tr">
-                            <div class="td width">{{ t('80%代森锰锌') }}</div>
-                            <div class="td">{{ t('山德生') }}</div>
-                            <div class="td">1:2000</div>
-                            <div class="td">{{ t('人工') }}</div>
-                        </div> -->
-                    </div>
-                </div>
-            </div>
-            <div class="info-item" v-if="recordItemData?.estimatedCost">
-                预计报价:
-                <span class="info-val">{{
-                    recordItemData?.estimatedCost || 0
-                }}元</span>
-            </div>
-            <div class="info-item one-text">
-                农事编号:
-                <span class="info-val">{{
-                    recordItemData?.farmWorkDetail?.code || recordItemData.farmWorkCode || recordItemData.code
-                }}</span>
-            </div>
-            <div class="info-item" v-if="recordItemData?.attention">
-                巡园提醒:
-                <span class="info-val">{{ recordItemData?.attention || "暂无巡园提醒" }}</span>
-            </div>
-        </div>
-        <slot name="footer"></slot>
-    </div>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { ref, computed, watch } from "vue";
-import { base_img_url2 } from "@/api/config";
-const emit = defineEmits(["titleRightClick"]);
-const props = defineProps({
-    onlyRecipeName: {
-        type: Boolean,
-        default: false,
-    },
-    showFarmImage: {
-        type: Boolean,
-        default: false,
-    },
-    recordItemData: {
-        type: Object,
-        default: () => ({}),
-    },
-    showContent: {
-        type: Boolean,
-        default: false,
-    },
-    contentMode: {
-        type: String,
-        default: "",
-        validator: (value) => ["", "serviceDetail"].includes(value),
-    },
-    titleMode: {
-        type: String,
-        default: "",
-        validator: (value) => ["", "default"].includes(value),
-    },
-    titleRightText: {
-        type: String,
-        default: "",
-    },
-    titleRightType: {
-        type: String,
-        default: "button",
-        validator: (value) => ["button", "dot"].includes(value),
-    },
-    titleRightDotText: {
-        type: String,
-        default: "",
-    },
-});
-
-const getPrescriptionInfo = (section) => {
-    // 将 prescriptionList 中所有 pesticideFertilizerName 用 + 连接
-    if (section && Array.isArray(section.prescriptionList)) {
-        const names = section.prescriptionList
-            .flatMap((item) => (Array.isArray(item?.pesticideFertilizerList) ? item.pesticideFertilizerList : []))
-            .map((sub) => sub?.pesticideFertilizerName)
-            .filter((name) => typeof name === "string" && name.trim().length > 0);
-        if (names.length > 0) {
-            return names.join("+");
-        }
-    }
-    return "无处方";
-};
-
-const farmWorkType = {
-    0: "预警农事",
-    1: "标准农事",
-    2: "建议农事",
-    3: "自建农事",
-};
-
-// 使用响应式对象存储图片 URL
-const imageUrlMap = ref({});
-// 存储正在加载的 ID,避免重复请求
-const loadingIds = ref(new Set());
-
-// 获取图片 URL 的函数
-const fetchImageUrl = (id) => {
-    // 如果 id 不存在或已经在加载中,直接返回
-    if (!id || loadingIds.value.has(id)) {
-        return;
-    }
-
-    // 如果已经有缓存的 URL,直接返回
-    if (imageUrlMap.value[id]) {
-        return;
-    }
-
-    // 标记为加载中
-    loadingIds.value.add(id);
-
-    // 发起异步请求获取图片 URL
-    VE_API.z_farm_work_record
-        .getTriggerImg({ farmWorkRecordId: id })
-        .then(({ data }) => {
-            if (data && data.length > 0) {
-                const url = base_img_url2 + data[data.length - 1].cloudFilename;
-                // 更新响应式数据,这样模板会自动更新
-                imageUrlMap.value[id] = url;
-            } else {
-                imageUrlMap.value[id] = "";
-            }
-        })
-        .catch(() => {
-            // 请求失败时,设置为空字符串避免重复请求
-            imageUrlMap.value[id] = "";
-        })
-        .finally(() => {
-            // 清除加载标记
-            loadingIds.value.delete(id);
-        });
-};
-
-// 计算属性:根据 recordItemData.id 获取图片 URL(响应式)
-// const currentImageUrl = computed(() => {
-//     const id = props.recordItemData?.id;
-//     if (id) {
-//         // 触发获取图片 URL(如果还没有获取过)
-//         fetchImageUrl(id);
-//         // 直接返回响应式数据,Vue 会自动追踪变化
-//         return imageUrlMap.value[id] || "";
-//     }
-//     return "";
-// });
-
-// 监听 recordItemData.id 的变化,确保 ID 变化时重新获取
-// watch(
-//     () => props.recordItemData?.id,
-//     (newId) => {
-//         if (props.showFarmImage) {
-//             if (newId && !imageUrlMap.value[newId] && !loadingIds.value.has(newId)) {
-//                 fetchImageUrl(newId);
-//             }
-//         }
-//     },
-//     { immediate: true }
-// );
-
-const handleTitleRightClick = (recordItemData) => {
-    emit("titleRightClick", recordItemData);
-};
-</script>
-
-<style lang="scss" scoped>
-.record-item {
-    background: #ffffff;
-    border-radius: 8px;
-    padding: 12px;
-    margin-bottom: 10px;
-    .record-title {
-        font-size: 16px;
-        color: #333333;
-        .box-title {
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
-            padding-bottom: 8px;
-            .title-l {
-                font-size: 16px;
-                font-weight: 600;
-                color: #000;
-                display: flex;
-                align-items: center;
-                .parent-text {
-                    margin-left: 5px;
-                    font-size: 12px;
-                    font-weight: normal;
-                    padding: 4px 6px;
-                    border-radius: 14px;
-                    background: rgba(119, 119, 119, 0.1);
-                }
-            }
-            .title-btn {
-                width: 24px;
-                height: 24px;
-                border-radius: 50%;
-                background: #2199f8;
-                display: flex;
-                align-items: center;
-                justify-content: center;
-            }
-            .title-r {
-                font-size: 12px;
-                &.title-r-button {
-                    padding: 5px 10px;
-                    border-radius: 20px;
-                    border: 1px solid #ff953d;
-                    color: #ff953d;
-                }
-                &.title-r-dot {
-                    display: flex;
-                    align-items: center;
-                    color: #393939;
-                    .r-dot {
-                        width: 6px;
-                        height: 6px;
-                        border-radius: 50%;
-                        background: #393939;
-                        margin-right: 5px;
-                    }
-                }
-            }
-        }
-    }
-    .record-content {
-        font-size: 12px;
-        .info-item {
-            color: #bbbbbb;
-            margin-bottom: 4px;
-            .info-val {
-                color: #666666;
-            }
-            &.one-text {
-                width: 100%;
-                white-space: nowrap;
-                overflow: hidden;
-                text-overflow: ellipsis;
-            }
-        }
-        .recipe-name {
-            display: flex;
-            .name-text {
-                flex: none;
-            }
-
-            .rescription {
-                max-width: 100%;
-                white-space: nowrap;
-                overflow: hidden;
-                text-overflow: ellipsis;
-            }
-        }
-        .info-table {
-            margin-top: 8px;
-
-            .table {
-                border: 1px solid rgba(196, 196, 196, 0.8);
-                border-radius: 4px;
-                font-size: 13px;
-                .th {
-                    background: #f6f6f6;
-                    color: #999999;
-                    display: flex;
-                    justify-content: space-between;
-                    border-radius: 4px 4px 0 0;
-                    padding: 4px 0;
-                }
-                .tr {
-                    display: flex;
-                    justify-content: space-between;
-                    align-items: center;
-                    color: #333333;
-                    padding: 10px 0;
-                }
-
-                .tr + .tr {
-                    border-top: 1px solid rgba(0, 0, 0, 0.08);
-                }
-                .td {
-                    width: 25%;
-                    padding: 0 2px;
-                    text-align: center;
-                }
-                .width {
-                    width: 55%;
-                }
-            }
-        }
-    }
-    // 服务详情模式样式
-    .service-detail-content {
-        .content-info {
-            .info-line {
-                font-size: 12px;
-                color: #bbbbbb;
-                margin-bottom: 8px;
-                line-height: 1.4;
-                .info-val {
-                    color: #666666;
-                }
-            }
-            .review-title {
-                .info-val {
-                    margin-top: 5px;
-                }
-            }
-            .review-image {
-                display: flex;
-                align-items: center;
-                gap: 8px;
-                .image-wrapper {
-                    position: relative;
-                    flex: 1;
-                    img {
-                        width: 100%;
-                        height: 105px;
-                        object-fit: cover;
-                        border-radius: 8px;
-                    }
-                    .image-label {
-                        position: absolute;
-                        top: 0;
-                        left: 0;
-                        padding: 4px 10px;
-                        background: rgba(54, 52, 52, 0.6);
-                        color: #fff;
-                        font-size: 12px;
-                        border-radius: 8px 0 8px 0;
-                        z-index: 1;
-                        backdrop-filter: blur(4px);
-                    }
-                }
-            }
-        }
-        .content-info + .content-info {
-            margin-top: 8px;
-        }
-    }
-}
-</style>

+ 0 - 400
src/components/weatherChart.vue

@@ -1,400 +0,0 @@
-<template>
-    <div ref="chartDom" class="chart"></div>
-</template>
-
-<script setup>
-import { onMounted, ref, watch } from "vue";
-import * as echarts from "echarts";
-
-const props = defineProps({
-    weatherData: {
-        type: Object,
-        default: null,
-    },
-});
-
-// 将接口数据转换为图表需要的格式
-function formatWeatherData(weatherData) {
-    if (!weatherData || !weatherData.daily || !Array.isArray(weatherData.daily)) {
-        return [];
-    }
-    
-    const weekDays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
-    
-    return weatherData.daily.map((item) => {
-        // 格式化日期:从 "2025-11-14" 转换为 "11/14"
-        const date = new Date(item.fxDate);
-        const month = String(date.getMonth() + 1).padStart(2, '0');
-        const day = String(date.getDate()).padStart(2, '0');
-        const rq = `${month}/${day}`;
-        
-        // 获取星期几
-        const weekDay = weekDays[date.getDay()];
-        
-        // 根据 iconDay 和 iconNight 生成图片URL(这里需要根据实际API返回的icon值来映射)
-        // 暂时使用默认图片,后续可以根据icon值映射到具体图片
-        const getWeatherImg = (icon) => {
-            // 可以根据icon值返回对应的图片URL
-            // 例如:icon "100" -> 晴, "101" -> 多云, "104" -> 阴等
-            // return `https://d.scggqx.com/forecast/img/${icon}.png`;
-            return `https://birdseye-img.sysuimars.com/weather/${icon}.svg`;
-        };
-        
-        return {
-            rq: rq,
-            weatherZgwd: item.tempMax,
-            weatherZdwd: item.tempMin,
-            weatherTqDay: item.textDay,
-            weatherTqNight: item.textNight,
-            weatherImgDay: getWeatherImg(item.iconDay),
-            weatherImgNight: getWeatherImg(item.iconNight),
-            windDirectDay: item.windDirDay,
-            windDirectNight: item.windDirNight,
-            windPowerDay: item.windScaleDay,
-            windPowerNight: item.windScaleNight,
-            week: weekDay,
-        };
-    });
-}
-
-// 处理天气数据
-function processWeatherData(data) {
-    let weekday = [];
-    let datelist = [];
-    let weatherDaylist = [];
-    let weatherNightlist = [];
-    let weatherImgDaylist = [];
-    let weatherImgNightlist = [];
-    let windDirectlist = [];
-    let windPowerlist = [];
-    let weatherZgwdlist = [];
-    let weatherZdwdlist = [];
-
-    data.forEach((item) => {
-        weekday.push(item.week);
-        datelist.push(item.rq);
-        weatherDaylist.push(item.weatherTqDay);
-        weatherNightlist.push(item.weatherTqNight);
-        weatherImgDaylist.push(item.weatherImgDay);
-        weatherImgNightlist.push(item.weatherImgNight);
-        windDirectlist.push(item.windDirectDay);
-        windPowerlist.push(item.windPowerDay);
-        weatherZgwdlist.push(item.weatherZgwd);
-        weatherZdwdlist.push(item.weatherZdwd);
-    });
-    
-    const maxWD = weatherZgwdlist.length > 0 ? Math.max(...weatherZgwdlist) + 30 : 60;
-    const minWD = weatherZdwdlist.length > 0 ? Math.min(...weatherZdwdlist) - 30 : 0;
-    
-    return {
-        weekday,
-        datelist,
-        weatherDaylist,
-        weatherNightlist,
-        weatherImgDaylist,
-        weatherImgNightlist,
-        windDirectlist,
-        windPowerlist,
-        weatherZgwdlist,
-        weatherZdwdlist,
-        maxWD,
-        minWD
-    };
-}
-// 生成天气图片样式
-function generateWeatherImgRich(weatherImgList) {
-    const weatherImgListStyle = weatherImgList.map((item) => {
-        return {
-            backgroundColor: {
-                image: item,
-            },
-            height: 20,
-            width: 20,
-        };
-    });
-    
-    const rich = {};
-    weatherImgListStyle.forEach((i, index) => {
-        rich[index] = i;
-    });
-    return rich;
-}
-
-const myChart = ref(null);
-const chartDom = ref(null);
-
-// 初始化默认数据(用于首次渲染)
-const defaultData = formatWeatherData(null);
-const defaultProcessed = processWeatherData(defaultData.length > 0 ? defaultData : []);
-const defaultWeatherImgDaylistRich = generateWeatherImgRich(defaultProcessed.weatherImgDaylist);
-const defaultWeatherImgNightlistRich = generateWeatherImgRich(defaultProcessed.weatherImgNightlist);
-
-// 生成图表配置
-function generateOptions(processedData, weatherImgDaylistRich, weatherImgNightlistRich) {
-    return {
-    grid: {
-        top: "-100px",
-        right: "20px",
-        bottom: '-55px',
-        left: "-20px",
-        containLabel: true,
-    },
-    xAxis: [
-        {
-            type: "category",
-            boundaryGap: false,
-            position: "top",
-            offset: 0,
-            zlevel: 100,
-            axisLine: {
-                show: false,
-            },
-            axisTick: {
-                show: false,
-            },
-            splitLine: {
-                show: false,
-            },
-            axisLabel: {
-                interval: 0,
-                formatter: ["{a|{value}}"].join("\n"),
-                rich: {
-                    a: {
-                        color: "#000",
-                    },
-                },
-            },
-            data: processedData.weekday,
-        },
-        {
-            type: "category",
-            position: "top",
-            offset: -15,
-            boundaryGap: false,
-            zlevel: 100,
-            axisLine: {
-                show: false,
-            },
-            axisTick: {
-                show: false,
-            },
-            axisLabel: {
-                interval: 0,
-                formatter: ["{a|{value}}"].join("\n"),
-                rich: {
-                    a: {
-                        color: "#999999",
-                        fontSize: 10,
-                    },
-                },
-            },
-            data: processedData.datelist,
-            axisPointer: {
-                show: false,
-            },
-        },
-        {
-            type: "category",
-            position: "top",
-            offset: -35,
-            boundaryGap: false,
-            zlevel: 100,
-            axisLine: {
-                show: false,
-            },
-            axisTick: {
-                show: false,
-            },
-            axisLabel: {
-                interval: 0,
-                formatter: ["{a|{value}}"].join("\n"),
-                rich: {
-                    a: {
-                        color: "#000",
-                    },
-                },
-            },
-            data: processedData.weatherDaylist,
-            axisPointer: {
-                show: false,
-            },
-        },
-        {
-            type: "category",
-            boundaryGap: false,
-            position: "top",
-            offset: -60,
-            zlevel: 100,
-            axisLine: {
-                show: false,
-            },
-            axisTick: {
-                show: false,
-            },
-            axisLabel: {
-                interval: 0,
-                formatter: ["{{value}|}"].join("\n"),
-                rich: weatherImgDaylistRich,
-            },
-            data: processedData.weatherImgDaylist.map((_, index) => String(index)),
-            axisPointer: {
-                show: false,
-            },
-        },
-        {
-            type: "category",
-            position: "top",
-            offset: -80,
-            boundaryGap: false,
-            zlevel: 100,
-            axisLine: {
-                show: false,
-            },
-            axisTick: {
-                show: false,
-            },
-            axisLabel: {
-                interval: 0,
-                formatter: ["{a|{value}°}"].join("\n"),
-                rich: {
-                    a: {
-                        color: "#000",
-                    },
-                },
-            },
-            data: processedData.weatherZgwdlist,
-            axisPointer: {
-                show: false,
-            },
-        },
-        {
-            type: "category",
-            position: "top",
-            offset: -160,
-            boundaryGap: false,
-            zlevel: 100,
-            axisLine: {
-                show: false,
-            },
-            axisTick: {
-                show: false,
-            },
-            axisLabel: {
-                interval: 0,
-                formatter: ["{a|{value}°}"].join("\n"),
-                rich: {
-                    a: {
-                        color: "#000",
-                    },
-                },
-            },
-            data: processedData.weatherZdwdlist,
-            axisPointer: {
-                show: false,
-            },
-        },
-    ],
-    yAxis: {
-        show: false,
-        interval: 15,
-        type: "value",
-        axisLabel: {
-            formatter: "{value}" + "℃",
-        },
-        max: processedData.maxWD,
-        min: processedData.minWD,
-    },
-    series: [
-        {
-            name: "最高温度",
-            type: "line",
-            data: processedData.weatherZgwdlist,
-            symbol: "circle",
-            symbolSize: 3,
-            showSymbol: true,
-            smooth: true,
-            itemStyle: {
-                color: "#FA8258", // 设置圆形的填充色
-                borderColor: "#FA8258", // 设置边框颜色
-                borderWidth: 3, // 设置边框宽度
-            },
-            lineStyle: {
-                width: 2, // 设置折线的宽度
-                color: "#FA8258", // 设置折线的颜色
-                shadowColor: "#FA8258", // 线的阴影颜色
-                shadowBlur: 5, // 线的阴影模糊级数
-                shadowOffsetX: 0, // 线的阴影水平偏移
-                shadowOffsetY: 5, // 线的阴影垂直偏移
-            },
-            silent: false,
-        },
-        {
-            name: "最低温度",
-            type: "line",
-            data: processedData.weatherZdwdlist,
-            symbol: "circle",
-            symbolSize: 3,
-            showSymbol: true,
-            smooth: true,
-            itemStyle: {
-                color: "#2E9AFE", // 设置圆形的填充色
-                borderColor: "#2E9AFE", // 设置边框颜色
-                borderWidth: 3, // 设置边框宽度
-            },
-
-            lineStyle: {
-                width: 2, // 设置折线的宽度
-                color: "#2E9AFE", // 设置折线的颜色
-                shadowColor: "#2E9AFE", // 线的阴影颜色
-                shadowBlur: 5, // 线的阴影模糊级数
-                shadowOffsetX: 0, // 线的阴影水平偏移
-                shadowOffsetY: 5, // 线的阴影垂直偏移
-            },
-            silent: false,
-        },
-    ],
-    };
-}
-
-const options = ref(generateOptions(defaultProcessed, defaultWeatherImgDaylistRich, defaultWeatherImgNightlistRich));
-
-onMounted(() => {
-    setTimeout(() => {
-        initChart();
-    }, 200);
-});
-
-// 监听 weatherData 变化,更新图表
-watch(
-    () => props.weatherData,
-    (newValue) => {
-        if (newValue && newValue.daily) {
-            const formattedData = formatWeatherData(newValue);
-            const processedData = processWeatherData(formattedData);
-            const weatherImgDaylistRich = generateWeatherImgRich(processedData.weatherImgDaylist);
-            const weatherImgNightlistRich = generateWeatherImgRich(processedData.weatherImgNightlist);
-            
-            options.value = generateOptions(processedData, weatherImgDaylistRich, weatherImgNightlistRich);
-            
-            if (myChart.value) {
-                myChart.value.setOption(options.value);
-            }
-        }
-    },
-    { deep: true }
-);
-
-const initChart = () => {
-    myChart.value = echarts.init(chartDom.value);
-    myChart.value.setOption(options.value);
-};
-
-
-</script>
-
-<style lang="scss" scoped>
-.chart {
-    width: 100%;
-    height: 100%;
-}
-</style>

+ 0 - 673
src/components/weatherInfo copy.vue

@@ -1,673 +0,0 @@
-<template>
-    <div class="weather-info is-garden"
-        :class="{ expanded: isExpanded, 'no-farm': !hasFarm, 'no-weather': !hasWeather, 'farm-list': activeGarden === 'list' }">
-        <div class="header flex-center">
-            <div class="header-left">
-                <div class="address-select flex-center" v-if="hasFarm">
-                    <div class="garden-tabs">
-                        <div class="garden-item left-item" @click="handleGardenClick('current')"
-                            :class="{ 'active': activeGarden === 'current' }">
-                            <img class="current-icon"
-                                :src="activeGarden === 'current' ? require('@/assets/img/common/farm-active.png') : require('@/assets/img/common/farm.png')"
-                                alt="">
-                            <span class="current-name van-ellipsis">{{ farmName }}</span>
-                        </div>
-                        <img class="title-block" v-show="activeGarden === 'current'"
-                            src="@/assets/img/common/title-block.png" alt="">
-                        <img class="title-block" v-show="activeGarden !== 'current'"
-                            src="@/assets/img/common/title-block-active.png" alt="">
-                        <div class="garden-item right-item" @click="handleGardenClick('list')"
-                            :class="{ 'active': activeGarden === 'list' }">
-                            <img class="current-icon"
-                                :src="activeGarden === 'list' ? require('@/assets/img/common/menu-active.png') : require('@/assets/img/common/menu.png')"
-                                alt="">
-                            <span class="current-name">{{ t("weather.farmList") }}</span>
-                        </div>
-
-                        <div class="mask-wrap" v-if="props.showTabMask" @click="emit('closeTabMask')">
-                            <div class="mask-content">
-                                <div class="mask-text">
-                                    {{ t("weather.farmListGuide") }}
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-
-                <div class="address-select flex-center farm-name" v-else>
-                    {{ t("common.demoFarm") }}
-                </div>
-                <div class="farm-l" v-show="activeGarden === 'current' && hasWeather">
-                    <div class="temperature flex-center">
-
-                        <div class="weather-icon" v-if="currentWeather.iconDay">
-                            <i :class="'qi-' + currentWeather.iconDay + '-fill'"></i>
-                        </div>
-                        <div class="temperature-number">{{ currentWeather.temp || '--' }}</div>
-                        <div class="temperature-text">
-                            <span>{{ currentWeather.text }}</span>
-                            <div class="temperature-text-time">
-                                <span>{{ currentDateText }}</span>
-                                <span class="temperature-text-date">{{ currentWeekText }}</span>
-                                <span v-show="!isExpanded" class="temperature-text-more" @click="toggleExpand">
-                                    {{ t("weather.expandMore") }}
-                                </span>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="button-wrap" v-if="hasFarm">
-                        <!-- <div class="button-item" @click="handleFarmInfo">
-                            <img class="button-pre" src="@/assets/img/common/info.png" alt="">
-                            {{ t("weather.farmInfoMaintain") }}
-                        </div> -->
-                        <!-- <div class="button-item">
-                            <img class="button-pre" src="@/assets/img/common/idea.png" alt="">
-                            种植档案管理
-                        </div> -->
-                    </div>
-                </div>
-
-                <slot v-if="!hasWeather" name="types-content"></slot>
-            </div>
-            <!-- <div class="weather-icon" v-else>
-                <img :src="`https://birdseye-img.sysuimars.com/weather/${currentWeather.iconDay}.svg`" alt="" />
-            </div> -->
-        </div>
-        <div class="weather-chart-container" v-show="activeGarden === 'current' && hasWeather">
-            <div class="weather-chart-title">
-                <span>{{ t("weather.future7Days") }}</span>
-                <div class="weather-chart-title-more" @click="toggleExpand">{{ t("weather.collapse") }}</div>
-            </div>
-            <weather-chart class="weather-chart" :weather-data="weatherData"></weather-chart>
-        </div>
-        <!-- 农场筛选 -->
-        <div class="farm-filter" v-show="activeGarden === 'list'">
-            <div class="filter-l">
-                <el-input v-model="searchFarm" style="width: 96px" :placeholder="t('weather.searchFarm')" :prefix-icon="Search" />
-            </div>
-            <div class="filter-r">
-                <el-select v-model="regionVal" :placeholder="t('weather.selectRegion')" style="width: 92px">
-                    <el-option v-for="item in regionOptions" :key="item.value" :label="item.label"
-                        :value="item.value" />
-                </el-select>
-                <el-select v-model="typeVal" :placeholder="t('weather.selectCategory')" style="width: 92px">
-                    <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
-                </el-select>
-            </div>
-        </div>
-    </div>
-
-</template>
-
-<script setup>
-import { ref, onActivated, computed } from "vue";
-import weatherChart from "./weatherChart.vue";
-import { useRouter } from "vue-router";
-import { useStore } from "vuex";
-import { Search } from '@element-plus/icons-vue';
-import { convertPointToArray } from "@/utils/index";
-import { useI18n } from "@/i18n";
-
-const { t } = useI18n();
-const store = useStore();
-
-const props = defineProps({
-    showTabMask: {
-        type: Boolean,
-        default: false
-    },
-    gardenId: {
-        type: [Number, String],
-        default: null
-    },
-    hasWeather: {
-        type: Boolean,
-        default: true
-    },
-    from: {
-        type: String,
-        default: null
-    }
-});
-
-const regionVal = ref('');
-const typeVal = ref('');
-const searchFarm = ref('');
-const regionOptions = ref([{
-    label: '地区1',
-    value: '1'
-}, {
-    label: '地区2',
-    value: '2'
-}]);
-const typeOptions = ref([{
-    label: '品类1',
-    value: '1'
-}]);
-
-// 定义emit事件
-const emit = defineEmits(['weatherExpanded', 'changeGarden', 'changeGardenTab', 'closeTabMask']);
-const router = useRouter();
-
-const isExpanded = ref(false);
-const toggleExpand = () => {
-    isExpanded.value = !isExpanded.value;
-    emit('weatherExpanded', isExpanded.value);
-};
-
-const farmId = ref(null);
-const farmName = ref("");
-const hasFarm = ref(false)
-const activeGarden = ref('current');
-
-onActivated(() => {
-    handleGardenClick('current');
-});
-
-function setGardenLoaded(hasFarmData) {
-    hasFarm.value = !!hasFarmData;
-    if (!hasFarm.value) {
-        farmId.value = null;
-        farmName.value = "";
-    }
-}
-
-function setSelectedGarden(payload) {
-    if (!payload?.id) {
-        setGardenLoaded(false);
-        getLocationName();
-        getWeatherData();
-        return;
-    }
-
-    hasFarm.value = true;
-    farmId.value = Number(payload.id);
-    farmName.value = payload.name || "";
-    getLocationName();
-    getWeatherData();
-    emit('changeGarden', payload);
-}
-
-const handleFarmInfo = () => {
-    router.push(`/farm_info?subjectId=${farmId.value}`);
-}
-
-const handleGardenClick = (type) => {
-    activeGarden.value = type;
-    emit("changeGardenTab", type);
-};
-
-const locationName = ref("");
-const weatherData = ref(null);
-const currentWeather = ref({ temp: "--", text: "--", iconDay: "" });
-const MAP_KEY = "CZLBZ-LJICQ-R4A5J-BN62X-YXCRJ-GNBUT";
-function getLocationName() {
-    const locationPoint = localStorage.getItem('selectedFarmPoint') || store.state.home.miniUserLocationPoint;
-    const farmLocation = convertPointToArray(locationPoint);
-    let formattedLocation = `${farmLocation[1]},${farmLocation[0]}`;
-    const params = {
-        key: MAP_KEY,
-        location: formattedLocation,
-    };
-    VE_API.old_mini_map.location(params).then(({ result }) => {
-        // locationVal.value = result.formatted_addresses.recommend;
-        locationName.value = result?.address_component
-            ? result.address_component.city + result.address_component.district
-            : result?.address + "";
-    });
-}
-const handleAddFarm = () => {
-    router.push(`/create_farm?from=${props.from}&isReload=true`);
-}
-
-// 获取天气数据
-function getWeatherData() {
-    const point = localStorage.getItem('selectedFarmPoint') || store.state.home.miniUserLocationPoint;
-    if (!point) {
-        return;
-    }
-    VE_API.old_mini_map.get7d({ point }).then(({ data }) => {
-        if (data && data.daily && data.daily.length > 0) {
-            weatherData.value = data;
-            // 设置当前天气(第一天的数据)
-            const today = data.daily[0];
-            currentWeather.value = {
-                temp: today.tempMax || today.tempMin || 26,
-                text: today.textDay || t("weather.sunny"),
-                iconDay: today.iconDay,
-                fxDate: today.fxDate
-            };
-        }
-    }).catch(() => {
-        // 获取天气数据失败,使用默认值
-    });
-}
-
-// 获取当前日期和星期
-const currentDateText = computed(() => {
-    const now = new Date();
-    const month = String(now.getMonth() + 1).padStart(2, '0');
-    const day = String(now.getDate()).padStart(2, '0');
-    return `${month}/${day}`;
-});
-
-const currentWeekText = computed(() => {
-    if (!currentWeather.value?.fxDate) {
-        return "";
-    }
-
-    // 兼容 "YYYY-MM-DD" 格式,避免部分环境下直接 new Date() 解析异常
-    const date = new Date(currentWeather.value.fxDate.replace(/-/g, "/"));
-    if (Number.isNaN(date.getTime())) {
-        return "";
-    }
-
-    return t(`week.${date.getDay()}`);
-});
-
-
-// 暴露方法供父页面(如长势报告)同步农场列表状态
-defineExpose({
-    setGardenLoaded,
-    setSelectedGarden,
-    toggleExpand,
-    handleGardenClick
-});
-</script>
-
-<style lang="scss" scoped>
-.mask-wrap {
-    position: fixed;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: calc(100% - 300px);
-    background-color: rgba(0, 0, 0, 0.52);
-    z-index: 99999;
-    color: rgba(0, 0, 0, 0.9);
-    .mask-content {
-        position: absolute;
-        right: 51px;
-        top: 58px;
-        .mask-text {
-            background: #fff;
-            padding: 6px 16px;
-            border-radius: 10px;
-            font-size: 14px;
-            line-height: 22px;
-            text-align: center;
-            width: fit-content;
-            box-sizing: border-box;
-            border: 1px solid #DCDCDC;
-            position: relative;
-            z-index: 10px;
-            &::after {
-                content: '';
-                position: absolute;
-                right: 24px;
-                top: -10px;
-                width: 0;
-                height: 0;
-                border-right: 5px solid transparent;
-                border-top: 5px solid transparent;
-                border-left: 5px solid transparent;
-                border-bottom: 5px solid #fff;
-            }
-        }
-    }
-}
-.weather-info {
-    width: 100%;
-    // height: 58px;
-    height: 80px;
-    border-radius: 14px;
-    border: 0.5px solid #ffffff;
-    background: linear-gradient(180deg, #89CBFF 0%, #2199F8 100%);
-    box-sizing: border-box;
-    transition: height 0.3s ease-in-out;
-    overflow: hidden;
-
-    &.is-garden {
-        border-radius: 8px;
-        box-shadow: 0px -2px 4px 0px #0000000D;
-        // height: 130px;
-        height: 96px;
-    }
-
-    &.no-weather {
-        height: auto;
-    }
-
-    &.no-farm {
-        height: 80px;
-
-        &.expanded {
-            height: 312px;
-        }
-    }
-
-    &.expanded {
-        height: 362px;
-    }
-
-    &.bg-white {
-        border-radius: 14px;
-        background-image: linear-gradient(90deg, #e2f1fe 0%, #ffffff 80%);
-    }
-
-    &.farm-list {
-        height: 94px;
-    }
-
-    .flex-center {
-        display: flex;
-        align-items: center;
-    }
-
-    .header {
-        display: flex;
-        align-items: flex-end;
-        justify-content: space-between;
-
-        .header-left {
-            width: 100%;
-
-            .address-select {
-                .select-garden {
-                    width: fit-content;
-                    max-width: 170px;
-                    margin-right: 8px;
-                    margin-bottom: 10px;
-
-                    .el-dropdown-link {
-                        font-size: 15px;
-                        font-weight: 500;
-                        color: #000000;
-
-                        span {
-                            width: fit-content;
-                            max-width: 95%;
-                            margin-right: 4px;
-                        }
-
-                        .default-text {
-                            font-size: 12px;
-                            color: #fff;
-                            padding: 2px 4px;
-                            width: 44px;
-                            text-align: center;
-                            box-sizing: border-box;
-                            font-weight: 400;
-                            background-color: #2199f8;
-                            border-radius: 25px;
-                        }
-                    }
-                }
-
-                .btn-wrap {
-                    position: absolute;
-                    right: 10px;
-                    top: 8px;
-                    display: flex;
-                    gap: 8px;
-                }
-
-                .add-garden {
-                    font-size: 12px;
-                    color: #2199f8;
-                    padding: 3px 10px;
-                    border: 1px solid rgba(33, 153, 248, 0.5);
-                    border-radius: 25px;
-                    display: flex;
-                    align-items: center;
-                }
-
-                .gray-btn {
-                    color: #919191;
-                    border: 1px solid rgba(145, 145, 145, 0.5);
-                }
-            }
-
-            .farm-name {
-                font-size: 16px;
-                color: #1D2129;
-                background: #fff;
-                padding: 2px 0 4px 12px;
-            }
-
-            .temperature {
-                padding-left: 10px;
-                width: 100%;
-                box-sizing: border-box;
-                position: relative;
-                background: #fff;
-
-                .temperature-number {
-                    font-size: 38px;
-                    position: relative;
-                    margin: 0 8px;
-
-                    &::after {
-                        content: "°";
-                        font-size: 10px;
-                        position: absolute;
-                        right: -6px;
-                        top: 2px;
-                    }
-                }
-
-                .temperature-text {
-                    .temperature-text-time {
-                        font-size: 12px;
-                        font-weight: 400;
-                    }
-
-                    .temperature-text-more {
-                        font-size: 12px;
-                        color: #2199f8;
-                        margin-left: 10px;
-                        font-weight: 500;
-                        cursor: pointer;
-                    }
-
-                    .temperature-text-date {
-                        color: #1D2129;
-                        margin-left: 4px;
-                    }
-                }
-            }
-        }
-
-        .header-right {
-            width: 84px;
-            height: 73px;
-        }
-
-        .weather-icon {
-            i {
-                font-size: 40px;
-                color: #a7cffb;
-            }
-        }
-    }
-
-    .garden-tabs {
-        width: 100%;
-        display: flex;
-        align-items: center;
-
-        .garden-item {
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            gap: 6px;
-            height: 40px;
-            width: calc(50% - 17px);
-
-            // width:100px;
-            // background: linear-gradient(180deg, #89CBFF 0%, #2199F8 100%);
-            &.left-item {
-                padding-left: 10px;
-            }
-
-            &.right-item {
-                padding-right: 10px;
-                z-index: 9999999;
-            }
-
-            &.active {
-                background: #fff;
-
-                // background: linear-gradient(360deg, #FFFFFF 30.18%, #FFFFFF 82.87%, #D3ECFF 106.69%);
-                .current-name {
-                    color: #2199F8;
-                }
-            }
-
-            .current-name {
-                font-size: 18px;
-                color: #fff;
-                font-family: "PangMenZhengDao";
-            }
-
-            .current-icon {
-                width: 16px;
-            }
-        }
-
-        .title-block {
-            width: 34px;
-            height: 40px;
-        }
-    }
-
-    .button-wrap {
-        background: #fff;
-        display: flex;
-        justify-content: space-between;
-        gap: 10px;
-        color: #2199F8;
-        padding: 8px 10px;
-
-        .button-item {
-            border: 0.5px solid rgba(33, 153, 248, 0.5);
-            display: flex;
-            border-radius: 4px;
-            align-items: center;
-            height: 28px;
-            line-height: 28px;
-            box-sizing: border-box;
-            gap: 4px;
-            font-size: 12px;
-            flex: auto;
-            justify-content: center;
-        }
-
-        .button-pre {
-            width: 14px;
-            height: 14px;
-        }
-    }
-
-    .farm-filter {
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
-        padding: 12px 7px 8px 7px;
-        height: 53px;
-        box-sizing: border-box;
-        background: #ffffff;
-
-        .filter-l {
-            ::v-deep {
-                .el-input__wrapper {
-                    border-radius: 20px;
-                }
-
-                .el-input .el-input__icon {
-                    margin-right: 3px;
-                }
-            }
-        }
-
-        .filter-r {
-            display: flex;
-            align-items: center;
-            gap: 10px;
-
-            ::v-deep {
-                .el-select__wrapper {
-                    border-radius: 20px;
-                    padding: 4px 6px 4px 10px;
-                }
-            }
-        }
-    }
-
-    .weather-chart-container {
-        width: 100%;
-        height: 100%;
-        overflow: hidden;
-        padding: 8px 10px 0 10px;
-        box-sizing: border-box;
-        background: #ffffff;
-
-        .weather-chart-title {
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-            font-size: 12px;
-            font-weight: 500;
-
-            .weather-chart-title-more {
-                color: #828282;
-                cursor: pointer;
-                padding: 3px 10px;
-                border-radius: 25px;
-                font-weight: 400;
-                border: 1px solid rgba(130, 130, 130, 0.5);
-            }
-        }
-
-        .weather-chart {
-            margin-top: 5px;
-            width: 100%;
-            height: 180px;
-        }
-    }
-}
-</style>
-<style lang="scss">
-.select-garden-popper {
-    max-height: calc(100vh - 200px);
-    overflow-y: auto;
-
-    &.el-dropdown__popper {
-        .el-dropdown__list {
-            max-width: 250px;
-        }
-
-        .el-dropdown-menu__item {
-            background-color: transparent !important;
-            color: #606266 !important;
-        }
-
-        .selected-active-garden {
-            color: #2199f8 !important;
-            background-color: rgba(33, 153, 248, 0.1) !important;
-            font-weight: 500;
-        }
-    }
-
-    .dropdown-default-text {
-        font-size: 11px;
-        color: #2199f8;
-        margin-left: 8px;
-        padding: 0 5px;
-        background-color: rgba(33, 153, 248, 0.1);
-        border-radius: 10px;
-        font-weight: 400;
-    }
-}
-</style>

+ 0 - 715
src/components/weatherInfo.vue

@@ -1,715 +0,0 @@
-<template>
-    <div class="weather-info is-garden"
-        :class="{ expanded: isExpanded, 'no-farm': !hasFarm, 'no-weather': !hasWeather, 'farm-list': activeGarden === 'list' }">
-        <div class="header flex-center">
-            <div class="header-left">
-                <div class="address-select flex-center" v-if="hasFarm">
-                    <div class="garden-tabs">
-                        <div class="garden-item left-item" @click="handleGardenClick('current')"
-                            :class="{ 'active': activeGarden === 'current' }">
-                            <img class="current-icon"
-                                :src="activeGarden === 'current' ? require('@/assets/img/common/farm-active.png') : require('@/assets/img/common/farm.png')"
-                                alt="">
-                            <span class="current-name van-ellipsis">{{ farmName }}</span>
-                            <el-icon
-                                @click="handleFarmInfo"
-                                v-if="activeGarden === 'current'"
-                                class="farm-edit-icon"
-                            >
-                                <Edit />
-                            </el-icon>
-                        </div>
-                        <img class="title-block" v-show="activeGarden === 'current'"
-                            src="@/assets/img/common/title-block.png" alt="">
-                        <img class="title-block" v-show="activeGarden !== 'current'"
-                            src="@/assets/img/common/title-block-active.png" alt="">
-                        <div class="garden-item right-item" @click="handleGardenClick('list')"
-                            :class="{ 'active': activeGarden === 'list' }">
-                            <img class="current-icon"
-                                :src="activeGarden === 'list' ? require('@/assets/img/common/menu-active.png') : require('@/assets/img/common/menu.png')"
-                                alt="">
-                            <span class="current-name">{{ t("weather.farmList") }}</span>
-                        </div>
-
-                        <div class="mask-wrap" v-if="props.showTabMask" @click="emit('closeTabMask')">
-                            <div class="mask-content">
-                                <div class="mask-text">
-                                    {{ t("weather.farmListGuide") }}
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-
-                <div class="address-select flex-center farm-name" v-else>
-                    {{ t("common.demoFarm") }}
-                </div>
-                <div class="farm-l" v-show="activeGarden === 'current' && hasWeather">
-                    <div class="temperature flex-center">
-
-                        <div class="weather-icon" v-if="currentWeather.iconDay">
-                            <i :class="'qi-' + currentWeather.iconDay + '-fill'"></i>
-                        </div>
-                        <div class="temperature-number">{{ currentWeather.temp || '--' }}</div>
-                        <div class="temperature-text">
-                            <span>{{ currentWeather.text }}</span>
-                            <div class="temperature-text-time">
-                                <span>{{ currentDateText }}</span>
-                                <span class="temperature-text-date">{{ currentWeekText }}</span>
-                                <span v-show="!isExpanded" class="temperature-text-more" @click="toggleExpand">
-                                    {{ t("weather.expandMore") }}
-                                </span>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-
-                <!-- <div v-if="!hasWeather" class="report-tabs">
-                    <div
-                        v-for="(item, index) in reportTabs"
-                        :key="item.key"
-                        class="report-tab-item"
-                        @click="emit('reportTabClick', item)"
-                    >
-                        <img class="report-tab-icon" :src="getReportTabIcon(index)" alt="" />
-                        <span class="report-tab-label">{{ getReportTabLabel(item) }}</span>
-                    </div>
-                </div> -->
-            </div>
-            <!-- <div class="weather-icon" v-else>
-                <img :src="`https://birdseye-img.sysuimars.com/weather/${currentWeather.iconDay}.svg`" alt="" />
-            </div> -->
-        </div>
-        <div class="weather-chart-container" v-show="activeGarden === 'current' && hasWeather">
-            <div class="weather-chart-title">
-                <span>{{ t("weather.future7Days") }}</span>
-                <div class="weather-chart-title-more" @click="toggleExpand">{{ t("weather.collapse") }}</div>
-            </div>
-            <weather-chart class="weather-chart" :weather-data="weatherData"></weather-chart>
-        </div>
-        <!-- 农场筛选 -->
-        <div class="farm-filter" v-show="activeGarden === 'list'">
-            <div class="filter-l">
-                <el-input v-model="searchFarm" style="width: 96px" :placeholder="t('weather.searchFarm')" :prefix-icon="Search" />
-            </div>
-            <div class="filter-r">
-                <el-select v-model="regionVal" :placeholder="t('weather.selectRegion')" style="width: 92px">
-                    <el-option v-for="item in regionOptions" :key="item.value" :label="item.label"
-                        :value="item.value" />
-                </el-select>
-                <el-select v-model="typeVal" :placeholder="t('weather.selectCategory')" style="width: 92px">
-                    <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
-                </el-select>
-            </div>
-        </div>
-    </div>
-
-</template>
-
-<script setup>
-import { ref, onActivated, computed } from "vue";
-import weatherChart from "./weatherChart.vue";
-import { useRouter } from "vue-router";
-import { useStore } from "vuex";
-import { Edit, Search } from '@element-plus/icons-vue';
-import { convertPointToArray } from "@/utils/index";
-import { useI18n } from "@/i18n";
-
-const { t } = useI18n();
-const store = useStore();
-
-const props = defineProps({
-    showTabMask: {
-        type: Boolean,
-        default: false
-    },
-    gardenId: {
-        type: [Number, String],
-        default: null
-    },
-    hasWeather: {
-        type: Boolean,
-        default: true
-    },
-    reportTabs: {
-        type: Array,
-        default: () => [
-            { key: "historyRisk" },
-            { key: "soilImprovement" },
-            { key: "rotationAdvice" },
-        ],
-    },
-    from: {
-        type: String,
-        default: null
-    }
-});
-
-const regionVal = ref('');
-const typeVal = ref('');
-const searchFarm = ref('');
-const regionOptions = ref([{
-    label: '地区1',
-    value: '1'
-}, {
-    label: '地区2',
-    value: '2'
-}]);
-const typeOptions = ref([{
-    label: '品类1',
-    value: '1'
-}]);
-
-const REPORT_TAB_ICONS = [
-    require("@/assets/img/common/header-icon-1.png"),
-    require("@/assets/img/common/header-icon-2.png"),
-    require("@/assets/img/common/header-icon-3.png"),
-];
-
-const getReportTabIcon = (index) => REPORT_TAB_ICONS[index] || REPORT_TAB_ICONS[0];
-
-const getReportTabLabel = (item) => {
-    if (!item?.key) return item?.label || "";
-    const i18nKey = `weather.reportTab.${item.key}`;
-    const translated = t(i18nKey);
-    if (translated !== i18nKey) return translated;
-    return item.label || item.key;
-};
-
-// 定义emit事件
-const emit = defineEmits(['weatherExpanded', 'changeGarden', 'changeGardenTab', 'closeTabMask', 'reportTabClick']);
-const router = useRouter();
-
-const isExpanded = ref(false);
-const toggleExpand = () => {
-    isExpanded.value = !isExpanded.value;
-    emit('weatherExpanded', isExpanded.value);
-};
-
-const farmId = ref(null);
-const farmName = ref("");
-const hasFarm = ref(false)
-const activeGarden = ref('current');
-
-onActivated(() => {
-    handleGardenClick('current');
-});
-
-function setGardenLoaded(hasFarmData) {
-    hasFarm.value = !!hasFarmData;
-    if (!hasFarm.value) {
-        farmId.value = null;
-        farmName.value = "";
-    }
-}
-
-function setSelectedGarden(payload) {
-    if (!payload?.id) {
-        setGardenLoaded(false);
-        getLocationName();
-        getWeatherData();
-        return;
-    }
-
-    hasFarm.value = true;
-    farmId.value = Number(payload.id);
-    farmName.value = payload.name || "";
-    getLocationName();
-    getWeatherData();
-    emit('changeGarden', payload);
-}
-
-const handleGardenClick = (type) => {
-    activeGarden.value = type;
-    emit("changeGardenTab", type);
-};
-
-const locationName = ref("");
-const weatherData = ref(null);
-const currentWeather = ref({ temp: "--", text: "--", iconDay: "" });
-const MAP_KEY = "CZLBZ-LJICQ-R4A5J-BN62X-YXCRJ-GNBUT";
-function getLocationName() {
-    const locationPoint = localStorage.getItem('selectedFarmPoint') || store.state.home.miniUserLocationPoint;
-    const farmLocation = convertPointToArray(locationPoint);
-    let formattedLocation = `${farmLocation[1]},${farmLocation[0]}`;
-    const params = {
-        key: MAP_KEY,
-        location: formattedLocation,
-    };
-    VE_API.old_mini_map.location(params).then(({ result }) => {
-        // locationVal.value = result.formatted_addresses.recommend;
-        locationName.value = result?.address_component
-            ? result.address_component.city + result.address_component.district
-            : result?.address + "";
-    });
-}
-const handleFarmInfo = () => {
-    router.push(`/farm_info?subjectId=${farmId.value}`);
-}
-
-// 获取天气数据
-function getWeatherData() {
-    const point = localStorage.getItem('selectedFarmPoint') || store.state.home.miniUserLocationPoint;
-    if (!point) {
-        return;
-    }
-    VE_API.old_mini_map.get7d({ point }).then(({ data }) => {
-        if (data && data.daily && data.daily.length > 0) {
-            weatherData.value = data;
-            // 设置当前天气(第一天的数据)
-            const today = data.daily[0];
-            currentWeather.value = {
-                temp: today.tempMax || today.tempMin || 26,
-                text: today.textDay || t("weather.sunny"),
-                iconDay: today.iconDay,
-                fxDate: today.fxDate
-            };
-        }
-    }).catch(() => {
-        // 获取天气数据失败,使用默认值
-    });
-}
-
-// 获取当前日期和星期
-const currentDateText = computed(() => {
-    const now = new Date();
-    const month = String(now.getMonth() + 1).padStart(2, '0');
-    const day = String(now.getDate()).padStart(2, '0');
-    return `${month}/${day}`;
-});
-
-const currentWeekText = computed(() => {
-    if (!currentWeather.value?.fxDate) {
-        return "";
-    }
-
-    // 兼容 "YYYY-MM-DD" 格式,避免部分环境下直接 new Date() 解析异常
-    const date = new Date(currentWeather.value.fxDate.replace(/-/g, "/"));
-    if (Number.isNaN(date.getTime())) {
-        return "";
-    }
-
-    return t(`week.${date.getDay()}`);
-});
-
-
-// 暴露方法供父页面(如长势报告)同步农场列表状态
-defineExpose({
-    setGardenLoaded,
-    setSelectedGarden,
-    toggleExpand,
-    handleGardenClick
-});
-</script>
-
-<style lang="scss" scoped>
-.mask-wrap {
-    position: fixed;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: calc(100% - 300px);
-    background-color: rgba(0, 0, 0, 0.52);
-    z-index: 99999;
-    color: rgba(0, 0, 0, 0.9);
-    .mask-content {
-        position: absolute;
-        right: 51px;
-        top: 58px;
-        .mask-text {
-            background: #fff;
-            padding: 6px 16px;
-            border-radius: 10px;
-            font-size: 14px;
-            line-height: 22px;
-            text-align: center;
-            width: fit-content;
-            box-sizing: border-box;
-            border: 1px solid #DCDCDC;
-            position: relative;
-            z-index: 10px;
-            &::after {
-                content: '';
-                position: absolute;
-                right: 24px;
-                top: -10px;
-                width: 0;
-                height: 0;
-                border-right: 5px solid transparent;
-                border-top: 5px solid transparent;
-                border-left: 5px solid transparent;
-                border-bottom: 5px solid #fff;
-            }
-        }
-    }
-}
-.weather-info {
-    width: 100%;
-    // height: 58px;
-    height: 80px;
-    border-radius: 14px;
-    border: 0.5px solid #ffffff;
-    background: linear-gradient(180deg, #89CBFF 0%, #2199F8 100%);
-    box-sizing: border-box;
-    transition: height 0.3s ease-in-out;
-    overflow: hidden;
-
-    &.is-garden {
-        border-radius: 8px;
-        box-shadow: 0px -2px 4px 0px #0000000D;
-        // height: 130px;
-        height: 96px;
-    }
-
-    &.no-weather {
-        height: auto;
-        position: relative;
-    }
-
-    &.no-farm {
-        height: 80px;
-
-        &.expanded {
-            height: 312px;
-        }
-    }
-
-    &.expanded {
-        height: 362px;
-    }
-
-    &.bg-white {
-        border-radius: 14px;
-        background-image: linear-gradient(90deg, #e2f1fe 0%, #ffffff 80%);
-    }
-
-    &.farm-list {
-        height: 94px;
-    }
-
-    .flex-center {
-        display: flex;
-        align-items: center;
-    }
-
-    .header {
-        display: flex;
-        align-items: flex-end;
-        justify-content: space-between;
-
-        .header-left {
-            width: 100%;
-
-            .address-select {
-                .select-garden {
-                    width: fit-content;
-                    max-width: 170px;
-                    margin-right: 8px;
-                    margin-bottom: 10px;
-
-                    .el-dropdown-link {
-                        font-size: 15px;
-                        font-weight: 500;
-                        color: #000000;
-
-                        span {
-                            width: fit-content;
-                            max-width: 95%;
-                            margin-right: 4px;
-                        }
-
-                        .default-text {
-                            font-size: 12px;
-                            color: #fff;
-                            padding: 2px 4px;
-                            width: 44px;
-                            text-align: center;
-                            box-sizing: border-box;
-                            font-weight: 400;
-                            background-color: #2199f8;
-                            border-radius: 25px;
-                        }
-                    }
-                }
-
-                .btn-wrap {
-                    position: absolute;
-                    right: 10px;
-                    top: 8px;
-                    display: flex;
-                    gap: 8px;
-                }
-
-                .add-garden {
-                    font-size: 12px;
-                    color: #2199f8;
-                    padding: 3px 10px;
-                    border: 1px solid rgba(33, 153, 248, 0.5);
-                    border-radius: 25px;
-                    display: flex;
-                    align-items: center;
-                }
-
-                .gray-btn {
-                    color: #919191;
-                    border: 1px solid rgba(145, 145, 145, 0.5);
-                }
-            }
-
-            .farm-name {
-                font-size: 16px;
-                color: #1D2129;
-                background: #fff;
-                padding: 2px 0 4px 12px;
-            }
-
-            .temperature {
-                padding-left: 10px;
-                width: 100%;
-                box-sizing: border-box;
-                position: relative;
-                background: #fff;
-
-                .temperature-number {
-                    font-size: 38px;
-                    position: relative;
-                    margin: 0 8px;
-
-                    &::after {
-                        content: "°";
-                        font-size: 10px;
-                        position: absolute;
-                        right: -6px;
-                        top: 2px;
-                    }
-                }
-
-                .temperature-text {
-                    .temperature-text-time {
-                        font-size: 12px;
-                        font-weight: 400;
-                    }
-
-                    .temperature-text-more {
-                        font-size: 12px;
-                        color: #2199f8;
-                        margin-left: 10px;
-                        font-weight: 500;
-                        cursor: pointer;
-                    }
-
-                    .temperature-text-date {
-                        color: #1D2129;
-                        margin-left: 4px;
-                    }
-                }
-            }
-
-            .report-tabs {
-                width: 100%;
-                display: flex;
-                align-items: center;
-                gap: 7px;
-                padding: 8px 10px 10px;
-                background: #fff;
-                box-sizing: border-box;
-
-                .report-tab-item {
-                    flex: 1;
-                    display: flex;
-                    align-items: center;
-                    justify-content: center;
-                    gap: 5px;
-                    padding: 5px 8px;
-                    font-size: 12px;
-                    color: #5A5A5A;
-                    border: 0.5px solid rgba(180, 180, 180, 0.4);
-                    border-radius: 4px;
-
-                    .report-tab-icon {
-                        width: 14px;
-                        height: 14px;
-                    }
-
-                    .report-tab-label {
-                        white-space: nowrap;
-                        overflow: hidden;
-                        text-overflow: ellipsis;
-                    }
-                }
-            }
-        }
-
-        .header-right {
-            width: 84px;
-            height: 73px;
-        }
-
-        .weather-icon {
-            i {
-                font-size: 40px;
-                color: #a7cffb;
-            }
-        }
-    }
-
-    .garden-tabs {
-        width: 100%;
-        display: flex;
-        align-items: center;
-
-        .garden-item {
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            gap: 6px;
-            height: 40px;
-            width: calc(50% - 17px);
-
-            // width:100px;
-            // background: linear-gradient(180deg, #89CBFF 0%, #2199F8 100%);
-            &.left-item {
-                padding-left: 10px;
-                justify-content: flex-start;
-
-                .farm-edit-icon {
-                    width: 16px;
-                    height: 16px;
-                    color: #2199F8;
-                    flex-shrink: 0;
-                    margin-left: 2px;
-                }
-            }
-
-            &.right-item {
-                padding-right: 10px;
-                z-index: 9999999;
-            }
-
-            &.active {
-                background: #fff;
-
-                // background: linear-gradient(360deg, #FFFFFF 30.18%, #FFFFFF 82.87%, #D3ECFF 106.69%);
-                .current-name {
-                    color: #2199F8;
-                }
-            }
-
-            .current-name {
-                font-size: 18px;
-                color: #fff;
-                font-family: "PangMenZhengDao";
-            }
-
-            .current-icon {
-                width: 16px;
-            }
-        }
-
-        .title-block {
-            width: 34px;
-            height: 40px;
-        }
-    }
-
-    .farm-filter {
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
-        padding: 12px 7px 8px 7px;
-        height: 53px;
-        box-sizing: border-box;
-        background: #ffffff;
-
-        .filter-l {
-            ::v-deep {
-                .el-input__wrapper {
-                    border-radius: 20px;
-                }
-
-                .el-input .el-input__icon {
-                    margin-right: 3px;
-                }
-            }
-        }
-
-        .filter-r {
-            display: flex;
-            align-items: center;
-            gap: 10px;
-
-            ::v-deep {
-                .el-select__wrapper {
-                    border-radius: 20px;
-                    padding: 4px 6px 4px 10px;
-                }
-            }
-        }
-    }
-
-    .weather-chart-container {
-        width: 100%;
-        height: 100%;
-        overflow: hidden;
-        padding: 8px 10px 0 10px;
-        box-sizing: border-box;
-        background: #ffffff;
-
-        .weather-chart-title {
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-            font-size: 12px;
-            font-weight: 500;
-
-            .weather-chart-title-more {
-                color: #828282;
-                cursor: pointer;
-                padding: 3px 10px;
-                border-radius: 25px;
-                font-weight: 400;
-                border: 1px solid rgba(130, 130, 130, 0.5);
-            }
-        }
-
-        .weather-chart {
-            margin-top: 5px;
-            width: 100%;
-            height: 180px;
-        }
-    }
-}
-</style>
-<style lang="scss">
-.select-garden-popper {
-    max-height: calc(100vh - 200px);
-    overflow-y: auto;
-
-    &.el-dropdown__popper {
-        .el-dropdown__list {
-            max-width: 250px;
-        }
-
-        .el-dropdown-menu__item {
-            background-color: transparent !important;
-            color: #606266 !important;
-        }
-
-        .selected-active-garden {
-            color: #2199f8 !important;
-            background-color: rgba(33, 153, 248, 0.1) !important;
-            font-weight: 500;
-        }
-    }
-
-    .dropdown-default-text {
-        font-size: 11px;
-        color: #2199f8;
-        margin-left: 8px;
-        padding: 0 5px;
-        background-color: rgba(33, 153, 248, 0.1);
-        border-radius: 10px;
-        font-weight: 400;
-    }
-}
-</style>

+ 0 - 126
src/utils/back/DialogModel1.vue

@@ -1,126 +0,0 @@
-<template>
-  <el-dialog
-      class="my-dialog"
-      fullscreen
-      append-to-body
-      destroy-on-close
-      :model-value="showDialog"
-      @close="closeDialog()"
-  >
-    <div class="dialog-box">
-      <div class="title">
-        <div class="name">{{ t('农事方案') }}</div>
-        <div class="close cursor-pointer" @click="closeDialog"></div>
-      </div>
-      <div class="my-body"></div>
-    </div>
-  </el-dialog>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import {reactive, ref, toRefs, computed, nextTick, onMounted} from "vue";
-import {useStore} from "vuex";
-import {WKT} from "ol/format";
-const emit = defineEmits(["closeDialog","success"])
-const store = useStore();
-
-const props = defineProps({
-  showDialog: {
-    type: Boolean,
-    default: true,
-  },
-});
-
-const formRef = ref(null);
-const {title, rowData} = toRefs(props);
-const closeDialog = () => {
-  emit("closeDialog", "pdf");
-};
-
-/**表单验证规则
- * @description:
- * @param {*} computed
- * @return {*}
- */
-const rules = computed(() => ({
-  name: [
-    {
-      required: true,
-      message: "请录入药品名称",
-      trigger: "change",
-    },
-  ]
-}));
-const form = reactive({
-  name:null,
-  type:1,
-})
-
-/**
- * @description:提交表单
- * @param {*}
- * @return {*}
- */
-const onSubmit = () => {
-
-};
-
-</script>
-
-<style lang="scss" >
-$title-height:44px;
-$body-height:calc(100% - $title-height);
-
-.my-dialog{
-  background-color: #F4F4F400;
-}
-.dialog-box{
-  // font-family: PingFangSC-Regular, PingFang SC;
-  position: absolute;
-  left: 33%;
-  right: 33%;
-  top:10%;
-  bottom:10%;
-  background: rgba(1,17,22,0.8);
-  box-shadow: 0px 0px 20px 0px #00FFF0;
-  border-radius: 4px;
-  border: 2px solid rgba(81,233,240,0.6);
-
-  .title{
-    width: 100%;
-    height: $title-height;
-    box-sizing: border-box;
-    background: rgba(0,77,101,0.8);
-    border-radius: 4px 4px 0px 0px;
-    border-bottom: 2px solid rgba(81,233,240,0.3);
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    .name{
-      margin-left: 20px;
-      font-size: 16px;
-      font-weight: 600;
-      color: #00FFF0;
-      height: 22px;
-    }
-    .close{
-      margin-right: 20px;
-      width: 16px;
-      height: 16px;
-      background-image: url("@/assets/img/close.png");
-      background-size: 100% 100%;
-    }
-  }
-  .my-body{
-    width: 100%;
-    height: $body-height;
-    box-sizing: border-box;
-    padding: 21px;
-  }
-
-
-}
-
-</style>

+ 0 - 485
src/views/old_mini/agri_file/components/remoteSensingChart.vue

@@ -1,485 +0,0 @@
-<template>
-    <div class="remote-sensing-chart-wrap">
-        <div v-if="loading" class="remote-sensing-chart-wrap__status">{{ t("agriFile.loading") }}</div>
-        <div v-else-if="!normalizedData" class="remote-sensing-chart-wrap__status">{{ t("agriFile.noData") }}</div>
-        <template v-else>
-            <div ref="chartRef" class="remote-sensing-line-chart"></div>
-            <div
-                v-if="reportText"
-                class="remote-sensing-report"
-                v-html="formattedReport"
-            ></div>
-        </template>
-    </div>
-</template>
-
-<script setup>
-import * as echarts from "echarts";
-import { computed, nextTick, onActivated, onBeforeUnmount, onMounted, ref, shallowRef, watch } from "vue";
-import { useI18n } from "@/i18n";
-
-const { t } = useI18n();
-
-const chartRef = ref(null);
-const chartInstance = shallowRef(null);
-const chartData = ref(null);
-const reportText = ref("");
-const loading = ref(false);
-let resizeObserver = null;
-
-const SERIES_COLORS = {
-    ndvi: "#1CC277",
-    ndwi: "#6277FB",
-    precipitation: "#E2F1FD",
-    avgPrecipitation: "#66BBFF",
-};
-
-/** 一屏默认展示的数据点数量,超出后可横向滑动 */
-const DATA_ZOOM_VISIBLE_COUNT = 30;
-
-const toDateKey = (value) => String(value ?? "").slice(0, 10);
-
-const getTodayDateString = () => {
-    const now = new Date();
-    const y = now.getFullYear();
-    const m = String(now.getMonth() + 1).padStart(2, "0");
-    const d = String(now.getDate()).padStart(2, "0");
-    return `${y}-${m}-${d}`;
-};
-
-const findAnchorIndexByToday = (dates) => {
-    const today = getTodayDateString();
-    const exactIndex = dates.findIndex((item) => toDateKey(item) === today);
-    if (exactIndex >= 0) return exactIndex;
-
-    for (let i = dates.length - 1; i >= 0; i--) {
-        if (toDateKey(dates[i]) <= today) return i;
-    }
-    return 0;
-};
-
-const getDataZoomRange = (dates) => {
-    const count = dates?.length ?? 0;
-    if (count <= DATA_ZOOM_VISIBLE_COUNT) return null;
-
-    const anchorIndex = findAnchorIndexByToday(dates);
-    let endIndex = anchorIndex;
-    let startIndex = Math.max(0, endIndex - DATA_ZOOM_VISIBLE_COUNT + 1);
-
-    if (endIndex - startIndex + 1 < DATA_ZOOM_VISIBLE_COUNT) {
-        endIndex = Math.min(count - 1, startIndex + DATA_ZOOM_VISIBLE_COUNT - 1);
-    }
-
-    return {
-        start: (startIndex / count) * 100,
-        end: ((endIndex + 1) / count) * 100,
-    };
-};
-
-const buildDataZoom = (dates) => {
-    const range = getDataZoomRange(dates);
-    if (!range) return [];
-
-    return [
-        {
-            type: "inside",
-            xAxisIndex: 0,
-            start: range.start,
-            end: range.end,
-            zoomLock: true,
-            zoomOnMouseWheel: false,
-            moveOnMouseMove: true,
-            moveOnMouseWheel: false,
-        },
-        {
-            type: "slider",
-            xAxisIndex: 0,
-            start: range.start,
-            end: range.end,
-            height: 14,
-            bottom: 2,
-            borderColor: "transparent",
-            backgroundColor: "#f0f0f0",
-            fillerColor: "rgba(33, 153, 248, 0.12)",
-            handleSize: "70%",
-            handleStyle: {
-                color: "#2199f8",
-                borderColor: "#2199f8",
-            },
-            showDetail: false,
-            brushSelect: false,
-        },
-    ];
-};
-
-const toNumber = (value) => {
-    if (value == null || value === "") return null;
-    const num = Number(value);
-    return Number.isNaN(num) ? null : num;
-};
-
-const formatDateLabel = (dateStr) => {
-    if (!dateStr) return "";
-    const parts = String(dateStr).split("-");
-    if (parts.length >= 3) {
-        return `${parts[1]}-${parts[2]}`;
-    }
-    return dateStr;
-};
-
-const extractReport = (raw) => {
-    if (!raw) return "";
-    if (typeof raw === "string") return raw;
-    if (raw.report) return String(raw.report);
-
-    const list = Array.isArray(raw) ? raw : raw?.list ?? raw?.series ?? [];
-    if (!Array.isArray(list)) return "";
-
-    const item = list.find((entry) => entry?.report) ?? list[list.length - 1];
-    return item?.report ? String(item.report) : "";
-};
-
-const escapeHtml = (text) =>
-    String(text)
-        .replace(/&/g, "&amp;")
-        .replace(/</g, "&lt;")
-        .replace(/>/g, "&gt;")
-        .replace(/"/g, "&quot;");
-
-const REPORT_HIGHLIGHT_PATTERN =
-    /(\d+(?:\.\d+)?(?:mm|%|天)?)|长势良好|长势一般|增加|减少|削弱/g;
-
-const formatReportHtml = (text) => {
-    if (!text) return "";
-    return escapeHtml(text).replace(
-        REPORT_HIGHLIGHT_PATTERN,
-        '<span class="remote-sensing-report__highlight">$&</span>'
-    );
-};
-
-const formattedReport = computed(() => formatReportHtml(reportText.value));
-
-const normalizeChartData = (raw) => {
-    if (!raw) return null;
-
-    const list = Array.isArray(raw) ? raw : raw?.list ?? raw?.series ?? [];
-    if (!Array.isArray(list) || !list.length) return null;
-
-    const sorted = [...list].sort((a, b) => String(a.date).localeCompare(String(b.date)));
-
-    return {
-        dates: sorted.map((item) => toDateKey(item.date)),
-        timeLabels: sorted.map((item) => formatDateLabel(item.date)),
-        ndvi: sorted.map((item) => toNumber(item.NDVI_before ?? item.ndvi)),
-        ndwi: sorted.map((item) => toNumber(item.NDWI_before ?? item.ndwi)),
-        precipitation: sorted.map((item) =>
-            toNumber(item.this_year_precip ?? item.precipitation ?? item.rain)
-        ),
-        avgPrecipitation: sorted.map((item) =>
-            toNumber(item.mean_precip ?? item.avgPrecipitation ?? item.avg_precipitation)
-        ),
-    };
-};
-
-const normalizedData = computed(() => {
-    const data = chartData.value;
-    if (!data?.timeLabels?.length) {
-        return null;
-    }
-
-    const length = data.timeLabels.length;
-    const mapSeries = (series = []) =>
-        series.slice(0, length).map((item) => toNumber(item));
-
-    return {
-        dates: (data.dates ?? []).slice(0, length),
-        timeLabels: data.timeLabels.slice(0, length),
-        ndvi: mapSeries(data.ndvi),
-        ndwi: mapSeries(data.ndwi),
-        precipitation: mapSeries(data.precipitation),
-        avgPrecipitation: mapSeries(data.avgPrecipitation),
-    };
-});
-
-const fetchChartData = async () => {
-    
-    const params = {
-        zone_id: '319',
-        date: getTodayDateString(),
-    };
-    loading.value = true;
-    try {
-        const res = await VE_API.record.getZoneRsSeries(params);
-        if (res.code === 200) {
-            chartData.value = normalizeChartData(res.data);
-            reportText.value = extractReport(res.data);
-        } else {
-            chartData.value = null;
-            reportText.value = "";
-        }
-    } catch {
-        chartData.value = null;
-        reportText.value = "";
-    } finally {
-        loading.value = false;
-    }
-};
-
-const getPrecipitationAxisMax = (data) => {
-    const values = [...(data.precipitation ?? []), ...(data.avgPrecipitation ?? [])].filter(
-        (v) => v != null && !Number.isNaN(v)
-    );
-    if (!values.length) return 10;
-
-    const max = Math.max(...values);
-    const padded = max * 1.2;
-    if (padded <= 10) return Math.ceil(padded);
-    if (padded <= 50) return Math.ceil(padded / 5) * 5;
-    return Math.ceil(padded / 10) * 10;
-};
-
-const getPrecipitationAxisInterval = (max) => {
-    if (max <= 10) return 2;
-    if (max <= 50) return 10;
-    return 25;
-};
-
-const buildOption = (data) => {
-    const precipMax = getPrecipitationAxisMax(data);
-    const precipInterval = getPrecipitationAxisInterval(precipMax);
-    const dataZoom = buildDataZoom(data.dates);
-    const hasDataZoom = dataZoom.length > 0;
-
-    return {
-    animation: false,
-    grid: {
-        left: 4,
-        right: 4,
-        top: 24,
-        bottom: hasDataZoom ? 22 : 8,
-        containLabel: true,
-    },
-    dataZoom,
-    xAxis: {
-        type: "category",
-        boundaryGap: true,
-        data: data.timeLabels,
-        axisLine: { show: false },
-        axisTick: { show: false },
-        axisLabel: {
-            color: "#C1C1C1",
-            fontSize: 11,
-            hideOverlap: true,
-        },
-    },
-    yAxis: [
-        {
-            type: "value",
-            min: -1,
-            max: 1,
-            interval: 0.5,
-            name: t("agriFile.remoteSensingAxisIndex"),
-            nameLocation: "end",
-            nameGap: 12,
-            nameTextStyle: {
-                color: "#C1C1C1",
-                fontSize: 11,
-                align: "left",
-                padding: [0, 0, 0, -20],
-            },
-            axisLine: { show: false },
-            axisTick: { show: false },
-            axisLabel: {
-                color: "#C1C1C1",
-                fontSize: 11,
-            },
-            splitLine: {
-                lineStyle: {
-                    color: "#EEEEEE",
-                },
-            },
-        },
-        {
-            type: "value",
-            min: 0,
-            max: precipMax,
-            interval: precipInterval,
-            name: t("agriFile.remoteSensingAxisPrecipitation"),
-            nameLocation: "end",
-            nameGap: 12,
-            nameTextStyle: {
-                color: "#C1C1C1",
-                fontSize: 11,
-                align: "right",
-                padding: [0, -20, 0, 0],
-            },
-            axisLine: { show: false },
-            axisTick: { show: false },
-            axisLabel: {
-                color: "#C1C1C1",
-                fontSize: 11,
-            },
-            splitLine: { show: false },
-        },
-    ],
-    series: [
-        {
-            name: "precipitation",
-            type: "bar",
-            yAxisIndex: 1,
-            barWidth: "40%",
-            itemStyle: {
-                color: SERIES_COLORS.precipitation,
-                borderRadius: [4, 4, 0, 0],
-            },
-            data: data.precipitation,
-            z: 1,
-        },
-        {
-            name: "ndwi",
-            type: "line",
-            yAxisIndex: 0,
-            smooth: true,
-            symbol: "none",
-            lineStyle: {
-                width: 2,
-                color: SERIES_COLORS.ndwi,
-            },
-            data: data.ndwi,
-            z: 2,
-        },
-        {
-            name: "avgPrecipitation",
-            type: "line",
-            yAxisIndex: 1,
-            smooth: true,
-            symbol: "none",
-            lineStyle: {
-                width: 2,
-                type: "dashed",
-                color: SERIES_COLORS.avgPrecipitation,
-            },
-            data: data.avgPrecipitation,
-            z: 3,
-        },
-        {
-            name: "ndvi",
-            type: "line",
-            yAxisIndex: 0,
-            smooth: true,
-            symbol: "none",
-            lineStyle: {
-                width: 2,
-                color: SERIES_COLORS.ndvi,
-            },
-            data: data.ndvi,
-            z: 4,
-        },
-    ],
-    };
-};
-
-const resizeChart = () => {
-    chartInstance.value?.resize();
-};
-
-const renderChart = () => {
-    if (!chartRef.value || !normalizedData.value) return;
-
-    const { clientWidth, clientHeight } = chartRef.value;
-    if (!clientWidth || !clientHeight) return;
-
-    if (!chartInstance.value) {
-        chartInstance.value = echarts.init(chartRef.value);
-    }
-
-    chartInstance.value.setOption(buildOption(normalizedData.value), true);
-    nextTick(resizeChart);
-};
-
-const setupResizeObserver = () => {
-    if (!chartRef.value || typeof ResizeObserver === "undefined") return;
-
-    resizeObserver?.disconnect();
-    resizeObserver = new ResizeObserver(() => {
-        if (!normalizedData.value) return;
-        if (!chartInstance.value) {
-            renderChart();
-            return;
-        }
-        resizeChart();
-    });
-    resizeObserver.observe(chartRef.value);
-};
-
-onMounted(() => {
-    fetchChartData();
-    window.addEventListener("resize", resizeChart);
-});
-
-onActivated(() => {
-    fetchChartData();
-});
-
-onBeforeUnmount(() => {
-    resizeObserver?.disconnect();
-    resizeObserver = null;
-    window.removeEventListener("resize", resizeChart);
-    chartInstance.value?.dispose();
-    chartInstance.value = null;
-});
-
-watch(
-    normalizedData,
-    (data) => {
-        if (!data) return;
-        nextTick(() => {
-            renderChart();
-            setupResizeObserver();
-        });
-    },
-    { deep: true }
-);
-
-defineExpose({
-    refresh: fetchChartData,
-});
-</script>
-
-<style lang="scss" scoped>
-.remote-sensing-chart-wrap {
-    width: 100%;
-    min-width: 0;
-
-    &__status {
-        text-align: center;
-        color: #9a9a9a;
-        font-size: 13px;
-        padding: 14px 0;
-        margin-top: 10px;
-    }
-}
-
-.remote-sensing-line-chart {
-    width: 100%;
-    min-width: 0;
-    height: 210px;
-    margin-top: 10px;
-}
-
-.remote-sensing-report {
-    margin-top: 10px;
-    padding: 12px 14px;
-    background: #f7f7f7;
-    border-radius: 8px;
-    font-size: 13px;
-    line-height: 1.65;
-    color: #666666;
-    word-break: break-word;
-
-    :deep(.remote-sensing-report__highlight) {
-        color: #0d0d0d;
-        font-weight: 600;
-    }
-}
-</style>

+ 0 - 403
src/views/old_mini/agri_file/pages/diagnosisReport copy.vue

@@ -1,403 +0,0 @@
-<template>
-    <div class="diagnosis-report-page">
-        <custom-header :name="t('agriFile.initialReport')" :isGoBack="true" @goback="handleBack" />
-
-        <div class="diagnosis-report-body">
-            <div class="report-hero">
-                <div class="report-hero__title">{{ reportData.title }}</div>
-                <div class="report-hero__desc">{{ reportData.intro }}</div>
-            </div>
-
-            <!-- 基本情况与种植价值 -->
-            <div class="report-section">
-                <div class="report-section__title">{{ reportData.basic.title }}</div>
-                <div v-for="card in reportData.basic.cards" :key="card.title" class="info-card">
-                    <div class="info-card__title">{{ card.title }}</div>
-                    <div v-for="(para, idx) in card.paragraphs" :key="idx" class="info-card__text">
-                        {{ para }}
-                    </div>
-                </div>
-            </div>
-
-            <!-- 决定产量的气象风险 -->
-            <div class="report-section">
-                <div class="report-section__title">{{ reportData.weatherRisk.title }}</div>
-                <div class="info-card__text mb-10">{{ reportData.weatherRisk.intro }}</div>
-                <div class="section-divider">
-                    <span>{{ reportData.weatherRisk.groupTitle }}</span>
-                </div>
-                <div class="info-card fertilizer-card">
-                    <div v-for="item in reportData.weatherRisk.items" :key="item.tag" class="tag-block">
-                        <span class="tag-block__tag">{{ item.tag }}</span>
-                        <div class="tag-block__text">{{ item.content }}</div>
-                    </div>
-                    <div class="suggest-card">
-                        <div class="suggest-card__title">{{ reportData.weatherRisk.suggest.title }}</div>
-                        <div v-for="row in reportData.weatherRisk.suggest.rows" :key="row.label"
-                            class="suggest-card__row">
-                            <span class="suggest-card__label">{{ row.label }}</span>
-                            <span>{{ row.content }}</span>
-                        </div>
-                    </div>
-                </div>
-            </div>
-
-            <!-- 肥料供给效率分析 -->
-            <div class="report-section">
-                <div class="report-section__title">{{ reportData.fertilizer.title }}</div>
-                <div class="info-card fertilizer-card">
-                    <div class="info-card__text">{{ reportData.fertilizer.intro }}</div>
-                    <div class="section-divider">
-                        <span>{{ reportData.fertilizer.groupTitle }}</span>
-                    </div>
-                    <div v-for="item in reportData.fertilizer.items" :key="item.tag" class="tag-block">
-                        <span class="tag-block__tag">{{ item.tag }}</span>
-                        <div class="tag-block__text">{{ item.content }}</div>
-                    </div>
-                    <div class="suggest-card">
-                        <div class="suggest-card__title">{{ reportData.fertilizer.suggest.title }}</div>
-                        <div v-for="row in reportData.fertilizer.suggest.rows" :key="row.label"
-                            class="suggest-card__row">
-                            <span class="suggest-card__label">{{ row.label }}</span>
-                            <span>{{ row.content }}</span>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <div class="share-btn" @click="handleShare">{{ t("agriFile.forwardReport") }}</div>
-    </div>
-</template>
-
-<script setup>
-import { ref } from "vue";
-import { useRouter, useRoute } from "vue-router";
-import customHeader from "@/components/customHeader.vue";
-import { useI18n } from "@/i18n";
-import wx from "weixin-js-sdk";
-
-const { t } = useI18n();
-const router = useRouter();
-const route = useRoute();
-
-/** 假数据:后续可替换为接口 */
-const reportData = ref({
-    title: "《广州市从化区妃子笑荔枝初始种植诊断报告》",
-    intro: "针对您的果园坐标、妃子笑荔枝和种植类型,飞鸟结合从化区长期种植条件,为您生成专属初始种植诊断报告",
-    basic: {
-        title: "基本情况与种植价值",
-        cards: [
-            {
-                title: "种植基础",
-                paragraphs: [
-                    "从化地处北回归线附近低纬度地带,属南亚热带季风气候,年均气温约20℃上下,雨量充足、光照充沛,森林覆盖率高的低山丘陵为荔枝提供了较理想的生长环境。",
-                ],
-            },
-            {
-                title: "品种价值",
-                paragraphs: [
-                    "妃子笑为当地率先登场的早熟品种,早结、丰产稳产性好,果果大核小、肉厚清甜,商品性较好,且抗逆性和成花着果能力在同产区中表现突出。",
-                    "产期价值:本地妃子笑多在5月下旬至6月中旬成熟采收,比当地桂味、糯米糍、槐枝等中晚熟品种提早约一个月上市,能在荔枝上市初期先供应市场、填补尝鲜空档。",
-                ],
-            },
-            {
-                title: "商品定位",
-                paragraphs: [
-                    "依托从化自然环境与当季鲜采优势,妃子笑宜以「本地早熟、果大肉厚清甜、新摘即卖」为卖点,面向本地及周边短途鲜食市场,强调产地直供与口感新鲜度。",
-                ],
-            }
-        ],
-    },
-    weatherRisk: {
-        title: "决定产量的气象风险",
-        intro: "飞鸟系统基于当地多年气象与物候窗口,梳理对产量形成影响最大的关键风险,帮助提前布局应对。",
-        groupTitle: "开花坐果期",
-        items: [
-            {
-                tag: "风险判断",
-                content:
-                    "开花坐果期阴雨涝渍年发生概率55.0%,历史强度等级4级,是制约坐果稳定的重要风险,需重点对待。",
-            },
-            {
-                tag: "主要影响",
-                content:
-                    "本物候期尚无花、果器官,研判重点放在叶和梢。高温、强光叠加缺水后,嫩叶失水速度超过根系补水速度,首先表现萎蔫与灼伤。",
-            },
-            {
-                tag: "重点准备",
-                content:
-                    "围绕排水防涝、保温防寒和抗旱灌水提前备好物资与预案,把灾害应对前移到敏感窗口来临之前。",
-            },
-        ],
-        suggest: {
-            title: "飞鸟建议",
-            rows: [
-                {
-                    label: "优先能力:",
-                    content:
-                        "重点提升防灾保果与应急稳产的成套管理能力,尤其是排水防涝、保温防寒和抗旱灌水的机动响应。",
-                },
-                {
-                    label: "管理方向:",
-                    content:
-                        "围绕开花坐果和果实膨大两大敏感窗口,把灾害应对前移到物候来临之前,守住产量形成的稳定期。",
-                },
-            ],
-        },
-    },
-    fertilizer: {
-        title: "肥料供给效率分析",
-        intro: "飞鸟系统结合历史土壤、地形水文和遥感长势数据,进一步分析发现,当地肥料利用效率的主要限制在于酸性黏重土壤的通气缓冲和湿热旱交替下的根系活力波动。",
-        groupTitle: "土壤长期供肥",
-        items: [
-            {
-                tag: "主要问题",
-                content:
-                    "当地为赤红壤黏壤土,pH约5.4偏酸,有机质水平中等,养分缓冲与保蓄能力总体偏弱。",
-            },
-            {
-                tag: "形成原因",
-                content:
-                    "暴雨涝渍年发生概率65.0%,长期强降雨易促使可移动养分淋失,进一步削弱酸性土壤的养分缓冲能力。",
-            },
-            {
-                tag: "生产影响",
-                content:
-                    "养分流失加快、供应节奏不稳,可能影响花芽分化、开花坐果和幼果稳定所需的营养基础。",
-            },
-        ],
-        suggest: {
-            title: "飞鸟建议",
-            rows: [
-                {
-                    label: "优先能力:",
-                    content:
-                        "重点提升排水防涝、土壤改良与分期稳肥的成套管理能力,尤其是酸性黏重土壤的通气缓冲与根系养护。",
-                },
-                {
-                    label: "管理方向:",
-                    content:
-                        "围绕开花坐果和果实膨大两大敏感窗口,把灾害应对前移到物候来临之前,守住产量形成的稳定期。",
-                },
-            ],
-        },
-    },
-});
-
-const handleBack = () => {
-    router.back();
-};
-
-const handleShare = () => {
-    const query = {
-        askInfo: { title: "转发报告", content: "是否分享给好友" },
-        shareText: reportData.value.title,
-        targetUrl: "diagnosis_report",
-        paramsPage: JSON.stringify({
-            id: route.query.id,
-            fromShare: 1,
-        }),
-        imageUrl: "https://birdseye-img.sysuimars.com/temp/field.png",
-    };
-    wx.miniProgram.navigateTo({
-        url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify(query)}&type=sharePage`,
-    });
-};
-</script>
-
-<style lang="scss" scoped>
-.diagnosis-report-page {
-    min-height: 100vh;
-    background: #f5f6f8;
-    box-sizing: border-box;
-    padding-bottom: 90px;
-}
-
-.diagnosis-report-body {
-    padding: 10px 10px 60px;
-    max-height: calc(100vh - 40px);
-    overflow: auto;
-    box-sizing: border-box;
-}
-
-.report-hero {
-    padding: 0px 0px 10px;
-    text-align: center;
-
-    &__title {
-        font-size: 16px;
-        font-weight: bold;
-        line-height: 24px;
-        color: #000000;
-    }
-
-    &__desc {
-        margin-top: 10px;
-        font-size: 16px;
-        font-weight: 350;
-        line-height: 24px;
-        color: rgba(6, 6, 6, 0.5);
-        text-align: left;
-    }
-}
-
-.report-section {
-    background: #fff;
-    padding: 10px;
-    border-radius: 10px;
-
-    &+& {
-        margin-top: 18px;
-    }
-
-    &__title {
-        margin-bottom: 10px;
-        font-size: 16px;
-        font-weight: 600;
-        line-height: 24px;
-        color: #000000;
-    }
-}
-
-.mb-10 {
-        margin-bottom: 10px;
-    }
-
-.info-card {
-    padding: 10px;
-    border-radius: 4px;
-    background: #F7F8FA;
-    box-sizing: border-box;
-
-    &.fertilizer-card {
-        background: transparent;
-        padding: 0;
-
-        .info-card__text {
-            margin-bottom: 10px;
-        }
-    }
-
-    &+& {
-        margin-top: 10px;
-    }
-
-    &__title {
-        margin-bottom: 4px;
-        font-size: 14px;
-        font-weight: 500;
-        line-height: 22px;
-        color: #1D2129;
-    }
-
-    &__text {
-        // margin-bottom: 10px;
-        font-size: 12px;
-        line-height: 20px;
-        color: #4E5969;
-
-        &+& {
-            margin-top: 2px;
-        }
-    }
-}
-
-.section-divider {
-    display: flex;
-    align-items: center;
-    gap: 10px;
-    margin-bottom: 10px;
-    color: #1D2129;
-    font-size: 14px;
-    font-weight: 500;
-    line-height: 20px;
-
-    &::before,
-    &::after {
-        content: "";
-        flex: 1;
-        height: 1px;
-        background: linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
-    }
-
-    &::before {
-        background: linear-gradient(270deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
-    }
-}
-
-.tag-block {
-    padding: 12px;
-    border-radius: 8px;
-    background: #f7f8fa;
-
-    &+& {
-        margin-top: 10px;
-    }
-
-    &__tag {
-        display: inline-block;
-        padding: 0 10px;
-        border-radius: 2px;
-        background: #2199f8;
-        color: #fff;
-        font-size: 12px;
-        line-height: 22px;
-    }
-
-    &__text {
-        margin-top: 4px;
-        font-size: 12px;
-        line-height: 20px;
-        color: #4E5969;
-    }
-}
-
-.suggest-card {
-    margin-top: 10px;
-    padding: 12px;
-    border-radius: 8px;
-    background: rgba(33, 153, 248, 0.08);
-
-    &__title {
-        margin-bottom: 8px;
-        font-size: 14px;
-        font-weight: 500;
-        line-height: 20px;
-        color: #2199f8;
-    }
-
-    &__row {
-        font-size: 12px;
-        line-height: 20px;
-        color: #4E5969;
-
-        &+& {
-            margin-top: 8px;
-        }
-    }
-
-    &__label {
-        color: #000000;
-    }
-}
-
-.share-btn {
-    position: fixed;
-    left: 50%;
-    bottom: 64px;
-    z-index: 10;
-    transform: translateX(-50%);
-    min-width: 120px;
-    height: 40px;
-    box-sizing: border-box;
-    padding: 0 30px;
-    border-radius: 22px;
-    background: linear-gradient(180deg, #72C1FF 0%, #2199F8 100%);
-    color: #fff;
-    font-size: 14px;
-    line-height: 40px;
-    text-align: center;
-    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.1);
-}
-</style>

+ 0 - 23
src/views/old_mini/agri_file/pages/locationCheckPass.vue

@@ -1,23 +0,0 @@
-<template>
-    <div class="location-check-pass"></div>
-</template>
-
-<script setup>
-import { onMounted } from "vue";
-import wx from "weixin-js-sdk";
-
-const STORAGE_KEY = "FARM_LOCATION_CHECK_PASS";
-
-onMounted(() => {
-    localStorage.setItem(STORAGE_KEY, "1");
-    wx.miniProgram.navigateBack({ delta: 1 });
-});
-</script>
-
-<style scoped>
-.location-check-pass {
-    width: 100%;
-    height: 100vh;
-    background: #fff;
-}
-</style>

+ 0 - 141
src/views/old_mini/agri_record/components/areaMap.js

@@ -1,141 +0,0 @@
-import * as KMap from "@/utils/ol-map/KMap";
-import * as util from "@/common/ol_common.js";
-import config from "@/api/config.js";
-import { Vector as VectorSource } from "ol/source.js";
-import { Point } from 'ol/geom';
-import { newPoint, newAreaFeature } from "@/utils/map";
-import { GeoJSON, WKT } from 'ol/format'
-import { Feature } from "ol";
-import { getArea } from "ol/sphere"
-import * as turf from "@turf/turf"
-import Style from "ol/style/Style";
-import Icon from "ol/style/Icon";
-import { Fill, Text, Stroke } from "ol/style";
-import * as proj from "ol/proj";
-import proj4 from "proj4"
-import { register } from "ol/proj/proj4";
-proj4.defs("EPSG:38572", "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");
-register(proj4);
-
-/**
- *
- */
-class AreaMap {
-    constructor() {
-        let that = this;
-        let vectorStyle = new KMap.VectorStyle()
-        this.gardenPolygonLayer = new KMap.VectorLayer("gardenPolygonLayer", 999, {
-            minZoom: 11,
-            maxZoom: 22,
-            source: new VectorSource({}),
-            style: function (f) {
-                let style2 = vectorStyle.getPolygonStyle("#00000080", "#2199F8", 2)
-
-                let style3 = new Style({
-                    text: new Text({
-                        font: "14px sans-serif",
-                        text: f.get("mianji") + "亩",
-                        // offsetX: 28,
-                        offsetY: 10,
-                        fill: new Fill({ color: "#fff" }), // 字体颜色
-                    }),
-                });
-                return [style2]
-            }
-        });
-
-        // 位置图标
-        this.clickPointLayer = new KMap.VectorLayer("clickPointLayer", 9999, {
-            style: (f) => {
-                let pointIcon = new Style({
-                    image: new Icon({
-                        src: require("@/assets/img/home/garden-point.png"),
-                        scale: 0.5,
-                        anchor: [0.5, 1],
-                    }),
-                });
-                let nameText = new Style({
-                    text: new Text({
-                        font: "14px sans-serif",
-                        text: f.get("name"),
-                        offsetY: 10,
-                        fill: new Fill({ color: "#fff" }), // 字体颜色
-                        stroke: new Stroke({
-                            color: "#000",
-                            width: 0.5,
-                        }),
-                    }),
-                });
-                return [pointIcon, nameText]
-            },
-        });
-    }
-
-
-    initMap(location, target) {
-        let level = 16;
-        let coordinate = util.wktCastGeom(location).getFirstCoordinate();
-        this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 8, 22);
-        let xyz2 = config.base_img_url3 + "map/lby/{z}/{x}/{y}.png";
-        this.kmap.addXYZLayer(xyz2, { minZoom: 8, maxZoom: 22 }, 2);
-        this.kmap.addLayer(this.gardenPolygonLayer.layer);
-        this.kmap.addLayer(this.clickPointLayer.layer);
-    }
-
-    initLayer(item) {
-        // this.gardenPolygonLayer.refresh()
-        if (this.gardenPolygonLayer.source) {
-            this.gardenPolygonLayer.source.clear()
-        }
-        if (item.pointWkt) {
-            let f = newPoint(item, "pointWkt")
-            f.set("name", item.name)
-            this.clickPointLayer.source.addFeature(f)
-        }
-        console.log('item', item)
-        if (item.geomWkt) {
-            // let f = new Feature({
-            //     organId: item.organId, // 用于查找点击选中地块的编辑,有多个地块时用id筛选
-            //     geometry: new WKT().readGeometry(item.geomWkt)
-            // })
-            // let geometry = new WKT().readGeometry(item.geomWkt)
-            // geometry.transform(proj.get("EPSG:4326"), proj.get("EPSG:38572"))
-            let f = newAreaFeature(item, "geomWkt")
-            //   let area = getArea(geometry)
-            //   area = (area + area / 2) / 1000;
-            f.set("mianji", item.mianji)
-            this.gardenPolygonLayer.source.addFeature(f)
-        }
-        this.fitView()
-    }
-
-    /**
-   * 调整地图视图以适应地块范围
-   */
-    fitView() {
-        let extent = this.gardenPolygonLayer.source.getExtent()
-        if (extent) {
-            // 地图自适应到区域可视范围
-            this.kmap.getView().fit(extent, { duration: 50, padding: [80, 80, 80, 80] });
-        }
-    }
-
-    fitByGardenId(gardenId, hasMapAnimate) {
-        this.gardenPolygonLayer.source.forEachFeature((f) => {
-            if (f.get("organId") == gardenId) {
-                const extent = f.getGeometry().getExtent()
-                this.kmap.getView().fit(extent, { padding: [160, 60, 340, 60], duration: hasMapAnimate ? 1500 : 0 });
-                const currentZoom = this.kmap.getView().getZoom();
-                if (currentZoom > 16) {
-                    // this.kmap.getView().setZoom(16);
-                    this.kmap.getView().animate({
-                        zoom: 16,
-                        duration: hasMapAnimate ? 1500 : 0 // 动画持续时间,单位为毫秒
-                    });
-                }
-            }
-        })
-    }
-}
-
-export default AreaMap;

+ 0 - 94
src/views/old_mini/agri_record/components/mapInfo.vue

@@ -1,94 +0,0 @@
-<template>
-    <div class="map-info">
-        <!-- <div class="popup-title" v-if="showTitle">{{ t('执行区域') }}</div> -->
-        <div class="map-box">
-            <div class="map" ref="mapContainer"></div>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { ref, nextTick, onMounted, watch } from "vue";
-import IndexMap from "@/views/old_mini/home/map/index.js";
-import AreaMap from "./areaMap.js";
-
-const props = defineProps({
-    farmId: {
-        type: [Number, String],
-        default: null,
-    },
-    showTitle: {
-        type: Boolean,
-        default: true,
-    },
-});
-
-const mapContainer = ref(null);
-const indexMap = new IndexMap();
-const areaMap = new AreaMap();
-
-// 加载农场地图信息
-const loadFarmMap = async () => {
-    if (!props.farmId) return;
-
-    try {
-        const res = await VE_API.farm.getFarmDetail({ farmId: props.farmId });
-        if (res.code !== 0 || !res.data) return;
-
-        const farmInfo = res.data;
-        const point = farmInfo.pointWkt;
-        const geometryArr = farmInfo.geomWkt;
-
-        nextTick(() => {
-            // 如果地图已经初始化,则更新中心点和地块;否则初始化地图
-            if (areaMap.kmap) {
-                areaMap.initLayer(farmInfo);
-            } else if (point && mapContainer.value) {
-                areaMap.initMap(point, mapContainer.value);
-                areaMap.initLayer(farmInfo);
-            }
-        });
-    } catch (e) {
-        // 忽略地图加载错误,避免影响主流程
-    }
-};
-
-onMounted(() => {
-    loadFarmMap();
-});
-
-// farmId 变化时重新加载地图
-watch(
-    () => props.farmId,
-    () => {
-        loadFarmMap();
-    }
-);
-</script>
-
-<style lang="scss" scoped>
-.map-info {
-    width: 100%;
-}
-    .popup-title {
-        text-align: center;
-        font-size: 24px;
-        font-family: "PangMenZhengDao";
-        padding-bottom: 12px;
-    }
-
-.map-box {
-    width: 100%;
-    height: 350px;
-    position: relative;
-
-    .map {
-        width: 100%;
-        height: 100%;
-        clip-path: inset(0px round 5px);
-        pointer-events: none;
-    }
-}
-</style>

+ 0 - 269
src/views/old_mini/agri_record/index.vue

@@ -1,269 +0,0 @@
-<template>
-    <custom-header v-if="isHeaderShow" :name="t('agriRecord.farmDetail')"></custom-header>
-    <div class="monitor-index" :style="{ height: `calc(100vh - ${tabBarHeight}px)` }">
-        <!-- 天气遮罩 -->
-        <div class="weather-mask" v-show="isExpanded" @click="handleMaskClick"></div>
-        <!-- 头部 -->
-        <div class="agri-record-header">
-            <weather-info ref="weatherInfoRef" :hasWeather="false" from="agri_record" class="weather-info"
-                @weatherExpanded="weatherExpanded" @changeGarden="changeGarden" @changeGardenTab="changeGardenTab"
-                :isGarden="true"
-                :gardenId="defaultGardenId" />
-        </div>
-        <!-- 农场列表 -->
-        <div v-show="activeGardenTab === 'list'">
-            <garden-list ref="gardenListRef" :garden-id="selectedGardenId" @loaded="handleGardenLoaded"
-                @selectGarden="handleGardenSelected" />
-        </div>
-        <!-- 作物档案:Tab 固定顶部,仅农事列表区域滚动 -->
-        <div class="archives-time-line" v-show="activeGardenTab === 'current'">
-            <div class="archives-time-line-fixed">
-                <div class="farm-work-tabs">
-                    <div
-                        v-for="tab in farmWorkTabs"
-                        :key="tab.key"
-                        class="farm-work-tabs__item"
-                        :class="{ 'farm-work-tabs__item--active': activeFarmWorkTab === tab.key }"
-                        @click="handleFarmWorkTabClick(tab.key)"
-                    >
-                        {{ t(tab.labelKey) }}
-                    </div>
-                </div>
-            </div>
-            <div ref="archivesScrollAreaRef" class="archives-time-line-content">
-                <archives-farm-time-line :farmId="gardenId" :activeFarmWorkTab="activeFarmWorkTab"></archives-farm-time-line>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-
-import customHeader from "@/components/customHeader.vue";
-import { ref, computed, onActivated, onDeactivated, watch, nextTick } from "vue";
-import { useStore } from "vuex";
-import weatherInfo from "@/components/weatherInfo.vue";
-import { useRoute, onBeforeRouteLeave } from "vue-router";
-import ArchivesFarmTimeLine from "@/components/pageComponents/ArchivesFarmTimeLine.vue";
-import gardenList from "@/components/gardenList.vue";
-
-const route = useRoute();
-
-const archivesScrollAreaRef = ref(null);
-const getArchivesOuterScrollKey = () =>
-    `agriRecordArchivesOuterScroll:${gardenId?.value ?? "none"}:${route.path}`;
-
-const saveArchivesOuterScrollTop = () => {
-    if (!archivesScrollAreaRef.value || activeGardenTab.value !== "current") return;
-    const scrollTop = archivesScrollAreaRef.value.scrollTop || 0;
-    sessionStorage.setItem(getArchivesOuterScrollKey(), String(scrollTop));
-};
-
-const restoreArchivesOuterScrollTop = () => {
-    if (!archivesScrollAreaRef.value || activeGardenTab.value !== "current") return false;
-    const raw = sessionStorage.getItem(getArchivesOuterScrollKey());
-    if (raw == null) return false;
-    const scrollTop = Number(raw);
-    // scrollTop=0 视为未建立有效滚动位置,留给子组件自动定位到「待执行」
-    if (Number.isNaN(scrollTop) || scrollTop <= 4) return false;
-    const el = archivesScrollAreaRef.value;
-    const maxScrollTop = Math.max(0, (el.scrollHeight || 0) - (el.clientHeight || 0));
-    el.scrollTop = Math.min(scrollTop, maxScrollTop);
-    return true;
-};
-
-const restoreArchivesOuterScrollTopWithRetry = (retryCount = 6) => {
-    const ok = restoreArchivesOuterScrollTop();
-    if (ok || retryCount <= 0) return;
-    setTimeout(() => restoreArchivesOuterScrollTopWithRetry(retryCount - 1), 50);
-};
-
-const defaultGardenId = ref(null);
-const selectedGardenId = ref(null);
-const gardenListRef = ref(null);
-const activeGardenTab = ref('current');
-const activeFarmWorkTab = ref('0');
-const farmWorkTabs = [
-    { key: '0', labelKey: 'agriRecord.allFarmWork' },
-    { key: '1', labelKey: 'agriRecord.traceFarmWork' },
-];
-
-const handleFarmWorkTabClick = (tab) => {
-    activeFarmWorkTab.value = tab;
-};
-
-const changeGardenTab = (tab) => {
-    activeGardenTab.value = tab;
-};
-
-const handleGardenLoaded = ({ hasFarm }) => {
-    weatherInfoRef.value?.setGardenLoaded?.(hasFarm);
-};
-
-const handleGardenSelected = (garden) => {
-    selectedGardenId.value = garden?.id ?? null;
-    weatherInfoRef.value?.setSelectedGarden?.(garden);
-};
-
-const isHeaderShow = ref(false);
-const weatherInfoRef = ref(null);
-
-onActivated(() => {
-    // 用来接收我的农场跳转过来的农场详情逻辑
-    if (route.query.isHeaderShow) {
-        isHeaderShow.value = true;
-        defaultGardenId.value = route.query.farmId;
-    }
-    const savedFarmId = localStorage.getItem("selectedFarmId");
-    selectedGardenId.value = savedFarmId ? Number(savedFarmId) : null;
-    gardenListRef.value?.refreshFarmList?.();
-    nextTick(() => {
-        requestAnimationFrame(() => {
-            restoreArchivesOuterScrollTopWithRetry();
-        });
-    });
-});
-
-onDeactivated(() => {
-    saveArchivesOuterScrollTop();
-});
-
-onBeforeRouteLeave(() => {
-    saveArchivesOuterScrollTop();
-});
-
-watch(activeGardenTab, (val, oldVal) => {
-    if (oldVal === "current" && val !== "current") {
-        saveArchivesOuterScrollTop();
-    }
-    if (val === "current") {
-        nextTick(() => {
-            requestAnimationFrame(() => {
-                restoreArchivesOuterScrollTopWithRetry();
-            });
-        });
-    }
-});
-
-const store = useStore();
-const tabBarHeight = computed(() => store.state.home.tabBarHeight);
-
-const isExpanded = ref(false);
-const weatherExpanded = (isExpandedValue) => {
-    isExpanded.value = isExpandedValue;
-};
-
-// 点击遮罩时收起天气
-const handleMaskClick = () => {
-    if (weatherInfoRef.value && weatherInfoRef.value.toggleExpand) {
-        weatherInfoRef.value.toggleExpand();
-    }
-};
-
-const gardenId = ref(store.state.home.gardenId);
-
-const changeGarden = (data) => {
-    if (!data?.id) return;
-    gardenId.value = data.id;
-    selectedGardenId.value = data.id;
-    store.commit("home/SET_GARDEN_ID", data.id);
-};
-</script>
-
-<style scoped lang="scss">
-.monitor-index {
-    width: 100%;
-    height: 100%;
-    box-sizing: border-box;
-    background: linear-gradient(180deg, #2199F8 8%, #F5F5F5 19%, #F5F5F5 73%, #F5F5F5 100%);
-
-    .weather-mask {
-        position: fixed;
-        top: 0;
-        left: 0;
-        width: 100%;
-        height: 100%;
-        background-color: rgba(0, 0, 0, 0.52);
-        z-index: 11;
-    }
-
-    .agri-record-header {
-        position: absolute;
-        z-index: 12;
-        left: 10px;
-        top: 12px;
-        width: calc(100% - 20px);
-        transform: translateZ(0);
-
-        .weather-info {
-            width: 100%;
-            position: relative;
-            left: auto;
-            top: auto;
-
-            :deep(.garden-tabs) {
-                .garden-item.left-item.active .current-name {
-                    color: #2199F8;
-                    font-weight: 600;
-                }
-            }
-        }
-    }
-
-    .archives-time-line {
-        position: relative;
-        height: 100%;
-        padding: 12px;
-        // padding-top: 100px;
-        padding-top: 53px;
-        display: flex;
-        flex-direction: column;
-        min-height: 0;
-        overflow: hidden;
-        box-sizing: border-box;
-
-        .archives-time-line-fixed {
-            flex-shrink: 0;
-        }
-
-        .farm-work-tabs {
-            display: flex;
-            gap: 8px;
-            margin-top: 10px;
-
-            &__item {
-                flex: 1;
-                padding: 5px 0;
-                border-radius: 2px;
-                text-align: center;
-                background: #EFEFEF;
-                color: #858585;
-
-                &--active {
-                    background: #2199f8;
-                    color: #ffffff;
-                }
-            }
-        }
-
-        .archives-time-line-content {
-            margin-top: 10px;
-            flex: 1;
-            min-height: 0;
-            overflow-y: auto;
-            -webkit-overflow-scrolling: touch;
-            background: #fff;
-            border-radius: 8px;
-            padding: 10px;
-            box-sizing: border-box;
-
-            :deep(.timeline-container) {
-                height: auto;
-                overflow: visible;
-            }
-        }
-    }
-}
-</style>

+ 0 - 248
src/views/old_mini/create_farm/editMap.vue

@@ -1,248 +0,0 @@
-<template>
-    <div class="edit-map">
-        <custom-header :name="$t('编辑农场')" :isGoBack="true" @goback="backgToCreate"></custom-header>
-        <div class="edit-map-content">
-            <div class="edit-map-tip">{{ t('操作提示:拖动圆点,即可调整地块边界') }}</div>
-            <div class="map-container" ref="mapContainer"></div>
-            <div class="edit-map-footer">
-                <div class="footer-back" @click="goBack">
-                    <img class="back-icon" src="@/assets/img/home/go-back.png" alt="" />
-                </div>
-                <div class="footer-address-box">
-                    <div class="footer-address">
-                        <div class="address-title">{{ pointName }}</div>
-                        <div class="address-detail">{{ pointAddress }}</div>
-                    </div>
-                    <div class="address-btn" @click="goBack">{{ t('修改地址') }}</div>
-                </div>
-                <div class="edit-map-footer-btn">
-                    <div class="btn-delete" @click="deletePolygon">{{ t('删除地块') }}</div>
-                    <div class="btn-cancel" @click="goBack">{{ t('取消') }}</div>
-                    <div class="btn-confirm" @click="confirm">{{ t('确认') }}</div>
-                </div>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import customHeader from "@/components/customHeader.vue";
-import { ref, onMounted, onActivated, onDeactivated } from "vue";
-import EditMap from "./map/editMap.js";
-import { useRouter, useRoute } from "vue-router";
-import { convertPointToArray } from "@/utils/index";
-import { useStore } from "vuex";
-import { ElMessage, ElMessageBox } from "element-plus";
-
-const router = useRouter();
-const route = useRoute();
-const store = useStore();
-const mapContainer = ref(null);
-const editMap = new EditMap();
-const mapData = {
-    farmCode: "LBY",
-    farmId: "766",
-    id: 2,
-    isGenerateReport: 1,
-    name: "分区2",
-    pointCount: 131,
-    pointWkt: "POINT (113.6142086995688 23.585836479509055)",
-    regionCode: "LBY-MR-2",
-    wkt: "MULTIPOLYGON (((113.61348988377155 23.58617369800422, 113.61395837633405 23.58622555407246, 113.61414076654707 23.58622555407246, 113.61436964832843 23.5862774101407, 113.61478628474084 23.586468741036786, 113.61491681896747 23.58652417337007, 113.61512424307672 23.586449071517652, 113.61491503077356 23.585742756367924, 113.61479880177082 23.585596129050916, 113.61473800497858 23.585451289764112, 113.61438931780664 23.585286780835393, 113.61410858003889 23.585299297865365, 113.61385645239149 23.585249229909184, 113.61378135053907 23.585288569029306, 113.61357571446003 23.585283204611276, 113.61347200232355 23.585342213209604, 113.61338080721704 23.585506721974614, 113.61335934954492 23.585665866485304, 113.61342193444922 23.58616296916816, 113.61348988377155 23.58617369800422)))",
-};
-
-const pointAddress = ref(null)
-const pointName = ref(null)
-const type = ref(null)
-onMounted(() => {
-    pointAddress.value = route.query.pointAddress
-    pointName.value = route.query.pointName
-    type.value = route.query.type
-    const point = route.query.mapCenter || "POINT (113.6142086995688 23.585836479509055)"
-    editMap.initMap(point, mapContainer.value);
-    
-    // 设置绘制限制回调
-    editMap.setDrawLimitCallback(() => {
-        ElMessage.warning({ message: t('请先删除当前地块再重新勾画'), type: 'warning' });
-    });
-    // editMap.setAreaGeometry([{ featureWkt: mapData.wkt }]);
-});
-
-onActivated(() => {
-    pointAddress.value = route.query.pointAddress
-    pointName.value = route.query.pointName
-    const point = route.query.mapCenter || "POINT (113.6142086995688 23.585836479509055)"
-    
-    // 先绘制地块
-    const polygonData = store.state.home.polygonData;
-    if (polygonData) {
-        editMap.setAreaGeometry(polygonData?.geometryArr);
-    }
-    
-    // 再设置地图中心位置,确保视图在 mapCenter
-    editMap.setMapPosition(convertPointToArray(point))
-})
-
-onDeactivated(() => {
-    editMap.clearLayer()
-})
-const goBack = () => {
-    editMap.clearLayer()
-    // 用户点击取消,不保存编辑结果
-    // 保持 store 中的数据不变(保留跳转前的状态,isConfirmed 保持为 false)
-    // 不需要做任何处理,直接返回即可
-    
-    if (type.value !== 'edit') {
-        router.replace(`/create_farm?from=${route.query.from}&type=${route.query.type}`)
-    }else{
-        router.back()
-    }
-};
-
-function backgToCreate() {
-    editMap.clearLayer()
-    // 用户点击返回,不保存编辑结果
-    // 保持 store 中的数据不变
-    
-    if (type.value !== 'edit') {
-        router.replace(`/create_farm?from=${route.query.from}&type=${route.query.type}`)
-    }else{
-        router.back()
-    }
-}
-const deletePolygon = () => {
-    ElMessageBox.confirm(
-        '确认要删除当前地块吗?删除后可以重新勾画。',
-        '删除确认',
-        {
-            confirmButtonText: '确认删除',
-            cancelButtonText: '取消',
-            type: 'warning',
-        }
-    ).then(() => {
-        editMap.deleteCurrentPolygon();
-        ElMessage.success({ message: t('地块已删除'), type: 'success' });
-    }).catch(() => {
-        // 用户取消删除,不做任何操作
-    });
-};
-
-const confirm = () => {
-    // getAreaGeometry
-    const polygonData = editMap.getAreaGeometry()
-    
-    // 标记为已确认,表示从编辑页面确认返回
-    polygonData.isConfirmed = true;
-    
-    store.commit("home/SET_FARM_POLYGON", polygonData);
-    
-    if (type.value !== 'edit') {
-        // 添加时间戳确保路由更新,触发 onActivated
-        const timestamp = Date.now();
-        router.replace(`/create_farm?from=${route.query.from}&type=${route.query.type}&_t=${timestamp}`)
-    }else{
-        router.back()
-    }
-};
-</script>
-
-<style lang="scss" scoped>
-.edit-map {
-    width: 100%;
-    height: 100vh;
-    overflow: hidden;
-    .edit-map-content {
-        width: 100%;
-        height: 100%;
-        position: relative;
-        .edit-map-tip {
-            position: absolute;
-            top: 23px;
-            left: calc(50% - 256px / 2);
-            z-index: 1;
-            font-size: 12px;
-            color: #fff;
-            padding: 9px 20px;
-            background: rgba(0, 0, 0, 0.5);
-            border-radius: 20px;
-        }
-        .map-container {
-            width: 100%;
-            height: 100%;
-        }
-        .edit-map-footer {
-            position: absolute;
-            bottom: 80px;
-            left: 12px;
-            width: calc(100% - 24px);
-            display: flex;
-            flex-direction: column;
-            align-items: flex-end;
-            .footer-back {
-                padding: 6px 7px 9px;
-                background: #fff;
-                border-radius: 8px;
-                .back-icon {
-                    width: 20px;
-                    height: 18px;
-                }
-            }
-            .footer-address-box {
-                width: 100%;
-                box-sizing: border-box;
-                margin: 19px 0 14px 0;
-                display: flex;
-                justify-content: space-between;
-                align-items: center;
-                background: #fff;
-                border-radius: 14px;
-                padding: 14px 12px;
-                .footer-address {
-                    font-size: 12px;
-                    color: rgba(0, 0, 0, 0.6);
-                    .address-title {
-                        font-weight: 500;
-                        font-size: 16px;
-                        color: #000;
-                    }
-                }
-                .address-btn {
-                    color: #2199f8;
-                    border: 1px solid #2199f8;
-                    border-radius: 25px;
-                    padding: 6px 10px;
-                    flex: none;
-                }
-            }
-            .edit-map-footer-btn {
-                display: flex;
-                justify-content: center;
-                align-items: center;
-                width: 100%;
-                gap: 8px;
-                div {
-                    flex: 1;
-                    max-width: 100px;
-                    text-align: center;
-                    color: #666666;
-                    font-size: 14px;
-                    padding: 8px 0;
-                    border-radius: 25px;
-                    background: #fff;
-                }
-                .btn-delete {
-                    background: #ff4d4f;
-                    color: #fff;
-                }
-                .btn-confirm {
-                    background: #000;
-                    background-image: linear-gradient(180deg, #76c3ff 0%, #2199f8 100%);
-                    color: #fff;
-                }
-            }
-        }
-    }
-}
-</style>

+ 0 - 1311
src/views/old_mini/create_farm/index copy.vue

@@ -1,1311 +0,0 @@
-<template>
-    <div class="create-farm">
-        <custom-header :name="paramsType === 'client' ? '新增用户' : paramsType === 'edit' ? '编辑农场' : '创建农场'"
-            :isGoBack="true" @goback="backgToHome"></custom-header>
-        <!-- 地图 -->
-        <div class="map-container" ref="mapContainer"></div>
-        <div class="farm-content">
-            <div class="top-mask"></div>
-            <div class="farm-filter">
-                <el-select v-model="locationVal" filterable remote reserve-keyword placeholder="搜索位置"
-                    :remote-method="remoteMethod" :loading="loading" @change="handleSearchRes"
-                    popper-class="location-search-popper">
-                    <el-option v-for="(item, index) in locationOptions.list" :key="index" :label="item.title"
-                        :value="{ value: item.point, item }">
-                        <span>{{ item.title }}</span>
-                        <span class="sub-title">{{ item.province }}{{ item.city }}{{ item.district || '' }}</span>
-                    </el-option>
-                </el-select>
-            </div>
-
-            <!-- 创建 -->
-            <div class="create-wrap">
-                <div class="create-box">
-                    <div class="box-content">
-                        <div class="create-title">
-                            <img class="title-icon" src="@/assets/img/home/create-icon.png" alt="" />
-                            {{ paramsType === "client" ? "新增用户" : paramsType === "edit" ? "编辑农场" : "创建农场" }}
-                        </div>
-                        <div class="create-content">
-                            <div class="create-from">
-                                <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" class="demo-ruleForm">
-                                    <el-form-item label="农场位置" prop="address">
-                                        <div class="position-wrap">
-                                            <el-input placeholder="农场位置" readonly v-model="ruleForm.address"
-                                                autocomplete="off" />
-                                            <div class="draw-btn" @click="toSubPage">
-                                                {{ hasDefaultPolygon ? "点击勾选地块" : "新增地块" }}
-                                            </div>
-                                        </div>
-                                    </el-form-item>
-                                    <el-form-item label="种植作物" prop="speciesItem">
-                                        <div class="select-wrap">
-                                            <el-select v-model="ruleForm.speciesItem" filterable class="select-item specie-select"
-                                                multiple :max-collapse-tags="3" collapse-tags placeholder="种植作物(可多选)" @change="changeSpecie">
-                                                <el-option v-for="(item, index) in specieList" :key="index"
-                                                    :label="item.name" :value="{ value: item.id, ...item }" />
-                                            </el-select>
-                                        </div>
-                                    </el-form-item>
-                                    <el-form-item label="联系人" prop="fzr">
-                                        <div class="area-box">
-                                            <el-input placeholder="请输入联系人姓名" v-model="ruleForm.fzr" autocomplete="off"
-                                                style="width: fit-content" />
-                                        </div>
-                                    </el-form-item>
-                                    <el-form-item label="联系电话" prop="tel">
-                                        <div class="area-box">
-                                            <el-input placeholder="请输入联系人电话" type="number" v-model="ruleForm.tel" autocomplete="off"
-                                                style="width: fit-content" />
-                                        </div>
-                                    </el-form-item>
-                                    <el-form-item label="农场面积" prop="mu">
-                                        <div class="area-box">
-                                            <el-input :placeholder="isFromEditMap ? '勾选地块获得农场面积' : '请输入农场的真实面积'
-                                                " v-model="ruleForm.mu" :readonly="isFromEditMap" type="text"
-                                                autocomplete="off" style="width: fit-content" @input="handleMianjiInput"
-                                                @keypress="handleMianjiKeypress" />
-                                            <div class="unit">亩</div>
-                                        </div>
-                                    </el-form-item>
-                                    <el-form-item label="农场名称" prop="name">
-                                        <el-input placeholder="请输入您的农场名称" v-model="ruleForm.name" autocomplete="off"
-                                            @input="handleFarmNameInput" />
-                                    </el-form-item>
-                                    <!-- <el-form-item label="基地类别" prop="baseType" class="select-wrap client-wrap">
-                                        <el-select placeholder="请选择" v-model="ruleForm.baseType" autocomplete="off">
-                                            <el-option v-for="(item, index) in baseTypeList" :key="index"
-                                                :label="item.name" :value="item.id" />
-                                        </el-select>
-                                    </el-form-item> -->
-                                </el-form>
-                            </div>
-                            <div class="create-btn">
-                                <div class="btn-item sencond-btn" @click="resetForm(ruleFormRef)">取消</div>
-                                <div class="btn-item primary-btn" @click="submitForm(ruleFormRef)">
-                                    {{
-                                        paramsType === "client"
-                                            ? "添加"
-                                            : paramsType === "edit"
-                                                ? "确认修改"
-                                                : "立即创建"
-                                    }}
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!-- 农情采集成功弹窗 -->
-    <tip-popup v-model:show="showSuccessPopup" type="success" text="农情采集成功" @confirm="handlePopupConfirm"
-        @handleClickOverlay="handlePopupConfirm" />
-</template>
-
-<script setup>
-import customHeader from "@/components/customHeader.vue";
-import IndexMap from "./map/index.js";
-import { useRoute, useRouter } from "vue-router";
-import { mapLocation } from "./map/index.js";
-import { onMounted, ref, reactive, watch, onActivated, nextTick, onDeactivated } from "vue";
-import { useStore } from "vuex";
-import { convertPointToArray } from "@/utils/index";
-import { ElMessage } from "element-plus";
-import { Checkbox } from "vant";
-import tipPopup from "@/components/popup/tipPopup.vue";
-import wx from "weixin-js-sdk";
-import { transformFromGCJToWGS, transformFromWGSToGCJ } from "@/utils/WSCoordinate.js";
-
-const route = useRoute();
-const router = useRouter();
-const store = useStore();
-
-const indexMap = new IndexMap();
-const mapContainer = ref(null);
-
-// 农情采集成功弹窗
-const showSuccessPopup = ref(false);
-
-const handlePopupConfirm = () => {
-    showSuccessPopup.value = false;
-    router.replace(`/home`);
-};
-
-// 标记是否从编辑地图页面确认返回
-const isFromEditMap = ref(false);
-
-// 标记是否已创建默认地块
-const hasDefaultPolygon = ref(false);
-
-// 标记用户是否手动修改过农场名称
-const isFarmNameManuallyModified = ref(false);
-
-/**
- * 根据中心点生成指定边长的正方形地块WKT
- * @param {Array} center - 中心点坐标 [lng, lat]
- * @param {Number} sideLength - 正方形边长(米)
- * @returns {Object} 包含WKT字符串和面积(亩)的对象
- */
-function generateSquarePolygonBySideLength(center, sideLength) {
-    // 确保输入是数字类型
-    const lng = parseFloat(center[0]);
-    const lat = parseFloat(center[1]);
-
-    // 半边长(米)
-    const halfSide = sideLength / 2;
-
-    // 纬度方向:1度约等于111000米
-    const latDelta = halfSide / 111000;
-
-    // 经度方向:需要根据纬度调整,1度约等于111000 * cos(lat)米
-    const lngDelta = halfSide / (111000 * Math.cos((lat * Math.PI) / 180));
-
-    // 计算四个顶点(逆时针顺序)
-    const topLeft = [lng - lngDelta, lat + latDelta];
-    const topRight = [lng + lngDelta, lat + latDelta];
-    const bottomRight = [lng + lngDelta, lat - latDelta];
-    const bottomLeft = [lng - lngDelta, lat - latDelta];
-
-    // 生成MULTIPOLYGON格式的WKT(需要闭合,所以第一个点要重复)
-    // 明确使用join来格式化坐标点
-    const formatPoint = (point) => `${point[0]} ${point[1]}`;
-    const coordinates = [topLeft, topRight, bottomRight, bottomLeft, topLeft].map(formatPoint).join(", ");
-
-    // 注意:MULTIPOLYGON 和括号之间需要有一个空格
-    const wkt = `MULTIPOLYGON (((${coordinates})))`;
-
-    // 计算面积(亩): 边长200米 = 40,000平方米 ≈ 60亩
-    const areaInSquareMeters = sideLength * sideLength;
-    const areaInMu = (areaInSquareMeters / 666.67).toFixed(2);
-
-    return { wkt, area: areaInMu };
-}
-
-/**
- * 根据中心点和亩数生成正方形地块WKT
- * @param {Array} center - 中心点坐标 [lng, lat]
- * @param {Number} mu - 面积(亩)
- * @returns {Object} 包含WKT字符串和面积(亩)的对象
- */
-function generateSquarePolygonByMu(center, mu) {
-    // 确保输入是数字类型
-    const lng = parseFloat(center[0]);
-    const lat = parseFloat(center[1]);
-
-    // 1亩 ≈ 666.67平方米
-    const areaInSquareMeters = mu * 666.67;
-    // 正方形边长(米)
-    const sideLength = Math.sqrt(areaInSquareMeters);
-    // 半边长(米)
-    const halfSide = sideLength / 2;
-
-    // 纬度方向:1度约等于111000米
-    const latDelta = halfSide / 111000;
-
-    // 经度方向:需要根据纬度调整,1度约等于111000 * cos(lat)米
-    const lngDelta = halfSide / (111000 * Math.cos((lat * Math.PI) / 180));
-
-    // 计算四个顶点(逆时针顺序)
-    const topLeft = [lng - lngDelta, lat + latDelta];
-    const topRight = [lng + lngDelta, lat + latDelta];
-    const bottomRight = [lng + lngDelta, lat - latDelta];
-    const bottomLeft = [lng - lngDelta, lat - latDelta];
-
-    // 生成MULTIPOLYGON格式的WKT(需要闭合,所以第一个点要重复)
-    const formatPoint = (point) => `${point[0]} ${point[1]}`;
-    const coordinates = [topLeft, topRight, bottomRight, bottomLeft, topLeft].map(formatPoint).join(", ");
-
-    // 注意:MULTIPOLYGON 和括号之间需要有一个空格
-    const wkt = `MULTIPOLYGON (((${coordinates})))`;
-
-    return { wkt, area: parseFloat(mu).toFixed(2) };
-}
-
-onMounted(() => {
-    // 清除上一次的地块数据,确保每次进入都是全新状态
-    store.commit("home/SET_FARM_POLYGON", null);
-    isFromEditMap.value = false; // 初始化时可以手动输入
-    hasDefaultPolygon.value = false; // 初始化时没有默认地块
-
-    centerPoint.value = store.state.home.miniUserLocationPoint;
-    // const arr = convertPointToArray(centerPoint.value);
-    // getLocationName(`${arr[1]},${arr[0]}`);
-    indexMap.initMap(centerPoint.value, mapContainer.value);
-
-    // 不再初始化时绘制默认地块,等待用户点击"新增地块"按钮
-    // 清空地块和面积数据
-    polygonArr.value = null;
-    ruleForm.mu = "";
-
-    // 如果是编辑模式,等待品类列表加载完成后再回填数据
-    if (route.query.type === "edit" && store.state.home.editFarmData) {
-        getSpecieList().then(() => {
-            populateEditData();
-        });
-    } else {
-        getSpecieList();
-    }
-    getBaseTypeList();
-});
-
-const polygonArr = ref(null);
-const paramsType = ref(null);
-onActivated(() => {
-    const centerPointVal = sessionStorage.getItem('centerPoint') ? JSON.parse(sessionStorage.getItem('centerPoint')) : null;
-    paramsType.value = route.query.type;
-
-    centerPoint.value = centerPointVal || store.state.home.miniUserLocationPoint;
-    const arr = convertPointToArray(centerPoint.value);
-    getLocationName(`${arr[1]},${arr[0]}`);
-    // 仅在携带 isReload 标记、且不是编辑/小程序回流场景时,认为是一次全新创建,重置表单和地块,
-    // 避免破坏原有自动生成农场名称等逻辑
-    if (route.query.isReload && paramsType.value !== "edit" && !route.query.miniJson) {
-        // 重置表单字段到初始值
-        ruleFormRef.value && ruleFormRef.value.resetFields();
-        // 重置与地块绘制相关的内部状态
-        polygonArr.value = null;
-        isFromEditMap.value = false;
-        hasDefaultPolygon.value = false;
-        // 重置农场名称手动修改标记,允许自动生成农场名称
-        isFarmNameManuallyModified.value = false;
-        // 清空上一次地块缓存
-        store.commit("home/SET_FARM_POLYGON", null);
-        getSpecieList();
-    }
-    // 确保地图已初始化,使用 nextTick 等待 DOM 更新
-    nextTick(() => {
-        // 检查地图实例是否已初始化
-        if (!indexMap.kmap) {
-            // 如果地图未初始化,重新初始化
-            if (mapContainer.value) {
-                centerPoint.value = store.state.home.miniUserLocationPoint;
-                const arr = convertPointToArray(centerPoint.value);
-                indexMap.initMap(centerPoint.value, mapContainer.value);
-            }
-            // 等待地图初始化完成后再继续
-            setTimeout(() => {
-                handleMapUpdate();
-            }, 100);
-            return;
-        }
-        handleMapUpdate();
-    });
-});
-
-onDeactivated(() => {
-    sessionStorage.setItem('centerPoint', JSON.stringify(centerPoint.value));
-});
-
-// 处理地图更新的逻辑
-function handleMapUpdate() {
-    if (route.query.isReload) {
-        // 清除旧的地块数据
-        store.commit("home/SET_FARM_POLYGON", null);
-        isFromEditMap.value = false; // 从home进入,可以手动输入
-        hasDefaultPolygon.value = false; // 重置默认地块状态
-        locationVal.value = null;
-
-        centerPoint.value = store.state.home.miniUserLocationPoint;
-        const arr = convertPointToArray(centerPoint.value);
-        getLocationName(`${arr[1]},${arr[0]}`);
-        indexMap.setMapPosition(arr);
-
-        indexMap.clearLayer();
-
-        // 不再自动生成默认地块,等待用户点击"新增地块"
-        polygonArr.value = null;
-        ruleForm.mu = "";
-        ruleForm.defaultFarm = 0;
-
-        return; // 直接返回,不执行下面的逻辑
-    }
-
-    indexMap.clearLayer();
-    // 绘制勾画范围(从edit_map返回的情况)
-    const polygonData = store.state.home.polygonData;
-
-    // 优先处理从编辑地图页面返回的数据
-    if (polygonData) {
-        // 检查地块数据是否有效(数组存在且不为空)
-        const hasValidGeometry =
-            polygonData.geometryArr && Array.isArray(polygonData.geometryArr) && polygonData.geometryArr.length > 0;
-
-        if (hasValidGeometry) {
-            // 用户从edit_map返回,且有有效的地块数据
-            // 根据 isConfirmed 判断是否锁定输入框
-            if (polygonData.isConfirmed) {
-                // 用户点击了"确认"按钮,锁定输入框并显示精确面积
-                isFromEditMap.value = true;
-                ruleForm.mu = polygonData.mianji;
-            } else {
-                // 用户点击了"取消",不锁定输入框,面积保持原样
-                isFromEditMap.value = false;
-                // 面积输入框保持之前的值,不更新
-            }
-            // 使用 nextTick 确保地图渲染完成后再设置地块
-            nextTick(() => {
-                indexMap.setAreaGeometry(polygonData.geometryArr);
-            });
-            polygonArr.value = polygonData.geometryArr;
-            // 有地块数据时,标记已创建默认地块
-            hasDefaultPolygon.value = true;
-        } else {
-            // 用户在编辑页面删除了所有地块
-            // 重置所有状态
-            polygonArr.value = null;
-            ruleForm.mu = "";
-            isFromEditMap.value = false;
-            hasDefaultPolygon.value = false;
-            ruleForm.defaultFarm = 0;
-        }
-    } else if (route.query.type === "edit" && store.state.home.editFarmData) {
-        // 如果是编辑模式且没有从编辑地图返回的数据,回填原始编辑数据
-        populateEditData();
-    } else if (centerPoint.value && polygonArr.value) {
-        // 没有新的编辑数据,保持当前地块
-        // 同样需要检查数据有效性
-        if (Array.isArray(polygonArr.value) && polygonArr.value.length > 0) {
-            nextTick(() => {
-                indexMap.setAreaGeometry(polygonArr.value);
-            });
-            // 保持 hasDefaultPolygon 状态
-        }
-    }
-}
-
-// 搜索
-const MAP_KEY = "CZLBZ-LJICQ-R4A5J-BN62X-YXCRJ-GNBUT";
-
-const locationVal = ref(null);
-const locationOptions = reactive({
-    list: [],
-});
-const loading = ref(false);
-const remoteMethod = async (keyword) => {
-    if (keyword) {
-        locationOptions.list = [];
-        loading.value = true;
-        const params = {
-            key: MAP_KEY,
-            keyword,
-            location: route.query.userLocation || "113.61702297075017,23.584863449735067",
-        };
-        await VE_API.old_mini_map.getCtiyList({ word: keyword }).then(({ data }) => {
-            if (data && data.length) {
-                data.forEach((item) => {
-                    item.point = item.location.lat + "," + item.location.lng;
-                    locationOptions.list.push(item);
-                });
-            }
-        });
-        VE_API.old_mini_map.search(params).then(({ data }) => {
-            loading.value = false;
-            data.forEach((item) => {
-                item.point = item.location.lat + "," + item.location.lng;
-                locationOptions.list.push(item);
-            });
-        });
-    } else {
-        locationOptions.list = [];
-    }
-};
-
-const handleSearchRes = (v) => {
-    const parts = v.value.split(",");
-    let { latitude, longitude } = transformFromGCJToWGS(parseFloat(parts[0]), parseFloat(parts[1]));
-    const coordinateArray = [longitude, latitude];
-    indexMap.setMapPosition(coordinateArray);
-    centerPoint.value = `POINT (${coordinateArray[0]} ${coordinateArray[1]})`;
-    ruleForm.address = v.item?.title || v.item?.address;
-    pointAddress.value = v.item?.province + v.item?.city + (v.item?.district || '');
-    // 更新farmCity以便后续更新农场名称
-    farmCity.value = v.item?.city + (v.item?.district || "");
-    // 地址修改后,如果满足条件则自动更新农场名称
-    updateFarmNameIfNeeded();
-    getSpecieList();
-};
-
-// 表单
-const ruleFormRef = ref(null);
-const ruleForm = reactive({
-    address: "",
-    mu: "",
-    // 多选品类:数组
-    speciesItem: [],
-    name: "",
-    fzr: "",
-    tel: "",
-    baseType: null,
-    defaultFarm: 0, // 0:否 1:是
-});
-// 自定义验证规则:验证面积必须是大于0的数字
-const validateMianji = (rule, value, callback) => {
-    if (!value) {
-        callback(new Error("请输入农场面积"));
-    } else {
-        const num = parseFloat(value);
-        if (isNaN(num)) {
-            callback(new Error("面积必须是数字"));
-        } else if (num <= 0) {
-            callback(new Error("面积必须大于0"));
-        } else {
-            callback();
-        }
-    }
-};
-
-const rules = reactive({
-    address: [{ required: true, message: "请选择农场位置", trigger: "blur" }],
-    mu: [
-        { required: true, message: "请输入农场面积", trigger: "blur" },
-        { validator: validateMianji, trigger: ["blur", "change"] },
-    ],
-    speciesItem: [{ required: true, message: "请选择种植作物", trigger: ["blur", "change"] }],
-    name: [{ required: true, message: "请输入您的农场名称", trigger: ["blur", "change"] }],
-    fzr: [{ required: true, message: "请输入联系人姓名", trigger: ["blur", "change"] }],
-    tel: [
-        { required: true, message: "请输入联系人电话", trigger: ["blur"] },
-        {
-            pattern: /^1[3-9]\d{9}$/,
-            message: "请输入正确的手机号码",
-            trigger: ["blur"],
-        },
-    ],
-    defaultFarm: [{ required: true, message: "请选择是否为默认农场", trigger: "blur" }],
-    baseType: [{ required: true, message: "请选择基地类别", trigger: "blur" }],
-});
-
-const curRole = localStorage.getItem("SET_USER_CUR_ROLE");
-
-const submitForm = (formEl) => {
-    if (!formEl) return;
-    formEl.validate((valid) => {
-        if (valid) {
-            const speciesList = Array.isArray(ruleForm.speciesItem) ? ruleForm.speciesItem : (ruleForm.speciesItem ? [ruleForm.speciesItem] : []);
-            const mainSpecies = speciesList[0];
-            const speciesContainer = speciesList.map((item) => ({
-                speciesId: item?.id ?? null,
-                containerId: item?.defaultContainerId ?? null,
-            }));
-            const params = {
-                ...ruleForm,
-                wkt: centerPoint.value,
-                speciesContainer,
-                agriculturalCreate: route.query.type === "client" ? 1 : 0,
-                // 编辑时geom不是数组,新增时是数组
-                geom:
-                    route.query.type === "edit"
-                        ? polygonArr.value && polygonArr.value.length > 0
-                            ? polygonArr.value[0]
-                            : null
-                        : polygonArr.value,
-            };
-
-            // 如果是编辑模式,添加农场ID
-            if (route.query.type === "edit" && route.query.farmId) {
-                params.id = route.query.farmId;
-            }
-
-            // let pageData = null;
-            // if (route.query.miniJson) {
-            //     const json = JSON.parse(route.query.miniJson);
-            //     console.log('json', json);
-            //     // pageData = JSON.parse(json.paramsPage);
-            // }
-
-            if (route.query.type !== "edit") {
-                // 处理 geom 参数,如果是数组需要序列化
-                const queryParams = {
-                    ...params,
-                    ...route.query,
-                };
-                // 如果 geom 是数组,需要序列化为 JSON 字符串
-                if (Array.isArray(queryParams.geom)) {
-                    queryParams.geom = JSON.stringify(queryParams.geom);
-                }
-                // speciesContainer 为对象时需序列化,否则 query 传递后无法正确解析
-                if (queryParams.speciesContainer && typeof queryParams.speciesContainer === 'object') {
-                    queryParams.speciesContainer = JSON.stringify(queryParams.speciesContainer);
-                }
-                delete queryParams.speciesItem;
-                queryParams.speciesName = mainSpecies?.name;
-
-                // if (pageData?.type === 'add') {
-                //     queryParams.invite = true;
-                // }
-                router.push({
-                    path: "/prescription",
-                    query: queryParams,
-                });
-                return;
-            }
-
-            // const apiCall = route.query.type === "edit" ? VE_API.basic_farm.saveBasicFarmInfoByExpertV3({...params, expertMiniUserId: '81881'}) : VE_API.farm.saveFarm(params);
-
-            // apiCall.then((res) => {
-            //     if (res.code === 0) {
-            //         ElMessage.success(route.query.type === "edit" ? "修改成功" : "创建成功");
-            //         // 重置表单和地块数据
-            //         ruleFormRef.value.resetFields();
-            //         store.commit("home/SET_FARM_POLYGON", null);
-            //         store.commit("home/SET_EDIT_FARM_DATA", null); // 清除编辑数据
-            //         polygonArr.value = null;
-            //         isFromEditMap.value = false;
-
-            //         if (route.query.type !== "edit" && curRole == 0) {
-            //             localStorage.setItem("selectedFarmId", res.data.id);
-            //             localStorage.setItem("selectedFarmName", res.data.name);
-            //         }
-
-            //         // 根据来源页面决定跳转目标
-            //         const fromPage = route.query.from;
-            //         if (fromPage && fromPage !== "details") {
-            //             // 如果是从monitor页面来的
-            //             router.replace(`/${fromPage}`);
-            //         } else if (fromPage === "details") {
-            //             router.go(-1);
-            //         } else {
-            //             if (route.query.miniJson) {
-            //                 const json = JSON.parse(route.query.miniJson);
-            //                 //上传图片
-            //                 VE_API.ali
-            //                     .uploadImg({
-            //                         farmId: res.data.id,
-            //                         images: json.images,
-            //                         uploadDate: formatDate(new Date()),
-            //                     })
-            //                     .then(({ code, msg }) => {
-            //                         if (code === 0) {
-            //                             showSuccessPopup.value = true;
-            //                         } else {
-            //                             ElMessage.error(msg);
-            //                         }
-            //                     });
-            //             } else {
-            //                 router.replace(`/growth_report`);
-            //             }
-            //         }
-            //     } else {
-            //         ElMessage.error(res.msg);
-            //     }
-            // });
-        }
-    });
-};
-
-const resetForm = (formEl) => {
-    if (!formEl) return;
-    formEl.resetFields();
-    // 清除地块数据
-    store.commit("home/SET_FARM_POLYGON", null);
-    polygonArr.value = null;
-    isFromEditMap.value = false;
-    hasDefaultPolygon.value = false; // 重置默认地块状态
-
-    // 根据来源页面决定返回目标
-    const fromPage = route.query.from;
-    if (fromPage && fromPage !== "details") {
-        router.replace(`/${fromPage}`);
-        return;
-    }
-    router.go(-1);
-};
-
-const centerPoint = ref(null);
-
-function toSubPage() {
-    // 如果还没有默认地块,先创建默认地块
-    if (!hasDefaultPolygon.value) {
-        if (centerPoint.value) {
-            const arr = convertPointToArray(centerPoint.value);
-            const squareData = generateSquarePolygonBySideLength(arr, 200); // 200米边长
-            const geometryData = {
-                geometryArr: [squareData.wkt],
-                mianji: squareData.area,
-            };
-
-            // 绘制默认地块
-            indexMap.setAreaGeometry(geometryData.geometryArr);
-
-            // 保存地块数据
-            polygonArr.value = geometryData.geometryArr;
-
-            // 标记已创建默认地块
-            hasDefaultPolygon.value = true;
-
-            // 不跳转,停留在当前页面
-            return;
-        }
-    }
-
-    // 如果已有默认地块,则跳转到编辑页面
-    // 保存到store中以便在编辑页面回显
-    if (polygonArr.value) {
-        const polygonData = {
-            geometryArr: polygonArr.value,
-            mianji: ruleForm.mu || "", // 保存用户输入的面积,如果没有输入则为空
-            isConfirmed: false, // 标记:还未从编辑页面确认返回
-        };
-        store.commit("home/SET_FARM_POLYGON", polygonData);
-    }
-
-    router.push(
-        `/edit_map?mapCenter=${centerPoint.value}&pointName=${ruleForm.address}&pointAddress=${pointAddress.value}&from=${route.query.from}&type=${route.query.type}`
-    );
-}
-
-const pointAddress = ref(null);
-const farmCity = ref(null);
-function getLocationName(location) {
-    const params = {
-        key: MAP_KEY,
-        location,
-    };
-    VE_API.old_mini_map.location(params).then(({ result }) => {
-        // locationVal.value = result.formatted_addresses.recommend;
-        const add = result.formatted_addresses?.recommend ? result.formatted_addresses.recommend : result.address + "";
-        ruleForm.address = add;
-        pointAddress.value = result.address;
-        farmCity.value = result.address_component?.city + (result.address_component?.district || "");
-        // 地址修改后,如果满足条件则自动更新农场名称
-        updateFarmNameIfNeeded();
-    });
-}
-
-watch(
-    () => mapLocation.data,
-    (newValue, oldValue) => {
-        if (newValue) {
-            let { latitude, longitude } = transformFromWGSToGCJ(newValue[1], newValue[0]);
-            centerPoint.value = `POINT (${newValue[0]} ${newValue[1]})`;
-            getLocationName(`${latitude},${longitude}`);
-        }
-    }
-);
-
-const specieList = ref([]);
-function getSpecieList() {
-    return VE_API.farm.fetchSpecieList({ point: centerPoint.value }).then(({ data }) => {
-        const list = Array.isArray(data) ? data : [];
-        // 只保留名称包含“水稻”或“荔枝”的品类
-        const litchiList = list.filter(
-            (item) => item?.name && (item.name.includes("水稻") || item.name.includes("荔枝")|| item.name.includes("大豆")|| item.name.includes("茶叶"))
-        );
-        specieList.value = litchiList;
-        // 返回空列表时,重置已选品类,避免保留上一次默认项
-        if (litchiList.length === 0) {
-            ruleForm.speciesItem = [];
-            return litchiList;
-        }
-        // //列表有值时,默认选中第一项
-        // if (litchiList.length > 0) {
-        //     const first = { value: litchiList[0].id, ...litchiList[0] };
-        //     ruleForm.speciesItem = [first];
-        //     // 同步触发品类变更逻辑(加载品种、自动生成农场名等)
-        //     changeSpecie(first);
-        // }
-        return litchiList;
-    });
-}
-
-const baseTypeList = ref([]);
-function getBaseTypeList() {
-    return VE_API.farm.fetchBaseTypeList().then(({ data }) => {
-        baseTypeList.value = data || [];
-        return data;
-    });
-}
-
-async function changeSpecie(v) {
-    const current = Array.isArray(v) ? v[v.length - 1] : v;
-    // 选择后立即更新该字段的校验状态,避免错误提示残留
-    nextTick(() => {
-        if (!ruleFormRef.value) return;
-        if (Array.isArray(ruleForm.speciesItem) && ruleForm.speciesItem.length > 0) {
-            ruleFormRef.value.clearValidate(["speciesItem"]);
-            return;
-        }
-        ruleFormRef.value.validateField("speciesItem");
-    });
-    // 只有在创建模式下且用户没有手动修改过农场名称时,才自动设置农场名称
-    if (route.query.type !== "edit" && !isFarmNameManuallyModified.value && farmCity.value && current) {
-        ruleForm.name = farmCity.value + current.name + "农场";
-    }
-}
-
-/**
- * 格式化日期为 YYYY-MM-DD 格式
- * @param {Date} date - 日期对象
- * @returns {string} 格式化后的日期字符串
- */
-function formatDate(date) {
-    const year = date.getFullYear();
-    const month = String(date.getMonth() + 1).padStart(2, "0");
-    const day = String(date.getDate()).padStart(2, "0");
-    return `${year}-${month}-${day}`;
-}
-
-function backgToHome() {
-    ruleFormRef.value?.resetFields();
-
-    // 根据来源页面决定返回目标
-    const fromPage = route.query?.from;
-    if (route.query.miniJson) {
-        const json = JSON.parse(route.query.miniJson);
-        if (json.isMini) {
-            const dropdownGardenItem = ref({
-                organId: json.farmId,
-                periodId: json.periodId,
-                name: json.name,
-                page: "create_farm",
-                showFarmSelect: true,
-                images: json.images,
-            });
-            wx.miniProgram.reLaunch({
-                url: `/pages/subPages/new_recognize/index?gardenData=${JSON.stringify(dropdownGardenItem.value)}`,
-            });
-        }
-
-        json?.from && router.replace(`/${json.from}`);
-        // const paramsPage = JSON.parse(json.paramsPage);
-        // if (paramsPage.isFarmer) {
-        //     router.replace('/home');
-        //     return;
-        // }
-    } else {
-        if (fromPage && fromPage !== "details") {
-            if (route.query?.type === "farmer") {
-                router.go(-1);
-            } else {
-                router.replace(`/${fromPage}`);
-            }
-            return;
-        } else {
-            router.go(-1);
-        }
-    }
-}
-
-// 处理面积按键输入 - 只允许数字和小数点
-function handleMianjiKeypress(event) {
-    // 如果是从编辑地图返回的,不允许手动修改
-    if (isFromEditMap.value) {
-        event.preventDefault();
-        return;
-    }
-
-    const charCode = event.which ? event.which : event.keyCode;
-    const char = String.fromCharCode(charCode);
-
-    // 允许数字 (0-9) 和小数点 (.)
-    if (!/^[0-9.]$/.test(char)) {
-        event.preventDefault();
-        return;
-    }
-
-    // 如果已经有小数点,不允许再输入小数点
-    const currentValue = ruleForm.mu || "";
-    if (char === "." && currentValue.includes(".")) {
-        event.preventDefault();
-        return;
-    }
-
-    // 不允许以小数点开头
-    if (char === "." && !currentValue) {
-        event.preventDefault();
-        return;
-    }
-}
-
-// 处理农场名称输入
-function handleFarmNameInput() {
-    // 标记用户已手动修改过农场名称
-    isFarmNameManuallyModified.value = true;
-}
-
-// 根据地址更新农场名称(如果满足条件)
-function updateFarmNameIfNeeded() {
-    // 只有在创建模式下且用户没有手动修改过农场名称且已选择品类时,才自动更新农场名称
-    const mainSpecies = Array.isArray(ruleForm.speciesItem)
-        ? ruleForm.speciesItem[0]
-        : ruleForm.speciesItem;
-    if (route.query.type !== "edit" && !isFarmNameManuallyModified.value && mainSpecies && farmCity.value) {
-        ruleForm.name = farmCity.value + mainSpecies.name + "农场";
-    }
-}
-
-// 回填编辑数据
-function populateEditData() {
-    const editData = store.state.home.editFarmData;
-    if (!editData) {
-        return;
-    }
-
-    // 回填基本信息
-    ruleForm.name = editData.name || "";
-    ruleForm.fzr = editData.fzr || "";
-    ruleForm.tel = editData.tel || "";
-    ruleForm.baseType = editData.baseType || null;
-    ruleForm.defaultFarm = editData.defaultOption || 0;
-    ruleForm.mu = editData.mianji || "";
-    ruleForm.address = editData.address || "";
-
-    // 设置地图中心点
-    if (editData.pointWkt) {
-        centerPoint.value = editData.pointWkt;
-        const arr = convertPointToArray(editData.pointWkt);
-        indexMap.setMapPosition(arr);
-    }
-
-    // 处理地块数据
-    if (editData.geomWkt) {
-        polygonArr.value = [editData.geomWkt];
-        indexMap.setAreaGeometry([editData.geomWkt]);
-        hasDefaultPolygon.value = true;
-        isFromEditMap.value = true; // 编辑模式下锁定面积输入
-    }
-
-    // 处理作物数据(兼容多选)
-    if (Array.isArray(editData.regionList) && editData.regionList.length > 0) {
-        const selected = [];
-        const speciesIdSet = new Set();
-        editData.regionList.forEach((region) => {
-            const targetId = region.speciesId;
-            if (targetId == null) return;
-            // 去重:同一个 speciesId 只保留一条
-            const speciesKey = String(targetId);
-            if (speciesIdSet.has(speciesKey)) return;
-            const match = specieList.value.find((s) => String(s.id) === String(targetId));
-            if (match) {
-                speciesIdSet.add(speciesKey);
-                selected.push({
-                    value: match.id,
-                    ...match,
-                });
-            }
-        });
-        if (selected.length > 0) {
-            ruleForm.speciesItem = selected;
-        }
-    } else if (editData.speciesId && editData.speciesName) {
-        // 兼容旧数据:只有单个品类字段时,按原逻辑回显一个
-        const species = {
-            value: editData.speciesId,
-            id: editData.speciesId,
-            name: editData.speciesName,
-            defaultContainerId: editData.containerId,
-        };
-        ruleForm.speciesItem = [species];
-    }
-
-    // 设置地址信息
-    if (editData.district) {
-        try {
-            const districtInfo = JSON.parse(editData.district);
-            pointAddress.value = districtInfo.province + districtInfo.city + (districtInfo?.district || '');
-        } catch (e) {
-            console.warn("解析地址信息失败:", e);
-        }
-    }
-}
-
-// 处理面积输入
-let mianjiInputTimer = null;
-function handleMianjiInput(value) {
-    // 如果是从编辑地图返回的,不允许手动修改
-    if (isFromEditMap.value) {
-        return;
-    }
-
-    // 过滤非法字符,只保留数字和小数点
-    let filteredValue = value.replace(/[^\d.]/g, "");
-
-    // 确保只有一个小数点
-    const parts = filteredValue.split(".");
-    if (parts.length > 2) {
-        filteredValue = parts[0] + "." + parts.slice(1).join("");
-    }
-
-    // 限制小数点后最多2位
-    if (parts.length === 2 && parts[1].length > 2) {
-        filteredValue = parts[0] + "." + parts[1].substring(0, 2);
-    }
-
-    // 更新输入框的值(如果被过滤了)
-    if (filteredValue !== value) {
-        ruleForm.mu = filteredValue;
-        return;
-    }
-
-    // 清除之前的定时器
-    if (mianjiInputTimer) {
-        clearTimeout(mianjiInputTimer);
-    }
-
-    // 防抖处理,用户停止输入500ms后再更新地块
-    mianjiInputTimer = setTimeout(() => {
-        const mu = parseFloat(filteredValue);
-
-        // 验证输入的有效性
-        if (!mu || isNaN(mu) || mu <= 0) {
-            return;
-        }
-
-        // 根据亩数重新生成地块
-        if (centerPoint.value) {
-            const arr = convertPointToArray(centerPoint.value);
-            const squareData = generateSquarePolygonByMu(arr, mu);
-
-            const geometryData = {
-                geometryArr: [squareData.wkt],
-                mianji: squareData.area,
-            };
-
-            // 清除旧地块
-            indexMap.clearLayer();
-            // 绘制新地块
-            indexMap.setAreaGeometry(geometryData.geometryArr);
-
-            // 更新状态
-            polygonArr.value = geometryData.geometryArr;
-            // 标记已创建默认地块
-            hasDefaultPolygon.value = true;
-        }
-    }, 500);
-}
-</script>
-
-<style lang="scss" scoped>
-::v-deep {
-    .el-form-item--default {
-        margin-bottom: 20px;
-    }
-}
-
-.create-farm {
-    position: relative;
-    width: 100%;
-    height: 100vh;
-    overflow: hidden;
-
-    .map-container {
-        width: 100%;
-        height: calc(100% - 320px);
-    }
-
-    .checkbox {
-        padding: 0 12px 6px;
-        font-size: 15px;
-    }
-
-    .farm-content {
-        position: absolute;
-        top: 40px;
-        left: 0;
-        width: 100%;
-        height: calc(100% - 40px);
-        pointer-events: none;
-        z-index: 2;
-
-        .top-mask {
-            height: 100px;
-            position: absolute;
-            z-index: 2;
-            top: 0;
-            left: 0;
-            width: 100%;
-            background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
-        }
-    }
-
-    .farm-filter {
-        pointer-events: all;
-        margin: 12px;
-        position: relative;
-        z-index: 10;
-        background: rgba(0, 0, 0, 0.3);
-        border-radius: 20px;
-        border: 1px solid rgba(255, 255, 255, 0.4);
-
-        &::before {
-            content: "";
-            position: absolute;
-            left: 12px;
-            top: 9px;
-            width: 14px;
-            height: 14px;
-            background: url("@/assets/img/home/search.png") no-repeat center center / 100% 100%;
-        }
-
-        ::v-deep {
-            .el-select__wrapper {
-                background: none;
-                box-shadow: none;
-                padding-left: 34px;
-                font-size: 12px;
-
-                .el-select__selected-item,
-                .el-select__placeholder,
-                .el-select__input {
-                    color: rgba(255, 255, 255, 0.6);
-
-                    &.is-transparent {
-                        color: #ccc;
-                        font-size: 12px;
-                    }
-                }
-            }
-
-            .el-select {
-                transition: all 0.3s;
-
-                .el-input.is-focus .el-input__wrapper {
-                    box-shadow: none !important;
-                }
-            }
-
-            .el-input {
-                .el-input__wrapper {
-                    background: none;
-                    box-shadow: none;
-                    padding-left: 18px;
-                    font-size: 11px;
-
-                    .el-input__inner {
-                        color: rgba(255, 255, 255, 0.6);
-                    }
-
-                    &.is-focus {
-                        .el-input__inner {
-                            color: #ccc;
-                            font-size: 11px;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    .create-wrap {
-        position: absolute;
-        bottom: 0px;
-        left: 0;
-        width: 100%;
-        background: linear-gradient(180deg, transparent 0%, #f5f7fb 20%);
-    }
-
-    .create-box {
-        pointer-events: all;
-        margin: 0 12px 10px 12px;
-        width: calc(100% - 24px);
-        background: #e0f1fe;
-        border-radius: 14px;
-
-        .box-content {
-            position: relative;
-
-            &::after {
-                position: absolute;
-                right: 10px;
-                top: 2px;
-                content: "";
-                width: 79px;
-                height: 72px;
-                background: url("@/assets/img/home/creat-bg.png") no-repeat center / 100% 100%;
-            }
-        }
-
-        .create-title {
-            display: flex;
-            align-items: center;
-            padding: 12px 6px 12px 12px;
-            color: #0089f5;
-            font-size: 18px;
-            font-weight: bold;
-
-            .title-icon {
-                width: 18px;
-                padding-right: 10px;
-            }
-        }
-
-        .create-content {
-            background: #fff;
-            border-radius: 14px;
-            padding: 12px;
-            position: relative;
-            z-index: 2;
-
-            .create-from {
-
-                .select-wrap {
-                    display: flex;
-
-                    // &.specie-wrap {
-                    //     flex: 1;
-                    //     gap: 12px;
-
-                    //     .specie-select {
-                    //         min-width: 56px;
-                    //         width: 56px;
-                    //     }
-                    // }
-
-                    width: 100%;
-                    ::v-deep {
-                        .el-input__wrapper {
-                            background: none;
-                            box-shadow: none;
-                        }
-
-                        .el-input__inner {
-                            font-size: 14px;
-                            color: rgba(0, 0, 0, 0.5);
-                        }
-
-                        .el-select__wrapper {
-                            background: none;
-                            box-shadow: none;
-                            gap: 2px;
-                            padding: 4px 2px;
-                            justify-content: center;
-                        }
-
-                        // .el-select__selection {
-                        //     flex: none;
-                        //     width: min-content;
-                        // }
-
-                        .el-select__placeholder {
-                            color: #000;
-                            position: static;
-                            transform: none;
-                            width: fit-content;
-                        }
-                    }
-
-                    &.client-wrap {
-                        ::v-deep {
-                            .el-select__wrapper {
-                                justify-content: flex-start;
-                            }
-                        }
-                    }
-
-                    // .select-item {
-                    //     min-width: 80px;
-                    //     margin-left: 10px;
-                    // }
-                }
-
-                ::v-deep {
-                    .el-form-item__label {
-                        color: #000;
-                    }
-
-                    .el-form-item__error {
-                        top: 117%;
-                    }
-
-                    .el-form-item {
-                        position: relative;
-
-                        &::after {
-                            content: "";
-                            position: absolute;
-                            left: 60px;
-                            bottom: -5px;
-                            width: calc(100% - 60px);
-                            height: 1px;
-                            background: rgba(0, 0, 0, 0.08);
-                        }
-                    }
-
-                    .el-input__wrapper {
-                        box-shadow: none;
-                        padding: 1px 6px;
-                    }
-                }
-
-                .area-box {
-                    display: flex;
-                    align-items: center;
-                    width: 100%;
-
-                    .unit {
-                        padding-right: 10px;
-                    }
-                }
-
-                .position-wrap {
-                    width: 100%;
-                    display: flex;
-                    justify-content: space-between;
-                    align-items: center;
-
-                    .draw-btn {
-                        flex: none;
-                        padding: 0 12px;
-                        height: 30px;
-                        line-height: 30px;
-                        box-sizing: border-box;
-                        color: #2199f8;
-                        border: 1px solid #2199f8;
-                        background: rgba(33, 153, 248, 0.1);
-                        border-radius: 20px;
-                        font-size: 12px;
-                    }
-                }
-            }
-
-            .create-btn {
-                display: flex;
-                align-items: center;
-                width: 100%;
-                padding-top: 10px;
-
-                .btn-item {
-                    flex: 1;
-                    text-align: center;
-                    padding: 0 11px;
-                    height: 40px;
-                    line-height: 40px;
-                    border-radius: 34px;
-                    font-size: 16px;
-                    box-sizing: border-box;
-
-                    &.sencond-btn {
-                        border: 1px solid rgba(153, 153, 153, 0.5);
-                        color: #666666;
-                    }
-
-                    &.primary-btn {
-                        background: linear-gradient(180deg, #76c3ff, #2199f8);
-                        color: #fff;
-                    }
-                }
-
-                .btn-item+.btn-item {
-                    margin-left: 5px;
-                }
-            }
-        }
-    }
-}
-</style>
-
-<style lang="scss">
-.location-search-popper {
-    .el-select-dropdown__list {
-        max-width: 96vw;
-        overflow-x: auto;
-    }
-
-    .sub-title {
-        padding-left: 6px;
-        font-size: 12px;
-        color: #ccc;
-    }
-}
-</style>

+ 0 - 1043
src/views/old_mini/create_farm/index.vue

@@ -1,1043 +0,0 @@
-<template>
-    <div class="create-farm">
-        <custom-header :name="paramsType === 'client' ? '新增用户' : paramsType === 'edit' ? '编辑农场' : '创建农场'"
-            :isGoBack="true" @goback="backgToHome"></custom-header>
-        <!-- 地图 -->
-        <div class="map-container" ref="mapContainer"></div>
-        <div class="farm-content">
-            <div class="top-mask"></div>
-            <div class="farm-filter">
-                <el-select v-model="locationVal" filterable remote reserve-keyword :placeholder="t('搜索位置')"
-                    :remote-method="remoteMethod" :loading="loading" @change="handleSearchRes"
-                    popper-class="location-search-popper">
-                    <el-option v-for="(item, index) in locationOptions.list" :key="index" :label="item.title"
-                        :value="{ value: item.point, item }">
-                        <span>{{ item.title }}</span>
-                        <span class="sub-title">{{ item.province }}{{ item.city }}{{ item.district || '' }}</span>
-                    </el-option>
-                </el-select>
-            </div>
-
-            <!-- 创建 -->
-            <div class="create-wrap">
-                <div class="create-box">
-                    <div class="box-content">
-                        <div class="create-title">
-                            <img class="title-icon" src="@/assets/img/home/create-icon.png" alt="" />
-                            {{ paramsType === "client" ? "新增用户" : paramsType === "edit" ? "编辑农场" : "创建农场" }}
-                        </div>
-                        <div class="create-content">
-                            <div class="create-from">
-                                <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" class="demo-ruleForm">
-                                    <el-form-item :label="t('农场位置')" prop="farm_address">
-                                        <div class="position-wrap">
-                                            <el-input :placeholder="t('农场位置')" readonly v-model="ruleForm.farm_address"
-                                                autocomplete="off" />
-                                        </div>
-                                    </el-form-item>
-                                    <el-form-item :label="t('种植作物')" required>
-                                        <div class="select-wrap">
-                                            <div class="species-entry" @click="handleGoSelectCrop">
-                                                <span class="species-entry__text">{{ selectedCropSummaryText || "点击选择作物" }}</span>
-                                            </div>
-                                        </div>
-                                    </el-form-item>
-                                    <el-form-item :label="t('农场面积')" prop="farm_area">
-                                        <div class="area-box">
-                                            <el-input :placeholder="isFromEditMap ? '勾选地块获得农场面积' : '请输入农场的真实面积'
-                                                " v-model="ruleForm.farm_area" :readonly="isFromEditMap" type="text"
-                                                autocomplete="off" style="width: fit-content" @input="handleMianjiInput"
-                                                @keypress="handleMianjiKeypress" />
-                                            <div class="unit">{{ t('亩') }}</div>
-                                        </div>
-                                    </el-form-item>
-                                    <el-form-item :label="t('农场名称')" prop="farm_name">
-                                        <el-input :placeholder="t('请输入您的农场名称')" v-model="ruleForm.farm_name"
-                                            autocomplete="off" @input="handleFarmNameInput" />
-                                    </el-form-item>
-                                </el-form>
-                            </div>
-                            <div class="create-btn">
-                                <div class="btn-item sencond-btn" @click="resetForm(ruleFormRef)">{{ t('取消') }}</div>
-                                <div
-                                    class="btn-item primary-btn"
-                                    :class="{ 'is-disabled': isSubmitting }"
-                                    @click="submitForm(ruleFormRef)"
-                                >
-                                    {{
-                                        isSubmitting
-                                            ? t('提交中...')
-                                            : paramsType === "client"
-                                                ? "添加"
-                                                : paramsType === "edit"
-                                                    ? "确认修改"
-                                                    : "立即创建"
-                                    }}
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- 四大种植报告生成成功 -->
-        <Popup v-model:show="showPlantingReportPopup" round class="planting-report-popup"
-            :close-on-click-overlay="false">
-            <div class="planting-report-popup__inner">
-                <img class="icon" src="@/assets/img/home/right.png" alt="" />
-                <div class="title">{{ t('您的四大种植报告') }}<br />{{ t('已全部生成') }}</div>
-                <div class="links">
-                    <span class="link">{{ t('(作物长势报告)') }}</span>
-                    <span class="link">{{ t('(土壤改良报告)') }}</span>
-                    <span class="link">{{ t('(种植建议报告)') }}</span>
-                </div>
-                <div class="btn" @click="handlePlantingReportView">{{ t('点击查看') }}</div>
-            </div>
-        </Popup>
-    </div>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import customHeader from "@/components/customHeader.vue";
-import IndexMap from "./map/index.js";
-import { useRoute, useRouter } from "vue-router";
-import { mapLocation } from "./map/index.js";
-import { onMounted, ref, reactive, watch, onActivated, nextTick, onDeactivated } from "vue";
-import { useStore } from "vuex";
-import { convertPointToArray } from "@/utils/index";
-import wx from "weixin-js-sdk";
-import { Popup } from "vant";
-import { ElMessage } from "element-plus";
-import { transformFromGCJToWGS, transformFromWGSToGCJ } from "@/utils/WSCoordinate.js";
-import { selectNewlyCreatedFarm } from "@/utils/selectedFarm";
-
-/** 与 selectCrop.vue 写入的 sessionStorage 键一致 */
-const SESSION_SELECT_CROP_KEY = "selectedCrop";
-
-/** @returns {Array<object>|null} 已选作物品类列表,未选择或数据无效时为 null */
-function parseSelectedCropItems() {
-    try {
-        const raw = sessionStorage.getItem(SESSION_SELECT_CROP_KEY);
-        if (!raw || raw === "null") return null;
-        const data = JSON.parse(raw);
-        if (!Array.isArray(data) || data.length === 0) return null;
-        return data;
-    } catch {
-        return null;
-    }
-}
-
-/** 入口展示:无选中为「点击选择作物」,有则 variety_name 去重后用顿号连接 */
-const selectedCropSummaryText = ref("");
-
-function refreshSelectedCropSummary() {
-    const items = parseSelectedCropItems();
-    if (!items?.length) {
-        selectedCropSummaryText.value = "";
-        return;
-    }
-    const seen = new Set();
-    const ordered = [];
-    for (const item of items) {
-        const name = String(item.variety_name ?? "").trim();
-        if (!name || seen.has(name)) continue;
-        seen.add(name);
-        ordered.push(name);
-    }
-    selectedCropSummaryText.value = ordered.join("、");
-}
-
-const route = useRoute();
-const router = useRouter();
-const store = useStore();
-
-const indexMap = new IndexMap();
-const mapContainer = ref(null);
-
-/** 创建成功后「四大种植报告」提示弹窗 */
-const showPlantingReportPopup = ref(false);
-
-function handlePlantingReportView() {
-    showPlantingReportPopup.value = false;
-    backgToHome();
-}
-
-// 标记是否从编辑地图页面确认返回
-const isFromEditMap = ref(false);
-
-// 标记用户是否手动修改过农场名称
-const isFarmNameManuallyModified = ref(false);
-
-/** 创建/提交接口请求中,防止重复点击 */
-const isSubmitting = ref(false);
-
-/**
- * 根据中心点和亩数生成正方形地块WKT
- * @param {Array} center - 中心点坐标 [lng, lat]
- * @param {Number} mu - 面积(亩)
- * @returns {Object} 包含WKT字符串和面积(亩)的对象
- */
-function generateSquarePolygonByMu(center, mu) {
-    // 确保输入是数字类型
-    const lng = parseFloat(center[0]);
-    const lat = parseFloat(center[1]);
-
-    // 1亩 ≈ 666.67平方米
-    const areaInSquareMeters = mu * 666.67;
-    // 正方形边长(米)
-    const sideLength = Math.sqrt(areaInSquareMeters);
-    // 半边长(米)
-    const halfSide = sideLength / 2;
-
-    // 纬度方向:1度约等于111000米
-    const latDelta = halfSide / 111000;
-
-    // 经度方向:需要根据纬度调整,1度约等于111000 * cos(lat)米
-    const lngDelta = halfSide / (111000 * Math.cos((lat * Math.PI) / 180));
-
-    // 计算四个顶点(逆时针顺序)
-    const topLeft = [lng - lngDelta, lat + latDelta];
-    const topRight = [lng + lngDelta, lat + latDelta];
-    const bottomRight = [lng + lngDelta, lat - latDelta];
-    const bottomLeft = [lng - lngDelta, lat - latDelta];
-
-    // 生成MULTIPOLYGON格式的WKT(需要闭合,所以第一个点要重复)
-    const formatPoint = (point) => `${point[0]} ${point[1]}`;
-    const coordinates = [topLeft, topRight, bottomRight, bottomLeft, topLeft].map(formatPoint).join(", ");
-
-    // 注意:MULTIPOLYGON 和括号之间需要有一个空格
-    const wkt = `MULTIPOLYGON (((${coordinates})))`;
-
-    return { wkt, area: parseFloat(mu).toFixed(2) };
-}
-
-onMounted(() => {
-    // 清除上一次的地块数据,确保每次进入都是全新状态
-    store.commit("home/SET_FARM_POLYGON", null);
-    isFromEditMap.value = false; // 初始化时可以手动输入
-
-    centerPoint.value = store.state.home.miniUserLocationPoint;
-    indexMap.initMap(centerPoint.value, mapContainer.value);
-
-    // 不再初始化时绘制默认地块,等待用户点击"新增地块"按钮
-    // 清空地块和面积数据
-    polygonArr.value = null;
-    ruleForm.farm_area = "";
-
-    if (route.query.type === "edit" && store.state.home.editFarmData) {
-        populateEditData();
-    }
-    refreshSelectedCropSummary();
-});
-
-const polygonArr = ref(null);
-const paramsType = ref(null);
-
-/** 全新创建:带 isReload,且非编辑/小程序回流 */
-function isCreateFarmFullReload() {
-    return (
-        route.query.isReload &&
-        route.query.type !== "edit" &&
-        !route.query.miniJson
-    );
-}
-
-onActivated(() => {
-    paramsType.value = route.query.type;
-
-    if (isCreateFarmFullReload()) {
-        // 先清缓存与位置状态,避免沿用上次搜索的 centerPoint / 地址
-        sessionStorage.removeItem("centerPoint");
-        centerPoint.value = store.state.home.miniUserLocationPoint;
-        locationVal.value = null;
-        locationOptions.list = [];
-        pointAddress.value = null;
-        farmCity.value = null;
-        polygonArr.value = null;
-        isFromEditMap.value = false;
-        isFarmNameManuallyModified.value = false;
-        ruleForm.farm_address = "";
-        ruleForm.farm_area = "";
-        ruleForm.farm_name = "";
-        ruleFormRef.value?.resetFields();
-        store.commit("home/SET_FARM_POLYGON", null);
-        isSubmitting.value = false;
-    } else {
-        const centerPointVal = sessionStorage.getItem("centerPoint")
-            ? JSON.parse(sessionStorage.getItem("centerPoint"))
-            : null;
-        centerPoint.value = centerPointVal || store.state.home.miniUserLocationPoint;
-        const arr = convertPointToArray(centerPoint.value);
-        getLocationName(`${arr[1]},${arr[0]}`);
-    }
-    // 确保地图已初始化,使用 nextTick 等待 DOM 更新
-    nextTick(() => {
-        // 检查地图实例是否已初始化
-        if (!indexMap.kmap) {
-            // 如果地图未初始化,重新初始化
-            if (mapContainer.value) {
-                centerPoint.value = store.state.home.miniUserLocationPoint;
-                const arr = convertPointToArray(centerPoint.value);
-                indexMap.initMap(centerPoint.value, mapContainer.value);
-            }
-            // 等待地图初始化完成后再继续
-            setTimeout(() => {
-                handleMapUpdate();
-            }, 100);
-            return;
-        }
-        handleMapUpdate();
-    });
-    refreshSelectedCropSummary();
-});
-
-onDeactivated(() => {
-    sessionStorage.setItem('centerPoint', JSON.stringify(centerPoint.value));
-});
-
-// 处理地图更新的逻辑
-function handleMapUpdate() {
-    if (isCreateFarmFullReload()) {
-        // 清除旧的地块数据
-        store.commit("home/SET_FARM_POLYGON", null);
-        isFromEditMap.value = false; // 从home进入,可以手动输入
-        locationVal.value = null;
-
-        centerPoint.value = store.state.home.miniUserLocationPoint;
-        const arr = convertPointToArray(centerPoint.value);
-        getLocationName(`${arr[1]},${arr[0]}`);
-        indexMap.setMapPosition(arr);
-
-        indexMap.clearLayer();
-
-        // 不再自动生成默认地块,等待用户点击"新增地块"
-        polygonArr.value = null;
-        ruleForm.farm_area = "";
-
-        return; // 直接返回,不执行下面的逻辑
-    }
-
-    indexMap.clearLayer();
-    // 绘制勾画范围(从edit_map返回的情况)
-    const polygonData = store.state.home.polygonData;
-
-    // 优先处理从编辑地图页面返回的数据
-    if (polygonData) {
-        // 检查地块数据是否有效(数组存在且不为空)
-        const hasValidGeometry =
-            polygonData.geometryArr && Array.isArray(polygonData.geometryArr) && polygonData.geometryArr.length > 0;
-
-        if (hasValidGeometry) {
-            // 用户从edit_map返回,且有有效的地块数据
-            // 根据 isConfirmed 判断是否锁定输入框
-            if (polygonData.isConfirmed) {
-                // 用户点击了"确认"按钮,锁定输入框并显示精确面积
-                isFromEditMap.value = true;
-                ruleForm.farm_area = polygonData.mianji;
-            } else {
-                // 用户点击了"取消",不锁定输入框,面积保持原样
-                isFromEditMap.value = false;
-                // 面积输入框保持之前的值,不更新
-            }
-            // 使用 nextTick 确保地图渲染完成后再设置地块
-            nextTick(() => {
-                indexMap.setAreaGeometry(polygonData.geometryArr);
-            });
-            polygonArr.value = polygonData.geometryArr;
-        } else {
-            // 用户在编辑页面删除了所有地块
-            // 重置所有状态
-            polygonArr.value = null;
-            ruleForm.farm_area = "";
-            isFromEditMap.value = false;
-        }
-    } else if (route.query.type === "edit" && store.state.home.editFarmData) {
-        // 如果是编辑模式且没有从编辑地图返回的数据,回填原始编辑数据
-        populateEditData();
-    } else if (centerPoint.value && polygonArr.value) {
-        // 没有新的编辑数据,保持当前地块
-        // 同样需要检查数据有效性
-        if (Array.isArray(polygonArr.value) && polygonArr.value.length > 0) {
-            nextTick(() => {
-                indexMap.setAreaGeometry(polygonArr.value);
-            });
-        }
-    }
-}
-
-// 搜索
-const MAP_KEY = "CZLBZ-LJICQ-R4A5J-BN62X-YXCRJ-GNBUT";
-
-const locationVal = ref(null);
-const locationOptions = reactive({
-    list: [],
-});
-const loading = ref(false);
-const remoteMethod = async (keyword) => {
-    if (keyword) {
-        locationOptions.list = [];
-        loading.value = true;
-        const params = {
-            key: MAP_KEY,
-            keyword,
-            location: route.query.userLocation || "113.61702297075017,23.584863449735067",
-        };
-        await VE_API.old_mini_map.getCtiyList({ word: keyword }).then(({ data }) => {
-            if (data && data.length) {
-                data.forEach((item) => {
-                    item.point = item.location.lat + "," + item.location.lng;
-                    locationOptions.list.push(item);
-                });
-            }
-        });
-        VE_API.old_mini_map.search(params).then(({ data }) => {
-            loading.value = false;
-            data.forEach((item) => {
-                item.point = item.location.lat + "," + item.location.lng;
-                locationOptions.list.push(item);
-            });
-        });
-    } else {
-        locationOptions.list = [];
-    }
-};
-
-const handleSearchRes = (v) => {
-    const parts = v.value.split(",");
-    let { latitude, longitude } = transformFromGCJToWGS(parseFloat(parts[0]), parseFloat(parts[1]));
-    const coordinateArray = [longitude, latitude];
-    indexMap.setMapPosition(coordinateArray);
-    centerPoint.value = `POINT (${coordinateArray[0]} ${coordinateArray[1]})`;
-    ruleForm.farm_address = v.item?.title || v.item?.address;
-    pointAddress.value = v.item?.province + v.item?.city + (v.item?.district || '');
-    // 更新farmCity以便后续更新农场名称
-    farmCity.value = v.item?.city + (v.item?.district || "");
-    // 地址修改后,如果满足条件则自动更新农场名称
-    updateFarmNameIfNeeded();
-};
-
-// 表单
-const ruleFormRef = ref(null);
-const ruleForm = reactive({
-    farm_address: "",
-    farm_area: "",
-    farm_name: "",
-});
-// 自定义验证规则:验证面积必须是大于0的数字
-const validateMianji = (rule, value, callback) => {
-    if (!value) {
-        callback(new Error("请输入农场面积"));
-    } else {
-        const num = parseFloat(value);
-        if (isNaN(num)) {
-            callback(new Error("面积必须是数字"));
-        } else if (num <= 0) {
-            callback(new Error("面积必须大于0"));
-        } else {
-            callback();
-        }
-    }
-};
-
-const rules = reactive({
-    farm_address: [{ required: true, message: "请选择农场位置", trigger: "blur" }],
-    farm_area: [
-        { required: true, message: "请输入农场面积", trigger: "blur" },
-        { validator: validateMianji, trigger: ["blur", "change"] },
-    ],
-    farm_name: [{ required: true, message: "请输入您的农场名称", trigger: ["blur", "change"] }],
-});
-
-const submitForm = (formEl) => {
-    if (!formEl || isSubmitting.value) return;
-    formEl.validate((valid) => {
-        if (!valid) return;
-        const cropItems = parseSelectedCropItems();
-        if (!cropItems) {
-            ElMessage.warning({ message: t('请先点击「种植作物」选择作物品类'), type: 'warning' });
-            return;
-        }
-        const params = {
-            ...ruleForm,
-            farm_location: centerPoint.value,
-            varieties: cropItems.map(
-                (item) => `${item.variety_code}-${item.categorycode}`,
-            ),
-            farm_polygon:
-                polygonArr.value && polygonArr.value.length > 0
-                    ? polygonArr.value[0]
-                    : null,
-        };
-
-        if (route.query.type === "edit" && route.query.farmId) {
-            params.id = route.query.farmId;
-        }
-
-        if (route.query.type !== "edit") {
-            const queryParams = { ...params };
-            if (Array.isArray(queryParams.geom)) {
-                queryParams.geom = JSON.stringify(queryParams.geom);
-            }
-
-            isSubmitting.value = true;
-            VE_API.farm.createFarm(queryParams)
-                .then(async (res) => {
-                    if (res?.code === 200) {
-                        // 创建成功后拉列表,选中最后一项(新建农场)
-                        await selectNewlyCreatedFarm();
-                        showPlantingReportPopup.value = true;
-                        sessionStorage.removeItem(SESSION_SELECT_CROP_KEY);
-                    }
-                })
-                .finally(() => {
-                    isSubmitting.value = false;
-                });
-        }
-    });
-};
-
-const resetForm = (formEl) => {
-    if (!formEl) return;
-    formEl.resetFields();
-    // 清除地块数据
-    store.commit("home/SET_FARM_POLYGON", null);
-    polygonArr.value = null;
-    isFromEditMap.value = false;
-
-    // 根据来源页面决定返回目标
-    if (route.query.from && route.query.from !== "details") {
-        router.replace(`/${route.query.from}`);
-        return;
-    }
-    router.go(-1);
-};
-
-const centerPoint = ref(null);
-
-function handleGoSelectCrop() {
-    router.push(`/select_crop`);
-}
-
-const pointAddress = ref(null);
-const farmCity = ref(null);
-function getLocationName(location) {
-    const params = {
-        key: MAP_KEY,
-        location,
-    };
-    VE_API.old_mini_map.location(params).then(({ result }) => {
-        const add = result.formatted_addresses?.recommend ? result.formatted_addresses.recommend : result.address + "";
-        ruleForm.farm_address = add;
-        pointAddress.value = result.address;
-        farmCity.value = result.address_component?.city + (result.address_component?.district || "");
-        // 地址修改后,如果满足条件则自动更新农场名称
-        updateFarmNameIfNeeded();
-    });
-}
-
-watch(() => mapLocation.data, (newValue) => {
-    if (newValue) {
-        let { latitude, longitude } = transformFromWGSToGCJ(newValue[1], newValue[0]);
-        centerPoint.value = `POINT (${newValue[0]} ${newValue[1]})`;
-        getLocationName(`${latitude},${longitude}`);
-    }
-});
-
-function backgToHome() {
-    ruleFormRef.value?.resetFields();
-    sessionStorage.removeItem(SESSION_SELECT_CROP_KEY);
-
-    // 根据来源页面决定返回目标
-    const fromPage = route.query?.from;
-    if (route.query.miniJson) {
-        const json = JSON.parse(route.query.miniJson);
-        if (json.isMini) {
-            const dropdownGardenItem = ref({
-                organId: json.farmId,
-                periodId: json.periodId,
-                name: json.name,
-                page: "create_farm",
-                showFarmSelect: true,
-                images: json.images,
-            });
-            wx.miniProgram.reLaunch({
-                url: `/pages/subPages/new_recognize/index?gardenData=${JSON.stringify(dropdownGardenItem.value)}`,
-            });
-        }
-
-        json?.from && router.replace(`/${json.from}`);
-    } else {
-        if (fromPage && fromPage !== "details") {
-            if (route.query?.type === "farmer") {
-                router.go(-1);
-            } else {
-                router.replace(`/${fromPage}`);
-            }
-            return;
-        } else {
-            router.go(-1);
-        }
-    }
-}
-
-// 处理面积按键输入 - 只允许数字和小数点
-function handleMianjiKeypress(event) {
-    // 如果是从编辑地图返回的,不允许手动修改
-    if (isFromEditMap.value) {
-        event.preventDefault();
-        return;
-    }
-
-    const charCode = event.which ? event.which : event.keyCode;
-    const char = String.fromCharCode(charCode);
-
-    // 允许数字 (0-9) 和小数点 (.)
-    if (!/^[0-9.]$/.test(char)) {
-        event.preventDefault();
-        return;
-    }
-
-    // 如果已经有小数点,不允许再输入小数点
-    const currentValue = ruleForm.farm_area || "";
-    if (char === "." && currentValue.includes(".")) {
-        event.preventDefault();
-        return;
-    }
-
-    // 不允许以小数点开头
-    if (char === "." && !currentValue) {
-        event.preventDefault();
-        return;
-    }
-}
-
-// 处理农场名称输入
-function handleFarmNameInput() {
-    // 标记用户已手动修改过农场名称
-    isFarmNameManuallyModified.value = true;
-}
-
-// 根据地址更新农场名称(如果满足条件)
-function updateFarmNameIfNeeded() {
-    // 创建模式且未手动改过名称时,地址变化后同步更新(含已有自动名称的场景)
-    if (route.query.type !== "edit" && !isFarmNameManuallyModified.value && farmCity.value) {
-        ruleForm.farm_name = farmCity.value + "农场";
-    }
-}
-
-// 回填编辑数据
-function populateEditData() {
-    const editData = store.state.home.editFarmData;
-    if (!editData) {
-        return;
-    }
-
-    // 回填基本信息
-    ruleForm.farm_name = editData.name || "";
-    ruleForm.farm_area = editData.mianji || "";
-    ruleForm.farm_address = editData.address || "";
-
-    // 设置地图中心点
-    if (editData.pointWkt) {
-        centerPoint.value = editData.pointWkt;
-        const arr = convertPointToArray(editData.pointWkt);
-        indexMap.setMapPosition(arr);
-    }
-
-    // 处理地块数据
-    if (editData.geomWkt) {
-        polygonArr.value = [editData.geomWkt];
-        indexMap.setAreaGeometry([editData.geomWkt]);
-        isFromEditMap.value = true; // 编辑模式下锁定面积输入
-    }
-
-    // 设置地址信息
-    if (editData.district) {
-        try {
-            const districtInfo = JSON.parse(editData.district);
-            pointAddress.value = districtInfo.province + districtInfo.city + (districtInfo?.district || '');
-        } catch (e) {
-            console.warn("解析地址信息失败:", e);
-        }
-    }
-}
-
-// 处理面积输入
-let mianjiInputTimer = null;
-function handleMianjiInput(value) {
-    // 如果是从编辑地图返回的,不允许手动修改
-    if (isFromEditMap.value) {
-        return;
-    }
-
-    // 过滤非法字符,只保留数字和小数点
-    let filteredValue = value.replace(/[^\d.]/g, "");
-
-    // 确保只有一个小数点
-    const parts = filteredValue.split(".");
-    if (parts.length > 2) {
-        filteredValue = parts[0] + "." + parts.slice(1).join("");
-    }
-
-    // 限制小数点后最多2位
-    if (parts.length === 2 && parts[1].length > 2) {
-        filteredValue = parts[0] + "." + parts[1].substring(0, 2);
-    }
-
-    // 更新输入框的值(如果被过滤了)
-    if (filteredValue !== value) {
-        ruleForm.farm_area = filteredValue;
-        return;
-    }
-
-    // 清除之前的定时器
-    if (mianjiInputTimer) {
-        clearTimeout(mianjiInputTimer);
-    }
-
-    // 防抖处理,用户停止输入500ms后再更新地块
-    mianjiInputTimer = setTimeout(() => {
-        const mu = parseFloat(filteredValue);
-
-        // 验证输入的有效性
-        if (!mu || isNaN(mu) || mu <= 0) {
-            return;
-        }
-
-        // 根据亩数重新生成地块
-        if (centerPoint.value) {
-            const arr = convertPointToArray(centerPoint.value);
-            const squareData = generateSquarePolygonByMu(arr, mu);
-
-            const geometryData = {
-                geometryArr: [squareData.wkt],
-                mianji: squareData.area,
-            };
-
-            // 清除旧地块
-            indexMap.clearLayer();
-            // 绘制新地块
-            indexMap.setAreaGeometry(geometryData.geometryArr);
-
-            // 更新状态
-            polygonArr.value = geometryData.geometryArr;
-        }
-    }, 500);
-}
-</script>
-
-<style lang="scss" scoped>
-::v-deep {
-    .el-form-item--default {
-        margin-bottom: 20px;
-    }
-}
-
-.create-farm {
-    position: relative;
-    width: 100%;
-    height: 100vh;
-    overflow: hidden;
-
-    .map-container {
-        width: 100%;
-        height: calc(100% - 320px);
-    }
-
-    .farm-content {
-        position: absolute;
-        top: 40px;
-        left: 0;
-        width: 100%;
-        height: calc(100% - 40px);
-        pointer-events: none;
-        z-index: 2;
-
-        .top-mask {
-            height: 100px;
-            position: absolute;
-            z-index: 2;
-            top: 0;
-            left: 0;
-            width: 100%;
-            background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
-        }
-    }
-
-    .farm-filter {
-        pointer-events: all;
-        margin: 12px;
-        position: relative;
-        z-index: 10;
-        background: rgba(0, 0, 0, 0.3);
-        border-radius: 20px;
-        border: 1px solid rgba(255, 255, 255, 0.4);
-
-        &::before {
-            content: "";
-            position: absolute;
-            left: 12px;
-            top: 9px;
-            width: 14px;
-            height: 14px;
-            background: url("@/assets/img/home/search.png") no-repeat center center / 100% 100%;
-        }
-
-        ::v-deep {
-            .el-select__wrapper {
-                background: none;
-                box-shadow: none;
-                padding-left: 34px;
-                font-size: 12px;
-
-                .el-select__selected-item,
-                .el-select__placeholder,
-                .el-select__input {
-                    color: rgba(255, 255, 255, 0.6);
-
-                    &.is-transparent {
-                        color: #ccc;
-                        font-size: 12px;
-                    }
-                }
-            }
-
-            .el-select {
-                transition: all 0.3s;
-
-                .el-input.is-focus .el-input__wrapper {
-                    box-shadow: none !important;
-                }
-            }
-
-            .el-input {
-                .el-input__wrapper {
-                    background: none;
-                    box-shadow: none;
-                    padding-left: 18px;
-                    font-size: 11px;
-
-                    .el-input__inner {
-                        color: rgba(255, 255, 255, 0.6);
-                    }
-
-                    &.is-focus {
-                        .el-input__inner {
-                            color: #ccc;
-                            font-size: 11px;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    .create-wrap {
-        position: absolute;
-        bottom: 0px;
-        left: 0;
-        width: 100%;
-        background: linear-gradient(180deg, transparent 0%, #f5f7fb 20%);
-    }
-
-    .create-box {
-        pointer-events: all;
-        margin: 0 12px 10px 12px;
-        width: calc(100% - 24px);
-        background: #e0f1fe;
-        border-radius: 14px;
-
-        .box-content {
-            position: relative;
-
-            &::after {
-                position: absolute;
-                right: 10px;
-                top: 2px;
-                content: "";
-                width: 79px;
-                height: 72px;
-                background: url("@/assets/img/home/creat-bg.png") no-repeat center / 100% 100%;
-            }
-        }
-
-        .create-title {
-            display: flex;
-            align-items: center;
-            padding: 12px 6px 12px 12px;
-            color: #0089f5;
-            font-size: 18px;
-            font-weight: bold;
-
-            .title-icon {
-                width: 18px;
-                padding-right: 10px;
-            }
-        }
-
-        .create-content {
-            background: #fff;
-            border-radius: 14px;
-            padding: 12px;
-            position: relative;
-            z-index: 2;
-
-            .create-from {
-
-                .select-wrap {
-                    display: flex;
-                    width: 100%;
-
-                    .species-entry {
-                        display: inline-flex;
-                        align-items: center;
-                        color: #000;
-                        cursor: pointer;
-                    }
-                }
-
-                ::v-deep {
-                    .el-form-item__label {
-                        color: #000;
-                    }
-
-                    .el-form-item__error {
-                        top: 117%;
-                    }
-
-                    .el-form-item {
-                        position: relative;
-
-                        &::after {
-                            content: "";
-                            position: absolute;
-                            left: 60px;
-                            bottom: -5px;
-                            width: calc(100% - 60px);
-                            height: 1px;
-                            background: rgba(0, 0, 0, 0.08);
-                        }
-                    }
-
-                    .el-input__wrapper {
-                        box-shadow: none;
-                        padding: 1px 6px;
-                    }
-                }
-
-                .area-box {
-                    display: flex;
-                    align-items: center;
-                    width: 100%;
-
-                    .unit {
-                        padding-right: 10px;
-                    }
-                }
-
-                .position-wrap {
-                    width: 100%;
-                    display: flex;
-                    justify-content: space-between;
-                    align-items: center;
-                }
-            }
-
-            .create-btn {
-                display: flex;
-                align-items: center;
-                width: 100%;
-                padding-top: 10px;
-
-                .btn-item {
-                    flex: 1;
-                    text-align: center;
-                    padding: 0 11px;
-                    height: 40px;
-                    line-height: 40px;
-                    border-radius: 34px;
-                    font-size: 16px;
-                    box-sizing: border-box;
-
-                    &.sencond-btn {
-                        border: 1px solid rgba(153, 153, 153, 0.5);
-                        color: #666666;
-                    }
-
-                    &.primary-btn {
-                        background: linear-gradient(180deg, #76c3ff, #2199f8);
-                        color: #fff;
-
-                        &.is-disabled {
-                            opacity: 0.6;
-                            pointer-events: none;
-                        }
-                    }
-                }
-
-                .btn-item+.btn-item {
-                    margin-left: 5px;
-                }
-            }
-        }
-    }
-}
-
-.planting-report-popup {
-    width: 82%;
-    padding: 28px 20px 20px;
-
-    .planting-report-popup__inner {
-        text-align: center;
-
-        .icon {
-            width: 68px;
-            height: 68px;
-            margin-bottom: 16px;
-        }
-
-        .title {
-            font-size: 24px;
-        }
-
-        .links {
-            display: flex;
-            flex-wrap: wrap;
-            justify-content: center;
-            gap: 10px 16px;
-            margin: 18px 0 22px;
-
-            .link {
-                font-size: 18px;
-                color: #2199f8;
-            }
-        }
-
-        .btn {
-            padding: 8px;
-            border-radius: 25px;
-            font-size: 16px;
-            color: #fff;
-            background: #2199F8;
-        }
-    }
-}
-</style>
-
-<style lang="scss">
-.location-search-popper {
-    .el-select-dropdown__list {
-        max-width: 96vw;
-        overflow-x: auto;
-    }
-
-    .sub-title {
-        padding-left: 6px;
-        font-size: 12px;
-        color: #ccc;
-    }
-}
-</style>

+ 0 - 280
src/views/old_mini/create_farm/map/editMap copy.js

@@ -1,280 +0,0 @@
-import * as KMap from "@/utils/ol-map/KMap";
-import * as util from "@/common/ol_common.js";
-import config from "@/api/config.js";
-import Style from "ol/style/Style";
-import Icon from "ol/style/Icon";
-import Fill from "ol/style/Fill";
-import Stroke from "ol/style/Stroke";
-import { Point } from 'ol/geom';
-import Feature from "ol/Feature";
-import * as proj from "ol/proj";
-import { getArea } from 'ol/sphere.js';
-import WKT from "ol/format/WKT.js";
-import GeoJSON from "ol/format/GeoJSON.js";
-import * as turf from "@turf/turf";
-import proj4 from "proj4"
-import { register } from "ol/proj/proj4";
-proj4.defs("EPSG:38572","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");
-register(proj4);
-
-/**
- * @description 地图层对象
- */
-class EditMap {
-  constructor() {
-    let that = this;
-    let vectorStyle = new KMap.VectorStyle();
-    this.vectorStyle = vectorStyle;
-
-    // 位置图标
-    this.clickPointLayer = new KMap.VectorLayer("clickPointLayer", 9999, {
-      style: (f) => {
-        return new Style({
-          image: new Icon({
-            src: require("@/assets/img/home/garden-point.png"),
-            scale: 0.5,
-            anchor: [0.5, 1],
-          }),
-        });
-      },
-    });
-
-    // 小网格图层(约 1 亩参考网格)
-    this.gridLayer = new KMap.VectorLayer("gridLayer", 900, {
-      style: (feature) => {
-        const selected = !!feature.get("selected");
-        return new Style({
-          fill: new Fill({
-            color: selected ? "rgba(255, 64, 64, 0.45)" : "rgba(255, 255, 255, 0.08)",
-          }),
-          stroke: new Stroke({
-            color: selected ? "rgba(255, 64, 64, 0.95)" : "rgba(255, 255, 255, 0.4)",
-            width: selected ? 1.8 : 1,
-          }),
-        });
-      },
-    });
-    this.selectedGridIds = new Set();
-    this.gridClickHandlerBound = false;
-    // 1 亩约 666.67m²,正方形边长约 25.82m
-    this.gridSideKm = 0.02582;
-  }
-
-  initMap(location, target) {
-    let level = 16;
-    let coordinate = util.wktCastGeom(location).getFirstCoordinate();
-    this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 8, 22);
-    let xyz2 = config.base_img_url3 + "map/lby/{z}/{x}/{y}.png";
-    this.kmap.addXYZLayer(xyz2, { minZoom: 8, maxZoom: 22 }, 2);
-    this.kmap.addLayer(this.clickPointLayer.layer);
-    this.kmap.addLayer(this.gridLayer.layer);
-    this.setMapPoint(coordinate)
-
-    this.kmap.initDraw((e) => {
-      this.rebuildGridFromPolygon();
-    })
-    
-    // 监听drawstart事件,在开始绘制前检查是否已有地块
-    this.kmap.draw.on('drawstart', (e) => {
-      const features = this.kmap.getLayerFeatures();
-      if (features && features.length >= 1) {
-        // 提示用户先删除当前地块
-        this.onDrawLimit && this.onDrawLimit();
-        // 取消本次绘制
-        this.kmap.draw.abortDrawing();
-      }
-    });
-    
-    this.kmap.startDraw()
-    this.kmap.modifyDraw(() => {
-      this.rebuildGridFromPolygon();
-    })
-    this.bindGridClick();
-  }
-
-  setAreaGeometry(geometryArr, needFitView = false) {
-    let that = this
-    geometryArr.map(item => {
-      // 不使用 setLayerWkt,而是手动添加要素,避免自动缩放视图
-      const format = new WKT()
-      const mapProjection = that.kmap.map.getView().getProjection()
-      let geometry = format.readGeometry(item, {
-        dataProjection: 'EPSG:4326',
-        featureProjection: mapProjection
-      })
-      let f = new Feature({ geometry: geometry })
-      that.kmap.polygonLayer.source.addFeature(f)
-    })
-    this.rebuildGridFromPolygon();
-    // 根据参数决定是否需要自适应地块范围
-    if (needFitView) {
-      this.fitView()
-    }
-  }
-
-
-  fitView(){
-    let extent = this.kmap.polygonLayer.source.getExtent()
-    // 地图自适应到区域可视范围
-    this.kmap.getView().fit(extent, { duration: 500, padding: [100, 100, 100, 100] });
-  }
-
-  clearLayer(){
-    // this.kmap.removeLayer(this.clickPointLayer.layer)
-    this.kmap.polygonLayer.source.clear();
-    this.gridLayer.source.clear();
-    this.selectedGridIds.clear();
-  }
-
-  getAreaGeometry() {
-    const features = this.kmap.getLayerFeatures()
-    let geometryArr = []
-    let area = 0
-    const format = new WKT()
-    // 获取图层上的Polygon,转成WKT用于回显
-    features.forEach(item => {
-      // 使用 writeGeometry 而不是 writeFeature,因为 setLayerWkt 期望的是几何体的 WKT
-      const geometry = item.getGeometry()
-      geometryArr.push(format.writeGeometry(geometry, {
-        dataProjection: 'EPSG:4326',
-        featureProjection: this.kmap.map.getView().getProjection()
-      }))
-      let geom = geometry.clone()
-      geom.transform(proj.get("EPSG:4326"), proj.get("EPSG:38572"))
-      let areaItem = getArea(geom)
-      areaItem = (areaItem + areaItem / 2) / 1000;
-      area += areaItem
-    })
-    return {geometryArr, mianji: area.toFixed(2)}  // 修改为 mianji 字段,与创建页面保持一致
-  }
-
-  setMapPosition(center) {
-    this.kmap.getView().animate({
-      center,
-      zoom: 17,
-      duration: 500,
-    });
-    this.setMapPoint(center)
-  }
-
-  setMapPoint(coordinate) {
-    this.clickPointLayer.source.clear()
-    let point = new Feature(new Point(coordinate))
-    this.clickPointLayer.addFeature(point)
-  }
-
-  // 删除当前地块
-  deleteCurrentPolygon() {
-    this.kmap.polygonLayer.source.clear();
-    this.gridLayer.source.clear();
-    this.selectedGridIds.clear();
-  }
-
-  // 设置绘制限制回调
-  setDrawLimitCallback(callback) {
-    this.onDrawLimit = callback;
-  }
-
-  bindGridClick() {
-    if (!this.kmap?.map || this.gridClickHandlerBound) return;
-    this.gridClickHandlerBound = true;
-    this.kmap.on("singleclick", (evt) => {
-      let hitFeature = null;
-      this.kmap.map.forEachFeatureAtPixel(evt.pixel, (feature, layer) => {
-        if (layer === this.gridLayer.layer) {
-          hitFeature = feature;
-          return feature;
-        }
-        return null;
-      });
-      if (!hitFeature) return;
-
-      const gridId = hitFeature.get("gridId");
-      const isSelected = !!hitFeature.get("selected");
-      hitFeature.set("selected", !isSelected);
-      if (isSelected) {
-        this.selectedGridIds.delete(gridId);
-      } else {
-        this.selectedGridIds.add(gridId);
-      }
-      hitFeature.changed();
-    });
-  }
-
-  rebuildGridFromPolygon() {
-    if (!this.kmap?.polygonLayer?.source || !this.gridLayer?.source) return;
-    const features = this.kmap.polygonLayer.source.getFeatures();
-    this.gridLayer.source.clear();
-    this.selectedGridIds.clear();
-    if (!features || !features.length) return;
-
-    const format = new WKT();
-    const geojsonFormat = new GeoJSON();
-    const polygonGeometries = [];
-    features.forEach((feature) => {
-      const geometry = feature.getGeometry();
-      if (!geometry) return;
-      const wkt = format.writeGeometry(geometry, {
-        dataProjection: "EPSG:4326",
-        featureProjection: this.kmap.map.getView().getProjection(),
-      });
-      const turfGeom = turf.wktToGeoJSON ? turf.wktToGeoJSON(wkt) : null;
-      if (turfGeom) {
-        polygonGeometries.push(turfGeom);
-        return;
-      }
-      // 回退:用 OL 读为 GeoJSON geometry
-      const json = geojsonFormat.writeGeometryObject(geometry, {
-        dataProjection: "EPSG:4326",
-        featureProjection: this.kmap.map.getView().getProjection(),
-      });
-      polygonGeometries.push(json);
-    });
-    if (!polygonGeometries.length) return;
-
-    const multiPolygonCoords = [];
-    polygonGeometries.forEach((geom) => {
-      if (!geom) return;
-      if (geom.type === "Polygon") {
-        multiPolygonCoords.push(geom.coordinates);
-      } else if (geom.type === "MultiPolygon") {
-        geom.coordinates.forEach((coords) => multiPolygonCoords.push(coords));
-      }
-    });
-    if (!multiPolygonCoords.length) return;
-
-    const farmPolygon = turf.multiPolygon(multiPolygonCoords);
-    const bbox = turf.bbox(farmPolygon);
-    const squareGrid = turf.squareGrid(bbox, this.gridSideKm, { units: "kilometers" });
-    if (!squareGrid?.features?.length) return;
-
-    squareGrid.features.forEach((gridFeature, index) => {
-      let clipped = null;
-      try {
-        clipped = turf.intersect(gridFeature, farmPolygon);
-      } catch (_) {
-        try {
-          // 兼容 turf 不同版本的 intersect 入参
-          clipped = turf.intersect(turf.featureCollection([gridFeature, farmPolygon]));
-        } catch (e) {
-          clipped = null;
-        }
-      }
-      if (!clipped) return;
-      const geometryObj = clipped.geometry;
-      if (!geometryObj) return;
-
-      const olGeometry = geojsonFormat.readGeometry(geometryObj, {
-        dataProjection: "EPSG:4326",
-        featureProjection: this.kmap.map.getView().getProjection(),
-      });
-      if (!olGeometry) return;
-      const cell = new Feature({ geometry: olGeometry });
-      cell.set("gridId", `grid-${index}`);
-      cell.set("selected", false);
-      this.gridLayer.source.addFeature(cell);
-    });
-  }
-}
-
-export default EditMap;

+ 0 - 146
src/views/old_mini/create_farm/map/editMap.js

@@ -1,146 +0,0 @@
-import * as KMap from "@/utils/ol-map/KMap";
-import * as util from "@/common/ol_common.js";
-import config from "@/api/config.js";
-import Style from "ol/style/Style";
-import Icon from "ol/style/Icon";
-import { Point } from 'ol/geom';
-import Feature from "ol/Feature";
-import * as proj from "ol/proj";
-import { getArea } from 'ol/sphere.js';
-import WKT from "ol/format/WKT.js";
-import proj4 from "proj4"
-import { register } from "ol/proj/proj4";
-proj4.defs("EPSG:38572","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");
-register(proj4);
-
-/**
- * @description 地图层对象
- */
-class EditMap {
-  constructor() {
-    let that = this;
-    let vectorStyle = new KMap.VectorStyle();
-    this.vectorStyle = vectorStyle;
-
-    // 位置图标
-    this.clickPointLayer = new KMap.VectorLayer("clickPointLayer", 9999, {
-      style: (f) => {
-        return new Style({
-          image: new Icon({
-            src: require("@/assets/img/home/garden-point.png"),
-            scale: 0.5,
-            anchor: [0.5, 1],
-          }),
-        });
-      },
-    });
-  }
-
-  initMap(location, target) {
-    let level = 16;
-    let coordinate = util.wktCastGeom(location).getFirstCoordinate();
-    this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 8, 22);
-    let xyz2 = config.base_img_url3 + "map/lby/{z}/{x}/{y}.png";
-    this.kmap.addXYZLayer(xyz2, { minZoom: 8, maxZoom: 22 }, 2);
-    this.kmap.addLayer(this.clickPointLayer.layer);
-    this.setMapPoint(coordinate)
-
-    this.kmap.initDraw((e) => {
-      // drawend事件:绘制结束后的处理
-    })
-    
-    // 监听drawstart事件,在开始绘制前检查是否已有地块
-    this.kmap.draw.on('drawstart', (e) => {
-      const features = this.kmap.getLayerFeatures();
-      if (features && features.length >= 1) {
-        // 提示用户先删除当前地块
-        this.onDrawLimit && this.onDrawLimit();
-        // 取消本次绘制
-        this.kmap.draw.abortDrawing();
-      }
-    });
-    
-    this.kmap.startDraw()
-    this.kmap.modifyDraw()
-  }
-
-  setAreaGeometry(geometryArr, needFitView = false) {
-    let that = this
-    geometryArr.map(item => {
-      // 不使用 setLayerWkt,而是手动添加要素,避免自动缩放视图
-      const format = new WKT()
-      const mapProjection = that.kmap.map.getView().getProjection()
-      let geometry = format.readGeometry(item, {
-        dataProjection: 'EPSG:4326',
-        featureProjection: mapProjection
-      })
-      let f = new Feature({ geometry: geometry })
-      that.kmap.polygonLayer.source.addFeature(f)
-    })
-    // 根据参数决定是否需要自适应地块范围
-    if (needFitView) {
-      this.fitView()
-    }
-  }
-
-
-  fitView(){
-    let extent = this.kmap.polygonLayer.source.getExtent()
-    // 地图自适应到区域可视范围
-    this.kmap.getView().fit(extent, { duration: 500, padding: [100, 100, 100, 100] });
-  }
-
-  clearLayer(){
-    // this.kmap.removeLayer(this.clickPointLayer.layer)
-    this.kmap.polygonLayer.source.clear();
-  }
-
-  getAreaGeometry() {
-    const features = this.kmap.getLayerFeatures()
-    let geometryArr = []
-    let area = 0
-    const format = new WKT()
-    // 获取图层上的Polygon,转成WKT用于回显
-    features.forEach(item => {
-      // 使用 writeGeometry 而不是 writeFeature,因为 setLayerWkt 期望的是几何体的 WKT
-      const geometry = item.getGeometry()
-      geometryArr.push(format.writeGeometry(geometry, {
-        dataProjection: 'EPSG:4326',
-        featureProjection: this.kmap.map.getView().getProjection()
-      }))
-      let geom = geometry.clone()
-      geom.transform(proj.get("EPSG:4326"), proj.get("EPSG:38572"))
-      let areaItem = getArea(geom)
-      areaItem = (areaItem + areaItem / 2) / 1000;
-      area += areaItem
-    })
-    return {geometryArr, mianji: area.toFixed(2)}  // 修改为 mianji 字段,与创建页面保持一致
-  }
-
-  setMapPosition(center) {
-    this.kmap.getView().animate({
-      center,
-      zoom: 17,
-      duration: 500,
-    });
-    this.setMapPoint(center)
-  }
-
-  setMapPoint(coordinate) {
-    this.clickPointLayer.source.clear()
-    let point = new Feature(new Point(coordinate))
-    this.clickPointLayer.addFeature(point)
-  }
-
-  // 删除当前地块
-  deleteCurrentPolygon() {
-    this.kmap.polygonLayer.source.clear();
-  }
-
-  // 设置绘制限制回调
-  setDrawLimitCallback(callback) {
-    this.onDrawLimit = callback;
-  }
-}
-
-export default EditMap;

+ 0 - 98
src/views/old_mini/create_farm/map/index.js

@@ -1,98 +0,0 @@
-import * as KMap from "@/utils/ol-map/KMap";
-import * as util from "@/common/ol_common.js";
-import config from "@/api/config.js";
-import Style from "ol/style/Style";
-import Icon from "ol/style/Icon";
-import { Point } from 'ol/geom';
-import Feature from "ol/Feature";
-import { reactive } from "vue";
-
-export let mapLocation = reactive({
-  data: null,
-});
-
-/**
- * @description 地图层对象
- */
-class IndexMap {
-  constructor() {
-    let that = this;
-    let vectorStyle = new KMap.VectorStyle();
-    this.vectorStyle = vectorStyle;
-
-    // 位置图标
-    this.clickPointLayer = new KMap.VectorLayer("clickPointLayer", 9999, {
-      style: (f) => {
-        return new Style({
-          image: new Icon({
-            src: require("@/assets/img/home/garden-point.png"),
-            scale: 0.5,
-            anchor: [0.5, 1],
-          }),
-        });
-      },
-    });
-  }
-
-  initMap(location, target) {
-    let level = 16;
-    let coordinate = util.wktCastGeom(location).getFirstCoordinate();
-    this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 8, 22);
-    let xyz2 = config.base_img_url3 + "map/lby/{z}/{x}/{y}.png";
-    this.kmap.addXYZLayer(xyz2, { minZoom: 8, maxZoom: 22 }, 2);
-    this.kmap.addLayer(this.clickPointLayer.layer);
-    this.setMapPoint(coordinate)
-    this.addMapSingerClick()
-  }
-
-  setMapPosition(center) {
-    this.kmap.getView().animate({
-      center,
-      zoom: 16,
-      duration: 0,
-    });
-    this.setMapPoint(center)
-  }
-
-  setMapPoint(coordinate) {
-    this.clickPointLayer.source.clear()
-    let point = new Feature(new Point(coordinate))
-    this.clickPointLayer.addFeature(point)
-  }
-
-  // 地图点击事件
-  addMapSingerClick() {
-    let that = this;
-    that.kmap.on("singleclick", (evt) => {
-      // that.kmap.map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) {
-      //   if ( layer instanceof VectorLayer && layer.get("name") === "reportPolygonLayer" ) {
-      //     areaId.data = feature.get("id")
-      //   }
-      // });
-      that.setMapPoint(evt.coordinate)
-      mapLocation.data = evt.coordinate
-    });
-  }
-
-  clearLayer() {
-    // this.kmap.removeLayer(this.clickPointLayer.layer)
-    this.kmap.polygonLayer.source.clear();
-  }
-
-  setAreaGeometry(geometryArr) {
-    this.clearLayer()
-    let that = this
-    geometryArr.map(item => {
-      that.kmap.setLayerWkt(item)
-    })
-    this.fitView()
-  }
-
-  fitView(){
-    let extent = this.kmap.polygonLayer.source.getExtent()
-    // 地图自适应到区域可视范围
-    this.kmap.getView().fit(extent, { duration: 500, padding: [100, 100, 100, 100] });
-  }
-}
-
-export default IndexMap;

+ 0 - 766
src/views/old_mini/create_farm/selectCrop.vue

@@ -1,766 +0,0 @@
-<template>
-    <div class="select-crop-page">
-        <custom-header :name="$t('选择作物')" @back="handleBack"></custom-header>
-        <div class="page-body">
-            <div class="top-tabs">
-                <div v-for="(m, mi) in majorTabList" :key="m.key" class="tab-item"
-                    :class="{ active: activeMajorKey === m.key }" @click="scrollToMajor(mi)">
-                    {{ m.label }}
-                </div>
-            </div>
-
-            <div ref="categoryScrollEl" class="category-sections">
-                <div v-for="(m, mi) in majorTabList" :key="m.key" :id="majorAnchorId(mi)" class="major-anchor-block">
-                    <div class="category-section">
-                        <div class="section-header">
-                            <div class="section-title">
-                                <span class="title-bar"></span>
-                                <span>{{ m.label }}</span>
-                            </div>
-                            <el-input v-model="searchMap[majorBlockKey(m.key)]" class="search-wrap" :placeholder="$t('搜索品类')">
-                                <template #prefix>
-                                    <el-icon>
-                                        <Search />
-                                    </el-icon>
-                                </template>
-                            </el-input>
-                        </div>
-
-                        <div class="crop-grid">
-                            <div class="crop-item" v-for="tab in getVisibleTabsForMajor(m.key)" :key="blockKey(tab)"
-                                :class="{ selected: isTabVarietySelected(tab) }" @click="handleVarietyTileClick(tab)">
-                                <span>{{ tab.variety_name }}</span>
-                                <span v-if="isTabVarietySelected(tab)" class="selected-mark">
-                                    <el-icon><Select /></el-icon>
-                                </span>
-                            </div>
-                        </div>
-
-                        <div v-if="shouldShowExpandForMajor(m.key)" class="expand-trigger"
-                            @click="toggleExpandMajor(m.key)">
-                            {{ expandedSections[majorBlockKey(m.key)] ? "收起" : "点击展开更多" }}
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <div class="custom-bottom-fixed-btns">
-            <div class="bottom-btn primary-btn" @click="handleConfirm">{{ $t('确认') }}</div>
-        </div>
-    </div>
-    <popup v-model:show="showPopup" class="crop-popup" round>
-        <div class="popup-title">{{ $t('请选择具体品种') }}</div>
-        <div class="popup-body">
-            <div v-if="popupVarietyDetail" class="category-section">
-                <div class="section-header">
-                    <div class="section-title">
-                        <span class="title-bar"></span>
-                        <span>{{ popupVarietyDetail.varietyName }}</span>
-                    </div>
-                    <el-input v-model="popupSearchKeyword" class="search-wrap" :placeholder="$t('搜索品种')">
-                        <template #prefix>
-                            <el-icon>
-                                <Search />
-                            </el-icon>
-                        </template>
-                    </el-input>
-                </div>
-                <div class="crop-grid">
-                    <div v-for="(cat, catIdx) in popupVisibleCategories" :key="categoryRowKey(cat, catIdx)"
-                        class="crop-item" :class="{ selected: isPopupSelected(cat) }"
-                        @click="togglePopupCrop(cat)">
-                        <span>{{ cat.category_name }}</span>
-                        <span v-if="isPopupSelected(cat)" class="selected-mark">
-                            <el-icon><Select /></el-icon>
-                        </span>
-                    </div>
-                </div>
-            </div>
-            <div v-if="shouldShowPopupSwitch" class="switch-btn" @click="handleSwitch">{{ $t('换一换') }}</div>
-            <div class="popup-actions">
-                <div class="action-btn cancel-btn" @click="clearPopupSelection">{{ $t('取消选中') }}</div>
-                <div class="action-btn confirm-btn" @click="handlePopupConfirm">{{ $t('确认') }}</div>
-            </div>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import CustomHeader from "@/components/customHeader.vue";
-import { ElMessage } from "element-plus";
-import { computed, nextTick, onActivated, onBeforeUnmount, onMounted, ref } from "vue";
-import { Popup } from "vant";
-import { useRouter } from "vue-router";
-
-const router = useRouter();
-
-const SECTION_VISIBLE_COUNT = 9;
-const POPUP_PAGE_SIZE = 12;
-const TAB_SCROLL_MARGIN = 8;
-const TAB_SCROLL_LEAD = 16;
-const PROGRAMMATIC_SCROLL_UNLOCK_MS = 750;
-
-// 接口 data 下按「大田作物 / 常绿果树」等大类的分组;顶部 Tab 展示这一层
-const majorTabList = ref([]);
-const activeMajorKey = ref(null);
-
-// 扁平品种列表(含 majorKey),供弹窗查找、一大类下筛选用
-const categoryList = ref([]);
-
-/** 页面最终选中(底部确认带回):仅弹窗点「确认」后写入 */
-const selectedCropIds = ref(new Set());
-/** 弹窗内临时勾选,与外面列表互不影响 */
-const popupSelectedIds = ref(new Set());
-const expandedSections = ref({});
-const searchMap = ref({});
-const showPopup = ref(false);
-const popupSearchKeyword = ref("");
-const popupPage = ref(0);
-const categoryScrollEl = ref(null);
-/** 点击 Tab 触发 smooth 滚动期间为 true,避免与滚动联动抢 active */
-const tabScrollProgrammatic = ref(false);
-let scrollRaf = 0;
-/** 点击 Tab 触发的 smooth 滚动:清理旧监听器/定时器,避免连点或 scrollend 误触发导致高亮乱跳 */
-let progScrollEndHandler = null;
-let progUnlockTimer = null;
-
-const clearProgrammaticScrollWatchers = (root) => {
-    if (progScrollEndHandler && root) {
-        root.removeEventListener("scrollend", progScrollEndHandler);
-    }
-    progScrollEndHandler = null;
-    if (progUnlockTimer) {
-        window.clearTimeout(progUnlockTimer);
-        progUnlockTimer = null;
-    }
-    /** 取消未完成的点击滚动时释放锁,避免连点清掉定时器后无法跟手滚动 */
-    tabScrollProgrammatic.value = false;
-};
-/** 弹窗:当前选中的品种 tab(variety_code + majorKey 定位 categoryList 中的一项) */
-const popupContext = ref({ tabId: null, majorKey: null });
-
-/** 同一页内搜索/展开区块 key;含一大类时避免不同大类下 variety_code 冲突 */
-const blockKey = (tab) => {
-    if (tab.majorKey != null && tab.majorKey !== "") {
-        return `${tab.majorKey}:${tab.variety_code}`;
-    }
-    return String(tab.variety_code);
-};
-
-const majorAnchorId = (majorIndex) => `major-anchor-${majorIndex}`;
-
-/** 一大类整块卡片:搜索 / 展开 共用同一 key */
-const majorBlockKey = (majorKey) => String(majorKey);
-
-const tabsUnderMajor = (majorKey) =>
-    categoryList.value.filter((t) => t.majorKey === majorKey);
-
-const sliceByPage = (list, page, pageSize) => {
-    const start = page * pageSize;
-    return list.slice(start, start + pageSize);
-};
-const toggleSetItem = (sourceSet, item) => {
-    const next = new Set(sourceSet);
-    if (next.has(item)) {
-        next.delete(item);
-    } else {
-        next.add(item);
-    }
-    return next;
-};
-
-/** 弹窗标题为点击的品种名;列表为该品种下 categories(category_name / categorycode) */
-const popupVarietyDetail = computed(() => {
-    const { tabId, majorKey } = popupContext.value;
-    if (tabId == null) return null;
-    const tab = categoryList.value.find((c) => {
-        if (String(c.variety_code) !== String(tabId)) return false;
-        if (majorKey != null && majorKey !== "") return c.majorKey === majorKey;
-        return c.majorKey == null || c.majorKey === "";
-    });
-    if (!tab) return null;
-    return {
-        varietyName: tab.variety_name ?? "",
-        categories: Array.isArray(tab.categories) ? tab.categories : [],
-    };
-});
-
-const popupFilteredCategories = computed(() => {
-    const list = popupVarietyDetail.value?.categories ?? [];
-    const kw = (popupSearchKeyword.value || "").trim();
-    if (!kw) return list;
-    return list.filter((c) =>
-        String(c.category_name ?? c.name ?? "").includes(kw)
-    );
-});
-
-const popupVisibleCategories = computed(() =>
-    sliceByPage(popupFilteredCategories.value, popupPage.value, POPUP_PAGE_SIZE)
-);
-
-/** 品类超过 9 条才需要「换一换」分页切换 */
-const shouldShowPopupSwitch = computed(
-    () => popupFilteredCategories.value.length > SECTION_VISIBLE_COUNT
-);
-
-/** 锚点顶部相对滚动容器内容区的纵向位置(与 scrollTop 同坐标系) */
-const anchorContentTop = (root, el) => {
-    const elRect = el.getBoundingClientRect();
-    const rootRect = root.getBoundingClientRect();
-    return root.scrollTop + (elRect.top - rootRect.top);
-};
-
-/** 一大类 Tab:按滚动位置高亮当前大类(定位而非切换) */
-const syncActiveMajorFromScroll = () => {
-    const root = categoryScrollEl.value;
-    if (!root) return;
-    const majors = majorTabList.value;
-    if (!majors.length) return;
-    const st = root.scrollTop;
-    let nextIdx = 0;
-    for (let i = 0; i < majors.length; i++) {
-        const el = root.querySelector(`#${majorAnchorId(i)}`);
-        if (!el) continue;
-        if (anchorContentTop(root, el) <= st + TAB_SCROLL_LEAD) {
-            nextIdx = i;
-        }
-    }
-    const nextKey = majors[nextIdx]?.key ?? null;
-    if (activeMajorKey.value !== nextKey) {
-        activeMajorKey.value = nextKey;
-    }
-};
-
-const scheduleSyncFromScroll = () => {
-    if (tabScrollProgrammatic.value) return;
-    if (scrollRaf) return;
-    scrollRaf = requestAnimationFrame(() => {
-        scrollRaf = 0;
-        syncActiveMajorFromScroll();
-    });
-};
-
-const scrollToMajor = (majorIndex) => {
-    const majors = majorTabList.value;
-    const key = majors[majorIndex]?.key;
-    if (key == null) return;
-    activeMajorKey.value = key;
-    nextTick(() => {
-        const root = categoryScrollEl.value;
-        const target = root?.querySelector(`#${majorAnchorId(majorIndex)}`);
-        if (!root || !target) return;
-        clearProgrammaticScrollWatchers(root);
-        tabScrollProgrammatic.value = true;
-        let unlocked = false;
-        const unlock = () => {
-            if (unlocked) return;
-            unlocked = true;
-            clearProgrammaticScrollWatchers(root);
-            activeMajorKey.value = key;
-        };
-        progScrollEndHandler = () => unlock();
-        root.addEventListener("scrollend", progScrollEndHandler);
-        const top = anchorContentTop(root, target);
-        root.scrollTo({ top: Math.max(0, top - TAB_SCROLL_MARGIN), behavior: "smooth" });
-        progUnlockTimer = window.setTimeout(unlock, PROGRAMMATIC_SCROLL_UNLOCK_MS);
-    });
-};
-
-const bindCategoryScroll = () => {
-    const root = categoryScrollEl.value;
-    root?.addEventListener("scroll", scheduleSyncFromScroll, { passive: true });
-};
-
-const unbindCategoryScroll = () => {
-    const root = categoryScrollEl.value;
-    root?.removeEventListener("scroll", scheduleSyncFromScroll);
-    if (scrollRaf) {
-        cancelAnimationFrame(scrollRaf);
-        scrollRaf = 0;
-    }
-};
-
-onMounted(() => {
-    bindCategoryScroll();
-    nextTick(() => syncActiveMajorFromScroll());
-    getCategoryList();
-});
-
-/** keep-alive 再次进入:若无已保存的选中数据,清空页面勾选与弹窗状态 */
-const resetCropSelectionState = () => {
-    selectedCropIds.value = new Set();
-    popupSelectedIds.value = new Set();
-    showPopup.value = false;
-    popupSearchKeyword.value = "";
-    popupPage.value = 0;
-    popupContext.value = { tabId: null, majorKey: null };
-};
-
-onActivated(() => {
-    try {
-        const raw = sessionStorage.getItem("selectedCrop");
-        if (raw == null || String(raw).trim() === "") {
-            resetCropSelectionState();
-        }
-    } catch {
-        resetCropSelectionState();
-    }
-});
-
-/** 从 data 对象里取出「值为数组」的字段作为顶层大类 Tab(排除 total_majors 等元数据) */
-const META_MAJOR_KEYS = new Set(["total_majors", "totalMajors"]);
-
-const extractMajorTabGroups = (raw) => {
-    if (raw == null || typeof raw !== "object" || Array.isArray(raw)) return [];
-    const out = [];
-    for (const [key, val] of Object.entries(raw)) {
-        if (META_MAJOR_KEYS.has(key)) continue;
-        if (Array.isArray(val)) {
-            out.push({ key, label: key });
-        }
-    }
-    return out;
-};
-
-/** 兼容后端字段命名;保证 categories 一定有数组 */
-const normalizeCategoryTab = (item, index) => {
-    const categories =
-        item.categories ??
-        item.category_list ??
-        item.categoryList ??
-        item.children ??
-        item.subList ??
-        [];
-    return {
-        ...item,
-        variety_code: item.variety_code ?? item.varietyCode ?? item.code ?? `tab-${index}`,
-        variety_name: item.variety_name ?? item.varietyName ?? item.name ?? "",
-        categories: Array.isArray(categories) ? categories : [],
-    };
-};
-
-/** 0/1:项目内成功码;200:常见后端;无 code 且带 data:一并兼容 */
-const isListResponseOk = (res) => {
-    const c = res?.code;
-    if (c === 0 || c === 1 || c === 200) return true;
-    if (c == null && res && Object.prototype.hasOwnProperty.call(res, "data")) return true;
-    return false;
-};
-
-const getCategoryList = () => {
-    VE_API.farm.findCategoryList().then((res) => {
-        if (!isListResponseOk(res)) return;
-        const raw = res?.data !== undefined ? res.data : res;
-        const majors = extractMajorTabGroups(raw);
-        if (majors.length) {
-            majorTabList.value = majors;
-            const flat = [];
-            for (const m of majors) {
-                const arr = Array.isArray(raw[m.key]) ? raw[m.key] : [];
-                arr.forEach((item, i) => {
-                    flat.push({
-                        ...normalizeCategoryTab(item, i),
-                        majorKey: m.key,
-                    });
-                });
-            }
-            categoryList.value = flat;
-            activeMajorKey.value = majors[0]?.key ?? null;
-            nextTick(() => syncActiveMajorFromScroll());
-            return;
-        }
-        majorTabList.value = [];
-        categoryList.value = [];
-        activeMajorKey.value = null;
-    }).catch(() => { });
-};
-
-onBeforeUnmount(() => {
-    clearProgrammaticScrollWatchers(categoryScrollEl.value);
-    unbindCategoryScroll();
-});
-
-/** 一大类下:按搜索过滤品种 tile,展开前最多 SECTION_VISIBLE_COUNT 个 */
-const filterTabsByMajorSearch = (tabs, keyword) => {
-    const k = (keyword || "").trim();
-    if (!k) return tabs || [];
-    return (tabs || []).filter((tab) => {
-        if (String(tab.variety_name || "").includes(k)) return true;
-        return (tab.categories || []).some((c) =>
-            String(c.category_name ?? c.name ?? "").includes(k)
-        );
-    });
-};
-
-/** 当前搜索条件下该大类下的全部品种(不分页) */
-const getMajorFilteredTabList = (majorKey) => {
-    const tabs = tabsUnderMajor(majorKey);
-    const kw = searchMap.value[majorBlockKey(majorKey)];
-    return filterTabsByMajorSearch(tabs, kw);
-};
-
-const getVisibleTabsForMajor = (majorKey) => {
-    const list = getMajorFilteredTabList(majorKey);
-    const bk = majorBlockKey(majorKey);
-    return expandedSections.value[bk] ? list : list.slice(0, SECTION_VISIBLE_COUNT);
-};
-
-const shouldShowExpandForMajor = (majorKey) =>
-    getMajorFilteredTabList(majorKey).length > SECTION_VISIBLE_COUNT;
-
-const toggleExpandMajor = (majorKey) => {
-    const key = majorBlockKey(majorKey);
-    expandedSections.value[key] = !expandedSections.value[key];
-};
-
-/** 品类唯一标识:接口字段 categorycode(兼容 category_code / 旧数据 id) */
-const categoryCodeOf = (cat) =>
-    cat?.categorycode ??
-    cat?.categoryCode ??
-    cat?.category_code ??
-    cat?.id;
-
-/** 选中存储键:品种父级(majorKey + variety_code)+ categorycode,避免不同品种下重复 categorycode 串台 */
-const cropSelectionKey = (tab, cat) => {
-    if (!tab) return null;
-    const code = categoryCodeOf(cat);
-    if (code == null || code === "") return null;
-    return `${blockKey(tab)}\x1f${String(code)}`;
-};
-
-/** 弹窗当前对应的品种行(与 popupVarietyDetail 同源) */
-const getPopupTab = () => {
-    const { tabId, majorKey } = popupContext.value;
-    if (tabId == null) return null;
-    return (
-        categoryList.value.find((c) => {
-            if (String(c.variety_code) !== String(tabId)) return false;
-            if (majorKey != null && majorKey !== "") return c.majorKey === majorKey;
-            return c.majorKey == null || c.majorKey === "";
-        }) ?? null
-    );
-};
-
-const categoryRowKey = (cat, index) => {
-    const tab = getPopupTab();
-    const ck = tab ? cropSelectionKey(tab, cat) : null;
-    if (ck) return ck;
-    const code = categoryCodeOf(cat);
-    return code != null && code !== "" ? String(code) : `category-${index}`;
-};
-
-/** 品种格:仅反映已确认选中(selectedCropIds),不受弹窗内临时勾选影响 */
-const isTabVarietySelected = (tab) =>
-    (tab.categories || []).some((s) => {
-        const k = cropSelectionKey(tab, s);
-        return Boolean(k && selectedCropIds.value.has(k));
-    });
-
-/** 点击品种格:弹窗标题为 variety_name,内容为 categories */
-const handleVarietyTileClick = (tab) => {
-    const list = tab.categories || [];
-    if (!list.length) return;
-    popupContext.value = {
-        tabId: tab.variety_code,
-        majorKey: tab.majorKey ?? null,
-    };
-    popupSearchKeyword.value = "";
-    popupPage.value = 0;
-    const nextPopup = new Set();
-    for (const cat of list) {
-        const k = cropSelectionKey(tab, cat);
-        if (k && selectedCropIds.value.has(k)) nextPopup.add(k);
-    }
-    popupSelectedIds.value = nextPopup;
-    showPopup.value = true;
-};
-
-const isPopupSelected = (cat) => {
-    const tab = getPopupTab();
-    const k = cropSelectionKey(tab, cat);
-    return Boolean(k && popupSelectedIds.value.has(k));
-};
-
-const togglePopupCrop = (cat) => {
-    const tab = getPopupTab();
-    const k = cropSelectionKey(tab, cat);
-    if (!k) return;
-    popupSelectedIds.value = toggleSetItem(popupSelectedIds.value, k);
-};
-
-/** 根据已确认的 categorycode 拼出可序列化的选项列表 */
-const buildSelectedCropPayload = () => {
-    const items = [];
-    for (const tab of categoryList.value) {
-        for (const cat of tab.categories || []) {
-            const k = cropSelectionKey(tab, cat);
-            if (!k || !selectedCropIds.value.has(k)) continue;
-            const code = categoryCodeOf(cat);
-            items.push({
-                categorycode: code,
-                category_name: cat.category_name ?? cat.name ?? "",
-                variety_code: tab.variety_code,
-                variety_name: tab.variety_name,
-                majorKey: tab.majorKey ?? null,
-            });
-        }
-    }
-    return items;
-};
-
-const handleConfirm = () => {
-    if (!selectedCropIds.value.size) {
-        ElMessage.warning("请至少选择一个品类");
-        return;
-    }
-    try {
-        sessionStorage.removeItem("selectedCrop");
-        sessionStorage.setItem(
-            "selectedCrop",
-            JSON.stringify(buildSelectedCropPayload())
-        );
-    } catch {
-        ElMessage.warning("保存选中结果失败,请重试");
-        return;
-    }
-    handleBack();
-};
-
-const handleBack = () => {
-    router.replace({ path: "/create_farm", query: { from: 'growth_report' } });
-};
-
-const handleSwitch = () => {
-    if (!popupFilteredCategories.value.length) return;
-    const totalPage = Math.ceil(popupFilteredCategories.value.length / POPUP_PAGE_SIZE);
-    popupPage.value = (popupPage.value + 1) % totalPage;
-};
-
-const clearPopupSelection = () => {
-    popupSelectedIds.value = new Set();
-};
-
-const handlePopupConfirm = () => {
-    const detail = popupVarietyDetail.value;
-    const tab = getPopupTab();
-    if (detail?.categories?.length && tab) {
-        const codesInTab = new Set(
-            detail.categories
-                .map((c) => cropSelectionKey(tab, c))
-                .filter(Boolean)
-        );
-        const next = new Set(selectedCropIds.value);
-        for (const k of next) {
-            if (codesInTab.has(k)) next.delete(k);
-        }
-        for (const k of popupSelectedIds.value) {
-            next.add(k);
-        }
-        selectedCropIds.value = next;
-    }
-    showPopup.value = false;
-};
-</script>
-
-<style scoped lang="scss">
-.category-section {
-    background: #fff;
-    border-radius: 6px;
-    padding: 10px 6px;
-    margin-bottom: 10px;
-}
-
-.section-header {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    margin-bottom: 10px;
-
-    .section-title {
-        font-size: 16px;
-        display: flex;
-        align-items: center;
-        gap: 6px;
-
-        .title-bar {
-            width: 3px;
-            height: 14px;
-            border-radius: 4px;
-            background: #2f9cf4;
-        }
-    }
-
-    .search-wrap {
-        width: 150px;
-
-        :deep(.el-input__wrapper) {
-            height: 32px;
-            border-radius: 20px;
-            box-shadow: 0 0 0 1px #ebedf0 inset;
-            padding: 0 10px;
-        }
-
-        :deep(.el-input__prefix-inner) {
-            color: #b8bec8;
-            font-size: 16px;
-        }
-
-        :deep(.el-input__inner) {
-            font-size: 14px;
-            color: #666;
-        }
-    }
-}
-
-.crop-grid {
-    display: grid;
-    grid-template-columns: repeat(3, minmax(0, 1fr));
-    gap: 10px;
-
-    .crop-item {
-        border: 1px solid #ebebeb;
-        border-radius: 4px;
-        text-align: center;
-        position: relative;
-        padding: 10px;
-
-        &.selected {
-            border-color: #2f9cf4;
-            color: #2f9cf4;
-            background: rgba(33, 153, 248, 0.1);
-        }
-    }
-
-    .selected-mark {
-        position: absolute;
-        right: 0;
-        bottom: 0;
-        width: 20px;
-        height: 14px;
-        border-radius: 4px 0 4px 0;
-        background: #2f9cf4;
-        color: #fff;
-        font-size: 12px;
-        line-height: 18px;
-        text-align: center;
-    }
-}
-
-.select-crop-page {
-    height: calc(100vh - 80px);
-    background: #f2f4f5;
-
-    .page-body {
-        padding: 14px 10px;
-        height: calc(100% - 100px);
-
-        .top-tabs {
-            display: flex;
-            flex-wrap: nowrap;
-            gap: 10px;
-            margin-bottom: 10px;
-            overflow-x: auto;
-            -webkit-overflow-scrolling: touch;
-            scrollbar-width: none;
-
-            &::-webkit-scrollbar {
-                display: none;
-            }
-
-            .tab-item {
-                flex: 0 0 auto;
-                border-radius: 2px;
-                padding: 6px 14px;
-                background: #fff;
-                border: 1px solid transparent;
-                color: #858585;
-                text-align: center;
-                white-space: nowrap;
-
-                &.active {
-                    background: #2f9cf4;
-                    color: #fff;
-                }
-            }
-        }
-
-        .category-sections {
-            overflow: auto;
-            height: 100%;
-
-            .major-anchor-block {
-                scroll-margin-top: 8px;
-            }
-
-            .tab-anchor-block {
-                scroll-margin-top: 8px;
-            }
-
-            .expand-trigger {
-                text-align: center;
-                color: rgba(0, 0, 0, 0.4);
-                margin-top: 14px;
-            }
-        }
-
-        .custom-bottom-fixed-btns {
-            .bottom-btn {
-                width: 130px;
-                box-sizing: border-box;
-                background: #2f9cf4;
-            }
-        }
-    }
-}
-
-.crop-popup {
-    width: 100%;
-    background: linear-gradient(0deg, #FFFFFF 79.37%, #93CEFD 108.08%);
-    padding: 20px 10px;
-
-    .popup-title {
-        text-align: center;
-        font-size: 20px;
-    }
-
-    .popup-body {
-        margin-top: 12px;
-
-        .switch-btn {
-            border-radius: 25px;
-            background: rgba(238, 238, 238, 0.6);
-            color: rgba(0, 0, 0, 0.56);
-            padding: 6px 0;
-            width: 114px;
-            text-align: center;
-            margin: 0 auto;
-        }
-
-        .popup-actions {
-            display: flex;
-            gap: 10px;
-            margin-top: 18px;
-
-            .action-btn {
-                flex: 1;
-                border-radius: 25px;
-                font-size: 16px;
-                text-align: center;
-                color: #000;
-                padding: 8px;
-                background: #fff;
-            }
-
-            .cancel-btn {
-                border: 1px solid rgba(0, 0, 0, 0.2);
-            }
-
-            .confirm-btn {
-                background: #2f9cf4;
-                color: #fff;
-            }
-        }
-    }
-}
-</style>

+ 0 - 388
src/views/old_mini/farm_info/index.vue

@@ -1,388 +0,0 @@
-<template>
-    <custom-header :name="$t('农场基本信息')" bgColor="#f2f3f5"></custom-header>
-    <div class="farm-details-page">
-        <div class="info-box info-card">
-            <div class="section-header">
-                <div class="line-title">{{ t('基本信息') }}</div>
-                <div class="edit-btn-box">
-                    <div class="edit-btn" @click="handleAddVariety">{{ t('新增品种') }}</div>
-                    <div class="edit-btn" @click="handleEditFarmInfo">{{ t('编辑信息') }}</div>
-                </div>
-            </div>
-            <div class="info-list">
-                <div class="info-row">
-                    <span class="info-label">{{ t('农场名称:') }}</span>
-                    <span class="info-value">{{ farmInfo.subjectName }}</span>
-                </div>
-                <div class="info-row">
-                    <span class="info-label">{{ t('农场面积:') }}</span>
-                    <span class="info-value">{{ farmInfo.farmArea }}亩</span>
-                </div>
-                <div class="info-row">
-                    <span class="info-label">{{ t('农场位置:') }}</span>
-                    <span class="info-value">{{ farmInfo.farmAddress }}</span>
-                </div>
-            </div>
-        </div>
-        <div class="info-box info-card">
-            <div class="section-header">
-                <div class="line-title">{{ t('土壤性质') }}</div>
-                <div class="edit-btn" @click="handleEditSoil">{{ t('编辑信息') }}</div>
-            </div>
-            <div class="info-list grid-list">
-                <div class="grid-item">
-                    <div class="grid-value">{{ t('壤土') }}</div>
-                    <div class="grid-name">{{ t('质地') }}</div>
-                </div>
-                <div class="grid-item">
-                    <div class="grid-value">1%</div>
-                    <div class="grid-name">{{ t('有机质') }}</div>
-                </div>
-                <div class="grid-item">
-                    <div class="grid-value">5.5</div>
-                    <div class="grid-name">PH</div>
-                </div>
-            </div>
-        </div>
-        <div class="info-box info-card">
-            <div class="section-header">
-                <div class="line-title">{{ t('历史高发风险') }}</div>
-                <div class="edit-btn only-text" @click="handleEditFarmFacility">{{ t('查看更多') }}<el-icon><ArrowRight /></el-icon></div>
-            </div>
-            <div class="info-list">
-                <span class="text-label">{{ t('物候风险:') }}</span> 风险描述风险描述风险描述风险描述风险
-            </div>
-        </div>
-        <div class="info-box info-card">
-            <div class="section-header">
-                <div class="line-title">{{ t('种植类别') }}</div>
-            </div>
-            <div class="info-list">
-                <div class="info-row">
-                    <span class="info-label">{{ t('过往种植:') }}</span>
-                    <div class="info-value crop-tags">
-                        <span v-for="crop in farmInfo.regionList" :key="crop.regionId" class="crop-tag dark-tag">
-                            {{ crop.regionName }}
-                        </span>
-                        <span class="crop-tag border-tag" @click="handleAddVariety">{{ t('+新增品种') }}</span>
-                    </div>
-                </div>
-                <div class="info-row line-break">
-                    <div class="info-label">{{ t('当季作物:') }}</div>
-                    <div class="season-box">
-                        <div class="info-value crop-tags">
-                            <span class="crop-tag">
-                                桂味
-                            </span>
-                        </div>
-                        <div class="season-content">
-                            <div class="season-item">{{ t('桂味-上市时间:06.08') }}</div>
-                            <div class="season-item">{{ t('桂味-上市时间:06.08') }}</div>
-                        </div>
-                    </div>
-                    <div class="season-box">
-                        <div class="info-value crop-tags">
-                            <span class="crop-tag">
-                                桂味
-                            </span>
-                        </div>
-                        <div class="season-content">
-                            <div class="season-item">{{ t('桂味-上市时间:06.08') }}</div>
-                            <div class="season-item">{{ t('桂味-上市时间:06.08') }}</div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!-- <FarmInfoPopup ref="farmInfoPopupRef" :farmId="route.query.subjectId" @success="fetchFarmSubjectDetail" /> -->
-
-    <SoilPopup ref="soilPopupRef" />
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { ref, onMounted } from "vue";
-import customHeader from "@/components/customHeader.vue";
-import { useRouter, useRoute } from "vue-router";
-// import FarmInfoPopup from "@/components/popup/farmInfoPopup.vue";
-import SoilPopup from "./popup/soilPopup.vue";
-
-const router = useRouter();
-const route = useRoute();
-const farmInfo = ref({});
-
-onMounted(() => {
-    fetchFarmSubjectDetail();
-    fetchBasicFarmFormData();
-});
-
-function fetchFarmSubjectDetail() {
-    VE_API.basic_farm.fetchFarmSubjectDetail({ subjectId: route.query.subjectId }).then(({ data }) => {
-        farmInfo.value = data || {};
-    });
-}
-
-const basicFarmInfo = ref({});
-function fetchBasicFarmFormData() {
-    VE_API.basic_farm.fetchBasicFarmFormData({ subjectId: route.query.subjectId }).then(({ data, code }) => {
-        if (code === 0) {
-            basicFarmInfo.value = {
-                ...data,
-                irrigation: data.irrigationMethods.filter(item => item.selected),
-            }
-        }
-    });
-}
-
-const farmInfoPopupRef = ref(null);
-const handleEditFarmInfo = () => {
-    // // 回显地块:存到 polygonData,创建页会优先使用这里的数据
-    // if (data.geomWkt) {
-    //     const polygonData = {
-    //         geometryArr: [data.geomWkt],
-    //         mianji: data.mianji,
-    //         isConfirmed: true,
-    //     };
-    //     store.commit("home/SET_FARM_POLYGON", polygonData);
-    // } else {
-    //     store.commit("home/SET_FARM_POLYGON", null);
-    // }
-
-    // const params = {
-    //     ...farmInfo.value,
-    //     name: farmInfo.value.subjectName,
-    //     fzr: farmInfo.value.contactName,
-    //     tel: farmInfo.value.contactPhone,
-    //     mianji: farmInfo.value.farmArea,
-    //     address: farmInfo.value.farmAddress,
-    // };
-
-    // // 回显其他表单字段
-    // store.commit("home/SET_EDIT_FARM_DATA", params);
-
-    // // 带上 from=details,创建页提交/取消后能正确返回
-    // router.push(`/create_farm?type=edit&farmId=${route.query.subjectId}&from=details`);
-
-    // farmInfoPopupRef.value.handleShow();
-};
-
-const soilPopupRef = ref(null);
-const handleEditSoil = () => {
-    soilPopupRef.value.open();
-};
-
-const handleEditFarmFacility = () => {
-    router.push(`/prescription?subjectId=${route.query.subjectId}`);
-};
-
-const handleAddVariety = () => {
-    console.log('handleAddVariety');
-    // router.push(`/interaction?addVariety=true&subjectId=${route.query.subjectId}`);
-};
-</script>
-
-<style lang="scss" scoped>
-.farm-details-page {
-    background: #f2f3f5;
-    height: calc(100vh - 40px);
-    padding: 0 12px;
-    overflow: auto;
-
-    .line-title {
-        position: relative;
-        padding-left: 14px;
-        font-size: 16px;
-
-        &::before {
-            content: "";
-            position: absolute;
-            left: 5px;
-            top: 50%;
-            transform: translateY(-50%);
-            width: 4px;
-            height: 15px;
-            background: #2199f8;
-            border-radius: 20px;
-        }
-    }
-
-    .info-card{
-        margin-top: 12px;
-        background: #fff;
-        border-radius: 6px;
-        padding: 10px;
-    }
-
-    .info-box {
-        margin-top: 12px;
-
-        .section-header {
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
-        }
-
-        .edit-btn-box {
-            display: flex;
-            align-items: center;
-            gap: 8px;
-        }
-
-        .edit-btn {
-            padding: 4px 12px;
-            font-size: 12px;
-            color: #86909c;
-            border-radius: 999px;
-            border: 0.5px solid #d0d3d8;
-            background-color: #ffffff;
-            &.only-text {
-                border: none;
-            }
-        }
-
-        .info-list {
-            margin-top: 10px;
-            margin-left: 5px;
-
-            .info-row {
-                display: flex;
-                align-items: flex-start;
-                margin-bottom: 6px;
-
-                &.line-break {
-                    display: block;
-                }
-
-                &.center-row {
-                    align-items: center;
-                }
-
-                .info-label {
-                    min-width: 70px;
-                    color: #4E5969;
-                }
-
-                .crop-tags {
-                    display: flex;
-                    align-items: center;
-                    flex-wrap: wrap;
-                    gap: 6px;
-
-                    .crop-tag {
-                        padding: 2px 8px;
-                        background: #E8F3FF;
-                        color: #2199f8;
-                        border-radius: 2px;
-                        font-size: 12px;
-                        height: 22px;
-                        box-sizing: border-box;
-                        &.dark-tag {
-                            background: #F8F8F8;
-                            color: #7F7F7F;
-                        }
-                        &.border-tag {
-                            border: 0.5px solid #2199F8;
-                        }
-                    }
-                }
-
-                .problem-tags {
-                    display: flex;
-                    flex-wrap: wrap;
-                    gap: 6px;
-
-                    .problem-tag {
-                        padding: 2px 8px;
-                        background: rgba(58, 173, 148, 0.1);
-                        color: #3AAD94;
-                        border-radius: 2px;
-                        font-size: 13px;
-                    }
-                }
-
-                .device-value {
-                    width: 100%;
-                }
-
-                .device-box {
-                    padding: 6px;
-                    border-radius: 4px;
-                    border: 0.5px solid rgba(33, 153, 248, 0.2);
-                    display: grid;
-                    grid-template-columns: repeat(2, minmax(0, 1fr));
-                    column-gap: 12px;
-                    row-gap: 4px;
-
-                    .device-item {
-                        display: flex;
-                        align-items: center;
-                        justify-content: space-between;
-                        padding: 4px 0;
-                        min-width: 0;
-                        gap: 8px;
-                        font-size: 13px;
-                        color: #1D2129;
-
-                        .device-count {
-                            padding: 2px 8px;
-                            background: #E8F3FF;
-                            color: #2199f8;
-                            border-radius: 2px;
-                        }
-                    }
-                }
-            }
-
-            .info-row-column {
-                display: flex;
-                flex-direction: column;
-                gap: 4px;
-            }
-        }
-
-        .season-box {
-            padding-top: 8px;
-            .season-content {
-                display: grid;
-                grid-template-columns: repeat(2, 1fr);
-                gap: 2px;
-                .season-item {
-                    padding-top: 6px;
-                }
-            }
-        }
-
-        .text-label {
-            color: #4E5969;
-        }
-
-        .grid-list {
-            display: grid;
-            grid-template-columns: repeat(3, 1fr);
-            gap: 6px;
-            .grid-item {
-                background: #F5F5F5;
-                border-radius: 5px;
-                padding: 3px;
-                display: flex;
-                flex-direction: column;
-                align-items: center;
-                justify-content: center;
-                height: 50px;
-                .grid-value {
-                    font-size: 16px;
-                    color: #1D2129;
-                    // line-height: 22px;
-                }
-                .grid-name {
-                    // line-height: 14px;
-                    font-size: 12px;
-                    color: rgba(78, 89, 105, 0.5);
-                }
-            }
-        }
-    }
-}
-</style>

+ 0 - 251
src/views/old_mini/farm_info/popup/soilPopup.vue

@@ -1,251 +0,0 @@
-<template>
-    <Popup class="soil-popup" round v-model:show="show">
-        <div class="soil-content">
-            <div class="section-title">{{ $t('请选择您的土壤类型') }}</div>
-            <div class="slider-wrap">
-                <Slider
-                    v-model="soilIndex"
-                    :min="0"
-                    :max="soilOptions.length - 1"
-                    :step="1"
-                    bar-height="2px"
-                    active-color="#D9D9D9"
-                    inactive-color="#D9D9D9"
-                >
-                    <template #button>
-                        <div class="slider-button">
-                            <span></span><span></span><span></span>
-                        </div>
-                    </template>
-                </Slider>
-                <div class="dot-row">
-                    <span
-                        v-for="(_, idx) in soilOptions"
-                        :key="'soil-dot-' + idx"
-                        class="dot"
-                        :class="{ active: idx === soilIndex }"
-                        @click="soilIndex = idx"
-                    />
-                </div>
-                <div class="label-row">
-                    <span
-                        v-for="(item, idx) in soilOptions"
-                        :key="'soil-label-' + item"
-                        class="label-item"
-                        :class="{ active: idx === soilIndex }"
-                        @click="soilIndex = idx"
-                    >
-                        {{ item }}
-                    </span>
-                </div>
-            </div>
-
-            <div class="section-title ph-title">{{ $t('调整pH值') }}</div>
-            <div class="slider-wrap">
-                <Slider
-                    v-model="phIndex"
-                    :min="0"
-                    :max="phOptions.length - 1"
-                    :step="1"
-                    bar-height="2px"
-                    active-color="#D9D9D9"
-                    inactive-color="#D9D9D9"
-                >
-                    <template #button>
-                        <div class="slider-button">
-                            <span></span><span></span><span></span>
-                        </div>
-                    </template>
-                </Slider>
-                <div class="dot-row">
-                    <span
-                        v-for="(_, idx) in phOptions"
-                        :key="'ph-dot-' + idx"
-                        class="dot"
-                        :class="{ active: idx === phIndex }"
-                        @click="phIndex = idx"
-                    />
-                </div>
-                <div class="label-row ph-label-row">
-                    <span
-                        v-for="(item, idx) in phOptions"
-                        :key="'ph-label-' + item"
-                        class="label-item"
-                        :class="{ active: idx === phIndex }"
-                        @click="phIndex = idx"
-                    >
-                        {{ item }}
-                    </span>
-                </div>
-            </div>
-        </div>
-        <div class="popup-button">
-            <div class="button-item cancel" @click="close">{{ $t('取消') }}</div>
-            <div class="button-item confirm" @click="handleConfirm">{{ $t('确认信息') }}</div>
-        </div>
-    </Popup>
-</template>
-
-<script setup>
-import { computed, ref } from 'vue';
-import { Popup, Slider } from "vant";
-
-const show = ref(false);
-const soilOptions = ["沙土", "壤土", "粘土"];
-const phOptions = ["5", "5.5", "6", "6.5", "7", "7.5", "8"];
-const soilIndex = ref(1);
-const phIndex = ref(3);
-
-const emit = defineEmits(["confirm"]);
-
-const currentSoilType = computed(() => soilOptions[soilIndex.value] || soilOptions[0]);
-const currentPh = computed(() => Number(phOptions[phIndex.value] || phOptions[0]));
-
-const open = () => {
-    show.value = true;
-}
-
-const close = () => {
-    show.value = false;
-}
-
-const handleConfirm = () => {
-    emit("confirm", {
-        soilType: currentSoilType.value,
-        ph: currentPh.value,
-    });
-    close();
-};
-
-defineExpose({
-    open,
-    close,
-});
-</script>
-
-<style lang="scss" scoped>
-.soil-popup {
-    width: 90%;
-    padding: 20px 22px 20px 22px;
-    // background: linear-gradient(360deg, #FFFFFF 74.2%, #D1EBFF 100%);
-    background: linear-gradient(360deg, #FFFFFF 63.11%, #93CEFD 100%);
-    border-radius: 8px;
-    font-size: 16px;
-    
-    .soil-content {
-        padding: 4px 0 0;
-
-        .section-title {
-            font-size: 16px;
-            color: #000;
-            margin-bottom: 10px;
-        }
-
-        .ph-title {
-            margin-top: 18px;
-        }
-
-        .slider-wrap {
-            padding: 8px 4px 0;
-            ::v-deep {
-                .van-slider__button-wrapper {
-                    z-index: 10;
-                }
-            }
-        }
-
-        .slider-button {
-            width: 46px;
-            height: 26px;
-            border-radius: 28px;
-            background: #2199f8;
-            border: 2px solid rgba(255, 255, 255, 0.9);
-            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            gap: 4px;
-
-            span {
-                width: 2px;
-                height: 8px;
-                border-radius: 6px;
-                background: #fff;
-            }
-        }
-
-        .dot-row {
-            margin-top: -6px;
-            z-index: 2;
-            position: relative;
-            padding: 0 2px;
-            display: flex;
-            justify-content: space-between;
-
-            .dot {
-                width: 10px;
-                height: 10px;
-                box-sizing: border-box;
-                border-radius: 50%;
-                background: #CDCDCD;
-                border: 1.5px solid #fff;
-                cursor: pointer;
-                box-shadow: 0px 2px 3px 0px #00000012;
-            }
-
-            .dot.active {
-                border-color: #2199f8;
-            }
-        }
-
-        .label-row {
-            margin-top: 14px;
-            display: flex;
-            justify-content: space-between;
-
-            .label-item {
-                font-size: 14px;
-                color: #000;
-                cursor: pointer;
-            }
-
-            .label-item.active {
-                color: #2199f8;
-                font-weight: 500;
-            }
-        }
-
-        .ph-label-row {
-            .label-item {
-                min-width: 24px;
-                text-align: center;
-            }
-        }
-    }
-
-    .popup-button {
-        display: flex;
-        justify-content: space-between;
-        margin-top: 16px;
-        gap: 12px;
-        .button-item {
-            flex: 1;
-            border-radius: 20px;
-            background: #2199F8;
-            color: #fff;
-            text-align: center;
-            height: 40px;
-            box-sizing: border-box;
-            line-height: 40px;
-        }
-
-        .cancel {
-            color: #000;
-            border: 1px solid rgba(0, 0, 0, 0.2);
-            background: #fff;
-            width: 102px;
-            flex: none;
-        }
-    }
-}
-</style>

+ 0 - 256
src/views/old_mini/growth_report/adjustPopup.vue

@@ -1,256 +0,0 @@
-<template>
-    <Popup class="adjust-popup" teleport="body" :z-index="9999" round v-model:show="show" closeable>
-        <div class="popup-title">{{ t('当前日期:2025.04.15') }}</div>
-        <div class="adjust-content">
-            <div class="adjust-item">
-                <div class="item-title">{{ t('请选择当前') }}<span class="text-light">{{ t('桂味') }}</span>{{ t('的物候期') }}</div>
-                <div class="item-checkbox">
-                    <div class="tag-group add-tag-group">
-                        <div class="tag-item" :class="{ selected: item.selected }" @click="handleSelect(idx)"
-                            v-for="(item, idx) in periodList" :key="'eriod-' + idx">
-                            <span class="text">{{ item.name }}</span>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="adjust-item">
-                <div class="item-title">{{ t('请选择当前') }}<span class="text-light">{{ t('桂味') }}</span>{{ t('的生育期') }}</div>
-                <div class="sub-title">{{ t('界定标准:') }}<span class="text-bold">{{ t('六成') }}</span>{{ t('以上表型进入该阶段') }}</div>
-                <div class="item-checkbox">
-                    <div class="tag-group add-tag-group child-tag-group">
-                        <div class="tag-item" :class="{ selected: item.selected }" @click="handleSelectChild(idx)"
-                            v-for="(item, idx) in childList" :key="'child-' + idx">
-                            <span class="text">{{ item.name }}</span>
-                            <img src="https://birdseye-img-ali-cdn.sysuimars.com/container_phenology_interaction/cover/284_0_1774863513631.png" alt="" class="right-icon">
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <div class="popup-button">
-            <div class="button-item cancel" @click="close">{{ t('取消') }}</div>
-            <div class="button-item confirm" @click="handleConfirm">{{ t('确认') }}</div>
-        </div>
-    </Popup>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { ref } from 'vue';
-import { Popup, showToast } from "vant";
-
-const show = ref(false);
-
-const open = () => {
-    show.value = true;
-}
-
-const close = () => {
-    show.value = false;
-}
-
-const handleConfirm = () => {
-    const hasPeriod = periodList.value.some((item) => item.selected);
-    const hasChild = childList.value.some((item) => item.selected);
-    if (!hasPeriod) {
-        showToast(t('请选择物候期'));
-        return;
-    }
-    if (!hasChild) {
-        showToast(t('请选择生育期'));
-        return;
-    }
-    close();
-}
-
-const handleSelect = (idx) => {
-    periodList.value.forEach((item, index) => {
-        item.selected = index === idx;
-    });
-}
-
-const periodList = ref([
-    { name: '花芽分化期', selected: false },
-    { name: '花穗期', selected: false },
-    { name: '坐果期', selected: false },
-]);
-
-
-// 生育期
-const childList = ref([
-    { name: '花穗萌动1', selected: false },
-    { name: '花穗萌动2', selected: false },
-    { name: '花穗萌动3', selected: false },
-]);
-const handleSelectChild = (idx) => {
-    childList.value.forEach((item, index) => {
-        item.selected = index === idx;
-    });
-}
-
-defineExpose({
-    open,
-    close,
-});
-</script>
-
-<style lang="scss" scoped>
-.adjust-popup {
-    width: 90%;
-    padding: 24px 18px 20px 18px;
-    background: linear-gradient(360deg, #FFFFFF 74.2%, #D1EBFF 100%);
-    border-radius: 8px;
-    font-size: 16px;
-    .adjust-content {
-        .item-title {
-            color: #000;
-        }
-        .text-light {
-            color: #2199F8;
-            font-weight: 500;
-            padding: 0 2px;
-        }
-        .adjust-item {
-            padding-top: 12px;
-        }
-        .sub-title {
-            font-size: 14px;
-            color: rgba(0, 0, 0, 0.5);
-            padding-top: 4px;
-            .text-bold {
-                color: #000000;
-            }
-        }
-    }
-
-    .item-checkbox {
-        .tag-group {
-            display: grid;
-            grid-template-columns: repeat(3, 1fr);
-            gap: 0 7px;
-            font-size: 14px;
-
-            &.child-tag-group {
-                grid-template-columns: repeat(2, 1fr);
-
-                .tag-item {
-                    height: 51px;
-                    line-height: 51px;
-                }
-            }
-
-            .tag-item {
-                margin-top: 12px;
-                position: relative;
-                border-radius: 4px;
-                color: #2199f8;
-                box-sizing: border-box;
-                height: 40px;
-                text-align: center;
-                line-height: 40px;
-                cursor: pointer;
-                transition: all 0.3s;
-
-                .right-icon {
-                    width: 40px;
-                    height: 40px;
-                    object-fit: cover;
-                    margin-left: 10px;
-                    border-radius: 50%;
-                }
-
-                .text {
-                    display: inline-flex;
-                    align-items: center;
-                }
-
-                &.selected {
-                    border: 1px solid #2199F8;
-                    background: #E8F5FF;
-                    color: #2199F8;
-
-                    &::after {
-                        content: "";
-                        position: absolute;
-                        z-index: 9;
-                        bottom: -1px;
-                        right: 0;
-                        width: 18px;
-                        height: 13px;
-                        background: url("@/assets/img/home/checked-bg.png") no-repeat bottom right / 18px 13px;
-                    }
-                }
-            }
-
-            &.add-tag-group {
-                .tag-item {
-                    color: #000000;
-                    background: rgba(241, 241, 241, 0.12);
-                    border: 1px solid #EBEBEB;
-                    cursor: pointer;
-
-                    &.self {
-                        border: 1px solid #2199F8;
-                        background: #E8F5FF;
-                        color: #2199F8;
-
-                        &::after {
-                            content: "";
-                            position: absolute;
-                            z-index: 9;
-                            bottom: -1px;
-                            right: 0;
-                            width: 18px;
-                            height: 13px;
-                            background: url("@/assets/img/home/checked-bg.png") no-repeat bottom right / 18px 13px;
-                        }
-                    }
-
-                    &.selected {
-                        border: 1px solid #2199F8;
-                        background: #E8F5FF;
-                        color: #2199F8;
-                    }
-
-                    &.last-add {
-                        display: flex;
-                        align-items: center;
-                        justify-content: center;
-                        cursor: pointer;
-
-                        .add-icon {
-                            font-size: 14px;
-                            font-weight: bold;
-                            margin-right: 3px;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    .popup-button {
-        display: flex;
-        justify-content: space-between;
-        margin-top: 12px;
-        gap: 12px;
-        .button-item {
-            flex: 1;
-            border-radius: 20px;
-            background: #2199F8;
-            color: #fff;
-            text-align: center;
-            height: 40px;
-            box-sizing: border-box;
-            line-height: 40px;
-        }
-
-        .cancel {
-            color: #000;
-            border: 1px solid rgba(0, 0, 0, 0.2);
-            background: #fff;
-        }
-    }
-}
-</style>

+ 0 - 409
src/views/old_mini/growth_report/components/PlotDetailContent.vue

@@ -1,409 +0,0 @@
-<template>
-    <div class="plot-detail-content" :class="{ 'plot-detail-content--fullscreen': fullscreen }">
-        <div class="plot-detail-content__card plot-detail-content__card--plot">
-            <div class="plot-detail-content__header">
-                <div class="plot-detail-content__title">{{ detail.name || "地块名称" }}</div>
-                <el-icon
-                    v-if="!fullscreen"
-                    class="plot-detail-content__close"
-                    color="#5A5A68"
-                    size="20"
-                    @click="emit('close')"
-                >
-                    <Close />
-                </el-icon>
-            </div>
-
-            <div class="plot-detail-content__grid">
-                <div
-                    v-for="item in infoItems"
-                    :key="item.key"
-                    class="plot-detail-content__grid-item"
-                >
-                    <img class="plot-detail-content__grid-icon" :src="item.icon" alt="" />
-                    <span class="plot-detail-content__grid-label">{{ item.label }}</span>
-                    <span class="plot-detail-content__grid-value">{{ item.value }}</span>
-                </div>
-            </div>
-
-            <div class="plot-detail-content__status">
-                <p class="plot-detail-content__status-text">{{ detail.description }}</p>
-                <div v-if="detail.images?.length" class="plot-detail-content__gallery">
-                    <img
-                        v-for="(image, index) in detail.images"
-                        :key="index"
-                        class="plot-detail-content__gallery-item"
-                        :src="image"
-                        alt=""
-                    />
-                </div>
-            </div>
-        </div>
-
-        <div class="plot-detail-content__card plot-detail-content__card--remote">
-            <div class="plot-detail-content__section-title">
-                <span class="plot-detail-content__section-bar"></span>
-                <span class="plot-detail-content__section-text">时序遥感曲线</span>
-            </div>
-
-            <div class="plot-detail-content__legend">
-                <div
-                    v-for="item in legendItems"
-                    :key="item.key"
-                    class="plot-detail-content__legend-item"
-                >
-                    <span
-                        class="plot-detail-content__legend-line"
-                        :style="{ background: item.color }"
-                    ></span>
-                    <span class="plot-detail-content__legend-text">{{ item.label }}</span>
-                </div>
-            </div>
-
-            <div class="plot-detail-content__chart-placeholder">
-                <span class="plot-detail-content__chart-placeholder-text">图表区域</span>
-            </div>
-
-            <div
-                class="plot-detail-content__summary"
-                v-html="remoteSensingSummaryHtml"
-            ></div>
-        </div>
-
-        <div class="plot-detail-content__history">
-            <div class="plot-detail-content__history-tabs">
-                <div
-                    v-for="tab in historyTabs"
-                    :key="tab.key"
-                    class="plot-detail-content__history-tab"
-                    :class="{ 'plot-detail-content__history-tab--active': activeHistoryTab === tab.key }"
-                    @click="activeHistoryTab = tab.key"
-                >
-                    {{ tab.label }}
-                </div>
-            </div>
-
-            <div class="plot-detail-content__history-panel">
-                <div class="plot-detail-content__history-panel-header">
-                    {{ currentHistoryTab.summaryTitle }}11 
-                </div>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { computed, ref } from "vue";
-
-const props = defineProps({
-    detail: {
-        type: Object,
-        default: () => ({}),
-    },
-    fullscreen: {
-        type: Boolean,
-        default: false,
-    },
-});
-
-const emit = defineEmits(["close"]);
-
-const legendItems = [
-    { key: "phenology", label: "物候曲线", color: "#2199f8" },
-    { key: "pest", label: "已发病虫害", color: "#e62e2d" },
-    { key: "growth", label: "已发生生长异常", color: "#ff9138" },
-    { key: "ndvi", label: "NVDI曲线", color: "#c6c6c6" },
-];
-
-const defaultRemoteSensingSummaryHtml =
-    '近一个月降水量较往年同期<span class="plot-detail-content__summary-highlight">增加**mm/减少**mm</span>,当前地块<span class="plot-detail-content__summary-highlight">长势良好/长势一般</span>,较往年同期绿度<span class="plot-detail-content__summary-highlight">减少**%</span>,湿度<span class="plot-detail-content__summary-highlight">减少**%</span>。根据当前长势和未来气象预测,如不进行农事干预,未来该地块长势将进一步<span class="plot-detail-content__summary-highlight">削弱**%</span>。';
-
-const remoteSensingSummaryHtml = computed(
-    () => props.detail.remoteSensingSummaryHtml || defaultRemoteSensingSummaryHtml
-);
-
-const historyTabs = [
-    { key: "pest", label: "过往病虫害", summaryTitle: "过往病虫害总结:" },
-    { key: "growth", label: "过往生长异常", summaryTitle: "过往生长异常总结:" },
-    { key: "weather", label: "过往气象风险", summaryTitle: "过往气象风险总结:" },
-];
-
-const activeHistoryTab = ref("pest");
-
-const currentHistoryTab = computed(
-    () => historyTabs.find((tab) => tab.key === activeHistoryTab.value) || historyTabs[0]
-);
-
-const defaultHistorySummaryMap = {
-    pest: "暂无过往病虫害总结数据",
-    growth: "暂无过往生长异常总结数据",
-    weather: "暂无过往气象风险总结数据",
-};
-
-const currentHistorySummary = computed(() => {
-    const customSummary = props.detail.historySummary?.[activeHistoryTab.value];
-    return customSummary || defaultHistorySummaryMap[activeHistoryTab.value];
-});
-
-const infoItems = computed(() => [
-    {
-        key: "area",
-        label: "种植面积",
-        value: props.detail.area || "--",
-        icon: require("@/assets/img/report/area.png"),
-    },
-    {
-        key: "category",
-        label: "种植类别",
-        value: props.detail.categories || "--",
-        icon: require("@/assets/img/report/category.png"),
-    },
-    {
-        key: "startTime",
-        label: "起始种植时间",
-        value: props.detail?.startTime || "--",
-        icon: require("@/assets/img/report/time.png"),
-    },
-    {
-        key: "harvestTime",
-        label: "预测收获时间",
-        value: props.detail.harvestTime || "--",
-        icon: require("@/assets/img/report/harvest.png"),
-    },
-]);
-</script>
-
-<style lang="scss" scoped>
-.plot-detail-content {
-    padding: 4px 10px;
-    background: #fff;
-    box-sizing: border-box;
-
-    &--fullscreen {
-        min-height: 100%;
-        padding: 10px 10px 60px;
-        background: #f3f5f6;
-        display: flex;
-        flex-direction: column;
-        gap: 10px;
-        box-sizing: border-box;
-
-        .plot-detail-content__card {
-            background: #fff;
-            border-radius: 12px;
-            padding: 12px 10px;
-            box-sizing: border-box;
-        }
-
-        .plot-detail-content__title {
-            font-size: 18px;
-            font-weight: 600;
-        }
-
-        .plot-detail-content__grid {
-            gap: 10px 12px;
-            margin-bottom: 12px;
-        }
-
-        .plot-detail-content__grid-label {
-            color: #c6c6c6;
-        }
-
-        .plot-detail-content__grid-icon {
-            opacity: 0.65;
-        }
-    }
-
-    &__card {
-        box-sizing: border-box;
-    }
-
-    &__header {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        margin-bottom: 6px;
-    }
-
-    &__title {
-        font-size: 18px;
-        font-weight: 500;
-    }
-
-    &__close {
-        flex-shrink: 0;
-    }
-
-    &__grid {
-        display: grid;
-        grid-template-columns: repeat(2, minmax(0, 1fr));
-        gap: 6px;
-        margin-bottom: 10px;
-    }
-
-    &__grid-item {
-        display: flex;
-        align-items: center;
-        gap: 4px;
-        font-size: 12px;
-        min-width: 0;
-    }
-
-    &__grid-icon {
-        width: 14px;
-        height: 14px;
-        flex-shrink: 0;
-    }
-
-    &__grid-label {
-        color: rgba(0, 0, 0, 0.4);
-        font-size: 12px;
-        margin-right: 2px;
-        white-space: nowrap;
-    }
-
-    &__grid-value {
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-    }
-
-    &__status {
-        padding: 8px;
-        background: linear-gradient(180deg, rgba(33, 153, 248, 0.1) 0%, rgba(255, 255, 255, 0.1) 100%);
-        border-radius: 8px;
-    }
-
-    &__status-text {
-        margin: 0 0 8px;
-        font-size: 12px;
-        line-height: 1.6;
-        color: #2199f8;
-    }
-
-    &__gallery {
-        display: grid;
-        grid-template-columns: repeat(4, minmax(0, 1fr));
-        gap: 6px;
-    }
-
-    &__gallery-item {
-        width: 100%;
-        aspect-ratio: 1;
-        border-radius: 4px;
-        object-fit: cover;
-    }
-
-    &__section-title {
-        display: flex;
-        align-items: center;
-        gap: 6px;
-        margin-bottom: 10px;
-    }
-
-    &__section-bar {
-        width: 4px;
-        height: 16px;
-        border-radius: 2px;
-        background: #2199f8;
-        flex-shrink: 0;
-    }
-
-    &__section-text {
-        font-size: 16px;
-        font-weight: 600;
-        color: #1d2129;
-    }
-
-    &__legend {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        margin-bottom: 10px;
-    }
-
-    &__legend-item {
-        display: flex;
-        align-items: center;
-        gap: 5px;
-    }
-
-    &__legend-line {
-        width: 10px;
-        height: 3px;
-        border-radius: 5px;
-    }
-
-    &__legend-text {
-        font-size: 12px;
-        color: rgba(0, 0, 0, 0.5);
-    }
-
-    &__chart-placeholder {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        height: 165px;
-        margin-bottom: 10px;
-        background: #f7f8fa;
-    }
-
-    &__chart-placeholder-text {
-        font-size: 13px;
-        color: #999;
-    }
-
-    &__summary {
-        padding: 8px 10px;
-        background: rgba(178, 178, 178, 0.1);
-        border-radius: 5px;
-        font-size: 12px;
-        color: rgba(0, 0, 0, 0.4);
-
-        :deep(.plot-detail-content__summary-highlight) {
-            color: rgba(0, 0, 0, 0.8);
-        }
-    }
-
-    &__history {
-        display: flex;
-        flex-direction: column;
-        gap: 10px;
-    }
-
-    &__history-tabs {
-        display: flex;
-        align-items: center;
-        gap: 8px;
-    }
-
-    &__history-tab {
-        flex: 1;
-        padding: 4px;
-        text-align: center;
-        color: #9A9A9A;
-        background: #fff;
-        border: 0.5px solid transparent;
-        border-radius: 2px;
-
-        &--active {
-            color: #2199f8;
-            background: rgba(33, 153, 248, 0.15);
-            border-color: #2199f8;
-        }
-    }
-
-    &__history-panel {
-        background: #fff;
-        border-radius: 10px;
-        padding: 10px;
-    }
-
-    &__history-panel-header {
-        padding: 8px 10px;
-        font-size: 12px;
-        color: #2199f8;
-        background: rgba(33, 153, 248, 0.1);
-    }
-}
-</style>

+ 0 - 165
src/views/old_mini/growth_report/components/RiskReportContent.vue

@@ -1,165 +0,0 @@
-<template>
-    <div
-        class="risk-report-content"
-        :class="{ 'risk-report-content--scrollable': !loading && !isEmpty }"
-    >
-        <div v-if="loading" class="panel-state">{{ t("agriFile.loading") }}</div>
-        <div v-else-if="isEmpty" class="panel-state">{{ t("growthReport.noRiskData") }}</div>
-        <template v-else>
-            <div v-if="hasRiskSection" class="report-section">
-                <div class="report-section__head">
-                    <img class="report-section__icon" :src="riskSection.icon || weatherIcon" alt="" />
-                    <span class="report-section__title">{{ riskSection.title || t("growthReport.weatherRisk") }}</span>
-                </div>
-                <div v-if="riskSection.summary" class="risk-summary-card">
-                    {{ riskSection.summary }}
-                </div>
-                <div
-                    v-for="(item, index) in riskSection.items"
-                    :key="`risk-${index}`"
-                    class="risk-detail-card"
-                >
-                    <div
-                        class="risk-detail-card__text"
-                        v-html="formatBoldText(item.description, item.boldKeywords)"
-                    ></div>
-                </div>
-            </div>
-
-            <div v-if="adviceList.length" class="report-section">
-                <div class="report-section__head">
-                    <img class="report-section__icon" :src="adviceIcon" alt="" />
-                    <span class="report-section__title">{{ t("growthReport.farmAdvice") }}</span>
-                </div>
-                <div
-                    v-for="(item, index) in adviceList"
-                    :key="`advice-${index}`"
-                    class="advice-card"
-                >
-                    <div class="advice-card__title">{{ item.title }}</div>
-                    <div class="advice-card__desc">{{ item.description }}</div>
-                </div>
-            </div>
-        </template>
-    </div>
-</template>
-
-<script setup>
-import { computed } from "vue";
-import { useI18n } from "@/i18n";
-import { boldKeywordsInText } from "@/utils/boldKeywords";
-
-const { t } = useI18n();
-
-const props = defineProps({
-    loading: {
-        type: Boolean,
-        default: false,
-    },
-    riskSection: {
-        type: Object,
-        default: () => ({}),
-    },
-    adviceList: {
-        type: Array,
-        default: () => [],
-    },
-});
-
-const weatherIcon = require("@/assets/img/report/weather-icon.png");
-const adviceIcon = require("@/assets/img/report/wh-icon.png");
-
-const hasRiskSection = computed(() => {
-    return Boolean(props.riskSection?.summary || props.riskSection?.items?.length);
-});
-
-const isEmpty = computed(() => {
-    return !hasRiskSection.value && !props.adviceList.length;
-});
-
-const formatBoldText = (text, keywords) => boldKeywordsInText(text, keywords);
-</script>
-
-<style lang="scss" scoped>
-.risk-report-content {
-    &--scrollable {
-        padding-bottom: 50px;
-    }
-
-    .panel-state {
-        text-align: center;
-        color: #9a9a9a;
-        font-size: 13px;
-        padding: 20px 0;
-    }
-
-    .report-section + .report-section {
-        margin-top: 16px;
-    }
-
-    .report-section {
-        &__head {
-            display: flex;
-            align-items: center;
-            gap: 6px;
-            margin-bottom: 10px;
-        }
-
-        &__icon {
-            width: 18px;
-            height: 15px;
-        }
-
-        &__title {
-            font-size: 15px;
-            font-weight: 600;
-            color: #333;
-        }
-    }
-
-    .risk-summary-card {
-        padding: 8px;
-        border-radius: 5px;
-        background: rgba(33, 153, 248, 0.1);
-        color: #2199F8;
-        font-size: 13px;
-    }
-
-    .risk-detail-card {
-        margin-top: 8px;
-        padding: 12px;
-        border-radius: 8px;
-        background: #f7f8fa;
-
-        &__text {
-            font-size: 13px;
-            color: rgba(6, 6, 6, 0.5);
-
-            :deep(.text-bold) {
-                color: #060606;
-            }
-        }
-    }
-
-    .advice-card {
-        margin-top: 8px;
-        padding: 12px;
-        border-radius: 8px;
-        background: #f7f8fa;
-
-        &__title {
-            font-size: 14px;
-            font-weight: 600;
-            color: #333;
-            line-height: 1.5;
-            margin-bottom: 6px;
-        }
-
-        &__desc {
-            font-size: 13px;
-            line-height: 1.65;
-            color: rgba(0, 0, 0, 0.5);
-        }
-    }
-}
-</style>

+ 0 - 415
src/views/old_mini/growth_report/components/RiskReportPanel.vue

@@ -1,415 +0,0 @@
-<template>
-    <floating-panel
-        class="risk-report-panel"
-        :class="{
-            'risk-report-panel--dragging': isDragging,
-            'risk-report-panel--plot': viewType === 'plot',
-            'risk-report-panel--plot-fullscreen': isPlotFullscreen,
-        }"
-        :style="panelMotionStyle"
-        v-model:height="height"
-        :anchors="anchors"
-        :duration="0.36"
-        :content-draggable="true"
-        @height-change="handleHeightChange"
-    >
-        <template v-if="viewType === 'risk'">
-            <div class="panel-header-zone">
-                <div class="panel-header" :class="{ 'panel-header--en': locale === 'en' }">
-                    <div class="panel-header__row">
-                        <div class="panel-header__left">
-                            <span class="panel-header__bar"></span>
-                            <span
-                                class="panel-header__title panel-header__title--toggle"
-                                @click="toggleLocale"
-                            >{{ t("growthReport.weatherRiskReport") }}</span>
-                            <span v-if="locale !== 'en'" class="panel-header__date">{{ reportDate }}</span>
-                        </div>
-                        <span v-if="locale === 'en'" class="panel-header__date">{{ reportDate }}</span>
-                        <div
-                            v-if="locale !== 'en'"
-                            class="panel-header__switch"
-                            @click="handleSwitchCategory"
-                        >
-                            <span>{{ t("growthReport.switchCategory") }}</span>
-                            <icon name="arrow-down" class="panel-header__switch-icon" />
-                        </div>
-                    </div>
-                    <div
-                        v-if="locale === 'en'"
-                        class="panel-header__switch panel-header__switch--en"
-                        @click="handleSwitchCategory"
-                    >
-                        <span>{{ t("growthReport.switchCategory") }}</span>
-                        <icon name="arrow-down" class="panel-header__switch-icon" />
-                    </div>
-                </div>
-            </div>
-
-            <div class="panel-body">
-                <risk-report-content
-                    :loading="loading"
-                    :risk-section="riskSection"
-                    :advice-list="adviceList"
-                />
-            </div>
-        </template>
-
-        <plot-detail-content
-            v-else
-            :detail="plotDetail"
-            :fullscreen="isPlotFullscreen"
-            @close="emit('closePlotDetail')"
-        />
-    </floating-panel>
-</template>
-
-<script setup>
-import { FloatingPanel, Icon } from "vant";
-import { computed, ref, watch } from "vue";
-import { useStore } from "vuex";
-import { useI18n } from "@/i18n";
-import PlotDetailContent from "./PlotDetailContent.vue";
-import RiskReportContent from "./RiskReportContent.vue";
-
-const { t, toggleLocale, locale } = useI18n();
-const store = useStore();
-const tabBarHeight = computed(() => store.state.home.tabBarHeight);
-
-const props = defineProps({
-    viewType: {
-        type: String,
-        default: "risk",
-    },
-    plotDetail: {
-        type: Object,
-        default: () => ({}),
-    },
-});
-
-const emit = defineEmits(["switchCategory", "expandProgress", "closePlotDetail"]);
-
-const MONTHS_EN = [
-    "January", "February", "March", "April", "May", "June",
-    "July", "August", "September", "October", "November", "December",
-];
-
-const formatReportDate = (date = new Date(), lang = "zh") => {
-    const year = date.getFullYear();
-    const month = date.getMonth() + 1;
-    const day = date.getDate();
-    if (lang === "en") {
-        return `${MONTHS_EN[month - 1]} ${day}, ${year}`;
-    }
-    return `${year}.${String(month).padStart(2, "0")}.${String(day).padStart(2, "0")}`;
-};
-
-const reportDate = computed(() => formatReportDate(new Date(), locale.value));
-const loading = ref(false);
-const riskSection = computed(() => ({
-    title: "高温高湿风险",
-    summary:
-        "预计高温高湿风险达到高风险等级(Ⅲ级),持续性高温高湿不仅直接加重病虫危害,还将迫使种植户增加农药施用频次,推高生产成本,进而影响稻米品质与种植效益,构成基地水稻中后期生产的关键气象风险。",
-    items: [
-        {
-            description:
-                "预计未来十天潢涌基地将进入 持续高温高湿状态,日均温普遍维持在 28℃ 以上,相对湿度超过 80%,为水稻病虫害的发生与流行提供了充分的气象条件。在此背景下,水稻纹枯病 可能急剧发展,经函数对病虫气象适宜度进行计算,并叠加前期积累的气象胁迫背景,计算得到病虫胁迫指数为 6(0~9范围,0~3为低风险,4~6为中风险,7~9为高风险),达到 高风险等级(Ⅲ级),重发田块发病率 可超过 60%,可导致 10%~15% 的产量损失。",
-            boldKeywords: [
-                "持续高温高湿状态",
-                "28℃",
-                "80%",
-                "水稻纹枯病",
-                // "6",
-                "高风险等级",
-                "重发田块发病率",
-                "60%",
-                "10%~15%",
-            ],
-        },
-        {
-            description:
-                "灌浆期遇高湿阴雨天气,稻瘟病 呈 中等偏重 发生趋势,感病品种 穗颈瘟 发病率可达 22.8% 。同时,稻飞虱、稻纵卷叶螟等迁飞性害虫在高温高湿环境中繁殖速度加快,若与台风外围虫源叠加,可造成 20% 左右的减产风险。此外,25~30℃日均温与80%以上相对湿度的组合,极有利于 水稻跗线螨 种群快速增长,可能导致叶片褪绿、千粒重下降 3%~5%。",
-            boldKeywords: [
-                "稻瘟病",
-                "中等偏重",
-                "穗颈瘟",
-                "22.8%",
-                "20%",
-                "水稻跗线螨",
-                " 3%~5%",
-            ],
-        },
-    ],
-}));
-
-const adviceList = computed(() => [
-    {
-        title: "田间水肥调控(即刻执行)",
-        description:
-            "叶面补钾增强抗性:每亩喷施磷酸二氢钾100克,兑水30公斤,提高茎秆硬度和植株抗病能力。"
-    },
-    {
-        title: "应急防控(未来3天内完成)",
-        description:
-            "立即喷施苯醚甲环唑·嘧菌酯悬浮剂,或井冈霉素水剂,重点喷施水稻茎秆中下部。重病田块间隔7天再补防一次。",
-    },
-]);
-
-const handleSwitchCategory = () => {
-    emit("switchCategory");
-};
-
-const anchors = computed(() => {
-    const viewportHeight = window.innerHeight - tabBarHeight.value;
-    return [
-        Math.round(viewportHeight * 0.4),
-        window.innerHeight,
-    ];
-});
-
-const height = ref(anchors.value[0]);
-const isDragging = ref(false);
-let dragEndTimer = null;
-
-const expandProgress = computed(() => {
-    const min = anchors.value[0];
-    const max = anchors.value[anchors.value.length - 1];
-    if (max <= min) return 0;
-    return Math.min(1, Math.max(0, (height.value - min) / (max - min)));
-});
-
-const isPlotFullscreen = computed(() => props.viewType === "plot" && expandProgress.value > 0.85);
-
-const panelMotionStyle = computed(() => {
-    const progress = expandProgress.value;
-    const margin = 10 * (1 - progress);
-    const radius = 16 * (1 - progress);
-    const headerScale = 1 + progress * 0.12;
-
-    return {
-        "--panel-radius": `${radius}px`,
-        "--panel-progress": progress,
-        left: `${margin}px`,
-        width: `calc(100% - ${margin * 2}px)`,
-        zIndex: progress > 0.82 ? 20 : 10,
-        paddingTop: progress > 0.9 ? "env(safe-area-inset-top, 0px)" : "0px",
-        "--header-bar-scale": headerScale,
-    };
-});
-
-const syncExpandProgress = () => {
-    emit("expandProgress", expandProgress.value);
-};
-
-watch(expandProgress, syncExpandProgress, { immediate: true });
-
-watch(height, () => {
-    isDragging.value = true;
-    if (dragEndTimer) {
-        clearTimeout(dragEndTimer);
-    }
-    dragEndTimer = setTimeout(() => {
-        isDragging.value = false;
-    }, 380);
-});
-
-watch(anchors, (nextAnchors) => {
-    if (height.value > nextAnchors[nextAnchors.length - 1]) {
-        height.value = nextAnchors[0];
-    }
-});
-
-watch(
-    () => props.viewType,
-    (type) => {
-        if (type === "plot") {
-            height.value = anchors.value[0];
-        }
-    }
-);
-
-const handleHeightChange = () => {
-    syncExpandProgress();
-};
-</script>
-
-<style lang="scss" scoped>
-.risk-report-panel {
-    z-index: 10;
-    will-change: left, width;
-
-    &.risk-report-panel--dragging {
-        ::v-deep .van-floating-panel__header-bar {
-            transform: scaleX(calc(var(--header-bar-scale, 1)));
-        }
-    }
-
-    &.risk-report-panel--plot-fullscreen {
-        ::v-deep {
-            .van-floating-panel__header {
-                background: #f5f7fb;
-            }
-
-            .van-floating-panel__content {
-                background: #f5f7fb;
-            }
-        }
-    }
-
-    &.risk-report-panel--plot {
-        ::v-deep {
-            .van-floating-panel__header {
-                background: #fff;
-            }
-
-            .van-floating-panel__header-bar {
-                background: #c6c6c6;
-            }
-
-            .van-floating-panel__content {
-                background: #fff;
-            }
-        }
-    }
-
-    ::v-deep {
-        .van-floating-panel__header {
-            height: 18px;
-            background: linear-gradient(180deg, #acd5fb 0%, #bcddfc 100%);
-            border-radius: var(--panel-radius, 16px) var(--panel-radius, 16px) 0 0;
-        }
-
-        .van-floating-panel__header-bar {
-            width: 36px;
-            height: 4px;
-            background: rgba(255, 255, 255, 0.95);
-            border-radius: 4px;
-            transform: scaleX(var(--header-bar-scale, 1));
-            transition: transform 0.2s ease;
-        }
-
-        .van-floating-panel__content {
-            overflow-y: auto;
-            padding-bottom: env(safe-area-inset-bottom);
-            background: linear-gradient(180deg, #d2ebff 38%, #e3f2fd 68%, #ffffff 100%);
-        }
-    }
-}
-
-.panel-header-zone {
-    padding-bottom: 4px;
-    background: linear-gradient(180deg, #bcddfc 0%, #d9ebfd 100%);
-}
-
-.panel-header {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    gap: 8px;
-    padding: 2px 12px 8px;
-    box-sizing: border-box;
-
-    &__row {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        width: 100%;
-        gap: 8px;
-        min-width: 0;
-    }
-
-    &--en {
-        flex-direction: column;
-        align-items: flex-start;
-        gap: 10px;
-        padding-bottom: 10px;
-
-        .panel-header__row {
-            width: 100%;
-        }
-
-        .panel-header__left {
-            flex: 1;
-            min-width: 0;
-        }
-
-        .panel-header__title {
-            font-size: 17px;
-            font-weight: 600;
-            color: #000;
-        }
-
-        .panel-header__date {
-            flex-shrink: 0;
-            padding: 4px 8px;
-            font-size: 12px;
-            color: #313131;
-            background: rgba(255, 255, 255, 0.72);
-            border-radius: 4px;
-        }
-
-        .panel-header__switch--en {
-            padding: 4px 10px;
-            border-radius: 4px;
-            border-color: rgba(33, 153, 248, 0.75);
-        }
-    }
-
-    &__left {
-        display: flex;
-        align-items: center;
-        gap: 6px;
-    }
-
-    &__bar {
-        width: 4px;
-        height: 16px;
-        border-radius: 2px;
-        background: #2199f8;
-    }
-
-    &__title {
-        font-size: 16px;
-        font-weight: 500;
-
-        &--toggle {
-            cursor: pointer;
-            user-select: none;
-        }
-    }
-
-    &__date {
-        padding: 2px 6px;
-        font-size: 12px;
-        color: #313131;
-        background: rgba(255, 255, 255, 0.5);
-        border-radius: 2px;
-    }
-
-    &__switch {
-        display: flex;
-        align-items: center;
-        gap: 2px;
-        padding: 5px 10px;
-        font-size: 12px;
-        color: #2199f8;
-        background: #fff;
-        border: 1px solid rgba(33, 153, 248, 0.65);
-        border-radius: 6px;
-        white-space: nowrap;
-        flex-shrink: 0;
-    }
-
-    &__switch-icon {
-        font-size: 12px;
-        color: #2199f8;
-    }
-}
-
-.panel-body {
-    margin: 0 10px;
-    background: #fff;
-    border-radius: 8px;
-    padding: 10px;
-}
-</style>

+ 0 - 190
src/views/old_mini/interactionList/components/examplePopup.vue

@@ -1,190 +0,0 @@
-<template>
-    <popup v-model:show="localShow" class="example-popup" :overlay-style="{ backdropFilter: 'blur(4px)' }">
-        <div class="example-content">
-            <div class="example-swipe-wrap">
-                <Swipe
-                    ref="exampleSwipeRef"
-                    :show-indicators="false"
-                    v-model="activeIndex"
-                    :autoplay="0"
-                    :loop="false"
-                    @change="handleSwipeChange"
-                    indicator-color="#2199F8"
-                >
-                    <SwipeItem v-for="img in images" :key="img?.exampleImageUrl">
-                        <div class="img-tag" v-if="showTitleAndTips">{{ img?.exampleImageAnnotation }}</div>
-                        <img class="example-img" :src="img?.exampleImageUrl" alt="" />
-                    </SwipeItem>
-                </Swipe>
-
-                <!-- 左箭头 -->
-                <div
-                    v-if="images.length > 1 && activeIndex > 0"
-                    class="example-arrow arrow-left"
-                    @click.stop="prevExample"
-                >
-                    <el-icon>
-                        <ArrowLeftBold color="#F0D09C" />
-                    </el-icon>
-                </div>
-                <!-- 右箭头 -->
-                <div
-                    v-if="images.length > 1 && activeIndex < images.length - 1"
-                    class="example-arrow arrow-right"
-                    @click.stop="nextExample"
-                >
-                    <el-icon>
-                        <ArrowRightBold color="#F0D09C" />
-                    </el-icon>
-                </div>
-            </div>
-
-            <div class="example-tips" v-if="showTitleAndTips">
-                {{ tips }}
-            </div>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { ref, watch, computed } from "vue";
-import { Popup, Swipe, SwipeItem } from "vant";
-
-const props = defineProps({
-    show: {
-        type: Boolean,
-        default: false,
-    },
-    images: {
-        type: Array,
-        default: () => [],
-    },
-    startIndex: {
-        type: Number,
-        default: 0,
-    },
-    tips: {
-        type: String,
-        default: "拍摄要求:请采集代表农场作物物候期的照片,请采集代表农场作物物候期的照片。",
-    },
-    // 为 false 时不显示左上角示例文字和底部说明文字(用于上传照片放大查看)
-    showTitleAndTips: {
-        type: Boolean,
-        default: true,
-    },
-});
-
-const emit = defineEmits(["update:show"]);
-
-const exampleSwipeRef = ref(null);
-const activeIndex = ref(0);
-
-// v-model:show 双向绑定
-const localShow = computed({
-    get: () => props.show,
-    set: (val) => emit("update:show", val),
-});
-
-// 当打开弹窗或 startIndex 变化时,设置当前索引
-watch(
-    () => [props.show, props.startIndex],
-    ([show, start]) => {
-        if (show) {
-            const lastIndex = Math.max(props.images.length - 1, 0);
-            const normalizedIndex = Math.min(Math.max(start || 0, 0), lastIndex);
-            activeIndex.value = normalizedIndex;
-            if (exampleSwipeRef.value) {
-                exampleSwipeRef.value.swipeTo(activeIndex.value);
-            }
-        }
-    }
-);
-
-const prevExample = () => {
-    if (!props.images.length) return;
-    activeIndex.value = Math.max(activeIndex.value - 1, 0);
-    exampleSwipeRef.value && exampleSwipeRef.value.swipeTo(activeIndex.value);
-};
-
-const nextExample = () => {
-    if (!props.images.length) return;
-    const lastIndex = props.images.length - 1;
-    activeIndex.value = Math.min(activeIndex.value + 1, lastIndex);
-    exampleSwipeRef.value && exampleSwipeRef.value.swipeTo(activeIndex.value);
-};
-
-const handleSwipeChange = (index) => {
-    activeIndex.value = Number(index) || 0;
-};
-</script>
-
-<style scoped lang="scss">
-.example-popup {
-    width: 100%;
-    border-radius: 0;
-    background: none;
-    max-width: 100%;
-
-    .example-content {
-        text-align: center;
-
-        .example-swipe-wrap {
-            position: relative;
-        }
-
-        .example-img {
-            width: 100%;
-            height: 400px;
-            object-fit: contain;
-        }
-
-        .img-tag {
-            position: absolute;
-            top: 0;
-            left: 0;
-            padding: 0 10px;
-            height: 28px;
-            line-height: 28px;
-            font-size: 12px;
-            color: #fff;
-            background: rgba(0, 0, 0, 0.7);
-            border-radius: 0 0 10px 0;
-            z-index: 2;
-        }
-
-        .example-arrow {
-            position: absolute;
-            top: 50%;
-            transform: translateY(-50%);
-            width: 32px;
-            height: 32px;
-            border-radius: 50%;
-            background: rgba(0, 0, 0, 0.45);
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            z-index: 3;
-        }
-
-        .arrow-left {
-            left: 8px;
-        }
-
-        .arrow-right {
-            right: 8px;
-        }
-    }
-
-    .example-tips {
-        margin: 16px 12px 6px 12px;
-        background: #3d3d3d;
-        padding: 8px 10px;
-        border-radius: 4px;
-        backdrop-filter: blur(4px);
-        color: #fff;
-        font-size: 14px;
-        line-height: 21px;
-        text-align: left;
-    }
-}
-</style>

+ 0 - 259
src/views/old_mini/interactionList/components/morePopup.vue

@@ -1,259 +0,0 @@
-<template>
-    <popup v-model:show="showMore" class="more-popup" round>
-        <div class="more-content">
-            <!-- 搜索框 -->
-            <!-- <div class="search-bar">
-                <el-icon class="search-icon">
-                    <Search />
-                </el-icon>
-                <input
-                    v-model="keyword"
-                    class="search-input"
-                    type="text"
-                    :placeholder="t('请输入病虫害名称')"
-                />
-            </div> -->
-
-            <!-- 类型切换 -->
-            <!-- <div class="type-tabs">
-                <div
-                    class="tab-item all-tab"
-                    :class="{ active: activeType === 'all' }"
-                    @click="changeType('all')"
-                >
-                    全部
-                </div>
-                <div
-                    class="tab-item"
-                    :class="{ active: activeType === 'disease' }"
-                    @click="changeType('disease')"
-                >
-                    病害
-                </div>
-                <div
-                    class="tab-item"
-                    :class="{ active: activeType === 'pest' }"
-                    @click="changeType('pest')"
-                >
-                    虫害
-                </div>
-            </div> -->
-
-            <!-- 病虫害列表 -->
-            <div class="card-grid">
-                <div
-                    v-for="(item, key) in filteredList"
-                    :key="key"
-                    class="card-item"
-                    @click="showExample(filteredList, key)"
-                >
-                    <div class="thumb-wrap">
-                        <img class="thumb" :src="item.exampleImageUrl" :alt="item.name" />
-                    </div>
-                    <div class="card-name">{{ item.exampleImageAnnotation || "病害" }}</div>
-                </div>
-                <div v-if="!filteredList.length" class="empty-text">{{ t('暂无数据') }}</div>
-            </div>
-        </div>
-    </popup>
-
-    <!-- 示例照片轮播组件 -->
-    <example-popup
-        v-model:show="showExamplePopup"
-        :images="exampleList"
-        :start-index="exampleStartIndex"
-        :tips="shootingMethod"
-    />
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { ref, computed } from "vue";
-import { Popup } from "vant";
-import { Search } from "@element-plus/icons-vue";
-import ExamplePopup from "./examplePopup.vue";
-
-const showMore = ref(false);
-const keyword = ref("");
-const activeType = ref("all"); // all / disease / pest
-
-// 病虫害数据(后续可通过接口或外部传入)
-const items = ref([
-    // 示例数据,占位用,后续可替换为接口返回
-    {
-        id: 1,
-        name: "蒂蛀虫",
-        type: "pest",
-        image: "https://birdseye-img-ali-cdn.sysuimars.com/birdseye-look-mini/94379/1768801082504.png",
-        images: [
-            "https://birdseye-img-ali-cdn.sysuimars.com/birdseye-look-mini/94379/1768801082504.png",
-        ],
-    },
-]);
-
-const filteredList = computed(() => {
-    let list = items.value || [];
-    if (activeType.value !== "all") {
-        list = list.filter((it) => it.type === activeType.value);
-    }
-    if (keyword.value.trim()) {
-        const k = keyword.value.trim().toLowerCase();
-        list = list.filter((it) => (it.name || "").toLowerCase().includes(k));
-    }
-    return list;
-});
-
-const openPopup = () => {
-    showMore.value = true;
-};
-
-const changeType = (type) => {
-    activeType.value = type;
-};
-
-// 预留给外部设置数据的能力
-const setItems = (list) => {
-    items.value = Array.isArray(list) ? list : [];
-};
-
-// 示例轮播相关
-const showExamplePopup = ref(false);
-const exampleList = ref([]);
-const exampleStartIndex = ref(0);
-const shootingMethod = ref('');
-
-const showExample = (list, index) => {
-    exampleList.value = list;
-    shootingMethod.value = list[0].shootingMethod;
-    exampleStartIndex.value = index;
-    showExamplePopup.value = true;
-};
-
-defineExpose({
-    openPopup,
-    setItems,
-});
-</script>
-
-<style lang="scss" scoped>
-.more-popup {
-    width: calc(100% - 40px);
-    border-radius: 16px;
-    background: #fff;
-    padding: 16px 0 20px 16px;
-    box-sizing: border-box;
-    max-height: 90%;
-    overflow: hidden;
-}
-
-.more-content {
-    display: flex;
-    flex-direction: column;
-    max-height: 100%;
-}
-
-.search-bar {
-    display: flex;
-    align-items: center;
-    border: 0.5px solid rgba(0, 0, 0, 0.2);
-    border-radius: 20px;
-    padding: 6px 12px;
-    margin-bottom: 16px;
-    margin-right: 16px;
-
-    .search-icon {
-        font-size: 18px;
-        color: #c0c4cc;
-        margin-right: 6px;
-    }
-
-    .search-input {
-        flex: 1;
-        border: none;
-        outline: none;
-        background: transparent;
-        font-size: 14px;
-        color: rgba(0, 0, 0, 0.5);
-    }
-
-    .search-input::placeholder {
-        color: rgba(0, 0, 0, 0.5);
-    }
-}
-
-.type-tabs {
-    display: flex;
-    gap: 10px;
-    margin-bottom: 16px;
-    padding-right: 16px;
-
-    .tab-item {
-        flex: 1;
-        text-align: center;
-        height: 32px;
-        line-height: 32px;
-        border-radius: 999px;
-        font-size: 15px;
-        background: rgba(218, 218, 218, 0.2);
-        color: #000;
-        &.all-tab {
-            flex: none;
-            width: 73px;
-        }
-    }
-
-    .tab-item.active {
-        background: #2199f8;
-        color: #fff;
-    }
-}
-
-.card-grid {
-    padding-right: 16px;
-    display: grid;
-    grid-template-columns: repeat(3, 1fr);
-    grid-row-gap: 12px;
-    grid-column-gap: 5px;
-    margin-top: 4px;
-    padding-bottom: 4px;
-    overflow-y: auto;
-    /* 让列表区域在内容较多时内部滚动 */
-    max-height: 70vh;
-
-    .card-item {
-        display: flex;
-        flex-direction: column;
-        align-items: center;
-    }
-
-    .thumb-wrap {
-        width: 100%;
-        border-radius: 8px;
-        overflow: hidden;
-        background: #f5f5f5;
-    }
-
-    .thumb {
-        width: 100%;
-        height: 76px;
-        object-fit: cover;
-        display: block;
-    }
-
-    .card-name {
-        margin-top: 5px;
-        font-size: 12px;
-        color: #000;
-        text-align: center;
-    }
-
-    .empty-text {
-        grid-column: 1 / -1;
-        text-align: center;
-        font-size: 14px;
-        color: #999;
-        padding: 16px 0;
-    }
-}
-</style>

+ 0 - 840
src/views/old_mini/interactionList/drawRegion.vue

@@ -1,840 +0,0 @@
-<template>
-    <div class="edit-map">
-        <custom-header :name="viewOnly ? '查看区域' : '勾画区域'"></custom-header>
-        <div class="region-type-tabs">
-            <div v-for="item in regionTypeTabs" :key="item.code" class="region-type-tab"
-                :class="{ 'region-type-tab--active': activeRegionType === item.code }">
-                {{ item.name }}
-            </div>
-        </div>
-        <div class="variety-tabs" v-if="varietyTabs.length > 0 && activeRegionType !== 'DORMANCY'">
-            <div v-for="(v, index) in varietyTabs" :key="index" class="variety-tab"
-                :class="{ 'variety-tab--active': activeVariety === index }">
-                {{ v.regionName || v.problemZoneTypeName }}
-            </div>
-        </div>
-        <div class="edit-map-content">
-            <div class="edit-map-tip" v-if="!viewOnly">{{ t('操作提示:拖动圆点,即可调整地块边界') }}</div>
-            <div class="map-container" ref="mapContainer"></div>
-            <div class="edit-map-footer" :style="{ 'bottom': activeRegionType !== 'DORMANCY' ? '85px' : '59px' }">
-                <div class="footer-back" @click="goBack">
-                    <img class="back-icon" src="@/assets/img/home/go-back.png" alt="" />
-                </div>
-                <div class="edit-map-footer-btn" v-if="!viewOnly">
-                    <div class="btn-delete" @click="deletePolygon">{{ t('删除地块') }}</div>
-                    <!-- <div class="btn-cancel" @click="goBack">{{ t('取消') }}</div> -->
-                    <div class="btn-confirm" @click="confirm">{{ t('确认区域') }}</div>
-                </div>
-            </div>
-        </div>
-
-        <popup v-model:show="showAbnormalTypePopup" round closeable class="abnormal-popup"
-            :close-on-click-overlay="true">
-            <div class="abnormal-popup-content">
-                <div class="abnormal-popup-title">{{ t('请选择异常类型') }}</div>
-                <el-select v-model="selectedAbnormalType" class="abnormal-type-select" :placeholder="t('请选择类型')" size="large">
-                    <el-option v-for="item in abnormalTypeOptions" :key="item.value" :label="item.name"
-                        :value="item.value" />
-                </el-select>
-                <div class="abnormal-popup-confirm" @click="handleConfirmUpload">{{ t('确认上传') }}</div>
-            </div>
-        </popup>
-    </div>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import customHeader from "@/components/customHeader.vue";
-import { ref, computed, onMounted, onActivated, onDeactivated } from "vue";
-import { Popup } from "vant";
-import DrawRegionMap from "./map/drawRegionMap.js";
-import { Map as KMapMap } from "@/utils/ol-map/KMap";
-import { useRouter, useRoute } from "vue-router";
-import { convertPointToArray } from "@/utils/index";
-import { ElMessage, ElMessageBox } from "element-plus";
-import Style from "ol/style/Style";
-import { Fill, Stroke, Circle, Text } from "ol/style.js";
-import { Point } from "ol/geom";
-import * as proj from "ol/proj";
-import { getArea } from "ol/sphere.js";
-
-const router = useRouter();
-const route = useRoute();
-const mapContainer = ref(null);
-const drawRegionMap = new DrawRegionMap();
-const DEFAULT_MAP_CENTER = "POINT (113.6142086995688 23.585836479509055)";
-
-const type = ref(null);
-const viewOnly = computed(() => route.query.viewOnly === "1" || route.query.viewOnly === "true");
-const showDataMode = computed(() => route.query.showData === "1" || route.query.showData === "true");
-const showAbnormalTypePopup = ref(false);
-const selectedAbnormalType = ref("");
-const abnormalTypeOptions = [{
-    name: "病害",
-    value: "DISEASE"
-}, {
-    name: "虫害",
-    value: "PEST"
-}, {
-    name: "不确定",
-    value: "UNCERTAIN"
-}];
-
-onMounted(() => {
-    type.value = route.query.type;
-    const point = route.query.mapCenter || DEFAULT_MAP_CENTER;
-    const editable = !viewOnly.value;
-    const showPoint = !viewOnly.value;
-    drawRegionMap.initMap(point, mapContainer.value, editable, true, showPoint);
-    applyRegionStyles();
-});
-
-onActivated(async () => {
-    const point = route.query.mapCenter || DEFAULT_MAP_CENTER;
-    await fetchRegionInfo();
-
-    syncMapEditableState(point);
-    const polygonData = route.query.polygonData;
-    const rawRangeWkt = route.query.rangeWkt;
-    const rangeWkt = rawRangeWkt ? decodeURIComponent(rawRangeWkt) : null;
-    const shouldRenderFromApi = showDataMode.value && !rangeWkt && !polygonData;
-
-    applyRegionStyles();
-    if (shouldRenderFromApi) {
-        renderRegionsFromApi();
-    }
-    if (rangeWkt) {
-        renderRegionsFromRouteRangeWkt(rangeWkt);
-    }
-    restoreEditablePolygonFromRoute(polygonData);
-    updateMapCenterForEditMode(point);
-
-    applyRegionStyles();
-});
-
-const regionTypeTabs = ref([]);
-const activeRegionType = ref("variety");
-const regionInfo = ref([]);
-const formatDateToYmdDash = (raw) => {
-    const sourceDate = raw ? new Date(raw) : new Date();
-    const resolvedDate = Number.isNaN(sourceDate.getTime()) ? new Date() : sourceDate;
-    const y = resolvedDate.getFullYear();
-    const m = String(resolvedDate.getMonth() + 1).padStart(2, "0");
-    const d = String(resolvedDate.getDate()).padStart(2, "0");
-    return `${y}-${m}-${d}`;
-};
-
-const isValidGeomWkt = (geom) => {
-    const text = String(geom || "").trim();
-    return text.length > 10 && (text.includes("POLYGON") || text.includes("MULTIPOLYGON"));
-};
-
-const isTreatmentOrControlledStatus = (status) => {
-    const normalizedStatus = String(status || "").trim();
-    return normalizedStatus === "2" || normalizedStatus === "3";
-};
-
-/**
- * 将不同入口(接口回显/路由透传)的几何数据统一映射为地图组件可消费的数据结构,
- * 避免散落在各处拼装导致字段不一致。
- */
-const buildRegionBasePayload = (
-    geometry,
-    regionStyleKind,
-    reproductiveName,
-    updatedTime,
-    handleStatus,
-    lockStyleType = "",
-    label = ""
-) => {
-    if (!isValidGeomWkt(geometry)) return null;
-    const hasTreatmentStatus = isTreatmentOrControlledStatus(handleStatus);
-    const shouldUseLockedDiseaseStyle = regionStyleKind === "ABNORMAL" && hasTreatmentStatus && !!lockStyleType;
-    return {
-        geometry: String(geometry).trim(),
-        status: "unresolved",
-        regionStyleKind,
-        reproductiveName,
-        updatedTime,
-        displayMode: shouldUseLockedDiseaseStyle ? "lockedDisease" : "",
-        handleStatus: hasTreatmentStatus ? String(handleStatus).trim() : "",
-        lockStyleType: shouldUseLockedDiseaseStyle ? lockStyleType : "",
-        label,
-    };
-};
-
-const buildAbnormalLabel = (name, handleStatus) => {
-    const status = String(handleStatus || "").trim();
-    const isTreatingOrControlled = isTreatmentOrControlledStatus(status);
-    const prefix = name.includes("虫害")
-        ? "虫害"
-        : name.includes("病害")
-            ? "病害"
-            : name.includes("过快")
-                ? "长势过快"
-                : name.includes("过慢")
-                    ? "长势过慢"
-                    : "";
-    if (!prefix) return "";
-    if (isTreatingOrControlled) {
-        return status === "3" ? `${prefix}已控制` : `${prefix}治疗中`;
-    }
-    return `新增${prefix}`;
-};
-
-const buildShowDataRegionsFromApi = () => {
-    const currentTab = (varietyTabs.value || [])[activeVariety.value] || {};
-    if (!currentTab) return [];
-    const styleKind = getCanonicalRegionTypeForStyles();
-    const reproductiveName = String(currentTab.problemZoneTypeName || currentTab.regionName || "");
-    const isAbnormal = styleKind === "ABNORMAL";
-    const geomItems = Array.isArray(currentTab.geomItems) ? currentTab.geomItems : [];
-    const regions = [];
-
-    geomItems.forEach((item) => {
-        const geometry = String(item?.geomWkt || "").trim();
-        if (!isValidGeomWkt(geometry)) return;
-        const handleStatus = String(item?.handleStatus ?? "").trim();
-        const hasTreatmentStatus = isTreatmentOrControlledStatus(handleStatus);
-        const isGrowthAbnormal = reproductiveName.includes("过慢") || reproductiveName.includes("过快");
-        const region = buildRegionBasePayload(
-            geometry,
-            styleKind,
-            reproductiveName,
-            formatDateToYmdDash(item?.createTime || currentTab?.createTime),
-            handleStatus,
-            isAbnormal && hasTreatmentStatus
-                ? (handleStatus === "3" ? "controlled" : (isGrowthAbnormal ? "growthTreating" : "diseaseTreating"))
-                : "",
-            isAbnormal ? buildAbnormalLabel(reproductiveName, handleStatus) : ""
-        );
-        if (region) regions.push(region);
-    });
-
-    if (regions.length > 0) return regions;
-    const fallbackGeom = String(currentTab.geom || "").trim();
-    if (!isValidGeomWkt(fallbackGeom)) return [];
-    const fallbackRegion = buildRegionBasePayload(
-        fallbackGeom,
-        styleKind,
-        reproductiveName,
-        formatDateToYmdDash(currentTab?.createTime),
-        "",
-        "",
-        isAbnormal ? buildAbnormalLabel(reproductiveName, "") : ""
-    );
-    return fallbackRegion ? [fallbackRegion] : [];
-};
-
-const fitAllRegionsWhenViewOnly = () => {
-    if (viewOnly.value && drawRegionMap.fitAllRegions) {
-        drawRegionMap.fitAllRegions();
-    }
-};
-
-const renderRegionsFromApi = () => {
-    const apiRegions = buildShowDataRegionsFromApi();
-    if (!apiRegions.length) return;
-    drawRegionMap.setStatusRegions(apiRegions);
-    fitAllRegionsWhenViewOnly();
-};
-
-/**
- * 路由可能传 JSON(geometryArr)或单条 WKT 字符串,这里统一转换为 regions。
- * 该函数只负责“解析+映射”,不关心地图渲染,便于后续复用和测试。
- */
-const buildRegionsFromRouteRangeWkt = (rangeWkt) => {
-    const regionStyleKind = getCanonicalRegionTypeForStyles();
-    const currentVarietyTab = (varietyTabs.value || [])[activeVariety.value] || {};
-    // 异常区名称有时不会从路由透传,补充当前 tab 兜底,避免标签回退为“病害治疗中”
-    const reproductiveName = String(
-        route.query.reproductiveName ||
-        route.query.problemZoneTypeName ||
-        currentVarietyTab.problemZoneTypeName ||
-        currentVarietyTab.regionName ||
-        ""
-    );
-    const isAbnormal = regionStyleKind === "ABNORMAL";
-    const routeHandleStatus = String(route.query.handleStatus || "").trim();
-    const hasTreatmentStatus = isTreatmentOrControlledStatus(routeHandleStatus);
-    const isGrowthAbnormal =
-        isAbnormal && (reproductiveName.includes("长势") || reproductiveName.includes("过慢") || reproductiveName.includes("过快"));
-    const abnormalLabel =
-        !isAbnormal
-            ? ""
-            : reproductiveName.includes("病害")
-                ? "新增病害"
-                : reproductiveName.includes("虫害")
-                    ? "新增虫害"
-                    : reproductiveName.includes("过慢")
-                        ? "新增长势过慢"
-                        : reproductiveName.includes("过快")
-                            ? "新增长势过快"
-                            : "";
-    const lockStyleType = !isAbnormal || !hasTreatmentStatus
-        ? ""
-        : (isGrowthAbnormal ? "growthTreating" : "diseaseTreating");
-
-    const toRegionPayload = (geometryText) => buildRegionBasePayload(
-        geometryText,
-        regionStyleKind,
-        reproductiveName,
-        route.query.updatedTime,
-        routeHandleStatus,
-        lockStyleType,
-        abnormalLabel
-    );
-
-    try {
-        const parsed = JSON.parse(rangeWkt);
-        if (parsed && Array.isArray(parsed.geometryArr)) {
-            return parsed.geometryArr
-                .map((item) => toRegionPayload(String(item || "").trim()))
-                .filter(Boolean);
-        }
-    } catch (_) {
-        // 非 JSON 透传时,按单条 WKT 处理
-    }
-
-    if (typeof rangeWkt === "string" && rangeWkt.trim().length > 10) {
-        const region = toRegionPayload(rangeWkt.trim());
-        return region ? [region] : [];
-    }
-    return [];
-};
-
-const renderRegionsFromRouteRangeWkt = (rangeWkt) => {
-    const regions = buildRegionsFromRouteRangeWkt(rangeWkt);
-    if (!regions.length) return;
-    drawRegionMap.setStatusRegions(regions);
-    fitAllRegionsWhenViewOnly();
-};
-
-const restoreEditablePolygonFromRoute = (polygonData) => {
-    if (viewOnly.value || !polygonData) return;
-    drawRegionMap.setAreaGeometry(
-        JSON.parse(polygonData)?.geometryArr,
-        false,
-        undefined,
-        undefined,
-        getAbnormalGrowthOverlayMeta()
-    );
-};
-
-const updateMapCenterForEditMode = (point) => {
-    // 查看模式通常会通过 fitAllRegions 自适应,不主动重置中心,避免打断用户缩放视角
-    if (viewOnly.value) return;
-    drawRegionMap.setMapPosition(convertPointToArray(point));
-};
-
-/**
- * 页面从 keep-alive 恢复时,如果查看态和编辑态发生切换,需要重建地图实例。
- * 仅在状态不一致时重建,避免每次激活都销毁重建带来的闪烁和性能开销。
- */
-const syncMapEditableState = (point) => {
-    if (!drawRegionMap.kmap) return;
-    const shouldEditable = !viewOnly.value;
-    if (drawRegionMap.editable === shouldEditable) return;
-    drawRegionMap.destroyMap();
-    drawRegionMap.initMap(point, mapContainer.value, shouldEditable, true, shouldEditable);
-};
-
-async function fetchRegionInfo() {
-    const subjectId = route.query.subjectId || localStorage.getItem('selectedFarmId');
-    const { data } = await VE_API.basic_farm.fetchRegionInfo({ subjectId });
-    if (data && data.length > 0) {
-        regionInfo.value = data[0] || [];
-        regionTypeTabs.value = regionInfo.value.problemZoneList || [];
-        regionTypeTabs.value.unshift({ name: "品种区", code: "variety" });
-        varietyTabs.value = regionInfo.value.regionList || [];
-        activeVariety.value = 0;
-
-        if (route.query.firstAct) {
-            activeRegionType.value = route.query.firstAct;
-            if (route.query.firstAct === "variety") {
-                varietyTabs.value = regionInfo.value.regionList || [];
-                const index = Number(route.query.secondAct);
-                activeVariety.value = Number.isInteger(index) && index >= 0 ? index : 0;
-                return;
-            }
-            const matchedGroup = (regionInfo.value.problemZoneList || []).find(
-                (item) => String(item?.code) === String(route.query.firstAct)
-            );
-            if (matchedGroup) {
-                varietyTabs.value = matchedGroup.children || [];
-                const index = Number(route.query.secondAct);
-                activeVariety.value = Number.isInteger(index) && index >= 0 ? index : 0;
-            }
-        }
-        if (activeVariety.value >= varietyTabs.value.length) {
-            activeVariety.value = 0;
-        }
-    }
-}
-
-const varietyTabs = ref([]);
-const activeVariety = ref(0);
-
-/** 样式用的大类:与接口 tab.code 解耦(避免 ABNORMAL / 数字 code 等导致勾画色落到默认灰) */
-const getCanonicalRegionTypeForStyles = () => {
-    const raw = activeRegionType.value;
-    if (raw === "variety") return "variety";
-    const tabs = regionTypeTabs.value || [];
-    const item = tabs.find((t) => String(t?.code) === String(raw));
-    if (item) {
-        const kind = item.code;
-        if (kind) return kind;
-    }
-    return "SLEEP";
-};
-
-const ABNORMAL_BADGE_BG_DISEASE_PEST = "#E32A28";
-const ABNORMAL_BADGE_BG_GROWTH = "#F76F00";
-
-/** 异常区小类(长势/病害/虫害等)闭合地块后在多边形内展示标签与发现日期 */
-const getAbnormalGrowthOverlayMeta = () => {
-    if (getCanonicalRegionTypeForStyles() !== "ABNORMAL") return null;
-    const tab = varietyTabs.value?.[activeVariety.value];
-    if (!tab) return null;
-    const name = (tab.problemZoneTypeName || tab.regionName || "").toString();
-    let badgeText = "";
-    let badgeBackground = ABNORMAL_BADGE_BG_GROWTH;
-    if (name.includes("病害")) {
-        badgeText = "新增病害";
-        badgeBackground = ABNORMAL_BADGE_BG_DISEASE_PEST;
-    } else if (name.includes("虫害")) {
-        badgeText = "新增虫害";
-        badgeBackground = ABNORMAL_BADGE_BG_DISEASE_PEST;
-    } else if (name.includes("过慢")) {
-        badgeText = "新增长势过慢";
-    } else if (name.includes("过快")) {
-        badgeText = "新增长势过快";
-    } else {
-        return null;
-    }
-    const now = new Date();
-    const y = now.getFullYear();
-    const m = String(now.getMonth() + 1).padStart(2, "0");
-    const d = String(now.getDate()).padStart(2, "0");
-    return { badgeText, discoveryDate: `${y}.${m}.${d}`, badgeBackground };
-};
-
-const createPolygonStyleFunc = (fillColor, strokeColor) => {
-    return (feature) => {
-        const styles = [];
-        const coord = feature.getGeometry().getCoordinates()[0];
-        for (let i = 0; i < coord[0].length - 1; i++) {
-            if (i % 2) {
-                styles.push(
-                    new Style({
-                        geometry: new Point(coord[0][i]),
-                        image: new Circle({
-                            radius: 4,
-                            fill: new Fill({
-                                color: strokeColor,
-                            }),
-                            stroke: new Stroke({
-                                color: "#fff",
-                                width: 1,
-                            }),
-                        }),
-                    })
-                );
-            } else {
-                styles.push(
-                    new Style({
-                        geometry: new Point(coord[0][i]),
-                        image: new Circle({
-                            radius: 6,
-                            fill: new Fill({
-                                color: "#fff",
-                            }),
-                        }),
-                    })
-                );
-            }
-        }
-        const fillStyle = new Style({
-            fill: new Fill({
-                color: fillColor,
-            }),
-            stroke: new Stroke({
-                color: strokeColor,
-                width: 2,
-            }),
-        });
-        let geom = feature.getGeometry().clone();
-        geom.transform(proj.get("EPSG:4326"), proj.get("EPSG:38572"));
-        let area = getArea(geom);
-        area = (area + area / 2) / 1000;
-        const growth = getAbnormalGrowthOverlayMeta();
-        if (growth) {
-            styles.push(
-                new Style({
-                    text: new Text({
-                        text: growth.badgeText,
-                        font: "bold 13px sans-serif",
-                        fill: new Fill({ color: "#ffffff" }),
-                        backgroundFill: new Fill({ color: growth.badgeBackground || ABNORMAL_BADGE_BG_GROWTH }),
-                        padding: [4, 10, 4, 10],
-                        offsetY: -40,
-                    }),
-                }),
-                new Style({
-                    text: new Text({
-                        text: `发现时间:${growth.discoveryDate}`,
-                        font: "12px sans-serif",
-                        fill: new Fill({ color: "#ffffff" }),
-                        offsetY: -16,
-                    }),
-                })
-            );
-        }
-        const areaValStyle = new Style({
-            text: new Text({
-                font: "16px sans-serif",
-                text: area.toFixed(2) + "亩",
-                fill: new Fill({ color: "#fff" }),
-                offsetY: growth ? 14 : 0,
-            }),
-        });
-        styles.push(fillStyle, areaValStyle);
-        return styles;
-    };
-};
-
-const applyRegionStyles = () => {
-    const kmap = drawRegionMap.kmap;
-    if (!kmap) return;
-
-    let lineColor = "#2199F8";
-    let vertexColor = "#2199F8";
-    let fillColor = [0, 0, 0, 0.5];
-    let strokeColor = "#2199F8";
-
-    const styleKind = getCanonicalRegionTypeForStyles();
-    if (styleKind === "variety") {
-        lineColor = "#18AA8B";
-        vertexColor = "#18AA8B";
-        fillColor = [0, 57, 44, 0.5];
-        strokeColor = "#18AA8B";
-    } else if (styleKind === "ABNORMAL") {
-        if (activeVariety.value < 2) {
-            lineColor = "#E03131";
-            vertexColor = "#E03131";
-            fillColor = [100, 0, 0, 0.5];
-            strokeColor = "#E03131";
-        } else {
-            lineColor = "#FF7300";
-            vertexColor = "#FF7300";
-            fillColor = [124, 46, 0, 0.5];
-            strokeColor = "#FF7300";
-        }
-    } else if (styleKind === "ENVIRONMENT") {
-        lineColor = "#FDCF7F";
-        vertexColor = "#FDCF7F";
-        fillColor = [151, 96, 0, 0.5];
-        strokeColor = "#FDCF7F";
-    } else {
-        lineColor = "#A6A6A6";
-        vertexColor = "#A6A6A6";
-        fillColor = [166, 166, 166, 0.25];
-        strokeColor = "#A6A6A6";
-    }
-
-    KMapMap.drawStyleColors = {
-        line: lineColor,
-        vertex: vertexColor,
-        fill: fillColor,
-        stroke: strokeColor,
-    };
-
-    kmap.polygonStyle = createPolygonStyleFunc(fillColor, strokeColor);
-    if (kmap.polygonLayer?.layer && typeof kmap.polygonLayer.layer.setStyle === "function") {
-        kmap.polygonLayer.layer.setStyle(kmap.polygonStyle);
-    }
-};
-
-onDeactivated(() => {
-    drawRegionMap.clearLayer()
-})
-const goBack = () => {
-    // drawRegionMap.clearLayer()
-    router.back()
-};
-
-const deletePolygon = () => {
-    ElMessageBox.confirm(
-        '确认要删除当前地块吗?删除后可以重新勾画。',
-        '删除确认',
-        {
-            confirmButtonText: '确认删除',
-            cancelButtonText: '取消',
-            type: 'warning',
-        }
-    ).then(() => {
-        drawRegionMap.abortOngoingDrawSketch();
-        if (drawRegionMap.kmap && drawRegionMap.kmap.polygonLayer && drawRegionMap.kmap.polygonLayer.source) {
-            drawRegionMap.kmap.polygonLayer.source.clear();
-        }
-        ElMessage.success({ message: t('地块已删除'), type: 'success' });
-    }).catch(() => {
-        // 用户取消删除,不做任何操作
-    });
-};
-
-const saveAndBack = () => {
-    const polygonData = drawRegionMap.getAreaGeometry();
-    const subjectId = route.query.subjectId || localStorage.getItem("selectedFarmId") || "";
-    const geometryArr = Array.isArray(polygonData?.geometryArr)
-        ? polygonData.geometryArr
-            .map((g) => (g == null ? "" : String(g).trim()))
-            .filter((g) => g.length > 10)
-        : [];
-    const geom = geometryArr[0] || "";
-
-    const currentGroup = (regionTypeTabs.value || []).find(
-        (item) => String(item?.code) === String(activeRegionType.value)
-    );
-    const currentTab = (varietyTabs.value || [])[activeVariety.value] || {};
-
-    const regionList =
-        activeRegionType.value === "variety" && geom
-            ? [
-                {
-                    regionId: currentTab.regionId ?? currentTab.id ?? "",
-                    typeId: currentTab.typeId ?? "",
-                    regionName: currentTab.regionName ?? currentTab.problemZoneTypeName ?? "",
-                    geom,
-                },
-            ]
-            : [];
-
-    const problemZoneList =
-        activeRegionType.value !== "variety" && geom
-            ? [
-                {
-                    name: currentGroup?.name ?? "",
-                    code: currentGroup?.code ?? activeRegionType.value,
-                    children: [
-                        {
-                            farmSubjectId: subjectId,
-                            handleStatus: 1,
-                            createTime: new Date().toISOString(),
-                            problemZoneTypeId: currentTab.problemZoneTypeId ?? currentTab.typeId ?? "",
-                            problemZoneTypeName: currentTab.problemZoneTypeName ?? currentTab.regionName ?? "",
-                            parentName: currentGroup?.name ?? "",
-                            parentCode: currentGroup?.code ?? activeRegionType.value,
-                            geomItems: [{ geomWkt: geom, remark: "" }],
-                        },
-                    ],
-                },
-            ]
-            : [];
-
-    const params = {
-        subjectId,
-        regionList,
-        problemZoneList,
-    };
-
-    sessionStorage.setItem("drawRegionPolygonData", JSON.stringify(polygonData));
-    sessionStorage.setItem("drawRegionSubmitParams", JSON.stringify(params));
-    if (selectedAbnormalType.value) {
-        sessionStorage.setItem("drawRegionAbnormalType", selectedAbnormalType.value);
-    } else {
-        sessionStorage.removeItem("drawRegionAbnormalType");
-    }
-    router.back();
-};
-
-const handleConfirmUpload = () => {
-    if (!selectedAbnormalType.value) {
-        ElMessage.warning({ message: t('请选择异常类型'), type: 'warning' });
-        return;
-    }
-    showAbnormalTypePopup.value = false;
-    saveAndBack();
-};
-
-const confirm = () => {
-    if (getCanonicalRegionTypeForStyles() === "ABNORMAL") {
-        showAbnormalTypePopup.value = true;
-        return;
-    }
-    saveAndBack();
-};
-</script>
-
-<style lang="scss" scoped>
-.edit-map {
-    width: 100%;
-    height: 100vh;
-    overflow: hidden;
-
-    .region-type-tabs {
-        display: flex;
-        align-items: center;
-        background: #f4f4f4;
-        margin: 10px 10px 0;
-        padding: 3px;
-        border-radius: 4px;
-        box-sizing: border-box;
-
-        .region-type-tab {
-            flex: 1;
-            text-align: center;
-            padding: 5px 0;
-            color: #767676;
-        }
-
-        .region-type-tab--active {
-            background: #ffffff;
-            border-radius: 4px;
-            color: #0D0D0D;
-        }
-    }
-
-    .variety-tabs {
-        display: flex;
-        align-items: center;
-        gap: 8px;
-        padding: 10px 12px 0;
-        overflow-x: auto;
-        overflow-y: hidden;
-        flex-wrap: nowrap;
-        -webkit-overflow-scrolling: touch;
-
-        .variety-tab {
-            padding: 4px 12px;
-            border-radius: 2px;
-            color: #575757;
-            background: #F4F4F4;
-            border: 1px solid transparent;
-            white-space: nowrap;
-        }
-
-        .variety-tab--active {
-            background: rgba(33, 153, 248, 0.1);
-            color: #2199F8;
-            border: 1px solid #2199F8;
-        }
-    }
-
-    .edit-map-content {
-        width: 100%;
-        height: calc(100% - 96px);
-        margin-top: 10px;
-        position: relative;
-
-        .edit-map-tip {
-            position: absolute;
-            top: 23px;
-            left: calc(50% - 256px / 2);
-            z-index: 1;
-            font-size: 12px;
-            color: #fff;
-            padding: 9px 20px;
-            background: rgba(0, 0, 0, 0.5);
-            border-radius: 20px;
-        }
-
-        .map-container {
-            width: 100%;
-            height: 100%;
-        }
-
-        .edit-map-footer {
-            position: absolute;
-            bottom: 85px;
-            left: 12px;
-            width: calc(100% - 24px);
-            display: flex;
-            flex-direction: column;
-            align-items: flex-end;
-
-            .footer-back {
-                padding: 6px 7px 9px;
-                background: #fff;
-                border-radius: 8px;
-                margin-bottom: 30px;
-
-                .back-icon {
-                    width: 20px;
-                    height: 18px;
-                }
-            }
-
-            .edit-map-footer-btn {
-                display: flex;
-                justify-content: center;
-                align-items: center;
-                width: 100%;
-                gap: 8px;
-
-                div {
-                    flex: 1;
-                    max-width: 100px;
-                    text-align: center;
-                    color: #666666;
-                    font-size: 14px;
-                    padding: 8px 0;
-                    border-radius: 25px;
-                    background: #fff;
-                }
-
-                .btn-delete {
-                    background: #ff4d4f;
-                    color: #fff;
-                }
-
-                .btn-confirm {
-                    background: #000;
-                    background-image: linear-gradient(180deg, #76c3ff 0%, #2199f8 100%);
-                    color: #fff;
-                }
-            }
-        }
-    }
-}
-
-.abnormal-popup {
-    width: 100%;
-
-    ::v-deep {
-        .van-popup__close-icon {
-            color: #000;
-        }
-    }
-
-    .abnormal-popup-content {
-        background: linear-gradient(180deg, #d9ecff 0%, #ffffff 60%);
-        border-radius: 18px;
-        padding: 24px 16px;
-        box-sizing: border-box;
-        position: relative;
-
-        .abnormal-popup-title {
-            font-size: 16px;
-            margin-bottom: 12px;
-        }
-
-        .abnormal-type-select {
-            width: 100%;
-        }
-
-        .abnormal-popup-confirm {
-            margin-top: 24px;
-            border-radius: 25px;
-            padding: 8px;
-            background: #2199F8;
-            color: #fff;
-            font-size: 16px;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-        }
-    }
-}
-</style>

+ 0 - 233
src/views/old_mini/interactionList/drawRegion1.vue

@@ -1,233 +0,0 @@
-<template>
-    <div class="edit-map">
-        <custom-header :name="viewOnly ? '查看区域' : '勾画区域'"></custom-header>
-        <div class="edit-map-content">
-            <div class="edit-map-tip" v-if="!viewOnly">{{ t('操作提示:拖动圆点,即可调整地块边界') }}</div>
-            <div class="map-container" ref="mapContainer"></div>
-            <div class="edit-map-footer">
-                <div class="footer-back" @click="goBack">
-                    <img class="back-icon" src="@/assets/img/home/go-back.png" alt="" />
-                </div>
-                <div class="edit-map-footer-btn" v-if="!viewOnly">
-                    <div class="btn-delete" @click="deletePolygon">{{ t('删除地块') }}</div>
-                    <div class="btn-cancel" @click="goBack">{{ t('取消') }}</div>
-                    <div class="btn-confirm" @click="confirm">{{ t('确认') }}</div>
-                </div>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import customHeader from "@/components/customHeader.vue";
-import { ref, computed, onMounted, onActivated, onDeactivated } from "vue";
-import DrawRegionMap from "./map/drawRegionMap.js";
-import { useRouter, useRoute } from "vue-router";
-import { convertPointToArray } from "@/utils/index";
-import { ElMessage, ElMessageBox } from "element-plus";
-
-const router = useRouter();
-const route = useRoute();
-const mapContainer = ref(null);
-const drawRegionMap = new DrawRegionMap();
-
-const type = ref(null);
-const viewOnly = computed(() => route.query.viewOnly === "1" || route.query.viewOnly === "true");
-
-onMounted(() => {
-    type.value = route.query.type;
-    const point = route.query.mapCenter || "POINT (113.6142086995688 23.585836479509055)";
-    const editable = !viewOnly.value;
-    const showPoint = !viewOnly.value;
-    drawRegionMap.initMap(point, mapContainer.value, editable, true, showPoint);
-
-    // 地图初始化之后(比如 initPreviewMap 里)
-    // const regions = [
-    //     {
-    //         geometry:
-    //             "MULTIPOLYGON(((113.61674040430906 23.586573370597367,113.61586610436014 23.585922976493354,113.61710291900188 23.58486741952544,113.61770000158238 23.585651090473736,113.61674040430906 23.586573370597367)))",
-    //         status: "unresolved", // 未解决(蓝色)
-    //     },
-    //     {
-    //         geometry:
-    //             "MULTIPOLYGON(((113.61516640298626 23.588441931082958,113.61445736699218 23.58799411906573,113.61572616841707 23.586954554834552,113.61642987338976 23.588180707433526,113.61516640298626 23.588441931082958)))",
-    //         status: "resolved", // 已解决(灰色)
-    //     },
-    // ];
-
-    // drawRegionMap.setStatusRegions(regions);
-});
-
-onActivated(() => {
-    const point = route.query.mapCenter || "POINT (113.6142086995688 23.585836479509055)";
-
-    // 从编辑态进入仅查看时,需重新初始化为不可编辑
-    if (viewOnly.value && drawRegionMap.kmap && drawRegionMap.editable) {
-        drawRegionMap.destroyMap();
-        drawRegionMap.initMap(point, mapContainer.value, false, true, false);
-    }
-
-    // 从仅查看进入勾画(编辑)时,需重新初始化为可编辑
-    if (!viewOnly.value && drawRegionMap.kmap && !drawRegionMap.editable) {
-        drawRegionMap.destroyMap();
-        drawRegionMap.initMap(point, mapContainer.value, true, true, true);
-    }
-
-    // 先绘制地块
-    const polygonData = route.query.polygonData;
-    const rawRangeWkt = route.query.rangeWkt;
-    const rangeWkt = rawRangeWkt ? decodeURIComponent(rawRangeWkt) : null;
-
-    if (rangeWkt) {
-        let regions = [];
-        try {
-            const parsed = JSON.parse(rangeWkt);
-            if (parsed && Array.isArray(parsed.geometryArr)) {
-                regions = parsed.geometryArr.map((item) => ({
-                    geometry: item,
-                    status: "unresolved",
-                    reproductiveName: route.query.reproductiveName,
-                    updatedTime: route.query.updatedTime,
-                }));
-            } else if (typeof rangeWkt === "string" && rangeWkt.trim().length > 10) {
-                regions = [{ geometry: rangeWkt.trim(), status: "unresolved", reproductiveName: route.query.reproductiveName, updatedTime: route.query.updatedTime }];
-            }
-        } catch (_) {
-            if (typeof rangeWkt === "string" && rangeWkt.trim().length > 10) {
-                regions = [{ geometry: rangeWkt.trim(), status: "unresolved", reproductiveName: route.query.reproductiveName, updatedTime: route.query.updatedTime }];
-            }
-        }
-        if (regions.length) {
-            drawRegionMap.setStatusRegions(regions);
-            if (viewOnly.value && drawRegionMap.fitAllRegions) {
-                drawRegionMap.fitAllRegions();
-            }
-        }
-    }
-    if (!viewOnly.value && polygonData) {
-        drawRegionMap.setAreaGeometry(JSON.parse(polygonData)?.geometryArr);
-    }
-
-    // 查看模式下已通过 fitAllRegions 适配;编辑模式再设置地图中心
-    if (!viewOnly.value) {
-        drawRegionMap.setMapPosition(convertPointToArray(point));
-    }
-});
-
-onDeactivated(() => {
-    drawRegionMap.clearLayer()
-})
-const goBack = () => {
-    // drawRegionMap.clearLayer()
-    router.back()
-};
-
-const deletePolygon = () => {
-    ElMessageBox.confirm(
-        '确认要删除当前地块吗?删除后可以重新勾画。',
-        '删除确认',
-        {
-            confirmButtonText: '确认删除',
-            cancelButtonText: '取消',
-            type: 'warning',
-        }
-    ).then(() => {
-        drawRegionMap.deleteCurrentPolygon();
-        ElMessage.success({ message: t('地块已删除'), type: 'success' });
-        sessionStorage.removeItem("drawRegionPolygonData");
-    }).catch(() => {
-        // 用户取消删除,不做任何操作
-    });
-};
-
-const confirm = () => {
-    const polygonData = drawRegionMap.getAreaGeometry();
-    sessionStorage.setItem("drawRegionPolygonData", JSON.stringify(polygonData));
-    router.back();
-};
-</script>
-
-<style lang="scss" scoped>
-.edit-map {
-    width: 100%;
-    height: 100vh;
-    overflow: hidden;
-
-    .edit-map-content {
-        width: 100%;
-        height: 100%;
-        position: relative;
-
-        .edit-map-tip {
-            position: absolute;
-            top: 23px;
-            left: calc(50% - 256px / 2);
-            z-index: 1;
-            font-size: 12px;
-            color: #fff;
-            padding: 9px 20px;
-            background: rgba(0, 0, 0, 0.5);
-            border-radius: 20px;
-        }
-
-        .map-container {
-            width: 100%;
-            height: 100%;
-        }
-
-        .edit-map-footer {
-            position: absolute;
-            bottom: 80px;
-            left: 12px;
-            width: calc(100% - 24px);
-            display: flex;
-            flex-direction: column;
-            align-items: flex-end;
-
-            .footer-back {
-                padding: 6px 7px 9px;
-                background: #fff;
-                border-radius: 8px;
-                margin-bottom: 12px;
-
-                .back-icon {
-                    width: 20px;
-                    height: 18px;
-                }
-            }
-
-            .edit-map-footer-btn {
-                display: flex;
-                justify-content: center;
-                align-items: center;
-                width: 100%;
-                gap: 8px;
-
-                div {
-                    flex: 1;
-                    max-width: 100px;
-                    text-align: center;
-                    color: #666666;
-                    font-size: 14px;
-                    padding: 8px 0;
-                    border-radius: 25px;
-                    background: #fff;
-                }
-
-                .btn-delete {
-                    background: #ff4d4f;
-                    color: #fff;
-                }
-
-                .btn-confirm {
-                    background: #000;
-                    background-image: linear-gradient(180deg, #76c3ff 0%, #2199f8 100%);
-                    color: #fff;
-                }
-            }
-        }
-    }
-}
-</style>

+ 0 - 1466
src/views/old_mini/interactionList/index.vue

@@ -1,1466 +0,0 @@
-<template>
-    <custom-header v-if="!showClose" :name="$t('农情互动')" bgColor="#f2f4f5"></custom-header>
-    <div class="interaction-list-wrapper" :class="{ 'show-close': showClose }">
-        <div class="interaction-card" v-if="showClose">
-            <img v-if="listData[0]?.coverUrl" :src="listData[0]?.coverUrl" alt="">
-            <div class="card-content">
-                <div class="card-title">互动主题:{{ listData[0]?.subjectName }}</div>
-                <div class="card-desc" v-if="listData[0]?.subjectRemark && listData[0]?.subjectRemark !== ''">{{ listData[0].subjectRemark }}</div>
-            </div>
-        </div>
-        <div class="interaction-list" ref="interactionListRef">
-            <!-- <div class="tips-text">{{ $t('由于系统审核,您照片拍摄位置与农场相差超 3 公里,请在农场现场使用水印相机重新拍摄上传,谢谢配合') }}</div> -->
-            <div class="list-item" v-for="(item, index) in listData" :key="item.id || index"
-                :class="{ 'uploaded-item': item.questionStatus !== 3 }">
-                <!-- 标题区域 -->
-                <div class="item-header-wrapper" :class="{ 'has-status': item.questionStatus !== 3 }">
-                    <div class="item-header">
-                        <div class="header-wrapper">
-                            <div class="title title-block">{{ item.varietyName }}</div>
-                            <div class="title title-block">{{ item.interactionThemeText }}</div>
-                        </div>
-                        <div class="status title-block" :class="['urgent-' + item.urgent]" v-if="item.questionStatus === 3">
-                            {{
-                                urgentType[item.urgent] }}</div>
-                        <!-- <div class="location-error">
-                            <el-icon size="16"><InfoFilled /></el-icon>
-                            <span>{{ $t('提交有误') }}</span>
-                        </div> -->
-                    </div>
-                    <div class="upload-status" v-show="item.questionStatus !== 3">
-                        <el-icon class="status-icon">
-                            <SuccessFilled />
-                        </el-icon>
-                        <span class="status-text">{{ $t('提交成功') }}</span>
-                    </div>
-                </div>
-
-                <!-- 未上传状态内容 -->
-                <div class="uploaded-content" v-show="item.questionStatus === 3 || item.expanded">
-                    <div class="content-wrapper">
-                        <span>{{ item.reason }}</span>
-                        <text-ellipsis class="item-desc" rows="0" :content="item.remark" expand-:text="$t('展开')"
-                            collapse-:text="$t('收起')" />
-                        <div class="tip-box">{{ $t('如果不确定是否发生,直接上传照片即可') }}</div>
-                        <div class="example-wrapper">
-                            <div class="example-header">
-                                <div>{{ $t('示例照片') }}</div>
-                                <div class="more" v-if="item.exampleImageWithAnnotations.length > 3"
-                                    @click="openMorePopup(item)">{{ $t('查看更多') }}</div>
-                            </div>
-                            <div class="example-list" v-if="item.exampleImageWithAnnotations.length > 0">
-                                <div class="image-item-wrapper"
-                                    v-for="(example, exIndex) in item.exampleImageWithAnnotations"
-                                    :key="example.exampleImageUrl" @click="showExample(item, exIndex)">
-                                    <img class="image-item" :src="example.exampleImageUrl" alt="" />
-                                </div>
-                            </div>
-                        </div>
-                        <text-ellipsis class="patrol-suggestion" rows="2" :content="'巡园建议:' + item.patrolSuggestion">
-                            <template #action="{ expanded }"><span class="action-text">{{ expanded ? '收起' : '展开'
-                                    }}</span></template>
-                        </text-ellipsis>
-                    </div>
-
-                    <!-- 展开状态内容 -->
-                    <div class="expanded-content" v-show="item.imagePaths.length > 0">
-                        <!-- 原因说明 -->
-                        <div class="reason-text">上传照片({{ item.imagePaths.length }}张)</div>
-                        <!-- 图片展示 -->
-                        <div class="uploaded-images">
-                            <!-- <div class="uploaded-img-wrap" v-for="(image, imgIndex) in item.imagePaths" :key="image"
-                                @click="showExample(item, imgIndex, { hideLabel: true })">
-                                <img class="uploaded-img" :src="base_img_url2 + image" alt="" />
-                                <span v-show="item.questionStatus === 3" class="uploaded-img-remove"
-                                    @click.stop="removeUploadedImage(item, imgIndex)">×</span>
-                            </div> -->
-
-                            <photo-provider :photo-closable="true">
-                                <photo-consumer v-for="(image, imgIndex) in item.imagePaths" :key="imgIndex" :src="base_img_url2 + image">
-                                <div class="uploaded-img-wrap">
-                                    <img :src="base_img_url2 + image" class="uploaded-img">
-                                    <span v-show="item.questionStatus === 3" class="uploaded-img-remove"
-                                        @click.stop="removeUploadedImage(item, imgIndex)">×</span>
-                                </div>
-                                </photo-consumer>
-                            </photo-provider>
-                        </div>
-                        <uploader v-show="item.questionStatus === 3" class="upload-wrap continue-upload-btn"
-                            @click="handleUploadClick(item)" multiple :max-count="10" :after-read="afterReadUpload">
-                            <div class="upload-btn">
-                                <el-icon>
-                                    <Plus />
-                                </el-icon>
-                                <span>{{ $t('继续上传照片') }}</span>
-                            </div>
-                        </uploader>
-                    </div>
-
-                    <!-- 上传按钮 -->
-                    <uploader v-if="item.imagePaths.length === 0 && item.questionStatus === 3"
-                        @click="handleUploadClick(item)" :before-read="beforeReadUpload" class="upload-wrap" multiple :max-count="10"
-                        :after-read="afterReadUpload">
-                        <div class="upload-btn">
-                            <el-icon>
-                                <Plus />
-                            </el-icon>
-                            <span>{{ $t('点击上传照片') }}</span>
-                        </div>
-                    </uploader>
-
-                    <div class="question-wrapper" v-if="item.imagePaths.length">
-                        <div class="question-cont">
-                            <div class="question-text"
-                                v-for="(q, qIdx) in (item.questionList || [item.question].filter(Boolean))" :key="qIdx">
-                                <span class="text-title">{{ q }}</span>
-                                <el-input v-model="item.answerValues[qIdx]" :disabled="item.questionStatus !== 3"
-                                    type="number" style="width: 70px">
-                                    <template #suffix>
-                                        <span class="text-unit">{{ item.indicators[qIdx]?.unit ?? item.indicators[0]?.unit
-                                            ?? '%' }}</span>
-                                    </template>
-                                </el-input>
-                            </div>
-                        </div>
-                        <div class="draw-region-btn" v-if="item.interactionTypeId != 1 && item.questionStatus === 3"
-                            @click="handleDrawRegion(item)">
-                            编辑发生区域</div>
-                        <div class="draw-region-btn" v-if="item.rangeWkt && item.questionStatus !== 3"
-                            @click="handleViewRegion(item)">
-                            查看发生区域</div>
-
-                        </div>
-
-                    <!-- 输入框 -->
-                    <div class="input-wrapper" v-if="item.questionStatus === 3 || item.replyText">
-                        <el-input v-model="item.replyText" :disabled="item.questionStatus !== 3" :placeholder="$t('请输入您咨询的问题')"
-                            clearable />
-                    </div>
-
-                    <div class="cancel-text" v-if="item.isConfirmed && item.questionStatus === 2">{{ item.cancelButtonName }}</div>
-
-                    <!-- 按钮区域 -->
-                    <div class="button-group" v-show="item.questionStatus === 3">
-                        <div
-                            class="btn-not-reached"
-                            :class="{ 'btn-loading': isItemSubmittingCancel(item) }"
-                            @click="handleConfirm(item, false)"
-                        >
-                            {{ isItemSubmittingCancel(item) ? '提交中...' : item.cancelButtonName }}
-                        </div>
-                        <div
-                            class="btn-default"
-                            :class="{
-                                'btn-confirm': item.imagePaths.length > 0,
-                                'btn-loading': isItemSubmittingConfirm(item),
-                            }"
-                            @click="handleConfirm(item, true)"
-                        >
-                            {{ isItemSubmittingConfirm(item) ? '提交中...' : '确认提交' }}
-                        </div>
-                    </div>
-
-                    <div class="invite-btn" v-if="item.imagePaths.length === 0 && item.questionStatus === 3 && !showClose"
-                        @click="handleInvite(item)">
-                        邀请农情互动</div>
-                </div>
-
-                <!-- 比例信息(已上传状态显示) -->
-                <div class="proportion-info" v-show="item.questionStatus !== 3"
-                    :style="{ justifyContent: item.expanded ? 'center' : 'space-between' }">
-                    <template v-if="!item.expanded">
-                        <template v-if="!item.isConfirmed && item.questionStatus === 2">
-                            <span class="proportion-text">{{(item.questionList && item.questionList.length
-                                ? item.questionList.map((q, i) => q + ':' + (item.answerValues[i] ?? '') +
-                                    (item.indicators[i]?.unit
-                                        ?? item.indicators[0]?.unit ?? '%')).join('')
-                                : item.question + ':' + (item.answerValues[0] ?? '') + (item.indicators[0]?.unit ?? '%'))
-                            }}</span>
-                        </template>
-                        <template v-else>
-                            <span class="proportion-text">{{ item.cancelButtonName }}</span>
-                        </template>
-                    </template>
-                    <div class="toggle-btn" @click="toggleExpand(item)">
-                        <span>{{ item.expanded ? "收起" : "展开" }}</span>
-                        <el-icon :class="{ rotate: !item.expanded }">
-                            <CaretTop />
-                        </el-icon>
-                    </div>
-                </div>
-            </div>
-            <div class="empty-data" v-if="!loading && listData.length === 0">{{ $t('暂无数据') }}</div>
-        </div>
-    </div>
-
-    <!-- <div class="custom-bottom-fixed-btns" :class="{ 'center-btn': false }">
-        <div class="bottom-btn secondary-btn" @click="handleShowDroneConsultPopup">{{ $t('获取自动飞行航线') }}</div>
-        <div class="bottom-btn secondary-btn">{{ $t('邀请农情互动') }}</div>
-        <div class="bottom-btn primary-btn" @click="handleSubmitAll">{{ $t('一键提交') }}</div>
-    </div> -->
-
-    <!-- 农场信息完善弹窗 -->
-    <farm-info-popup :oldUser="oldUser" :expertMiniUserId="route.query.expertMiniUserId" v-model:show="showFarmInfoPopup" />
-    <!-- 无人机/飞行航线咨询弹窗 -->
-    <drone-consult-popup v-model:show="showDroneConsultPopup" @copy="onCopyWechatId" />
-
-    <!-- 示例照片轮播组件 -->
-    <example-popup v-model:show="showExamplePopup" :images="exampleList" :tips="currentPhotData?.shootingMethod"
-        :start-index="exampleStartIndex" :show-title-and-tips="exampleShowTitleAndTips" />
-    <!-- 照片上传进度 -->
-
-    <popup v-model:show="showUploadProgressPopup" round :close-on-click-overlay="false" class="upload-progress-popup">
-        <div class="upload-progress-title">
-            <span>{{ $t('照片上传进度') }}</span>
-            <el-progress class="upload-progress" :percentage="uploadPercentage" :stroke-width="10" :format="format" />
-        </div>
-        <div
-            class="upload-box"
-            v-loading="popupImageUploadLoading"
-            element-loading-:text="$t('上传中...')"
-        >
-            <!-- 把已经上传成功的图片传给 upload 组件做回显,同时保持原有上传事件不变 -->
-            <upload ref="uploadRef" :maxCount="10" :initImgArr="initImgArr" @handleUpload="handleUploadSuccess">
-            </upload>
-        </div>
-        <div class="input-box">
-            <div class="input-item"
-                v-for="(q, qIdx) in (currentItem?.questionList?.length ? currentItem.questionList : (currentItem?.question ? [currentItem.question] : []))"
-                :key="qIdx">
-                <span class="label-text">{{ q }}</span>
-                <el-input class="label-input" v-model="currentItem.answerValues[qIdx]" :placeholder="$t('请输入')" type="number">
-                    <template #suffix>
-                        <span class="unit">{{ currentItem.indicators[qIdx]?.unit ?? currentItem.indicators[0]?.unit ??
-                            '%' }}</span>
-                    </template>
-                </el-input>
-            </div>
-            <el-input class="input-item" v-model="currentItem.replyText" :placeholder="$t('请输入您咨询的问题')" clearable />
-        </div>
-        <template v-if="currentItem.interactionTypeId != 1">
-            <div class="region-tips">{{ $t('勾画异常发生区域,精准匹配专属农事方案') }}</div>
-            <div class="region-map" ref="mapContainer" @click="handleDrawRegion(currentItem)">
-                <div class="region-map-text">{{ $t('点击勾画异常发生区域') }}</div>
-            </div>
-        </template>
-        <div class="upload-action-btns">
-            <div class="cancel-btn" @click="handleCancelUploadPopup">{{ $t('取消') }}</div>
-            <div class="confirm-btn" :class="{ 'confirm-btn-loading': confirmUploadLoading }" @click="handleConfirmUpload">
-                {{ confirmUploadLoading ? '上传中...' : '确认上传' }}
-            </div>
-        </div>
-    </popup>
-
-    <!-- 查看更多弹窗 -->
-    <more-popup ref="morePopupRef" />
-
-    <upload-tips v-model:show="showUploadTipsPopup" />
-</template>
-<script setup>
-import { ref, onActivated, computed, onUnmounted } from "vue";
-import { ElMessage } from "element-plus";
-import { Uploader, Popup, TextEllipsis } from "vant";
-import customHeader from "@/components/customHeader.vue";
-import upload from "@/components/upload.vue";
-import FarmInfoPopup from "@/components/popup/farmInfoPopup.vue";
-import DroneConsultPopup from "@/components/popup/droneConsultPopup.vue";
-import ExamplePopup from "./components/examplePopup.vue";
-import { useRouter, useRoute } from "vue-router";
-import { base_img_url2 } from "@/api/config";
-import DrawRegionMap from "./map/drawRegionMap.js";
-import UploadFile from "@/utils/upliadFile";
-import wx from "weixin-js-sdk";
-import { getFileExt } from "@/utils/util";
-import MorePopup from "./components/morePopup.vue";
-import UploadTips from "@/components/popup/uploadTips.vue";
-
-const showUploadTipsPopup = ref(false);
-
-const interactionListRef = ref(null);
-const SCROLL_KEY = 'interactionListScrollTop';
-
-const showDroneConsultPopup = ref(false);
-const handleShowDroneConsultPopup = () => {
-    showDroneConsultPopup.value = true;
-}
-
-const showFarmInfoPopup = ref(false);
-const loading = ref(false);
-const router = useRouter();
-const route = useRoute();
-const listData = ref([]);
-const morePopupRef = ref(null);
-//照片上传进度
-const showUploadProgressPopup = ref(false);
-// 上传进度统计
-const totalUploadCount = ref(0); // 本次选择的总文件数(固定不随上传成功变化)
-const uploadedSuccessCount = ref(0); // 已上传成功的文件数
-const uploadPercentage = computed(() => {
-    if (!totalUploadCount.value) return 0;
-    return Math.round((uploadedSuccessCount.value / totalUploadCount.value) * 100);
-});
-const format = () => {
-    if (!totalUploadCount.value) return '0/0';
-    return `${uploadedSuccessCount.value}/${totalUploadCount.value}`;
-};
-
-const drawRegionMap = new DrawRegionMap();
-/** 上传进度弹窗内地图为只读回显时,多边形配色与列表主题蓝一致(避免沿用勾画页默认绿色) */
-const READONLY_AREA_STYLE_BLUE = {
-    fill: "rgba(33, 153, 248, 0.35)",
-    stroke: "#2199F8",
-};
-const mapContainer = ref(null);
-const itemSubmittingMap = ref({});
-const confirmUploadLoading = ref(false);
-
-const getItemSubmitKey = (item) => String(item?.id ?? "");
-/** 任意一种提交进行中(用于防重复点击) */
-const isItemSubmitting = (item) => {
-    const key = getItemSubmitKey(item);
-    if (!key) return false;
-    return !!itemSubmittingMap.value[key];
-};
-const isItemSubmittingConfirm = (item) => {
-    const key = getItemSubmitKey(item);
-    return key ? itemSubmittingMap.value[key] === "confirm" : false;
-};
-const isItemSubmittingCancel = (item) => {
-    const key = getItemSubmitKey(item);
-    return key ? itemSubmittingMap.value[key] === "cancel" : false;
-};
-
-/** 接口长时间无响应时结束等待,避免按钮一直「提交中」 */
-const SUBMIT_API_TIMEOUT_MS = 120000;
-const raceWithTimeout = (promise, ms = SUBMIT_API_TIMEOUT_MS) =>
-    Promise.race([
-        Promise.resolve(promise),
-        new Promise((_, reject) =>
-            setTimeout(() => reject(new Error("请求超时,请稍后重试")), ms)
-        ),
-    ]);
-
-const clearItemSubmittingKey = (key) => {
-    if (!key) return;
-    const next = { ...itemSubmittingMap.value };
-    delete next[key];
-    itemSubmittingMap.value = next;
-};
-
-const renderRegionFromSession = () => {
-    if (!drawRegionMap.kmap) return;
-
-    // 先清空图层
-    drawRegionMap.clearLayer && drawRegionMap.clearLayer();
-
-    // 1)通过保存的互动项 ID,在 listData 中找到对应项,用接口 rangeWkt 回显只读区域
-    const savedId = sessionStorage.getItem("drawRegionInteractionId");
-    if (savedId && Array.isArray(listData.value) && listData.value.length > 0) {
-        const targetItem = listData.value.find(
-            (it) =>
-                it &&
-                it.id != null &&
-                (String(it.id) === savedId || Number(it.id) === Number(savedId))
-        );
-        if (targetItem && targetItem.rangeWkt && targetItem.rangeWkt.length > 10) {
-            // 使用 setStatusRegions 显示接口返回的区域
-            renderRegionFromItemWkt(targetItem);
-        }
-    }
-
-    // 2)再回显本地勾画的多边形到可编辑图层(两者可共存)
-    const polygonStr = sessionStorage.getItem("drawRegionPolygonData");
-    if (polygonStr) {
-        try {
-            const polygonData = JSON.parse(polygonStr);
-            if (
-                polygonData &&
-                Array.isArray(polygonData.geometryArr) &&
-                polygonData.geometryArr.length > 0 &&
-                drawRegionMap.kmap &&
-                drawRegionMap.kmap.polygonLayer
-            ) {
-                // 注意这里不再调用 clearLayer,避免清掉上一步 setStatusRegions 的只读区域
-                // 此处也不单独做 fit,由下方统一调用 fitAllRegions 适配所有图层
-                drawRegionMap.setAreaGeometry(
-                    polygonData.geometryArr,
-                    false,
-                    polygonData.mianji,
-                    READONLY_AREA_STYLE_BLUE
-                );
-            }
-        } catch (e) {
-            console.error("解析 drawRegionPolygonData 失败:", e);
-        }
-    }
-
-    // 3)统一根据只读图层 + 可编辑图层的范围自适应视图,保证所有区域都在视野内
-    if (drawRegionMap.fitAllRegions) {
-        drawRegionMap.fitAllRegions();
-    }
-};
-
-// 用当前项的 rangeWkt(接口返回的已保存区域)回显到地图;使用 setStatusRegions 方法显示
-const renderRegionFromItemWkt = (item) => {
-    const raw = item?.rangeWkt;
-    if (!raw || typeof raw !== 'string' || raw.length <= 10) return;
-    if (!drawRegionMap.kmap || !drawRegionMap.staticRegionLayer) return;
-    let geometryArr = [];
-    const trimmed = raw.trim();
-    if (trimmed.startsWith('{')) {
-        try {
-            const parsed = JSON.parse(raw);
-            if (parsed && Array.isArray(parsed.geometryArr) && parsed.geometryArr.length > 0) {
-                geometryArr = parsed.geometryArr;
-            }
-        } catch (e) {
-            console.error("解析 rangeWkt JSON 失败:", e);
-            return;
-        }
-    } else {
-        geometryArr = [raw];
-    }
-    if (geometryArr.length > 0) {
-        // 转换为 setStatusRegions 需要的格式:[{ geometry: wkt, status?: 'resolved' | 'unresolved' }]
-        const regions = geometryArr
-            .filter(wkt => wkt && typeof wkt === 'string' && wkt.trim().length > 10)
-            .map(wkt => ({
-                geometry: wkt.trim(),
-                status: 'unresolved', // 接口返回的区域默认显示为未解决状态
-                unresolvedBlueFill: true, // 与列表主题蓝一致,避免深灰填充
-            }));
-        if (regions.length > 0) {
-            drawRegionMap.setStatusRegions(regions);
-        }
-    }
-};
-
-//
-const urgentType = {
-    "0": "一般紧急",
-    "1": "紧急",
-    "2": "非常紧急",
-}
-
-const uploadFileObj = new UploadFile();
-const initImgArr = ref([]);
-const miniUserId = localStorage.getItem("MINI_USER_ID");
-const uploadRef = ref(null);
-/** 列表选择照片后,在弹窗内直传 OSS 期间,遮挡图片区域避免误操作 */
-const popupImageUploadLoading = ref(false);
-const beforeReadUpload = (file) => {
-    showUploadProgressPopup.value = true;
-    totalUploadCount.value = 0;
-    uploadedSuccessCount.value = 0;
-    initImgArr.value = [];
-    popupImageUploadLoading.value = false;
-    uploadRef.value && uploadRef.value.uploadReset();
-    return true;
-};
-
-//弹窗问题
-const afterReadUpload = async (data) => {
-    // 继续上传:回显已有图片再追加新图;首次上传:直接清空,只显示本次新传
-    initImgArr.value = (currentItem.value?.imagePaths?.length > 0)
-        ? [...currentItem.value.imagePaths]
-        : [];
-    // 本次上传的总数 = 选择的文件数量(固定,用于做进度的“总数”)
-    if (!Array.isArray(data)) {
-        data = [data];
-    }
-    totalUploadCount.value = data.length;
-    uploadedSuccessCount.value = 0;
-    // 仅当「编辑发生区域」和本次上传是同一项时保留勾画数据并回显;否则清除,避免数据串
-    const savedInteractionId = sessionStorage.getItem("drawRegionInteractionId");
-    const isSameItem = savedInteractionId != null && String(currentItem.value?.id) === savedInteractionId;
-    if (!isSameItem) {
-        drawRegionMap.clearLayer && drawRegionMap.clearLayer();
-        sessionStorage.removeItem("drawRegionPolygonData");
-        sessionStorage.removeItem("drawRegionInteractionId");
-    }
-
-    popupImageUploadLoading.value = true;
-    try {
-        for (let file of data) {
-            // 将文件上传至服务器
-            let fileVal = file.file;
-            file.status = "uploading";
-            file.message = "上传中...";
-            let ext = getFileExt(fileVal.name);
-            let key = `birdseye-look-mini/${miniUserId}/${new Date().getTime()}.${ext}`;
-            let resFilename = await uploadFileObj.put(key, fileVal)
-            if (resFilename) {
-                file.status = "done";
-                file.message = "";
-                // 记录成功数量,用于进度条“当前成功数”
-                uploadedSuccessCount.value += 1;
-                // 记录已上传成功的图片路径,用于回显
-                initImgArr.value.push(resFilename)
-            } else {
-                file.status = 'failed';
-                file.message = '上传失败';
-                ElMessage.error('图片上传失败,请稍后再试!')
-            }
-        }
-    } finally {
-        popupImageUploadLoading.value = false;
-    }
-
-    // 所有文件上传结束后再打开进度弹窗,此时 imgArr 已包含全部图片
-    if (initImgArr.value.length > 0 && currentItem.value.interactionTypeId != 1 && currentItem.value.questionStatus === 3) {
-        setTimeout(() => {
-            // 只在第一次时初始化地图,后续复用已有实例
-            if (!drawRegionMap.kmap) {
-                drawRegionMap.initMap(
-                    localStorage.getItem('selectedFarmPoint') || "POINT (113.6142086995688 23.585836479509055)",
-                    mapContainer.value,
-                    false,
-                    false,
-                    false
-                );
-            }
-            // 先清空所有图层,再按规则分别回显:接口 rangeWkt 用 setStatusRegions,本地 session 用 setAreaGeometry,可共存
-            drawRegionMap.clearLayer && drawRegionMap.clearLayer();
-            const savedId = sessionStorage.getItem("drawRegionInteractionId");
-            const currentId = currentItem.value?.id;
-            const isSameItem =
-                savedId != null &&
-                currentId != null &&
-                (String(currentId) === savedId || Number(currentId) === Number(savedId));
-            const hasSessionPolygon = !!sessionStorage.getItem("drawRegionPolygonData");
-
-            // 1)接口返回的 rangeWkt:始终用 setStatusRegions 渲染到只读图层
-            if (currentItem.value?.rangeWkt?.length > 10) {
-                renderRegionFromItemWkt(currentItem.value);
-            }
-
-            // 2)本地刚编辑的多边形(同一项且有 session 数据):用 setAreaGeometry 渲染到可编辑图层
-            if (isSameItem && hasSessionPolygon) {
-                const polygonStr = sessionStorage.getItem("drawRegionPolygonData");
-                if (polygonStr) {
-                    try {
-                        const polygonData = JSON.parse(polygonStr);
-                        if (
-                            polygonData &&
-                            Array.isArray(polygonData.geometryArr) &&
-                            polygonData.geometryArr.length > 0 &&
-                            drawRegionMap.kmap &&
-                            drawRegionMap.kmap.polygonLayer
-                        ) {
-                            // 此处不再调用 clearLayer,避免清掉上一步 setStatusRegions 的只读区域
-                            drawRegionMap.setAreaGeometry(
-                                polygonData.geometryArr,
-                                true,
-                                polygonData.mianji,
-                                READONLY_AREA_STYLE_BLUE
-                            );
-                        }
-                    } catch (e) {
-                        console.error("解析 drawRegionPolygonData 失败:", e);
-                    }
-                }
-            }
-            if (drawRegionMap.fitAllRegions) {
-                drawRegionMap.fitAllRegions();
-            }
-            // 3)其它情况:保持清空后的空地图
-        }, 100);
-    }
-};
-
-const currentItem = ref(null);
-const handleUploadClick = (item) => {
-    currentItem.value = item;
-};
-
-// 示例照片轮播
-const showExamplePopup = ref(false);
-const exampleList = ref([]);
-const exampleStartIndex = ref(0);
-const exampleShowTitleAndTips = ref(true);
-const currentPhotData = ref({})
-const showExample = (item, index, options = {}) => {
-    currentPhotData.value = item;
-    exampleList.value = options?.hideLabel ? item.imagePaths.map(p => ({ exampleImageUrl: base_img_url2 + p })) : item.exampleImageWithAnnotations || [];
-    exampleStartIndex.value = index || 0;
-    exampleShowTitleAndTips.value = options.hideLabel !== true;
-    showExamplePopup.value = true;
-};
-
-// 加载数据
-/*  */
-const loadData = async () => {
-    loading.value = true;
-    try {
-        const { data } = await VE_API.home.listTriggeredByFarm({ farmId: miniData.value.farmId, interactionTypeId: miniData.value.interactionTypeId })
-        listData.value = data.map(item => {
-            // question 按 || 切割成数组,用于循环渲染
-            const questionStr = item.question != null ? String(item.question) : '';
-            item.questionList = questionStr
-                ? questionStr.split('||').map(s => s.trim()).filter(Boolean)
-                : [];
-            if (!item.questionList.length && questionStr !== '') {
-                item.questionList = [questionStr];
-            }
-            // 保证 answerValues 与 questionList 长度一致,便于每项对应一个输入框
-            if (!Array.isArray(item.answerValues)) {
-                item.answerValues = [];
-            }
-            while (item.answerValues.length < item.questionList.length) {
-                item.answerValues.push('');
-            }
-            // interactionTypeName 按 : 分割,取第 0 项 + reproductiveName 生成互动主题文案
-            const interactionTypeNameStr = item.interactionTypeName != null ? String(item.interactionTypeName) : '';
-            const interactionTypeNameList = interactionTypeNameStr
-                ? interactionTypeNameStr.split(':').map(s => s.trim()).filter(Boolean)
-                : [];
-            const reproductive = item.reproductiveName || '';
-            // 类型名各段用 : 连接;若有繁殖名则统一为「……:繁殖名」
-            let interactionThemeText = '';
-            if (!interactionTypeNameList.length) {
-                interactionThemeText = reproductive;
-            } else {
-                interactionThemeText = interactionTypeNameList[0] + ':' + reproductive;
-            }
-            return {
-                ...item,
-                interactionTypeNameList,
-                interactionThemeText,
-            };
-        });
-    } catch (error) {
-        // 加载数据失败时静默处理或在需要时提示
-    } finally {
-        loading.value = false;
-    }
-};
-
-// 刷新列表数据
-const refreshList = async () => {
-    listData.value = [];
-    await loadData();
-};
-
-// 删除已上传的图片
-const removeUploadedImage = (item, imgIndex) => {
-    item.imagePaths.splice(imgIndex, 1);
-};
-
-// 确认上传 / 暂未到达进程
-const handleConfirm = async (item, isConfirm) => {
-    if (isItemSubmitting(item)) return;
-
-    if (isConfirm) {
-        const list = item.questionList || [];
-        // const needFill = list.length || 1;
-        // const hasEmpty = Array.from({ length: needFill }, (_, i) => i).some(
-        //     (i) => item.answerValues[i] === '' || item.answerValues[i] === null || item.answerValues[i] === undefined
-        // );
-        // if (hasEmpty) {
-        //     ElMessage.warning("请填写当前果园比例");
-        //     return;
-        // }
-        if (item.imagePaths.length === 0 && uploadData.value.length === 0) {
-            ElMessage.warning("请上传图片");
-            return;
-        }
-    }
-    const parmas = {
-        farmId: miniData.value.farmId,
-        imagePaths: item.imagePaths.concat(uploadData.value),
-        isUploadPhoto: item.imagePaths.concat(uploadData.value).length > 0 ? true : false,
-        rangeWkt: sessionStorage.getItem("drawRegionPolygonData") || '',
-        interactionId: item.id,
-        replyText: item.replyText,
-        answerValues: item.answerValues,
-        regionId: '',
-        isConfirmed: isConfirm ? true : false
-    }
-    const key = getItemSubmitKey(item);
-    const submitKind = isConfirm ? "confirm" : "cancel";
-    if (key) {
-        itemSubmittingMap.value = { ...itemSubmittingMap.value, [key]: submitKind };
-    }
-    let needRefresh = false;
-    try {
-        await raceWithTimeout(VE_API.home.uploadAnswerData(parmas));
-        const { code, msg } = await raceWithTimeout(VE_API.home.uploadAnswer(parmas));
-        if (code === 0) {
-            ElMessage.success("上传成功");
-            uploadData.value = [];
-            sessionStorage.removeItem("drawRegionPolygonData");
-            sessionStorage.removeItem("drawRegionInteractionId");
-            needRefresh = true;
-            if (sessionStorage.getItem("drawRegionSubmitParams")) {
-                const params = JSON.parse(sessionStorage.getItem("drawRegionSubmitParams"));
-                VE_API.basic_farm.ediRegionZone(params);
-            }
-        } else {
-            ElMessage.error(msg || "上传失败");
-        }
-    } catch (error) {
-        ElMessage.error(error?.message || "上传失败,请稍后重试");
-    } finally {
-        clearItemSubmittingKey(key);
-    }
-    if (needRefresh) {
-        try {
-            await refreshList();
-        } catch (e) {
-            ElMessage.error("列表刷新失败,请下拉重试");
-        }
-    }
-};
-
-const handleConfirmUpload = async () => {
-    if (confirmUploadLoading.value) return;
-    // 校验是否有上传图片
-    if (!uploadData.value || uploadData.value.length === 0) {
-        ElMessage.warning("请先上传照片");
-        return;
-    }
-    const item = currentItem.value;
-    const len = item?.questionList?.length || 1;
-    // const hasEmpty = Array.from({ length: len }, (_, i) => i).some(
-    //     (i) => item.answerValues[i] === '' || item.answerValues[i] === null || item.answerValues[i] === undefined
-    // );
-    // if (hasEmpty) {
-    //     ElMessage.warning("请填写占比数值");
-    //     return;
-    // }
-    const answerVals = (item.answerValues || []).slice(0, len);
-    const parmas = {
-        interactionId: item.id,
-        farmId: miniData.value.farmId,
-        imagePaths: uploadData.value,
-        rangeWkt: sessionStorage.getItem("drawRegionPolygonData") || '',
-        replyText: item.replyText,
-        answerValues: answerVals,
-    }
-    confirmUploadLoading.value = true;
-    let needRefresh = false;
-    try {
-        const { code, msg } = await raceWithTimeout(VE_API.home.uploadAnswerData(parmas));
-        if (code === 0) {
-            ElMessage.success("确认成功");
-            uploadData.value = [];
-            sessionStorage.removeItem("drawRegionPolygonData");
-            sessionStorage.removeItem("drawRegionInteractionId");
-            showUploadProgressPopup.value = false;
-            needRefresh = true;
-        } else {
-            ElMessage.error(msg || "确认失败");
-        }
-    } catch (error) {
-        ElMessage.error(error?.message || "确认失败,请稍后重试");
-    } finally {
-        confirmUploadLoading.value = false;
-    }
-    if (needRefresh) {
-        try {
-            await refreshList();
-        } catch (e) {
-            ElMessage.error("列表刷新失败,请下拉重试");
-        }
-    }
-};
-
-const handleCancelUploadPopup = () => {
-    showUploadProgressPopup.value = false;
-};
-
-// 切换展开/收起
-const toggleExpand = (item) => {
-    item.expanded = !item.expanded;
-};
-
-const handleViewRegion = (item) => {
-    router.push(`/draw_region?viewOnly=1&firstAct=ABNORMAL&secondAct=0&showData=true`);
-}
-
-const showClose = ref(false);
-
-const handleInvite = (item) => {
-    const query = {
-        askInfo: { title: "农情互动", content: "是否分享该农情互动给好友" },
-        shareText: "邀请您农情互动,精准匹配种植方案",
-        targetUrl: `interaction_list`,
-        paramsPage: JSON.stringify({
-            farmId: miniData.value.farmId,
-            regionId: item.regionId,
-            interactionTypeId: item.interactionTypeId,
-            showClose: true
-        }),
-        imageUrl: 'https://birdseye-img.sysuimars.com/feiniaomini/1.png',
-    };
-    wx.miniProgram.navigateTo({
-        url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify(query)}&type=sharePage`,
-    });
-}
-
-const handleDrawRegion = (item) => {
-    if (sessionStorage.getItem("drawRegionInteractionId") != item.id) {
-        sessionStorage.removeItem("drawRegionPolygonData");
-        sessionStorage.removeItem("drawRegionInteractionId");
-    }
-    // 记录本次勾画对应的互动项 id,上传时若是同一项则保留回显,否则清除避免数据串
-    sessionStorage.setItem("drawRegionInteractionId", String(item.id));
-    const polygonData = sessionStorage.getItem("drawRegionPolygonData");
-    // 记录当前滚动位置
-    const container = interactionListRef.value;
-    if (container && typeof container.scrollTop === 'number') {
-        sessionStorage.setItem(SCROLL_KEY, String(container.scrollTop));
-    }
-
-    if (item.rangeWkt && item.rangeWkt.length > 10) {
-        router.push(`/draw_region?polygonData=${polygonData}&rangeWkt=${item.rangeWkt}&updatedTime=${item.updatedTime.slice(0, 10)}&mapCenter=${localStorage.getItem('selectedFarmPoint') || 'POINT (113.6142086995688 23.585836479509055)'}&firstAct=ABNORMAL&secondAct=0`);
-    } else {
-        if (polygonData) {
-            router.push(`/draw_region?polygonData=${polygonData}&mapCenter=${localStorage.getItem('selectedFarmPoint') || 'POINT (113.6142086995688 23.585836479509055)'}&firstAct=ABNORMAL&secondAct=0`);
-        } else {
-            router.push(`/draw_region?mapCenter=${localStorage.getItem('selectedFarmPoint') || 'POINT (113.6142086995688 23.585836479509055)'}&firstAct=ABNORMAL&secondAct=0`);
-        }
-    }
-};
-
-onUnmounted(() => {
-    sessionStorage.removeItem("drawRegionPolygonData");
-    sessionStorage.removeItem("drawRegionInteractionId");
-});
-
-const uploadData = ref([]);
-const handleUploadSuccess = (data) => {
-    uploadData.value = data.imgArr;
-    // 同步进度条:删除/增加图片时,总数和已上传数跟随当前列表变化
-    const len = (data.imgArr && data.imgArr.length) || 0;
-    totalUploadCount.value = len;
-    uploadedSuccessCount.value = len;
-};
-
-const openMorePopup = (item) => {
-    const data = item.exampleImageWithAnnotations.map(exampleItem => {
-        return {
-            ...exampleItem,
-            shootingMethod: item.shootingMethod,
-        }
-    });
-    morePopupRef.value.setItems(data);
-    morePopupRef.value.openPopup();
-}
-
-const onCopyWechatId = () => {
-    ElMessage.success("微信号已复制");
-};
-
-const oldUser = ref(false);
-const miniData = ref({});
-// 页面从勾画页返回时,如果组件被 keep-alive 缓存,则会触发 onActivated,在此再做一次回显
-onActivated(() => {
-    // 重新进入页面时清空提交/上传中状态,避免上次未完成请求导致按钮一直卡在「提交中」「上传中」
-    itemSubmittingMap.value = {};
-    confirmUploadLoading.value = false;
-    if(route.query.miniJson) {
-        const data = JSON.parse(route.query.miniJson);
-        miniData.value = JSON.parse(data.paramsPage);
-    }else{
-        miniData.value = route.query;
-    }
-    showClose.value = miniData.value?.showClose ? true : false;
-    if (!localStorage.getItem('showUploadTipsPopup')) {
-        showUploadTipsPopup.value = true;
-        setTimeout(() => {
-            showUploadTipsPopup.value = false;
-            localStorage.setItem('showUploadTipsPopup', true);
-        }, 3000);
-    }
-    // 初始化加载
-    // getFarmList();
-    // 加载数据
-    loadData();
-    renderRegionFromSession();
-    // 恢复滚动位置
-    const container = interactionListRef.value;
-    const savedTop = sessionStorage.getItem(SCROLL_KEY);
-    if (container && savedTop != null) {
-        const top = Number(savedTop);
-        if (!Number.isNaN(top)) {
-            // 延迟一点,等 DOM 渲染完成后再滚动
-            setTimeout(() => {
-                container.scrollTop = top;
-            }, 0);
-        }
-    }
-    oldUser.value = route.query.oldUser && Boolean(route.query.oldUser);
-    if (oldUser.value) {
-        showFarmInfoPopup.value = true;
-    }
-});
-
-const getFarmList = async () => {
-    const { data } = await VE_API.farm.userFarmSelectOption();
-    if (data && data.length === 0) {
-        showFarmInfoPopup.value = true;
-    }
-}
-
-const handleSubmitAll = () => {
-    console.log("一键提交");
-};
-
-</script>
-<style scoped lang="scss">
-.interaction-list-wrapper{
-    width: 100%;
-    height: calc(100vh - 40px);
-    background: #f2f4f5;
-    padding: 12px;
-    box-sizing: border-box;
-    overflow-y: auto;
-    &.show-close{
-        height: 100vh;
-    }
-    .interaction-card{
-        background: #ffffff;
-        border-radius: 6px;
-        padding: 10px;
-        border: 1px solid #ffffff;
-        margin-bottom: 10px;
-        img{
-            width: 100%;
-            height: 145px;
-            object-fit: cover;
-            border-radius: 2px;
-        }
-        .card-content{
-            color: #666666;
-            margin-top: 8px;
-            .card-title{
-                font-size: 16px;
-                color: #000000;
-                font-weight: 500;
-            }
-            .card-desc{
-                margin-top: 4px;
-            }
-        }
-    }
-    .interaction-list {
-        width: 100%;
-
-        .tips-text {
-            color: #FA7406;
-            padding: 5px 10px;
-            border: 1px solid #FA7406;
-            border-radius: 5px;
-            margin-bottom: 10px;
-            background: #fff;
-        }
-
-        .list-item {
-            background: #ffffff;
-            border-radius: 6px;
-            padding: 10px;
-            border: 1px solid #ffffff;
-
-            &.uploaded-item {
-                border: 1px solid #2199f8;
-            }
-
-            .item-header-wrapper {
-                .item-header {
-                    display: flex;
-                    align-items: center;
-                    justify-content: space-between;
-
-                    .header-wrapper {
-                        display: flex;
-                        align-items: center;
-                        gap: 5px;
-                    }
-
-                    .title-block {
-                        font-size: 15px;
-                        color: #6f6f6f;
-                        font-family: "PangMenZhengDao";
-                        width: fit-content;
-                        background: rgba(143, 143, 143, 0.1);
-                        padding: 5px 10px;
-                        border-radius: 2px;
-                    }
-
-                    .status {
-                        color: #999999;
-                        background: #F1F1F1;
-
-                        &.urgent-0 {
-                            color: #2199f8;
-                            background: rgba(33, 153, 248, 0.1);
-                        }
-
-                        &.urgent-1 {
-                            color: #FF953D;
-                            background: rgba(255, 149, 61, 0.1);
-                        }
-
-                        &.urgent-2 {
-                            color: #EE4646;
-                            background: rgba(238, 70, 70, 0.1);
-                        }
-                    }
-
-                    .location-error {
-                        display: flex;
-                        align-items: center;
-                        font-family: "Helvetica Neue, Helvetica, Tahoma, Arial, sans-serif";
-                        color: #FA7406;
-                        gap: 4px;
-                        font-size: 14px;
-                        background: #fff;
-                    }
-                }
-
-                .upload-status {
-                    display: flex;
-                    align-items: center;
-                    gap: 4px;
-                    margin-left: 10px;
-
-                    .status-icon {
-                        color: #2199f8;
-                        font-size: 17px;
-                    }
-
-                    .status-text {
-                        font-size: 14px;
-                        color: #2199f8;
-                    }
-                }
-
-                &.has-status {
-                    display: flex;
-                    justify-content: space-between;
-                    align-items: center;
-
-                    .item-header {
-                        div {
-                            color: #2199f8;
-                            background: rgba(33, 153, 248, 0.1);
-                        }
-                    }
-                }
-            }
-
-            .expanded-content {
-                background: rgba(33, 153, 248, 0.1);
-                border-radius: 5px;
-                padding: 10px;
-                border: 0.5px solid #2199F8;
-                margin-top: 12px;
-
-                .uploaded-images {
-                    display: flex;
-                    flex-wrap: wrap;
-                    gap: 8px;
-                    margin-top: 8px;
-
-                    .uploaded-img-wrap {
-                        position: relative;
-                        width: calc((100vw - 68px) / 4);
-                        height: calc((100vw - 68px) / 4);
-                    }
-
-                    .uploaded-img {
-                        width: 100%;
-                        height: 100%;
-                        border-radius: 4px;
-                        object-fit: cover;
-                    }
-
-                    .uploaded-img-remove {
-                        position: absolute;
-                        top: 0;
-                        right: 0;
-                        width: 18px;
-                        height: 18px;
-                        display: flex;
-                        justify-content: center;
-                        background: rgba(0, 0, 0, 0.6);
-                        color: #fff;
-                        font-size: 14px;
-                        line-height: 16px;
-                        border-radius: 50%;
-                    }
-                }
-
-                .continue-upload-btn {
-                    border: 0.5px solid rgba(33, 153, 248, 0.5);
-                    border-radius: 4px;
-                    background: #FFFFFF;
-                    cursor: pointer;
-                }
-            }
-
-            .uploaded-content {
-                .content-wrapper {
-                    border: 0.5px solid rgba(0, 0, 0, 0.1);
-                    border-radius: 4px;
-                    padding: 10px;
-                    margin-top: 12px;
-
-                    .item-desc {
-                        color: #3C3C3C;
-                        margin-bottom: 10px;
-                        display: inline-block;
-                    }
-
-                    .tip-box {
-                        font-size: 12px;
-                        color: #2199F8;
-                        padding: 3px 5px;
-                        border-radius: 4px;
-                        margin-bottom: 10px;
-                        background: linear-gradient(90deg, rgba(33, 153, 248, 0.2) 0%, rgba(221, 221, 221, 0) 100%);
-                    }
-
-                    .example-wrapper {
-                        .example-header {
-                            display: flex;
-                            align-items: center;
-                            justify-content: space-between;
-                            margin-bottom: 8px;
-                            color: #BEB9B9;
-
-                            .more {
-                                font-size: 12px;
-                            }
-                        }
-
-                        .example-list {
-                            display: flex;
-                            align-items: center;
-                            overflow: hidden;
-
-                            .image-item-wrapper {
-                                position: relative;
-                                margin-right: 6px;
-
-                                &::after {
-                                    content: '示例';
-                                    position: absolute;
-                                    top: 0;
-                                    left: 0;
-                                    background: rgba(0, 0, 0, 0.7);
-                                    color: #F2F4F5;
-                                    padding: 2px 6px;
-                                    border-radius: 8px 0 2px 0;
-                                    font-size: 10px;
-                                    z-index: 1;
-                                }
-                            }
-
-                            .image-item {
-                                width: calc((100vw - 68px) / 4);
-                                height: calc((100vw - 68px) / 4);
-                                border-radius: 8px;
-                                object-fit: cover;
-                            }
-                        }
-                    }
-
-                    .patrol-suggestion {
-                        color: rgba(60, 60, 60, 0.4);
-                        margin-top: 10px;
-
-                        .action-text {
-                            color: #727272;
-                        }
-                    }
-                }
-
-                .upload-wrap {
-                    width: 100%;
-                    margin-top: 12px;
-
-                    ::v-deep {
-                        .van-uploader__input-wrapper {
-                            width: 100%;
-                        }
-                    }
-
-                    .upload-btn {
-                        width: 100%;
-                        display: flex;
-                        align-items: center;
-                        justify-content: center;
-                        gap: 4px;
-                        color: #0B84E4;
-                        padding: 6px;
-                        border: 0.5px solid rgba(33, 153, 248, 0.5);
-                        border-radius: 4px;
-                        box-sizing: border-box;
-                    }
-                }
-            }
-
-            .input-wrapper {
-                margin: 12px 0;
-            }
-
-            .cancel-text{
-                color: #969696;
-                margin-top: 8px;
-            }
-
-            .button-group {
-                display: flex;
-                gap: 12px;
-
-                .btn-not-reached,
-                .btn-default {
-                    flex: 1;
-                    text-align: center;
-                    border-radius: 4px;
-                    padding: 6px;
-                }
-
-                .btn-not-reached {
-                    max-width: fit-content;
-                    background: #fff;
-                    color: #585858;
-                    min-width: 98px;
-                    border: 1px solid rgba(88, 88, 88, 0.2);
-                }
-
-                .btn-default {
-                    background: #F1F1F1;
-                    color: #999999;
-                    border: 1px solid #F1F1F1;
-                }
-
-                .btn-loading {
-                    opacity: 0.7;
-                    pointer-events: none;
-                }
-
-                .btn-confirm {
-                    background: #2199f8;
-                    color: #ffffff;
-                    border: 1px solid #2199f8;
-                }
-            }
-
-            .invite-btn {
-                color: #2199f8;
-                border: 1px solid rgba(33, 153, 248, 0.2);
-                border-radius: 4px;
-                padding: 5px;
-                text-align: center;
-                margin-top: 12px;
-                background: rgba(33, 153, 248, 0.1);
-            }
-
-            .proportion-info {
-                display: flex;
-                justify-content: space-between;
-                align-items: center;
-                margin-top: 12px;
-
-                .proportion-text {
-                    color: #969696;
-                    font-size: 14px;
-                    white-space: nowrap;
-                    overflow: hidden;
-                    text-overflow: ellipsis;
-                    flex: 1;
-                    margin-right: 10px;
-                }
-
-                .toggle-btn {
-                    display: flex;
-                    align-items: center;
-                    gap: 2px;
-                    color: #8D8D8D;
-                    padding: 2px 10px;
-                    border: 1px solid rgba(0, 0, 0, 0.2);
-                    font-size: 12px;
-                    border-radius: 25px;
-                    background: #FFFFFF;
-
-                    .rotate {
-                        transform: rotate(180deg);
-                    }
-                }
-            }
-        }
-
-        .list-item+.list-item {
-            margin-top: 12px;
-        }
-
-        .empty-data {
-            text-align: center;
-            padding: 40px 0;
-            color: #999999;
-            font-size: 14px;
-        }
-
-        .question-wrapper {
-            display: flex;
-            align-items: flex-start;
-            justify-content: space-between;
-            gap: 10px;
-            margin: 12px 0 6px;
-            box-sizing: border-box;
-            width: 100%;
-
-            .question-text {
-                background: #ffffff;
-                color: #6f6f6f;
-                display: flex;
-                align-items: center;
-
-                .text-title {
-                    margin-right: 5px;
-                }
-
-                .text-unit {
-                    margin-left: 4px;
-                }
-            }
-
-            .question-text+.question-text {
-                margin-top: 6px;
-            }
-
-            .draw-region-btn {
-                background: rgba(33, 153, 248, 0.1);
-                border-radius: 4px;
-                padding: 6px 10px;
-                color: #2199f8;
-            }
-        }
-    }
-}
-
-.custom-bottom-fixed-btns {
-    justify-content: space-between;
-
-    .secondary-btn {
-        padding: 10px 20px;
-    }
-}
-
-.center-btn {
-    justify-content: center;
-
-    .primary-btn {
-        padding: 10px 32px;
-        background: #2199F8;
-    }
-}
-
-.upload-progress-popup {
-    width: 100%;
-    padding: 20px 16px;
-
-    .upload-progress-title {
-        font-size: 16px;
-        color: #121212;
-        margin-bottom: 12px;
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-
-        .upload-progress {
-            width: 55%;
-
-            ::v-deep {
-                .el-progress__text {
-                    min-width: fit-content;
-                }
-            }
-        }
-    }
-
-    .upload-box {
-        margin-bottom: 12px;
-        position: relative;
-        min-height: 88px;
-    }
-
-    .input-box {
-        .input-item {
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
-            gap: 6px;
-
-            .label-input {
-                width: 130px;
-            }
-        }
-
-        .input-item+.input-item {
-            margin-top: 6px;
-        }
-    }
-
-    .region-tips {
-        color: #2199F8;
-        padding: 5px;
-        background: rgba(33, 153, 248, 0.1);
-        border-radius: 5px;
-        margin: 16px 0 12px 0;
-        text-align: center;
-    }
-
-    .region-map {
-        width: 100%;
-        height: 168px;
-        clip-path: inset(0px round 5px);
-        position: relative;
-
-        .region-map-text {
-            position: absolute;
-            bottom: 0;
-            right: 0;
-            color: #FFFFFF;
-            padding: 5px 20px;
-            border-radius: 5px;
-            background: rgba(0, 0, 0, 0.6);
-            z-index: 1;
-        }
-    }
-
-    .upload-action-btns {
-        display: flex;
-        gap: 10px;
-        margin-top: 16px;
-
-        .cancel-btn,
-        .confirm-btn {
-            flex: 1;
-            border-radius: 4px;
-            padding: 8px;
-            text-align: center;
-            font-size: 16px;
-        }
-
-        .cancel-btn {
-            border: 1px solid #dcdfe6;
-            color: #606266;
-            background: #ffffff;
-        }
-
-        .confirm-btn {
-            background: #2199f8;
-            color: #ffffff;
-        }
-    }
-
-    .confirm-btn-loading {
-        opacity: 0.7;
-        pointer-events: none;
-    }
-}
-</style>

+ 0 - 669
src/views/old_mini/interactionList/map/drawRegionMap.js

@@ -1,669 +0,0 @@
-import * as KMap from "@/utils/ol-map/KMap";
-import * as util from "@/common/ol_common.js";
-import config from "@/api/config.js";
-import Style from "ol/style/Style";
-import Icon from "ol/style/Icon";
-import { Fill, Stroke, Text } from "ol/style.js";
-import { Point } from 'ol/geom';
-import Feature from "ol/Feature";
-import * as proj from "ol/proj";
-import { getArea } from 'ol/sphere.js';
-import WKT from "ol/format/WKT.js";
-import proj4 from "proj4"
-import { register } from "ol/proj/proj4";
-proj4.defs("EPSG:38572", "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");
-register(proj4);
-
-/**
- * @description 地图层对象
- */
-class DrawRegionMap {
-    constructor() {
-        let that = this;
-        let vectorStyle = new KMap.VectorStyle();
-        this.vectorStyle = vectorStyle;
-        // 是否允许编辑(勾画页 true,小弹窗回显页 false)
-        this.editable = true;
-
-        // 位置图标
-        this.clickPointLayer = new KMap.VectorLayer("clickPointLayer", 9999, {
-            style: () => {
-                return new Style({
-                    image: new Icon({
-                        // src: require("@/assets/img/home/garden-point.png"),
-                        src: require("@/assets/img/map/map_point.png"),
-                        scale: 0.5,
-                        // anchor: [0.5, 0.5],
-                    }),
-                });
-            },
-        });
-
-        // 只读状态区域图层(展示多 polygon,用于“已解决 / 未解决”等状态)
-        // 层级需低于默认可编辑 polygonLayer(1000),避免标签遮挡当前编辑地块
-        this.staticRegionLayer = new KMap.VectorLayer("staticRegionLayer", 900, {
-            style: (f) => {
-                const displayMode = f.get("displayMode");
-                // 品种勾画页:已勾画的其他品种仅做只读灰色展示,并显示品种名
-                if (displayMode === "readonlyVariety") {
-                    // 品种区只读展示:统一使用品种区视觉样式
-                    return new Style({
-                        fill: new Fill({ color: "rgba(0, 57, 44, 0.5)" }),
-                        stroke: new Stroke({ color: "#18AA8B", width: 1.5 }),
-                        text: new Text({
-                            text: f.get("label") || "",
-                            font: "12px sans-serif",
-                            fill: new Fill({ color: "#ffffff" }),
-                            backgroundFill: new Fill({ color: "rgba(0, 57, 44, 0.85)" }),
-                            padding: [2, 6, 2, 6],
-                        }),
-                    });
-                }
-                if (displayMode === "lockedDisease") {
-                    const status = String(f.get("handleStatus") || "");
-                    const lockStyleType = String(f.get("lockStyleType") || "");
-                    const isControlled = lockStyleType === "controlled" || status === "3";
-                    const isGrowthTreating = lockStyleType === "growthTreating";
-                    const label = f.get("label") || (isControlled ? "病害已控制" : "病害治疗中");
-                    const updatedTime = f.get("updatedTime") || "";
-                    const isNewAbnormal = String(label).startsWith("新增");
-                    let areaText = "";
-                    try {
-                        let geom = f.getGeometry().clone();
-                        geom.transform(proj.get("EPSG:4326"), proj.get("EPSG:38572"));
-                        let area = getArea(geom);
-                        area = (area + area / 2) / 1000;
-                        areaText = `${Number(area).toFixed(2)}亩`;
-                    } catch (_) {
-                        areaText = "";
-                    }
-                    const fillColor = isControlled
-                        ? "rgba(166, 166, 166, 0.25)"
-                        : isGrowthTreating
-                            ? "rgba(255, 159, 102, 0.3)"
-                            : "rgba(191, 91, 91, 0.36)";
-                    const strokeColor = isControlled
-                        ? "#A6A6A6"
-                        : isGrowthTreating
-                            ? "rgba(255, 94, 0, 0.3)"
-                            : "rgba(224, 49, 49, 0.3)";
-                    const badgeTextColor = isControlled
-                        ? "#ffffff"
-                        : isNewAbnormal
-                            ? "#ffffff"
-                            : isGrowthTreating
-                                ? "#F76F00"
-                                : "#E32A28";
-                    const badgeBgColor = isControlled
-                        ? "#A6A6A6"
-                        : isNewAbnormal
-                            ? (isGrowthTreating ? "#F76F00" : "#E32A28")
-                            : "#ffffff";
-                    const badgeBorderColor = isControlled || isNewAbnormal ? "" : isGrowthTreating ? "#F76F00" : "#E32A28";
-                    const styles = [
-                        new Style({
-                            fill: new Fill({ color: fillColor }),
-                            stroke: new Stroke({ color: strokeColor, width: 1.5 }),
-                            text: new Text({
-                                text: label,
-                                font: "bold 13px sans-serif",
-                                fill: new Fill({ color: badgeTextColor }),
-                                backgroundFill: new Fill({ color: badgeBgColor }),
-                                backgroundStroke: badgeBorderColor
-                                    ? new Stroke({ color: badgeBorderColor, width: 1 })
-                                    : undefined,
-                                padding: [4, 10, 4, 10],
-                                offsetY: -40,
-                            }),
-                        }),
-                    ];
-                    if (updatedTime) {
-                        styles.push(
-                            new Style({
-                                text: new Text({
-                                    text: `发现时间:${updatedTime}`,
-                                    font: "12px sans-serif",
-                                    fill: new Fill({ color: isNewAbnormal ? "#333333" : "#ffffff" }),
-                                    ...(isNewAbnormal
-                                        ? {
-                                              backgroundFill: new Fill({ color: "#ffffff" }),
-                                              padding: [8, 12, 8, 12],
-                                          }
-                                        : {}),
-                                    offsetY: -16,
-                                }),
-                            })
-                        );
-                    }
-                    if (areaText) {
-                        styles.push(
-                            new Style({
-                                text: new Text({
-                                    text: areaText,
-                                    font: "16px sans-serif",
-                                    fill: new Fill({ color: "#ffffff" }),
-                                    offsetY: 14,
-                                }),
-                            })
-                        );
-                    }
-                    return styles;
-                }
-
-                const status = f.get("status"); // 'resolved' | 'unresolved'
-                const reproductiveName = f.get("reproductiveName") || "";
-                const isResolved = status === "resolved";
-                const unresolvedBlueFill = f.get("unresolvedBlueFill") === true;
-                const regionStyleKind = String(f.get("regionStyleKind") || "");
-                const isAbnormalGrowth =
-                    regionStyleKind === "ABNORMAL" &&
-                    (reproductiveName.includes("长势") ||
-                        reproductiveName.includes("过慢") ||
-                        reproductiveName.includes("过快"));
-                let unresolvedFillColor = unresolvedBlueFill
-                    ? "rgba(33, 153, 248, 0.35)"
-                    : "rgba(0, 0, 0, 0.5)";
-                let unresolvedStrokeColor = "#2199F8";
-                let unresolvedBadgeColor = "#2199F8";
-
-                if (regionStyleKind === "variety") {
-                    unresolvedFillColor = "rgba(0, 57, 44, 0.5)";
-                    unresolvedStrokeColor = "#18AA8B";
-                    unresolvedBadgeColor = "#18AA8B";
-                } else if (regionStyleKind === "ABNORMAL") {
-                    unresolvedFillColor = isAbnormalGrowth
-                        ? "rgba(124, 46, 0, 0.5)"
-                        : "rgba(100, 0, 0, 0.5)";
-                    unresolvedStrokeColor = isAbnormalGrowth ? "#FF7300" : "#E03131";
-                    unresolvedBadgeColor = isAbnormalGrowth ? "#F76F00" : "#E03131";
-                } else if (regionStyleKind === "ENVIRONMENT") {
-                    unresolvedFillColor = "rgba(151, 96, 0, 0.5)";
-                    unresolvedStrokeColor = "#FDCF7F";
-                    unresolvedBadgeColor = "#FDCF7F";
-                }
-                // 已解决:深灰填充,浅白描边;未解决:默认深灰半透明 + 蓝描边;unresolvedBlueFill 时浅蓝填充(互动列表等)
-                const fillColor = isResolved
-                    ? "rgba(0, 0, 0, 0.6)"
-                    : unresolvedFillColor;
-                const strokeColor = isResolved ? "#7C7C7C" : unresolvedStrokeColor;
-                let abnormalBadgeText = "";
-                if (regionStyleKind === "ABNORMAL") {
-                    if (reproductiveName.includes("病害")) {
-                        abnormalBadgeText = "新增病害";
-                    } else if (reproductiveName.includes("虫害")) {
-                        abnormalBadgeText = "新增虫害";
-                    } else if (reproductiveName.includes("过慢")) {
-                        abnormalBadgeText = "新增长势过慢";
-                    } else if (reproductiveName.includes("过快")) {
-                        abnormalBadgeText = "新增长势过快";
-                    }
-                }
-                const statusText = status === "resolved" ? "已解决" : "未解决";
-                const mainLabelText =
-                    regionStyleKind === "ABNORMAL" && abnormalBadgeText
-                        ? abnormalBadgeText
-                        : reproductiveName
-                            ? `${reproductiveName} ${statusText}`
-                            : statusText;
-                let areaText = "";
-                try {
-                    let geom = f.getGeometry().clone();
-                    geom.transform(proj.get("EPSG:4326"), proj.get("EPSG:38572"));
-                    let area = getArea(geom);
-                    area = (area + area / 2) / 1000;
-                    areaText = `${Number(area).toFixed(2)}亩`;
-                } catch (_) {
-                    areaText = "";
-                }
-
-                const text = new Text({
-                    text: mainLabelText,
-                    font: regionStyleKind === "ABNORMAL" ? "bold 13px sans-serif" : "12px sans-serif",
-                    fill: new Fill({ color: "#ffffff" }),
-                    backgroundFill: new Fill({ 
-                        color: isResolved ? "#949494" : unresolvedBadgeColor 
-                    }),
-                    padding: [1, 5, 1, 5],
-                    offsetY: -40,
-                });
-                const style =  new Style({
-                        fill: new Fill({ color: fillColor }),
-                        stroke: new Stroke({ color: strokeColor, width: 1 }),
-                        text: text,
-                    })
-
-                const text2 = new Style({
-                    text: new Text({
-                        text: `发现时间:${f.get("updatedTime")}`,
-                        font: "12px sans-serif",
-                        offsetY: -16,
-                        fill: new Fill({ color: "#ffffff" }),
-                        ...(regionStyleKind === "ABNORMAL"
-                            ? {}
-                            : {
-                                  backgroundFill: new Fill({
-                                      color: isResolved ? "rgba(171, 171, 171, 0.4)" : `${unresolvedBadgeColor}99`,
-                                  }),
-                              }),
-                        padding: [1, 5, 1, 5],
-                    }),
-                });
-
-                const styles = [style, text2];
-                if (areaText) {
-                    styles.push(
-                        new Style({
-                            text: new Text({
-                                text: areaText,
-                                font: "16px sans-serif",
-                                fill: new Fill({ color: "#ffffff" }),
-                                offsetY: 14,
-                            }),
-                        })
-                    );
-                }
-
-                return styles;
-            },
-        });
-    }
-
-    /**
-     * 初始化地图
-     * @param {string} location WKT 点位
-     * @param {HTMLElement|string} target 地图容器
-     * @param {boolean} editable 是否允许绘制/编辑地块
-     * @param {boolean} movable 是否允许拖动/缩放地图
-     * @param {boolean} showPoint 是否显示初始点位图标
-     * @param {Function} onDrawEnd 绘制闭环回调(drawend),可选
-     */
-    initMap(location, target, editable = true, movable = true, showPoint = true, onDrawEnd) {
-        let level = 16;
-        let coordinate = util.wktCastGeom(location).getFirstCoordinate();
-        this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 8, 22);
-        // 记录当前地图是否可编辑,供样式控制使用
-        this.editable = editable;
-        let xyz2 = config.base_img_url3 + "map/lby/{z}/{x}/{y}.png";
-        this.kmap.addXYZLayer(xyz2, { minZoom: 8, maxZoom: 22 }, 2);
-        this.kmap.addLayer(this.clickPointLayer.layer);
-        this.kmap.addLayer(this.staticRegionLayer.layer);
-        // 根据 showPoint 决定是否在初始化时落下点位图标
-        if (showPoint) {
-            this.setMapPoint(coordinate);
-        } else {
-            this.clickPointLayer.source.clear();
-        }
-
-        // 仅在 editable 为 true 时开启绘制/编辑能力(用于勾画页面)
-        if (editable) {
-            this.kmap.initDraw((e) => {
-                if (typeof onDrawEnd === "function") {
-                    try {
-                        onDrawEnd(e);
-                    } catch (_) {
-                        // 回调失败不影响地图继续使用
-                    }
-                }
-            });
-            this.kmap.startDraw()
-            this.kmap.modifyDraw()
-        }
-
-        // movable 为 false 时,禁用地图拖动、缩放等交互(用于小弹窗只看不动)
-        if (!movable && this.kmap && this.kmap.setStates) {
-            this.kmap.setStates({
-                DoubleClickZoom: false,
-                DragAndDrop: false,
-                MouseWheelZoom: false,
-            });
-        }
-    }
-
-    /**
-     * 回显地块
-     * @param {string[]} geometryArr 多边形 WKT 数组
-     * @param {boolean} needFitView 是否自动缩放视图
-     * @param {string|number} areaText 显示的面积(单位:亩),可选
-     * @param {{ fill?: string, stroke?: string }} [readonlyAreaStyle] 只读模式下覆盖填充/描边色;不传则仍用 Map.drawStyleColors 或默认
-     * @param {{ badgeText: string, discoveryDate: string, badgeBackground?: string }|function} [growthOverlay] 只读模式下异常区标签(可传函数按地块动态返回)
-     * @param {string} [polygonCenterLabel] 只读模式下覆盖多边形中心文案(原样展示,不加「亩」);用于品种查看态显示品种名等
-     */
-    setAreaGeometry(geometryArr, needFitView = false, areaText, readonlyAreaStyle, growthOverlay, polygonCenterLabel) {
-        // 兜底保护:geometryArr 可能为 undefined/null 或空数组
-        if (!Array.isArray(geometryArr) || geometryArr.length === 0) return;
-        // 地图实例或图层尚未初始化时也直接返回,避免报错
-        if (!this.kmap || !this.kmap.polygonLayer || !this.kmap.polygonLayer.source) return;
-
-        let that = this;
-        geometryArr.map((item, index) => {
-            // 不使用 setLayerWkt,而是手动添加要素,避免自动缩放视图
-            const format = new WKT()
-            const mapProjection = that.kmap.map.getView().getProjection()
-            let geometry = format.readGeometry(item, {
-                dataProjection: 'EPSG:4326',
-                featureProjection: mapProjection
-            })
-            let f = new Feature({ geometry: geometry })
-            // 只读模式下,为多边形单独设置样式:仅填充+边框 + 面积文本,不显示可拖动的顶点小圆点
-            if (!this.editable) {
-                const resolvedGrowthOverlay =
-                    typeof growthOverlay === "function"
-                        ? growthOverlay(f, item, index)
-                        : growthOverlay;
-                const overlayStatus = String(resolvedGrowthOverlay?.handleStatus || "");
-                const overlayBadgeText = String(resolvedGrowthOverlay?.badgeText || "");
-                const overlayLockStyleType = String(resolvedGrowthOverlay?.lockStyleType || "");
-                // 只读查看态颜色与编辑态保持一致:
-                // 1) 已控制(3) 灰色;2) 长势治疗中(2) 橙色;3) 病虫害治疗中(2) 红色
-                const isControlledDisease = overlayStatus === "3";
-                const isTreatingGrowth =
-                    overlayStatus === "2" &&
-                    (overlayLockStyleType === "growthTreating" || overlayBadgeText.includes("长势"));
-                const isTreatingDisease = overlayStatus === "2" && !isTreatingGrowth;
-                // 查看模式下单块区域展示:优先 readonlyAreaStyle,其次 Map.drawStyleColors,再默认
-                const fillColor = isControlledDisease
-                    ? "rgba(166, 166, 166, 0.25)"
-                    : isTreatingGrowth
-                        ? "rgba(255, 159, 102, 0.3)"
-                    : isTreatingDisease
-                        ? "rgba(191, 91, 91, 0.36)"
-                    : (readonlyAreaStyle?.fill ??
-                        KMap.Map?.drawStyleColors?.fill ??
-                        "rgba(0, 57, 44, 0.5)");
-                const strokeColor = isControlledDisease
-                    ? "#A6A6A6"
-                    : isTreatingGrowth
-                        ? "rgba(255, 94, 0, 0.3)"
-                    : isTreatingDisease
-                        ? "rgba(224, 49, 49, 0.3)"
-                    : (readonlyAreaStyle?.stroke ??
-                        KMap.Map?.drawStyleColors?.stroke ??
-                        "#18AA8B");
-                const styles = [
-                    new Style({
-                        fill: new Fill({
-                            color: fillColor,
-                        }),
-                        stroke: new Stroke({
-                            color: strokeColor,
-                            width: 2,
-                        }),
-                    }),
-                ];
-                // 中心文本:优先 polygonCenterLabel(品种查看态显示名称);否则按面积规则
-                const trimmedCenterLabel =
-                    typeof polygonCenterLabel === "string" && polygonCenterLabel.trim() !== ""
-                        ? polygonCenterLabel.trim()
-                        : "";
-                // 面积文本显示规则:
-                // 1) 传空字符串:不显示
-                // 2) 传了值:优先显示传入值
-                // 3) 未传:按当前地块实时计算亩数
-                const isExplicitEmptyText = typeof areaText === "string" && areaText.trim() === "";
-                const hasProvidedAreaText = areaText !== undefined && areaText !== null;
-                let textValue = "";
-                if (trimmedCenterLabel) {
-                    textValue = trimmedCenterLabel;
-                } else if (!isExplicitEmptyText) {
-                    if (hasProvidedAreaText) {
-                        textValue = `${areaText}亩`;
-                    } else {
-                        try {
-                            let geom = geometry.clone();
-                            geom.transform(proj.get("EPSG:4326"), proj.get("EPSG:38572"));
-                            let areaItem = getArea(geom);
-                            areaItem = (areaItem + areaItem / 2) / 1000;
-                            textValue = `${Number(areaItem).toFixed(2)}亩`;
-                        } catch (_) {
-                            textValue = "";
-                        }
-                    }
-                }
-                const hasGrowth =
-                    resolvedGrowthOverlay &&
-                    resolvedGrowthOverlay.badgeText &&
-                    resolvedGrowthOverlay.discoveryDate;
-                if (textValue) {
-                    // 品种名与 staticRegionLayer.readonlyVariety 标签视觉一致(12px + 深绿底)
-                    const isVarietyNameLabel = !!trimmedCenterLabel;
-                    styles.push(
-                        new Style({
-                            text: new Text({
-                                text: textValue,
-                                font: isVarietyNameLabel ? "12px sans-serif" : "15px sans-serif",
-                                fill: new Fill({ color: "#ffffff" }),
-                                ...(isVarietyNameLabel
-                                    ? {
-                                          backgroundFill: new Fill({
-                                              color:
-                                                  KMap.Map?.drawStyleColors?.stroke
-                                                      ? `${KMap.Map.drawStyleColors.stroke}D9`
-                                                      : "rgba(0, 57, 44, 0.85)",
-                                          }),
-                                          padding: [2, 6, 2, 6],
-                                      }
-                                    : {}),
-                                offsetY: hasGrowth ? 14 : 0,
-                            }),
-                        })
-                    );
-                }
-                if (hasGrowth) {
-                    styles.push(
-                        new Style({
-                            text: new Text({
-                                text: resolvedGrowthOverlay.badgeText,
-                                font: "bold 13px sans-serif",
-                                fill: new Fill({ color: resolvedGrowthOverlay.badgeTextColor || "#ffffff" }),
-                                backgroundFill: new Fill({
-                                    color: resolvedGrowthOverlay.badgeBackground || "#FF7F00",
-                                }),
-                                backgroundStroke: resolvedGrowthOverlay.badgeBorderColor
-                                    ? new Stroke({ color: resolvedGrowthOverlay.badgeBorderColor, width: 1 })
-                                    : undefined,
-                                padding: [4, 10, 4, 10],
-                                offsetY: -40,
-                            }),
-                        }),
-                        new Style({
-                            text: new Text({
-                                text: `发现时间:${resolvedGrowthOverlay.discoveryDate}`,
-                                font: "12px sans-serif",
-                                fill: new Fill({ color: "#ffffff" }),
-                                offsetY: -16,
-                            }),
-                        })
-                    );
-                }
-                f.setStyle(styles);
-            }
-            that.kmap.polygonLayer.source.addFeature(f)
-        })
-        // 根据参数决定是否需要自适应地块范围
-        if (needFitView) {
-            this.fitView()
-        }
-    }
-
-
-    fitView() {
-        if (!this.kmap?.polygonLayer?.source) return;
-        const extent = this.kmap.polygonLayer.source.getExtent();
-        if (
-            !extent ||
-            !isFinite(extent[0]) ||
-            !isFinite(extent[1]) ||
-            !isFinite(extent[2]) ||
-            !isFinite(extent[3])
-        ) {
-            return;
-        }
-        this.kmap.getView().fit(extent, { duration: 500, padding: [10, 10, 10, 10] });
-    }
-
-    clearLayer() {
-        // this.kmap.removeLayer(this.clickPointLayer.layer)
-        if (this.kmap && this.kmap.polygonLayer) {
-            this.kmap.polygonLayer.source.clear();
-        }
-        if (this.staticRegionLayer && this.staticRegionLayer.source) {
-            this.staticRegionLayer.source.clear();
-        }
-    }
-
-    /** 取消当前未完成的勾画(草图在 Draw 的 overlay 上,仅 clear 多边形图层去不掉) */
-    abortOngoingDrawSketch() {
-        if (!this.kmap || !this.kmap.draw || typeof this.kmap.draw.abortDrawing !== "function") return;
-        this.kmap.draw.abortDrawing();
-    }
-
-    /**
-     * 销毁地图实例(用于从编辑态切换到仅查看时重新初始化)
-     */
-    destroyMap() {
-        this.clearLayer();
-        if (this.kmap && typeof this.kmap.destroy === "function") {
-            this.kmap.destroy();
-        }
-        this.kmap = null;
-    }
-
-    getAreaGeometry() {
-        const features = this.kmap.getLayerFeatures()
-        let geometryArr = []
-        let area = 0
-        const format = new WKT()
-        // 获取图层上的Polygon,转成WKT用于回显
-        features.forEach(item => {
-            // 使用 writeGeometry 而不是 writeFeature,因为 setLayerWkt 期望的是几何体的 WKT
-            const geometry = item.getGeometry()
-            geometryArr.push(format.writeGeometry(geometry, {
-                dataProjection: 'EPSG:4326',
-                featureProjection: this.kmap.map.getView().getProjection()
-            }))
-            let geom = geometry.clone()
-            geom.transform(proj.get("EPSG:4326"), proj.get("EPSG:38572"))
-            let areaItem = getArea(geom)
-            areaItem = (areaItem + areaItem / 2) / 1000;
-            area += areaItem
-        })
-        return { geometryArr, mianji: area.toFixed(2) }  // 修改为 mianji 字段,与创建页面保持一致
-    }
-
-    setMapPosition(center) {
-        this.kmap.getView().animate({
-            center,
-            zoom: 17,
-            duration: 500,
-        });
-        this.setMapPoint(center)
-    }
-
-    setMapPoint(coordinate) {
-        this.clickPointLayer.source.clear()
-        let point = new Feature(new Point(coordinate))
-        this.clickPointLayer.addFeature(point)
-    }
-
-    // 删除当前地块(删除最新绘制的一个地块)
-    deleteCurrentPolygon() {
-        if (!this.kmap || !this.kmap.polygonLayer) return;
-        const features = this.kmap.polygonLayer.source.getFeatures();
-        if (features && features.length > 0) {
-            const lastFeature = features[features.length - 1];
-            this.kmap.polygonLayer.source.removeFeature(lastFeature);
-        }
-    }
-
-    /**
-     * 设置只读状态区域图层(多个 polygon,不可编辑)
-     * @param {Array<{ geometry: string, status?: 'resolved' | 'unresolved', label?: string, displayMode?: string, unresolvedBlueFill?: boolean }>} regions
-     *
-     * 使用示例:
-     * drawRegionMap.setStatusRegions([
-     *   { geometry: 'MULTIPOLYGON(((...)))', status: 'resolved' },
-     *   { geometry: 'MULTIPOLYGON(((...)))', status: 'unresolved' },
-     * ]);
-     */
-    setStatusRegions(regions) {
-        if (!this.kmap || !this.staticRegionLayer || !this.staticRegionLayer.source) return;
-
-        // 仅操作只读图层,不影响当前地图的绘制 / 编辑状态
-        this.staticRegionLayer.source.clear();
-        if (!Array.isArray(regions) || regions.length === 0) return;
-
-        const format = new WKT();
-        const mapProjection = this.kmap.map.getView().getProjection();
-
-        regions.forEach((region) => {
-            if (!region || !region.geometry) return;
-            try {
-                const geometry = format.readGeometry(region.geometry, {
-                    dataProjection: "EPSG:4326",
-                    featureProjection: mapProjection,
-                });
-                const feature = new Feature({ geometry });
-                feature.set("reproductiveName", region.reproductiveName);
-                feature.set("status", region.status || "unresolved");
-                feature.set("updatedTime", region.updatedTime);
-                feature.set("label", region.label || "");
-                feature.set("displayMode", region.displayMode || "");
-                feature.set("handleStatus", region.handleStatus);
-                feature.set("lockStyleType", region.lockStyleType || "");
-                feature.set("unresolvedBlueFill", region.unresolvedBlueFill === true);
-                feature.set("regionStyleKind", region.regionStyleKind || "");
-                this.staticRegionLayer.addFeature(feature);
-            } catch (e) {
-                // 单个区域解析失败时忽略
-            }
-        });
-    }
-
-    /**
-     * 视图自适应到「只读区域图层 + 可编辑多边形图层」的联合范围
-     * 适用于同时存在接口返回区域和本地勾画区域时,保证都能出现在视野内
-     */
-    fitAllRegions() {
-        if (!this.kmap) return;
-
-        const extents = [];
-
-        // 只读状态区域图层范围
-        if (this.staticRegionLayer && this.staticRegionLayer.source) {
-            const features = this.staticRegionLayer.source.getFeatures();
-            if (features && features.length > 0) {
-                extents.push(this.staticRegionLayer.source.getExtent());
-            }
-        }
-
-        // 可编辑 polygon 图层范围
-        if (this.kmap.polygonLayer && this.kmap.polygonLayer.source) {
-            const features = this.kmap.polygonLayer.source.getFeatures();
-            if (features && features.length > 0) {
-                extents.push(this.kmap.polygonLayer.source.getExtent());
-            }
-        }
-
-        if (extents.length === 0) return;
-
-        // 计算所有范围的并集 [minX, minY, maxX, maxY]
-        const merged = extents.reduce(
-            (acc, cur) => {
-                if (!acc) return cur.slice();
-                return [
-                    Math.min(acc[0], cur[0]),
-                    Math.min(acc[1], cur[1]),
-                    Math.max(acc[2], cur[2]),
-                    Math.max(acc[3], cur[3]),
-                ];
-            },
-            null
-        );
-
-        if (merged) {
-            this.kmap.getView().fit(merged, { duration: 500, padding: [100, 100, 100, 100] });
-        }
-    }
-}
-
-export default DrawRegionMap;

+ 0 - 63
src/views/old_mini/recordDetails/components/RiskAssessPopup.vue

@@ -1,63 +0,0 @@
-<template>
-    <popup v-model:show="showValue" round class="risk-assess-popup" teleport="body">
-        <img class="risk-assess-popup__img" :src="imageSrc" alt="" />
-        <div class="risk-assess-popup__desc">
-            <div>
-                经过飞鸟智慧大脑计算,今日出现高温<span class="highlight">干旱风险3级</span>,今日温度35摄氏度,<span class="highlight">SPEI干旱指数-0.5</span>,目前处于 果皮速长期,对高温敏感。
-            </div>
-        </div>
-    </popup>
-</template>
-
-<script setup>
-import { computed } from "vue";
-import { Popup } from "vant";
-import defaultImg from "@/assets/img/common/sd-4.jpg";
-
-const props = defineProps({
-    show: {
-        type: Boolean,
-        default: false,
-    },
-    image: {
-        type: String,
-        default: "",
-    },
-});
-
-const emit = defineEmits(["update:show"]);
-
-const showValue = computed({
-    get: () => props.show,
-    set: (value) => emit("update:show", value),
-});
-
-const imageSrc = computed(() => props.image || defaultImg);
-</script>
-
-<style scoped lang="scss">
-.risk-assess-popup {
-    width: 100%;
-    padding: 10px;
-
-    &__img {
-        width: 100%;
-        height: 150px;
-        object-fit: cover;
-        border-radius: 8px;
-    }
-
-    &__desc {
-        margin-top: 10px;
-        padding: 10px;
-        border-radius: 5px;
-        background: rgba(167, 167, 167, 0.1);
-        color: #3C3C3C;
-
-        .highlight {
-            color: #2199f8;
-            font-weight: 500;
-        }
-    }
-}
-</style>

+ 0 - 1553
src/views/old_mini/recordDetails/index.vue

@@ -1,1553 +0,0 @@
-<template>
-    <div class="record-wrap">
-        <custom-header :name="t('recordDetails.workName')"></custom-header>
-        <div class="record-content">
-            <div class="record-header">
-                <span>{{ t(recordHeaderInfo.titleKey) }}</span>
-                <div class="question">{{ recordHeaderInfo.question }}</div>
-            </div>
-            <div class="record-body">
-                <div class="card-wrap">
-                    <div class="card-item">
-                        <span class="item-label">{{ t(`recordDetails.${leadDetailField.labelKey}`) }}</span>
-                        <text-ellipsis class="item-value" v-bind="textEllipsisBind"
-                            :content="leadDetailField.content" />
-                    </div>
-                    <div v-if="recordType === 'pest'" class="phenology-tip-banner">
-                        <div class="banner__left">
-                            <div class="banner__title">
-                                <span>{{ t('recordDetails.abnormalBanner') }}</span>
-                            </div>
-                            <span class="banner__desc">{{ t('recordDetails.abnormalBannerDesc') }}</span>
-                        </div>
-                        <div class="banner__btn" @click="handleAbnormalRecord">
-                            <el-icon size="17">
-                                <CameraFilled />
-                            </el-icon>
-                            <span>{{ t('recordDetails.abnormalRecord') }}</span>
-                        </div>
-                    </div>
-                    <div v-if="recordType === 'growth'" class="phenology-tip-banner">
-                        <div class="banner__left">
-                            <div class="banner__title">
-                                <span>{{ t('recordDetails.growthAbnormalBanner') }}</span>
-                            </div>
-                            <span class="banner__desc">{{ t('recordDetails.growthAbnormalBannerDesc') }}</span>
-                        </div>
-                        <div class="banner__btn" @click="handleAbnormalRecord">
-                            <span>{{ t('recordDetails.growthAbnormalRecord') }}</span>
-                        </div>
-                    </div>
-                    <template v-if="recordType === 'phenology'">
-                        <div v-for="field in trailDetailFields" :key="field.labelKey" class="card-item">
-                            <span class="item-label">{{ t(`recordDetails.${field.labelKey}`) }}</span>
-                            <text-ellipsis class="item-value" v-bind="textEllipsisBind" :content="field.content" />
-                        </div>
-                        <div class="phenology-tip-banner blue">
-                            <div class="banner__left">
-                                <div class="banner__title">{{ t('recordDetails.partitionBannerTitle') }}</div>
-                                <span class="banner__desc">{{ t('recordDetails.partitionBannerDesc') }}</span>
-                            </div>
-                            <div class="banner__btn" @click="goPartitionManage">
-                                {{ t('recordDetails.partitionManage') }}
-                            </div>
-                        </div>
-                    </template>
-                </div>
-                <template v-if="recordType === 'growth' && !showMap">
-                    <div class="growth-anomaly-tabs">
-                        <div v-for="(item, index) in growthAnomalyTabs" :key="index" class="item-tab"
-                            :class="{ 'item-tab--active': activeGrowthAnomalyIndex === index }"
-                            @click="handleGrowthAnomalyTabClick(index)">
-                            <span v-if="getGrowthTabDisplayLevel(index) > 0" class="item-tab__badge" :class="[
-                                `item-tab__badge--${getGrowthTabDisplayLevel(index)}`,
-                                { 'item-tab__badge--on-active': activeGrowthAnomalyIndex === index },
-                            ]">
-                                {{ t('agriRecord.riskLevel', { level: getGrowthTabDisplayLevel(index) }) }}
-                            </span>
-                            <span class="item-tab__text">{{ item.label }}</span>
-                        </div>
-                    </div>
-                    <div class="card-wrap growth-detail-card">
-                        <div v-for="field in trailDetailFields" :key="field.labelKey" class="card-item"
-                            :class="{ 'card-item--phenotype': field.image }">
-                            <div v-if="field.image" class="card-item__phenotype">
-                                <div class="card-item__phenotype-content">
-                                    <span class="item-label">{{ t(`recordDetails.${field.labelKey}`) }}</span>
-                                    <text-ellipsis class="item-value" v-bind="textEllipsisBind"
-                                        :content="field.content" />
-                                </div>
-                                <!-- <img class="card-item__phenotype-image" :src="field.image" alt=""
-                                    @click="handlePhenotypeImagePreview(field.image)" /> -->
-                            </div>
-                            <template v-else>
-                                <span class="item-label">{{ t(`recordDetails.${field.labelKey}`) }}</span>
-                                <text-ellipsis class="item-value" v-bind="textEllipsisBind" :content="field.content" />
-                            </template>
-                        </div>
-                    </div>
-                </template>
-                <div v-if="recordType === 'pest'" class="pest-classify-picker">
-                    <div class="pest-classify-picker__tabs" ref="pestTabsRef">
-                        <div v-for="(label, i) in pestTopLabels" :key="'top-' + i" :ref="(el) => setPestTabRef(el, i)"
-                            class="pest-classify-picker__tab"
-                            :class="{ 'pest-classify-picker__tab--active': pestTopIndex === i }"
-                            @click="handlePestTopClick(i)">{{ label }}</div>
-                    </div>
-                    <div class="pest-classify-picker__panel" ref="pestPanelRef"
-                        :style="{ '--arrow-left': `${pestPanelArrowLeft}px` }">
-                        <div class="pest-classify-picker__categories">
-                            <div v-for="(item, i) in pestCategoryLabels" :key="'cat-' + item.value"
-                                class="pest-classify-picker__category"
-                                :class="{ 'pest-classify-picker__category--active': pestCategoryIndex === i }"
-                                @click="handlePestCategoryClick(i)">{{ item.label }}</div>
-                        </div>
-                        <div class="pest-classify-picker__details">
-                            <div v-for="(item, i) in pestDetailLabels" :key="'det-' + item.value"
-                                class="pest-classify-picker__detail"
-                                :class="{ 'pest-classify-picker__detail--active': pestDetailIndex === i }"
-                                @click="handlePestDetailClick(i)">
-                                <span v-if="item.risk_level > 0" class="pest-classify-picker__badge"
-                                    :class="`pest-classify-picker__badge--${item.risk_level}`">
-                                    {{ t('agriRecord.riskLevel', { level: item.risk_level }) }}
-                                </span>
-                                <span class="pest-classify-picker__detail-text">{{ item.label }}</span>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div v-if="recordType === 'pest'" class="card-wrap pest-detail-card">
-                    <div v-for="field in trailDetailFields" :key="field.labelKey" class="card-item"
-                        :class="{ 'card-item--phenotype': field.image }">
-                        <div v-if="field.image" class="card-item__phenotype">
-                            <div class="card-item__phenotype-content">
-                                <span class="item-label">{{ t(`recordDetails.${field.labelKey}`) }}</span>
-                                <text-ellipsis class="item-value" v-bind="textEllipsisBind" :content="field.content" />
-                            </div>
-                            <!-- <img class="card-item__phenotype-image" :src="field.image" alt=""
-                                @click="handlePhenotypeImagePreview(field.image)" /> -->
-                        </div>
-                        <template v-else>
-                            <span class="item-label">{{ t(`recordDetails.${field.labelKey}`) }}</span>
-                            <text-ellipsis class="item-value" v-bind="textEllipsisBind" :content="field.content" />
-                        </template>
-                    </div>
-                </div>
-                <!-- <div class="tabs-list" v-if="showMap">
-                    <div class="item-tab" :class="{ 'item-tab--active': activeTab === index }"
-                        v-for="(item, index) in tabsList" :key="index" @click="handleTabClick(index)">{{ item.label }}
-                    </div>
-                </div> -->
-                <div class="card-wrap">
-                    <div class="border-wrap" v-if="showMap">
-                        <div class="question-box">
-                            <span>{{ workDetail.interaction_issue }}</span>
-                            <el-input class="input" v-model="input" size="large" type="number">
-                                <template #suffix>
-                                    <span>%</span>
-                                </template>
-                            </el-input>
-                        </div>
-                        <div class="my-map">
-                            <div class="map-container" ref="recordMapContainer">
-                                <div class="tip">{{ t('recordDetails.drawTip') }}</div>
-                            </div>
-                            <div class="confirm-btn-wrap">
-                                <div class="cancel-btn">{{ t('recordDetails.notReached') }}</div>
-                                <div class="confirm-btn">{{ t('recordDetails.confirmUpload') }}</div>
-                            </div>
-                        </div>
-                    </div>
-                    <div v-if="!showMap && recordType === 'phenology'" class="border-wrap no-map-wrap">
-                        <div class="question-info">
-                            <span class="title">{{ t('recordDetails.keyAssessment') }}</span>
-                            <span class="content">{{ workDetail.interaction_issue }}</span>
-                            <div class="current-status">{{ currentStatusText }}</div>
-                        </div>
-                        <div class="time-line">
-                            <GrowthStageTimeline :key="phenologyTimelineKey" v-model="growthStageIndex"
-                                :stages="growthStages" @scroll-settled="onStageScrollSettled"
-                                @locale-change="getFindPhenologyInfo" />
-                        </div>
-                        <div class="confirm-btn-wrap">
-                            <div class="confirm-btn" @click="hanldeSubmit">{{ t('recordDetails.confirmInfo') }}</div>
-                        </div>
-                    </div>
-                    <div class="phenology-track-section">
-                        <PhenologyTrackTimelineItem ref="phenologyTrackTimelineRef"
-                            :abnormalType="recordTypeObj[recordType]" />
-                    </div>
-                </div>
-            </div>
-        </div>
-        <!-- <div class="custom-bottom-fixed-btns">
-            <div class="bottom-btn secondary-btn">{{ $t('转发记录') }}</div>
-        </div> -->
-
-        <RiskAssessPopup v-model:show="showRiskAssessPopup" />
-
-        <!-- 表型特征图片大图预览 -->
-        <ImagePreviewPopup v-model:show="showPhenotypeImagePreview" :images="phenotypePreviewImages" />
-
-        <!-- 物候 上传弹窗 -->
-        <UploadProgressPopup ref="phenologyUploadPopupRef" v-model:show="showPhenologyUploadPopup"
-            :enable-identify="false" @cancel="handleCancelPhenologyUploadPopup" :upload-required="false"
-            @confirm="handleConfirmPhenologyUpload">
-            <template #header>
-                <div class="upload-progress-title">
-                    <!-- <span class="label">{{ $t('当前现状:') }}</span> -->
-                    <span class="value">{{ currentStatusText }}</span>
-                </div>
-            </template>
-        </UploadProgressPopup>
-
-        <!-- 病虫害 上传弹窗 -->
-        <UploadProgressPopup ref="pestUploadPopupRef" v-model:show="showPestUploadPopup" :enable-identify="true"
-            :init-img-arr="pestInitImgArr" :confirm-text="t('recordDetails.confirmUpload')" :upload-required="false"
-            @reset="handlePestUploadPopupReset" @cancel="handleCancelPestUploadPopup"
-            @confirm="handleConfirmPestUpload">
-            <template #header>
-                <div class="upload-form">
-                    <div v-if="recordType === 'growth'" class="form-item growth-abnormal-type-field">
-                        <div class="growth-abnormal-type-field__label">
-                            {{ t('recordDetails.growthAbnormalTypeLabel') }}
-                        </div>
-                        <el-select v-model="formData.abnormalType" class="growth-abnormal-type-select"
-                            placeholder="请选择异常类型" size="large">
-                            <el-option v-for="item in growthAbnormalTypeOptions" :key="item.value" :label="item.label"
-                                :value="item.value" />
-                        </el-select>
-                    </div>
-                    <div class="form-item special-input">
-                        <div class="item-label" style="font-size: 14px;color: #5A5A5A;">
-                            <span>{{ t('recordDetails.abnormalCount') }}</span>
-                        </div>
-                        <el-input v-model="formData.ratio" type="number" size="large"
-                            :placeholder="t('recordDetails.inputPlaceholder')">
-                            <template #suffix>
-                                {{ t('recordDetails.treeUnit') }}
-                            </template>
-                        </el-input>
-                    </div>
-                </div>
-            </template>
-            <template #footer>
-                <div class="upload-form">
-                    <div class="form-item">
-                        <div class="item-label">{{ t('recordDetails.patrolDesc') }}</div>
-                        <el-input v-model="formData.regionName" size="large"
-                            :placeholder="t('recordDetails.inputDescPlaceholder')" />
-                    </div>
-                    <div class="map-container" ref="uploadMapContainer" @click="handleMapClick">
-                        <div class="tip" v-if="!hasMapConfirmGeometry">{{ t('recordDetails.drawTip') }}</div>
-                    </div>
-                </div>
-            </template>
-        </UploadProgressPopup>
-    </div>
-</template>
-
-<script setup>
-import customHeader from "@/components/customHeader.vue";
-import PhenologyTrackTimelineItem from "@/components/pageComponents/PhenologyTrackTimelineItem.vue";
-import GrowthStageTimeline from "@/components/pageComponents/GrowthStageTimeline.vue";
-import UploadProgressPopup from "@/components/popup/UploadProgressPopup.vue";
-import ImagePreviewPopup from "@/components/popup/ImagePreviewPopup.vue";
-import RiskAssessPopup from "./components/RiskAssessPopup.vue";
-import { ref, onActivated, watch, nextTick, computed } from 'vue';
-import { useRouter, useRoute } from 'vue-router';
-import { useStore } from 'vuex';
-import { useI18n } from '@/i18n';
-import { RECORD_KEY_MAP } from '@/i18n/recordTextMap';
-import { TextEllipsis } from "vant";
-import { ElMessage } from "element-plus";
-import IndexMap from "./map/index.js";
-import pestPhenotypePlaceholder from '@/assets/img/common/sd-1.jpg';
-import pestPreviewImg2 from '@/assets/img/common/sd-2.jpg';
-import pestPreviewImg3 from '@/assets/img/common/sd-3.jpg';
-
-/** 表型大图预览 mock 多图(联调后可删) */
-const PHENOTYPE_PREVIEW_MOCK_IMAGES = [
-    pestPhenotypePlaceholder,
-    pestPreviewImg2,
-    pestPreviewImg3,
-];
-
-const router = useRouter();
-const route = useRoute();
-const store = useStore();
-const { t } = useI18n();
-
-const TYPE_LEGACY_MAP = {
-    长势异常态势跟踪: 'growth',
-    病虫害态势监控: 'pest',
-    物候跟踪记录: 'phenology',
-};
-
-const recordType = computed(() => {
-    const type = route.query.type;
-    return TYPE_LEGACY_MAP[type] || type || 'phenology';
-});
-
-const expandCollapse = computed(() => ({
-    expand: t('recordDetails.expand'),
-    collapse: t('recordDetails.collapse'),
-}));
-
-const textEllipsisBind = computed(() => ({
-    expandText: expandCollapse.value.expand,
-    collapseText: expandCollapse.value.collapse,
-    rows: 3,
-}));
-
-function goPartitionManage() {
-    router.push({ name: 'MapManage' });
-}
-
-const showMap = ref(false);
-const showRiskAssessPopup = ref(false);
-/** 表型特征图片预览弹窗 */
-const showPhenotypeImagePreview = ref(false);
-const phenotypePreviewImages = ref([]);
-
-/** 点击表型缩略图,打开大图预览 */
-function handlePhenotypeImagePreview(image) {
-    if (!image) return;
-    phenotypePreviewImages.value = PHENOTYPE_PREVIEW_MOCK_IMAGES;
-    showPhenotypeImagePreview.value = true;
-}
-
-/** 病虫害态势监控:分类选择(接入接口后可绑定 workDetail) */
-const pestTopIndex = ref(0);
-const pestCategoryIndex = ref(0);
-const pestDetailIndex = ref(0);
-const pestData = ref([]);
-
-const pestTopLabels = computed(() => [t('recordDetails.pestDisease'), t('recordDetails.pestInsect')]);
-
-const PEST_CATEGORY_DISEASE = [
-    { key: 'catDiseaseFungal', value: 1 },
-    { key: 'catDiseaseBacterial', value: 2 },
-    { key: 'catDiseaseSoilBorne', value: 3 },
-    { key: 'catDiseaseInsectBorne', value: 4 },
-    { key: 'catDiseaseViral', value: 5 },
-];
-
-const PEST_CATEGORY_INSECT = [
-    { key: 'catInsectPiercing', value: 1 },
-    { key: 'catInsectChewing', value: 2 },
-    { key: 'catInsectBoring', value: 3 },
-    { key: 'catInsectUnderground', value: 4 },
-];
-
-const pestCategoryLabels = computed(() => {
-    const list = pestTopIndex.value === 0 ? PEST_CATEGORY_DISEASE : PEST_CATEGORY_INSECT;
-    return list.map(({ key, value }) => ({
-        label: t(`recordDetails.${key}`),
-        value,
-    }));
-});
-
-const PEST_MOCK_RISK_LEVELS = [3, 2, 1, 0];
-
-const pestDetailLabels = computed(() =>
-    pestData.value.map((item, index) => ({
-        label: item.label ?? item.name ?? '',
-        value: item.value ?? item.fourth_type ?? item.id,
-        risk_level: PEST_MOCK_RISK_LEVELS[index % PEST_MOCK_RISK_LEVELS.length],
-    }))
-);
-
-const currentPestDetail = computed(() => pestData.value[pestDetailIndex.value]);
-
-/** 病虫害列表查询 */
-const getAbnormalPlan = async () => {
-    const category = pestCategoryLabels.value[pestCategoryIndex.value];
-    const params = {
-        crop_type: JSON.parse(localStorage.getItem('selectedFarmData')).farm_variety,
-        phenology_code: route.query.curCode,
-        second_type: pestTopIndex.value === 0 ? 2 : 1,
-        third_type: category?.value ?? 1,
-    };
-    const res = await VE_API.record.abnormalPlan(params);
-    if (res.code === 200 && res.data?.length) {
-        pestData.value = res.data;
-        if (pestDetailIndex.value >= res.data.length) {
-            pestDetailIndex.value = 0;
-        }
-    } else {
-        pestData.value = [];
-        pestDetailIndex.value = 0;
-    }
-};
-
-/** 病虫害分类选择 */
-const handlePestTopClick = async (index) => {
-    pestTopIndex.value = index;
-    pestCategoryIndex.value = 0;
-    pestDetailIndex.value = 0;
-    await getAbnormalPlan();
-    syncPestPanelArrow();
-};
-
-const handlePestCategoryClick = async (index) => {
-    pestCategoryIndex.value = index;
-    pestDetailIndex.value = 0;
-    await getAbnormalPlan();
-};
-
-const handlePestDetailClick = (index) => {
-    pestDetailIndex.value = index;
-};
-
-const pestTabsRef = ref(null);
-const pestTabRefs = ref([]);
-const pestPanelRef = ref(null);
-const pestPanelArrowLeft = ref(0);
-
-const setPestTabRef = (el, index) => {
-    if (el) {
-        pestTabRefs.value[index] = el;
-    }
-};
-
-const syncPestPanelArrow = () => {
-    nextTick(() => {
-        requestAnimationFrame(() => {
-            const activeTab = pestTabRefs.value[pestTopIndex.value];
-            const panel = pestPanelRef.value;
-            if (!activeTab || !panel) return;
-            const panelRect = panel.getBoundingClientRect();
-            const tabRect = activeTab.getBoundingClientRect();
-            pestPanelArrowLeft.value = tabRect.left + tabRect.width / 2 - panelRect.left;
-        });
-    });
-};
-
-watch(pestTopIndex, syncPestPanelArrow);
-watch(recordType, (type) => {
-    if (type === 'pest') {
-        syncPestPanelArrow();
-    }
-});
-
-const indexMap = new IndexMap();
-const recordMapContainer = ref(null);
-const uploadMapContainer = ref(null);
-const location = ref(null);
-const input = ref('');
-
-const tabsList = ref([
-    { label: '分区一', value: 0 },
-    { label: '分区二', value: 1 },
-    { label: '分区三', value: 2 },
-    { label: '分区四', value: 3 },
-]);
-
-/** UI 占位:接口未返回等级时,前三个 Tab 依次展示三级 / 二级 / 一级 */
-const GROWTH_TAB_MOCK_LEVELS = [3, 2, 1];
-
-function getGrowthTabDisplayLevel(index) {
-    return GROWTH_TAB_MOCK_LEVELS[index] ?? 0;
-}
-
-function resolveGrowthAnomalyOptionValue(item, index) {
-    const raw = item?.value ?? item?.id ?? item?.code ?? index;
-    if (raw === undefined || raw === null || raw === '') return '';
-    return String(raw);
-}
-
-const activeGrowthAnomalyIndex = ref(0);
-const growthAnomalyData = ref([]);
-const growthAnomalyTabs = computed(() =>
-    growthAnomalyData.value.map((item, index) => ({
-        label: item.name ?? '',
-        value: resolveGrowthAnomalyOptionValue(item, index),
-    }))
-);
-
-const currentGrowthAnomalyDetail = computed(() => growthAnomalyData.value[activeGrowthAnomalyIndex.value]);
-const handleGrowthAnomalyTabClick = (index) => {
-    activeGrowthAnomalyIndex.value = index;
-};
-
-const currentStatusText = computed(() =>
-    t('recordDetails.currentStatus', {
-        label: curStage.value?.label || '',
-        period: curStage.value?.periodTitle || '',
-    })
-);
-
-const DEFAULT_MAP_LOCATION = "POINT(113.6142086995688 23.585836479509055)";
-
-function getFarmMapLocation() {
-    try {
-        const farmData = JSON.parse(localStorage.getItem('selectedFarmData') || '{}');
-        return farmData.geom_wkt || farmData.wkt || DEFAULT_MAP_LOCATION;
-    } catch {
-        return DEFAULT_MAP_LOCATION;
-    }
-}
-
-const mapConfirmPayload = computed(() => store.state.recordDetails.mapConfirmPayload);
-
-const hasMapConfirmGeometry = computed(() => store.getters['recordDetails/mapConfirmCoordinatesArray'].length > 0);
-
-const formData = ref({
-    ratio: '',
-    regionName: '',
-    abnormalType: '',
-});
-
-const growthAbnormalTypeOptions = computed(() => {
-    if (growthAnomalyData.value.length) {
-        return growthAnomalyData.value.map((item, index) => ({
-            label: item.name ?? '',
-            value: resolveGrowthAnomalyOptionValue(item, index),
-        }));
-    }
-    return [
-        { label: t('recordDetails.tabFruitBlocked'), value: 'fruit_blocked' },
-        { label: t('recordDetails.tabSlowGrowth'), value: 'slow_growth' },
-        { label: t('recordDetails.tabVigorous'), value: 'vigorous' },
-        { label: t('recordDetails.tabWilting'), value: 'wilting' },
-    ];
-});
-
-function syncGrowthAbnormalTypeSelection() {
-    const idx = activeGrowthAnomalyIndex.value;
-    const fromApi = resolveGrowthAnomalyOptionValue(growthAnomalyData.value[idx], idx);
-    const options = growthAbnormalTypeOptions.value;
-    if (fromApi && options.some((o) => o.value === fromApi)) {
-        formData.value.abnormalType = fromApi;
-        return;
-    }
-    formData.value.abnormalType = options[idx]?.value ?? options[0]?.value ?? '';
-}
-
-function destroyMap() {
-    if (indexMap.kmap?.destroy) {
-        indexMap.kmap.destroy();
-    }
-    indexMap.kmap = null;
-}
-
-function ensureRecordMap() {
-    if (!recordMapContainer.value) return false;
-    location.value = getFarmMapLocation();
-    destroyMap();
-    indexMap.initMap(location.value, recordMapContainer.value, { editable: false, movable: false });
-    return Boolean(indexMap.kmap);
-}
-
-function syncRecordMapView() {
-    nextTick(() => {
-        setTimeout(() => {
-            if (showMap.value) return;
-            if (!ensureRecordMap()) return;
-            resizeMap();
-        }, 250);
-    });
-}
-
-function ensureUploadMap() {
-    if (!uploadMapContainer.value) return false;
-    location.value = getFarmMapLocation();
-    destroyMap();
-    indexMap.initMap(location.value, uploadMapContainer.value, { editable: false, movable: false });
-    return Boolean(indexMap.kmap);
-}
-
-function resizeMap() {
-    indexMap.kmap?.map?.updateSize?.();
-}
-
-/** 弹窗动画结束后再初始化,避免容器尺寸为 0 导致白屏 */
-function syncUploadMapView() {
-    const geometryArr = store.getters['recordDetails/mapConfirmCoordinatesArray'];
-    nextTick(() => {
-        setTimeout(() => {
-            if (!ensureUploadMap()) return;
-            resizeMap();
-            if (geometryArr.length) {
-                indexMap.setAreaGeometry(geometryArr);
-                resizeMap();
-            }
-        }, 250);
-    });
-}
-
-function syncFormFromMapConfirmPayload() {
-    if (!showPestUploadPopup.value) return;
-    syncUploadMapView();
-}
-
-const handleAbnormalRecord = () => {
-    formData.value.ratio = '';
-    formData.value.regionName = '';
-    if (recordType.value === 'growth') {
-        syncGrowthAbnormalTypeSelection();
-    } else {
-        formData.value.abnormalType = '';
-    }
-    showPestUploadPopup.value = true;
-};
-
-const handleMapClick = () => {
-    router.push({
-        name: 'MapManage', query: {
-            type: recordType.value,
-        }
-    });
-}
-
-const showPhenologyUploadPopup = ref(false);
-const showPestUploadPopup = ref(false);
-
-watch(showPestUploadPopup, (show) => {
-    if (show) {
-        if (recordType.value === 'growth') {
-            nextTick(() => syncGrowthAbnormalTypeSelection());
-        }
-        syncUploadMapView();
-    } else {
-        destroyMap();
-        if (!showMap.value) {
-            syncRecordMapView();
-        }
-    }
-});
-
-const pestInitImgArr = ref([]);
-const phenologyUploadPopupRef = ref(null);
-const pestUploadPopupRef = ref(null);
-const phenologyTrackTimelineRef = ref(null);
-const handlePestUploadPopupReset = () => {
-    pestInitImgArr.value = [];
-};
-
-const curStage = ref({});
-const curCode = ref('')
-function onStageScrollSettled(index, stage, code) {
-    shouldApplyPhenologyDefault.value = false;
-    if (stage) curStage.value = stage;
-    curCode.value = code ?? stage?.phenophase_code ?? "";
-}
-
-/** 从节点文案如「60%展开」中取出百分数,转为 0~1,如 60% -> 0.6 */
-function labelPercentToProgress(label) {
-    if (typeof label !== "string" || !label.trim()) return 0;
-    const m = label.match(/(\d+(?:\.\d+)?)\s*%/);
-    if (!m) return 0;
-    return Number(m[1]) / 100;
-}
-
-const hanldeSubmit = () => {
-    showPhenologyUploadPopup.value = true;
-};
-
-const handleCancelPhenologyUploadPopup = () => {
-    showPhenologyUploadPopup.value = false;
-};
-
-const handleConfirmPhenologyUpload = () => {
-    const farmData = JSON.parse(localStorage.getItem('selectedFarmData'));
-    const time = new Date().toISOString();
-    const params = {
-        farm_id: farmData.farm_id,
-        farm_variety: farmData.farm_variety,
-        current_code: curCode.value,
-        new_start_date: time.slice(0, 10),
-        progress: labelPercentToProgress(curStage.value.label),
-    };
-    VE_API.monitor.farmPhenologyAdjust(params).then(res => {
-        if (res.code === 200) {
-            showPhenologyUploadPopup.value = false;
-            phenologyTrackTimelineRef.value?.refresh?.();
-            ElMessage.success(t('recordDetails.confirmSuccess'));
-        }
-    });
-};
-
-const handleCancelPestUploadPopup = () => {
-    showPestUploadPopup.value = false;
-    store.commit('recordDetails/CLEAR_MAP_CONFIRM_PAYLOAD');
-};
-
-const recordTypeObj = {
-    phenology: 0,
-    pest: 1,
-    growth: 2,
-};
-function validateAbnormalRatio() {
-    const ratio = String(formData.value.ratio ?? '').trim();
-    if (ratio === '' || Number.isNaN(Number(ratio))) {
-        ElMessage.warning(t('recordDetails.ratioRequired'));
-        return false;
-    }
-    return true;
-}
-
-function validateGrowthAbnormalType() {
-    if (String(formData.value.abnormalType ?? '').trim() === '') {
-        ElMessage.warning(t('recordDetails.growthAbnormalTypeRequired'));
-        return false;
-    }
-    return true;
-}
-
-const handleConfirmPestUpload = (imgArr) => {
-    if (!validateAbnormalRatio()) return;
-    if (recordType.value === 'growth' && !validateGrowthAbnormalType()) return;
-
-    if (recordType.value === 'pest') {
-        const hasDrawnMap = store.getters['recordDetails/mapConfirmCoordinatesArray'].length > 0;
-        if (!hasDrawnMap) {
-            handleMapClick();
-            return;
-        }
-    }
-
-    const farmData = JSON.parse(localStorage.getItem('selectedFarmData'));
-    const params = {
-        farm_id: farmData.farm_id,
-        variety_code: farmData.farm_variety,
-        category_code: farmData.farm_category,
-        type: recordTypeObj[recordType.value],
-        time: new Date().toISOString().slice(0, 10),
-        zone_name: mapConfirmPayload.value.zone_name,
-        coordinates: mapConfirmPayload.value.coordinates,
-        "recog_type": "20",
-        image_urls: imgArr,
-        ...formData.value,
-    }
-    VE_API.record.writeFarmRecord(params).then(res => {
-        if (res.code === 200) {
-            showPestUploadPopup.value = false;
-            store.commit('recordDetails/CLEAR_MAP_CONFIRM_PAYLOAD');
-            phenologyTrackTimelineRef.value?.refresh?.();
-            ElMessage.success(t('recordDetails.confirmSuccess'));
-        } else {
-            ElMessage.error(res.msg);
-        }
-    });
-};
-
-const activeTab = ref(0);
-
-const handleTabClick = (index) => {
-    activeTab.value = index;
-};
-
-const workDetail = ref({});
-
-const recordHeaderInfo = computed(() => {
-    if (recordType.value === 'growth') {
-        return {
-            titleKey: 'agriRecord.growthWorkName',
-            question: currentGrowthAnomalyDetail.value?.interact_question,
-        };
-    }
-    if (recordType.value === 'pest') {
-        return {
-            titleKey: 'agriRecord.pestWorkName',
-            question: currentPestDetail.value?.interaction_reason,
-        };
-    }
-    return {
-        titleKey: 'agriRecord.phenologyWorkName',
-        question: workDetail.value.work_reason_short,
-    };
-});
-
-const leadDetailField = computed(() => {
-    if (recordType.value === 'growth') {
-        return {
-            labelKey: 'scienceLabel',
-            content: currentGrowthAnomalyDetail.value?.agri_judgment,
-        };
-    }
-    if (recordType.value === 'pest') {
-        return {
-            labelKey: 'scienceLabel',
-            content: currentPestDetail.value?.kepu,
-        };
-    }
-    return {
-        labelKey: 'farmAnalysisLabel',
-        content: workDetail.value.work_reason_detail,
-    };
-});
-
-const trailDetailFields = computed(() => {
-    if (recordType.value === 'growth') {
-        const detail = currentGrowthAnomalyDetail.value;
-        const phenotypeImage = detail?.phenotype_image ?? detail?.phenotype_img ?? detail?.image;
-        const mockLevel = getGrowthTabDisplayLevel(activeGrowthAnomalyIndex.value);
-        const anomalyLevelContent =
-            detail?.abnormal_level ??
-            detail?.anomaly_level ??
-            detail?.level_desc ??
-            detail?.harm_level ??
-            detail?.level;
-        return [
-            {
-                labelKey: 'anomalyLevelLabel',
-                content:
-                    anomalyLevelContent ||
-                    (mockLevel ? t('agriRecord.riskLevel', { level: mockLevel }) : ''),
-            },
-            {
-                labelKey: 'phenotypeLabel',
-                content: detail?.phenotype,
-                image: phenotypeImage || pestPhenotypePlaceholder,
-            },
-            { labelKey: 'highRiskLabel', content: detail?.patrol_points },
-        ];
-    }
-    if (recordType.value === 'pest') {
-        const detail = currentPestDetail.value;
-        return [
-            {
-                labelKey: 'harmLevelLabel',
-                content: detail?.harm ?? detail?.harm_desc ?? detail?.harm_level ?? detail?.damage,
-            },
-            {
-                labelKey: 'phenotypeLabel',
-                content: detail?.phenotype,
-                image: pestPhenotypePlaceholder,
-            },
-            { labelKey: 'highRiskLabel', content: detail?.patrol_points },
-        ];
-    }
-    return [
-        { labelKey: 'patrolLabel', content: workDetail.value.inspection_keypoints },
-        { labelKey: 'phenotypeLabel', content: workDetail.value.phenotypic_characteristics },
-    ];
-});
-
-const growthStageIndex = ref();
-const growthStages = ref([]);
-const phenologyRawList = ref([]);
-const phenologyTimelineKey = ref(0);
-/** 数据加载后按物候编码定位,用户拖动后不再自动覆盖 */
-const shouldApplyPhenologyDefault = ref(true);
-
-function normalizePhenologyCode(code) {
-    if (code == null || code === '') return '';
-    return String(code).trim();
-}
-
-function findStageIndexByPhenophaseCode(stages, code) {
-    const target = normalizePhenologyCode(code);
-    if (!Array.isArray(stages) || !stages.length || !target) return -1;
-    return stages.findIndex(
-        (s) => normalizePhenologyCode(s.phenophase_code) === target
-    );
-}
-
-function resolveStageIndexByPhenophaseCode(stages, rawItems, code) {
-    const target = normalizePhenologyCode(code);
-    if (!target || !Array.isArray(stages) || !stages.length) return -1;
-
-    const byFlat = findStageIndexByPhenophaseCode(stages, target);
-    if (byFlat >= 0) return byFlat;
-
-    const period = (rawItems || []).find(
-        (item) =>
-            normalizePhenologyCode(item.phenophase_code ?? item.phenophaseCode) ===
-            target
-    );
-    if (!period) return -1;
-
-    const milestones = normalizeTimeDescribe(period.time_discribe);
-    const firstLabel = milestones[0]?.label;
-    if (!firstLabel) return -1;
-
-    return stages.findIndex(
-        (s) =>
-            s.label === firstLabel &&
-            normalizePhenologyCode(s.phenophase_code) === target
-    );
-}
-
-function buildGrowthStagesFlat(rawItems) {
-    const flat = [];
-    for (const item of rawItems) {
-        const periodCode =
-            item.phenophase_code ?? item.phenophaseCode ?? '';
-        const milestones = normalizeTimeDescribe(item.time_discribe);
-        for (const t of milestones) {
-            flat.push({
-                label: t.label ?? '',
-                tags: Array.isArray(t.tags) ? t.tags : [],
-                periodTitle: item.phenophase_name ?? '',
-                periodSubtitle: item.phenophase_discribe ?? '',
-                phenophase_code:
-                    t.phenophase_code ??
-                    t.phenophaseCode ??
-                    t.code ??
-                    periodCode,
-            });
-        }
-    }
-    return flat;
-}
-
-/** 时间轴初始定位:优先 workDetail.phenelogy_code,否则路由 curCode */
-function resolveTimelineDefaultCode() {
-    const fromWork =
-        workDetail.value?.phenelogy_code ?? workDetail.value?.phenology_code;
-    return normalizePhenologyCode(fromWork ?? route.query.curCode);
-}
-
-function applyTimelineDefaultIndex(flat, rawItems) {
-    const targetCode = resolveTimelineDefaultCode();
-    const defaultIndex = resolveStageIndexByPhenophaseCode(
-        flat,
-        rawItems,
-        targetCode
-    );
-    if (defaultIndex < 0) return -1;
-
-    shouldApplyPhenologyDefault.value = true;
-    growthStageIndex.value = defaultIndex;
-    growthStages.value = flat;
-    phenologyTimelineKey.value += 1;
-
-    return defaultIndex;
-}
-
-function syncCurStageFromModel() {
-    const stages = growthStages.value;
-    if (!Array.isArray(stages) || !stages.length) return;
-    const n = stages.length;
-    let i;
-
-    if (shouldApplyPhenologyDefault.value) {
-        const targetCode = resolveTimelineDefaultCode();
-        const byCode = resolveStageIndexByPhenophaseCode(
-            stages,
-            phenologyRawList.value,
-            targetCode
-        );
-        i = byCode >= 0 ? byCode : Math.max(0, Math.floor((n - 1) / 2));
-        if (byCode >= 0) {
-            growthStageIndex.value = i;
-            shouldApplyPhenologyDefault.value = false;
-        }
-    } else {
-        i = growthStageIndex.value;
-        if (i === undefined || i === null) {
-            i = Math.max(0, Math.floor((n - 1) / 2));
-        } else {
-            i = Math.min(Math.max(0, i), n - 1);
-        }
-    }
-
-    const stage = stages[i];
-    if (stage) curStage.value = stage;
-    curCode.value = stage?.phenophase_code ?? "";
-}
-
-watch([growthStages, growthStageIndex], syncCurStageFromModel, { immediate: true });
-
-onActivated(async () => {
-    sessionStorage.removeItem('mapManageConfirmPayload');
-    syncFormFromMapConfirmPayload();
-    if (route.query.workId) {
-        await getWorkDetail();
-    }
-    if (route.query.type === 'pest') {
-        await getAbnormalPlan();
-        syncPestPanelArrow();
-    }
-    if (route.query.type === 'growth') {
-        getGrowthAnomalyInfo();
-    }
-    getFindPhenologyInfo();
-    if (!showMap.value) {
-        syncRecordMapView();
-    }
-});
-
-const getWorkDetail = async () => {
-    const res = await VE_API.monitor.getWorkDetail({ id: route.query.workId });
-    if (res.code === 200 && res.data.length) {
-        workDetail.value = res.data[0];
-        console.log(workDetail.value);
-    }
-}
-
-// 获取生长异常列表
-const getGrowthAnomalyInfo = async () => {
-    const farmData = JSON.parse(localStorage.getItem('selectedFarmData'));
-    const params = {
-        crop_type: farmData.farm_variety,
-        phenology_code: route.query.curCode,
-        farm_id: farmData.farm_id,
-    }
-    const res = await VE_API.record.growthAnomalyInfo(params);
-    if (res.code === 200 && res.data?.length) {
-        growthAnomalyData.value = res.data;
-        activeGrowthAnomalyIndex.value = 0;
-    } else {
-        growthAnomalyData.value = [];
-        activeGrowthAnomalyIndex.value = 0;
-    }
-}
-
-function normalizeTimeDescribe(raw) {
-    if (Array.isArray(raw)) return raw;
-    if (typeof raw === 'string' && raw.trim()) {
-        try {
-            const parsed = JSON.parse(raw);
-            return Array.isArray(parsed) ? parsed : [];
-        } catch {
-            return [];
-        }
-    }
-    return [];
-}
-
-const getFindPhenologyInfo = async () => {
-    const cropType = JSON.parse(localStorage.getItem('selectedFarmData')).farm_variety;
-    const res = await VE_API.monitor.getFindPhenologyInfo({ crop_type: cropType });
-    if (res.code === 200 && Array.isArray(res.data) && res.data.length) {
-        phenologyRawList.value = res.data;
-        const flat = buildGrowthStagesFlat(res.data);
-        if (!flat.length) return;
-
-        const defaultIndex = applyTimelineDefaultIndex(flat, res.data);
-        await nextTick();
-        if (defaultIndex >= 0) {
-            growthStageIndex.value = defaultIndex;
-            shouldApplyPhenologyDefault.value = false;
-            syncCurStageFromModel();
-        }
-    }
-};
-
-</script>
-
-<style scoped lang="scss">
-.record-wrap {
-    height: 100vh;
-    background: #f2f3f5;
-
-    .record-content {
-        // height: calc(100% - 120px);
-        // overflow: auto;
-        // padding-bottom: 120px;
-        height: calc(100% - 40px);
-        overflow: auto;
-        // padding-bottom: 120px;
-
-        .record-header {
-            color: #fff;
-            background: #2199F8;
-            padding: 10px;
-            font-size: 22px;
-
-            .question {
-                font-size: 14px;
-                color: #2199F8;
-                margin-top: 10px;
-                padding: 4px 5px;
-                border-radius: 2px;
-                background: #ffffff;
-            }
-        }
-
-        .record-body {
-            padding: 10px;
-
-            .tabs-list {
-                margin: 10px 0;
-                flex-shrink: 0;
-            }
-
-            .card-wrap+.phenology-tip-banner,
-            .phenology-tip-banner+.growth-anomaly-tabs,
-            .growth-anomaly-tabs+.card-wrap {
-                margin-top: 10px;
-            }
-
-            .growth-anomaly-tabs {
-                display: flex;
-                flex-wrap: wrap;
-                gap: 8px;
-                padding-top: 12px;
-
-                .item-tab {
-                    position: relative;
-                    flex: 1 1 calc(33.333% - 6px);
-                    min-width: 0;
-                    box-sizing: border-box;
-                    padding: 8px 0;
-                    border: 1px solid transparent;
-                    border-radius: 6px;
-                    background: #fff;
-                    color: #666;
-                    text-align: center;
-                    font-size: 14px;
-                    font-weight: 600;
-                }
-
-                .item-tab--active {
-                    border-color: #2199f8;
-                    background: rgba(33, 153, 248, 0.08);
-                    color: #2199f8;
-                }
-
-                .item-tab__text {
-                    display: block;
-                    width: 100%;
-                }
-
-                .item-tab__badge {
-                    position: absolute;
-                    top: -9px;
-                    right: -8px;
-                    padding: 0 6px;
-                    border-radius: 2px;
-                    font-size: 10px;
-                    font-weight: 400;
-                    line-height: 16px;
-                    color: #fff;
-                    z-index: 1;
-
-                    &--1 {
-                        background: rgba(33, 153, 248, 0.4);
-                    }
-
-                    &--2 {
-                        background: rgba(33, 153, 248, 0.7);
-                    }
-
-                    &--3 {
-                        background: #2199f8;
-                    }
-
-                    &--on-active {
-                        background: #2199f8;
-                    }
-                }
-            }
-
-            .card-wrap {
-                background: #fff;
-                border-radius: 8px;
-                padding: 10px;
-
-                .card-item {
-                    padding: 5px 10px;
-                    border-radius: 5px;
-                    background: #F6F6F6;
-
-                    .item-label {
-                        color: rgba(60, 60, 60, 0.5);
-                    }
-
-                    .item-value {
-                        display: inline;
-                    }
-
-                    &__phenotype {
-                        display: flex;
-                        align-items: flex-start;
-                        gap: 6px;
-
-                        &-content {
-                            flex: 1;
-                            min-width: 0;
-                        }
-                    }
-
-                    &__phenotype-image {
-                        width: 70px;
-                        height: 63px;
-                        object-fit: cover;
-                        border-radius: 5px;
-                        cursor: pointer;
-                    }
-                }
-
-                .card-item+.card-item {
-                    margin-top: 8px;
-                }
-
-                .border-wrap {
-                    border-radius: 8px;
-                    border: 0.5px solid #2199F8;
-                    padding: 10px;
-
-                    .question-box {
-                        border: 1px solid #2199F8;
-                        background: rgba(33, 153, 248, 0.1);
-                        border-radius: 5px;
-                        padding: 8px;
-                        color: #5A5A5A;
-
-                        .input {
-                            margin-top: 10px;
-                            width: 100%;
-                        }
-                    }
-
-
-
-                    .confirm-btn-wrap {
-                        display: flex;
-                        gap: 13px;
-
-                        div {
-                            flex: 1;
-                            text-align: center;
-                            border-radius: 5px;
-                            font-size: 16px;
-                            padding: 8px 0;
-                        }
-
-                        .cancel-btn {
-                            border: 1px solid #D6D6D6;
-                            color: #7F7F7F;
-                        }
-
-                        .confirm-btn {
-                            border: 1px solid #2199F8;
-                            background: #2199F8;
-                            color: #fff;
-                        }
-                    }
-
-                    .question-info {
-                        padding: 8px 10px;
-                        border-radius: 5px;
-                        background: rgba(33, 153, 248, 0.1);
-                        color: #909090;
-                        font-weight: 500;
-
-                        .content {
-                            font-weight: 400;
-                        }
-
-                        .current-status {
-                            color: #2199F8;
-                        }
-                    }
-
-                    .time-line {
-                        margin: 10px 0;
-                    }
-                }
-            }
-
-            .card-wrap+.card-wrap {
-                margin-top: 10px;
-            }
-
-            .pest-classify-picker {
-                padding: 10px;
-                background: #f2f3f5;
-                border-radius: 8px;
-                display: flex;
-                flex-direction: column;
-                align-items: center;
-
-                &__tabs {
-                    position: relative;
-                    z-index: 2;
-                    display: inline-flex;
-                    width: fit-content;
-                    padding: 3px;
-                    border-radius: 4px;
-                    background: #fff;
-                    box-sizing: border-box;
-                }
-
-                &__tab {
-                    position: relative;
-                    padding: 6px 28px;
-                    border-radius: 4px;
-                    font-size: 13px;
-                    line-height: 18px;
-                    color: #767676;
-                    text-align: center;
-                    box-sizing: border-box;
-
-                    &--active {
-                        background: #2199f8;
-                        color: #fff;
-                    }
-                }
-
-                &__panel {
-                    position: relative;
-                    align-self: stretch;
-                    width: 100%;
-                    margin-top: 10px;
-                    padding: 12px 10px 10px;
-                    border-radius: 4px;
-                    background: #fff;
-                    box-sizing: border-box;
-
-                    &::before {
-                        content: '';
-                        position: absolute;
-                        top: -7px;
-                        left: var(--arrow-left, 50%);
-                        transform: translateX(-50%);
-                        width: 0;
-                        height: 0;
-                        border-left: 8px solid transparent;
-                        border-right: 8px solid transparent;
-                        border-bottom: 8px solid #fff;
-                        z-index: 3;
-                    }
-                }
-
-                &__categories {
-                    display: flex;
-                    justify-content: space-between;
-                    gap: 2px;
-                    margin-bottom: 10px;
-                    overflow-x: auto;
-                    -webkit-overflow-scrolling: touch;
-                }
-
-                &__category {
-                    position: relative;
-                    flex: 1;
-                    padding-bottom: 5px;
-                    font-size: 13px;
-                    color: #909090;
-                    text-align: center;
-
-                    &--active {
-                        color: #333;
-                        border-bottom: 2px solid #3A3A3A;
-                    }
-                }
-
-                &__details {
-                    display: grid;
-                    grid-template-columns: repeat(4, 1fr);
-                    gap: 10px;
-                    padding-top: 6px;
-                }
-
-                &__detail {
-                    position: relative;
-                    display: flex;
-                    align-items: center;
-                    justify-content: center;
-                    padding: 5px 6px;
-                    border: 1px solid transparent;
-                    border-radius: 4px;
-                    background: #f5f5f5;
-                    color: #909090;
-                    font-size: 12px;
-                    text-align: center;
-                    box-sizing: border-box;
-
-                    &--active {
-                        border-color: #2199f8;
-                        background: rgba(33, 153, 248, 0.1);
-                        color: #2199f8;
-                    }
-                }
-
-                &__detail-text {
-                    display: block;
-                    width: 100%;
-                    overflow: hidden;
-                    text-overflow: ellipsis;
-                    white-space: nowrap;
-                }
-
-                &__badge {
-                    position: absolute;
-                    top: -9px;
-                    right: -8px;
-                    padding: 0 5px;
-                    border-radius: 2px;
-                    font-size: 10px;
-                    color: #fff;
-                    z-index: 1;
-
-                    &--1 {
-                        background: rgba(33, 153, 248, 0.35);
-                    }
-
-                    &--2 {
-                        background: rgba(33, 153, 248, 0.65);
-                    }
-
-                    &--3 {
-                        background: #2199f8;
-                    }
-                }
-            }
-
-            .phenology-track-section {
-                margin-top: 15px;
-                display: flex;
-                flex-direction: column;
-                gap: 16px;
-            }
-        }
-    }
-
-    .phenology-tip-banner {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        gap: 8px;
-        padding: 10px;
-        border-radius: 8px;
-        background: rgba(255, 149, 61, 0.1);
-        border: 1px solid rgba(255, 149, 61, 0.5);
-        margin-top: 10px;
-
-        .banner__left {
-            flex: 1;
-
-            .banner__title {
-                font-size: 16px;
-                font-weight: 600;
-                color: #FF953D;
-            }
-
-            .banner__desc {
-                font-size: 12px;
-                color: rgba(0, 0, 0, 0.4);
-            }
-        }
-
-        .banner__btn {
-            display: flex;
-            align-items: center;
-            gap: 4px;
-            padding: 7px 16px;
-            border-radius: 25px;
-            color: #ffffff;
-            background: linear-gradient(180deg, #FFB273 0%, #FF953D 100%);
-        }
-
-        &.blue {
-            background: #F1F8FE;
-            border: 1px solid rgba(33, 153, 248, 0.5);
-
-            .banner__title {
-                color: #2199F8;
-            }
-
-            .banner__btn {
-                background: linear-gradient(180deg, #8ACBFF 0%, #2199F8 100%);
-            }
-        }
-    }
-}
-
-// .my-map {
-//     width: 100%;
-
-//     .map-container {
-//         width: 100%;
-//         height: 170px;
-//         margin: 10px 0;
-//         clip-path: inset(0px round 5px);
-//         position: relative;
-
-//         .tip {
-//             position: absolute;
-//             top: 0;
-//             left: 0;
-//             color: #fff;
-//             padding: 5px 10px;
-//             border-radius: 5px;
-//             background: rgba(0, 0, 0, 0.6);
-//             z-index: 2;
-//         }
-//     }
-// }
-
-.map-container {
-    width: 100%;
-    height: 170px;
-    margin: 10px 0;
-    clip-path: inset(0px round 5px);
-    position: relative;
-
-    .tip {
-        position: absolute;
-        top: 0;
-        left: 0;
-        color: #fff;
-        padding: 5px 10px;
-        border-radius: 5px;
-        background: rgba(0, 0, 0, 0.6);
-        z-index: 2;
-    }
-}
-
-.upload-progress-title {
-    color: rgba(60, 60, 60, 0.5);
-    font-weight: 500;
-    background: rgba(33, 153, 248, 0.1);
-    border-radius: 5px;
-    padding: 5px 10px;
-    margin-bottom: 12px;
-
-    .value {
-        color: #2199F8;
-    }
-}
-
-.upload-form {
-    .form-item {
-        margin-bottom: 10px;
-
-        .item-label {
-            font-size: 16px;
-            margin-bottom: 8px;
-
-            .optional {
-                font-size: 14px;
-                color: rgba(0, 0, 0, 0.2);
-            }
-        }
-    }
-
-    .growth-abnormal-type-field {
-        margin-bottom: 12px;
-
-        &__label {
-            font-size: 16px;
-            color: #000;
-            margin-bottom: 10px;
-        }
-    }
-
-    .growth-abnormal-type-select {
-        width: 100%;
-
-        :deep(.el-select__wrapper) {
-            min-height: 44px;
-            padding: 4px 12px;
-            border-radius: 6px;
-            border: 1px solid #d6d6d6;
-            box-shadow: none;
-            background: #fff;
-        }
-    }
-
-    .special-input {
-        padding: 8px;
-        background: rgba(33, 153, 248, 0.1);
-        border-radius: 5px;
-        border: 1px solid #2199F8;
-    }
-}
-</style>

+ 0 - 472
src/views/old_mini/recordDetails/mapManage.vue

@@ -1,472 +0,0 @@
-<template>
-    <div class="map-manage">
-        <custom-header :name="$t('勾画区域')" />
-        <div class="map-manage-content">
-            <!-- <locationSearch class="location-search" @change="handleLocationChange"></locationSearch> -->
-            <div class="map-container" ref="mapContainer"></div>
-            <div class="map-tip" v-if="isConstrainedZoneMode">
-                {{ recordType === 'growth'
-                    ? $t('建立您的专属长势异常地图档案,生成分区靶向治疗方案')
-                    : $t('建立您的专属病虫害地图档案,生成分区靶向治疗方案') }}
-            </div>
-            <div class="new-region-btn" v-show="!drawingEnabled && !isConstrainedZoneMode" @click="onStartRegionDrawing">
-                {{ $t('新建管理分区') }}</div>
-            <div class="map-icon" v-show="drawingEnabled && !isConstrainedZoneMode" @click="handleMapIconClick">
-                <img src="@/assets/img/map/map-icon.png" alt="">
-            </div>
-            <div class="map-legend" :class="{ 'map-legend--growth': recordType === 'growth' }" v-if="isConstrainedZoneMode">
-                <div class="map-legend__item">
-                    <span class="map-legend__dot map-legend__dot--past"></span>
-                    <span class="map-legend__text">{{ recordType === 'growth' ? $t('过往长势异常') : $t('过往病虫害') }}</span>
-                </div>
-                <div class="map-legend__item">
-                    <span class="map-legend__dot map-legend__dot--zone"></span>
-                    <span class="map-legend__text">{{ recordType === 'growth' ? $t('长势异常区域') : $t('病虫害区域') }}</span>
-                </div>
-            </div>
-        </div>
-        <div class="custom-bottom-fixed-btns" :style="{ justifyContent: drawingEnabled ? 'space-between' : 'center' }">
-            <template v-if="drawingEnabled">
-                <div class="bottom-btn secondary-btn" @click="handleClearDraw">{{ $t('取消勾选') }}</div>
-                <div class="bottom-btn primary-btn" @click="handleConfirmDraw">{{ $t('确认区域') }}</div>
-            </template>
-            <div v-else-if="isConstrainedZoneMode" class="bottom-btn primary-btn" @click="handleConfirmDraw">{{
-                $t('确认区域') }}</div>
-            <div v-else class="bottom-btn secondary-btn">{{ $t('邀请勾画') }}</div>
-        </div>
-
-        <UploadProgressPopup ref="uploadProgressPopupRef" v-model:show="showUploadProgressPopup"
-            :confirm-params="{ regionName: formData.regionName }" :confirm-text="$t('点击上传')"
-            @cancel="handleCancelUploadPopup" @confirm="handleConfirmUpload">
-            <template #header>
-                <div class="upload-form">
-                    <div class="form-item">
-                        <div class="item-label">{{ $t('区域名称') }}</div>
-                        <el-input v-model="formData.regionName" size="large" :placeholder="$t('请输入区域名称')" />
-                    </div>
-                    <div class="form-item">
-                        <div class="item-label">{{ $t('品种') }}<span class="optional">{{ $t('(多选)') }}</span></div>
-                        <el-select v-model="value" :placeholder="$t('选择品种')" size="large">
-                            <el-option v-for="item in options" :key="item.value" :label="item.label"
-                                :value="item.value" />
-                        </el-select>
-                    </div>
-                    <div class="form-item">
-                        <div class="item-label">{{ $t('物候时间') }}</div>
-                        <GrowthStageTimeline v-model="growthStageIndex" :stages="growthStages" />
-                    </div>
-                </div>
-            </template>
-        </UploadProgressPopup>
-
-        <RegionNamePopup v-model:show="showRegionNamePopup" @confirm="handleRegionNameConfirm" />
-    </div>
-</template>
-
-<script setup>
-import customHeader from "@/components/customHeader.vue";
-import locationSearch from "@/components/pageComponents/locationSearch.vue";
-import GrowthStageTimeline from "@/components/pageComponents/GrowthStageTimeline.vue";
-import UploadProgressPopup from "@/components/popup/UploadProgressPopup.vue";
-import RegionNamePopup from "./components/RegionNamePopup.vue";
-import MapManage from "./map/mapManage.js";
-import * as util from "@/common/ol_common.js";
-import { ref, onActivated, onDeactivated, computed, nextTick } from "vue";
-import { ElMessageBox, ElMessage } from "element-plus";
-import { useRouter, useRoute } from "vue-router";
-import { useStore } from "vuex";
-import { normalizeMapCoordinates } from "@/store/modules/recordDetails/index.js";
-
-const router = useRouter();
-const route = useRoute();
-const store = useStore();
-const recordType = computed(() => route.query.type);
-const isConstrainedZoneMode = computed(() => recordType.value === 'pest' || recordType.value === 'growth');
-const zoneStyle = computed(() => (
-    recordType.value === 'growth'
-        ? { fill: 'rgba(124, 46, 0, 0.5)', fillSelected: 'rgba(124, 46, 0, 0.5)', stroke: '#FF7300' }
-        : undefined
-));
-const mapManage = new MapManage();
-
-const DEFAULT_MAP_LOCATION = "POINT(113.6142086995688 23.585836479509055)";
-
-function getFarmMapLocation() {
-    try {
-        const farmData = JSON.parse(localStorage.getItem('selectedFarmData') || '{}');
-        return farmData.geom_wkt || farmData.wkt || DEFAULT_MAP_LOCATION;
-    } catch {
-        return DEFAULT_MAP_LOCATION;
-    }
-}
-
-function getFarmMapCoordinate() {
-    return util.wktCastGeom(getFarmMapLocation()).getFirstCoordinate();
-}
-
-const mapContainer = ref(null);
-const drawingEnabled = ref(false);
-
-const showUploadProgressPopup = ref(false);
-const showRegionNamePopup = ref(false);
-const uploadProgressPopupRef = ref(null);
-const formData = ref({
-    regionName: '',
-});
-
-const options = ref([
-    {
-        value: '1',
-        label: '品种1',
-    },
-    {
-        value: '2',
-        label: '品种2',
-    },
-]);
-
-const growthStageIndex = ref();
-const growthStages = ref([
-    {
-        label: "5%萌动",
-        tags: ["最佳给肥点"],
-        periodTitle: "生育期",
-        periodSubtitle: "描述的小字描述的",
-    },
-    {
-        label: "30%展开",
-        periodTitle: "生育期",
-        periodSubtitle: "描述的小字描述的",
-    },
-    {
-        label: "60%展开",
-        tags: ["最佳防治点", "最佳追肥点"],
-        periodTitle: "生育期",
-        periodSubtitle: "描述的小字描述的",
-    },
-    {
-        label: "30%红黄",
-        periodTitle: "生育期",
-        periodSubtitle: "描述的小字描述的",
-    },
-    {
-        label: "60%红黄",
-        periodTitle: "生育期",
-        periodSubtitle: "描述的小字描述的",
-    },
-]);
-
-const handleCancelUploadPopup = () => {
-    showUploadProgressPopup.value = false;
-};
-
-const handleConfirmUpload = () => {
-    showUploadProgressPopup.value = false;
-};
-
-const confirmPayload = ref({
-    zone_name: '',
-    coordinates: '',
-    gridMultipolygon: '',
-    selectedGridIds: [],
-});
-
-/** 病虫害/长势异常:仅区域名称弹窗确认后才写入 store */
-const constrainedZoneMapPayloadCommitted = ref(false);
-const constrainedZoneMapStoreSnapshot = ref(null);
-
-function buildMapConfirmPayload(overrides = {}) {
-    const selectedGrids = mapManage.getSelectedGrids();
-    const drawnPayload = mapManage.getAreaGeometry();
-    const hasGridLayer = Boolean(mapManage.kmap && mapManage.gridLayer?.source);
-    const hasDrawnAreas = drawnPayload.geometryArr.length > 0;
-    return {
-        zone_name: confirmPayload.value.zone_name,
-        coordinates: hasDrawnAreas
-            ? mapManage.mergeGeometryWkts(drawnPayload.geometryArr)
-            : (selectedGrids.gridIds.length
-                ? mapManage.mergeGeometryWkts(selectedGrids.geometryArr)
-                : confirmPayload.value.coordinates),
-        gridMultipolygon: mapManage.getBoundaryWkt() || confirmPayload.value.gridMultipolygon,
-        selectedGridIds: hasGridLayer ? selectedGrids.gridIds : confirmPayload.value.selectedGridIds,
-        ...overrides,
-    };
-}
-
-const handleRegionNameConfirm = (regionName) => {
-    confirmPayload.value.zone_name = regionName;
-    constrainedZoneMapPayloadCommitted.value = true;
-    store.commit('recordDetails/SET_MAP_CONFIRM_PAYLOAD', buildMapConfirmPayload({
-        zone_name: regionName,
-    }));
-    router.back();
-};
-
-const onStartRegionDrawing = () => {
-    drawingEnabled.value = true;
-    mapManage.enableRegionDrawing();
-};
-
-
-const handleMapIconClick = () => {
-    mapManage.setMapPosition(getFarmMapCoordinate());
-};
-
-const handleClearDraw = () => {
-    ElMessageBox.confirm("确定清除地图上已勾画的所有地块?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-    })
-        .then(() => {
-            mapManage.clearLayer();
-        })
-        .catch(() => { });
-};
-
-const handleConfirmDraw = () => {
-    if (isConstrainedZoneMode.value) {
-        const payload = mapManage.getAreaGeometry();
-        if (!payload.geometryArr.length) {
-            ElMessage.warning("请先勾画地块");
-            return;
-        }
-        confirmPayload.value.coordinates = mapManage.mergeGeometryWkts(payload.geometryArr);
-        confirmPayload.value.gridMultipolygon = mapManage.getBoundaryWkt() || confirmPayload.value.gridMultipolygon;
-        showRegionNamePopup.value = true;
-    } else {
-        uploadProgressPopupRef.value?.uploadReset?.();
-        showUploadProgressPopup.value = true;
-    }
-};
-
-function initMapManageView() {
-    if (!mapContainer.value) return;
-    mapManage.destroyMap();
-    mapManage.initMap(getFarmMapLocation(), mapContainer.value, {
-        editable: !isConstrainedZoneMode.value,
-        constrainedDrawing: isConstrainedZoneMode.value,
-        zoneStyle: zoneStyle.value,
-        onDrawOutsideBoundary: isConstrainedZoneMode.value
-            ? () => ElMessage.warning('请在虚线管理区域内勾画')
-            : undefined,
-    });
-
-    const stored = store.state.recordDetails.mapConfirmPayload;
-    if (store.getters['recordDetails/hasMapConfirmPayload']) {
-        confirmPayload.value = {
-            zone_name: stored.zone_name || '',
-            coordinates: stored.coordinates,
-            gridMultipolygon: stored.gridMultipolygon || '',
-            selectedGridIds: Array.isArray(stored.selectedGridIds) ? [...stored.selectedGridIds] : [],
-        };
-        if (!isConstrainedZoneMode.value) {
-            const geometryArr = store.getters['recordDetails/mapConfirmCoordinatesArray'];
-            if (geometryArr.length) {
-                mapManage.setAreaGeometry(geometryArr);
-            }
-        }
-    } else {
-        mapManage.clearLayer();
-        confirmPayload.value = {
-            zone_name: '',
-            coordinates: '',
-            gridMultipolygon: '',
-            selectedGridIds: [],
-        };
-    }
-
-    if (isConstrainedZoneMode.value) {
-        mapManage.enableMapInteraction();
-        if (confirmPayload.value.gridMultipolygon) {
-            mapManage.setBoundaryWkt(confirmPayload.value.gridMultipolygon);
-            mapManage.enableConstrainedDrawing();
-            const coords = normalizeMapCoordinates(confirmPayload.value.coordinates);
-            if (coords.length) {
-                mapManage.setDrawnAreaGeometry(coords);
-            }
-        } else if (!confirmPayload.value.coordinates) {
-            const wkt = mapManage.setDefaultSquareAtCenter(60);
-            if (wkt) {
-                confirmPayload.value.gridMultipolygon = wkt;
-            }
-        } else {
-            const coords = normalizeMapCoordinates(confirmPayload.value.coordinates);
-            if (coords.length === 1 && !confirmPayload.value.gridMultipolygon) {
-                mapManage.setBoundaryWkt(coords[0]);
-                mapManage.enableConstrainedDrawing();
-            } else if (coords.length) {
-                const wkt = mapManage.setDefaultSquareAtCenter(60);
-                if (wkt) {
-                    confirmPayload.value.gridMultipolygon = wkt;
-                    mapManage.setDrawnAreaGeometry(coords);
-                }
-            }
-        }
-    }
-}
-
-onActivated(() => {
-    constrainedZoneMapPayloadCommitted.value = false;
-    if (isConstrainedZoneMode.value) {
-        const stored = store.state.recordDetails.mapConfirmPayload;
-        constrainedZoneMapStoreSnapshot.value = {
-            zone_name: stored.zone_name || '',
-            coordinates: stored.coordinates,
-            gridMultipolygon: stored.gridMultipolygon || '',
-            selectedGridIds: Array.isArray(stored.selectedGridIds) ? [...stored.selectedGridIds] : [],
-        };
-    }
-    nextTick(() => initMapManageView());
-});
-
-onDeactivated(() => {
-    if (isConstrainedZoneMode.value && !constrainedZoneMapPayloadCommitted.value && constrainedZoneMapStoreSnapshot.value) {
-        store.commit('recordDetails/SET_MAP_CONFIRM_PAYLOAD', { ...constrainedZoneMapStoreSnapshot.value });
-    }
-    mapManage.destroyMap();
-    drawingEnabled.value = false;
-    constrainedZoneMapPayloadCommitted.value = false;
-    constrainedZoneMapStoreSnapshot.value = null;
-});
-</script>
-
-<style scoped lang="scss">
-.map-manage {
-    width: 100%;
-    height: 100vh;
-
-    .map-manage-content {
-        height: calc(100% - 120px);
-        position: relative;
-
-        .location-search {
-            width: calc(100% - 24px);
-            position: absolute;
-            top: 12px;
-            left: 12px;
-            z-index: 2;
-        }  
-
-        .map-container {
-            width: 100%;
-            height: 100%;
-        }
-
-        .map-tip {
-            position: absolute;
-            top: 30px;
-            left: 50%;
-            transform: translate(-50%, -50%);
-            z-index: 2;
-            padding: 10px;
-            font-size: 12px;
-            color: #fff;
-            text-align: center;
-            background: rgba(0, 0, 0, 0.5);
-            border-radius: 25px;
-            box-sizing: border-box;
-            width: max-content;
-        }
-
-        .map-icon {
-            position: absolute;
-            width: 35px;
-            height: 35px;
-            bottom: 32px;
-            right: 12px;
-            z-index: 2;
-            background: #fff;
-            border-radius: 8px;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-
-            img {
-                width: 17px;
-                height: 19px;
-            }
-        }
-
-        .new-region-btn {
-            position: absolute;
-            top: 50%;
-            left: 50%;
-            transform: translate(-50%, -50%);
-            z-index: 3;
-            background: #2199F8;
-            color: #fff;
-            border-radius: 25px;
-            padding: 10px 24px;
-        }
-
-        .map-legend {
-            position: absolute;
-            bottom: 16px;
-            left: 16px;
-            z-index: 2;
-            display: flex;
-            align-items: center;
-            gap: 20px;
-            padding: 6px 20px;
-            background: #fff;
-            border-radius: 25px;
-
-            &__item {
-                display: flex;
-                align-items: center;
-                gap: 5px;
-            }
-
-            &__dot {
-                width: 14px;
-                height: 14px;
-                border-radius: 50%;
-
-                &--past {
-                    background: rgba(100, 0, 0, 0.4);
-                }
-
-                &--zone {
-                    background: rgba(0, 0, 0, 0.57);
-                }
-            }
-
-            &--growth {
-                .map-legend__dot--past {
-                    background: rgba(124, 46, 0, 0.3);
-                }
-            }
-        }
-    }
-
-    .custom-bottom-fixed-btns {
-        justify-content: space-between;
-
-        .bottom-btn {
-            padding: 10px 20px;
-        }
-
-        .primary-btn {
-            background: #2199F8;
-            color: #fff;
-        }
-    }
-
-    .upload-form {
-        .form-item {
-            margin-bottom: 10px;
-
-            .item-label {
-                font-size: 16px;
-                margin-bottom: 8px;
-
-                .optional {
-                    font-size: 14px;
-                    color: rgba(0, 0, 0, 0.2);
-                }
-            }
-        }
-    }
-}
-</style>

+ 0 - 144
src/views/old_mini/work_detail/components/mapInfo.vue

@@ -1,144 +0,0 @@
-<template>
-    <div class="view-area-page">
-        <custom-header :name="t('查看区域')" isGoBack @goback="handleBack" />
-        <div class="map-wrapper">
-            <div class="map" ref="mapContainer"></div>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-import customHeader from "@/components/customHeader.vue";
-import { ref, nextTick, onMounted, onActivated, onDeactivated, onBeforeUnmount } from "vue";
-import { useRouter } from "vue-router";
-import WKT from "ol/format/WKT.js";
-import AreaMap from "./areaMap.js";
-
-const { t } = useI18n();
-const router = useRouter();
-
-const mapContainer = ref(null);
-const areaMap = new AreaMap();
-const wktFmt = new WKT();
-const MAP_CENTER_FALLBACK = "POINT(110.479 29.128)";
-
-/** 临时 mock 数据,后续替换为接口返回 */
-const MOCK_ZONES = [
-    {
-        zone_geometry:
-            "POLYGON((110.4735 29.1325, 110.4765 29.1340, 110.4785 29.1310, 110.4755 29.1295, 110.4735 29.1325))",
-        zone_name: "04/19-分区一",
-        fly_speed: "5.2m/s",
-        fill_color: "rgba(224, 49, 49, 0.45)",
-        stroke_color: "#E03131",
-        label_style: "card",
-    },
-    {
-        zone_geometry:
-            "POLYGON((110.4765 29.1290, 110.4795 29.1305, 110.4815 29.1275, 110.4785 29.1260, 110.4765 29.1290))",
-        zone_name: "04/20-分区二",
-        fly_speed: "4.8m/s",
-        fill_color: "rgba(224, 49, 49, 0.45)",
-        stroke_color: "#E03131",
-        label_style: "card",
-    },
-    {
-        zone_geometry:
-            "POLYGON((110.4795 29.1315, 110.4825 29.1330, 110.4845 29.1300, 110.4815 29.1285, 110.4795 29.1315))",
-        zone_name: "04/21-分区三",
-        fly_speed: "6.0m/s",
-        fill_color: "rgba(224, 49, 49, 0.45)",
-        stroke_color: "#E03131",
-        label_style: "card",
-    },
-    {
-        zone_geometry:
-            "POLYGON((110.4710 29.1280, 110.4740 29.1295, 110.4755 29.1265, 110.4725 29.1250, 110.4710 29.1280))",
-        zone_name: "妃子笑",
-        fill_color: "rgba(55, 55, 55, 0.55)",
-        stroke_color: "#FFFFFF",
-        label_style: "simple",
-    },
-    {
-        zone_geometry:
-            "POLYGON((110.4820 29.1255, 110.4850 29.1270, 110.4865 29.1240, 110.4835 29.1225, 110.4820 29.1255))",
-        zone_name: "04/22-分区四",
-        fly_speed: "5.5m/s",
-        fill_color: "rgba(120, 45, 45, 0.55)",
-        stroke_color: "#E03131",
-        label_style: "card",
-    },
-];
-
-function wktCenterPointFromZones(zones) {
-    const list = Array.isArray(zones) ? zones : [];
-    for (const zone of list) {
-        const wkt = zone?.zone_geometry;
-        if (!wkt || typeof wkt !== "string") continue;
-        try {
-            const c = wktFmt.readGeometry(wkt.trim()).getFirstCoordinate();
-            return `POINT(${c[0]} ${c[1]})`;
-        } catch {
-            /* try next zone */
-        }
-    }
-    return MAP_CENTER_FALLBACK;
-}
-
-const destroyMap = () => {
-    areaMap.destroyMap();
-};
-
-const initMap = () => {
-    nextTick(() => {
-        if (!mapContainer.value) return;
-        const zones = MOCK_ZONES;
-        areaMap.destroyMap();
-        areaMap.initMap(wktCenterPointFromZones(zones), mapContainer.value, { interactive: true });
-        areaMap.initZones(zones);
-    });
-};
-
-const handleBack = () => {
-    router.back();
-};
-
-onMounted(() => {
-    initMap();
-});
-
-onActivated(() => {
-    initMap();
-});
-
-onDeactivated(() => {
-    destroyMap();
-});
-
-onBeforeUnmount(() => {
-    destroyMap();
-});
-</script>
-
-<style lang="scss" scoped>
-.view-area-page {
-    width: 100%;
-    height: 100vh;
-    display: flex;
-    flex-direction: column;
-    overflow: hidden;
-    background: #f2f3f5;
-}
-
-.map-wrapper {
-    flex: 1;
-    min-height: 0;
-    position: relative;
-
-    .map {
-        width: 100%;
-        height: 100%;
-    }
-}
-</style>