wangsisi 4 giorni fa
parent
commit
6e6861ba46

+ 0 - 4
src/api/modules/farm.js

@@ -92,10 +92,6 @@ module.exports = {
     },
     readReportByFarm: {
         url: config.base_dev_url + "container/growthReport/read",
-        type: "post",
-    },
-    getReportStatus: {
-        url: config.base_dev_url + "container/growthReport/read",
         type: "get",
     },
 }

+ 43 - 25
src/components/pageComponents/ArchivesFarmTimeLine.vue

@@ -31,29 +31,37 @@
                                     { 'future-card': !shouldShowBlue(p) },
                                 ]" @click="handleRowClick(fw)">
                                 <div class="card-content">
-                                    <div class="card-left" :style="{ width: fw.sourceDataJson && fw.sourceDataJson.resFilename ? 'calc(100% - 45px)' : '100%' }" v-if="pageType === 'agri_plan'">
+                                    <div class="card-left"
+                                        :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="text" @click.stop="handleStatusDetail(fw)">
-                                                <span class="van-ellipsis">{{ fw.title}}</span>
-                                                <el-icon v-if="shouldShowBlue(p)"><ArrowRight /></el-icon>
+                                                <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">
                                                 执行者:{{ fw.sourceDataJson.executorName }}
                                             </div> -->
                                         </div>
-                                        <div class="title-text van-ellipsis" v-if="shouldShowBlue(p)">{{ fw.content }}</div>
+                                        <div class="title-text van-ellipsis"
+                                            v-if="shouldShowBlue(p) && fw.sourceType != 4">{{ fw.content }}</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>
+                                                <el-icon class="text-icon">
+                                                    <ArrowRight />
+                                                </el-icon>
                                             </div>
                                         </div>
                                         <div class="title-wrap van-ellipsis" v-show="shouldShowBlue(p)">
