Browse Source

Merge branch '2.0.0' of http://git.ycjcjy.com/fuxingfan/smartCommunity into 2.0.0

魏熙美 6 years ago
parent
commit
3f7ef365cf

+ 1
- 1
VUECODE/smart-property-manage/config/dev.env.js View File

4
 
4
 
5
 module.exports = merge(prodEnv, {
5
 module.exports = merge(prodEnv, {
6
   NODE_ENV: '"development"',
6
   NODE_ENV: '"development"',
7
-  BASE_API: '"http://localhost:8086/property-api"',
7
+  BASE_API: '"http://106.14.20.193:8086/property-api"',
8
 })
8
 })

+ 1
- 1
VUECODE/smart-property-manage/config/index.js View File

29
     // Use Eslint Loader?
29
     // Use Eslint Loader?
30
     // If true, your code will be linted during bundling and
30
     // If true, your code will be linted during bundling and
31
     // linting errors and warnings will be shown in the console.
31
     // linting errors and warnings will be shown in the console.
32
-    useEslint: true,
32
+    useEslint: false,
33
     // If true, eslint errors and warnings will also be shown in the error overlay
33
     // If true, eslint errors and warnings will also be shown in the error overlay
34
     // in the browser.
34
     // in the browser.
35
     showEslintErrorsInOverlay: false,
35
     showEslintErrorsInOverlay: false,

+ 7
- 0
VUECODE/smart-property-manage/src/api/index.js View File

15
     method: 'get'
15
     method: 'get'
16
   })
16
   })
17
 }
17
 }
18
+// 首页图表数据
19
+export function getIndexCount() {
20
+  return request({
21
+    url: '/index/count',
22
+    method: 'get'
23
+  })
24
+}

+ 36
- 44
VUECODE/smart-property-manage/src/components/chart/chart3.vue View File

1
 <template>
1
 <template>
2
   <div id="node3">
2
   <div id="node3">
3
-    <div class="title">今日所有小区智能硬件数据统计</div>
3
+    <div class="title">今日小区智能硬件数据统计</div>
4
     <div class="table">
4
     <div class="table">
5
-      <div
6
-        v-for="(item,index) in arr"
7
-        :key="index"
8
-        :class="{active:item.active}"
9
-        @mouseover="item.active = true"
10
-        @mouseout="item.active=false"
11
-      >
12
-        <div>{{ item.text }}</div>
13
-        <div>{{ item.num }}</div>
5
+      <div :class="bgHover==1?'active':''"  @mouseenter="divHover(1)">
6
+        <div>小区门禁开启</div>
7
+        <div>{{ hardwaremap.communityCount }}</div>
8
+      </div>
9
+      <div :class="bgHover==2?'active':''"  @mouseenter="divHover(2)">
10
+        <div>单元门开启</div>
11
+        <div>{{ hardwaremap.unitCount }}</div>
12
+      </div>
13
+      <div :class="bgHover==3?'active':''"  @mouseenter="divHover(3)">
14
+        <div>访客车辆进入数量</div>
15
+        <div>{{ hardwaremap.visitorCount }}</div>
16
+      </div>
17
+      <div :class="bgHover==4?'active':''"  @mouseenter="divHover(4)">
18
+        <div>公区摄像头查看</div>
19
+        <div>{{ hardwaremap.publicCameraCount }}</div>
20
+      </div>
21
+      <div :class="bgHover==5?'active':''"  @mouseenter="divHover(5)">
22
+        <div>单元门远程监控查看</div>
23
+        <div>{{ hardwaremap.remoteMonitoringCount }}</div>
24
+      </div>
25
+      <div :class="bgHover==6?'active':''"  @mouseenter="divHover(6)">
26
+        <div>单元门远程开门</div>
27
+        <div>{{ hardwaremap.remoteUnitCount }}</div>
14
       </div>
28
       </div>
15
     </div>
29
     </div>
16
   </div>
30
   </div>
17
 </template>
31
 </template>
18
 
32
 
19
 <script>
33
 <script>
20
-import { mapState, mapActions } from 'vuex'
21
-
22
 export default {
34
 export default {
23
   data() {
35
   data() {
24
     return {
36
     return {
25
-      arr: [
26
-        { text: '小区门禁开启', num: '13400次', active: false },
27
-        { text: '单元门开启', num: '12788次', active: false },
28
-        { text: '车辆进入数量', num: '5664辆', active: false },
29
-        { text: '咖啡厅销量', num: '3994次', active: false },
30
-        { text: '智慧食堂销量', num: '5664人次', active: false },
31
-        { text: '健身房健身', num: '1255人次', active: false }
32
-      ]
33
-    }
34
-  },
35
-  computed: {
36
-    ...mapState('trunkIndex', {
37
-      hardData: item => item.trunkIndex.hardData
38
-    })
39
-  },
40
-  created() {
41
-    // this.GetHardData().then(() => {
42
-    //   console.log(this.hardData)
43
-    //   this.hardData.forEach(item => {
44
-    //     if (item.message === '小区开门次数') {
45
-    //       this.arr[0].num = item.count + '次'
46
-    //     } else if (item.message === '单元门开门次数') {
47
-    //       this.arr[1].num = item.count + '次'
48
-    //     }
49
-    //   })
50
-    //   this.arr = JSON.parse(JSON.stringify(this.arr))
51
-    // })
37
+      bgHover:"",
38
+
39
+    };
52
   },
40
   },
53
-  methods: {
54
-    ...mapActions('trunkIndex', [
55
-      'GetHardData'
56
-    ])
41
+  props: ["hardwaremap"],
42
+ 
43
+  methods:{
44
+       divHover(index) {
45
+      this.bgHover = index;
46
+    }
57
   }
47
   }
58
-}
48
+};
59
 </script>
49
 </script>
60
 
50
 
61
 <style lang="scss" scoped>
51
 <style lang="scss" scoped>
87
         color: #a4b6c5;
77
         color: #a4b6c5;
88
         margin: 5px;
78
         margin: 5px;
89
         font-size: 13px;
79
         font-size: 13px;
80
+        text-align: center;
90
       }
81
       }
91
     }
82
     }
