| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 | <template>  <j-modal    :title="title"    :width="width"    :visible="visible"    switchFullscreen    @ok="handleOk"    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"    @cancel="handleCancel"    cancelText="关闭">    <a-tabs default-active-key="attrs" @change="tabsChange">      <a-tab-pane key="attrs" tab="属性信息">        <rm-gxqktjb-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rm-gxqktjb-form>      </a-tab-pane>      <a-tab-pane key="map" tab="位置信息">        <basic-map ref="locMap" layersUrl='/resManager.catalog/rescatalog/resList' :model="{...model,layerName:'泵站工程,岸线功能区'}"></basic-map>      </a-tab-pane>    </a-tabs>  </j-modal></template><script>  import RmGxqktjbForm from './RmGxqktjbForm'  import BasicMap from "../../../../../../components/BasicMap/BasicMap";  export default {    name: 'RmGxqktjbModal',    components: {      BasicMap,      RmGxqktjbForm    },    data () {      return {        title:'',        width:896,        visible: false,        disableSubmit: false      }    },    methods: {      add () {        this.visible=true        this.$nextTick(()=>{          this.$refs.realForm.add();        })      },      edit (record) {        this.lng = record.jd;        this.lat = record.wd;        this.model = record;        this.visible = true        this.$nextTick(() => {          this.$refs.realForm.edit(record);        })      },      close () {        this.$emit('close');        this.visible = false;      },      handleOk () {        this.$refs.realForm.submitForm();      },      submitCallback(){        this.$emit('ok');        this.visible = false;      },      handleCancel () {        this.close()      },      tabsChange(key) {        let that = this;        if (key == "map") {          this.$nextTick(() => {            this.$refs.locMap.locateByCoords({...this.model});          })        }      },      locateByCoords() {        let loc_x = this.lng;        let loc_y = this.lat;        this.$refs.locMap.locateByCoords(loc_x, loc_y);      }    },    beforeMount() {      if (!this.height) {        let calcHeight = window.document.documentElement.clientHeight - 225;        let m_height = calcHeight.toString() + 'px';        this.mapHeight = m_height;      }    }  }</script>
 |