index.vue
2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<template>
<div class="dashboard-editor-container">
<panel-group :chart-data="panelData" />
<el-row style="background: #fff; padding: 16px 16px 0; margin-bottom: 32px">
<line-chart :last-data="lastData" />
</el-row>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-location-chart :location-data="locationData" />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-status-chart :status-data="statusData" />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-inventory-chart :prop-data="propData" />
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import { getCommonData } from "@/api/dashboard";
import { getShipmentsLast7Days } from "@/api/task/taskHeader";
import { getLocationProp } from "@/api/config/InventoryInfo/location";
import {
getInventoryStatus,
getInventoryProp,
} from "@/api/inventory/inventoryHeader/header";
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";
export default {
name: "Index",
components: {
PanelGroup,
LineChart,
PieLocationChart,
PieStatusChart,
PieInventoryChart,
},
data() {
return {
panelData: {},
locationData: [],
statusData: [],
propData: [],
lastData: {},
};
},
created() {
getCommonData().then((response) => {
this.panelData = response.data;
});
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.list;
});
}
};
</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;
}
}
@media (max-width: 1024px) {
.chart-wrapper {
padding: 8px;
}
}
</style>