<template>
  <section class="AppWorkflowManage">
    <component :is="currentPage" v-bind="$props"/>
  </section>
</template>

<script>
import List from "./list";
import Add from "./add";
import WorkflowLogs from "./workflowLogs";

export default {
  name: "AppWorkflowManage",
  components: {WorkflowLogs, Add, List},
  label: "工作流管理",
  props: {
    instance: Function,
    dict: Object,
    permissions: Function
  },
  computed: {
    currentPage() {
      let {hash} = this.$route
      return hash == "#add" ? Add :
          hash == "#logs" ? WorkflowLogs : List
    }
  },
  created() {
    this.dict.load('yesOrNo')
  }
}
</script>

<style lang="scss" scoped>
.AppWorkflowManage {
  height: 100%;
}
</style>