92
     .active {
83
     .active {
94
       z-index: 1;
85
       z-index: 1;
95
       div {
86
       div {
96
         color: #53f9ff;
87
         color: #53f9ff;
88
+        text-align: center;
97
       }
89
       }
98
     }
90
     }
99
   }
91
   }

+ 110
- 108
VUECODE/smart-property-manage/src/components/chart/chart4.vue View File

1
 <template>
1
 <template>
2
-  <div id="node4">
3
-    <div class="top-title">已合作社区分布图</div>
4
-    <el-amap
5
-      ref="map"
6
-      :center="mapCenter"
7
-      :zoom="7"
8
-      :map-style="setMapStyle"
9
-      vid="amapDemo"
10
-      class="amap-demo"
11
-    >
12
-      <el-amap-marker
13
-        v-for="(item,index) in markers"
14
-        :key="index"
15
-        :position="item.position"
16
-        :icon="item.icon"
17
-        :title="item.title"
18
-        :offset="item.offset"
19
-        :content="item.content"
20
-      />
21
-    </el-amap>
22
-  </div>
2
+  <div id="node4"/>
23
 </template>
3
 </template>
24
 
4
 
25
 <script>
5
 <script>
26
-// import G2 from '@antv/g2'
27
-// import DataSet from '@antv/data-set'
28
-import $ from 'jquery'
29
-// import AMapUI from 'AMapUI'
30
-import light1 from '@/assets/light1.png'
31
-import light2 from '@/assets/light2.png'
32
-import light3 from '@/assets/light3.png'
33
-import light4 from '@/assets/light4.png'
6
+import G2 from "@antv/g2";
7
+import DataSet from "@antv/data-set";
8
+
34
 export default {
9
 export default {
35
-  data() {
36
-    return {
37
-      light1,
38
-      light2,
39
-      light3,
40
-      light4,
41
-      markers: [{
42
-        position: [118.633516, 32.069878],
43
-        title: '悦见山',
44
-        offset: [-60, -60],
45
-        content: `<div class='point'>
46
-        <img src='${light1}'>
47
-        <span>悦见山</span>
48
-        </div>`
49
-      }, {
50
-        position: [117.161777, 34.154014],
51
-        title: '致享城',
52
-        offset: [-60, -60],
53
-        content: `<div class='point'>
54
-        <img src='${light2}'>
55
-        <span>致享城</span>
56
-        </div>`
57
-      }, {
58
-        position: [118.753086, 31.972501],
59
-        title: '智慧社区',
60
-        offset: [-60, -60],
61
-        content: `<div class='point'>
62
-        <img src='${light3}'>
63
-        <span>智慧社区</span>
64
-        </div>`
65
-      }, {
66
-        position: [120.064082, 30.343891],
67
-        title: '云谷天境',
68
-        offset: [-60, -60],
69
-        content: `<div class='point'>
70
-        <img src='${light4}'>
71
-        <span>云谷天境</span>
72
-        </div>`
73
-      }],
74
-      mapCenter: [118.753086, 31.972501],
75
-      setMapStyle: 'amap://styles/blue'
76
-    }
77
-  },
78
   mounted() {
10
   mounted() {
79
-    setInterval(() => {
80
-      this.rander()
81
-    }, 1600)
11
+    this.rander();
12
+    console.log(this.invoicelist,"chart4")
82
   },
13
   },
14
+ props:['invoicelist'],
83
   methods: {
15
   methods: {
84
     rander() {
16
     rander() {
85
-      $('.point img').animate({ opacity: 0 }, 800).animate({ opacity: 1 }, 800)
17
+      var data = this.invoicelist;
18
+      var dv = new DataSet.View().source(data);
19
+      var chart = new G2.Chart({
20
+        container: "node4",
21
+        forceFit: true,
22
+        height: 282,
23
+        padding: [80, 40, 30, 50]
24
+      });
25
+      chart.source(dv, {
26
+        priceTotal: {
27
+          formatter: function formatter(val) {
28
+            return val;
29
+          }
30
+        },
31
+        createDate: {
32
+        }
33
+      });
34
+
35
+      chart.axis("priceTotal", {
36
+        line: {
37
+          lineWidth: 1, // 设置线的宽度
38
+          stroke: "#a4b6c5" // 设置线的颜色
39
+        },
40
+        grid: null,
41
+        label: {
42
+          textStyle: {
43
+            textAlign: "end", // 文本对齐方向,可取值为: start middle end
44
+            fill: "#a4b6c5", // 文本的颜色
45
+            fontSize: "12", // 文本大小
46
+            textBaseline: "middle" // 文本基准线,可取 top middle bottom,默认为middle
47
+          }
48
+        }
49
+      });
50
+      chart.axis("createDate", {
51
+        line: {
52
+          lineWidth: 1, // 设置线的宽度
53
+          stroke: "#a4b6c5" // 设置线的颜色
54
+        },
55
+        grid: null,
56
+        label: {
57
+          textStyle: {
58
+            fill: "#a4b6c5", // 文本的颜色
59
+            fontSize: "12" // 文本大小
60
+          }
61
+        }
62
+      });
63
+      chart.tooltip({
64
+        crosshairs: true
65
+      });
66
+
67
+      chart
68
+        .line()
69
+        .position("createDate*priceTotal")
70
+        .color("priceTotal", function(val) {
71
+          return "#83BB41";
72
+        })
73
+        .size(2)
74
+        .shape("smooth");
75
+      chart
76
+        .point()
77
+        .position("createDate*priceTotal")
78
+        .size(3)
79
+        .shape("circle")
80
+        .label(
81
+          "createDate*priceTotal",
82
+          function(createDate, priceTotal) {
83
+            return priceTotal;
84
+          },
85
+          {
86
+            textStyle: {
87
+              fill: "#fff",
88
+              fontSize: 12,
89
+              textAlign:'left',
90
+            }
91
+          }
92
+        )
93
+        .style({
94
+          fill: "#eee",
95
+          fontSize: 12,
96
+          stroke: "#83BB41",
97
+          lineWidth: 1
98
+        });
99
+      chart.guide().html({
100
+        position: ["5%", "-35%"],
101
+        html:
102
+          '<div class="chart4-title"><p class="title">收费组总缴费统计</p></div>'
103
+      });
104
+      chart.guide().html({
105
+        position: ["1%", "-22%"],
106
+        html:
107
+          '<div class="chart4-title"><p class="title">金额(元)</p></div>'
108
+      });
109
+      chart.guide().html({
110
+        position: ["102%", "100%"],
111
+        html:
112
+          '<div class="chart4-title"><p class="title">日期</p></div>'
113
+      });
114
+      chart.render();
86
     }
115
     }
87
   }
116
   }
88
-}
117
+};
89
 </script>
