Jelajahi Sumber

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

wangsisi 4 hari lalu
induk
melakukan
66f0acaf7d

+ 1 - 1
src/App.vue

@@ -138,7 +138,7 @@ const router = useRouter();
 // 首页loading加载完才显示底部导航栏
 const showTab = ref(false);
 // 0: 农户, 1: 专家, 2:农资农服
-const curRole = ref(0);
+const curRole = ref(2);
 
 let tabBarHeight = 0;
 onMounted(() => {

+ 1 - 1
src/components/taskItem.vue

@@ -48,7 +48,7 @@
 import { ref } from 'vue';
 import { useRouter } from "vue-router";
 
-const status = ref(1)
+const status = ref(0)
 
 const router = useRouter();
 const toPage = () => {

+ 18 - 1
src/router/globalRoutes.js

@@ -170,5 +170,22 @@ export default [
         name: "ExpertDetail",
         component: () => import("@/views/old_mini/expert_detail/index.vue"),
     },
-    
+    // 农事详情--农户
+    {
+        path: "/farmer_agri",
+        name: "FarmerIndex",
+        component: () => import("@/views/old_mini/agri_work/farmerIndex.vue"),
+    },
+    // 农事详情--专家
+    {
+        path: "/expert_agri",
+        name: "ExpertIndex",
+        component: () => import("@/views/old_mini/agri_work/expertIndex.vue"),
+    },
+    // 农事详情--农资农服
+    {
+        path: "/services_agri",
+        name: "ServicesIndex",
+        component: () => import("@/views/old_mini/agri_work/servicesIndex.vue"),
+    },
 ];

+ 80 - 0
src/views/old_mini/agri_work/components/infoText.vue

@@ -0,0 +1,80 @@
+<template>
+    <div class="box-wrap farm-data">
+        <div class="card-title">秋梢防虫<span class="type-tag">标准农事</span></div>
+        <div class="data-content">
+            <div class="form-item">
+                <div class="item-name">农事编号</div>
+                <div class="item-text">BZ-YY-04-SQYY-20</div>
+            </div>
+            <div class="form-item">
+                <div class="item-name">服务亩数</div>
+                <div class="item-text">100亩</div>
+            </div>
+            <div class="form-item">
+                <div class="item-name">服务区域</div>
+                <div class="item-text">广州市从化区荔枝博览园</div>
+            </div>
+            <div class="form-item">
+                <div class="item-name">触发条件</div>
+                <div class="item-text">单数花带叶40%</div>
+            </div>
+            <div class="form-item">
+                <div class="item-name">执行时间</div>
+                <div class="item-text">2025.02.18</div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script setup></script>
+
+<style lang="scss" scoped>
+.box-wrap {
+    background: #fff;
+    padding: 10px;
+    border-radius: 8px;
+}
+.farm-data {
+    margin-top: 10px;
+    .data-content {
+        margin-top: 8px;
+        border-top: 1px solid #f5f5f5;
+        padding: 8px 0;
+    }
+
+    .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;
+    }
+}
+
+.card-title {
+    font-size: 16px;
+    font-weight: bold;
+    color: #000;
+    display: flex;
+    align-items: center;
+
+    .type-tag {
+        margin-left: 5px;
+        font-size: 12px;
+        color: #000000;
+        padding: 0 10px;
+        background: rgba(119, 119, 119, 0.1);
+        border-radius: 20px;
+        font-weight: normal;
+        height: 26px;
+        line-height: 26px;
+    }
+}
+</style>

+ 225 - 0
src/views/old_mini/agri_work/components/prescriptionTable.vue

@@ -0,0 +1,225 @@
+<template>
+    <div class="box-wrap farm-table">
+        <div class="card-title">药物处方</div>
+        <div class="table-item">
+            <div class="form-item">
+                <div class="item-name">施用方式</div>
+                <div class="item-text">叶面施</div>
+            </div>
+        </div>
+        <div class="new-wrap">
+            <div class="new-title">
+                <div class="title-1"><div class="table-name">使用功效</div></div>
+                <div class="title-2"><div class="table-name">肥药名称</div></div>
+                <div class="title-3"><div class="table-name">执行方式</div></div>
+                <div class="title-4"><div class="table-name">亩兑水量</div></div>
+                <div class="title-5"><div class="table-name">单亩用量</div></div>
+            </div>
+            <div
+                class="new-table-wrap"
+                v-for="(prescriptionItem, prescriptionI) in prescriptioData.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 }}</div>
+                        </div>
+                        <div class="line-r" :class="{ 'has-border': prescriptioData.usageMode === '叶面施' }">
+                            <div class="line-3">
+                                <div
+                                    class="sub-line title-3"
+                                    :class="{ 'execute-line': prescriptioData.usageMode === '叶面施' }"
+                                >
+                                    人工
+                                </div>
+                                <div class="sub-line title-4">{{ subP.ratio }}ML</div>
+                                <div class="sub-line title-5">{{ subP.muUsage }}{{ subP.unit }}</div>
+                            </div>
+                            <div class="line-4" v-if="prescriptioData.usageMode === '叶面施'">
+                                <div class="sub-line title-3 execute-line">无人机</div>
+                                <div class="sub-line title-4">
+                                    {{ subP.ratio2 ? subP.ratio2 + subP.unit : "---" }}
+                                </div>
+                                <div class="sub-line title-5">
+                                    {{ subP.muUsage2 ? subP.muUsage2 + subP.unit : "---" }}
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="note-text" v-if="subP.remark">{{ subP.remark }}</div>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+
+const prescriptioData = ref({
+    prescriptionList: [
+        {
+            name: "营养",
+            pesticideFertilizerList: [
+                {
+                    key: 1,
+                    typeName: "营养",
+                    defaultName: "乙烯利",
+                    muUsage: "50",
+                    muUsage2: "500",
+                    ratio: "400",
+                    ratio2: "400",
+                    unit: "ml",
+                    remark: "这是是用药注意事项的备注,这是是用药注意事项的备注",
+                },
+            ],
+        },
+    ],
+    usageMode: "叶面施",
+});
+
+</script>
+
+<style lang="scss" scoped>
+.box-wrap {
+    background: #fff;
+    padding: 10px;
+    border-radius: 8px;
+}
+
+.card-title {
+    font-size: 16px;
+    font-weight: bold;
+    color: #000;
+    display: flex;
+    align-items: center;
+
+    .type-tag {
+        margin-left: 5px;
+        font-size: 12px;
+        color: #000000;
+        padding: 0 10px;
+        background: rgba(119, 119, 119, 0.1);
+        border-radius: 20px;
+        font-weight: normal;
+        height: 26px;
+        line-height: 26px;
+    }
+}
+.farm-table {
+    margin-top: 10px;
+    .table-item {
+        padding: 10px 0 12px 0;
+    }
+
+    
+        .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);
+            }
+        }
+}
+
+.new-wrap {
+    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 {
+        padding: 5px;
+        .new-prescription {
+            .new-table {
+                display: flex;
+                align-items: center;
+                border: 1px solid rgba(225, 225, 225, 0.8);
+                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 {
+            padding-top: 8px;
+        }
+    }
+}
+</style>

+ 13 - 0
src/views/old_mini/agri_work/expertIndex.vue

@@ -0,0 +1,13 @@
+<template>
+    <div>
+
+    </div>
+</template>
+
+<script setup>
+
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 13 - 0
src/views/old_mini/agri_work/farmerIndex.vue

@@ -0,0 +1,13 @@
+<template>
+    <div>
+
+    </div>
+</template>
+
+<script setup>
+
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 416 - 0
src/views/old_mini/agri_work/newFarmMap.js

@@ -0,0 +1,416 @@
+
+import config from "@/api/config.js"
+import * as KMap from '@/utils/ol-map/KMap';
+import Style from "ol/style/Style";
+import * as util from "@/common/ol_common.js"
+import { newAreaFeature, newAreaPoint, newPolymerFeature, newPoint} from "@/utils/map";
+import { GARDEN_STATUS_ENUM as STATUS_ENUM } from "@/api/enum.js"
+import Icon from "ol/style/Icon";
+import eventBus from '@/api/eventBus';
+import VectorLayer from "ol/layer/Vector.js";
+import {getArea} from 'ol/sphere.js';
+import * as proj from "ol/proj";
+import { register } from "ol/proj/proj4";
+import proj4 from "proj4"
+proj4.defs("EPSG:38572","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");
+register(proj4);
+
+/**
+ * @description 智能巡园地图层对象
+ */
+class EditNsMap {
+
+    constructor() {
+        let that = this
+        this.vectorStyle = new KMap.VectorStyle()
+        let pointSimpleStyle = this.vectorStyle.getPointSimpleStyle(8, "#999999", "#d5d5d0", "1")
+        this.areaLayer = new KMap.VectorLayer("areaLayer", 999, { style: (f) => that.vectorStyle.getPolygonStyle("#0000001a", "#00000033", 3) })
+        this.subAreaLayer = new KMap.VectorLayer("subAreaLayer", 1000, {
+            style: (f) => {
+                return that.vectorStyle.getPolygonStyle(f.get("fillColor"), f.get("strokeColor"), 2)
+            }
+        })
+        this.afterDayNum = 3
+        this.areaPointLayer = new KMap.VectorLayer("areaPointLayer", 1002, { style: (f) => that.vectorStyle.getPointTextStyle(f.get("name"), "#120046", "#FFFFFF", 2, 13) })
+        this.treeCacheStyle = {}
+        this.treeStyle = (f) => {
+            let key = f.get("imgSrc");
+            if (that.treeCacheStyle[key]) {
+                return that.treeCacheStyle[key]
+            }
+            let style = new Style({
+                image: new Icon({
+                    src: f.get("imgSrc"),
+                    scale: 1,
+                    anchor: [0.5, 1],
+                })
+            });
+            that.treeCacheStyle[key] = style
+            return style
+        }
+        this.treeLayer = new KMap.VectorLayer("statusPointLayer", 999, { style: that.treeStyle })
+        this.treeFeatures = []
+
+        this.curArea = null
+        this.blueRegionLayer = new KMap.VectorLayer("blueRegionLayer", 99, {
+            minZoom: 1,
+            maxZoom: 22,
+            style: function (f) {
+                const selected = f.get('selected');
+                if (selected) {
+                    return that.vectorStyle.getPolygonStyle("rgba(23, 99, 110, 0.43)", "rgba(37, 227, 255, 0.7)", 2)
+                }
+                return that.vectorStyle.getPolygonStyle("rgba(0, 0, 0, 0.5)", "rgba(255, 255, 255, 0.2)", 1)
+            }
+        });
+
+        this.areaVal = 0
+    }
+
+    initMap(location, target, movable = true) {
+        let level = 18
+        let coordinate = util.wktCastGeom(location).getFirstCoordinate()
+        this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 10, 22, "img", movable, movable);
+        let xyz2 = config.base_img_url3 + 'map/lby/{z}/{x}/{y}.png';
+        this.kmap.addXYZLayer(xyz2, { minZoom: 12, maxZoom: 26 });
+        this.kmap.addLayer(this.areaLayer.layer)
+        this.kmap.addLayer(this.subAreaLayer.layer)
+        this.kmap.addLayer(this.treeLayer.layer)
+        this.kmap.addLayer(this.areaPointLayer.layer)
+        this.kmap.addLayer(this.blueRegionLayer.layer)
+
+        this.addMapSingerClick()
+    }
+
+    destroyMap() {
+        // 销毁地图实例
+        if (this.kmap) {
+            this.kmap.destroy()
+        }
+    }
+
+    initArea(data, callback) {
+        let that = this
+        this.areaLayer.refresh()
+        for (let item of data) {
+            that.areaLayer.addFeature(newAreaFeature(item))
+            that.areaPointLayer.addFeature(newAreaPoint(item))
+        }
+        callback && callback()
+    }
+
+    initSubArea(organId, callback) {
+        let that = this
+        this.subAreaLayer.refresh()
+        VE_API.sub_area.list({ organId }).then(({ data, code }) => {
+            for (let item of data) {
+                // item.fillColor = that.handleStatusColor(item.status).fillColor
+                // item.strokeColor = that.handleStatusColor(item.status).strokeColor
+                that.subAreaLayer.addFeature(newPolymerFeature(item))
+            }
+            callback && callback()
+        })
+    }
+
+
+    initTree(organId, callback) {
+        let that = this
+        this.treeLayer.refresh()
+        that.treeFeatures = []
+        VE_API.sub_area.treeList({ farmId: organId }).then(({ data }) => {
+            for (let item of data) {
+                let result = that.handleStatusIcon(item)
+                if (result.hasStatus) {
+                    item.imgSrc = result.imgSrc
+                    let point = newPoint(item);
+                    that.treeLayer.addFeature(point)
+                    that.treeFeatures.push(point)
+                }
+            }
+            callback && callback()
+        })
+    }
+
+    getBlueRegion({gardenId, regionId}, callback) {
+        this.blueRegionLayer.source && this.blueRegionLayer.source.clear()
+        const data = [
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 2,
+            "isGenerateReport": 1,
+            "name": "分区2",
+            "pointCount": 131,
+            "pointWkt": "POINT (113.6142086995688 23.585836479509055)",
+            "regionCode": "LBY-MR-2",
+            "wkt": "MULTIPOLYGON (((113.61348988377155 23.58617369800422, 113.61395837633405 23.58622555407246, 113.61414076654707 23.58622555407246, 113.61436964832843 23.5862774101407, 113.61478628474084 23.586468741036786, 113.61491681896747 23.58652417337007, 113.61512424307672 23.586449071517652, 113.61491503077356 23.585742756367924, 113.61479880177082 23.585596129050916, 113.61473800497858 23.585451289764112, 113.61438931780664 23.585286780835393, 113.61410858003889 23.585299297865365, 113.61385645239149 23.585249229909184, 113.61378135053907 23.585288569029306, 113.61357571446003 23.585283204611276, 113.61347200232355 23.585342213209604, 113.61338080721704 23.585506721974614, 113.61335934954492 23.585665866485304, 113.61342193444922 23.58616296916816, 113.61348988377155 23.58617369800422)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 9,
+            "isGenerateReport": 1,
+            "name": "分区9",
+            "pointCount": 63,
+            "pointWkt": "POINT (113.61725048541882 23.585262743588892)",
+            "regionCode": "LBY-MR-9",
+            "wkt": "MULTIPOLYGON (((113.61697301904715 23.585749021838886, 113.617320420354 23.585742359348075, 113.61752600578478 23.585708095109652, 113.61772112158744 23.5856785897931, 113.61789720170187 23.58559102562808, 113.61787340709186 23.585330236701996, 113.61793812843106 23.58526932250014, 113.61795526055036 23.585167481569073, 113.61793146594025 23.585022810339957, 113.61790671954574 23.58491525870246, 113.61779345720193 23.58473346788171, 113.61779821612386 23.584601169849783, 113.61771921801855 23.584509798547092, 113.61763260563801 23.584517412822354, 113.61755741467023 23.584640193010298, 113.61736515422085 23.584823887399946, 113.61726902399624 23.58487623554194, 113.61709484745067 23.584864814129187, 113.61707105284067 23.584962847922696, 113.61699586187265 23.585023762124397, 113.61689877986377 23.585071351344393, 113.61675981934107 23.58515796372515, 113.61663132844662 23.585192227963518, 113.61646000725422 23.58524076896813, 113.61634484134152 23.585320718857897, 113.61628392713976 23.585360693802862, 113.6162163504473 23.585397813394497, 113.61601552393823 23.585480618637533, 113.61596127222741 23.585499654325552, 113.61597174185577 23.585538677485918, 113.61598125969975 23.585561520311693, 113.61608690776846 23.585591025628073, 113.61610689524092 23.585611013100582, 113.61619350762157 23.58557960421532, 113.6162886860618 23.58552820785755, 113.61632104673151 23.585492040050294, 113.61638196093314 23.585453968674216, 113.61646095903859 23.585480618637543, 113.6164771393734 23.585505365031985, 113.61649617506146 23.585564375664962, 113.61648760900198 23.58561006131614, 113.61645048941011 23.58567192730245, 113.61649807863034 23.585676686224392, 113.61662466595578 23.585595784550236, 113.61671698904298 23.585495847187836, 113.61676553004737 23.585587218490588, 113.61681787818966 23.585559616742817, 113.61689211737293 23.5854558722431, 113.61695588692798 23.585499654325556, 113.61697301904715 23.585749021838886)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 29,
+            "isGenerateReport": 1,
+            "name": "分区8",
+            "pointCount": 40,
+            "pointWkt": "POINT (113.61587084394066 23.58618878122994)",
+            "regionCode": "LBY-MR-8",
+            "wkt": "MULTIPOLYGON (((113.61516876894466 23.58617727723074, 113.6153952936325 23.58616014511155, 113.61551426668275 23.586215348606817, 113.61564275757719 23.586290539574595, 113.61565798612749 23.58640951262483, 113.61577695917796 23.58637905552401, 113.61584168051715 23.586392380505654, 113.615912112563 23.58637048946448, 113.61613483011318 23.586200120056528, 113.6162547549478 23.586365730542376, 113.61623762282863 23.586448535785365, 113.61615196223237 23.586476137533136, 113.61634435485792 23.586946782901485, 113.61654695275945 23.586932042261843, 113.61651364030526 23.58667220511998, 113.61648127963554 23.586552280285296, 113.61640894402115 23.58641903046899, 113.61636135480092 23.586292443143435, 113.6163308977001 23.586121121951034, 113.61631471736528 23.58605735239606, 113.61618622647107 23.586071629162152, 113.61612911940675 23.58603260600161, 113.61610342122786 23.58595265611185, 113.61601109814079 23.585864140162432, 113.61585310193013 23.585803225960632, 113.61557898802205 23.585730890346124, 113.6153714990225 23.585723276070855, 113.61520493675204 23.585882224066058, 113.61516591359151 23.586056400611785, 113.61516876894466 23.58617727723074)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 12828,
+            "isGenerateReport": 1,
+            "name": "分区5",
+            "pointCount": 45,
+            "pointWkt": "POINT (113.61692837797158 23.58435388968608)",
+            "regionCode": "LBY-MR-5",
+            "wkt": "MULTIPOLYGON (((113.61726902399624 23.584875938109313, 113.61732981922493 23.584649032707855, 113.61741785928217 23.58458954618279, 113.6176284415812 23.584287354634938, 113.61761892373723 23.584146966435544, 113.61762249292879 23.584041080420736, 113.61758442155264 23.584010147427676, 113.61752374529698 23.583939953328095, 113.6174499820059 23.583857861923292, 113.61723702024568 23.5839113997961, 113.61706331959229 23.583947091711153, 113.61689794705232 23.583967317129648, 113.61673019505157 23.58399468093132, 113.61659218631306 23.584025613924393, 113.61641848565968 23.584054167456387, 113.61624716446725 23.584093428562902, 113.61621623147425 23.584286164904498, 113.61622218012678 23.584531249388036, 113.6162186109351 23.58466211974327, 113.61629713314835 23.584684724622857, 113.6166052733487 23.58470970896351, 113.61669926205845 23.584731124112597, 113.61678016373266 23.584778713332653, 113.61680276861217 23.584819164169826, 113.61683846052725 23.58481916416982, 113.61689080866942 23.584775144141148, 113.61697884872665 23.58482035390024, 113.61709484745067 23.584864516696555, 113.61726902399624 23.584875938109313)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 172047,
+            "isGenerateReport": 1,
+            "name": "认养分区",
+            "pointCount": null,
+            "pointWkt": "POINT (113.61573550741103 23.586606696698798)",
+            "regionCode": "LBY认养分区",
+            "wkt": "MULTIPOLYGON (((113.61553138381385 23.586555391814727, 113.61578836560238 23.586770495089638, 113.61593018147823 23.586692924660838, 113.61571507820327 23.5864349910878, 113.61553138381385 23.586555391814727)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 175094,
+            "isGenerateReport": 1,
+            "name": "12",
+            "pointCount": null,
+            "pointWkt": "POINT (113.61860504330416 23.583859757151316)",
+            "regionCode": "LBY-MR-12",
+            "wkt": "MULTIPOLYGON (((113.61790764544605 23.58437349638575, 113.61810434755591 23.58448136528483, 113.61834039008784 23.58457781277093, 113.61887973458238 23.58461715319288, 113.61901298439875 23.584476289101246, 113.61925029597637 23.584407760624345, 113.61937973865497 23.58437349638575, 113.61932390063691 23.584164103817216, 113.61923506742585 23.5838836446801, 113.61920587937084 23.583660292607078, 113.61927060071025 23.58345216908441, 113.61940004338908 23.5832846550295, 113.6191449651692 23.58325927411221, 113.61896095351813 23.583223740827805, 113.61884166320624 23.58314759807564, 113.61873379430745 23.58305115058954, 113.6185180565094 23.583087952919755, 113.61840257333529 23.58318947658927, 113.61825028783096 23.583260543158076, 113.61815510939073 23.583216126552543, 113.61807262140928 23.583183131360045, 113.61779216227194 23.583299883580025, 113.61792541208831 23.58360953077215, 113.61817668317042 23.583615876001545, 113.61831374012445 23.583843035212283, 113.61829216634476 23.583925523193727, 113.61821348550086 23.5839014113223, 113.6179825191524 23.583770699597665, 113.6178530764738 23.583793542423393, 113.61783784792328 23.583905218459847, 113.617946985868 23.58400166594589, 113.61795713823494 23.584085422973374, 113.61786703597829 23.58419963710162, 113.61785815265716 23.58428847031246, 113.61790764544605 23.58437349638575)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 175095,
+            "isGenerateReport": 1,
+            "name": "13",
+            "pointCount": null,
+            "pointWkt": "POINT (113.61907779775447 23.582774628335315)",
+            "regionCode": "LBY-MR-13",
+            "wkt": "MULTIPOLYGON (((113.6185180565094 23.583087952919755, 113.61873379430756 23.58305115058954, 113.61884166320624 23.58314759807564, 113.61896095351813 23.583223740827805, 113.6191449651692 23.58325927411221, 113.61940004338908 23.5832846550295, 113.61952853428329 23.58303148037845, 113.61974554112703 23.582682175502953, 113.61942574156774 23.58233191884284, 113.61909737594897 23.58227005285653, 113.61872713181651 23.58242614549863, 113.61843207865172 23.58267265765886, 113.61843112686734 23.583051467850964, 113.6185180565094 23.583087952919755)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 175096,
+            "isGenerateReport": 1,
+            "name": "15",
+            "pointCount": null,
+            "pointWkt": "POINT (113.61729343325402 23.581078231145653)",
+            "regionCode": "LBY-MR-15",
+            "wkt": "MULTIPOLYGON (((113.61579634969576 23.580895993441118, 113.61623258421344 23.58139885286704, 113.61657522659812 23.581547965756727, 113.61743341886756 23.5818731587608, 113.61737155288142 23.58216345300349, 113.61798704012836 23.582252286214498, 113.61852479831566 23.58088806190449, 113.61799973058703 23.58035347633188, 113.61769991850042 23.580115530231183, 113.61644039047451 23.580399479244647, 113.61574558786083 23.580797642386187, 113.61579634969576 23.580895993441118)))"
+        }
+    ]
+    for (let item of data) {
+        item.id = item.regionCode
+        try {
+            let feature = newAreaFeature(item);
+            this.blueRegionLayer.addFeature(feature)
+        } catch {
+            console.log('error');
+        }
+    }
+    this.kmap.fit(this.blueRegionLayer.source.getExtent(), [0, 0, 0, 0])
+    callback && callback(data.length)
+        // VE_API.farm.blueRegionList({ farmId: gardenId, regionId }).then(({ data, code }) => {
+        // })
+    }
+
+    setBlueRegion(data) {
+        this.blueRegionLayer.source.getFeatures().forEach(feature => {
+            // 检查 feature 的属性中是否有 selected 属性且为 true
+            data.map(item => {
+                if (item.id === feature.get('id')) {
+                    feature.set('selected', true)
+                }
+            })
+        });
+    }
+
+    toggleAllArea(val) {
+        let that = this
+        that.areaVal = 0
+        this.blueRegionLayer.source.getFeatures().forEach(feature => {
+            feature.set('selected', val)
+            if (val === true) {
+                let geom = feature.getGeometry().clone()
+                geom.transform(proj.get("EPSG:4326"), proj.get("EPSG:38572"))
+                let areaItem = getArea(geom)
+                areaItem = (areaItem + areaItem / 2) / 1000;
+                that.areaVal += areaItem
+            }
+            eventBus.emit("editNsMap:areaVal", that.areaVal)
+        });
+
+    }
+
+    // 状态图例
+    handleStatusIcon(obj) {
+        let key = this.afterDayNum == 3 ? "ycStatus" : this.afterDayNum == 5 ? "ycStatus5d" : "ycStatus7d"
+        let hasStatus = false
+        let imgSrc = null
+        if (obj[key] == 3) {
+            hasStatus = true
+            imgSrc = require('@/assets/img/status/status_bcyc.png')
+            return { hasStatus, imgSrc }
+        }
+        if (obj[key] == 2) {
+            hasStatus = true
+            imgSrc = require('@/assets/img/status/status_szyc.png')
+            return { hasStatus, imgSrc }
+        }
+        // if (obj[key] == 1) {
+        //     hasStatus = true
+        //     imgSrc = require('@/assets/status/status_dfh.png')
+        //     return { hasStatus, imgSrc }
+        // }
+        // if (obj[key] == 0) {
+        //     hasStatus = true
+        //     imgSrc = require('@/assets/status/status_xfdw.png')
+        //     return { hasStatus, imgSrc }
+        // }
+        return { hasStatus, imgSrc }
+    }
+
+    // 区级颜色
+    handleStatusColor(key) {
+        let fillColor = '#ffffff00'
+        let strokeColor = '#ffffff'
+        switch (key) {
+            case STATUS_ENUM.DONE:
+                fillColor = 'rgba(95,255,197,0)'
+                strokeColor = '#ffffff'
+                break;
+            case STATUS_ENUM.ABNORMAL_GROWTH:
+                fillColor = 'rgba(255,189,5,0.2)'
+                strokeColor = '#FFE44E'
+                break;
+            case STATUS_ENUM.ABNORMAL_Pest:
+                fillColor = 'rgba(51,11,3,0.52)'
+                strokeColor = '#F55A5A'
+                break;
+            case STATUS_ENUM.PENDING_REVIEW:
+                fillColor = 'rgba(3,40,51,0.2)'
+                strokeColor = '#032833'
+                break;
+            case STATUS_ENUM.REVIEWED:
+                fillColor = 'rgba(95,255,197,0.1)'
+                strokeColor = '#5FFFC5'
+                break;
+            default:
+                break;
+        }
+        return { fillColor, strokeColor }
+    }
+
+    addToggleTreeSelect(listener) {
+        let that = this
+        this.treeLayer.addToggleSelect(function ({ deselected, selected, preventDefault }) {
+            if (selected.length > 0) {
+                listener && listener(selected[0], deselected[0])
+            }
+            preventDefault()
+        }, this.kmap.map, that.treeStyle)
+    }
+
+    addToggleSubAreaSelect(listener) {
+        let that = this
+        this.subAreaLayer.addToggleSelect(function ({ deselected, selected, preventDefault }) {
+            if (selected.length > 0) {
+                that.treeLayer.source.forEachFeature((f) => {
+                    if (f.get("subAreaId") == selected[0].get("id")) {
+                        that.treeLayer.toggleSelect.getFeatures().remove(f)
+                    }
+                })
+                that.treeLayer.source.forEachFeature((f) => {
+                    if (f.get("subAreaId") == selected[0].get("id")) {
+                        that.treeLayer.toggleSelect.getFeatures().push(f)
+                    }
+                })
+            }
+            if (deselected.length > 0) {
+                that.treeLayer.source.forEachFeature((f) => {
+                    if (f.get("subAreaId") == deselected[0].get("id")) {
+                        that.treeLayer.toggleSelect.getFeatures().remove(f)
+                    }
+                })
+            }
+            listener && listener(selected[0], deselected[0])
+            preventDefault()
+        }, this.kmap.map)
+    }
+
+    refreshTree(organId, day, callback) {
+        this.afterDayNum = day
+        this.initTree(organId, callback)
+
+    }
+    fit(geomOrExtent) {
+        this.kmap.fit(geomOrExtent)
+    }
+
+
+    addMapSingerClick() {
+        let that = this
+        this.kmap.on("singleclick", (evt) => {
+            that.kmap.map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) {
+                if (layer instanceof VectorLayer && layer.get("name") === "blueRegionLayer") {
+                    feature.set('selected', feature.get("selected") ? false : true);
+
+                    let geom = feature.getGeometry().clone()
+                    geom.transform(proj.get("EPSG:4326"), proj.get("EPSG:38572"))
+                    let areaItem = getArea(geom)
+                    areaItem = (areaItem + areaItem / 2) / 1000;
+                    if (feature.get('selected') === true) {
+                        that.areaVal += areaItem
+                    } else {
+                        that.areaVal -= areaItem
+                    }
+                    eventBus.emit("editNsMap:areaVal", that.areaVal)
+                }
+            })
+        })
+    }
+
+    getSelectedBlueRegion() {
+        // 用于存储 selected 为 true 的 feature 的 id
+        const selectedFeatureIds = [];
+        // 遍历所有 features
+        this.blueRegionLayer.source.getFeatures().forEach(feature => {
+            // 检查 feature 的属性中是否有 selected 属性且为 true
+            if (feature.get('selected') === true) {
+                // 获取 feature 的 id
+                const id = feature.get('id');
+                // 将 id 添加到数组中
+                selectedFeatureIds.push({ id });
+            }
+        });
+        return selectedFeatureIds;
+    }
+
+
+}
+
+export default EditNsMap

