<template>
  <div>
    <type :type="type" :curInfo="curInfo" />
  </div>
</template>
<script>
import { treeBaseInfo } from "../../dashboard/api";
import Type from "../../dashboard/components/index.vue";

export default {
  components: { Type },
  data() {
    return {
      titleinfo: "",
      type: 1,
      curInfo: {},
    };
  },
  created() {
    this.getParams();
  },
  methods: {
    getParams() {
      this.type = this.$route.query.type;
      let params = {
        id: this.$route.query.id,
        type: this.type,
        name: this.$route.query.name
      };
      treeBaseInfo(params).then((res) => {
        let controlLimit = res.controlLimit || []
        if (controlLimit) {
          controlLimit.map(item => {
            res[`type${item.type}`] = item.sum
          })
        }
        this.curInfo = res;
      });
    },
  },
};
</script>
