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

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

11
       <line-chart id="chat6" :data="data6" title="临时车总缴费统计" axis-x="日期" axis-y="金额(元)" />
11
       <line-chart id="chat6" :data="data6" title="临时车总缴费统计" axis-x="日期" axis-y="金额(元)" />
12
     </div>
12
     </div>
13
     <div class="right">
13
     <div class="right">
14
-      <chart7/>
14
+      <bar-chart id="chat7" :data="data7" title="注册用户总数" axis-x="" axis-y="数量(个)" />
15
       <line-chart id="chat8" :data="data8" title="日活跃用户" axis-x="日期" axis-y="数量(个)" />
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
     </div>
17
     </div>
18
   </div>
18
   </div>
19
 </template>
19
 </template>
25
 import LineChart from "@/components/chart/lineChart.vue";
25
 import LineChart from "@/components/chart/lineChart.vue";
26
 import chart2 from "@/components/chart/chart2.vue";
26
 import chart2 from "@/components/chart/chart2.vue";
27
 import chart3 from "@/components/chart/chart3.vue";
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
 import chart9 from "@/components/chart/chart9.vue";
29
 import chart9 from "@/components/chart/chart9.vue";
30
 
30
 
31
 export default {
31
 export default {
42
     chart2,
42
     chart2,
43
     chart3,
43
     chart3,
44
     LineChart,
44
     LineChart,
45
-    chart7,
45
+    BarChart,
46
     chart9
46
     chart9
47
   },
47
   },
48
   computed: {
48
   computed: {
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
     data8 () {
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
         return ({
162
         return ({
145
           item: dayjs(createDate).format('M.D'),
163
           item: dayjs(createDate).format('M.D'),
146
           value: briskCount,
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
   methods: {
187
   methods: {
152
     ...mapActions("trunkIndex", ["getIndexCount"])
188
     ...mapActions("trunkIndex", ["getIndexCount"])