<template>
  <div>
    <div style="padding-bottom: 10px">
      <el-radio-group v-model="type">
        <el-radio-button label="graph">
          {{ $t('imatrixUIPublicModel.graphView') }}
        </el-radio-button>
        <el-radio-button label="list">
          {{ $t('imatrixUIPublicModel.listView') }}
        </el-radio-button>
      </el-radio-group>
    </div>

    <div v-if="type==='graph'" class="graphDiv">
      <workflow-history :id="workflowId" />
    </div>
    <workflow-history-list v-if="type==='list'" :workflow-id="workflowId" />
  </div>
</template>

<script>
export default {
  name: 'TacheSubprocessHistory',
  data() {
    return {
      type: 'graph',
      workflowId: null
    }
  },
  created() {
    const workflowId = this.$route.query.workflowId
    if (workflowId) {
      this.workflowId = parseInt(workflowId)
    }
  }
}
</script>
<style scoped>
.graphDiv {
  overflow:auto;
  height: 100%;
  height: calc(100vh - 20px);
}
</style>

