| 
														
															@@ -46,12 +46,12 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                     label-width="auto" 
														 | 
														
														 | 
														
															                                     label-width="auto" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                     class="demo-ruleForm" 
														 | 
														
														 | 
														
															                                     class="demo-ruleForm" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                 > 
														 | 
														
														 | 
														
															                                 > 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                    <el-form-item label="农场位置" prop="position"> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                    <el-form-item label="农场位置" prop="address"> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                         <div class="position-wrap"> 
														 | 
														
														 | 
														
															                                         <div class="position-wrap"> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                             <el-input 
														 | 
														
														 | 
														
															                                             <el-input 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                                 placeholder="农场位置" 
														 | 
														
														 | 
														
															                                                 placeholder="农场位置" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                                 readonly 
														 | 
														
														 | 
														
															                                                 readonly 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                                v-model="ruleForm.position" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                                v-model="ruleForm.address" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                                 autocomplete="off" 
														 | 
														
														 | 
														
															                                                 autocomplete="off" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                             /> 
														 | 
														
														 | 
														
															                                             /> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                             <div class="draw-btn" @click="toSubPage">点击勾选地块</div> 
														 | 
														
														 | 
														
															                                             <div class="draw-btn" @click="toSubPage">点击勾选地块</div> 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -68,20 +68,17 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                             <div class="unit">亩</div> 
														 | 
														
														 | 
														
															                                             <div class="unit">亩</div> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                         </div> 
														 | 
														
														 | 
														
															                                         </div> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                     </el-form-item> 
														 | 
														
														 | 
														
															                                     </el-form-item> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                    <el-form-item label="种植作物" prop="period"> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                    <el-form-item label="种植作物" prop="phenologyId"> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                         <div class="select-wrap"> 
														 | 
														
														 | 
														
															                                         <div class="select-wrap"> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                            <el-select class="select-item" v-model="ruleForm.type" placeholder="作物类型"> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                                <el-option v-for="(item, index) in specieList" :key="index" :value="item.id">{{ item.name }}</el-option> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                            <el-select @change="changeSpecie" class="select-item" v-model="ruleForm.speciesItem" placeholder="作物类型"> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                                <el-option v-for="(item, index) in specieList" :key="index" :label="item.name" :value="{value: item.id, ...item}" /> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                             </el-select> 
														 | 
														
														 | 
														
															                                             </el-select> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                             <el-select 
														 | 
														
														 | 
														
															                                             <el-select 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                                v-model="ruleForm.period" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                                v-model="ruleForm.phenologyId" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                                 placeholder="物候期" 
														 | 
														
														 | 
														
															                                                 placeholder="物候期" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                                 class="period-select select-item" 
														 | 
														
														 | 
														
															                                                 class="period-select select-item" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                             > 
														 | 
														
														 | 
														
															                                             > 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                                <el-option label="秋梢期" value="秋梢期" /> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                                <el-option label="开花期" value="开花期" /> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                                <el-option label="膨果期" value="膨果期" /> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                                <el-option label="成熟期" value="成熟期" /> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                                <el-option v-for="(item, index) in phenologyList" :key="index" :label="item.name" :value="item.id" /> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                             </el-select> 
														 | 
														
														 | 
														
															                                             </el-select> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                         </div> 
														 | 
														
														 | 
														
															                                         </div> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                     </el-form-item> 
														 | 
														
														 | 
														
															                                     </el-form-item> 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -114,6 +111,7 @@ import { mapLocation } from "./map/index.js" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import { onMounted, ref, reactive, watch, onActivated } from "vue"; 
														 | 
														
														 | 
														
															 import { onMounted, ref, reactive, watch, onActivated } from "vue"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import { useStore } from "vuex"; 
														 | 
														
														 | 
														
															 import { useStore } from "vuex"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import { convertPointToArray } from "@/utils/index"; 
														 | 
														
														 | 
														
															 import { convertPointToArray } from "@/utils/index"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import { ElMessage } from "element-plus"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 const route = useRoute(); 
														 | 
														
														 | 
														
															 const route = useRoute(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 const router = useRouter(); 
														 | 
														
														 | 
														
															 const router = useRouter(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 const store = useStore(); 
														 | 
														
														 | 
														
															 const store = useStore(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -186,24 +184,24 @@ const handleSearchRes = (v) => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     const coordinateArray = [parseFloat(parts[1]), parseFloat(parts[0])]; 
														 | 
														
														 | 
														
															     const coordinateArray = [parseFloat(parts[1]), parseFloat(parts[0])]; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     indexMap.setMapPosition(coordinateArray); 
														 | 
														
														 | 
														
															     indexMap.setMapPosition(coordinateArray); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     centerPoint.value = `POINT (${coordinateArray[0]} ${coordinateArray[1]})` 
														 | 
														
														 | 
														
															     centerPoint.value = `POINT (${coordinateArray[0]} ${coordinateArray[1]})` 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ruleForm.position = v.item?.title || v.item?.address; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    ruleForm.address = v.item?.title || v.item?.address; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     pointAddress.value = v.item?.province + v.item?.city + v.item?.district 
														 | 
														
														 | 
														
															     pointAddress.value = v.item?.province + v.item?.city + v.item?.district 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 }; 
														 | 
														
														 | 
														
															 }; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 // 表单 
														 | 
														
														 | 
														
															 // 表单 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 const ruleFormRef = ref(null); 
														 | 
														
														 | 
														
															 const ruleFormRef = ref(null); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 const ruleForm = reactive({ 
														 | 
														
														 | 
														
															 const ruleForm = reactive({ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    position: "", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    address: "", 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     area: "", 
														 | 
														
														 | 
														
															     area: "", 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    type: "", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    period: "", 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    speciesItem: "", 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    phenologyId: "", 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     name: "", 
														 | 
														
														 | 
														
															     name: "", 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 }); 
														 | 
														
														 | 
														
															 }); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 const rules = reactive({ 
														 | 
														
														 | 
														
															 const rules = reactive({ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    position: [{ required: true, message: "请选择农场位置", trigger: "blur" }], 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    address: [{ required: true, message: "请选择农场位置", trigger: "blur" }], 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     area: [{ required: true, message: "请勾选地块获得农场面积", trigger: "blur" }], 
														 | 
														
														 | 
														
															     area: [{ required: true, message: "请勾选地块获得农场面积", trigger: "blur" }], 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    type: [{ required: true, message: "请选择品类", trigger: "blur" }], 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    period: [{ required: true, message: "请选择物候期", trigger: "blur" }], 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    speciesItem: [{ required: true, message: "请选择品类", trigger: "blur" }], 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    phenologyId: [{ required: true, message: "请选择物候期", trigger: "blur" }], 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     name: [{ required: true, message: "请输入您的农场名称", trigger: "blur" }], 
														 | 
														
														 | 
														
															     name: [{ required: true, message: "请输入您的农场名称", trigger: "blur" }], 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 }); 
														 | 
														
														 | 
														
															 }); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -213,8 +211,16 @@ const submitForm = (formEl) => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (valid) { 
														 | 
														
														 | 
														
															         if (valid) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             const params = { 
														 | 
														
														 | 
														
															             const params = { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 ...ruleForm, 
														 | 
														
														 | 
														
															                 ...ruleForm, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                gemo: polygonArr.value 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                wkt: centerPoint.value, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                speciesId: ruleForm.speciesItem?.id, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                containerId: ruleForm.speciesItem?.defaultContainerId, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                // geom: polygonArr.value 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            VE_API.farm.saveFarm(params).then((res) => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                console.log('code', res.code); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                ElMessage.success("创建成功") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                router.replace('/home?reload=true') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            }) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             console.log("submit!", params); 
														 | 
														
														 | 
														
															             console.log("submit!", params); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } else { 
														 | 
														
														 | 
														
															         } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             console.log("error submit!"); 
														 | 
														
														 | 
														
															             console.log("error submit!"); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -231,7 +237,7 @@ const resetForm = (formEl) => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 const centerPoint = ref(null) 
														 | 
														
														 | 
														
															 const centerPoint = ref(null) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 function toSubPage() { 
														 | 
														
														 | 
														
															 function toSubPage() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    router.push(`/edit_map?mapCenter=${centerPoint.value}&pointName=${ruleForm.position}&pointAddress=${pointAddress.value}`); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    router.push(`/edit_map?mapCenter=${centerPoint.value}&pointName=${ruleForm.address}&pointAddress=${pointAddress.value}`); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 const pointAddress = ref(null) 
														 | 
														
														 | 
														
															 const pointAddress = ref(null) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -245,7 +251,7 @@ function getLocationName(location) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             const add = result.formatted_addresses?.recommend 
														 | 
														
														 | 
														
															             const add = result.formatted_addresses?.recommend 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 ? result.formatted_addresses.recommend 
														 | 
														
														 | 
														
															                 ? result.formatted_addresses.recommend 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 : result.address + ""; 
														 | 
														
														 | 
														
															                 : result.address + ""; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            ruleForm.position = add 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            ruleForm.address = add 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             pointAddress.value = result.address 
														 | 
														
														 | 
														
															             pointAddress.value = result.address 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         }); 
														 | 
														
														 | 
														
															         }); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -264,6 +270,18 @@ function getSpecieList() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         specieList.value = data 
														 | 
														
														 | 
														
															         specieList.value = data 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     }) 
														 | 
														
														 | 
														
															     }) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+function changeSpecie(v) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    getPhenology(v.defaultContainerId) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+const phenologyList = ref([]) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+function getPhenology(containerId) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    VE_API.farm.fetchPhenologyList({containerId}).then(({data}) => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        console.log('getPhenology', data); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        phenologyList.value = data 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    }) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 </script> 
														 | 
														
														 | 
														
															 </script> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 <style lang="scss" scoped> 
														 | 
														
														 | 
														
															 <style lang="scss" scoped> 
														 |