Просмотр исходного кода

feat:修改农事规划页面

wangsisi 14 часов назад
Родитель
Сommit
c5dcfcf6a6

+ 0 - 14
src/router/globalRoutes.js

@@ -66,20 +66,6 @@ export default [
         name: "Consult",
         name: "Consult",
         component: () => import("@/views/old_mini/chat_frame/consult.vue"),
         component: () => import("@/views/old_mini/chat_frame/consult.vue"),
     },
     },
-    // 农事记录详情
-    {
-        path: "/status_detail",
-        name: "StatusDetail",
-        meta: { keepAlive: true },
-        component: () => import("@/views/old_mini/agri_record/subPages/statusDetail.vue"),
-    },
-    // 转发处方页面
-    {
-        path: "/prescription_page",
-        name: "PrescriptionPage",
-        meta: { keepAlive: true },
-        component: () => import("@/views/old_mini/agri_record/subPages/prescriptionPage.vue"),
-    },
     // 农事互动列表
     // 农事互动列表
     {
     {
         path: "/interaction_list",
         path: "/interaction_list",

+ 23 - 0
src/views/old_mini/agri_file/index.vue

@@ -201,7 +201,30 @@ onActivated(() => {
     const savedFarmId = localStorage.getItem("selectedFarmId");
     const savedFarmId = localStorage.getItem("selectedFarmId");
     selectedGardenId.value = savedFarmId ? Number(savedFarmId) : null;
     selectedGardenId.value = savedFarmId ? Number(savedFarmId) : null;
     gardenListRef.value?.refreshFarmList?.();
     gardenListRef.value?.refreshFarmList?.();
+    getFarmRiskAndTracking();
 });
 });
+
+const getFarmRiskAndTracking = async () => {
+    const selectedFarmData = JSON.parse(localStorage.getItem("selectedFarmData"));
+    const res = await VE_API.monitor.getFarmRiskAndTracking({
+        farm_id: selectedGardenId.value,
+        crop_type: selectedFarmData.farm_variety,
+        category_code: selectedFarmData.farm_category
+    });
+    if (res.code === 200) {
+        console.log(res)
+        // trackingList.value = res.data;
+    }
+}
+
+// const handleTrendMonitorCardClick = (item) => {
+//     saveArchivesOuterScrollTop();
+//     blockArchivesScrollSaveOnce.value = true;
+//     router.push({
+//         path: "/record_details",
+//         query: { workId: item?.first_work?.work_id, type: item?.workType, curCode:currentPheCode.value  },
+//     });
+// };
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 2 - 182
src/views/old_mini/agri_record/index.vue

@@ -12,38 +12,9 @@
             <garden-list ref="gardenListRef" :garden-id="selectedGardenId" @loaded="handleGardenLoaded"
             <garden-list ref="gardenListRef" :garden-id="selectedGardenId" @loaded="handleGardenLoaded"
                 @selectGarden="handleGardenSelected" />
                 @selectGarden="handleGardenSelected" />
         </div>
         </div>
-        <!-- 作物档案:趋势监测与 Tab 固定顶部,仅农事列表区域滚动 -->
+        <!-- 作物档案:Tab 固定顶部,仅农事列表区域滚动 -->
         <div class="archives-time-line" v-show="activeGardenTab === 'current'">
         <div class="archives-time-line" v-show="activeGardenTab === 'current'">
             <div class="archives-time-line-fixed">
             <div class="archives-time-line-fixed">
-                <div class="trend-monitor-list">
-                    <div class="trend-monitor-card" @click="handleTrendMonitorCardClick(item)"
-                        v-for="(item, index) in visibleTrendMonitorList" :key="index">
-                        <div class="card-header">
-                            <div class="header-left">
-                                <span class="title">{{ item?.first_work?.work_name }}</span>
-                                <span class="level-tag" v-if="item?.risk_level">{{ t('agriRecord.riskLevel', { level: item.risk_level }) }}</span>
-                            </div>
-                            <div class="status-tag" v-if="item?.status === 0">{{ t('agriRecord.pendingRecord') }}</div>
-                        </div>
-                        <div class="card-row">
-                            <div class="reason-text">{{ item?.first_work?.work_reason_short }}</div>
-                            <div class="question-tag">{{ item?.first_work?.interaction_issue }}</div>
-                        </div>
-                        <div class="record-list">
-                            <div class="record-item" v-for="(record, recordIndex) in item.list?.slice(0, 3)" :key="recordIndex">
-                                <span v-if="record?.category_name">({{ record.time }}){{ record.category_name }}</span>
-                                <span v-else>{{ record }}</span>
-                            </div>
-                        </div>
-                    </div>
-                    <div
-                        v-if="trendMonitorMockList.length > 1"
-                        class="trend-monitor-toggle"
-                        @click.stop="trendMonitorExpanded = !trendMonitorExpanded"
-                    >
-                        {{ trendMonitorExpanded ? t('common.collapse') : t('common.expandMore') }}
-                    </div>
-                </div>
                 <div class="farm-work-tabs">
                 <div class="farm-work-tabs">
                     <div
                     <div
                         v-for="tab in farmWorkTabs"
                         v-for="tab in farmWorkTabs"
@@ -71,16 +42,13 @@ import customHeader from "@/components/customHeader.vue";
 import { ref, computed, onActivated, onDeactivated, watch, nextTick } from "vue";
 import { ref, computed, onActivated, onDeactivated, watch, nextTick } from "vue";
 import { useStore } from "vuex";
 import { useStore } from "vuex";
 import weatherInfo from "@/components/weatherInfo.vue";
 import weatherInfo from "@/components/weatherInfo.vue";
-import { useRoute, useRouter, onBeforeRouteLeave } from "vue-router";
+import { useRoute, onBeforeRouteLeave } from "vue-router";
 import ArchivesFarmTimeLine from "@/components/pageComponents/ArchivesFarmTimeLine.vue";
 import ArchivesFarmTimeLine from "@/components/pageComponents/ArchivesFarmTimeLine.vue";
 import gardenList from "@/components/gardenList.vue";
 import gardenList from "@/components/gardenList.vue";
 
 
-const router = useRouter();
 const route = useRoute();
 const route = useRoute();
 
 
 const archivesScrollAreaRef = ref(null);
 const archivesScrollAreaRef = ref(null);
-/** 从趋势卡跳转详情时已主动保存滚动;避免 leave/deactivate 阶段读到异常 scrollTop 覆盖 sessionStorage */
-const blockArchivesScrollSaveOnce = ref(false);
 const getArchivesOuterScrollKey = () =>
 const getArchivesOuterScrollKey = () =>
     `agriRecordArchivesOuterScroll:${gardenId?.value ?? "none"}:${route.path}`;
     `agriRecordArchivesOuterScroll:${gardenId?.value ?? "none"}:${route.path}`;
 
 
@@ -117,12 +85,6 @@ const farmWorkTabs = [
     { key: '0', labelKey: 'agriRecord.allFarmWork' },
     { key: '0', labelKey: 'agriRecord.allFarmWork' },
     { key: '1', labelKey: 'agriRecord.traceFarmWork' },
     { key: '1', labelKey: 'agriRecord.traceFarmWork' },
 ];
 ];