118
 </script>
90
 
119
 
91
 <style lang="scss">
120
 <style lang="scss">
92
-#node4{
93
-  border-radius: 5px;
94
-}
95
-.top-title{
96
-  width: 100%;
97
-  position: absolute;
98
-  top: 0;
99
-  left: 0;
100
-  text-align: center;
101
-  margin-top: 30px;
102
-  z-index: 20;
103
-  color: #A6B9C8;
104
-  font-size: 18px;
105
-}
106
-.point{
107
-  position: relative;
108
-  width: 120px;
109
-  height: 120px;
110
-  img{
111
-    position: absolute;
112
-    top: 50%;
113
-    left: 50%;
114
-    transform: translate(-50%,-50%);
115
-  }
116
-  span{
117
-    position: absolute;
118
-    top: 80%;
119
-    left: 50%;
120
-    transform: translate(-50%,-50%);
121
-    font-size: 12px;
122
-    color: white;
121
+.chart4-title {
122
+  .title {
123
+    font-size: 13px;
124
+    color: #a4b6c5;
123
   }
125
   }
124
 }
126
 }
125
 </style>
127
 </style>

+ 121
- 63
VUECODE/smart-property-manage/src/components/chart/chart5.vue View File

3
 </template>
3
 </template>
4
 
4
 
5
 <script>
5
 <script>
6
-import G2 from '@antv/g2'
7
-import { mapState, mapActions } from 'vuex'
8
-
6
+import G2 from "@antv/g2";
7
+import DataSet from "@antv/data-set";
9
 export default {
8
 export default {
10
-  computed: {
11
-    ...mapState('trunkIndex', {
12
-      signUser: item => item.trunkIndex.signUser
13
-    })
14
-  },
15
   mounted() {
9
   mounted() {
16
-    // this.GetSignUser().then(() => {
17
-    //   this.rander()
18
-    // })
10
+    this.rander();
11
+     console.log(this.invoicelist,"chart4")
19
   },
12
   },
13
+  props:['usercountList'],
20
   methods: {
14
   methods: {
21
-    ...mapActions('trunkIndex', [
22
-      'GetSignUser'
23
-    ]),
24
     rander() {
15
     rander() {
25
-      console.log(this.signUser)
26
-      var data = this.signUser
16
+      var data = [
17
+        {
18
+          year: "11.17",
19
+          ACME: 300
20
+        },
21
+        {
22
+          year: "11.18",
23
+          ACME: 280
24
+        },
25
+        {
26
+          year: "11.19",
27
+          ACME: 320
28
+        },
29
+        {
30
+          year: "11.20",
31
+          ACME: 250
32
+        },
33
+        {
34
+          year: "11.21",
35
+          ACME: 310
36
+        },
37
+        {
38
+          year: "11.22",
39
+          ACME: 323
40
+        },
41
+        {
42
+          year: "11.23",
43
+          ACME: 350
44
+        }
45
+      ];
46
+      var dv = new DataSet.View().source(data);
47
+      dv.transform({
48
+        type: "fold",
49
+        fields: ["ACME"],
50
+        key: "type",
51
+        value: "value"
52
+      });
27
       var chart = new G2.Chart({
53
       var chart = new G2.Chart({
28
-        container: 'node5',
54
+        container: "node5",
29
         forceFit: true,
55
         forceFit: true,
30
         height: 282,
56
         height: 282,
31
-        padding: [80, 20, 30, 40]
32
-      })
33
-      chart.source(data)
34
-      console.log(chart)
35
-      chart.axis('count', {
57
+        padding: [80, 40, 30, 40]
58
+      });
59
+      chart.source(dv, {
60
+        value: {
61
+          alias: "The Share Price in Dollars",
62
+          formatter: function formatter(val) {
63
+            return val;
64
+          }
65
+        },
66
+        year: {
67
+          // range: [0, 1]
68
+        }
69
+      });
70
+      chart.axis("value", {
36
         line: {
71
         line: {
37
           lineWidth: 1, // 设置线的宽度
72
           lineWidth: 1, // 设置线的宽度
38
-          stroke: '#a4b6c5' // 设置线的颜色
73
+          stroke: "#a4b6c5" // 设置线的颜色
39
         },
74
         },
40
         grid: null,
75
         grid: null,
41
         label: {
76
         label: {
42
           textStyle: {
77
           textStyle: {
43
-            textAlign: 'end', // 文本对齐方向,可取值为: start middle end
44
-            fill: '#a4b6c5', // 文本的颜色
45
-            fontSize: '12', // 文本大小
46
-            textBaseline: 'middle' // 文本基准线,可取 top middle bottom,默认为middle
78
+            textAlign: "end", // 文本对齐方向,可取值为: start middle end
79
+            fill: "#a4b6c5", // 文本的颜色
80
+            fontSize: "12", // 文本大小
81
+            textBaseline: "middle" // 文本基准线,可取 top middle bottom,默认为middle
47
           }
82
           }
48
         }
83
         }
49
-      })
50
-      chart.axis('message', {
84
+      });
85
+      chart.axis("year", {
51
         line: {
86
         line: {
52
           lineWidth: 1, // 设置线的宽度
87
           lineWidth: 1, // 设置线的宽度
53
-          stroke: '#a4b6c5' // 设置线的颜色
88
+          stroke: "#a4b6c5" // 设置线的颜色
54
         },
89
         },
55
         grid: null,
90
         grid: null,
56
         label: {
91
         label: {
57
           textStyle: {
92
           textStyle: {
58
-            fill: '#a4b6c5', // 文本的颜色
59
-            fontSize: '12' // 文本大小
93
+            fill: "#a4b6c5", // 文本的颜色
94
+            fontSize: "12", // 文本大小
95
+            textBaseline: "middle" // 文本基准线,可取 top middle bottom,默认为middle
60
           }
96
           }
61
         }
97
         }
62
-      })
63
-      chart.scale('', {
64
-        tickInterval: 200
65
-      })
98
+      });
99
+      chart.tooltip({
100
+        crosshairs: true
101
+      });
102
+
103
+      chart
104
+        .line()
105
+        .position("year*value")
106
+        .color("type", function(val) {
107
+          return "#da70d6";
108
+        })
109
+        .size(2)
110
+        .shape("smooth");
111
+      chart
112
+        .point()
113
+        .position("year*value")
114
+        .size(3)
115
+        .shape("circle")
116
+        .label(
117
+          "year*value",
118
+          function(year, value) {
119
+            return value;
120
+          },
121
+          {
122
+            textStyle: {
123
+              fill: "#fff",
124
+              fontSize: 12,
125
+              textAlign: "left"
126
+            }
127
+          }
128
+        )
129
+        .style({
130
+          fill: "#eee",
131
+          fontSize: 12,
132
+          stroke: "#da70d6",
133
+          lineWidth: 1
134
+        });
135
+
66
       chart.guide().html({
136
       chart.guide().html({
67
-        position: ['5%', '-25%'],
68
-        html: '<div class="chart5-title"><p class="title">注册用户统计</p></div>'
69
-      })
137
+        position: ["5%", "-35%"],
138
+        html:
139
+          '<div class="chart5-title"><p class="title">月租车总缴费统计</p></div>'
140
+      });
141
+        chart.guide().html({
142
+        position: ["1%", "-22%"],
143
+        html:
144
+          '<div class="chart4-title"><p class="title">金额(元)</p></div>'
145
+      });
70
       chart.guide().html({
146
       chart.guide().html({
71
-        position: ['90%', '-15%'],
72
-        html: `<div class="chart-right-btn"><span>18/11/27</span>&nbsp;<i class='el-icon-date'></i></div>`
73
-      })
74
-
75
-      chart.interval().position('message*count').color('message', function(val) {
76
-        if (val === '户主总数' || val === '家属总数') {
77
-          return '#53F9FF'
78
-        }
79
-        return '#FF5367'
80
-      })
81
-      chart.render()
147
+        position: ["102%", "100%"],
148
+        html:
149
+          '<div class="chart4-title"><p class="title">日期</p></div>'
150
+      });
151
+      chart.render();
82
     }
152
     }
83
   }
153
   }
84
-}
154
+};
85
 </script>
