Parcourir la source

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

lxf il y a 1 jour
Parent
commit
a37a63f33a

+ 5 - 1
README.md

@@ -1,4 +1,8 @@
 # feiniao-farm-h5
 
 新版飞鸟管家
-http://127.0.0.1:8081/#/dev_login?point=113.1093017627431,22.574540836684672&userId=94494
+http://127.0.0.1:3000/#/dev_login?point=113.1093017627431,22.574540836684672&userId=96804
+http://127.0.0.1:3000/#/dev_login?point=113.1093017627431,22.574540836684672&userId=92950 //燕飞账号
+http://127.0.0.1:8081/#/dev_login?point=113.1093017627431,22.574540836684672&userId=94494 //秀芳
+http://127.0.0.1:8081/#/dev_login?point=113.1093017627431,22.574540836684672&userId=91523
+http://127.0.0.1:8081/#/dev_login?point=113.1093017627431,22.574540836684672&userId=91524

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

@@ -27,4 +27,9 @@ module.exports = {
         url: config.base_dev_url + "chat/sessionListByFarm",
         type: "get",
     },
+    //获取帖子详情
+    postDetail: {
+        url: config.base_dev_url + "bbs_post/detail",
+        type: "get",
+    }
 }

+ 18 - 4
src/components/pageComponents/ArchivesFarmTimeLine.vue

