| | |
| | | <template> |
| | | <basic-container> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-col :span="11"> |
| | | <avue-form ref="form" v-model="form" :option="option" @submit="submit"></avue-form> |
| | | </el-col> |
| | | <el-col :span="1"> |
| | | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <OpenLayersMap ref="olMap" @getMapData="getMapData" :map-location="mapLocation"></OpenLayersMap> |
| | | <!-- <avue-input-map v-model="form"></avue-input-map>--> |
| | | </el-col> |
| | | </el-row> |
| | | </basic-container> |
| | |
| | | import {add} from "@/api/fire/fire"; |
| | | import OpenLayersMap from "@/components/OpenLayersMap/index"; |
| | | import axios from "@/router/axios" |
| | | import {getDetail} from "@/api/base/region"; |
| | | export default { |
| | | name: "fireAdd", |
| | | components: {OpenLayersMap}, |
| | |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label:'具体地址', |
| | |
| | | "form.location":{ |
| | | handler(newVal){ |
| | | if (newVal){ |
| | | this.$refs.olMap.getLocation(newVal) |
| | | if (newVal.length == 3){ |
| | | this.getRegionDetail(newVal) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | }, |
| | | //获取地图经纬度 |
| | | getMapData(data){ |
| | | this.form.lon = data[0][0] |
| | | this.form.lat = data[0][1] |
| | | this.form.lon = data[0] |
| | | this.form.lat = data[1] |
| | | }, |
| | | getRegionDetail(regionCode){ |
| | | let code = regionCode[2] |
| | | getDetail(code).then(res=>{ |
| | | let data = res.data.data |
| | | let regionName = [data.provinceName,data.cityName,data.districtName] |
| | | this.$refs.olMap.getLocation(regionCode,regionName) |
| | | }) |
| | | } |
| | | } |
| | | } |