155
 </script>
86
 
156
 
87
 <style lang="scss">
157
 <style lang="scss">
91
     color: #a4b6c5;
161
     color: #a4b6c5;
92
   }
162
   }
93
 }
163
 }
94
-.chart-right-btn{
95
-  padding: 0px 8px;
96
-  display: flex;
97
-  border: 1px solid #a4b6c5;
98
-  border-radius: 9px;
99
-  justify-content: center;
100
-  align-items: center;
101
-  span,i{
102
-    font-size: 10px;
103
-    color: #a4b6c5;
104
-  }
105
-}
106
 </style>
164
 </style>

+ 116
- 61
VUECODE/smart-property-manage/src/components/chart/chart6.vue View File

3
 </template>
3
 </template>
4
 
4
 
5
 <script>
5
 <script>
6
-import G2 from '@antv/g2'
7
-import DataSet from '@antv/data-set'
6
+import G2 from "@antv/g2";
7
+import DataSet from "@antv/data-set";
8
 export default {
8
 export default {
9
   mounted() {
9
   mounted() {
10
-    this.rander()
10
+    this.rander();
11
   },
11
   },
12
+  props:['temporaryList'],
12
   methods: {
13
   methods: {
13
     rander() {
14
     rander() {
14
-      var data = [{
15
-        'year': '11.17',
16
-        'ACME': 300
17
-      }, {
18
-        'year': '11.18',
19
-        'ACME': 280
20
-      }, {
21
-        'year': '11.19',
22
-        'ACME': 320
23
-      }, {
24
-        'year': '11.20',
25
-        'ACME': 250
26
-      }, {
27
-        'year': '11.21',
28
-        'ACME': 310
29
-      }, {
30
-        'year': '11.22',
31
-        'ACME': 323
32
-      }, {
33
-        'year': '11.23',
34
-        'ACME': 350
35
-      }]
36
-      var dv = new DataSet.View().source(data)
15
+      var data = [
16
+        {
17
+          year: "11.17",
18
+          ACME: 300
19
+        },
20
+        {
21
+          year: "11.18",
22
+          ACME: 280
23
+        },
24
+        {
25
+          year: "11.19",
26
+          ACME: 320
27
+        },
28
+        {
29
+          year: "11.20",
30
+          ACME: 250
31
+        },
32
+        {
33
+          year: "11.21",
34
+          ACME: 310
35
+        },
36
+        {
37
+          year: "11.22",
38
+          ACME: 323
39
+        },
40
+        {
41
+          year: "11.23",
42
+          ACME: 350
43
+        }
44
+      ];
45
+      var dv = new DataSet.View().source(data);
37
       dv.transform({
46
       dv.transform({
38
-        type: 'fold',
39
-        fields: ['ACME'],
40
-        key: 'type',
41
-        value: 'value'
42
-      })
47
+        type: "fold",
48
+        fields: ["ACME"],
49
+        key: "type",
50
+        value: "value"
51
+      });
43
       var chart = new G2.Chart({
52
       var chart = new G2.Chart({
44
-        container: 'node6',
53
+        container: "node6",
45
         forceFit: true,
54
         forceFit: true,
46
         height: 282,
55
         height: 282,
47
-        padding: [80, 20, 30, 40]
48
-      })
56
+        padding: [80, 40, 30, 40],
57
+        itemStyle: { normal: { label: { show: true } } }
58
+      });
49
       chart.source(dv, {
59
       chart.source(dv, {
50
         value: {
60
         value: {
51
-          alias: 'The Share Price in Dollars',
61
+          alias: "The Share Price in Dollars",
52
           formatter: function formatter(val) {
62
           formatter: function formatter(val) {
53
-            return val
63
+            return val;
54
           }
64
           }
55
         },
65
         },
56
         year: {
66
         year: {
57
-          range: [0, 1]
67
+          // range: [0, 1]
58
         }
68
         }
59
-      })
60
-      chart.axis('value', {
69
+      });
70
+      chart.axis("value", {
61
         line: {
71
         line: {
62
           lineWidth: 1, // 设置线的宽度
72
           lineWidth: 1, // 设置线的宽度
63
-          stroke: '#a4b6c5' // 设置线的颜色
73
+          stroke: "#a4b6c5" // 设置线的颜色
64
         },
74
         },
65
         grid: null,
75
         grid: null,
66
         label: {
76
         label: {
67
           textStyle: {
77
           textStyle: {
68
-            textAlign: 'end', // 文本对齐方向,可取值为: start middle end
69
-            fill: '#a4b6c5', // 文本的颜色
70
-            fontSize: '12', // 文本大小
71
-            textBaseline: 'middle' // 文本基准线,可取 top middle bottom,默认为middle
78
+            textAlign: "end", // 文本对齐方向,可取值为: start middle end
79
+            fill: "#a4b6c5", // 文本的颜色
80
+            fontSize: "12", // 文本大小
81
+            textBaseline: "middle" // 文本基准线,可取 top middle bottom,默认为middle
72
           }
82
           }
73
         }
83
         }
74
-      })
75
-      chart.axis('year', {
84
+      });
85
+      chart.axis("year", {
76
         line: {
86
         line: {
77
           lineWidth: 1, // 设置线的宽度
87
           lineWidth: 1, // 设置线的宽度
78
-          stroke: '#a4b6c5' // 设置线的颜色
88
+          stroke: "#a4b6c5" // 设置线的颜色
79
         },
89
         },
90
+        name: "wowow",
80
         grid: null,
91
         grid: null,
81
         label: {
92
         label: {
82
           textStyle: {
93
           textStyle: {
83
-            fill: '#a4b6c5', // 文本的颜色
84
-            fontSize: '12' // 文本大小
94
+            fill: "#a4b6c5", // 文本的颜色
95
+            fontSize: "12" // 文本大小
85
           }
96
           }
86
         }
97
         }
87
-      })
98
+      });
88
       chart.tooltip({
99
       chart.tooltip({
89
         crosshairs: true
100
         crosshairs: true
90
-      })
101
+      });
102
+      chart
103
+        .line()
104
+        .position("year*value")
105
+        .color("type", function(val) {
106
+          return "#6495ed";
107
+        })
108
+        .size(2)
109
+        .shape("smooth");
110
+      chart
111
+        .point()
112
+        .position("year*value")
113
+        .size(3)
114
+        .shape("circle")
115
+        .label(
116
+          "year*value",
117
+          function(year, value) {
118
+            return value;
119
+          },
120
+          {
121
+            textStyle: {
122
+              fill: "#fff",
123
+              fontSize: 12,
124
+              textAlign:'left',
125
+            }
126
+          }
127
+        )
128
+        .style({
129
+          fill: "#eee",
130
+          fontSize: 12,
131
+          stroke: "#6495ed",
132
+          lineWidth: 1
133
+        });
134
+
91
       chart.guide().html({
135
       chart.guide().html({
92
-        position: ['90%', '-15%'],
93
-        html: `<div class="chart-right-btn"><span>日活跃量</span>&nbsp;<i class='el-icon-arrow-down'></i></div>`
94
-      })
95
-      chart.area().position('year*value').color('type', function(val) { return '#53F9FF' }).shape('smooth')
96
-      chart.line().position('year*value').color('type', function(val) { return '#53F9FF' }).size(2).shape('smooth')
136
+        position: ["5%", "-35%"],
137
+        html:
138
+          '<div class="chart4-title"><p class="title">临时车总缴费统计</p></div>'
139
+      });
140
+        chart.guide().html({
141
+        position: ["1%", "-22%"],
142
+        html:
143
+          '<div class="chart4-title"><p class="title">金额(元)</p></div>'
144
+      });
97
       chart.guide().html({
145
       chart.guide().html({
98
-        position: ['5%', '-25%'],
99
-        html: '<div class="chart5-title"><p class="title">上线活跃用户</p></div>'
100
-      })
101
-      chart.render()
146
+        position: ["102%", "100%"],
147
+        html:
148
+          '<div class="chart4-title"><p class="title">日期</p></div>'
149
+      });
150
+      chart.render();
102
     }
151
     }
103
   }
152
   }
104
-}
153
+};
105
 </script>
