|
@@ -300,6 +300,7 @@ const MAP_KEY = "CZLBZ-LJICQ-R4A5J-BN62X-YXCRJ-GNBUT";
|
|
|
|
|
|
const handleSearchRes = (v) => {
|
|
const handleSearchRes = (v) => {
|
|
authenticMap.setMapCenter(v);
|
|
authenticMap.setMapCenter(v);
|
|
|
|
+ onRest()
|
|
};
|
|
};
|
|
|
|
|
|
const locationOptions = reactive({
|
|
const locationOptions = reactive({
|
|
@@ -312,7 +313,7 @@ const remoteMethod = async (keyword) => {
|
|
const params = {
|
|
const params = {
|
|
key: MAP_KEY,
|
|
key: MAP_KEY,
|
|
keyword,
|
|
keyword,
|
|
- // location: store.getters.userLocation,
|
|
|
|
|
|
+ // location: location.value,
|
|
location: "22.574540836684672,113.1093017627431",
|
|
location: "22.574540836684672,113.1093017627431",
|
|
};
|
|
};
|
|
await VE_API.old_mini_map
|
|
await VE_API.old_mini_map
|
|
@@ -336,7 +337,16 @@ const remoteMethod = async (keyword) => {
|
|
locationOptions.list = [];
|
|
locationOptions.list = [];
|
|
}
|
|
}
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+const validatePhoneNumber = (rule, value, callback) => {
|
|
|
|
+ const phoneRegex = /^[1][3-9]\d{9}$/
|
|
|
|
+ if (!value) {
|
|
|
|
+ callback(new Error('请输入联系电话'))
|
|
|
|
+ } else if (!phoneRegex.test(value)) {
|
|
|
|
+ callback(new Error('手机号码格式不正确'));
|
|
|
|
+ } else {
|
|
|
|
+ callback();
|
|
|
|
+ }
|
|
|
|
+}
|
|
const rules = {
|
|
const rules = {
|
|
address: [{ required: true, message: "请输入农场地址", trigger: "change" }],
|
|
address: [{ required: true, message: "请输入农场地址", trigger: "change" }],
|
|
farmName: [{ required: true, message: "请输入农场名称", trigger: "change" }],
|
|
farmName: [{ required: true, message: "请输入农场名称", trigger: "change" }],
|
|
@@ -344,7 +354,7 @@ const rules = {
|
|
{ required: true, message: "请输入作物物种", trigger: "change" },
|
|
{ required: true, message: "请输入作物物种", trigger: "change" },
|
|
],
|
|
],
|
|
masterName: [{ required: true, message: "请输入姓名", trigger: "change" }],
|
|
masterName: [{ required: true, message: "请输入姓名", trigger: "change" }],
|
|
- masterTel: [{ required: true, message: "请输入联系电话", trigger: "change" }],
|
|
|
|
|
|
+ masterTel: [{ required: true, validator: validatePhoneNumber, trigger: "change" }],
|
|
};
|
|
};
|
|
const ruleFormRef = ref(null);
|
|
const ruleFormRef = ref(null);
|
|
const initForm = {
|
|
const initForm = {
|
|
@@ -370,12 +380,12 @@ const formInlineSearch = reactive({
|
|
});
|
|
});
|
|
|
|
|
|
const onSearch = () => {
|
|
const onSearch = () => {
|
|
- // isUpdata.value = false
|
|
|
|
authenticMap.search(formInlineSearch)
|
|
authenticMap.search(formInlineSearch)
|
|
};
|
|
};
|
|
|
|
|
|
const onRest = () => {
|
|
const onRest = () => {
|
|
Object.assign(formInlineSearch, initForm);
|
|
Object.assign(formInlineSearch, initForm);
|
|
|
|
+ isUpdata.value = false
|
|
onCancel()
|
|
onCancel()
|
|
};
|
|
};
|
|
|
|
|
|
@@ -397,13 +407,14 @@ const onCancel = (isCancel) => {
|
|
if (isUpdata.value || isCancel) {
|
|
if (isUpdata.value || isCancel) {
|
|
authenticMap.cancelDraw();
|
|
authenticMap.cancelDraw();
|
|
} else {
|
|
} else {
|
|
|
|
+ // authenticMap.cancelDraw();
|
|
getList((geoms)=>{
|
|
getList((geoms)=>{
|
|
- const geometriesWkt = []
|
|
|
|
- for(let item of geoms){
|
|
|
|
- geometriesWkt.push(item.featureWkt)
|
|
|
|
- }
|
|
|
|
- authenticMap.fit(geometriesWkt)
|
|
|
|
- authenticMap.allSelect()
|
|
|
|
|
|
+ // const geometriesWkt = []
|
|
|
|
+ // for(let item of geoms){
|
|
|
|
+ // geometriesWkt.push(item.featureWkt)
|
|
|
|
+ // }
|
|
|
|
+ // authenticMap.fit(geometriesWkt)
|
|
|
|
+ authenticMap.allUnSelect()
|
|
});
|
|
});
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -573,7 +584,7 @@ const updatePointList = () => {
|
|
|
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
isRefresh.value = true
|
|
isRefresh.value = true
|
|
- if (mapData.isEdit && mapData.selectPointArr.length < 2&&isRefresh.value) {
|
|
|
|
|
|
+ if (mapData.isEdit && mapData.selectPointArr.length < 2&& isRefresh.value) {
|
|
isEdit.value = true;
|
|
isEdit.value = true;
|
|
disabledForm.value = false;
|
|
disabledForm.value = false;
|
|
isUpdata.value = true;
|
|
isUpdata.value = true;
|