Browse Source

样式调整

duwendi 1 year ago
parent
commit
06d2c83ff5

+ 19 - 37
src/components/barChart.vue

@@ -4,32 +4,13 @@
4 4
 
5 5
 <script>
6 6
 import * as echarts from 'echarts'
7
-const colors = [
8
-  new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
9
-    offset: 0,
10
-    color: '#1EBFFF'
11
-    },
12
-    {
13
-    offset: 1,
14
-    color: '#975BFF'
15
-    }
16
-  ]),
17
-  new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
18
-    offset: 0,
19
-    color: '#FF6E2F'
20
-    },
21
-    {
22
-    offset: 1,
23
-    color: '#FFCA02'
24
-    }
25
-  ])
26
-]
7
+const colors = [ '#5470c6','#91cc75' ]
27 8
 export default {
28 9
   props: {
29 10
     id: {type: String, required: true},
30 11
     dataset: {type: Array, required: true},
31 12
     encode: {type: Array, required: true},
32
-    barWidth:{type: Number, default: 15},
13
+    barWidth:{type: Number, default: 30},
33 14
     yAxisName: {type: String},
34 15
     xlabelFormat: {type: Function},
35 16
     showLegend: {type: Boolean, default: true},
@@ -53,14 +34,11 @@ export default {
53 34
           left: 70,
54 35
           right: 20
55 36
         },
56
-        legend: {right: 20, top: 0, icon: this.legendIcon, textStyle: {color: '#ffffff', fontSize: this.isBig ? 18 : 12}},
37
+        legend: {right: 20, top: 0, icon: this.legendIcon, textStyle: {color: '#333', fontSize: this.isBig ? 18 : 12}},
57 38
         tooltip: {
58 39
           trigger: 'axis',
59 40
           confine: true,
60 41
           backgroundColor: 't',
61
-          axisPointer: {
62
-            lineStyle: { color: "#0081AC", type: "dashed" },
63
-          },
64 42
           show: this.tooltip,
65 43
           formatter: this.tooltip,
66 44
           position: function(point, params, dom,rect,size) {
@@ -73,40 +51,35 @@ export default {
73 51
           type: 'category',
74 52
           axisLabel: {
75 53
             interval: 0,
76
-            color: '#59BEED',
54
+            color: '#333',
77 55
             fontSize: this.labelSize
78 56
           },
79 57
            axisLine: {
80
-            lineStyle: {
81
-              color: '#1977C6'
82
-            }
58
+            show: false,
83 59
           },
84 60
           splitLine: {
85 61
             lineStyle: {
86
-              color: '#082E81',
87
-              type: 'dashed'
88 62
             }
89 63
           },
90 64
           axisTick: false
91 65
         },
92 66
         yAxis: {
93 67
           axisLabel: {
94
-            color: '#59BEED',
68
+            color: '#333',
95 69
             fontSize: this.labelSize
96 70
           },
97 71
           nameTextStyle: {
98
-            color: '#59BEED',
72
+            color: '#333',
99 73
             fontSize: this.labelSize
100 74
           },
101 75
           axisLine: {
76
+            show: false,
102 77
             lineStyle: {
103
-              color: '#1977C6'
78
+              // color: '#1977C6'
104 79
             }
105 80
           },
106 81
           splitLine: {
107 82
             lineStyle: {
108
-              color: '#082E81',
109
-              type: 'dashed'
110 83
             }
111 84
           },
112 85
           axisTick: false,
@@ -150,7 +123,16 @@ export default {
150 123
         itemStyle: {
151 124
           barBorderRadius: this.legendIcon === 'circle' ? [5, 5, 0, 0] : 0,
152 125
           color: isNaN(this.colorIdx) ? this.colorArr[idx] : colors[this.colorIdx]
153
-        }
126
+        },
127
+        label: { //柱体上显示数值
128
+          show: true,//开启显示
129
+          position: 'top',//在上方显示
130
+          textStyle: {//数值样式
131
+            fontSize: '7px',
132
+            color: '#333'
133
+          },
134
+          // formatter: '{c}',
135
+        },
154 136
       })
155 137
     })
156 138
     option.dataset.source = this.dataset

+ 3 - 3
src/components/pieChart.vue

@@ -3,7 +3,7 @@
3 3
 </template>
4 4
 
5 5
 <script>
6
-const colors = ["#db6749", "#f8cd55", "#3c97d6", "#989bf8"];
6
+const colors = ["#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc"];
7 7
 import * as echarts from 'echarts'
8 8
 export default {
9 9
   props: {
@@ -42,7 +42,7 @@ export default {
42 42
           icon: "circle",
43 43
           show: this.legend,
44 44
           textStyle: {
45
-            color: "#8BDFFD",
45
+            color: "#333",
46 46
             fontSize: this.isBig ? 18 : 12,
47 47
           },
48 48
           ...this.legend,
@@ -87,7 +87,7 @@ export default {
87 87
                   padding: [3, 3, 0, -12],
88 88
                 },
89 89
                 name: {
90
-                  color: "#8BDFFD",
90
+                  color: "#333",
91 91
                   align: "center",
92 92
                   lineHeight: this.labelSize,
93 93
                   padding: this.isBig ? [-20, 10, -40, 10] : [-20, 10, -30, 10],

+ 8 - 0
src/pages/index/components/lead_system.vue

@@ -30,7 +30,9 @@
30 30
 <!--            </el-col>-->
31 31
 <!--          </el-row>-->
32 32
 <!--        </el-form>-->
33
+        <br>
33 34
         <h4>停车场数量和分布</h4>
35
+        <br>
34 36
         <el-table border :row-class-name="rowClassName" :data="tableData1" v-loading="loading1">
35 37
           <el-table-column v-for="(item, index) in columns1" :key="index" :label="item.label" :prop="item.key">
36 38
           </el-table-column>
@@ -40,17 +42,23 @@
40 42
 <!--                         :current-page.sync="pageNum1" :page-size.sync="pageSize1">-->
41 43
 <!--          </el-pagination>-->
42 44
 <!--        </div>-->
45
+        <br>
43 46
         <h4>停车位利用率</h4>
47
+        <br>
44 48
         <el-table border :row-class-name="rowClassName" :data="tableData2" height="300px" v-loading="loading2">
45 49
           <el-table-column v-for="(item, index) in columns2" :key="index" :label="item.label" :prop="item.key">
46 50
           </el-table-column>
47 51
         </el-table>
52
+        <br>
48 53
         <h4>停车时长分布</h4>
54
+        <br>
49 55
         <el-table border :row-class-name="rowClassName" :data="tableData3" height="300px" v-loading="loading3">
50 56
           <el-table-column v-for="(item, index) in columns3" :key="index" :label="item.label" :prop="item.key">
51 57
           </el-table-column>
52 58
         </el-table>
59
+        <br>
53 60
         <h4>停车场运营效率</h4>
61
+        <br>
54 62
         <el-table border :row-class-name="rowClassName" :data="tableData4" height="300px" v-loading="loading4">
55 63
           <el-table-column v-for="(item, index) in columns4" :key="index" :label="item.label" :prop="item.key">
56 64
           </el-table-column>

+ 13 - 16
src/pages/index/components/parking_index.vue

@@ -1,33 +1,32 @@
1 1
 <template xmlns:piechart="http://www.w3.org/1999/html">
2 2
   <div class="body-wrapper">
3 3
     <div style="display: flex; justify-content: space-between;">
4
-      <div class="body-box" style="width: 43%;height:400px;border-radius: 5px;background-color: #f6f5f5;padding: 20px;color: #525252;">
5
-        <h2>概览</h2>
6
-        <div class="box-item" style="border: 2px dotted #a1a1a1;border-radius: 5px;padding: 20px 20px 40px 20px;margin-top: 15px">
4
+      <div class="body-box" style="width: 43%;height:300px;border-radius: 5px;background-color: #f6f5f5;padding: 20px;color: #525252;">
5
+        <h3>概览</h3>
6
+        <div class="box-item" style="border: 2px dotted #a1a1a1;border-radius: 5px;padding: 10px 20px;margin-top: 15px; display: flex;justify-content: space-between;">
7 7
           <h4 style="float: left">停车场总数</h4>
8 8
           <span style="float: right;color: red">{{viewData.totalPark}}</span>
9 9
         </div>
10
-        <div class="box-item" style="border: 2px dotted #757575;border-radius: 5px;padding: 20px 20px 40px 20px;margin-top: 15px">
10
+        <div class="box-item" style="border: 2px dotted #757575;border-radius: 5px;padding: 10px 20px;margin-top: 15px;display: flex;justify-content: space-between;">
11 11
           <h4 style="float: left">今日停车记录数</h4>
12 12
           <span style="float: right;color: red">{{viewData.totalRecord}}</span>
13 13
         </div>
14
-        <div class="box-item" style="border: 2px dotted #757575;border-radius: 5px;padding: 20px 20px 40px 20px;margin-top: 15px">
14
+        <div class="box-item" style="border: 2px dotted #757575;border-radius: 5px;padding: 10px 20px;margin-top: 15px;display: flex;justify-content: space-between;">
15 15
           <h4 style="float: left">今日实收总额</h4>
16 16
           <span style="float: right;color: red">{{viewData.totalFee || 0}}</span>
17 17
         </div>
18
-        <div class="box-item" style="border: 2px dotted #757575;border-radius: 5px;padding: 20px 20px 40px 20px;margin-top: 15px">
18
+        <div class="box-item" style="border: 2px dotted #757575;border-radius: 5px;padding: 10px 20px;margin-top: 15px;display: flex;justify-content: space-between;">
19 19
           <h4 style="float: left">日均时长泊位利用率</h4>
20 20
           <span style="float: right;color: red">{{viewData.dayBerthRate}}%</span>
21 21
         </div>
22 22
       </div>
23
-      <div class="body-box" style="width: 48%;height:400px;border-radius: 5px;background-color: #f6f5f5;padding: 20px;color: #525252;">
24
-        <h1>停车收入概览</h1>
23
+      <div class="body-box" style="width: 48%;height:300px;border-radius: 5px;background-color: #f6f5f5;padding: 20px;color: #525252;">
24
+        <h3>停车收入概览</h3>
25 25
         <piechart
26 26
           class="model-pie-body"
27 27
           id="chart1"
28 28
           :roseType="false"
29 29
           :radiusArr="['30%', '70%']"
30
-          :colorArr="modelPieColor"
31 30
           :labelFormat="['{name|{b}}', '{sub|{d}%}', '{hr|}']"
32 31
           :dataset="modelData"
33 32
           :encode="{ itemName: 'name', value: 'value' }"
@@ -35,18 +34,16 @@
35 34
       </div>
36 35
     </div>
37 36
     <div style="display: flex; justify-content: space-between;">
38
-      <div class="body-box" style="width:98%;height:400px;border-radius: 5px;background-color: #f6f5f5;padding: 20px;margin-top: 20px;color: #525252;">
37
+      <div class="body-box" style="width:98%;height:300px;border-radius: 5px;background-color: #f6f5f5;padding: 20px;margin-top: 20px;color: #525252;">
39 38
         <h1>停车收入概览</h1>
40 39
         <barchart
41 40
           class="side-chart"
42 41
           :autoStop="false"
43
-          :colorArr="['#ffd201', '#00eacb', '#01b4ff', '#5d78ff']"
44 42
           legendIcon="react"
45
-          :bottom="30"
46
-          :xlabelFormat="xLabelFormat"
47
-          :top="60"
43
+          :bottom="50"
44
+          :top="40"
48 45
           yAxisName="(辆)"
49
-          :tooltip="tooltipFormat"
46
+          :tooltip="false"
50 47
           :dataset="bardata"
51 48
           :encode="[
52 49
             {x: 'mouth', y: 'hs', seriesName: '停车数量'}]"
@@ -75,7 +72,6 @@ export default {
75 72
         totalFee:0,
76 73
         dayBerthRate:0
77 74
       },
78
-      modelPieColor: ["#4382f6", "#81f878", "#f2ff90", "#FF9800", "#9C27B0"],
79 75
       modelData: [],
80 76
       bardata: [],
81 77
     }
@@ -124,6 +120,7 @@ export default {
124 120
 </script>
125 121
 <style  lang="scss" scoped>
126 122
 .body-wrapper {
123
+  background: transparent;
127 124
   .form-wrapper {
128 125
     .el-form-item {
129 126
       margin-bottom: 0px;