+ 414 - 0
src/views/old_mini/agri_work/servicesIndex.vue

@@ -0,0 +1,414 @@
+<template>
+    <div class="completed-work">
+        <custom-header name="农事详情"></custom-header>
+        <div class="work-content" :class="{'hasBottom': curRole == 0}">
+            <div class="content-status">
+                <div class="status-l" v-if="status === 0">
+                    <div class="stauts-text">待执行</div>
+                    <div class="stauts-sub-text">距离预计执行时间还差 <span class="time-text">3</span> 天</div>
+                </div>
+                <div class="status-l" v-if="status === 1">
+                    <div class="stauts-text">
+                        <el-icon color="#2199F8" size="16" class="status-icon"><Select /></el-icon>
+                        该农事已完成
+                    </div>
+                </div>
+                <div class="status-r" v-if="curRole == 0">{{ status === 0 ? "设置提醒" : "去评价" }}</div>
+                <div class="status-r" v-if="curRole == 1">{{ status === 0 ? "提醒执行" : "提醒复核" }}</div>
+            </div>
+
+            <div class="work-wrap">
+                <div class="box-wrap farm-info">
+                    <div class="info-title">
+                        <div class="card-title">农场现状</div>
+                        <div class="info-more">
+                            点击查看更多
+                            <el-icon><ArrowRight /></el-icon>
+                        </div>
+                    </div>
+                    <div class="info-content">
+                        当前农场指标:当前农场指标:当前农场指标:当前农场指标:当前农场指标:当前农场指标:当前农场指标:当前农场指标:当前农场指标:当前农场指标:当前农场指标:当前农场指标:当前农场指标
+                    </div>
+                </div>
+                <div class="box-wrap farm-photo">
+                    <div class="photo-list">
+                        <div class="img-item" v-for="(item, index) in 6" :key="index">
+                            <img
+                                class="photo-item"
+                                src="https://birdseye-img-ali-cdn.sysuimars.com/16926861-1e20-4cbd-8bf2-90208db5a2d0/806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_202509010800_001_806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_20250901080536_0045_V_code-ws0fsmge97gh.jpeg"
+                                alt=""
+                            />
+                        </div>
+                    </div>
+                    <div class="list-text">点击查看更多</div>
+                </div>
+
+                <info-text></info-text>
+
+                <prescription-table></prescription-table>
+
+                <div class="work-map">
+                    <div class="card-title">执行农事区域</div>
+                    <div class="map-content">
+                        <div class="map-dom" ref="areaRef"></div>
+                    </div>
+                </div>
+            </div>
+
+            <div class="fixed-btn" v-if="curRole == 0">{{ status === 0 ? "确认完成" : "立即复核" }}</div>
+        </div>
+    </div>
+</template>
+
+<script setup>
+import customHeader from "@/components/customHeader.vue";
+import { onMounted, ref } from "vue";
+import NewFarmMap from "./newFarmMap";
+import { useStore } from "vuex";
+import infoText from "./components/infoText.vue"
+import prescriptionTable from "./components/prescriptionTable.vue"
+
+const store = useStore();
+
+// 角色
+// const curRole = store.state.app.curRole
+const curRole = 1
+
+// 0:执行, 1: 复核
+const status = ref(1);
+
+// 地图
+const areaRef = ref(null);
+let newFarmMap = new NewFarmMap();
+onMounted(() => {
+    const point = store.state.home.miniUserLocationPoint;
+    newFarmMap.initMap(point, areaRef.value, false);
+
+    getAreaList(() => {
+        console.log('areaList.value', areaList.value);
+        newFarmMap.initArea(areaList.value);
+    });
+})
+
+// 农场分区列表
+const areaList = ref([]);
+const regionId = ref(null);
+const getAreaList = (callback) => {
+    const data = [
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 2,
+            "isGenerateReport": 1,
+            "name": "分区2",
+            "pointCount": 131,
+            "pointWkt": "POINT (113.6142086995688 23.585836479509055)",
+            "regionCode": "LBY-MR-2",
+            "wkt": "MULTIPOLYGON (((113.61348988377155 23.58617369800422, 113.61395837633405 23.58622555407246, 113.61414076654707 23.58622555407246, 113.61436964832843 23.5862774101407, 113.61478628474084 23.586468741036786, 113.61491681896747 23.58652417337007, 113.61512424307672 23.586449071517652, 113.61491503077356 23.585742756367924, 113.61479880177082 23.585596129050916, 113.61473800497858 23.585451289764112, 113.61438931780664 23.585286780835393, 113.61410858003889 23.585299297865365, 113.61385645239149 23.585249229909184, 113.61378135053907 23.585288569029306, 113.61357571446003 23.585283204611276, 113.61347200232355 23.585342213209604, 113.61338080721704 23.585506721974614, 113.61335934954492 23.585665866485304, 113.61342193444922 23.58616296916816, 113.61348988377155 23.58617369800422)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 9,
+            "isGenerateReport": 1,
+            "name": "分区9",
+            "pointCount": 63,
+            "pointWkt": "POINT (113.61725048541882 23.585262743588892)",
+            "regionCode": "LBY-MR-9",
+            "wkt": "MULTIPOLYGON (((113.61697301904715 23.585749021838886, 113.617320420354 23.585742359348075, 113.61752600578478 23.585708095109652, 113.61772112158744 23.5856785897931, 113.61789720170187 23.58559102562808, 113.61787340709186 23.585330236701996, 113.61793812843106 23.58526932250014, 113.61795526055036 23.585167481569073, 113.61793146594025 23.585022810339957, 113.61790671954574 23.58491525870246, 113.61779345720193 23.58473346788171, 113.61779821612386 23.584601169849783, 113.61771921801855 23.584509798547092, 113.61763260563801 23.584517412822354, 113.61755741467023 23.584640193010298, 113.61736515422085 23.584823887399946, 113.61726902399624 23.58487623554194, 113.61709484745067 23.584864814129187, 113.61707105284067 23.584962847922696, 113.61699586187265 23.585023762124397, 113.61689877986377 23.585071351344393, 113.61675981934107 23.58515796372515, 113.61663132844662 23.585192227963518, 113.61646000725422 23.58524076896813, 113.61634484134152 23.585320718857897, 113.61628392713976 23.585360693802862, 113.6162163504473 23.585397813394497, 113.61601552393823 23.585480618637533, 113.61596127222741 23.585499654325552, 113.61597174185577 23.585538677485918, 113.61598125969975 23.585561520311693, 113.61608690776846 23.585591025628073, 113.61610689524092 23.585611013100582, 113.61619350762157 23.58557960421532, 113.6162886860618 23.58552820785755, 113.61632104673151 23.585492040050294, 113.61638196093314 23.585453968674216, 113.61646095903859 23.585480618637543, 113.6164771393734 23.585505365031985, 113.61649617506146 23.585564375664962, 113.61648760900198 23.58561006131614, 113.61645048941011 23.58567192730245, 113.61649807863034 23.585676686224392, 113.61662466595578 23.585595784550236, 113.61671698904298 23.585495847187836, 113.61676553004737 23.585587218490588, 113.61681787818966 23.585559616742817, 113.61689211737293 23.5854558722431, 113.61695588692798 23.585499654325556, 113.61697301904715 23.585749021838886)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 29,
+            "isGenerateReport": 1,
+            "name": "分区8",
+            "pointCount": 40,
+            "pointWkt": "POINT (113.61587084394066 23.58618878122994)",
+            "regionCode": "LBY-MR-8",
+            "wkt": "MULTIPOLYGON (((113.61516876894466 23.58617727723074, 113.6153952936325 23.58616014511155, 113.61551426668275 23.586215348606817, 113.61564275757719 23.586290539574595, 113.61565798612749 23.58640951262483, 113.61577695917796 23.58637905552401, 113.61584168051715 23.586392380505654, 113.615912112563 23.58637048946448, 113.61613483011318 23.586200120056528, 113.6162547549478 23.586365730542376, 113.61623762282863 23.586448535785365, 113.61615196223237 23.586476137533136, 113.61634435485792 23.586946782901485, 113.61654695275945 23.586932042261843, 113.61651364030526 23.58667220511998, 113.61648127963554 23.586552280285296, 113.61640894402115 23.58641903046899, 113.61636135480092 23.586292443143435, 113.6163308977001 23.586121121951034, 113.61631471736528 23.58605735239606, 113.61618622647107 23.586071629162152, 113.61612911940675 23.58603260600161, 113.61610342122786 23.58595265611185, 113.61601109814079 23.585864140162432, 113.61585310193013 23.585803225960632, 113.61557898802205 23.585730890346124, 113.6153714990225 23.585723276070855, 113.61520493675204 23.585882224066058, 113.61516591359151 23.586056400611785, 113.61516876894466 23.58617727723074)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 12828,
+            "isGenerateReport": 1,
+            "name": "分区5",
+            "pointCount": 45,
+            "pointWkt": "POINT (113.61692837797158 23.58435388968608)",
+            "regionCode": "LBY-MR-5",
+            "wkt": "MULTIPOLYGON (((113.61726902399624 23.584875938109313, 113.61732981922493 23.584649032707855, 113.61741785928217 23.58458954618279, 113.6176284415812 23.584287354634938, 113.61761892373723 23.584146966435544, 113.61762249292879 23.584041080420736, 113.61758442155264 23.584010147427676, 113.61752374529698 23.583939953328095, 113.6174499820059 23.583857861923292, 113.61723702024568 23.5839113997961, 113.61706331959229 23.583947091711153, 113.61689794705232 23.583967317129648, 113.61673019505157 23.58399468093132, 113.61659218631306 23.584025613924393, 113.61641848565968 23.584054167456387, 113.61624716446725 23.584093428562902, 113.61621623147425 23.584286164904498, 113.61622218012678 23.584531249388036, 113.6162186109351 23.58466211974327, 113.61629713314835 23.584684724622857, 113.6166052733487 23.58470970896351, 113.61669926205845 23.584731124112597, 113.61678016373266 23.584778713332653, 113.61680276861217 23.584819164169826, 113.61683846052725 23.58481916416982, 113.61689080866942 23.584775144141148, 113.61697884872665 23.58482035390024, 113.61709484745067 23.584864516696555, 113.61726902399624 23.584875938109313)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 126202,
+            "isGenerateReport": 1,
+            "name": "LBY-MR-SG1",
+            "pointCount": null,
+            "pointWkt": "POINT (113.67786773078139 23.512815571668426)",
+            "regionCode": "LBY-MR-SG1",
+            "wkt": "POLYGON ((113.67643632076339 23.512862037149922, 113.67909107058698 23.51321600379307, 113.67909107058698 23.512673254940246, 113.67661330408497 23.512472673842463, 113.67643632076339 23.512862037149922))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 172047,
+            "isGenerateReport": 1,
+            "name": "认养分区",
+            "pointCount": null,
+            "pointWkt": "POINT (113.61573550741103 23.586606696698798)",
+            "regionCode": "LBY认养分区",
+            "wkt": "MULTIPOLYGON (((113.61553138381385 23.586555391814727, 113.61578836560238 23.586770495089638, 113.61593018147823 23.586692924660838, 113.61571507820327 23.5864349910878, 113.61553138381385 23.586555391814727)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 175094,
+            "isGenerateReport": 1,
+            "name": "12",
+            "pointCount": null,
+            "pointWkt": "POINT (113.61860504330416 23.583859757151316)",
+            "regionCode": "LBY-MR-12",
+            "wkt": "MULTIPOLYGON (((113.61790764544605 23.58437349638575, 113.61810434755591 23.58448136528483, 113.61834039008784 23.58457781277093, 113.61887973458238 23.58461715319288, 113.61901298439875 23.584476289101246, 113.61925029597637 23.584407760624345, 113.61937973865497 23.58437349638575, 113.61932390063691 23.584164103817216, 113.61923506742585 23.5838836446801, 113.61920587937084 23.583660292607078, 113.61927060071025 23.58345216908441, 113.61940004338908 23.5832846550295, 113.6191449651692 23.58325927411221, 113.61896095351813 23.583223740827805, 113.61884166320624 23.58314759807564, 113.61873379430745 23.58305115058954, 113.6185180565094 23.583087952919755, 113.61840257333529 23.58318947658927, 113.61825028783096 23.583260543158076, 113.61815510939073 23.583216126552543, 113.61807262140928 23.583183131360045, 113.61779216227194 23.583299883580025, 113.61792541208831 23.58360953077215, 113.61817668317042 23.583615876001545, 113.61831374012445 23.583843035212283, 113.61829216634476 23.583925523193727, 113.61821348550086 23.5839014113223, 113.6179825191524 23.583770699597665, 113.6178530764738 23.583793542423393, 113.61783784792328 23.583905218459847, 113.617946985868 23.58400166594589, 113.61795713823494 23.584085422973374, 113.61786703597829 23.58419963710162, 113.61785815265716 23.58428847031246, 113.61790764544605 23.58437349638575)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 175095,
+            "isGenerateReport": 1,
+            "name": "13",
+            "pointCount": null,
+            "pointWkt": "POINT (113.61907779775447 23.582774628335315)",
+            "regionCode": "LBY-MR-13",
+            "wkt": "MULTIPOLYGON (((113.6185180565094 23.583087952919755, 113.61873379430756 23.58305115058954, 113.61884166320624 23.58314759807564, 113.61896095351813 23.583223740827805, 113.6191449651692 23.58325927411221, 113.61940004338908 23.5832846550295, 113.61952853428329 23.58303148037845, 113.61974554112703 23.582682175502953, 113.61942574156774 23.58233191884284, 113.61909737594897 23.58227005285653, 113.61872713181651 23.58242614549863, 113.61843207865172 23.58267265765886, 113.61843112686734 23.583051467850964, 113.6185180565094 23.583087952919755)))"
+        },
+        {
+            "farmCode": "LBY",
+            "farmId": "766",
+            "id": 175096,
+            "isGenerateReport": 1,
+            "name": "15",
+            "pointCount": null,
+            "pointWkt": "POINT (113.61729343325402 23.581078231145653)",
+            "regionCode": "LBY-MR-15",
+            "wkt": "MULTIPOLYGON (((113.61579634969576 23.580895993441118, 113.61623258421344 23.58139885286704, 113.61657522659812 23.581547965756727, 113.61743341886756 23.5818731587608, 113.61737155288142 23.58216345300349, 113.61798704012836 23.582252286214498, 113.61852479831566 23.58088806190449, 113.61799973058703 23.58035347633188, 113.61769991850042 23.580115530231183, 113.61644039047451 23.580399479244647, 113.61574558786083 23.580797642386187, 113.61579634969576 23.580895993441118)))"
+        }
+    ]
+    areaList.value = data;
+    regionId.value = (data && data.length && data[0].id) || "";
+    changeRegion(regionId.value);
+    callback && callback();
+    // VE_API.region.list({ farmId: gardenId.value }).then(({ data, code }) => {
+    // });
+};
+
+// 切换分区
+const gardenId = ref(null);
+const changeRegion = (e) => {
+    newFarmMap.getBlueRegion({ gardenId: gardenId.value, regionId: e }, () => {
+        // newFarmMap.setBlueRegion([{id: "ws0y1me7h94u"}, {id: "ws0y1me545tg"}])
+        // serveArea.value = "3.72亩"
+    });
+};
+
+</script>
+
+<style lang="scss" scoped>
+.completed-work {
+    height: 100vh;
+    position: relative;
+    overflow: auto;
+    font-size: 14px;
+    background: #f2f3f5;
+    .work-content {
+        height: calc(100% - 40px);
+        overflow: auto;
+        box-sizing: border-box;
+        &.hasBottom {
+            padding-bottom: 60px;
+        }
+        .work-wrap {
+            position: relative;
+            z-index: 3;
+            padding: 0 12px;
+            top: -16px;
+        }
+        .fixed-btn {
+            position: absolute;
+            z-index: 10;
+            bottom: 26px;
+            left: 50%;
+            transform: translateX(-50%);
+            padding: 0 60px;
+            height: 42px;
+            line-height: 42px;
+            background: linear-gradient(180deg, #70BFFE, #2199F8);
+            border-radius: 20px;
+            color: #fff;
+            font-size: 16px;
+        }
+        .card-title {
+            font-size: 16px;
+            font-weight: bold;
+            color: #000;
+            display: flex;
+            align-items: center;
+
+            .type-tag {
+                margin-left: 5px;
+                font-size: 12px;
+                color: #000000;
+                padding: 0 10px;
+                background: rgba(119, 119, 119, 0.1);
+                border-radius: 20px;
+                font-weight: normal;
+                height: 26px;
+                line-height: 26px;
+            }
+        }
+        .box-wrap {
+            background: #fff;
+            padding: 10px;
+            border-radius: 8px;
+        }
+
+        .content-status {
+            position: relative;
+            padding: 26px 12px 20px 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: 136px;
+                background: #2199f8;
+                width: 100%;
+            }
+            .status-l {
+                .stauts-text {
+                    font-size: 22px;
+                    display: flex;
+                    align-items: center;
+                    .status-icon {
+                        width: 24px;
+                        height: 24px;
+                        background: #FFFFFF;
+                        border-radius: 50%;
+                        margin-right: 8px;
+                    }
+                }
+                .stauts-sub-text {
+                    color: rgba(255, 255, 255, 0.51);
+                    font-size: 14px;
+                }
+                .time-text {
+                    color: #ffff;
+                }
+            }
+            .status-r {
+                height: 32px;
+                line-height: 32px;
+                padding: 0 16px;
+                color: #2199f8;
+                font-size: 16px;
+                background: #fff;
+                border-radius: 20px;
+            }
+        }
+
+        .info-content {
+            padding: 10px 0;
+            position: relative;
+        }
+        .farm-info {
+            color: rgba(0, 0, 0, 0.6);
+            font-size: 14px;
+            margin-top: 14px;
+            .info-title {
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+                color: rgba(41, 41, 41, 0.3);
+                .info-more {
+                    display: flex;
+                    align-items: center;
+                }
+            }
+        }
+        .farm-photo {
+            margin-top: 10px;
+            .photo-list {
+                display: flex;
+                align-items: center;
+                width: 100%;
+                overflow: auto;
+                padding-bottom: 10px;
+                .photo-item {
+                    width: 92px;
+                    height: 92px;
+                    border-radius: 8px;
+                    object-fit: cover;
+                }
+                .img-item + .img-item {
+                    margin-left: 12px;
+                }
+            }
+            .list-text {
+                text-align: center;
+                color: rgba(0, 0, 0, 0.5);
+                padding-top: 2px;
+            }
+        }
+
+        .farm-data {
+            margin-top: 10px;
+            .data-content {
+                margin-top: 8px;
+                border-top: 1px solid #f5f5f5;
+                padding: 8px 0;
+            }
+        }
+
+        .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;
+        }
+
+        .farm-table {
+            margin-top: 10px;
+            .table-item {
+                padding: 10px 0 12px 0;
+            }
+        }
+
+        .work-map {
+            padding: 10px 0;
+            .map-content {
+                padding-top: 8px;
+                .map-dom {
+                    height: 166px;
+                    width: 100%;
+                    clip-path: inset(0px round 8px);
+                }
+            }
+        }
+    }
+}
+</style>