154
 </script>
106
 
155
 
107
 <style lang="scss">
156
 <style lang="scss">
157
+.chart4-title {
158
+  .title {
159
+    font-size: 13px;
160
+    color: #a4b6c5;
161
+  }
162
+}
108
 </style>
163
 </style>

+ 79
- 47
VUECODE/smart-property-manage/src/components/chart/chart7.vue View File

3
 </template>
3
 </template>
4
 
4
 
5
 <script>
5
 <script>
6
-import G2 from '@antv/g2'
6
+import G2 from "@antv/g2";
7
 
7
 
8
 export default {
8
 export default {
9
   mounted() {
9
   mounted() {
10
-    this.rander()
10
+    this.rander();
11
   },
11
   },
12
   methods: {
12
   methods: {
13
     rander() {
13
     rander() {
14
-      var data = [{
15
-        type: '公告',
16
-        sales: 500
17
-      }, {
18
-        type: '活动',
19
-        sales: 400
20
-      }, {
21
-        type: '帖子',
22
-        sales: 1000
23
-      }]
14
+      var data = [
15
+        {
16
+          type: "户主",
17
+          sales: 500
18
+        },
19
+        {
20
+          type: "家属",
21
+          sales: 1000
22
+        },
23
+        {
24
+          type: "租客",
25
+          sales: 300
26
+        }
27
+      ];
24
       var chart = new G2.Chart({
28
       var chart = new G2.Chart({
25
-        container: 'node7',
29
+        container: "node7",
26
         forceFit: true,
30
         forceFit: true,
27
         height: 282,
31
         height: 282,
28
         padding: [80, 20, 30, 40]
32
         padding: [80, 20, 30, 40]
29
-      })
30
-      chart.source(data)
31
-      chart.scale('', {
33
+      });
34
+      chart.source(data);
35
+      chart.scale("", {
32
         tickInterval: 200
36
         tickInterval: 200
33
-      })
37
+      });
38
+      chart.scale("sales", {
39
+        alias: "行数(万)"
40
+      });
34
       chart.guide().html({
41
       chart.guide().html({
35
-        position: ['5%', '-25%'],
36
-        html: '<div class="chart7-title"><p class="title">内容运营统计</p></div>'
37
-      })
38
-      chart.guide().html({
39
-        position: ['90%', '-15%'],
40
-        html: `<div class="chart-right-btn"><span>发布数量</span>&nbsp;<i class='el-icon-arrow-down'></i></div>`
41
-      })
42
-      chart.axis('sales', {
42
+        position: ["5%", "-35%"],
43
+        html:
44
+          '<div class="chart7-title"><p class="title">注册用户总数</p></div>'
45
+      });
46
+        chart.guide().html({
47
+        position: ["1%", "-22%"],
48
+        html:
49
+          '<div class="chart4-title"><p class="title">数量(个)</p></div>'
50
+      });
51
+   
52
+      // chart.guide().html({
53
+      //   position: ["90%", "-15%"],
54
+      //   html: `<div class="chart-right-btn"><span>发布数量</span>&nbsp;<i class='el-icon-arrow-down'></i></div>`
55
+      // });
56
+      chart.axis("sales", {
43
         line: {
57
         line: {
44
           lineWidth: 1, // 设置线的宽度
58
           lineWidth: 1, // 设置线的宽度
45
-          stroke: '#a4b6c5' // 设置线的颜色
59
+          stroke: "#a4b6c5" // 设置线的颜色
46
         },
60
         },
61
+        title: {}, //
62
+
47
         grid: null,
63
         grid: null,
48
         label: {
64
         label: {
49
           textStyle: {
65
           textStyle: {
50
-            textAlign: 'end', // 文本对齐方向,可取值为: start middle end
51
-            fill: '#a4b6c5', // 文本的颜色
52
-            fontSize: '12', // 文本大小
53
-            textBaseline: 'middle' // 文本基准线,可取 top middle bottom,默认为middle
66
+            textAlign: "end", // 文本对齐方向,可取值为: start middle end
67
+            fill: "#a4b6c5", // 文本的颜色
68
+            fontSize: "12", // 文本大小
69
+            textBaseline: "middle" // 文本基准线,可取 top middle bottom,默认为middle
54
           }
70
           }
55
         }
71
         }
56
-      })
57
-      chart.axis('type', {
72
+      });
73
+      chart.axis("type", {
58
         line: {
74
         line: {
59
           lineWidth: 1, // 设置线的宽度
75
           lineWidth: 1, // 设置线的宽度
60
-          stroke: '#a4b6c5' // 设置线的颜色
76
+          stroke: "#a4b6c5" // 设置线的颜色
61
         },
77
         },
62
         grid: null,
78
         grid: null,
63
         label: {
79
         label: {
64
           textStyle: {
80
           textStyle: {
65
-            fill: '#a4b6c5', // 文本的颜色
66
-            fontSize: '12' // 文本大小
81
+            fill: "#a4b6c5", // 文本的颜色
82
+            fontSize: "12" // 文本大小
67
           }
83
           }
68
         }
84
         }
69
-      })
70
-      chart.interval().position('type*sales').color('type', function(val) {
71
-        if (val === '公告') {
72
-          return '#53F9FF'
73
-        } else if (val === '活动') {
74
-          return '#FF5367'
75
-        }
76
-        return '#3F688D'
77
-      })
78
-      chart.render()
85
+      });
86
+
87
+      chart
88
+        .interval()
89
+        .position("type*sales")
90
+        .color("type", function(val) {
91
+          if (val === "户主") {
92
+            return "#6699FF";
93
+          } else if (val === "家属") {
94
+            return "#30e0e0";
95
+          }
96
+          return "#3cb371";
97
+        })
98
+        .label(
99
+          "type*sales",
100
+          function(type, sales) {
101
+            return sales;
102
+          },
103
+          {
104
+            textStyle: {
105
+              fill: "#fff",
106
+              fontSize: 12
107
+            }
108
+          }
109
+        );
110
+      chart.render();
79
     }
111
     }
80
   }
112
   }
81
-}
113
+};
82
 </script>
