index.vue 2.96 KB
Newer Older
Pan's avatar
Pan committed
1
<template>
Pan's avatar
Pan committed
2
  <div class="dashboard-container">
yanzhongrong's avatar
yanzhongrong committed
3 4
    <!-- 首页 -->
    <div>
yanzhongrong's avatar
yanzhongrong committed
5 6 7 8
      <orgTree style="float:left" @selectItem="selectItem" />
      <div class="ml300">
        <type :type="type" :curInfo="curInfo" />
      </div>
yanzhongrong's avatar
yanzhongrong committed
9
    </div>
Pan's avatar
Pan committed
10
  </div>
Pan's avatar
Pan committed
11 12 13
</template>

<script>
yanzhongrong's avatar
yanzhongrong committed
14 15 16
import { treeBaseInfo } from './api'
import orgTree from '@/components/orgTree.vue'
import Type from './components/index.vue'
Pan's avatar
Pan committed
17
export default {
18
  name: 'Dashboard',
yanzhongrong's avatar
yanzhongrong committed
19 20
  data() {
    return {
yanzhongrong's avatar
yanzhongrong committed
21 22
      type: 1,
      curInfo: {}
yanzhongrong's avatar
yanzhongrong committed
23
    }
yanzhongrong's avatar
yanzhongrong committed
24
  },
yanzhongrong's avatar
yanzhongrong committed
25 26 27 28
  components: {
    orgTree,
    Type
  },
Pan's avatar
Pan committed
29
  computed: {
yanzhongrong's avatar
yanzhongrong committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
  },
  mounted() {
    this.getDetailNode(4)
  },
  methods: {
    selectItem(data) {
      this.type = data.type
      this.getDetailNode(data.id)
    }, 
    getDetailNode(data) {
      let param = {
        type: this.type,
        id: data
      }
      treeBaseInfo(param).then(res => {
yanzhongrong's avatar
yanzhongrong committed
45 46 47 48 49 50
        let controlLimit = res.controlLimit || []
        if(controlLimit) {
          controlLimit.map(item => {
            res[`type${item.type}`]= item.sum
          })
        }
yanzhongrong's avatar
yanzhongrong committed
51 52 53
        this.curInfo = res
      })
    },
Pan's avatar
Pan committed
54 55
  }
}
neogcg's avatar
neogcg committed
56

Pan's avatar
Pan committed
57
</script>
Pan's avatar
Pan committed
58

