<template>
  <a-modal
    :title="modalTitle"
    width="100%"
    class="ant-modal2"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <iframe
      :src="url"
      id="mobsf"
      scrolling="no"
      frameborder="0"
      allowtransparency="true"
      width="100%"
      :height="clientHeight"></iframe>
    <template slot="footer">
      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">关闭</a-button>
    </template>
  </a-modal>
</template>

<script>

export default {
  name: 'ModelDesign',
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      url: '',
      modalTitle: '设计审批流程',
      visible: false,
      clientHeight: document.documentElement.clientHeight - 185
    }
  },
  props: {
  },
  methods: {
    base (id) {
      this.visible = true
      this.url = process.env.VUE_APP_API_BASE_URL + '/static/modeler.html?modelId=' + id
    },
    handleCancel (values) {
      this.visible = false
      this.confirmLoading = false
      this.url = ''
      if (this.BaseTool.Object.isNotBlank(values)) {
        this.$emit('ok', values)
      }
    }

  }
}
</script>

<style lang="less">
  .ant-modal2 {
    top: 5px !important;
  }
</style>