@@ -131,10 +131,10 @@ const props = defineProps({
         type: [String, Number],
         default: null,
     },
-    // 是否禁用所有点击事件(用于只读展示)
-    disableClick: {
-        type: Boolean,
-        default: false,
+    // 年份
+    year: {
+        type: [Number, String],
+        default: new Date().getFullYear(),
     },
     // 是否是标准农事
     isStandard: {
@@ -619,6 +619,7 @@ const getFarmWorkPlan = () => {
         farmId: props.farmId,
         regionId: props.regionId,
         problemZoneId: props.problemZoneId,
+        year: props.year,
     }
     if (props.pageType === 'agri_record') {
         params.containerId = props.containerId;
@@ -836,9 +837,22 @@ watch(
     { immediate: true }
 );
 
+watch(
+    () => props.year,
+    (val, oldVal) => {
+        if (!props.farmId) return;
+        if (val !== oldVal) {
+            lastRequestedFarmId.value = null;
+        }
+        isInitialLoad.value = true;
+        updateFarmWorkPlan();
+    },
+);
+
 const showPhenologyName = computed(() => {
     return !props.problemZoneId;
 });
+
 watch(
     () => props.problemZoneId,
     (val, oldVal) => {

+ 6 - 0
src/router/globalRoutes.js

@@ -427,6 +427,12 @@ export default [
         meta: { showTabbar: true, keepAlive: true },
         component: () => import("@/views/old_mini/growth_report/index.vue"),
     },
+    // 历史风险报告
+    {
+        path: "/history_risk_report",
+        name: "HistoryRiskReport",
+        component: () => import("@/views/old_mini/growth_report/historyRiskReport.vue"),
+    },
     // 咨询专家
     {
         path: "/consult",

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

@@ -19,6 +19,7 @@
                         v-model="date"
                         type="year"
                         placeholder="全部日期"
+                        :editable="false"
                         :disabled-date="disabledYearDate"
                     />
                 </div>
@@ -43,7 +44,7 @@
                 <img class="example-img" src="@/assets/img/monitor/example.png" alt="">
             </template>
             <div class="archives-time-line-content">
-                <archives-farm-time-line :farmId="farmIdData" :problemZoneId="currentVariety?.problemZoneTypeId" :regionId="regionData" :containerId="containerData"
+                <archives-farm-time-line :year="date.getFullYear()" :farmId="farmIdData" :problemZoneId="currentVariety?.problemZoneTypeId" :regionId="regionData" :containerId="containerData"
                     pageType="agri_record" :typeId="currentVariety?.typeId" @card-click="handleCardClick"></archives-farm-time-line>
             </div>
         </div>

+ 3 - 3
src/views/old_mini/create_farm/index.vue

@@ -529,7 +529,7 @@ const submitForm = (formEl) => {
                 }
                 delete queryParams.speciesItem;
                 queryParams.speciesName = mainSpecies?.name;
-                
+
                 // if (pageData?.type === 'add') {
                 //     queryParams.invite = true;
                 // }
@@ -689,7 +689,7 @@ function getSpecieList() {
         const list = Array.isArray(data) ? data : [];
         // 只保留名称包含“水稻”或“荔枝”的品类
         const litchiList = list.filter(
-            (item) => item?.name && (item.name.includes("水稻") || item.name.includes("荔枝"))
+            (item) => item?.name && (item.name.includes("水稻") || item.name.includes("荔枝")|| item.name.includes("大豆")|| item.name.includes("茶叶"))
         );
         specieList.value = litchiList;
         // 返回空列表时,重置已选品类,避免保留上一次默认项
@@ -765,7 +765,7 @@ function backgToHome() {
                 url: `/pages/subPages/new_recognize/index?gardenData=${JSON.stringify(dropdownGardenItem.value)}`,
             });
         }
-        
+
         json?.from && router.replace(`/${json.from}`);
         // const paramsPage = JSON.parse(json.paramsPage);
         // if (paramsPage.isFarmer) {

+ 89 - 0
src/views/old_mini/growth_report/historyRiskReport.vue

@@ -0,0 +1,89 @@
+<template>
+    <div class="history-risk-report-page">
+        <custom-header name="历史风险报告" isGoBack @goback="handleGoBack"></custom-header>
+        <div v-loading="loading" class="history-risk-report-content">
+            <div v-if="reportContent" class="rich-text" v-html="reportContent"></div>
+            <div v-else-if="!loading" class="empty-text">暂无内容</div>
+        </div>
+    </div>
+</template>
+
+<script setup>
+import { onActivated, onMounted, ref } from "vue";
+import { useRouter } from "vue-router";
+import customHeader from "@/components/customHeader.vue";
+
+const router = useRouter();
+const loading = ref(false);
+const reportContent = ref("");
+
+const getReportDetail = () => {
+    loading.value = true;
+    VE_API.bbs
+        .postDetail({ id: "829511846204542976" })
+        .then((res) => {
+            reportContent.value = res?.data?.content || "";
+        })
+        .finally(() => {
+            loading.value = false;
+        });
+};
+
+const handleGoBack = () => {
+    if (window.history.length > 1) {
+        router.back();
+        return;
+    }
+    router.replace("/growth_report");
+};
+
+onMounted(() => {
+    getReportDetail();
+});
+
+onActivated(() => {
+    getReportDetail();
+});
+</script>
+
+<style scoped lang="scss">
+.history-risk-report-page {
+    width: 100%;
+    height: 100vh;
+    background: #ffffff;
+    overflow: hidden;
+
+    .history-risk-report-content {
+        height: calc(100vh - 40px);
+        padding: 12px 16px 20px;
+        box-sizing: border-box;
+        overflow-y: auto;
+        -webkit-overflow-scrolling: touch;
+    }
+
+    .rich-text {
+        font-size: 14px;
+        line-height: 1.75;
+        color: #333333;
+        word-break: break-word;
+
+        ::v-deep(img) {
+            max-width: 100%;
+            height: auto;
+            border-radius: 6px;
+        }
+
+        ::v-deep(table) {
+            width: 100% !important;
+            table-layout: fixed;
+        }
+    }
+
+    .empty-text {
+        padding-top: 40px;
+        text-align: center;
+        color: #999999;
+        font-size: 14px;
+    }
+}
+</style>

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

@@ -6,7 +6,14 @@
         <weather-info ref="weatherInfoRef" from="growth_report" class="weather-info" @weatherExpanded="weatherExpanded"
             @changeGarden="changeGarden" :isGarden="true"></weather-info>
         <div class="report-content-wrap" v-if="hasReport" v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.1)">
-            <swipe ref="swipeRef" class="my-swipe" :loop="false" indicator-color="white" @change="handleSwipeChange">
+          <div class="history-risk-report-btn" @click="handleHistoryRiskReportClick">
+            <span class="risk-report-icon">
+              <i></i>
+            </span>
+            <span class="risk-report-text">历史风险报告</span>
+          </div>
+
+          <swipe ref="swipeRef" class="my-swipe" :loop="false" indicator-color="white" @change="handleSwipeChange">
                 <swipe-item v-for="(item, index) in regionsData" :key="index">
                     <div class="report-content has-report" :style="{ minHeight: `calc(100vh - ${tabBarHeight}px)` }">
                         <!-- <img src="@/assets/img/home/qrcode.png" alt="" class="code-icon" /> -->
@@ -39,7 +46,7 @@
                                         :class="'today-'+card.color"
                                         @click="handleTodayPatrolFocusClick(card)"
                                         >
-                                        <!-- <badge class="status-badge" dot 
+                                        <!-- <badge class="status-badge" dot
                                             :offset="[80, -10]">
                                         </badge> -->
                                         <div class="status-title">
@@ -65,7 +72,7 @@
                                         :class="card.type"
                                         @click="handlePendingFarmWorkClick(card)"
                                         >
-                                        <!-- <badge class="status-badge" dot 
+                                        <!-- <badge class="status-badge" dot
                                             :offset="[80, -10]">
                                         </badge> -->
                                         <div v-if="card.executionLimitDays || card.executionLimitDays === 0" class="tag-name" :style="{ borderColor: card.purposeColor, color: card.purposeColor }">限时 {{ card.executionLimitDays }} 天</div>
@@ -264,6 +271,10 @@ const handleAddFarm = () => {
     router.push(`/create_farm?from=growth_report&isReload=true`);
 }
 
+const handleHistoryRiskReportClick = () => {
+    router.push("/history_risk_report");
+}
+
 const todayPatrolFocus = ref([]);
 const pendingFarmWork = ref([]);
 const handlePendingFarmWorkClick = (card) => {
@@ -438,6 +449,49 @@ onUnmounted(() => {
         box-sizing: border-box;
         position: relative;
 
+        .history-risk-report-btn {
+            position: absolute;
+            right: 0px;
+            top: 110px;
+            z-index: 13;
+            height: 26px;
+            padding: 0 10px 0 8px;
+            display: inline-flex;
+            align-items: center;
+            gap: 4px;
+            color: #ffffff;
+            font-size: 14px;
+            border-radius: 13px 0 0 13px;
+            background: linear-gradient(180deg, #60c2ff 0%, #2199f8 100%);
+            box-shadow: 0 2px 6px rgba(33, 153, 248, 0.3);
+            cursor: pointer;
+
+            .risk-report-icon {
+                width: 14px;
+                height: 14px;
+                border-radius: 2px;
+                background: #ffffff;
+                position: relative;
+                display: inline-flex;
+                align-items: center;
+                justify-content: center;
+                transform: rotate(-12deg);
+
+                i {
+                    width: 8px;
+                    height: 2px;
+                    border-radius: 2px;
+                    background: #42a7ff;
+                    box-shadow: 0 3px 0 #42a7ff;
+                }
+            }
+
+            .risk-report-text {
+                line-height: 1;
+                white-space: nowrap;
+            }
+        }
+
         .bottom-btn {
             z-index: 2;
             position: fixed;
@@ -776,7 +830,7 @@ linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
                 grid-template-columns: repeat(3, 1fr);
                 gap: 6px;
 
-                
+
 
                 .status-card {
                     border-radius: 2px;

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

@@ -16,6 +16,7 @@
                     </div>
                     <el-date-picker
                         style="width: 110px"
+                        :editable="false"
                         v-model="date"
                         type="year"
                         placeholder="全部日期"
@@ -56,7 +57,7 @@
                     <img src="@/assets/img/monitor/report-icon.png" alt="" class="report-icon" />
                 </div> -->
                 <div class="time-line">
-                    <archives-farm-time-line :problemZoneId="currentVariety?.id" :farmId="farmIdData" :regionId="regionData" @card-click="handleCardClick"></archives-farm-time-line>
+                    <archives-farm-time-line :year="date.getFullYear()" :problemZoneId="currentVariety?.id" :farmId="farmIdData" :regionId="regionData" @card-click="handleCardClick"></archives-farm-time-line>
                 </div>
             </div>
         </div>

+ 13 - 79
src/views/old_mini/work_detail/index.vue

@@ -4,13 +4,13 @@
 
         <div class="work-detail-content">
             <!-- 顶部状态 -->
-            <div class="content-status" :class="['status-' + detail?.flowStatus, 'audit-' + getAuditStatusPriority(detail?.executeEvidenceAuditStatus)]">
+            <div class="content-status" :class="'status-' + detail?.flowStatus">
                 <div class="status-l">
                     <div class="status-title">{{ handleTagType(detail?.flowStatus) }}</div>
                     <div class="status-sub" v-if="triggerDateText && (detail?.flowStatus == -1 || detail?.flowStatus == -2)">
                         执行时间已经过去 {{ Math.abs(daysDiff) }} 天了
                     </div>
-                    <div class="status-sub" v-if="detail?.flowStatus === 3 && getAuditStatusPriority(detail?.executeEvidenceAuditStatus) !== 2">
+                    <div class="status-sub" v-if="detail?.flowStatus === 3">
                         <template v-if="daysDiff > 0">
                             距离执行时间还差 {{ Math.abs(daysDiff) }} 天
                         </template>
@@ -130,10 +130,6 @@
                                     :src="base_img_url2 + src.filename">
                                     <div class="photo-img">
                                         <img :src="base_img_url2 + src.filename" />
-                                        <div class="fail-icon" v-if="failIndex(index) === 2">
-                                            <el-icon size="24" color="#FF953D"><WarningFilled /></el-icon>
-                                            <div class="fail-icon-text">审核失败</div>
-                                        </div>
                                     </div>
                                 </photo-consumer>
                             </photo-provider>
@@ -372,41 +368,11 @@ const handleTagType = (tagType) => {
     if (tagType == 0) return "待触发";
     if (tagType == -1) return "已过期";
     if (tagType == -2) return "已过期";
-    if (tagType == 3) {
-        const status = getAuditStatusPriority(detail.value?.executeEvidenceAuditStatus);
-        if (status === 2) {
-            return "审核失败";
-        }
-        return "待认证"
-    }
-    if (tagType == 5) {
-        const status = getAuditStatusPriority(detail.value?.executeEvidenceAuditStatus);
-        if (status === 2) {
-            return "审核失败";
-        }
-        if (status === 0) {
-            return "审核中";
-        }
-        return "已完成";
-    }
+    if (tagType == 3) return "待认证";
+    if (tagType == 5) return "已完成";
     return "待触发"
 }
 
-// 审核状态优先级:2 > 0 > 1
-const getAuditStatusPriority = (auditStatusList) => {
-    if (!Array.isArray(auditStatusList) || !auditStatusList.length) return 1;
-    const normalized = auditStatusList.map((x) => Number(x)).filter((x) => [0, 1, 2].includes(x));
-    if (!normalized.length) return 1;
-    if (normalized.includes(2)) return 2;
-    if (normalized.includes(0)) return 0;
-    return 1;
-};
-
-// 审核是否失败
-const failIndex = (index) => {
-    return detail.value?.executeEvidenceAuditStatus[index]
-}
-
 const handleExecute = () => {
     // const today = new Date();
     // const executeDate = new Date(detail.value.executeDate);
@@ -554,24 +520,12 @@ const changeExecutionMethod = (stageIndex, value) => {
         }
     }
 
-    &.status-5 {
-        padding-top: 30px;
-
-        &::after {
-            background: #2199F8;
-        }
-    }
-
-    &.status-3, &.audit-2, &.audit-0 {
+    &.status-3 {
         &::after {
             background: #FF953D;
         }
     }
 
-    &.audit-2 {
-        padding-top: 30px;
-    }
-
     &.status--1 {
         &::after {
             background: #FF4F4F;
@@ -583,6 +537,14 @@ const changeExecutionMethod = (stageIndex, value) => {
         }
     }
 
+    &.status-5 {
+        padding-top: 30px;
+
+        &::after {
+            background: #2199F8;
+        }
+    }
+
     .status-l {
         .status-title {
             font-size: 22px;
@@ -622,15 +584,6 @@ const changeExecutionMethod = (stageIndex, value) => {
         padding: 11px 10px;
         font-size: 14px;
 
-        .tips-text {
-            color: #FA7406;
-            padding: 5px 10px;
-            border: 1px solid #FF953D;
-            border-radius: 5px;
-            margin-bottom: 10px;
-            background: #fff;
-        }
-
         .photo-title {
             color: #000;
             padding-bottom: 9px;
@@ -877,25 +830,6 @@ const changeExecutionMethod = (stageIndex, value) => {
         border-radius: 8px;
         overflow: hidden;
 
-        .fail-icon {
-            position: absolute;
-            top: 0;
-            left: 0;
-            width: 100%;
-            height: 100%;
-            background: rgba(0, 0, 0, 0.6);
-            border-radius: 8px;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            flex-direction: column;
-            gap: 4px;
-            .fail-icon-text {
-                color: #FF943D;
-                font-size: 12px;
-            }
-        }
-
         img {
             width: 100%;
             height: 100%;

+ 31 - 1
src/views/old_mini/youwei_trace/index.vue

@@ -1,4 +1,5 @@
 <template>
+    <!--
     <div class="youwei-trace-page" :style="{ height: `calc(100vh - ${tabBarHeight}px)` }">
         <empty
             image="https://birdseye-img.sysuimars.com/birdseye-look-mini/custom-empty-image.png"
@@ -6,18 +7,32 @@
             description="该页面正在升级,敬请期待..."
         />
     </div>
+    -->
+    <div class="youwei-trace-page" :style="{ height: `calc(100vh - ${tabBarHeight}px)` }">
+        <img
+            class="trace-long-img"
+            src="https://birdseye-img.sysuimars.com/birdseye-look-vue/zj/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20260407220906_3750_42.png"
+            alt="有味溯源"
+        />
+    </div>
 </template>
 
 <script setup>
+// import { computed } from "vue";
+// import { useStore } from "vuex";
+// import { Empty } from "vant";
+//
+// const store = useStore();
+// const tabBarHeight = computed(() => store.state.home.tabBarHeight);
 import { computed } from "vue";
 import { useStore } from "vuex";
-import { Empty } from "vant";
 
 const store = useStore();
 const tabBarHeight = computed(() => store.state.home.tabBarHeight);
 </script>
 
 <style scoped lang="scss">
+/*
 .youwei-trace-page {
     width: 100%;
     height: 100%;
@@ -26,4 +41,19 @@ const tabBarHeight = computed(() => store.state.home.tabBarHeight);
     justify-content: center;
     box-sizing: border-box;
 }
+*/
+
+.youwei-trace-page {
+    width: 100%;
+    height: 100%;
+    overflow-y: auto;
+    -webkit-overflow-scrolling: touch;
+    background: #ffffff;
+}
+
+.trace-long-img {
+    width: 100%;
+    height: auto;
+    display: block;
+}
 </style>