<template>
  <div class='childProcess' id='childProcess'>
    <el-dialog title="子流程触发配置" width="65%" :visible.sync="isDialogsVisible" :append-to-body="true"
          :close-on-click-modal="false" :close-on-press-escape="false" class="childDialog">
          <div>
            <sub-process-trigger
              v-if="isDialogsVisible"
                :treeData="treeData"
                :childProcessInfo="childProcessInfo"
                :processinfoid="processinfoid"
              />
          </div>
    </el-dialog>
  </div>
</template>

<script>
import subProcessTrigger from './components/subProcessTrigger.vue'
export default {
  name: 'childProcessDialog',
  components: {
    subProcessTrigger
  },
  data() {
    return {
      isDialogsVisible: false,
      childProcessInfo: {
        type: ''
      },
      processInfo: {},
      processinfoid: '',
      treeData: {
        id: ''
      }
    }
  },
  mounted() {
    this.childProcessInfo = JSON.parse(sessionStorage.getItem('childProcessInfo'))
    this.processInfo = JSON.parse(sessionStorage.getItem('processInfo')) || {}
    let version = !!this.processInfo.item ? (this.processInfo.item.version || undefined) : undefined
    console.log(this.childProcessInfo, this.processInfo, 'childProcessInfo')
    this.isDialogsVisible = true
    this.processinfoid = this.childProcessInfo.id
    this.treeData.id = this.childProcessInfo.curId
    this.treeData.version = version
  }
}
</script>