|  |  |  | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | const longAndLatVal = (rule, value, callback) => { | 
|---|
|  |  |  | let longAndLat = value.split(',') | 
|---|
|  |  |  | this.form.longitude = longAndLat[0] | 
|---|
|  |  |  | this.form.latitude = longAndLat.length==2 ? longAndLat[1] : '' | 
|---|
|  |  |  | this.form.latitude = longAndLat[0] | 
|---|
|  |  |  | this.form.longitude = longAndLat.length==2 ? longAndLat[1] : '' | 
|---|
|  |  |  | if (!this.form.longitude || !this.form.latitude) { | 
|---|
|  |  |  | callback(new Error()) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | 
|---|
|  |  |  | for (const key in this.form) { | 
|---|
|  |  |  | this.form[key] = target[key] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.form.longAndLat = `${this.form.longitude},${this.form.latitude}` | 
|---|
|  |  |  | this.form.longAndLat = `${this.form.latitude},${this.form.longitude}` | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeLongAndLat(v) { | 
|---|
|  |  |  | let longAndLat = v.split(',') | 
|---|
|  |  |  | // console.log(longAndLat); | 
|---|
|  |  |  | this.form.longitude = longAndLat[0] | 
|---|
|  |  |  | this.form.latitude = longAndLat.length==2 ? longAndLat[1] : '' | 
|---|
|  |  |  | this.form.latitude = longAndLat[0] | 
|---|
|  |  |  | this.form.longitude = longAndLat.length==2 ? longAndLat[1] : '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | } | 
|---|