+ 6 - 6
src/views/old_mini/modify_work/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="new-farming-page">
-        <custom-header :name="isAdd ? '新增农事' : '编辑农事'"></custom-header>
+        <custom-header :name="isAdd ? '新增农事' : '农事详情'"></custom-header>
         <div class="new-farming-content">
             <div v-if="!isAdd">
                 <div class="box-wrap farm-info">
@@ -56,7 +56,7 @@
                                     <el-option v-for="(item, index) in farmWorkIndexNameList" :key="index" :value="item" :label="item" />
                                 </el-select>
                                 <span class="symbol"></span>
-                                <el-select v-model="dynamicValidateForm.conditionRate" placeholder="" style="width: 34%">
+                                <el-select v-model="dynamicValidateForm.conditionRate" placeholder="" style="width: 38%">
                                     <el-option :value="0" label="0%" />
                                     <el-option :value="5" label="5%" />
                                     <el-option :value="10" label="10%" />
@@ -284,7 +284,7 @@
                         </el-form-item>
                     </div>
                 </div>
-                <div class="farm-card map-content" v-if="curRole==0">
+                <div class="farm-card map-content" v-if="!(curRole==1 && isAdd)">
                     <div class="card-title">执行农事区域</div>
                     <div class="info-content">
                         <div class="area-select">
