wangsisi пре 1 недеља
родитељ
комит
821cec98ac
2 измењених фајлова са 17 додато и 93 уклоњено
  1. 16 92
      src/views/old_mini/monitor/subPages/plan.vue
  2. 1 1
      src/views/old_mini/user/farmDetails.vue

+ 16 - 92
src/views/old_mini/monitor/subPages/plan.vue

@@ -47,10 +47,8 @@
                                         </div>
                                         <div class="card-content">
                                             <span>温馨提示:在某某物候期之后,请密切关注荔枝,关注蒂蛀虫的出现!</span>
-                                            <span class="edit-link" @click.stop="handleEdit(fw)">编辑</span>
+                                            <span class="edit-link" @click.stop="handleEdit(fw)">点击编辑</span>
                                         </div>
-                                        <div class="card-divider"></div>
-                                        <div class="card-footer" @click.stop="handleRowClick(fw)">查看详情</div>
                                         <div
                                             v-if="
                                                 getArrangeStatusClass(fw) === 'status-complete' ||
@@ -88,7 +86,7 @@
     <!-- 农事信息弹窗 -->
     <detail-dialog ref="detailDialogRef" @triggerFarmWork="triggerFarmWork"></detail-dialog>
     <!-- 新增:激活上传弹窗 -->
-    <active-upload-popup ref="activeUploadPopupRef" :needExecutor="true" @handleUploadSuccess="getFarmWorkPlan"></active-upload-popup>
+    <active-upload-popup ref="activeUploadPopupRef" @handleUploadSuccess="getFarmWorkPlan"></active-upload-popup>
     <!-- 互动设置弹窗 -->
     <interact-popup ref="interactPopupRef" @handleSaveSuccess="getFarmWorkPlan" @handleDeleteInteract="handleDeleteInteract"></interact-popup>
 </template>
@@ -105,8 +103,6 @@ import { ElMessage } from "element-plus";
 const router = useRouter();
 const route = useRoute();
 
-const activeSeason = ref("");
-
 const solarTerms = ref([]);
 const phenologyList = ref([]);
 
@@ -188,15 +184,9 @@ const getFarmWorkPlan = () => {
         });
 };
 
-// 切换开关状态
-const isDefaultEnabled = ref(true);
 // 新增农事
 const addNewTask = () => {
     ElMessage.warning("该功能正在升级中,敬请期待");
-    // router.push({
-    //     path: "/modify_work",
-    //     query: { data: JSON.stringify(["生长异常"]), gardenId: 766, isAdd: true },
-    // });
 };
 
 const triggerFarmWork = () => {
@@ -204,30 +194,17 @@ const triggerFarmWork = () => {
         gardenIdVal: route.query.farmId,
         problemTitleVal: "请选择您出现" + curFarmObj.value.farmWorkName + "的时间",
         arrangeIdVal: curFarmObj.value.id,
+        needExecutorVal: true,
     });
 };
 
 const curFarmObj = ref({});
 const handleRowClick = (item) => {
     curFarmObj.value = item;
-    // 0:默认,1-4:正常,5:完成,6:预警
-    if (item.flowStatus === 5) {
-        router.push({
-            path: "/review_work",
-            query: {
-                miniJson: JSON.stringify({ id: item.farmWorkRecordId, goBack: true }),
-            },
-        });
-    } else if (item.flowStatus === null) {
-        detailDialogRef.value.showDialog(item.farmWorkId);
-    } else if (item.flowStatus === 6 || (item.flowStatus < 5 && item.flowStatus >= 0)) {
-        router.push({
-            path: "/completed_work",
-            query: {
-                miniJson: JSON.stringify({ id: item.farmWorkRecordId }),
-            },
-        });
-    }
+    router.push({
+        path: "/modify",
+        query: { id: 277983 },
+    });
 };
 
 const activeUploadPopupRef = ref(null);
@@ -246,22 +223,6 @@ const handleEdit = (item) => {
 };
 
 const handleDeleteInteract = (params) => {
-    // TODO: 调用删除互动设置的API
-    // VE_API.monitor.deleteInteractSetting(params)
-    //     .then((res) => {
-    //         if (res.code === 0) {
-    //             ElMessage.success("删除成功");
-    //             getFarmWorkPlan();
-    //         } else {
-    //             ElMessage.error(res.message || "删除失败");
-    //         }
-    //     })
-    //     .catch((error) => {
-    //         console.error("删除互动设置失败:", error);
-    //         ElMessage.error("删除失败,请重试");
-    //     });
-    
-    // 临时模拟删除成功
     getFarmWorkPlan();
 };
 
@@ -303,7 +264,7 @@ const getListStyle = computed(() => {
     const minP = minProgress.value;
     const maxP = maxProgress.value;
     const range = Math.max(1, maxP - minP); // 避免除0
-    const total = (solarTerms.value?.length || 0) * 320;
+    const total = (solarTerms.value?.length || 0) * 250;
     const minH = total; // 无上下留白
     return { minHeight: `${minH}px` };
 });