114
 </script>
83
-
84
 <style lang="scss">
115
 <style lang="scss">
85
 .chart7-title {
116
 .chart7-title {
86
   .title {
117
   .title {
89
   }
120
   }
90
 }
121
 }
91
 </style>
122
 </style>
123
+

+ 158
- 0
VUECODE/smart-property-manage/src/components/chart/chart8.vue View File

1
+<template>
2
+  <div id="node8"/>
3
+</template>
4
+
5
+<script>
6
+import G2 from "@antv/g2";
7
+import DataSet from "@antv/data-set";
8
+export default {
9
+  mounted() {
10
+    this.rander();
11
+  },
12
+  methods: {
13
+    rander() {
14
+      var data = [
15
+        {
16
+          year: "11.17",
17
+          ACME: 300
18
+        },
19
+        {
20
+          year: "11.18",
21
+          ACME: 280
22
+        },
23
+        {
24
+          year: "11.19",
25
+          ACME: 320
26
+        },
27
+        {
28
+          year: "11.20",
29
+          ACME: 250
30
+        },
31
+        {
32
+          year: "11.21",
33
+          ACME: 310
34
+        },
35
+        {
36
+          year: "11.22",
37
+          ACME: 323
38
+        },
39
+        {
40
+          year: "11.23",
41
+          ACME: 350
42
+        }
43
+      ];
44
+      var dv = new DataSet.View().source(data);
45
+      dv.transform({
46
+        type: "fold",
47
+        fields: ["ACME"],
48
+        key: "type",
49
+        value: "value"
50
+      });
51
+      var chart = new G2.Chart({
52
+        container: "node8",
53
+        forceFit: true,
54
+        height: 282,
55
+        padding: [80, 40, 30, 40]
56
+      });
57
+      chart.source(dv, {
58
+        value: {
59
+          formatter: function formatter(val) {
60
+            return val;
61
+          }
62
+        },
63
+        year: {
64
+          // range: [0, 1]
65
+        }
66
+      });
67
+      chart.axis("value", {
68
+        line: {
69
+          lineWidth: 1, // 设置线的宽度
70
+          stroke: "#a4b6c5" // 设置线的颜色
71
+        },
72
+        grid: null,
73
+        label: {
74
+          textStyle: {
75
+            textAlign: "end", // 文本对齐方向,可取值为: start middle end
76
+            fill: "#a4b6c5", // 文本的颜色
77
+            fontSize: "12", // 文本大小
78
+            textBaseline: "middle" // 文本基准线,可取 top middle bottom,默认为middle
79
+          }
80
+        }
81
+      });
82
+      chart.axis("year", {
83
+        line: {
84
+          lineWidth: 1, // 设置线的宽度
85
+          stroke: "#a4b6c5" // 设置线的颜色
86
+        },
87
+        grid: null,
88
+        label: {
89
+          textStyle: {
90
+            fill: "#a4b6c5", // 文本的颜色
91
+            fontSize: "12" // 文本大小
92
+          }
93
+        }
94
+      });
95
+      chart.tooltip({
96
+        crosshairs: true
97
+      });
98
+      chart
99
+        .line()
100
+        .position("year*value")
101
+        .color("type", function(val) {
102
+          return "#ffd700";
103
+        })
104
+        .size(2)
105
+        .shape("smooth");
106
+      chart
107
+        .point()
108
+        .position("year*value")
109
+        .size(3)
110
+        .shape("circle")
111
+        .label(
112
+          "year*value",
113
+          function(year, ACME) {
114
+            return ACME;
115
+          },
116
+          {
117
+            textStyle: {
118
+              fill: "#fff",
119
+              fontSize: 12,
120
+              textAlign:'left',
121
+            }
122
+          }
123
+        )
124
+        .style({
125
+          fill: "#eee",
126
+          fontSize: 12,
127
+          stroke: "#ffd700",
128
+          lineWidth: 1
129
+        });
130
+
131
+      chart.guide().html({
132
+        position: ["5%", "-35%"],
133
+        html: '<div class="chart8-title"><p class="title">日活跃用户</p></div>'
134
+      });
135
+        chart.guide().html({
136
+        position: ["1%", "-22%"],
137
+        html:
138
+          '<div class="chart4-title"><p class="title">数量(个)</p></div>'
139
+      });
140
+      chart.guide().html({
141
+        position: ["102%", "100%"],
142
+        html:
143
+          '<div class="chart4-title"><p class="title">日期</p></div>'
144
+      });
145
+      chart.render();
146
+    }
147
+  }
148
+};
149
+</script>
150
+
151
+<style lang="scss">
152
+.chart8-title {
153
+  .title {
154
+    font-size: 13px;
155
+    color: #a4b6c5;
156
+  }
157
+}
158
+</style>