花裤衩's avatar
花裤衩 committed
59
<style lang="scss" scoped>
yanzhongrong's avatar
yanzhongrong committed
60 61 62 63 64 65
.header_title {
  font-size: 23px;
  font-family: Source Han Sans CN;
  font-weight: 500;
  line-height: 40px;
  text-align: center;
yanzhongrong's avatar
yanzhongrong committed
66
  color: #0058ff;
yanzhongrong's avatar
yanzhongrong committed
67 68 69 70
  letter-spacing: 10px;
  opacity: 1;
  margin-bottom: 20px;
}
yanzhongrong's avatar
yanzhongrong committed
71
::v-deep.el-card {
yanzhongrong's avatar
yanzhongrong committed
72
  border: 1px solid #e3e3e3;
yanzhongrong's avatar
yanzhongrong committed
73
  border-radius: 8px;
neogcg's avatar
neogcg committed
74
  min-height: 243px;
yanzhongrong's avatar
yanzhongrong committed
75 76 77 78 79 80 81 82
  .el-card__header {
    font-size: 18px;
    color: #333333;
    font-weight: 500;
    text-align: center;
    background: rgba(226, 235, 255, 0.39);
    opacity: 1;
  }
neogcg's avatar
neogcg committed
83 84
  .el-card__body {
    padding: 0px;
yanzhongrong's avatar
yanzhongrong committed
85
  }
neogcg's avatar
neogcg committed
86
}
yanzhongrong's avatar
yanzhongrong committed
87
.posa {
neogcg's avatar
neogcg committed
88 89
  position: relative;
}
yanzhongrong's avatar
yanzhongrong committed
90
.savebtn {
neogcg's avatar
neogcg committed
91
  position: absolute;
yanzhongrong's avatar
yanzhongrong committed
92
  right: 2%;
neogcg's avatar
neogcg committed
93
}
yanzhongrong's avatar
yanzhongrong committed
94 95 96 97 98
// .el-col {
//   margin-bottom: 20px;
// }
.text {
  // display: flex;
neogcg's avatar
neogcg committed
99
  padding: 10px 20px 10px 20px;
yanzhongrong's avatar
yanzhongrong committed
100
  border-bottom: 1px solid #e3e3e3;
yanzhongrong's avatar
yanzhongrong committed
101 102
  &:last-child {
    border-bottom: none;
neogcg's avatar
neogcg committed
103
  }
yanzhongrong's avatar
yanzhongrong committed
104 105 106 107
  .item_name,
  .item_data,
  .value_handle {
    height: 16px;
neogcg's avatar
neogcg committed
108
    line-height: 16px;
yanzhongrong's avatar
yanzhongrong committed
109
    margin-top: 12px;
neogcg's avatar
neogcg committed
110
    margin-bottom: 12px;
yanzhongrong's avatar
yanzhongrong committed
111 112 113
  }
  .item_name {
    width: 262px;
neogcg's avatar
neogcg committed
114 115
    height: 16px;
    line-height: 16px;
yanzhongrong's avatar
yanzhongrong committed
116
    color: #7e7e7e;
neogcg's avatar
neogcg committed
117 118 119 120
    margin-top: 12px;
    margin-bottom: 12px;
  }

yanzhongrong's avatar
yanzhongrong committed
121
  .item_data {
Pan's avatar
Pan committed
122
  }
yanzhongrong's avatar
yanzhongrong committed
123
  .value_handle {
yanzhongrong's avatar
yanzhongrong committed
124
    color: red;
yanzhongrong's avatar
yanzhongrong committed
125
    margin-right: 10px;
neogcg's avatar
neogcg committed
126
  }
yanzhongrong's avatar
yanzhongrong committed
127 128
  .alarmbtn {
    margin-top: 6px;
neogcg's avatar
neogcg committed
129
    margin-bottom: 6px;
Pan's avatar
Pan committed
130
  }
neogcg's avatar
neogcg committed
131 132
  .el-card:last-child .text {
    border-bottom: none !important;
yanzhongrong's avatar
yanzhongrong committed
133
  }
neogcg's avatar
neogcg committed
134 135 136 137
}
.text2 {
  // display: flex;
  padding: 10px 20px 10px 20px;
yanzhongrong's avatar
yanzhongrong committed
138 139 140 141 142
  border-bottom: 1px solid #e3e3e3;
  .item_name,
  .item_data,
  .value_handle {
    height: 16px;
neogcg's avatar
neogcg committed
143
    line-height: 16px;
yanzhongrong's avatar
yanzhongrong committed
144
    margin-top: 12px;
neogcg's avatar
neogcg committed
145 146 147 148 149 150
    margin-bottom: 12px;
  }
  .item_name {
    width: 262px;
    height: 16px;
    line-height: 16px;
yanzhongrong's avatar
yanzhongrong committed
151
    color: #7e7e7e;
neogcg's avatar
neogcg committed
152 153 154 155
    margin-top: 12px;
    margin-bottom: 12px;
  }

yanzhongrong's avatar
yanzhongrong committed
156
  .item_data {
neogcg's avatar
neogcg committed
157 158
  }
  .value_handle {
yanzhongrong's avatar
yanzhongrong committed
159
    color: red;
neogcg's avatar
neogcg committed
160
    margin-right: 10px;
neogcg's avatar
neogcg committed
161
    min-width: 52px;
neogcg's avatar
neogcg committed
162
  }
yanzhongrong's avatar
yanzhongrong committed
163 164
  .alarmbtn {
    margin-top: 6px;
neogcg's avatar
neogcg committed
165 166 167 168
    margin-bottom: 6px;
  }
  .el-card:last-child .text {
    border-bottom: none !important;
yanzhongrong's avatar
yanzhongrong committed
169
  }
neogcg's avatar
neogcg committed
170
}
Pan's avatar
Pan committed
171
</style>