@@ -351,8 +351,8 @@ const curRole = 0
 const gardenId = ref(null);
 const actionType = ref([]);
 const isAdd = ref(false)
+isAdd.value = route.query.isAdd ? true : false
 onMounted(() => {
-    isAdd.value = route.query.isAdd ? true : false
     window.scrollTo(0, 0);
     getFarmWorkNameList();
     getFarmWorkIndexNameList();
@@ -375,7 +375,7 @@ onMounted(() => {
             },
         ],
     }));
-    if (curRole==0) {
+    if (!(curRole==1 && isAdd.value)) {
         const point = store.state.home.miniUserLocationPoint;
         newFarmMap.initMap(point, areaRef.value);
         // eventBus.on("editNsMap:areaVal", getArea);
@@ -626,7 +626,7 @@ const submitForm = (formEl) => {
 
 const submit = () => {
     let executeBlueZones = null
-    if (curRole==0) {
+    if (!(curRole==1 && isAdd.value)) {
         executeBlueZones = newFarmMap.getSelectedBlueRegion();
     }
     // if (!executeBlueZones || !executeBlueZones.length) {

+ 8 - 2
src/views/old_mini/task_condition/components/task.vue

@@ -46,9 +46,9 @@
                                         <el-icon class="btn-icon" size="14" color="#8B8B8B"><ChatDotSquare /></el-icon>
                                         联系果园
                                     </div>
-                                    <div class="btn primary" v-if="item == 2 || item == 1">
+                                    <div class="btn primary" v-if="item == 2 || item == 1" @click="toPage">
                                         <el-icon class="btn-icon" size="14"><Plus /></el-icon>
-                                        加入任务
+                                        报价
                                     </div>
                                     <div class="btn primary" v-else>
                                         <el-icon class="btn-icon" size="14"><Select /></el-icon>
@@ -70,8 +70,10 @@ import { useStore } from "vuex";
 import IndexMap from "../../farm_manage/map/index";
 import taskItem from "@/components/taskItem.vue";
 import calendar from "./calendar.vue"
+import { useRouter } from "vue-router";
 
 const store = useStore();
+const router = useRouter();
 const indexMap = new IndexMap();
 const mapContainer = ref(null);
 const tabBarHeight = computed(() => store.state.home.tabBarHeight);
@@ -106,6 +108,10 @@ const activeIndex = ref(0);
 function handleActiveFilter(i) {
     activeIndex.value = i;
 }
+
+function toPage() {
+    router.push("/services_agri")
+}
 </script>
 
 <style lang="scss" scoped>