-                                            <div class="title-text" v-if="fw.flowStatus != null">{{ 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>
@@ -488,12 +496,12 @@ const handleSeasonClick = (seasonValue) => {
 // 农事状态样式映射
 const getArrangeStatusClass = (fw) => {
     const t = props.pageType === 'agri_record' ? fw?.flowStatus : fw?.sourceType;
-    if(props.pageType === 'agri_record'){
+    if (props.pageType === 'agri_record') {
         if (t == null) return "status-default";
         return "status-act";
-    }else{
+    } else {
         if (t == 10) return "status-complete";
-        if (t == 11 ) return "status-warning";
+        if (t == 11) return "status-warning";
         return "status-normal";
     }
 };
@@ -531,7 +539,7 @@ const getFarmWorkPlan = () => {
     const params = {
         farmId: props.farmId,
     }
-    if(props.pageType === 'agri_record'){
+    if (props.pageType === 'agri_record') {
         params.containerId = props.containerId || 26;
     }
 
@@ -766,7 +774,7 @@ const handleStatusDetail = (fw) => {
     //     path: props.pageType === 'agri_plan' ? "/agricultural_detail" : "/status_detail",
     //     query: { miniJson: JSON.stringify({ id: fw.id }) },
     // });
-    if(props.pageType === 'agri_record'){
+    if (props.pageType === 'agri_record') {
         router.push({
             path: "/status_detail",
             query: { miniJson: JSON.stringify({ farmWorkLibId: fw.farmWorkLibId, farmWorkRecordId: fw.farmWorkRecordId, farmId: props.farmId }) },
@@ -1104,7 +1112,7 @@ watch(
                                 .left-date {
                                     color: #2199f8;
                                     border: 1px solid #2199f8;
-                                    padding: 1px 5px; 
+                                    padding: 1px 5px;
                                     border-radius: 2px;
                                     font-size: 12px;
                                 }
@@ -1131,11 +1139,12 @@ watch(
                             }
 
                             &.agri-record-card {
-                                .title-wrap{
+                                .title-wrap {
                                     display: flex;
                                     align-items: flex-end;
                                     gap: 6px;
-                                    .expert-info{
+
+                                    .expert-info {
                                         display: flex;
                                         align-items: center;
                                         gap: 2px;
@@ -1194,10 +1203,6 @@ watch(
                     opacity: 0.3;
                 }
 
-                .arrange-card.future-card .card-content {
-                    color: #808080;
-                }
-
                 .arrange-card.status-normal {
                     border-color: #2199f8;
 
@@ -1216,11 +1221,13 @@ watch(
                                 border-color: #FF4E4E;
                             }
                         }
-                        .title-text{
+
+                        .title-text {
                             color: #FF4E4E;
                             background: rgba(255, 78, 78, 0.1);
                         }
                     }
+
                     &::before {
                         border-right-color: #FF4E4E;
                     }
@@ -1236,11 +1243,13 @@ watch(
                                 border-color: #FF943D;
                             }
                         }
-                        .title-text{
+
+                        .title-text {
                             color: #FF943D;
                             background: rgba(255, 149, 61, 0.1);
                         }
                     }
+
                     &::before {
                         border-right-color: #FF943D;
                     }
@@ -1256,11 +1265,13 @@ watch(
                                 border-color: #FF953D;
                             }
                         }
-                        .title-text{
+
+                        .title-text {
                             color: #fff;
                             background: #FF953D;
                         }
                     }
+
                     &::before {
                         border-right-color: #FF953D;
                     }
@@ -1275,15 +1286,19 @@ watch(
                                 color: #BBBBBB;
                                 border-color: #BBBBBB;
                             }
-                            .text-name,.text-icon{
+
+                            .text-name,
+                            .text-icon {
                                 color: #BBBBBB;
                             }
                         }
-                        .title-text{
+
+                        .title-text {
                             color: #fff;
                             background: #BBBBBB;
                         }
                     }
+
                     &::before {
                         border-right-color: #BBBBBB;
                     }
@@ -1293,11 +1308,14 @@ watch(
                 .arrange-card.future-card {
                     border-color: #e4e4e4;
 
+                    .card-content {
+                        color: rgba(36, 36, 36, 0.5);
+                    }
+
                     .card-left {
                         .left-info {
                             .left-date {
-                                color: #fff;
-                                background: #e4e4e4;
+                                color: #CACACA;
                                 border-color: #e4e4e4;
                             }
                         }

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

@@ -51,7 +51,7 @@ const handleFarmInfoClick = () =>{
     const query = {
         askInfo: { title: "农场认领", content: "是否分享该链接给好友" },
         shareText: "邀您参与农情互动,获取专家精准指导",
-        targetUrl: `home`,
+        targetUrl: `monitor`,
         paramsPage: {isFarmer:true},
         imageUrl: 'https://birdseye-img.sysuimars.com/birdseye-look-mini/share-lz-bg.png',
     };

+ 4 - 4
src/views/old_mini/growth_report/index.vue

@@ -114,15 +114,14 @@ function formatArea(val) {
 const paramsPage = ref({});
 onActivated(() => {
     window.scrollTo(0, 0);
-    paramsPage.value = route.query.miniJson ? JSON.parse(route.query.miniJson) : {};
+    paramsPage.value = route.query || {};
     getDetail();
-    setReadStatus();
     // getResultReport();
 });
 
 
-const setReadStatus = () => {
-    VE_API.farm.readReportByFarm({ id: workItem.value.id }).then(({ data }) => {
+const setReadStatus = (id) => {
+    VE_API.farm.readReportByFarm({ id,isRead:1 }).then(({ data }) => {
         console.log(data);
     });
 }
@@ -133,6 +132,7 @@ const getDetail = () => {
         .growthReportByFarm({ farmId: paramsPage.value.farmId, limit: 20 })
         .then(({ data }) => {
             workItem.value = data[0];
+            setReadStatus(data[0].id);
         })
         .finally(() => {
             loading.value = false;

+ 1 - 1
src/views/old_mini/home/components/knowledgeCard.vue

@@ -89,7 +89,7 @@ const handleKnowledgeClick = (index) => {
 };
 
 const handleBannerClick = (id) => {
-    router.push(`/warning_detail?id=${id}`);
+    router.push(`/warning_detail?id=${id}&showImage=true`);
 };
 
 const handleMoreClick = () => {

+ 4 - 3
src/views/old_mini/home/index.vue

@@ -71,7 +71,8 @@
     <!-- 执行轨迹弹窗 -->
     <execute-trace-popup v-model:show="showExecuteTracePopup" @later="handleTraceLater" @confirm="handleTraceConfirm" />
 
-    <tip-popup v-model:show="showReportPopup" type="success" text="请查看" buttonText="去查看" @confirm="handleReportBtn" :zIndex="9999">
+    <tip-popup v-model:show="showReportPopup" type="success" text="请查看" buttonText="去查看" @confirm="handleReportBtn"
+        :zIndex="9999">
         <template #default>
             <div class="report-text">您的农情报告已生成</div>
         </template>
@@ -109,7 +110,7 @@ const handleBtn = () => {
 const handleReportBtn = () => {
     router.push({
         path: "/growth_report",
-        query: { miniJson: JSON.stringify({ farmId: gardenId.value }) },
+        query: { farmId: gardenId.value },
     });
 }
 
@@ -194,7 +195,7 @@ const getExpertByFarmId = () => {
 const showReportPopup = ref(false);
 const getReport = () => {
     if (!gardenId.value) return;
-    VE_API.farm.growthReportByFarm({farmId: gardenId.value, limit: 20, isRead: 0}).then(({ data }) => {
+    VE_API.farm.growthReportByFarm({ farmId: gardenId.value, limit: 20, isRead: 0 ,generateStatus:1}).then(({ data }) => {
         if (data && data.length > 0) {
             showReportPopup.value = true;
         } else {

+ 3 - 7
src/views/old_mini/interactionList/components/examplePopup.vue

@@ -9,9 +9,9 @@
                     :autoplay="0"
                     indicator-color="#2199F8"
                 >
-                    <SwipeItem v-for="img in images" :key="img">
-                        <div class="img-tag" v-if="showTitleAndTips">{{ title }}</div>
-                        <img class="example-img" :src="img" alt="" />
+                    <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>
 
@@ -61,10 +61,6 @@ const props = defineProps({
         type: Number,
         default: 0,
     },
-    title: {
-        type: String,
-        default: "示例图",
-    },
     tips: {
         type: String,
         default: "拍摄要求:请采集代表农场作物物候期的照片,请采集代表农场作物物候期的照片。",

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

@@ -45,12 +45,12 @@
                     v-for="(item, key) in filteredList"
                     :key="key"
                     class="card-item"
-                    @click="showExample(filteredList, item, key)"
+                    @click="showExample(filteredList, key)"
                 >
                     <div class="thumb-wrap">
-                        <img class="thumb" :src="item.image" :alt="item.name" />
+                        <img class="thumb" :src="item.exampleImageUrl" :alt="item.name" />
                     </div>
-                    <div class="card-name">{{ item.name || "病害" }}</div>
+                    <div class="card-name">{{ item.exampleImageAnnotation || "病害" }}</div>
                 </div>
                 <div v-if="!filteredList.length" class="empty-text">暂无数据</div>
             </div>
@@ -60,9 +60,9 @@
     <!-- 示例照片轮播组件 -->
     <example-popup
         v-model:show="showExamplePopup"
-        :images="exampleList.map(item => item.image)"
+        :images="exampleList"
         :start-index="exampleStartIndex"
-        :title="exampleTitle"
+        :tips="shootingMethod"
     />
 </template>
 
@@ -119,12 +119,12 @@ const setItems = (list) => {
 const showExamplePopup = ref(false);
 const exampleList = ref([]);
 const exampleStartIndex = ref(0);
-const exampleTitle = ref("示例图");
+const shootingMethod = ref('');
 
-const showExample = (list, item, index) => {
+const showExample = (list, index) => {
     exampleList.value = list;
+    shootingMethod.value = list[0].shootingMethod;
     exampleStartIndex.value = index;
-    exampleTitle.value = item.name || "示例图";
     showExamplePopup.value = true;
 };
 

+ 28 - 50
src/views/old_mini/interactionList/index.vue

@@ -27,19 +27,20 @@
                     <div class="example-wrapper">
                         <div class="example-header">
                             <div>示例照片</div>
-                            <div class="more" v-if="item.exampleImagesJson.length > 3"
-                                @click="openMorePopup(item.exampleImagesJson,item)">查看更多</div>
+                            <div class="more" v-if="item.exampleImageWithAnnotations.length > 3"
+                                @click="openMorePopup(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"
-                                :key="example" @click="showExample(item,item.exampleImagesJson, exIndex)">
-                                <img class="image-item" :src="example" alt="" />
+                        <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>
+                                }}</span></template>
                     </text-ellipsis>
                 </div>
 
@@ -50,7 +51,7 @@
                     <!-- 图片展示 -->
                     <div class="uploaded-images">
                         <div class="uploaded-img-wrap" v-for="(image, imgIndex) in item.imagePaths" :key="image"
-                            @click="showExample(item,item.imagePaths.map(p => base_img_url2 + p), imgIndex, { hideLabel: true })">
+                            @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>
@@ -119,9 +120,11 @@
                 :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.indicators[0]?.unit ?? '%')).join('')
-                        : item.question + ':' + (item.answerValues[0] ?? '') + (item.indicators[0]?.unit ?? '%')) }}</span>
+                        ? 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>
                 <div class="toggle-btn" @click="toggleExpand(item)">
                     <span>{{ item.expanded ? "收起" : "展开" }}</span>
@@ -146,8 +149,8 @@
     <drone-consult-popup v-model:show="showDroneConsultPopup" @copy="onCopyWechatId" />
 
     <!-- 示例照片轮播组件 -->
-    <example-popup v-model:show="showExamplePopup" :images="exampleList" :tips="currentPhotData?.shootingMethod" :start-index="exampleStartIndex" :title="currentPhotData?.exampleImageAnnotation"
-        :show-title-and-tips="exampleShowTitleAndTips" />
+    <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 class="upload-progress-popup">
@@ -185,9 +188,6 @@
 
     <!-- 查看更多弹窗 -->
     <more-popup ref="morePopupRef" />
-
-    <tip-popup v-model:show="showTipPopup" type="success" text="您的农情报告已生成
-        请查看" buttonText="查看报告" @confirm="handleBtn" :zIndex="9999" />
 </template>
 <script setup>
 import { ref, onMounted, onActivated, computed, onUnmounted } from "vue";
@@ -204,14 +204,6 @@ import DrawRegionMap from "./map/drawRegionMap.js";
 import UploadFile from "@/utils/upliadFile";
 import { getFileExt } from "@/utils/util";
 import MorePopup from "./components/morePopup.vue";
-import tipPopup from "@/components/popup/tipPopup.vue";
-
-
-const showTipPopup = ref(false)
-const handleBtn = () => {
-    console.log('00')
-}
-
 
 const showDroneConsultPopup = ref(false);
 const handleShowDroneConsultPopup = () => {
@@ -452,9 +444,9 @@ const exampleList = ref([]);
 const exampleStartIndex = ref(0);
 const exampleShowTitleAndTips = ref(true);
 const currentPhotData = ref({})
-const showExample = (item, list, index, options = {}) => {
+const showExample = (item, index, options = {}) => {
     currentPhotData.value = item;
-    exampleList.value = list || [];
+    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;
@@ -467,22 +459,6 @@ const loadData = async () => {
     try {
         const { data } = await VE_API.home.listTriggeredByFarm({ farmId: localStorage.getItem("selectedFarmId") })
         listData.value = data.map(item => {
-            // 将 exampleImagesJson 转换为数组
-            if (item.exampleImagesJson) {
-                try {
-                    item.exampleImagesJson = typeof item.exampleImagesJson === 'string'
-                        ? JSON.parse(item.exampleImagesJson)
-                        : item.exampleImagesJson;
-                    // 确保是数组格式
-                    if (!Array.isArray(item.exampleImagesJson)) {
-                        item.exampleImagesJson = [];
-                    }
-                } catch (e) {
-                    item.exampleImagesJson = [];
-                }
-            } else {
-                item.exampleImagesJson = [];
-            }
             // question 按 || 切割成数组,用于循环渲染
             const questionStr = item.question != null ? String(item.question) : '';
             item.questionList = questionStr
@@ -524,7 +500,7 @@ const removeUploadedImage = (item, imgIndex) => {
 const handleConfirm = async (item, isConfirm) => {
     if (isConfirm) {
         const list = item.questionList || [];
-        const needFill = list.length || 1;
+        // 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
         // );
@@ -546,6 +522,7 @@ const handleConfirm = async (item, isConfirm) => {
         replyText: item.replyText,
         answerValues: item.answerValues
     }
+    await VE_API.home.uploadAnswerData(parmas);
     const { code, msg } = await VE_API.home.uploadAnswer(parmas);
     if (code === 0) {
         ElMessage.success("上传成功");
@@ -612,7 +589,7 @@ const handleDrawRegion = (item) => {
     const polygonData = sessionStorage.getItem("drawRegionPolygonData");
 
     if (item.rangeWkt && item.rangeWkt.length > 10) {
-        router.push(`/draw_region?polygonData=${polygonData}&rangeWkt=${item.rangeWkt}&updatedTime=${item.updatedTime.slice(0,10)}`);
+        router.push(`/draw_region?polygonData=${polygonData}&rangeWkt=${item.rangeWkt}&updatedTime=${item.updatedTime.slice(0, 10)}`);
     } else {
         if (polygonData) {
             router.push(`/draw_region?polygonData=${polygonData}`);
@@ -637,13 +614,13 @@ const handleUploadSuccess = (data) => {
     uploadedSuccessCount.value = len;
 };
 
-const openMorePopup = (images, item) => {
-    const data = images.map(image => {
+const openMorePopup = (item) => {
+    const data = item.exampleImageWithAnnotations.map(exampleItem => {
         return {
-            name: item.exampleImageAnnotation,
-            image: image
+            ...exampleItem,
+            shootingMethod: item.shootingMethod,
         }
-    })
+    });
     morePopupRef.value.setItems(data);
     morePopupRef.value.openPopup();
 }
@@ -1008,6 +985,7 @@ const handleSubmitAll = () => {
         margin: 12px 0 6px;
         box-sizing: border-box;
         width: 100%;
+
         .question-text {
             background: #ffffff;
             color: #6f6f6f;
@@ -1023,7 +1001,7 @@ const handleSubmitAll = () => {
             }
         }
 
-        .question-text + .question-text {
+        .question-text+.question-text {
             margin-top: 6px;
         }
 

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

@@ -21,7 +21,7 @@
                                 <CaretRight />
                             </el-icon>
                         </div>
-                        <span class="box-text">当前处于蒂蛀虫高发期,请及时采集</span>
+                        <span class="box-text">点击查看您的长势报告</span>
                     </div>
                     <img src="@/assets/img/monitor/report-icon.png" alt="" class="report-icon" />
                 </div>
@@ -74,8 +74,8 @@ const checkHasUnrepliedTriggeredInteraction = async () => {
         agriExecuteData.value = {
             expertAvatar: data.expertAvatar,
             expertName: data.expertName,
-            title: data.interactionTypeName,
-            abnormalText: data.reason,
+            title: data.subjectName,
+            abnormalText: data.subjectRemark,
             exampleImg: JSON.parse(data.exampleImagesJson)[0],
             executedButtonText: '开始采集',
         };
@@ -359,7 +359,7 @@ function handlePage(url) {
 function handleReportClick() {
     router.push({
         path: "/growth_report",
-        query: { miniJson: JSON.stringify({ farmId: gardenId.value }) },
+        query: { farmId: gardenId.value },
     });
 }