<template>
  <j-modal
    :title='title'
    fullscreen
    :width='width'
    :visible='visible'
    :maskClosable='false'
    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='地块信息基本表'>
        <div class='attrPane'>
          <!--      <qc-ssgqzysytdqk-space-form ref="realForm" @ok="submitCallback" :disabled="disa"  ></qc-ssgqzysytdqk-space-form>-->
          <qc-ssgqzysytdqk-form3 :mainId="this.xmid" ref="realForm" @ok="submitCallback" :disabled="disa" ></qc-ssgqzysytdqk-form3>
        </div>
        <div class='geomPane'>
          <basic-map :height=this.mapHeight ref='map' class='map' :res-config-url='resConfigUrl' :tools-config-url='toolsConfigUrl'
                     ></basic-map>
        </div>
      </a-tab-pane>
    </a-tabs>

  </j-modal>
</template>

<script>

  import QcSsgqzysytdqkForm from './QcSsgqzysytdqkForm';
  import qcSsgqzysytdqkForm3 from "@views/qcsb/modules/QcSsgqzysytdqkForm3";
  import BasicMap from "@comp/OneMap/BasicMap";
  export default {
    name: 'QcSsgqzysytdqkModal',
    components: {
      QcSsgqzysytdqkForm,
      qcSsgqzysytdqkForm3,
      BasicMap
    },
    data () {
      return {
        title:'',
        width:896,
        xmid:'',
        visible: false,
        disableSubmit: false,
        disa:false,
        mapHeight: window.document.documentElement.clientHeight - 230 + 'px',
        resConfigUrl: '/resManager.catalog/rescatalog/resListByUser',
        toolsConfigUrl: '/toolManage/toolmanage/toolListByUser'

      }
    },
    methods: {
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add();
        })
      },
      edit (record) {
        this.visible=true
        this.xmid=record.id
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
          this.disa=true
        this.$refs.realForm.submitForm();
          this.disa=false
      },
      submitCallback(){
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>
<style>
.attrPane {
  width: 33%;
  display: inline-block;
  height: 100%;
  overflow-y: auto;

}
.geomPane {
  margin-left: 3%;
  width: 63%;
  display: inline-block;
  height: 100%;
}
</style>