ソースを参照

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

lxf 5 日 前
コミット
99258ff409

+ 5 - 0
src/api/modules/monitor.js

@@ -103,4 +103,9 @@ module.exports = {
         url: config.base_dev_url + "container_phenology_interaction/farmWorkPlan",
         type: "get",
     },
+    //关闭当天弹窗:记录该互动在当天已展示过弹窗
+    closeTodayPopup: {
+        url: config.base_dev_url + "container_phenology_interaction/closeTodayUnrepliedInteraction",
+        type: "get",
+    },
 };

+ 29 - 7
src/components/pageComponents/ArchivesFarmTimeLine.vue

@@ -35,7 +35,7 @@
                                         <div class="left-info">
                                             <div class="left-date">{{ formatDate(fw.createTime) }}</div>
                                             <div class="text" @click.stop="handleStatusDetail(fw)">
-                                                <span class="van-ellipsis">{{ shouldShowBlue(p) ? '物候进程' : fw.title }}</span>
+                                                <span class="van-ellipsis">{{ fw.title}}</span>
                                                 <el-icon v-if="shouldShowBlue(p)"><ArrowRight /></el-icon>
                                             </div>
                                             <!-- <div class="text green van-ellipsis" v-if="fw?.sourceType === 7">
@@ -53,7 +53,7 @@
                                             </div>
                                         </div>
                                         <div class="title-wrap van-ellipsis" v-show="shouldShowBlue(p)">
-                                            <div class="title-text">{{ fw.flowStatus == null ? '未激活' : '已激活' }}</div>
+                                            <div class="title-text" v-if="fw.flowStatus != null">{{ fw.flowStatus == null ? '未激活' : '已激活' }}</div>
                                             <!-- <div class="expert-info">
                                                 <el-avatar :size="14" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" />
                                                 <span>专家下发</span>
