| <template>  | 
| <a-form style="margin-top: 8px" :form="form">  | 
|     <a-modal class="modelSize" title="配置坐标" destroyOnClose :visible="visible" @cancel="handleCancel">  | 
|         <!-- <div id="map"></div> -->  | 
|         <BaiduMap class="bm-view" :center="center" :zoom="zoom" @ready="handler" ak="9FrZ6v3P8xS290ygi40M5Ik3Fgwes4KY"></BaiduMap>  | 
|         <template slot="footer">  | 
|             <a-button key="cancel" @click="handleCancel">  | 
|                 取消  | 
|             </a-button>  | 
|             <a-button key="forward" type="primary" @click="handleOk">  | 
|                 完成  | 
|             </a-button>  | 
|         </template>  | 
|     </a-modal>  | 
| </a-form>  | 
| </template>  | 
|   | 
| <script lang="ts">  | 
|   | 
| import {  | 
|     Component,  | 
|     Prop,  | 
|     Vue,  | 
|     Emit,  | 
|     Model,  | 
|     Watch,  | 
| } from 'vue-property-decorator';  | 
| import { get, post } from "@/util/request";  | 
| import BaiduMap from 'vue-baidu-map/components/map/Map.vue'  | 
| @Component({  | 
|     components: {  | 
|         BaiduMap  | 
|     },  | 
| })  | 
| export default class UpdateTaskForm extends Vue {  | 
|     @Prop({  | 
|         type: Boolean,  | 
|         default: false,  | 
|     })  | 
|   | 
|   | 
|   | 
|     private visible!: boolean;  | 
|   | 
|     private defaultSelectedKeys:any;  | 
|     private defaultCheckedKeys:any;  | 
|   | 
|     private replaceFields:any =  {  | 
|         children: 'child',  | 
|         title: 'name',  | 
|     }  | 
|   | 
|     private center:any = null  | 
|   | 
|     private zoom:any = null  | 
|   | 
|     // 地图初始信息  | 
|     private mapInfo:any = {  | 
|         center: {lng: 116.404, lat: 39.915},  | 
|         zoom: 8  | 
|     }  | 
|   | 
|     // 地图初始化  | 
|     // private initMap(){  | 
|   | 
|     // }  | 
|     private handler (BMap:any, map:any) {  | 
|         setTimeout(()=>{  | 
|             this.mapInfo.center.lng = 116.404  | 
|             this.mapInfo.center.lat = 39.915  | 
|             this.mapInfo.zoom = 8  | 
|         },3000)  | 
|     }  | 
|   | 
|     private idList:any;  | 
|   | 
|     @Prop({  | 
|         type: Object,  | 
|         default() {  | 
|             return {};  | 
|         },  | 
|     })  | 
|     private record!: any;  | 
|   | 
|     private form: any = null;  | 
|   | 
|     private formVals: any = {  | 
|         target: '0',  | 
|         template: '0',  | 
|         type: '1',  | 
|         time: '',  | 
|         frequency: 'month',  | 
|     };  | 
|   | 
|     private currentStep: number = 0;  | 
|   | 
|     private formLayout = {  | 
|         labelCol: {  | 
|             span: 7,  | 
|         },  | 
|         wrapperCol: {  | 
|             span: 13,  | 
|         },  | 
|     };  | 
|   | 
|   | 
|     private onCheck(checkedKeys: any, info: any) {  | 
|       this.idList = checkedKeys  | 
|     }  | 
|   | 
|     private handleBackward(): void {  | 
|         this.currentStep--;  | 
|     }  | 
|   | 
|     private handleNext(): void {  | 
|         this.form.validateFields((err: any, fieldsValue: any) => {  | 
|             if (err) {  | 
|                 return;  | 
|             }  | 
|             this.formVals = { ...this.formVals, ...fieldsValue };  | 
|             this.currentStep++;  | 
|         });  | 
|     }  | 
|   | 
|     private handleCancel(): void {  | 
|         this.updateVisible(false);  | 
|         this.defaultSelectedKeys = []  | 
|         this.defaultCheckedKeys = []  | 
|     }  | 
|   | 
|     private handleOk(): void {  | 
|         post('manageRole/updateRoleMenu', {menuIds:this.idList,id:this.record.id}).then((res) => {  | 
|             this.updateVisible(false);  | 
|             this.onOk();  | 
|             this.defaultSelectedKeys = []  | 
|             this.defaultCheckedKeys = []  | 
|         });  | 
|     }  | 
|   | 
|     @Emit('ok')  | 
|     private onOk() {  | 
|   | 
|     }  | 
|   | 
|     private updateVisible(visible: boolean): void {  | 
|         this.$emit('update:visible', visible);  | 
|     }  | 
|   | 
|     private mounted(): void {  | 
|     }  | 
|   | 
|     @Watch('record', {  | 
|         immediate: true,  | 
|         deep: true,  | 
|     })  | 
|     private recordChange(value: any, oldValue: any): void {  | 
|         this.formVals = {  | 
|             ...value,  | 
|             ...this.formVals,  | 
|         };  | 
|         this.currentStep = 0;  | 
|     }  | 
|   | 
| }  | 
| </script>  | 
|   | 
| <style lang="less">  | 
|     .bm-view {  | 
|         width: 750px;  | 
|         height: 600px;  | 
|     }  | 
|     .modelSize{  | 
|         .ant-modal-content{  | 
|             width: 800px;  | 
|         }  | 
|         // .ant-form-item{  | 
|   | 
|         // }  | 
|     }  | 
| </style>  |