<template>
  <a-modal
    :title="title"
    :width="1300"
    :visible="visible"
    @cancel="onCancel"
    :confirmLoading="confirmLoading"
    :footer="null"
    switchFullscreen
  >
    <div style="height:100%;">
      <iframe
        id="iframe"
        :src="modelerUrl"
        frameborder="0"
        width="100%"
        height="650px"
        scrolling="auto"
      />

    </div>
  </a-modal>
</template>

<script>
  import { getToken } from '@/utils/auth'
  import { ACCESS_TOKEN, TENANT_ID } from '@/store/mutation-types'
  import Vue from 'vue'

  export default {
    name: 'ActivitiModel',
    components: {},
    data() {
      return {
        id: '',
        modelerLoading: true,
        title: '流程设计',
        visible: false,
        models: {},
        confirmLoading: false,
        modelerUrl: ''

      }
    },
    computed: {
      token() {
        return this.$store.getters.token
      },
      apiUrl() {
        let apiBaseUrl = process.env.VUE_APP_API_BASE_URL
        return apiBaseUrl // 后台部署的api服务
      }
    },
    created() {
    },
    mounted() {
      // 传递值
      window.getMyVue = this
      window.getMyVue.tenantId = Vue.ls.get(TENANT_ID)
    },
    methods: {
      onCancel() {
        this.visible = false
         this.$emit('ok')
      },
      openModel(row) {
        console.log('window.getMyVue.tenantId ', window.getMyVue)
        this.visible = true
        this.modelerId = row.id
        this.models = row
        this.modelerUrl = `/static/modeler.html?modelId=` + row.id
      }

    }
}
// 关闭流程设计弹窗
top.modelClose = function () {
    window.getMyVue.visible = false
    // this.$emit('ok')
 }
</script>

<style>

  .ant-modal-body{
    padding:20;
  }
</style>
