
<template>
  <div>
      <ReportEditor :headlineTree="headlineTree" />
  </div>
</template>

<script>
import ReportEditor from "@/components/ReportEditor"
export default {
  name:"CommonEditReport",
  components: {
    ReportEditor
  },

  data() {
    return {
      listLoading: true,
      reportId:this.$route.query.id,
      headlineTree:[]
    }

  },

  created(){
    this.getHeadlineTree();
  },
  methods: {

    getHeadlineTree(){
      if (this.reportId){
        this.listLoading = true
        this.$api.reportMain.getMainTree(this.reportId).then(res=>{
          if (res.code === 200){
              this.headlineTree = res.data;
          }else{
            setTimeout(() => {
              this.listLoading = false
          }, 200)
          }
        }).catch(() => {
            this.listLoading = false
          })
      }
    }
  }
}
</script>

<style lang="css">
.report {
  width: 100%;
}
</style>