-const trendMonitorMockList = ref([]);
-const trendMonitorExpanded = ref(true);
-const visibleTrendMonitorList = computed(() => {
-    if (trendMonitorExpanded.value) return trendMonitorMockList.value;
-    return trendMonitorMockList.value.slice(0, 1);
-});
 
 
 const handleFarmWorkTabClick = (tab) => {
 const handleFarmWorkTabClick = (tab) => {
     activeFarmWorkTab.value = tab;
     activeFarmWorkTab.value = tab;
@@ -132,27 +94,6 @@ const changeGardenTab = (tab) => {
     activeGardenTab.value = tab;
     activeGardenTab.value = tab;
 };
 };
 
 
-const currentPheCode = ref('');
-const getFarmRiskAndTracking = async () => {
-    const selectedFarmData = JSON.parse(localStorage.getItem("selectedFarmData"));
-    const res = await VE_API.monitor.getFarmRiskAndTracking({
-        farm_id: gardenId.value,
-        crop_type: selectedFarmData.farm_variety,
-        category_code: selectedFarmData.farm_category
-    });
-    trendMonitorMockList.value = [];
-    trendMonitorExpanded.value = true;
-    if (res.code === 200) {
-        currentPheCode.value = res.data?.current_phe_code;
-        const growth = res.data?.growth_abnormal_tracking;
-        const pest = res.data?.pest_risk_assessment;
-        const phenology = res.data?.phenology_tracking;
-        if (growth) trendMonitorMockList.value.push({ ...growth, workType: "growth" });
-        if (pest) trendMonitorMockList.value.push({ ...pest, workType: "pest" });
-        if (phenology) trendMonitorMockList.value.push({ ...phenology, workType: "phenology" });
-    }
-}
-
 const handleGardenLoaded = ({ hasFarm }) => {
 const handleGardenLoaded = ({ hasFarm }) => {
     weatherInfoRef.value?.setGardenLoaded?.(hasFarm);
     weatherInfoRef.value?.setGardenLoaded?.(hasFarm);
 };
 };
@@ -166,7 +107,6 @@ const isHeaderShow = ref(false);
 const weatherInfoRef = ref(null);
 const weatherInfoRef = ref(null);
 
 
 onActivated(() => {
 onActivated(() => {
-    blockArchivesScrollSaveOnce.value = false;
     // 用来接收我的农场跳转过来的农场详情逻辑
     // 用来接收我的农场跳转过来的农场详情逻辑
     if (route.query.isHeaderShow) {
     if (route.query.isHeaderShow) {
         isHeaderShow.value = true;
         isHeaderShow.value = true;
@@ -183,12 +123,10 @@ onActivated(() => {
 });
 });
 
 
 onDeactivated(() => {
 onDeactivated(() => {
-    if (blockArchivesScrollSaveOnce.value) return;
     saveArchivesOuterScrollTop();
     saveArchivesOuterScrollTop();
 });
 });
 
 
 onBeforeRouteLeave(() => {
 onBeforeRouteLeave(() => {
-    if (blockArchivesScrollSaveOnce.value) return;
     saveArchivesOuterScrollTop();
     saveArchivesOuterScrollTop();
 });
 });
 
 
@@ -222,28 +160,10 @@ const handleMaskClick = () => {
 
 
 const gardenId = ref(store.state.home.gardenId);
 const gardenId = ref(store.state.home.gardenId);
 
 
-// 初始化加载数据
-// onMounted(() => {
-//     if (gardenId.value) {
-//         getFarmRiskAndTracking();
-//     }
-// });
-
 const changeGarden = ({ id }) => {
 const changeGarden = ({ id }) => {
     gardenId.value = id;
     gardenId.value = id;
-    getFarmRiskAndTracking();
-    // 更新 store 中的状态
     store.commit("home/SET_GARDEN_ID", id);
     store.commit("home/SET_GARDEN_ID", id);
 };
 };
-
-const handleTrendMonitorCardClick = (item) => {
-    saveArchivesOuterScrollTop();
-    blockArchivesScrollSaveOnce.value = true;
-    router.push({
-        path: "/record_details",
-        query: { workId: item?.first_work?.work_id, type: item?.workType, curCode:currentPheCode.value  },
-    });
-};
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
@@ -271,106 +191,6 @@ const handleTrendMonitorCardClick = (item) => {
         z-index: 12;
         z-index: 12;
     }
     }
 
 
-    .trend-monitor-list {
-        display: flex;
-        flex-direction: column;
-        gap: 12px;
-        background: #fff;
-        border: 1px solid #2199F8;
-        border-radius: 8px;
-        padding: 10px;
-
-        .trend-monitor-card {
-            border: 0.5px solid rgba(33, 153, 248, 0.5);
-            border-radius: 4px;
-            padding: 6px 8px;
-            position: relative;
-
-
-            .card-header {
-                display: flex;
-                align-items: center;
-                margin-bottom: 6px;
-
-                .header-left {
-                    display: flex;
-                    align-items: center;
-                    gap: 5px;
-
-                    .title {
-                        font-size: 16px;
-                    }
-
-                    .level-tag {
-                        padding: 1px 8px;
-                        border-radius: 2px;
-                        background: rgba(255, 78, 78, 0.1);
-                        color: #FF4E4E;
-                        font-size: 12px;
-                    }
-                }
-
-                .status-tag {
-                    background: #FF953D;
-                    color: #ffffff;
-                    font-size: 12px;
-                    border-radius: 0 4px 0 4px;
-                    padding: 2px 5px;
-                    position: absolute;
-                    top: 0;
-                    right: 0;
-                }
-            }
-
-            .card-row {
-                background: #F7F7F7;
-                border-radius: 5px;
-                padding: 5px;
-                display: flex;
-                align-items: center;
-                justify-content: space-between;
-                margin-bottom: 6px;
-                font-size: 12px;
-                color: #626262;
-
-                .reason-text{
-                    width: 50%;
-                }
-                .question-tag {
-                    background: #2b9af6;
-                    color: #ffffff;
-                    border-radius: 2px;
-                    padding: 2px 6px;
-                }
-            }
-
-            .record-list {
-                display: flex;
-                gap: 6px;
-
-                .record-item {
-                    border: 1px solid #2199F8;
-                    border-radius: 2px;
-                    color: #2199F8;
-                    text-align: center;
-                    font-size: 12px;
-                    padding: 0 5px;
-                }
-            }
-        }
-
-        .trend-monitor-toggle {
-            display: flex;
-            justify-content: flex-end;
-            align-items: center;
-            padding-top: 2px;
-            font-size: 12px;
-            color: #2199F8;
-            cursor: pointer;
-            user-select: none;
-        }
-    }
-
     .archives-time-line {
     .archives-time-line {
         position: relative;
         position: relative;
         height: 100%;
         height: 100%;

+ 0 - 496
src/views/old_mini/agri_record/subPages/prescriptionPage.vue

@@ -1,496 +0,0 @@
-<template>
-    <div class="prescription-page">
-        <custom-header :name="$t('处方详情')" isClose :showClose="false" @goback="handleClose"></custom-header>
-
-        <div class="prescription-content">
-            <div class="card-box content-card">
-                <div class="card-header">
-                    <div class="card-title-wrap">
-                        <div class="card-title">{{ prescriptionData.title }}</div>
-                        <div class="type-tag">{{ prescriptionData.type }}</div>
-                    </div>
-                </div>
-
-                <div class="card-info">
-                    <div class="info-item">
-                        <span class="info-label">{{ t('下发专家') }}</span>
-                        <span class="info-value">{{ prescriptionData.expert }}</span>
-                    </div>
-                    <div class="info-item">
-                        <span class="info-label">{{ t('执行时间') }}</span>
-                        <span class="info-value">{{ prescriptionData.executeTime }}</span>
-                    </div>
-                    <div class="info-item">
-                        <span class="info-label">{{ t('施用方式') }}</span>
-                        <span class="info-value">{{ prescriptionData.applyMethod }}</span>
-                    </div>
-                </div>
-            </div>
-
-            <!-- 处方详情 -->
-            <div class="card-box prescription-card mt-10">
-                <div class="card-header">
-                    <div class="card-title">
-                        药物处方
-                    </div>
-                </div>
-
-                <!-- <div class="table-item">
-                    <div class="form-item">
-                        <div class="item-name">{{ t('施用方式') }}</div>
-                        <div class="item-text">{{ detailData?.usageMode || '其他' }}</div>
-                    </div>
-                    <div class="form-item">
-                        <div class="item-name">{{ t('执行方式') }}</div>
-                        <div class="item-text">
-                            {{ quotationData?.executionMethodName }}
-                        </div>
-                    </div>
-                </div> -->
-                <div class="new-wrap"
-                    v-if="detailData?.prescriptionList?.length && detailData?.prescriptionList[0]?.pesticideFertilizerList?.length > 0">
-                    <div class="new-title">
-                        <div class="title-1">
-                            <div class="table-name">{{ t('药肥类型') }}</div>
-                        </div>
-                        <div class="title-2">
-                            <div class="table-name">{{ t('药肥名称') }}</div>
-                        </div>
-                        <div class="title-4">
-                            <div class="table-name">{{ t('药肥配比') }}</div>
-                        </div>
-                        <div class="title-5">
-                            <div class="table-name">{{ t('单亩用量') }}</div>
-                        </div>
-                    </div>
-                    <div class="new-table-wrap"
-                        v-for="(prescriptionItem, prescriptionI) in detailData?.prescriptionList" :key="prescriptionI">
-                        <div class="new-prescription" v-for="(subP, subI) in prescriptionItem.pesticideFertilizerList"
-                            :key="subI">
-                            <div class="new-table">
-                                <div class="line-l">
-                                    <div class="line-1 title-1">{{ subP.typeName }}</div>
-                                    <div class="line-2">{{ subP.defaultName || subP.pesticideFertilizerName }}</div>
-                                </div>
-                                <div class="line-r">
-                                    <div class="line-3">
-                                        <div class="sub-line title-4">{{ quotationData.executionMethod === 1 ?
-                                            subP.ratio2 : subP.ratio }}倍</div>
-                                        <div class="sub-line title-5">{{ quotationData.executionMethod === 1 ?
-                                            subP.muUsage2 : subP.muUsage }}{{ subP.unit }}</div>
-                                    </div>
-                                </div>
-                            </div>
-                            <div class="note-text" v-if="subP.remark">{{ subP.remark }}</div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-
-            <!-- 执行区域 -->
-            <div class="card-box area-card mt-10">
-                <div class="card-header">
-                    <div class="card-title">
-                        执行区域
-                    </div>
-                </div>
-                <div class="card-content">
-                    <map-info :farm-id="farmId" :show-title="false" />
-                </div>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { ref, onMounted } from "vue";
-import { useRouter, useRoute } from "vue-router";
-import customHeader from "@/components/customHeader.vue";
-import MapInfo from "@/views/old_mini/agri_record/components/mapInfo.vue";
-
-const router = useRouter();
-const route = useRoute();
-
-const prescriptionData = ref({
-    title: "秋梢防虫",
-    type: "标准农事",
-    expert: "韦帮稳",
-    executeTime: "2025.02.18",
-    applyMethod: "内膛喷施",
-});
-
-const farmId = ref(94500);
-
-onMounted(() => {
-});
-
-const handleClose = () => {
-    router.go(-1);
-};
-
-const handleViewPrescription = () => {
-    // 查看药物处方逻辑
-    // TODO: 实现查看药物处方功能
-};
-
-const handleViewArea = () => {
-    // 查看执行区域逻辑
-    // TODO: 实现查看执行区域功能
-};
-
-const quotationData = ref(
-    {
-        "executionMethodName": "地面喷施",
-        "executionMethod": 1,
-    }
-);
-
-const detailData = ref(
-    {
-        "consequenceText": "",
-        "id": "280962",
-        "reCheckText": "",
-        "orderId": "801082980008202240",
-        "farmWorkArrangeId": "11272",
-        "farmName": "荔枝博览园",
-        "farmPoint": "POINT(113.61702297075017 23.584863449735067)",
-        "area": 300,
-        "expert": "739294587868155904",
-        "orderStatus": 0,
-        "activeStatus": null,
-        "flowStatus": 5,
-        "farmId": 766,
-        "regionId": null,
-        "farmMiniUserId": 90739,
-        "farmMiniUserName": "",
-        "speciesId": "1",
-        "speciesName": "荔枝",
-        "agriculturalId": 214,
-        "agriculturalIcon": "",
-        "farmWorkId": "801074109092990976",
-        "farmWorkLibId": "801074109092990976",
-        "farmWorkLibName": "冬季防治(地面)",
-        "farmWorkName": "冬季防治(地面)",
-        "expertName": "飞鸟种植助手",
-        "expertUserName": "飞鸟种植助手",
-        "expertIcon": "https://birdseye-img-ali-cdn.sysuimars.com//expert/1757473957076.png",
-        "expertUserIcon": "https://birdseye-img-ali-cdn.sysuimars.com//expert/1757473957076.png",
-        "icon": null,
-        "indexName": "",
-        "indexChart": [],
-        "executeDate": "2026-01-19",
-        "executeDeadlineDate": "2026-01-19",
-        "expectedExecuteDate": "2026-01-19",
-        "finishDate": null,
-        "checkDate": null,
-        "beforeExecuteDate": null,
-        "indexJson": "",
-        "expertPrescription": "",
-        "code": "801074109080408065",
-        "condition": "",
-        "solarName": "",
-        "reCheck": 1,
-        "menu": 1,
-        "num": null,
-        "purpose": "",
-        "type": 1,
-        "farmWorkType": 3,
-        "farmWorkTypeName": "病虫",
-        "execute": 3,
-        "updateDate0": "2026-01-19",
-        "updateDate1": null,
-        "updateDate2": null,
-        "updateDate3": null,
-        "updateDate4": null,
-        "updateDate5": null,
-        "updateDate6": null,
-        "confirmPicture": [],
-        "executeEvidence": [
-            "birdseye-look-mini/94379/1768801082504.png",
-            "birdseye-look-mini/94379/1768801086136.png"
-        ],
-        "reviewImage": [],
-        "reviewImage2": [],
-        "reviewDate": null,
-        "reviewDate2": null,
-        "serviceRegion": "广州市从化区荔枝博览园",
-        "usageMode": "地面喷施",
-        "serviceMain": "数域行",
-        "executeMain": "数域行",
-        "storeShortName": "",
-        "weatherWarningMsg": "",
-        "userEvaluation": null,
-        "executeBlueZones": [],
-        "isMaster": null,
-        "isEdit": 0,
-        "selfExec": null,
-        "defaultFarmWork": 1,
-        "isPublic": 0,
-        "prescriptionList": [
-            {
-                "name": "病虫",
-                "pesticideFertilizerList": [
-                    {
-                        "defaultName": "",
-                        "id": null,
-                        "muPrice": 1,
-                        "muUsage": 20,
-                        "muUsage2": 20,
-                        "price": "",
-                        "ratio": 1000,
-                        "ratio2": 100,
-                        "remark": "",
-                        "usageMode": "",
-                        "usageModeList": [
-                            "叶面施"
-                        ],
-                        "pesticideFertilizerCode": "1522",
-                        "pesticideFertilizerId": "776945747475042304",
-                        "pesticideFertilizerName": "5%高氯·甲维盐微乳剂",
-                        "brand": "默认品牌",
-                        "typeName": "胃毒性",
-                        "unit": "ml"
-                    }
-                ]
-            }
-        ],
-        "needReview": 0,
-        "conditionList": [],
-        "actualAgriculturalInput": null,
-        "actualFarmServiceInput": null,
-        "actualTotalInput": 996,
-        "executeName": "张扬",
-        "executorIcon": "https://birdseye-img.sysuimars.com/dinggou-mini/defalut-icon.png",
-        "executorUserId": 94379
-    }
-);
-</script>
-
-<style lang="scss" scoped>
-.prescription-page {
-    height: 100vh;
-    width: 100%;
-    background: #f2f3f5;
-
-    .prescription-content {
-        height: calc(100% - 44px);
-        overflow: auto;
-        box-sizing: border-box;
-        padding: 12px;
-    }
-}
-
-.mt-10 {
-    margin-top: 10px;
-}
-
-.card-box {
-    background: #fff;
-    border-radius: 8px;
-    padding: 12px 10px 16px 10px;
-
-    .card-header {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        margin-bottom: 8px;
-
-        .card-title {
-            font-size: 16px;
-            font-weight: bold;
-            color: #000;
-            margin-right: 5px;
-        }
-
-        .card-title-wrap {
-            display: flex;
-            align-items: center;
-            flex: 1;
-
-
-            .type-tag {
-                font-size: 12px;
-                padding: 0 10px;
-                color: #000000;
-                background: rgba(119, 119, 119, 0.1);
-                border-radius: 20px;
-                font-weight: normal;
-                height: 26px;
-                line-height: 26px;
-            }
-        }
-    }
-}
-
-.content-card {
-    .card-info {
-        padding-top: 12px;
-        border-top: 1px solid #f5f5f5;
-
-        .info-item {
-            display: flex;
-            align-items: center;
-            font-size: 14px;
-            color: #767676;
-            height: 24px;
-
-            .info-label {
-                width: 80px;
-                color: rgba(0, 0, 0, 0.2);
-            }
-
-            .info-value {
-                flex: 1;
-                color: #767676;
-            }
-        }
-    }
-
-    .card-actions {
-        display: flex;
-        gap: 8px;
-        margin-top: 6px;
-
-        .action-btn {
-            padding: 0 16px;
-            height: 32px;
-            line-height: 32px;
-            text-align: center;
-            background: #f7f8fa;
-            color: #4e5969;
-            font-size: 14px;
-            cursor: pointer;
-        }
-    }
-}
-
-
-
-.new-wrap {
-    margin-top: 12px;
-    border-radius: 5px;
-    text-align: center;
-    border: 1px solid rgba(225, 225, 225, 0.5);
-
-    .new-title {
-        background: rgba(241, 241, 241, 0.4);
-        border-radius: 5px 5px 0 0;
-        border-bottom: 1px solid rgba(225, 225, 225, 0.5);
-        display: flex;
-        color: #767676;
-        // justify-content: space-around;
-        padding: 5px 6px;
-        font-size: 12px;
-
-        .table-name {
-            width: 24px;
-            font-size: 12px;
-            margin: 0 auto;
-        }
-    }
-
-    .title-1 {
-        width: 46px;
-    }
-
-    .title-2 {
-        flex: 1;
-    }
-
-    .title-3 {
-        width: 52px;
-    }
-
-    .title-4 {
-        width: 56px;
-    }
-
-    .title-5 {
-        width: 52px;
-    }
-
-    .new-table-wrap {
-        .new-prescription {
-            .new-table {
-                height: 45px;
-                display: flex;
-                align-items: center;
-                background: #fff;
-                border-radius: 5px;
-                color: rgba(0, 0, 0, 0.6);
-                font-size: 11px;
-
-                .line-l {
-                    display: flex;
-                    flex: 1;
-
-                    .line-2 {
-                        flex: 1;
-                        padding: 0 2px;
-                    }
-                }
-
-                .line-r {
-                    &.has-border {
-                        border-left: 1px solid rgba(225, 225, 225, 0.8);
-                    }
-
-                    .line-3 {
-                        display: flex;
-                        align-items: center;
-                    }
-
-                    .sub-line {
-                        padding: 10px 0;
-                    }
-
-                    .line-4 {
-                        display: flex;
-                        align-items: center;
-                        border-top: 1px solid rgba(225, 225, 225, 0.8);
-                    }
-
-                    .execute-line {
-                        border-right: 1px solid rgba(225, 225, 225, 0.8);
-                    }
-                }
-            }
-
-            .note-text {
-                margin: 8px 0 4px 0;
-                color: rgba(0, 0, 0, 0.4);
-                background: #fff;
-                padding: 6px 8px;
-                border-radius: 5px;
-                text-align: left;
-                font-size: 11px;
-            }
-        }
-
-        .new-prescription+.new-prescription {
-            .new-table {
-                border-top: 1px solid rgba(0, 0, 0, 0.08);
-            }
-        }
-    }
-}
-
-.form-item {
-    display: flex;
-    align-items: center;
-    font-size: 14px;
-    color: #767676;
-    height: 24px;
-
-    .item-name {
-        width: 80px;
-        color: rgba(0, 0, 0, 0.2);
-    }
-}
-
-.form-item+.form-item {
-    padding-top: 2px;
-}
-</style>

+ 0 - 987
src/views/old_mini/agri_record/subPages/statusDetail.vue

@@ -1,987 +0,0 @@
-<template>
-    <div class="status-detail">
-        <custom-header :name="$t('农事详情')" isGoBack @goback="handleClose"></custom-header>
-
-        <div class="detail-content" :class="{ 'has-group': isLocked }">
-            <!-- 橙色状态头部 -->
-            <div class="status-header" :class="'status-' + status">
-                <!-- <div class="status-left" v-if="status === -1">
-                    <div class="status-text">
-                        <span>{{ t('未执行') }}</span>
-                    </div>
-                    <div class="status-sub-text">{{ t('执行时间已过去 7 天') }}</div>
-                </div> -->
-                <div class="status-left" v-if="status === 5">
-                    <div class="status-text">
-                        <span>{{ t('已完成') }}</span>
-                    </div>
-                    <div class="status-sub-text">执行时间:{{ detailData?.detail?.executeDate }}</div>
-                </div>
-                 <div class="status-left" v-else-if="status === 0 || !status">
-                     <div class="status-text">
-                         <span>{{ t('未激活') }}</span>
-                     </div>
-                     <div class="status-sub-text">
-                         预计激活时间 {{ detailData?.activateTime ? formatDate(detailData.activateTime) : "" }}
-                     </div>
-                 </div>
-                <div class="status-left" v-else>
-                    <div class="status-text">
-                        <span>{{ t('已激活') }}</span>
-                    </div>
-                    <div class="status-sub-text" v-if="daysDiff > 0">距离执行时间还差 {{ daysDiff }} 天</div>
-                    <div class="status-sub-text" v-else-if="daysDiff === 0">{{ t('触发时间为今天') }}</div>
-                    <div class="status-sub-text" v-else>{{ t('触发时间已过') }}</div>
-                </div>
-            </div>
-
-            <div class="card-wrap">
-                <!-- 内容卡片 -->
-                <div class="card-box content-card">
-                    <div class="card-header">
-                        <div class="card-title-wrap">
-                            <div class="card-title">{{ detailData?.detail?.farmWorkName }}</div>
-                            <div class="type-tag">{{ typeMap[detailData?.detail?.farmWorkType || 1] }}</div>
-                        </div>
-                        <!-- <div class="forward-link" @click="handleForward">{{ t('转发处方') }}</div> -->
-                    </div>
-
-                    <div class="card-info">
-                        <div class="info-item">
-                            <span class="info-label">{{ t('下发专家') }}</span>
-                            <span class="info-value">{{ detailData?.expertNameFromFarmBasicInfo }}</span>
-                        </div>
-                        <div class="info-item">
-                            <span class="info-label">{{ t('执行时间') }}</span>
-                            <span class="info-value">{{ detailData?.detail?.executeDate }}</span>
-                        </div>
-                        <div class="info-item">
-                            <span class="info-label">{{ t('农事建议') }}</span>
-                            <span class="info-value">{{ detailData?.detail?.purpose }}</span>
-                        </div>
-                    </div>
-
-                    <div class="card-actions">
-                        <div class="action-btn" @click="handleViewPrescription">
-                            药物处方
-                            <el-icon class="action-btn-icon" :class="{ 'rotate': showPrescription }" :size="16"><DArrowRight /></el-icon>
-                        </div>
-                        <div class="action-btn" @click="handleViewArea">
-                            执行区域
-                            <el-icon class="action-btn-icon" :class="{ 'rotate': showMapArea }" :size="16"><DArrowRight /></el-icon>
-                        </div>
-                    </div>
-
-                    <transition name="prescription-slide">
-                        <div class="new-wrap"
-                            :class="{'has-lock': isLocked}"
-                            v-show="showPrescription && detailData?.detail?.prescriptionList?.length && detailData?.detail?.prescriptionList[0]?.pesticideFertilizerList?.length > 0">
-
-                            <div class="info-item pb-8">
-                                <span class="info-label">{{ t('施用方式') }}</span>
-                                <span class="info-value">{{ detailData?.detail?.usageMode }}</span>
-                            </div>
-
-                            <div class="new-wrap-inner">
-                                <div class="new-title">
-                                    <div class="title-1">
-                                        <div class="table-name">{{ t('药肥类型') }}</div>
-                                    </div>
-                                    <div class="title-2">
-                                        <div class="table-name">{{ t('药肥名称') }}</div>
-                                    </div>
-                                    <div class="title-4">
-                                        <div class="table-name">{{ t('药肥配比') }}</div>
-                                    </div>
-                                    <div class="title-5">
-                                        <div class="table-name">{{ t('单亩用量') }}</div>
-                                    </div>
-                                </div>
-                                <div class="new-table-wrap"
-                                    v-for="(prescriptionItem, prescriptionI) in detailData?.detail?.prescriptionList"
-                                    :key="prescriptionI">
-                                    <div class="new-prescription"
-                                        v-for="(subP, subI) in prescriptionItem.pesticideFertilizerList" :key="subI">
-                                        <div class="new-table">
-                                            <div class="line-l">
-                                                <div class="line-1 title-1">{{ subP.typeName }}</div>
-                                                <div class="line-2">{{ subP.defaultName || subP.pesticideFertilizerName }}
-                                                </div>
-                                            </div>
-                                            <div class="line-r">
-                                                <div class="line-3">
-                                                    <div class="sub-line title-4">{{ detailData?.detail?.executionMethod === 1 ?
-                                                        subP.ratio2 : subP.ratio }}倍</div>
-                                                    <div class="sub-line title-5">{{ detailData?.detail?.executionMethod === 1 ?
-                                                        subP.muUsage2 : subP.muUsage }}{{ subP.unit }}</div>
-                                                </div>
-                                            </div>
-                                        </div>
-                                        <div class="note-text" v-if="subP.remark">{{ subP.remark }}</div>
-                                    </div>
-                                </div>
-                            </div>
-
-                            <!-- 带锁 -->
-                            <div class="lock-wrap" v-if="isLocked">
-                                <img class="lock-img" src="@/assets/img/home/lock.png" alt="">
-                                <div class="lock-text">
-                                    加入下方指导群可解锁
-                                </div>
-                            </div>
-                        </div>
-                    </transition>
-
-                    <transition name="prescription-slide">
-                        <div v-if="showMapArea" class="map-info-wrap">
-                            <map-info :key="`map-${farmId}`" :farm-id="farmId" />
-                        </div>
-                    </transition>
-                </div>
-
-                <div class="card-box action-video">
-                    <div class="card-header">
-                        <div class="card-title-wrap">
-                            <div class="card-title">{{ t('执行操作') }}</div>
-                        </div>
-                        <!-- <div class="forward-link" @click="handleForward">{{ t('转发操作指南') }}</div> -->
-                    </div>
-                    <div class="video-wrap">
-                        <photo-provider :photo-closable="true" v-if="guideSrc">
-                            <photo-consumer
-                                :src="guideSrc"
-                            >
-                            <img class="video-img" :src="guideSrc" alt="">
-                            </photo-consumer>
-                        </photo-provider>
-                        <div class="video-play-icon">
-                            <div
-                                v-html="detailData?.post?.content"
-                            ></div>
-                            <!-- <div class="expand-text" @click="toggleGuideExpand">
-                                <el-icon class="expand-icon" :class="{ 'rotate': isGuideExpanded }"><DArrowLeft /></el-icon>
-                                {{isGuideExpanded ? '收起' : '展开详细操作指南'}}
-                            </div> -->
-                        </div>
-                        <!-- <video src="https://birdseye-img-ali-cdn.sysuimars.com/bbs_post/video/1767872309467.mp4"
-                            controls style="width: 100%; max-width: 100%; height: auto; border-radius: 8px"
-                            preload="metadata" playsinline webkit-playsinline x5-playsinline></video> -->
-                    </div>
-                </div>
-
-                <!-- 执行档案 -->
-                <!-- <div class="card-box execution-file">
-                    <div class="card-header">
-                        <div class="card-title-wrap">
-                            <div class="card-title">{{ t('执行档案') }}</div>
-                        </div>
-                        <div class="forward-link" @click="handleShowQrCodePopup(1)">{{ t('邀请拍照') }}</div>
-                    </div>
-                    <div class="exe-upload">
-                        <upload :maxCount="10" ref="uploadRef" exampleImg class="upload-wrap" @handleUpload="handleUpload">
-                            <img class="example" src="@/assets/img/home/plus.png" alt="" />
-                        </upload>
-                    </div>
-                    <div class="no-text">{{ t('暂未检测到拍照') }}</div>
-                </div> -->
-
-                <!-- 执行轨迹 -->
-                <!-- <div class="card-box execution-file">
-                    <div class="card-header">
-                        <div class="card-title-wrap">
-                            <div class="card-title">{{ t('执行轨迹') }}</div>
-                        </div>
-                        <div class="forward-link" @click="handleShowQrCodePopup(2)">{{ t('转发执行二维码') }}</div>
-                    </div>
-                    <div class="exe-upload">
-                        <upload :maxCount="10" :key="2" ref="uploadRef2" exampleImg class="upload-wrap" @handleUpload="handleUpload2">
-                            <img class="example" src="@/assets/img/home/plus.png" alt="" />
-                        </upload>
-                    </div>
-                    <div class="no-text">{{ t('暂未检测到工人执行') }}</div>
-                </div> -->
-            </div>
-
-            <!-- 群 -->
-             <div class="group-wrap" v-if="isLocked">
-                <div class="group-left">
-                    <el-avatar :size="34" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" />
-                    <div class="group-name">
-                        <div class="name-text">{{ t('加入冼老师种植群') }}</div>
-                        <div class="group-desc">{{ t('每日农情打卡,享一对一专家指导') }}</div>
-                    </div>
-                </div>
-                <div class="group-right">
-                    <photo-provider :photo-closable="true">
-                        <photo-consumer
-                            :src="groupSrc"
-                        >
-                        <img class="group-img" :src="groupSrc" alt="">
-                        </photo-consumer>
-                    </photo-provider>
-                </div>
-             </div>
-
-             <!-- 我已执行 -->
-             <!-- <div class="bottom-btn-wrap">
-                <div class="bottom-btn" @click="selectExecuteTime">{{ t('我已执行') }}</div>
-             </div> -->
-        </div>
-
-        <!-- 二维码弹窗 -->
-        <popup v-model:show="showQrCodePopup" closeable class="code-popup">
-            <div class="code-popup-wrap">
-                <div class="qr-code-content">
-                    <img class="qr-code-img" src="@/assets/img/home/qrcode.png" alt="" />
-                </div>
-                <div class="text-wrap">
-                    <div class="qr-code-text">
-                        此二维码为
-                        <span v-if="qrCodeType === 1"><span class="work-name">{{ t('梢期杀虫') }}</span>{{ t('上传执行照片邀请码') }}</span>
-                        <span v-if="qrCodeType === 2"><span class="work-name">{{ t('梢期杀虫') }}</span>{{ t('执行码') }}</span>
-                    </div>
-                    <div class="qr-code-text">{{ t('有效期:2025.07.15之前') }}</div>
-                </div>
-                <div class="code-tips">{{ t('&lt;&lt;长按二维码保存或转发&gt;&gt;') }}</div>
-            </div>
-        </popup>
-
-        <!-- 执行区域地图弹窗 -->
-        <!-- <popup v-model:show="showMapPopup" closeable class="map-popup">
-            <map-info :farm-id="farmId" />
-        </popup> -->
-
-        <!-- 处方卡片 -->
-        <detail-dialog ref="detailDialogRef" />
-    </div>
-
-    <!-- 确认执行时间 -->
-    <calendar v-model:show="showCalendar" :title="t('执行日期')" @confirm="onConfirmExecuteTime" :min-date="minDate" :max-date="maxDate" />
-</template>
-
-<script setup>
-import { useI18n } from "@/i18n";
-const { t } = useI18n();
-import { useRouter, useRoute } from "vue-router";
-import { showSuccessToast } from 'vant';
-import { ElMessage } from "element-plus";
-import { ref, onActivated, onDeactivated, computed } from "vue";
-import customHeader from "@/components/customHeader.vue";
-import { Warning } from "@element-plus/icons-vue";
-import upload from "@/components/upload";
-import detailDialog from "@/components/detailDialog.vue";
-import MapInfo from "@/views/old_mini/agri_record/components/mapInfo.vue";
-import { Popup, Calendar } from "vant";
-import { formatDate } from "@/common/commonFun";
-
-const router = useRouter();
-const route = useRoute();
-
-const status = ref(null);
-
-const typeMap = ref({
-    0: "预警农事",
-    1: "标准农事",
-    2: "建议农事",
-    3: "自建农事",
-});
-
-const handleClose = () => {
-    router.go(-1);
-};
-
-const guideSrc = ref(null);
-const groupSrc = ref(require("@/assets/img/home/qrcode.png"));
-
-const showCalendar = ref(false);
-const minDate = ref(new Date(2025, 0, 1));
-const maxDate = ref(new Date());
-
-
-// 计算距离执行时间的天数差
-const daysDiff = computed(() => {
-    if (!detailData.value?.detail?.executeDate) {
-        return 0;
-    }
-
-    const executeDate = new Date(detailData.value?.detail?.executeDate);
-    const today = new Date();
-
-    // 将时间设置为 00:00:00,只比较日期
-    executeDate.setHours(0, 0, 0, 0);
-    today.setHours(0, 0, 0, 0);
-
-    // 计算天数差(毫秒转天数)
-    const diffTime = executeDate.getTime() - today.getTime();
-    const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
-
-    return diffDays;
-});
-
-const onConfirmExecuteTime = (date) => {
-    showCalendar.value = false;
-    console.log(formatDate(date) );
-};
-/* 选择执行时间 */
-const selectExecuteTime = () => {
-    showCalendar.value = true;
-};
-
-const handleForward = async () => {
-    // 转发处方:复制处方链接到剪贴板
-    const url = `${window.location.origin}/#/prescription_page?id=${route.query.miniJson ? JSON.parse(route.query.miniJson).id : null}`;
-
-    try {
-        if (navigator.clipboard && navigator.clipboard.writeText) {
-            await navigator.clipboard.writeText(url);
-            // showSuccessToast(t('复制成功')));
-            ElMessage.success({ message: t('复制成功'), type: 'success' });
-        } else {
-            // 兼容不支持 clipboard API 的环境
-            const textarea = document.createElement("textarea");
-            textarea.value = url;
-            textarea.style.position = "fixed";
-            textarea.style.opacity = "0";
-            document.body.appendChild(textarea);
-            textarea.select();
-            document.execCommand("copy");
-            document.body.removeChild(textarea);
-        }
-    } catch (e) {
-        // 复制失败时不抛出错误,避免影响主流程
-    }
-};
-
-const detailDialogRef = ref(null);
-// 控制处方列表展开/收起
-const showPrescription = ref(false);
-
-const handleViewPrescription = () => {
-    // 收起执行区域地图
-    showMapArea.value = false;
-    // 切换处方列表展开/收起状态
-    showPrescription.value = !showPrescription.value;
-};
-
-// 控制执行区域地图展开/收起
-const showMapArea = ref(false);
-
-const detailData = ref({});
-
-const farmId = ref();
-
-const handleViewArea = () => {
-    // 收起药物处方
-    showPrescription.value = false;
-    // 切换执行区域地图展开/收起状态
-    showMapArea.value = !showMapArea.value;
-};
-
-const uploadRef = ref(null);
-const uploadRef2 = ref(null);
-const images = ref([]);
-const images2 = ref([]);
-const handleUpload = ({ imgArr }) => {
-    images.value = imgArr;
-};
-
-const handleUpload2 = ({ imgArr }) => {
-    images2.value = imgArr;
-};
-
-const qrCodeType = ref(null);
-const showQrCodePopup = ref(false);
-const handleShowQrCodePopup = (type) => {
-    qrCodeType.value = type;
-    showQrCodePopup.value = true;
-};
-
-const isLocked = ref(false);
-
-const miniJson = ref(null);
-
-onActivated(() => {
-    miniJson.value = route.query.miniJson ? JSON.parse(route.query.miniJson) : null;
-    farmId.value = miniJson.value?.farmId;
-    if (miniJson.value?.farmWorkLibId) {
-        getDetail(miniJson.value.farmWorkLibId);
-    }
-});
-
-onDeactivated(() => {
-
-    // 收起执行区域地图
-    showMapArea.value = false;
-    // 收起药物处方
-    showPrescription.value = false;
-})
-
-
-const getDetail = async (farmWorkLibId) => {
-    const { data } = await VE_API.z_farm_work_record.getDetailById({ farmWorkLibId, farmWorkRecordId: miniJson.value.farmWorkRecordId, farmId: farmId.value });
-    detailData.value = data;
-    status.value = data?.detail?.flowStatus;
-    guideSrc.value = data?.post?.media ? JSON.parse(data?.post?.media)[0] : null;
-};
-</script>
-
-<style lang="scss" scoped>
-.status-detail {
-    height: 100vh;
-    width: 100%;
-    background: #f2f3f5;
-
-    .detail-content {
-        height: calc(100% - 44px);
-        overflow: auto;
-        box-sizing: border-box;
-        padding-bottom: 10px;
-        &.has-group {
-            padding-bottom: 104px;
-        }
-    }
-}
-
-.status-header {
-    position: relative;
-    padding: 16px 12px 16px 12px;
-    color: #fff;
-    z-index: 2;
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-
-    &::after {
-        content: "";
-        z-index: -1;
-        position: absolute;
-        left: 0;
-        top: 0;
-        height: 144px;
-        background: #C7C7C7;
-        width: 100%;
-    }
-
-    &.status-0 {
-        &::after {
-            background: #C7C7C7;
-        }
-    }
-
-    &.status-1, &.status-2, &.status-3, &.status-4 {
-        &::after {
-            background: #ff953d;
-        }
-    }
-
-    &.status-5 {
-        &::after {
-            background: #2199f8;
-        }
-    }
-
-    &.status-6 {
-        &::after {
-            background: #ff6666;
-        }
-    }
-
-    .status-left {
-        .status-text {
-            font-size: 22px;
-            display: flex;
-            align-items: center;
-            margin-bottom: 4px;
-
-            .status-icon {
-                margin-right: 8px;
-                display: flex;
-                align-items: center;
-                justify-content: center;
-            }
-        }
-
-        .status-sub-text {
-            color: #fff;
-            font-size: 14px;
-        }
-    }
-}
-
-.card-box {
-    background: #fff;
-    border-radius: 8px;
-    padding: 12px 10px 16px 10px;
-
-    .card-header {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        margin-bottom: 8px;
-
-        .card-title-wrap {
-            display: flex;
-            align-items: center;
-            flex: 1;
-
-            .card-title {
-                font-size: 16px;
-                font-weight: bold;
-                color: #000;
-                margin-right: 5px;
-            }
-
-            .type-tag {
-                font-size: 12px;
-                padding: 0 10px;
-                color: #000000;
-                background: rgba(119, 119, 119, 0.1);
-                border-radius: 20px;
-                font-weight: normal;
-                height: 26px;
-                line-height: 26px;
-            }
-        }
-
-        .forward-link {
-            font-size: 14px;
-            color: #2199f8;
-            cursor: pointer;
-        }
-    }
-}
-
-.card-wrap {
-    padding: 0 12px;
-    // padding-bottom: 58px;
-}
-
-.content-card {
-    position: relative;
-    z-index: 2;
-    transition: all 0.3s ease;
-
-    .card-info {
-        padding-top: 12px;
-        border-top: 1px solid #f5f5f5;
-
-    }
-    .info-item {
-        display: flex;
-        font-size: 14px;
-        color: #767676;
-        line-height: 24px;
-
-        .info-label {
-            width: 80px;
-            color: rgba(0, 0, 0, 0.2);
-        }
-
-        .info-value {
-            flex: 1;
-            color: #767676;
-        }
-    }
-
-    .pb-8 {
-        padding-bottom: 8px;
-    }
-
-    .card-actions {
-        display: flex;
-        gap: 8px;
-        margin-top: 6px;
-
-        .action-btn {
-            padding: 0 16px;
-            height: 32px;
-            line-height: 32px;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            text-align: center;
-            background: #f7f8fa;
-            color: #4e5969;
-            font-size: 14px;
-            cursor: pointer;
-            .action-btn-icon {
-                margin-left: 4px;
-                transform: rotate(270deg);
-                transition: transform 0.3s ease;
-                &.rotate {
-                    transform: rotate(90deg);
-                }
-            }
-        }
-    }
-}
-
-.new-wrap {
-    margin-top: 12px;
-    position: relative;
-    .lock-wrap {
-        position: absolute;
-        top: 0;
-        left: 0;
-        width: 100%;
-        height: 100%;
-        border-radius: 5px;
-        backdrop-filter: blur(4px);
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        flex-direction: column;
-        .lock-img {
-            width: 50px;
-            height: 50px;
-        }
-        .lock-text {
-            margin-top: 8px;
-            font-size: 14px;
-            color: #fff;
-            padding: 0px 36px;
-            height: 22px;
-            line-height: 22px;
-            background: linear-gradient(90deg, rgba(60, 60, 60, 0) 0%, rgba(60, 60, 60, 0.5) 50%, rgba(60, 60, 60, 0) 100%);
-        }
-    }
-    .new-wrap-inner {
-        border-radius: 5px;
-        text-align: center;
-        border: 1px solid rgba(225, 225, 225, 0.5);
-    }
-    .new-title {
-        background: rgba(241, 241, 241, 0.4);
-        border-radius: 5px 5px 0 0;
-        border-bottom: 1px solid rgba(225, 225, 225, 0.5);
-        display: flex;
-        color: #767676;
-        // justify-content: space-around;
-        padding: 5px 0px;
-        font-size: 12px;
-
-        .table-name {
-            width: 24px;
-            font-size: 12px;
-            margin: 0 auto;
-        }
-    }
-
-    .title-1 {
-        width: 46px;
-    }
-
-    .title-2 {
-        flex: 1;
-    }
-
-    .title-3 {
-        width: 52px;
-    }
-
-    .title-4 {
-        width: 56px;
-    }
-
-    .title-5 {
-        width: 52px;
-    }
-
-    .new-table-wrap {
-        .new-prescription {
-            .new-table {
-                height: 45px;
-                display: flex;
-                align-items: center;
-                background: #fff;
-                border-radius: 5px;
-                color: rgba(0, 0, 0, 0.6);
-                font-size: 11px;
-
-                .line-l {
-                    display: flex;
-                    flex: 1;
-
-                    .line-2 {
-                        flex: 1;
-                        padding: 0 2px;
-                    }
-                }
-
-                .line-r {
-                    &.has-border {
-                        border-left: 1px solid rgba(225, 225, 225, 0.8);
-                    }
-
-                    .line-3 {
-                        display: flex;
-                        align-items: center;
-                    }
-
-                    .sub-line {
-                        padding: 10px 0;
-                    }
-
-                    .line-4 {
-                        display: flex;
-                        align-items: center;
-                        border-top: 1px solid rgba(225, 225, 225, 0.8);
-                    }
-
-                    .execute-line {
-                        border-right: 1px solid rgba(225, 225, 225, 0.8);
-                    }
-                }
-            }
-
-            .note-text {
-                margin: 8px 0 4px 0;
-                color: rgba(0, 0, 0, 0.4);
-                background: #fff;
-                padding: 6px 8px;
-                border-radius: 5px;
-                text-align: left;
-                font-size: 11px;
-            }
-        }
-
-        .new-prescription+.new-prescription {
-            .new-table {
-                border-top: 1px solid rgba(0, 0, 0, 0.08);
-            }
-        }
-    }
-}
-
-.action-video {
-    margin-top: 10px;
-    padding: 10px;
-
-    .video-wrap {
-        padding-top: 4px;
-        ::v-deep {
-            .PhotoConsumer {
-                width: 100%;
-            }
-        }
-        .video-img {
-            width: 100%;
-            // height: 100%;
-            height: 146px;
-            object-fit: cover;
-            border-radius: 5px;
-        }
-        .video-play-icon {
-            // padding-top: 12px;
-            font-size: 14px;
-                .html-ellipsis {
-                    display: -webkit-box;
-                    -webkit-box-orient: vertical;
-                    -webkit-line-clamp: 2;
-                    overflow: hidden;
-                    word-break: break-word;
-                    line-height: 20px;
-                    color: #4e5969;
-                }
-            .expand-text {
-                padding-top: 4px;
-                text-align: center;
-                color: #2199f8;
-                display: flex;
-                align-items: center;
-                justify-content: center;
-                .expand-icon {
-                    margin-right: 4px;
-                    transform: rotate(270deg);
-                    transition: transform 0.3s ease;
-                    &.rotate {
-                        transform: rotate(90deg);
-                    }
-                }
-            }
-        }
-    }
-}
-
-.execution-file {
-    margin-top: 10px;
-    padding: 10px;
-
-    .exe-upload {
-        padding-top: 4px;
-        display: flex;
-        align-items: center;
-
-        .example {
-            width: calc((100vw - 68px) / 4);
-            height: calc((100vw - 68px) / 4);
-            margin-right: 8px;
-        }
-    }
-
-    .no-text {
-        font-size: 14px;
-        color: rgba(0, 0, 0, 0.2);
-        line-height: 24px;
-        height: 24px;
-        text-align: center;
-        padding: 16px 0 6px 0;
-    }
-
-}
-.map-info-wrap {
-    padding-top: 12px;
-    ::v-deep {
-        .map-box {
-            height: 180px;
-        }
-    }
-}
-
-.bottom-btn-wrap {
-    position: fixed;
-    z-index: 2;
-    bottom: 0;
-    left: 0;
-    width: 100%;
-    height: 60px;
-    background: #fff;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    .bottom-btn {
-        height: 40px;
-        line-height: 40px;
-        padding: 0 26px;
-        border-radius: 20px;
-        font-size: 14px;
-        background: #2199F8;
-        color: #fff;
-    }
-}
-.group-wrap {
-    position: fixed;
-    bottom: 30px;
-    left: 12px;
-    width: calc(100% - 24px);
-    height: 64px;
-    background: #fff;
-    box-shadow: 0px 2px 2px 0px #0000000D;
-    border-radius: 8px;
-    padding: 10px;
-    box-sizing: border-box;
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    z-index: 2;
-    .group-left {
-        display: flex;
-        align-items: center;
-        .group-name {
-            padding-left: 6px;
-            font-size: 14px;
-            line-height: 18px;
-            color: rgba(81, 81, 81, 0.5);
-            font-weight: 350;
-            .name-text {
-                color: #111;
-                font-weight: 400;
-            }
-        }
-    }
-    .group-img {
-        width: 44px;
-        height: 44px;
-        border-radius: 3px;
-        border: 0.59px solid rgba(221, 225, 231, 1);
-        object-fit: cover;
-    }
-}
-
-.code-popup {
-    width: 330px;
-    border-radius: 8px;
-    padding: 36px 10px 20px 10px;
-    box-sizing: border-box;
-    background: linear-gradient(360deg, #ffffff 74.2%, #d1ebff 100%);
-
-    ::v-deep {
-        .van-popup__close-icon {
-            color: #333333;
-        }
-    }
-
-    .code-popup-wrap {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        flex-direction: column;
-
-        .text-wrap {
-            padding: 8px 0 36px 0;
-
-            .qr-code-text {
-                font-size: 14px;
-                line-height: 22px;
-                color: rgba(0, 0, 0, 0.6);
-                text-align: center;
-            }
-        }
-
-        .code-tips {
-            color: #666666;
-            font-size: 14px;
-        }
-    }
-
-    .qr-code-content {
-        .qr-code-img {
-            width: 197px;
-            min-height: 197px;
-        }
-    }
-}
-
-.map-popup {
-    width: 92%;
-    // max-width: 420px;
-    border-radius: 8px;
-    padding: 12px;
-    box-sizing: border-box;
-}
-.example-overlay {
-    background: rgba(0, 0, 0, 0.6);
-    backdrop-filter: blur(8px);
-}
-
-// 处方列表展开/收起过渡动画
-.prescription-slide-enter-active,
-.prescription-slide-leave-active {
-    transition: all 0.2s ease;
-    overflow: hidden;
-}
-
-.prescription-slide-enter-from {
-    // opacity: 0;
-    max-height: 0;
-    margin-top: 0;
-}
-
-.prescription-slide-enter-to {
-    // opacity: 1;
-    max-height: 1000px;
-    margin-top: 12px;
-}
-
-.prescription-slide-leave-from {
-    opacity: 1;
-    max-height: 1000px;
-    margin-top: 12px;
-}
-
-.prescription-slide-leave-to {
-    opacity: 0;
-    max-height: 0;
-    margin-top: 0;
-}
-</style>

+ 0 - 328
src/views/old_mini/home/components/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 - 98
src/views/old_mini/home/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 { Point } from 'ol/geom';
-import Feature from "ol/Feature";
-import Style from "ol/style/Style";
-import Icon from "ol/style/Icon";
-import LngLat from "@/utils/ol-map/LngLat";
-/**
- * @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,
-          }),
-        });
-      },
-    });
-  }
-
-  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);
-    let point = new Feature(new Point(coordinate))
-    this.clickPointLayer.addFeature(point)
-  }
-
-  /**
-   * 更新地图中心点
-   * @param {string} location WKT格式的位置字符串
-   */
-  updateCenter(location) {
-    if (!this.kmap) {
-      console.warn('地图未初始化,无法更新中心点');
-      return;
-    }
-    const that = this;
-    
-    try {
-      let coordinate = util.wktCastGeom(location).getFirstCoordinate();
-      // 清除之前的点标记
-      that.clickPointLayer.source.clear()
-      // 添加新的点标记
-      let point = new Feature(new Point(coordinate));
-      that.clickPointLayer.addFeature(point);
-      // 更新地图中心点
-      that.kmap.getView().animate({
-        center: coordinate,
-        zoom: 16,
-        duration: 0,
-      });
-    } catch (error) {
-      console.error('更新地图中心点失败:', error);
-    }
-  }
-
-  setAreaGeometry(geometryArr) {
-    this.clearLayer()
-    let that = this
-    geometryArr.map(item => {
-      that.kmap.setLayerWkt(item)
-    })
-    // this.fitView()
-  }
-
-  /**
-   * 清除地块图层
-   */
-  clearLayer() {
-    if (this.kmap && this.kmap.polygonLayer) {
-      this.kmap.polygonLayer.source.clear()
-    }
-  }
-
-  /**
-   * 调整地图视图以适应地块范围
-   */
-  fitView(){
-    let extent = this.kmap.polygonLayer.source.getExtent()
-    // 地图自适应到区域可视范围
-    this.kmap.getView().fit(extent, { duration: 50, padding: [100, 100, 100, 100] });
-  }
-}
-
-export default IndexMap;