|
@@ -11,7 +11,7 @@
|
|
<el-option v-for="(item, index) in unitArr" :key="index" :label="item.label" :value="item.id"></el-option>
|
|
<el-option v-for="(item, index) in unitArr" :key="index" :label="item.label" :value="item.id"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
<template slot="latitude">
|
|
<template slot="latitude">
|
|
- <el-input v-model="initDot" @change="initDotTggle" placeholder="请选择经纬坐标">
|
|
|
|
|
|
+ <el-input v-model="initDot" @change="initDotTggle" placeholder="请输入正确坐标或选择坐标">
|
|
<i slot="suffix" class="zoniot_font zoniot-icon-dizhi" @click="QueryClick"></i>
|
|
<i slot="suffix" class="zoniot_font zoniot-icon-dizhi" @click="QueryClick"></i>
|
|
</el-input>
|
|
</el-input>
|
|
</template>
|
|
</template>
|
|
@@ -46,8 +46,8 @@ export default {
|
|
latitude: this.$valid.custome({
|
|
latitude: this.$valid.custome({
|
|
validator(rule, value, cb) {
|
|
validator(rule, value, cb) {
|
|
const rl = rule;
|
|
const rl = rule;
|
|
- if (!value) {
|
|
|
|
- rl.message = '请输入或选择坐标';
|
|
|
|
|
|
+ if (!value || !_this.formData.longitude) {
|
|
|
|
+ rl.message = '请输入正确坐标或选择坐标';
|
|
cb(new Error());
|
|
cb(new Error());
|
|
} else if (_this.initDot.split(',').length > 2) {
|
|
} else if (_this.initDot.split(',').length > 2) {
|
|
rl.message = '一个巡更点只能有一个经纬度';
|
|
rl.message = '一个巡更点只能有一个经纬度';
|
|
@@ -191,7 +191,9 @@ export default {
|
|
this.nestedLoop(this.buildingArr, 'unit', 'unitArr', e);
|
|
this.nestedLoop(this.buildingArr, 'unit', 'unitArr', e);
|
|
},
|
|
},
|
|
initDotTggle() {
|
|
initDotTggle() {
|
|
- // console.log(this.initDot.split(','))
|
|
|
|
|
|
+ let logPoint = this.initDot.split(',');
|
|
|
|
+ this.formData.latitude = logPoint[0];
|
|
|
|
+ this.formData.longitude = logPoint[1];
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|