Browse Source

feats: 2 reprots

张延森 6 years ago
parent
commit
7673aa589c

+ 7
- 4
VUECODE/smart-property-manage/src/components/chart/barChart.vue View File

@@ -39,13 +39,14 @@ export default {
39 39
           container: _self.id,
40 40
           forceFit: true,
41 41
           height: 282,
42
-        padding: [80, 20, 30, 40]
42
+          padding: [80, 20, 30, 40]
43 43
         });
44 44
       }
45 45
 
46 46
       const chart = this.chart;
47 47
       chart.source(_self.data);
48 48
 
49
+      chart.scale('value', {});
49 50
 
50 51
       chart.axis("value", {
51 52
         line: {
@@ -75,9 +76,9 @@ export default {
75 76
           }
76 77
         }
77 78
       });
78
-      chart.tooltip({
79
-        crosshairs: true
80
-      });
79
+      // chart.tooltip({
80
+      //   crosshairs: true
81
+      // });
81 82
 
82 83
       chart.guide().html({
83 84
         position: ["5%", "-35%"],
@@ -92,6 +93,8 @@ export default {
92 93
         html: `<div class="line-chat"><p class="title">${_self.axisX}</p></div>`
93 94
       });
94 95
 
96
+      chart.interval().position('item*value').color('item');
97
+
95 98
       chart.render();
96 99
     }
97 100
   }

+ 42
- 6
VUECODE/smart-property-manage/src/views/index/index.vue View File

@@ -11,9 +11,9 @@
11 11
       <line-chart id="chat6" :data="data6" title="临时车总缴费统计" axis-x="日期" axis-y="金额(元)" />
12 12
     </div>
13 13
     <div class="right">
14
-      <chart7/>
14
+      <bar-chart id="chat7" :data="data7" title="注册用户总数" axis-x="" axis-y="数量(个)" />
15 15
       <line-chart id="chat8" :data="data8" title="日活跃用户" axis-x="日期" axis-y="数量(个)" />
16
-      <chart9/>
16
+      <bar-chart id="chat9" :data="data9" title="已发布内容统计" axis-x="" axis-y="数量(个)" />
17 17
     </div>
18 18
   </div>
19 19
 </template>
@@ -25,7 +25,7 @@ import chart1 from "@/components/chart/chart1.vue";
25 25
 import LineChart from "@/components/chart/lineChart.vue";
26 26
 import chart2 from "@/components/chart/chart2.vue";
27 27
 import chart3 from "@/components/chart/chart3.vue";
28
-import chart7 from "@/components/chart/chart7.vue";
28
+import BarChart from "@/components/chart/barChart.vue";
29 29
 import chart9 from "@/components/chart/chart9.vue";
30 30
 
31 31
 export default {
@@ -42,7 +42,7 @@ export default {
42 42
     chart2,
43 43
     chart3,
44 44
     LineChart,
45
-    chart7,
45
+    BarChart,
46 46
     chart9
47 47
   },
48 48
   computed: {
@@ -137,16 +137,52 @@ export default {
137 137
         })
138 138
       })
139 139
     },
140
+    data7 () {
141
+      let { houseOwnerCount = 0, houseRelationCount = 0, houseTenantCount = 0 } = (this.IndexInfo || {}).registerUserMap || {}
142
+
143
+      return [
144
+        {
145
+          item: '户主',
146
+          value: houseOwnerCount,
147
+        },
148
+        {
149
+          item: '家属',
150
+          value: houseRelationCount,
151
+        },
152
+        {
153
+          item: '租客',
154
+          value: houseTenantCount,
155
+        },
156
+      ]
157
+    },
140 158
     data8 () {
141
-      let billList = (this.IndexInfo || {}).taBriskUserList || []
159
+      let usrList = (this.IndexInfo || {}).taBriskUserList || []
142 160
 
143
-      return billList.map(({ createDate, briskCount }) => {
161
+      return usrList.map(({ createDate, briskCount }) => {
144 162
         return ({
145 163
           item: dayjs(createDate).format('M.D'),
146 164
           value: briskCount,
147 165
         })
148 166
       })
149 167
     },
168
+    data9 () {
169
+      let { activityCount = 0, announcementCount = 0, topicCount = 0 } = (this.IndexInfo || {}).publishContentMap || {}
170
+
171
+      return [
172
+        {
173
+          item: '活动',
174
+          value: activityCount,
175
+        },
176
+        {
177
+          item: '公告',
178
+          value: announcementCount,
179
+        },
180
+        {
181
+          item: '话题',
182
+          value: topicCount,
183
+        },
184
+      ]
185
+    },
150 186
   },
151 187
   methods: {
152 188
     ...mapActions("trunkIndex", ["getIndexCount"])