| | |
| | | </el-form-item> |
| | | |
| | | <el-form-item class="optionItem" label="描述:" prop="description"> |
| | | <el-input type="textarea" |
| | | <el-input |
| | | type="textarea" |
| | | v-model="form.description" |
| | | placeholder="请填写描述" |
| | | :rows="4" |
| | |
| | | |
| | | <el-form-item class="optionItem" label="责任区域:" prop="region"> |
| | | <Map |
| | | style="width: 400px; height: 300px" |
| | | :point="point" |
| | | :zoom="zoom" |
| | | @getRegion="getRegion" |
| | | style="width: 600px; height: 400px" |
| | | :region="form.region" |
| | | ></Map> |
| | | </el-form-item> |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import Map from "./map.vue"; |
| | | import Map from "./leafletMap.vue"; |
| | | |
| | | import { createNamespacedHelpers } from "vuex"; |
| | | const { mapActions } = createNamespacedHelpers("orgGrid"); |
| | |
| | | children: "children", |
| | | label: "departName", |
| | | }, |
| | | point: { x: "119.27179890", y: "28.59027084" }, |
| | | zoom: 15, |
| | | }; |
| | | }, |
| | | created() { |
| | | // 初始化数据 |
| | | this.form = this.info; |
| | | if (this.info.center) { |
| | | var center = JSON.parse(this.info.center); |
| | | this.point = { x: center[0], y: center[1] }; |
| | | this.zoom = this.info.zoom; |
| | | } |
| | | }, |
| | | |
| | | watch: { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | getRegion(e) { |
| | | // this.form.center = JSON.stringify([ |
| | | // e.map.getCenter().lng, |
| | | // e.map.getCenter().lat, |
| | | // ]); |
| | | // this.form.zoom = e.map.getZoom(); |
| | | this.form.center = JSON.stringify(e.center); |
| | | this.form.zoom = e.zoom; |
| | | this.form.region = JSON.stringify(e.path); |
| | | }, |
| | | }, |
| | | props: ["info", "closeDialog"], |
| | | }; |