detail.vue 867 Bytes
Newer Older
neogcg's avatar
neogcg committed
1
<template>
neogcg's avatar
neogcg committed
2 3
  <div>
    <type :type="type" :curInfo="curInfo" />
neogcg's avatar
neogcg committed
4 5 6
  </div>
</template>
<script>
neogcg's avatar
neogcg committed
7 8
import { treeBaseInfo } from "../../dashboard/api";
import Type from "../../dashboard/components/index.vue";
yanzhongrong's avatar
yanzhongrong committed
9

neogcg's avatar
neogcg committed
10
export default {
neogcg's avatar
neogcg committed
11
  components: { Type },
neogcg's avatar
neogcg committed
12 13
  data() {
    return {
neogcg's avatar
neogcg committed
14 15 16
      titleinfo: "",
      type: 1,
      curInfo: {},
neogcg's avatar
neogcg committed
17 18
    };
  },
yanzhongrong's avatar
yanzhongrong committed
19 20 21
  created() {
    this.getParams();
  },
neogcg's avatar
neogcg committed
22 23
  methods: {
    getParams() {
neogcg's avatar
neogcg committed
24 25 26 27
      this.type = this.$route.query.type;
      let params = {
        id: this.$route.query.id,
        type: this.type,
yanzhongrong's avatar
yanzhongrong committed
28
        name: this.$route.query.name
neogcg's avatar
neogcg committed
29 30
      };
      treeBaseInfo(params).then((res) => {
yanzhongrong's avatar
yanzhongrong committed
31 32
        let controlLimit = res.controlLimit || []
        if (controlLimit) {
neogcg's avatar
neogcg committed
33
          controlLimit.map(item => {
yanzhongrong's avatar
yanzhongrong committed
34
            res[`type${item.type}`] = item.sum
neogcg's avatar
neogcg committed
35 36
          })
        }
neogcg's avatar
neogcg committed
37
        this.curInfo = res;
neogcg's avatar
neogcg committed
38 39 40 41 42
      });
    },
  },
};
</script>