春风项目四线(合箱线、总装线)
yyt
2024-01-24 87ebb286373e365b4bb427177b26cf00dda1e2f3
提交 | 用户 | 时间
fd2207 1 <template>
0899ce 2   <div class="dashboard-editor-container">
fd2207 3
9ebb88 4     <panel-group style="margin-bottom: 10px" @handleSetLineChartData="handleSetLineChartData" />
0899ce 5
9ebb88 6     <el-row style="background:#fff;padding:16px 16px 0; width: 1292px">
0899ce 7       <el-col :xs="24" :sm="12">
9ebb88 8         <pie-chart />
0899ce 9       </el-col>
8adcec 10
0899ce 11       <el-col :xs="24" :sm="12">
9ebb88 12         <line-chart :chart-data="lineChartData" />
8adcec 13
fd2207 14       </el-col>
15     </el-row>
16
17   </div>
18 </template>
19
20 <script>
0899ce 21 import PanelGroup from './dashboard/PanelGroup'
J 22 import LineChart from './dashboard/LineChart'
23 import PieChart from './dashboard/PieChart'
8adcec 24 import pieChart from "@/views/dashboard/PieChart.vue";
0899ce 25
J 26 const lineChartData = {
27   newVisitis: {
28     expectedData: [100, 120, 161, 134, 105, 160, 165],
29     actualData: [120, 82, 91, 154, 162, 140, 145]
30   },
31   messages: {
32     expectedData: [200, 192, 120, 144, 160, 130, 140],
33     actualData: [180, 160, 151, 106, 145, 150, 130]
34   },
35   purchases: {
36     expectedData: [80, 100, 121, 104, 105, 90, 100],
37     actualData: [120, 90, 100, 138, 142, 130, 130]
38   },
39   shoppings: {
40     expectedData: [130, 140, 141, 142, 145, 150, 160],
41     actualData: [120, 82, 91, 154, 162, 140, 130]
42   }
43 }
44
fd2207 45 export default {
0899ce 46   name: 'Index',
8adcec 47   computed: {
J 48     pieChart() {
49       return pieChart
50     }
51   },
0899ce 52   components: {
J 53     PanelGroup,
54     LineChart,
55     PieChart
56   },
fd2207 57   data() {
58     return {
0899ce 59       lineChartData: lineChartData.newVisitis
J 60     }
fd2207 61   },
62   methods: {
0899ce 63     handleSetLineChartData(type) {
J 64       this.lineChartData = lineChartData[type]
fd2207 65     }
66   }
67 }
0899ce 68 </script>
fd2207 69
0899ce 70 <style lang="scss" scoped>
J 71 .dashboard-editor-container {
9ebb88 72   padding: 20px;
0899ce 73   background-color: rgb(240, 242, 245);
J 74   position: relative;
75
76   .chart-wrapper {
77     background: #fff;
78     padding: 16px 16px 0;
79     margin-bottom: 32px;
80   }
81 }
82
83 @media (max-width:1024px) {
84   .chart-wrapper {
85     padding: 8px;
86   }
87 }
88 </style>