CommonEditReport.vue 923 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <div>
  3. <ReportEditor :headlineTree="headlineTree" />
  4. </div>
  5. </template>
  6. <script>
  7. import ReportEditor from "@/components/ReportEditor"
  8. export default {
  9. name:"CommonEditReport",
  10. components: {
  11. ReportEditor
  12. },
  13. data() {
  14. return {
  15. listLoading: true,
  16. reportId:this.$route.query.id,
  17. headlineTree:[]
  18. }
  19. },
  20. created(){
  21. this.getHeadlineTree();
  22. },
  23. methods: {
  24. getHeadlineTree(){
  25. if (this.reportId){
  26. this.listLoading = true
  27. this.$api.reportMain.getMainTree(this.reportId).then(res=>{
  28. if (res.code === 200){
  29. this.headlineTree = res.data;
  30. }else{
  31. setTimeout(() => {
  32. this.listLoading = false
  33. }, 200)
  34. }
  35. }).catch(() => {
  36. this.listLoading = false
  37. })
  38. }
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang="css">
  44. .report {
  45. width: 100%;
  46. }
  47. </style>