Blame view

src/views/index.vue 2.41 KB
yuanshuhui authored
1
2
<template>
  <div class="dashboard-editor-container">
3
    <panel-group :chart-data="panelData" />
yuanshuhui authored
4
yuanshuhui authored
5
    <el-row style="background: #fff; padding: 16px 16px 0; margin-bottom: 32px">
6
      <line-chart :last-data="lastData" />
yuanshuhui authored
7
8
9
10
11
    </el-row>

    <el-row :gutter="32">
      <el-col :xs="24" :sm="24" :lg="8">
        <div class="chart-wrapper">
12
          <pie-location-chart :location-data="locationData" />
yuanshuhui authored
13
14
15
16
        </div>
      </el-col>
      <el-col :xs="24" :sm="24" :lg="8">
        <div class="chart-wrapper">
17
          <pie-status-chart :status-data="statusData" />
yuanshuhui authored
18
19
20
21
        </div>
      </el-col>
      <el-col :xs="24" :sm="24" :lg="8">
        <div class="chart-wrapper">
22
          <pie-inventory-chart :prop-data="propData" />
yuanshuhui authored
23
24
25
26
27
28
29
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
yuanshuhui authored
30
import { getCommonData } from "@/api/dashboard";
31
32
33
34
35
36
import { getShipmentsLast7Days } from "@/api/task/taskHeader";
import { getLocationProp } from "@/api/config/InventoryInfo/location";
import {
  getInventoryStatus,
  getInventoryProp,
} from "@/api/inventory/inventoryHeader/header";
yuanshuhui authored
37
38
39
40
41
import PanelGroup from "./dashboard/PanelGroup";
import LineChart from "./dashboard/LineChart";
import PieLocationChart from "./dashboard/PieLocationChart";
import PieStatusChart from "./dashboard/PieStatusChart";
import PieInventoryChart from "./dashboard/PieInventoryChart";
yuanshuhui authored
42
43

export default {
yuanshuhui authored
44
  name: "Index",
yuanshuhui authored
45
46
47
  components: {
    PanelGroup,
    LineChart,
yuanshuhui authored
48
49
    PieLocationChart,
    PieStatusChart,
yuanshuhui authored
50
    PieInventoryChart,
yuanshuhui authored
51
52
53
  },
  data() {
    return {
yuanshuhui authored
54
      panelData: {},
55
56
57
58
      locationData: [],
      statusData: [],
      propData: [],
      lastData: {},
yuanshuhui authored
59
    };
yuanshuhui authored
60
  },
yuanshuhui authored
61
  created() {
yuanshuhui authored
62
63
64
    getCommonData().then((response) => {
      this.panelData = response.data;
    });
65
66
67
68
69
70
71
72
73
74
75
76
    getShipmentsLast7Days().then((response) => {
      this.lastData = response.data;
    });
    getLocationProp().then((response) => {
      this.locationData = response.data;
    });
    getInventoryStatus().then((response) => {
      this.statusData = response.data;
    });
    getInventoryProp().then((response) => {
      this.propData = response.data;
    });
yuanshuhui authored
77
78
  },
};
yuanshuhui authored
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}
yuanshuhui authored
94
@media (max-width: 1024px) {
yuanshuhui authored
95
96
97
98
99
  .chart-wrapper {
    padding: 8px;
  }
}
</style>