@@ -313,7 +274,7 @@ const getTermStyle = (t) => {
     const minP = minProgress.value;
     const maxP = maxProgress.value;
     const range = Math.max(1, maxP - minP); // 避免除0
-    const total = (solarTerms.value?.length || 0) * 320;
+    const total = (solarTerms.value?.length || 0) * 250;
     // 将progress映射到0开始的位置,最小progress对应top: 0
     const normalizedP = range > 0 ? ((p - minP) / range) * 100 : 0;
     const top = (normalizedP / 100) * total;
@@ -330,7 +291,6 @@ const getTermStyle = (t) => {
 
 // 点击季节 → 滚动到对应节气(立春/立夏/立秋/立冬)
 const handleSeasonClick = (seasonValue) => {
-    activeSeason.value = seasonValue;
     const mapping = {
         spring: "立春",
         summer: "立夏",
@@ -345,7 +305,7 @@ const handleSeasonClick = (seasonValue) => {
     const minP = minProgress.value;
     const maxP = maxProgress.value;
     const range = Math.max(1, maxP - minP);
-    const total = (solarTerms.value?.length || 0) * 320;
+    const total = (solarTerms.value?.length || 0) * 250;
     const normalizedP = range > 0 ? ((p - minP) / range) * 100 : 0;
     const targetTop = (normalizedP / 100) * total; // 内容内的像素位置
     const wrap = timelineContainerRef.value;
@@ -367,7 +327,7 @@ const getPhenologyBarStyle = (item) => {
     const minP = minProgress.value;
     const maxP = maxProgress.value;
     const range = Math.max(1, maxP - minP);
-    const total = (solarTerms.value?.length || 0) * 320; // 有效绘制区高度(px)
+    const total = (solarTerms.value?.length || 0) * 250; // 有效绘制区高度(px)
     // 将progress映射到0开始的位置
     const normalizedStart = range > 0 ? ((start - minP) / range) * 100 : 0;
     const normalizedEnd = range > 0 ? ((end - minP) / range) * 100 : 0;
@@ -433,7 +393,7 @@ const getPhenologyBarHeight = (item) => {
     const minP = minProgress.value;
     const maxP = maxProgress.value;
     const range = Math.max(1, maxP - minP);
-    const total = (solarTerms.value?.length || 0) * 320;
+    const total = (solarTerms.value?.length || 0) * 250;
     // 将progress映射到0开始的位置
     const normalizedStart = range > 0 ? ((start - minP) / range) * 100 : 0;
     const normalizedEnd = range > 0 ? ((end - minP) / range) * 100 : 0;
@@ -450,21 +410,6 @@ const getReproductiveItemHeight = (phenologyItem) => {
     return listLength > 0 ? barHeight / listLength : barHeight;
 };
 
-// 根据文字长度返回对应的 class
-const getTextLengthClass = (text) => {
-    if (!text || typeof text !== "string") return "";
-    const len = text.trim().length;
-    if (len > 4 && len <= 6) return "text-4-6";
-    if (len > 6 && len <= 8) return "text-7-8";
-    return "";
-};
-
-// 处理文本,在括号前换行
-const formatTextWithLineBreak = (text) => {
-    if (!text || typeof text !== "string") return text;
-    // 在左括号前添加换行符
-    return text.replace(/([((])/g, "\n$1");
-};
 </script>
 
 <style scoped lang="scss">
@@ -497,16 +442,6 @@ const formatTextWithLineBreak = (text) => {
                 align-items: stretch;
                 justify-content: center;
                 box-sizing: border-box;
-                // &::before {
-                //     content: "";
-                //     position: absolute;
-                //     top: 0;
-                //     left: 25px;
-                //     width: calc(100vw - 100px);
-                //     height: 100%;
-                //     background: var(--bar-before-bg, rgba(201, 201, 201, 0.1));
-                //     z-index: 1;
-                // }
                 .reproductive-list {
                     display: grid;
                     grid-auto-rows: 1fr; /* 子项等高,整体等分父高度 */
@@ -575,37 +510,26 @@ const formatTextWithLineBreak = (text) => {
                                         background: rgba(119, 119, 119, 0.1);
                                         border-radius: 25px;
                                         font-weight: 400;
-                                        font-size: 11px;
+                                        font-size: 12px;
                                         color: #000;
                                     }
                                 }
                                 .header-right {
-                                    font-size: 11px;
-                                    color: #2199f8;
+                                    font-size: 12px;
+                                    color: #808080;
                                     padding: 0 8px;
                                     border-radius: 25px;
-                                    // background: rgba(33, 153, 248, 0.1);
                                 }
                             }
                             .card-content {
                                 color: #909090;
                                 text-align: left;
                                 line-height: 1.55;
-                                margin: 4px 0 10px 0;
+                                margin: 4px 0 2px 0;
                                 .edit-link {
                                     color: #2199f8;
                                 }
                             }
-                            .card-divider {
-                                height: 0.5px;
-                                background: rgba(0, 0, 0, 0.1);
-                            }
-                            .card-footer {
-                                text-align: center;
-                                font-size: 12px;
-                                color: #adadad;
-                                padding-top: 6px;
-                            }
                             .status-icon {
                                 position: absolute;
                                 right: -8px;

+ 1 - 1
src/views/old_mini/user/farmDetails.vue

@@ -27,7 +27,7 @@
                                 <div class="farm-info-footer-item-value">1450<span class="unit">元</span></div>
                             </div>
                         </div>
-                        <div class="footer-action" @click="handleDetail('farm_list')">农事规划</div>
+                        <div class="footer-action" @click="handleDetail('plan?farmId=101532&miniJson={\'farmId\':101532}')">农事规划</div>
                     </div>
                 </template>
             </farm-info-card>