+ 116
- 0
VUECODE/smart-property-manage/src/components/chart/chart9.vue View File

1
+<template>
2
+  <div id="node9"/>
3
+</template>
4
+
5
+<script>
6
+import G2 from "@antv/g2";
7
+
8
+export default {
9
+  mounted() {
10
+    this.rander();
11
+  },
12
+  methods: {
13
+    rander() {
14
+      var data = [
15
+        {
16
+          type: "公告",
17
+          sales: 500
18
+        },
19
+        {
20
+          type: "活动",
21
+          sales: 400
22
+        },
23
+        {
24
+          type: "话题",
25
+          sales: 1000
26
+        }
27
+      ];
28
+      var chart = new G2.Chart({
29
+        container: "node9",
30
+        forceFit: true,
31
+        height: 282,
32
+        padding: [80, 20, 30, 40]
33
+      });
34
+      chart.source(data);
35
+      chart.scale("", {
36
+        tickInterval: 200
37
+      });
38
+      chart.guide().html({
39
+        position: ["5%", "-35%"],
40
+        html:
41
+          '<div class="chart9-title"><p class="title">已发布内容统计</p></div>'
42
+      });
43
+      chart.guide().html({
44
+        position: ["1%", "-22%"],
45
+        html: '<div class="chart4-title"><p class="title">数量(个)</p></div>'
46
+      });
47
+
48
+      chart.axis("sales", {
49
+        line: {
50
+          lineWidth: 1, // 设置线的宽度
51
+          stroke: "#a4b6c5" // 设置线的颜色
52
+        },
53
+        grid: null,
54
+        label: {
55
+          textStyle: {
56
+            textAlign: "end", // 文本对齐方向,可取值为: start middle end
57
+            fill: "#a4b6c5", // 文本的颜色
58
+            fontSize: "12", // 文本大小
59
+            textBaseline: "middle" // 文本基准线,可取 top middle bottom,默认为middle
60
+          }
61
+        }
62
+      });
63
+      chart.axis("type", {
64
+        line: {
65
+          lineWidth: 1, // 设置线的宽度
66
+          stroke: "#a4b6c5" // 设置线的颜色
67
+        },
68
+        grid: null,
69
+        label: {
70
+          textStyle: {
71
+            fill: "#a4b6c5", // 文本的颜色
72
+            fontSize: "12" // 文本大小
73
+          }
74
+        }
75
+      });
76
+      chart
77
+        .interval()
78
+        .position("type*sales")
79
+        .color("type", function(val) {
80
+          if (val === "公告") {
81
+            return "#53F9FF";
82
+          } else if (val === "活动") {
83
+            return "#FF6666";
84
+          }
85
+          return "#3F688D";
86
+        })
87
+        .label(
88
+          "type*sales",
89
+          function(type, sales) {
90
+            return sales;
91
+          },
92
+          {
93
+            textStyle: {
94
+              fill: "#fff",
95
+              fontSize: 12
96
+            }
97
+          }
98
+        );
99
+      chart.render();
100
+    }
101
+  }
102
+};
103
+</script>
104
+
105
+<style lang="scss">
106
+.chart9-title {
107
+  .title {
108
+    font-size: 13px;
109
+    color: #a4b6c5;
110
+  }
111
+}
112
+.chart-right-btn {
113
+  font-size: 13px;
114
+  color: #a4b6c5;
115
+}
116
+</style>