@@ -490,7 +490,7 @@ const getArrangeStatusClass = (fw) => {
     const t = props.pageType === 'agri_record' ? fw?.flowStatus : fw?.sourceType;
     if(props.pageType === 'agri_record'){
         if (t == null) return "status-default";
-        return "status-complete";
+        return "status-act";
     }else{
         if (t == 9) return "status-complete";
         if (t == 8 ) return "status-warning";
@@ -767,10 +767,12 @@ const handleStatusDetail = (fw) => {
     //     path: props.pageType === 'agri_plan' ? "/agricultural_detail" : "/status_detail",
     //     query: { miniJson: JSON.stringify({ id: fw.id }) },
     // });
-    router.push({
-        path: "/status_detail",
-        query: { miniJson: JSON.stringify({ farmWorkLibId: fw.farmWorkLibId, farmWorkRecordId: fw.farmWorkRecordId, farmId: props.farmId }) },
-    });
+    if(props.pageType === 'agri_record'){
+        router.push({
+            path: "/status_detail",
+            query: { miniJson: JSON.stringify({ farmWorkLibId: fw.farmWorkLibId, farmWorkRecordId: fw.farmWorkRecordId, farmId: props.farmId }) },
+        });
+    }
 };
 
 // 格式化日期为 MM-DD 格式
@@ -1243,6 +1245,26 @@ watch(
                     }
                 }
 
+                .arrange-card.status-act {
+                    border-color: #FF953D;
+
+                    .card-left {
+                        .left-info {
+                            .left-date {
+                                color: #FF953D;
+                                border-color: #FF953D;
+                            }
+                        }
+                        .title-text{
+                            color: #fff;
+                            background: #FF953D;
+                        }
+                    }
+                    &::before {
+                        border-right-color: #FF953D;
+                    }
+                }
+
                 .arrange-card.status-default {
                     border-color: #BBBBBB;
 

+ 13 - 6
src/components/popup/agriExecutePopup.vue

@@ -7,14 +7,15 @@
         teleport="body"
     >
         <div class="popup-content">
+            <div class="popup-tips">为了处方体系更加适应您当前的果园管理</div>
             <!-- 头部区域 -->
-            <!-- <div class="popup-header">
-                <img class="expert-logo" src="@/assets/img/mine/expert-icon.png" alt="" />
+            <div class="popup-header">
+                <img class="expert-logo" :src="popupData?.expertAvatar" alt="" />
                 <div class="expert-info">
-                    <span>{{ popupData.expertName || "韦帮稳" }}专家</span>
-                    <span class="invite-text">邀请您</span>
+                    <span>{{ popupData?.expertName || "韦帮稳" }}专家</span>
+                    <span class="invite-text">邀请您进行农情互动</span>
                 </div>
-            </div> -->
+            </div>
 
             <!-- 标题 -->
             <div class="popup-title">{{ popupData.title }}</div>
@@ -99,6 +100,11 @@ const handleExecuted = () => {
         flex-direction: column;
     }
 
+    .popup-tips{
+        color: rgba(93, 93, 93, 0.8);
+        margin-bottom: 5px;
+    }
+
     .popup-header {
         margin-bottom: 5px;
         display: flex;
@@ -107,12 +113,13 @@ const handleExecuted = () => {
         .expert-logo {
             width: 26px;
             height: 26px;
+            border-radius: 50%;
+            object-fit: cover;
         }
 
         .expert-info {
             font-size: 16px;
             .invite-text {
-                color: #999999;
                 margin-left: 6px;
             }
         }

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

@@ -16,7 +16,7 @@
         <div class="archives-time-line">
             <div class="archives-time-line-header">
                 <div class="line-title">农事记录</div>
-                <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" />
+                <!-- <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" /> -->
             </div>
             <div class="archives-time-line-content">
                 <archives-farm-time-line :farmId="gardenId" pageType="agri_record"></archives-farm-time-line>

+ 4 - 4
src/views/old_mini/interactionList/components/morePopup.vue

@@ -2,7 +2,7 @@
     <popup v-model:show="showMore" class="more-popup" round>
         <div class="more-content">
             <!-- 搜索框 -->
-            <div class="search-bar">
+            <!-- <div class="search-bar">
                 <el-icon class="search-icon">
                     <Search />
                 </el-icon>
@@ -12,7 +12,7 @@
                     type="text"
                     placeholder="请输入病虫害名称"
                 />
-            </div>
+            </div> -->
 
             <!-- 类型切换 -->
             <!-- <div class="type-tabs">
@@ -48,7 +48,7 @@
                     @click="showExample(filteredList, item, key)"
                 >
                     <div class="thumb-wrap">
-                        <img class="thumb" :src="item" :alt="key" />
+                        <img class="thumb" :src="item.image" :alt="item.name" />
                     </div>
                     <div class="card-name">{{ item.name || "病害" }}</div>
                 </div>
@@ -60,7 +60,7 @@
     <!-- 示例照片轮播组件 -->
     <example-popup
         v-model:show="showExamplePopup"
-        :images="exampleList"
+        :images="exampleList.map(item => item.image)"
         :start-index="exampleStartIndex"
         :title="exampleTitle"
     />

+ 1 - 1
src/views/old_mini/interactionList/drawRegion.vue

@@ -65,7 +65,7 @@ onActivated(() => {
     if (rangeWkt) {
         const regions = JSON.parse(rangeWkt)?.geometryArr.map(item => ({
             geometry: item,
-            status: "resolved",
+            status: "unresolved",
             updatedTime: route.query.updatedTime,
         }));
         drawRegionMap.setStatusRegions(regions);

+ 29 - 25
src/views/old_mini/interactionList/index.vue

@@ -28,7 +28,7 @@
                         <div class="example-header">
                             <div>示例照片</div>
                             <div class="more" v-if="item.exampleImagesJson.length > 3"
-                                @click="openMorePopup(item.exampleImagesJson)">查看更多</div>
+                                @click="openMorePopup(item.exampleImagesJson,item)">查看更多</div>
                         </div>
                         <div class="example-list" v-if="item.exampleImagesJson.length > 0">
                             <div class="image-item-wrapper" v-for="(example, exIndex) in item.exampleImagesJson"
@@ -119,9 +119,9 @@
                 :style="{ justifyContent: item.expanded ? 'center' : 'space-between' }">
                 <template v-if="!item.expanded">
                     <span class="proportion-text">{{(item.questionList && item.questionList.length
-                        ? item.questionList.map((q, i) => q + (item.answerValues[i] ?? '') + (item.indicators[i]?.unit
+                        ? 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>
+                        : item.question + ':' + (item.answerValues[0] ?? '') + (item.indicators[0]?.unit ?? '%')) }}</span>
                 </template>
                 <div class="toggle-btn" @click="toggleExpand(item)">
                     <span>{{ item.expanded ? "收起" : "展开" }}</span>
@@ -146,7 +146,7 @@
     <drone-consult-popup v-model:show="showDroneConsultPopup" @copy="onCopyWechatId" />
 
     <!-- 示例照片轮播组件 -->
-    <example-popup v-model:show="showExamplePopup" :images="exampleList" :tips="exampleTips" :start-index="exampleStartIndex" :title="exampleTitle"
+    <example-popup v-model:show="showExamplePopup" :images="exampleList" :tips="currentPhotData?.shootingMethod" :start-index="exampleStartIndex" :title="currentPhotData?.exampleImageAnnotation"
         :show-title-and-tips="exampleShowTitleAndTips" />
     <!-- 照片上传进度 -->
 
@@ -318,7 +318,7 @@ const renderRegionFromItemWkt = (item) => {
             .filter(wkt => wkt && typeof wkt === 'string' && wkt.trim().length > 10)
             .map(wkt => ({
                 geometry: wkt.trim(),
-                status: 'resolved' // 接口返回的区域默认显示为未解决状态
+                status: 'unresolved' // 接口返回的区域默认显示为未解决状态
             }));
         if (regions.length > 0) {
             drawRegionMap.setStatusRegions(regions);
@@ -451,13 +451,11 @@ const showExamplePopup = ref(false);
 const exampleList = ref([]);
 const exampleStartIndex = ref(0);
 const exampleShowTitleAndTips = ref(true);
-const exampleTitle = ref('')
-const exampleTips = ref('')
+const currentPhotData = ref({})
 const showExample = (item, list, index, options = {}) => {
-    exampleTitle.value = item.exampleImageAnnotation;
+    currentPhotData.value = item;
     exampleList.value = list || [];
     exampleStartIndex.value = index || 0;
-    exampleTips.value = item.shootingMethod;
     exampleShowTitleAndTips.value = options.hideLabel !== true;
     showExamplePopup.value = true;
 };
@@ -527,13 +525,13 @@ const handleConfirm = async (item, isConfirm) => {
     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;
-        }
+        // 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;
@@ -568,13 +566,13 @@ const handleConfirmUpload = async () => {
     }
     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 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,
@@ -639,8 +637,14 @@ const handleUploadSuccess = (data) => {
     uploadedSuccessCount.value = len;
 };
 
-const openMorePopup = (images) => {
-    morePopupRef.value.setItems(images);
+const openMorePopup = (images, item) => {
+    const data = images.map(image => {
+        return {
+            name: item.exampleImageAnnotation,
+            image: image
+        }
+    })
+    morePopupRef.value.setItems(data);
     morePopupRef.value.openPopup();
 }
 

+ 13 - 4
src/views/old_mini/monitor/index.vue

@@ -10,7 +10,7 @@
         <div class="archives-time-line">
             <div class="archives-time-line-header" @click="handleJump">
                 <div class="line-title">作物档案</div>
-                <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" />
+                <!-- <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" /> -->
             </div>
             <div class="archives-time-line-content">
                 <div class="report-box">
@@ -37,7 +37,7 @@
 
     <!-- 农事执行弹窗 -->
     <agri-execute-popup v-model:show="showAgriExecutePopup" :popupData="agriExecuteData"
-        @executed="handleAgriExecuted" />
+        @executed="handleAgriExecuted" @close="handleClosePopup" />
 </template>
 
 <script setup>
@@ -62,13 +62,18 @@ const agriExecuteData = ref({});
 const handleAgriExecuted = () => {
     showAgriExecutePopup.value = false;
     // router.push("/interaction_list?expertMiniUserId=81881&oldUser=true");
+    handleClosePopup();
     router.push("/interaction_list?expertMiniUserId=81881");
 };
 
+const expertInfo = ref({});
 const checkHasUnrepliedTriggeredInteraction = async () => {
     const { data } = await VE_API.home.hasUnrepliedTriggeredInteraction({ farmId: localStorage.getItem("selectedFarmId") });
     if (data && data.id != null) {
+        expertInfo.value = data;
         agriExecuteData.value = {
+            expertAvatar: data.expertAvatar,
+            expertName: data.expertName,
             title: data.interactionTypeName,
             abnormalText: data.reason,
             exampleImg: JSON.parse(data.exampleImagesJson)[0],
@@ -319,8 +324,6 @@ onMounted(() => {
         currentPage.value = 1;
         finished.value = false;
         broadcastList.value = [];
-        getStayCount();
-        checkHasUnrepliedTriggeredInteraction();
     }
 });
 
@@ -356,6 +359,12 @@ function handleReportClick() {
         query: { miniJson: JSON.stringify({ id: gardenId.value }) },
     });
 }
+
+const handleClosePopup = () => {
+    VE_API.monitor.closeTodayPopup({
+        interactionId: expertInfo.value.id,
+    });
+}
 </script>
 
 <style scoped lang="scss">