+ 20
- 3
VUECODE/smart-property-manage/src/store/modules/trunkIndex.js View File

1
-import { getHardData, getSignUser } from '@/api/index'
1
+import { getHardData, getSignUser,getIndexCount } from '@/api/index'
2
 
2
 
3
 const trunkIndex = {
3
 const trunkIndex = {
4
   namespaced: true,
4
   namespaced: true,
5
   state: {
5
   state: {
6
     trunkIndex: {
6
     trunkIndex: {
7
       hardData: null,
7
       hardData: null,
8
-      signUser: null
8
+      signUser: null,
9
+      IndexInfo: null,
9
     }
10
     }
10
   },
11
   },
11
   mutations: {
12
   mutations: {
14
     },
15
     },
15
     upDateSignUser: (state, data) => {
16
     upDateSignUser: (state, data) => {
16
       state.trunkIndex.signUser = data
17
       state.trunkIndex.signUser = data
18
+    },
19
+    upDateIndexCount: (state, data) => {
20
+      state.trunkIndex.IndexInfo = data
17
     }
21
     }
18
   },
22
   },
19
   actions: {
23
   actions: {
41
           reject(error)
45
           reject(error)
42
         })
46
         })
43
       })
47
       })
44
-    }
48
+    },
49
+    // 首页图表数据
50
+    getIndexCount({ commit }) {
51
+      return new Promise((resolve, reject) => {
52
+        getIndexCount().then(response => {
53
+          const data = response.data;
54
+          commit('upDateIndexCount', data)
55
+          resolve(data)
56
+        }).catch(error => {
57
+          reject(error)
58
+        })
59
+      })
60
+    },
61
+
45
   }
62
   }
46
 }
63
 }
47
 
64
 

+ 47
- 16
VUECODE/smart-property-manage/src/views/index/index.vue View File

3
     <div class="left">
3
     <div class="left">
4
       <chart1/>
4
       <chart1/>
5
       <chart2/>
5
       <chart2/>
6
-      <chart3/>
6
+      <chart3 :hardwaremap="hardwaremap"/>
7
     </div>
7
     </div>
8
     <div class="middle">
8
     <div class="middle">
9
-      <chart4/>
9
+      <chart4 :invoicelist="invoicelist"/>
10
+      <chart5 :usercountlist="usercountlist"/>
11
+      <chart6 :temporarylist="temporarylist"/>
10
     </div>
12
     </div>
11
     <div class="right">
13
     <div class="right">
12
-      <chart5/>
13
-      <chart6/>
14
       <chart7/>
14
       <chart7/>
15
+      <chart8/>
16
+      <chart9/>
15
     </div>
17
     </div>
16
   </div>
18
   </div>
17
 </template>
19
 </template>
18
 
20
 
19
 <script>
21
 <script>
20
-import chart1 from '@/components/chart/chart1.vue'
21
-import chart2 from '@/components/chart/chart2.vue'
22
-import chart3 from '@/components/chart/chart3.vue'
23
-import chart4 from '@/components/chart/chart4.vue'
24
-import chart5 from '@/components/chart/chart5.vue'
25
-import chart6 from '@/components/chart/chart6.vue'
26
-import chart7 from '@/components/chart/chart7.vue'
22
+import { mapState, mapActions } from "vuex";
23
+import chart1 from "@/components/chart/chart1.vue";
24
+import chart2 from "@/components/chart/chart2.vue";
25
+import chart3 from "@/components/chart/chart3.vue";
26
+import chart4 from "@/components/chart/chart4.vue";
27
+import chart5 from "@/components/chart/chart5.vue";
28
+import chart6 from "@/components/chart/chart6.vue";
29
+import chart7 from "@/components/chart/chart7.vue";
30
+import chart8 from "@/components/chart/chart8.vue";
31
+import chart9 from "@/components/chart/chart9.vue";
27
 
32
 
28
 export default {
33
 export default {
34
+  data() {
35
+    return {
36
+      hardwaremap: {}, //chart3
37
+      invoicelist: [], //chart4
38
+      usercountlist: [], //chart5
39
+      temporarylist: [] //chart6
40
+    };
41
+  },
29
   components: {
42
   components: {
30
     chart1,
43
     chart1,
31
     chart2,
44
     chart2,
33
     chart4,
46
     chart4,
34
     chart5,
47
     chart5,
35
     chart6,
48
     chart6,
36
-    chart7
37
-  }
38
-}
49
+    chart7,
50
+    chart8,
51
+    chart9
52
+  },
53
+  computed: {
54
+    ...mapState("trunkIndex", {
55
+      IndexInfo: item => item.trunkIndex.IndexInfo
56
+    })
57
+  },
58
+  methods: {
59
+    ...mapActions("trunkIndex", ["getIndexCount"])
60
+  },
61
+  created() {
62
+    this.getIndexCount().then(() => {
63
+      console.log(this.IndexInfo);
39
 
64
 
65
+      this.hardwaremap = this.IndexInfo.hardwareMap; //chart3
66
+      this.invoicelist = this.IndexInfo.billInvoiceCountList; //chart4
67
+      this.usercountlist = this.IndexInfo.taUserLicenseCountList; //chart5
68
+      this.temporarylist = this.IndexInfo.taTemporaryLicenseCountList; //chart6
69
+    });
70
+  }
71
+};
40
 </script>
72
 </script>
41
 
73
 
42
 <style lang="scss" scoped>
74
 <style lang="scss" scoped>
61
     }
93
     }
62
   }
94
   }
63
   .middle {
95
   .middle {
64
-    flex: 5;
65
-    width: 1022px;
96
+    flex: 2;
66
     height: 905px;
97
     height: 905px;
67
   }
98
   }
68
 }
99
 }