Bläddra i källkod

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/pc-admin

# Conflicts:
#	src/config/api.js
#	vue.config.js
傅行帆 5 år sedan
förälder
incheckning
cfe38ed6ba

Binär
dist.zip Visa fil


+ 13
- 2
src/config/api.js Visa fil

@@ -57,7 +57,12 @@ const apis = {
57 57
     delete: {
58 58
       method: 'delete',
59 59
       url: `${commPrefix}/building/delete/:id`
60
-    }
60
+    },
61
+    getCityName: {
62
+      method: 'get',
63
+      url: `${commPrefix}/tdCity?leveltype=2`
64
+    },
65
+
61 66
   },
62 67
   dynamic: {
63 68
     list: {
@@ -325,7 +330,13 @@ const apis = {
325 330
     add:{
326 331
       method:'post',
327 332
       url: `${commPrefix}/taBuildingReport/add`
328
-    }
333
+    },
334
+  },
335
+  indexEcharts:{
336
+    list:{
337
+      method:'get',
338
+      url: `${commPrefix}/indexStatistical`
339
+    },
329 340
   },
330 341
 }
331 342
 export default apis

+ 1
- 0
src/store/index.js Visa fil

@@ -19,6 +19,7 @@ const store = new Vuex.Store({
19 19
     points: require('./modules/points').default,
20 20
     exchange: require('./modules/exchange').default,
21 21
     carouselFigure: require('./modules/carouselFigure').default,
22
+    indexEcharts: require('./modules/indexEcharts').default,
22 23
     message: require('./modules/message').default,
23 24
     report: require('./modules/report').default,
24 25
     news

+ 23
- 3
src/store/modules/building.js Visa fil

@@ -5,7 +5,8 @@ export default {
5 5
   namespaced: true,
6 6
   state: {
7 7
     buildings: {},
8
-    detail: {}
8
+    detail: {},
9
+    cityNameList:[],
9 10
   },
10 11
   mutations: {
11 12
     updateList (state, payload) {
@@ -13,7 +14,11 @@ export default {
13 14
     },
14 15
     updateDetail (state, payload) {
15 16
       state.detail = payload
16
-    }
17
+    },
18
+    updateCityNameList (state, payload) {
19
+      state.cityNameList = payload
20
+    },
21
+
17 22
   },
18 23
   actions: {
19 24
     setDetailNull ({ commit }) {
@@ -35,13 +40,28 @@ export default {
35 40
         })
36 41
       })
37 42
     },
43
+    getCityName ({ commit }, payload) {
44
+      return new Promise((resolve, reject) => {
45
+        request({
46
+          ...apis.building.getCityName,
47
+          params: payload,
48
+        }).then((data) => {
49
+          window.console.log(data,"data")
50
+          commit('updateCityNameList', data)
51
+          resolve(data)
52
+        }).catch(({ message }) => {
53
+          if (typeof message === 'string') {
54
+            reject(message)
55
+          }
56
+        })
57
+      })
58
+    },
38 59
     getDetail ({ commit }, payload) {
39 60
       return new Promise((resolve, reject) => {
40 61
         request({
41 62
           ...apis.building.detail,
42 63
           urlData: payload,
43 64
         }).then((data) => {
44
-          window.console.log(data)
45 65
           commit('updateDetail', data)
46 66
           resolve(data)
47 67
         }).catch(({ message }) => {

+ 63
- 0
src/store/modules/indexEcharts.js Visa fil

@@ -0,0 +1,63 @@
1
+import request from '../../utils/request'
2
+import apis from '../../config/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    echartsInfo: {},
8
+  },
9
+  mutations: {
10
+    updateList (state, payload) {
11
+      state.echartsInfo = payload
12
+    },
13
+  },
14
+  actions: {
15
+    setDetailNull ({ commit }) {
16
+      commit('updateList', {})
17
+    },
18
+    getIndexEcharts ({ commit }, payload) {
19
+      return new Promise((resolve, reject) => {
20
+        request({
21
+          ...apis.indexEcharts.list,
22
+          params: payload,
23
+        }).then((data) => {
24
+          commit('updateList', data)
25
+          resolve(data)
26
+        }).catch((err) => {
27
+          const message = err.message || err.msg
28
+          if (typeof message === 'string') {
29
+            reject(message)
30
+          }
31
+        })
32
+      })
33
+    },
34
+    // changeExchangeStatus (_, payload) {
35
+    //   return new Promise((resolve, reject) => {
36
+    //     request({
37
+    //       ...apis.exchange.change,
38
+    //       data: payload,
39
+    //     }).then((data) => {
40
+    //       resolve(data)
41
+    //     }).catch((err) => {
42
+    //       const message = err.message || err.msg
43
+
44
+    //       if (typeof message === 'string') {
45
+    //         reject(message)
46
+    //       }
47
+    //     })
48
+    //   })
49
+    // },
50
+    // verifyById (_, payload) {
51
+    //   return new Promise((resolve, reject) => {
52
+    //     request({
53
+    //       ...apis.exchange.update,
54
+    //       urlData: payload,
55
+    //     }).then((data) => {
56
+    //       resolve(data)
57
+    //     }).catch((err) => {
58
+    //       reject(err)
59
+    //     })
60
+    //   })
61
+    // }
62
+  }
63
+}

+ 214
- 163
src/views/building/edit.vue Visa fil

@@ -100,6 +100,11 @@
100 100
             <el-radio :label="0">否</el-radio>
101 101
           </el-radio-group>
102 102
         </el-form-item>
103
+        <el-form-item label="所在城市">
104
+          <el-select v-model="building.cityId" filterable placeholder="请选择">
105
+            <el-option  v-for="(list,i) in cityNameList" :key="i" :label="list.name" :value="list.id"></el-option>
106
+          </el-select>
107
+        </el-form-item>
103 108
         <el-form-item label="楼盘区域">
104 109
           <el-input v-model="building.buildingArea"></el-input>
105 110
         </el-form-item>
@@ -305,138 +310,153 @@
305 310
 </template>
306 311
 
307 312
 <script>
308
-import { createNamespacedHelpers } from 'vuex'
309
-import apis from '../../config/api'
310
-import { mapState } from 'vuex'
313
+import { createNamespacedHelpers } from "vuex";
314
+import apis from "../../config/api";
315
+import { mapState } from "vuex";
311 316
 
312
-const { mapState: mapBuildingState, mapActions: mapBuildingActions, mapMutations: mapBuildingMutations } = createNamespacedHelpers('building')
313
-const { mapActions: mapApartmentActions } = createNamespacedHelpers('apartment')
317
+const {
318
+  mapState: mapBuildingState,
319
+  mapActions: mapBuildingActions,
320
+  mapMutations: mapBuildingMutations
321
+} = createNamespacedHelpers("building");
322
+const { mapActions: mapApartmentActions } = createNamespacedHelpers(
323
+  "apartment"
324
+);
314 325
 
315 326
 export default {
316
-  name: 'BuildingEdit',
327
+  name: "BuildingEdit",
317 328
   components: {
318
-    EditableTag: () => import('@/components/EditableTag.vue'),
329
+    EditableTag: () => import("@/components/EditableTag.vue")
319 330
   },
320
-  data () {
321
-    var _self = this
331
+  data() {
332
+    var _self = this;
322 333
     return {
323 334
       upFileUrl: apis.file.upload.url,
324
-      commPrefix: '',
325
-      imgurl: '',
335
+      commPrefix: "",
336
+      imgurl: "",
326 337
       loadingZm: false,
327
-      activeName: 'detail',
328
-      dialogImageUrl: '',
338
+      activeName: "detail",
339
+      dialogImageUrl: "",
329 340
       dialogVisible: false,
330
-      dialogApartImageUrl: '',
341
+      dialogApartImageUrl: "",
331 342
       dialogApartVisible: false,
332 343
       showHx: false,
333 344
       markers: [],
334 345
       imgList: [],
335 346
       tags: [],
336 347
       buildingProperty: [],
348
+      cityName: "123",
337 349
       aparments: [],
338 350
       aparmentInfo: {},
339 351
       aparmentImg: [],
340 352
       searchOption: {
341
-        city: '南京',
353
+        city: "南京",
342 354
         citylimit: false
343 355
       },
344 356
       saleType: [
345 357
         {
346 358
           id: 1,
347
-          name: '待定',
359
+          name: "待定"
348 360
         },
349 361
         {
350 362
           id: 2,
351
-          name: '售罄',
363
+          name: "售罄"
352 364
         },
353 365
         {
354 366
           id: 3,
355
-          name: '在售',
356
-        },
367
+          name: "在售"
368
+        }
357 369
       ],
358 370
       mapCenter: [118.789509, 32.019989],
359 371
       events: {
360
-        click: (e) => {
361
-          _self.updateDetail({..._self.building, coordinate: e.lnglat.lat + ',' + e.lnglat.lng})
372
+        click: e => {
373
+          _self.updateDetail({
374
+            ..._self.building,
375
+            coordinate: e.lnglat.lat + "," + e.lnglat.lng
376
+          });
362 377
         }
363
-      },
364
-    }
378
+      }
379
+    };
365 380
   },
366 381
   computed: {
367 382
     ...mapBuildingState({
368 383
       detail: x => x.detail,
384
+      cityNameList: x => x.cityNameList
369 385
     }),
370 386
     ...mapState({
371
-      dicts: x =>  x.dicts,
387
+      dicts: x => x.dicts
372 388
     }),
373 389
     building: {
374
-      get () {
375
-        return this.detail
390
+      get() {
391
+        return this.detail;
376 392
       },
377
-      set (val) {
378
-        return this.updateDetail(val)
393
+      set(val) {
394
+        return this.updateDetail(val);
379 395
       }
380 396
     },
381
-    propertyType () {
382
-      return (this.dicts || []).filter(x => x.type === 'propertyType')
397
+    propertyType() {
398
+      return (this.dicts || []).filter(x => x.type === "propertyType");
383 399
     },
384
-    uploadHeaders () {
385
-      const token = localStorage.getItem('x-token') || ''
400
+    uploadHeaders() {
401
+      const token = localStorage.getItem("x-token") || "";
386 402
       return {
387 403
         Authorization: `Bearer ${token}`
388
-      }
404
+      };
389 405
     }
390 406
   },
391 407
   methods: {
392
-    ...mapBuildingMutations([
393
-      'updateDetail'
394
-    ]),
408
+    ...mapBuildingMutations(["updateDetail"]),
395 409
     ...mapBuildingActions([
396
-      'getDetail',
397
-      'addBuilding',
398
-      'editBuilding'
410
+      "getDetail",
411
+      "getCityName",
412
+      "addBuilding",
413
+      "editBuilding"
399 414
     ]),
400 415
     ...mapApartmentActions([
401
-      'getApartments',
402
-      'getApartmentDetail',
403
-      'addApartment',
404
-      'editApartment',
405
-      'deleteApartment'
416
+      "getApartments",
417
+      "getApartmentDetail",
418
+      "addApartment",
419
+      "editApartment",
420
+      "deleteApartment"
406 421
     ]),
407
-    getSaleTypeName (id) {
408
-      return (this.saleType.filter(x => x.id == id) [0] || {}).name
422
+    getSaleTypeName(id) {
423
+      return (this.saleType.filter(x => x.id == id)[0] || {}).name;
409 424
     },
410
-    onCancel () {
411
-      this.$router.push({name: 'buildinglist'})
425
+    onCancel() {
426
+      this.$router.push({ name: "buildinglist" });
427
+      this.$message({
428
+        message: "保存成功!",
429
+        type: "success"
430
+      });
412 431
     },
413
-    handleRemove (file, fileList) {
414
-      this.imgList = fileList
432
+    handleRemove(file, fileList) {
433
+      this.imgList = fileList;
415 434
     },
416
-    handleAparmentRemove (file, fileList) {
417
-      this.aparmentImg = fileList
435
+    handleAparmentRemove(file, fileList) {
436
+      this.aparmentImg = fileList;
418 437
     },
419
-    onSearchResult (pois) { // 搜索地图
420
-      let latSum = 0
421
-      let lngSum = 0
438
+    onSearchResult(pois) {
439
+      // 搜索地图
440
+      let latSum = 0;
441
+      let lngSum = 0;
422 442
       if (pois.length > 0) {
423 443
         pois.forEach(poi => {
424
-          let { lng, lat } = poi
425
-          lngSum += lng
426
-          latSum += lat
427
-          this.markers.push([poi.lng, poi.lat])
428
-        })
444
+          let { lng, lat } = poi;
445
+          lngSum += lng;
446
+          latSum += lat;
447
+          this.markers.push([poi.lng, poi.lat]);
448
+        });
429 449
         let center = {
430 450
           lng: lngSum / pois.length,
431 451
           lat: latSum / pois.length
432
-        }
433
-        this.mapCenter = [center.lng, center.lat]
452
+        };
453
+        this.mapCenter = [center.lng, center.lat];
434 454
       }
435 455
     },
436
-    beforeImgUpload (file) {
437
-      if (file.type !== 'image/jpeg' && file.type !== 'image/png') {
438
-        this.$message.error('上传图片只能是 JPG 或 PNG 格式!')
439
-        return false
456
+    beforeImgUpload(file) {
457
+      if (file.type !== "image/jpeg" && file.type !== "image/png") {
458
+        this.$message.error("上传图片只能是 JPG 或 PNG 格式!");
459
+        return false;
440 460
       }
441 461
       // if (file.size / 1024 > 300) {
442 462
       //   this.$message.error('图片大小不允许超过300k!')
@@ -444,157 +464,184 @@ export default {
444 464
       // }
445 465
       this.loading = this.$loading({
446 466
         lock: true,
447
-        text: '上传中...',
448
-        spinner: 'el-icon-loading',
449
-        background: 'rgba(0, 0, 0, 0.7)'
450
-      })
467
+        text: "上传中...",
468
+        spinner: "el-icon-loading",
469
+        background: "rgba(0, 0, 0, 0.7)"
470
+      });
451 471
 
452
-      return true
472
+      return true;
453 473
     },
454
-    handleAvatarSuccess (res) {
455
-      this.imgList = [...this.imgList, {
456
-        url: res.data
457
-      }]
458
-      this.loading.close()
474
+    handleAvatarSuccess(res) {
475
+      this.imgList = [
476
+        ...this.imgList,
477
+        {
478
+          url: res.data
479
+        }
480
+      ];
481
+      this.loading.close();
459 482
     },
460 483
     handleMapImgSuccess(res) {
461
-      this.building = {...this.building, mapImg: res.data }
462
-      this.loading.close()
484
+      this.building = { ...this.building, mapImg: res.data };
485
+      this.loading.close();
463 486
     },
464 487
     handlePosterSuccess(res) {
465
-      this.building = {...this.building, poster: res.data }
466
-      this.loading.close()
488
+      this.building = { ...this.building, poster: res.data };
489
+      this.loading.close();
467 490
     },
468 491
     handlePreSalePermitSuccess(res) {
469
-      this.building = {...this.building, preSalePermit: res.data }
470
-      this.loading.close()
492
+      this.building = { ...this.building, preSalePermit: res.data };
493
+      this.loading.close();
471 494
     },
472
-    handleAparmentSuccess (res) {
473
-      this.aparmentImg = [...this.aparmentImg, {
474
-        url: res.data
475
-      }]
476
-      this.loading.close()
495
+    handleAparmentSuccess(res) {
496
+      this.aparmentImg = [
497
+        ...this.aparmentImg,
498
+        {
499
+          url: res.data
500
+        }
501
+      ];
502
+      this.loading.close();
477 503
     },
478
-    onSubmit () {
504
+    onSubmit() {
479 505
       const imgs = this.imgList.map((x, i) => {
480 506
         return {
481
-          imgType: 'banner',
507
+          imgType: "banner",
482 508
           url: x.url,
483
-          orderNo: (i + 1)
484
-        }
485
-      })
509
+          orderNo: i + 1
510
+        };
511
+      });
486 512
       const tag = this.tags.map(x => {
487 513
         return {
488 514
           tagName: x
489
-        }
490
-      })
491
-      const building = {...this.building, img: imgs, propertyType: this.buildingProperty.join(','), tag}
515
+        };
516
+      });
517
+      const building = {
518
+        ...this.building,
519
+        img: imgs,
520
+        propertyType: this.buildingProperty.join(","),
521
+        tag
522
+      };
492 523
       if (!building.buildingId) {
493 524
         // 新增
494 525
         this.addBuilding({
495 526
           onSuccess: this.onCancel,
496 527
           detail: JSON.stringify(building)
497
-        })
528
+        });
498 529
       } else {
499 530
         // 修改
500 531
         this.editBuilding({
501 532
           onSuccess: this.onCancel,
502 533
           detail: JSON.stringify(building)
503
-        })
534
+        });
504 535
       }
505 536
     },
506
-    FormatDate (date) {
507
-      return (date || '').split('T')[0] === '0001-01-01' ? '' : (date || '').split('T')[0]
537
+    FormatDate(date) {
538
+      return (date || "").split("T")[0] === "0001-01-01"
539
+        ? ""
540
+        : (date || "").split("T")[0];
508 541
     },
509
-    saveAparment () {
542
+    saveAparment() {
510 543
       const imgs = this.aparmentImg.map((x, i) => {
511 544
         return {
512
-          imgType: 'aparment',
545
+          imgType: "aparment",
513 546
           url: x.url,
514
-          orderNo: (i + 1)
515
-        }
516
-      })
547
+          orderNo: i + 1
548
+        };
549
+      });
517 550
       if (!this.aparmentInfo.apartmentId) {
518
-        this.addApartment(JSON.stringify({
519
-          ...this.aparmentInfo,
520
-          img: imgs
521
-        })).then(() => {
522
-          this.getAparmentList()
523
-          this.showHx = false
524
-        })
551
+        this.addApartment(
552
+          JSON.stringify({
553
+            ...this.aparmentInfo,
554
+            img: imgs
555
+          })
556
+        ).then(() => {
557
+          this.getAparmentList();
558
+          this.showHx = false;
559
+          this.$message({
560
+            message: "保存成功!",
561
+            type: "success"
562
+          });
563
+        });
525 564
       } else {
526
-        this.editApartment(JSON.stringify({
527
-          ...this.aparmentInfo,
528
-          img: imgs
529
-        })).then(() => {
530
-          this.getAparmentList()
531
-          this.showHx = false
532
-        })
565
+        this.editApartment(
566
+          JSON.stringify({
567
+            ...this.aparmentInfo,
568
+            img: imgs
569
+          })
570
+        ).then(() => {
571
+          this.getAparmentList();
572
+          this.showHx = false;
573
+          this.$message({
574
+            message: "保存成功!",
575
+            type: "success"
576
+          });
577
+        });
533 578
       }
534 579
     },
535
-    addHx () {
536
-      this.aparmentImg = []
537
-      this.aparmentInfo = {buildingId: this.building.buildingId}
538
-      this.showHx = true
580
+    addHx() {
581
+      this.aparmentImg = [];
582
+      this.aparmentInfo = { buildingId: this.building.buildingId };
583
+      this.showHx = true;
539 584
     },
540
-    getAparmentList () {
541
-      this.getApartments({buildingId: this.$route.query.id}).then(data => {
542
-        this.aparments = data
543
-      })
585
+    getAparmentList() {
586
+      this.getApartments({ buildingId: this.$route.query.id }).then(data => {
587
+        this.aparments = data;
588
+      });
544 589
     },
545
-    handleEdit (row) {
546
-      this.aparmentImg = []
590
+    handleEdit(row) {
591
+      this.aparmentImg = [];
547 592
       this.getApartmentDetail({
548 593
         id: row.apartmentId
549 594
       }).then(data => {
550
-        console.log("...",data)
595
+        console.log("...", data);
551 596
         this.aparmentImg = data.buildingImgList.map(x => {
552 597
           return {
553 598
             name: x.imgId,
554 599
             url: x.url
555
-          }
556
-        })
557
-        this.aparmentInfo = data
558
-        this.showHx = true
559
-      })
600
+          };
601
+        });
602
+        this.aparmentInfo = data;
603
+        this.showHx = true;
604
+      });
560 605
     },
561
-    handleDel (row) {
562
-      this.$confirm('确认删除此数据?', '提示', {
563
-        confirmButtonText: '确定',
564
-        cancelButtonText: '取消',
565
-        type: 'warning'
606
+    handleDel(row) {
607
+      this.$confirm("确认删除此数据?", "提示", {
608
+        confirmButtonText: "确定",
609
+        cancelButtonText: "取消",
610
+        type: "warning"
566 611
       }).then(() => {
567 612
         if (this.building.status === 1) {
568
-          this.$message.error('当前楼盘处于发布状态,不允许删除!')
569
-          return false
613
+          this.$message.error("当前楼盘处于发布状态,不允许删除!");
614
+          return false;
570 615
         }
571 616
         this.deleteApartment({
572 617
           id: row.apartmentId
573 618
         }).then(() => {
574
-          this.getAparmentList()
575
-        })
576
-      })
619
+          this.getAparmentList();
620
+        });
621
+      });
577 622
     },
578
-    initData () {
579
-      if ((this.$route.query.id || '') !== '') {
580
-        this.getAparmentList()
581
-        this.getDetail({id: this.$route.query.id}).then(data => {
582
-          this.buildingProperty = data.propertyType.split(',')
623
+    initData() {
624
+      this.getCityName();
625
+
626
+      if ((this.$route.query.id || "") !== "") {
627
+        this.getAparmentList();
628
+        this.getDetail({ id: this.$route.query.id }).then(data => {
629
+          this.buildingProperty = data.propertyType.split(",");
583 630
           this.imgList = data.buildingImg.map(x => {
584 631
             return {
585 632
               name: x.imgId,
586 633
               url: x.url
587
-            }
588
-          })
589
-          this.tags = data.buildingTag.map(x => x.tagName)
590
-        })
634
+            };
635
+          });
636
+          this.tags = data.buildingTag.map(x => x.tagName);
637
+        });
591 638
       }
592 639
     }
593 640
   },
594
-  mounted () {
595
-    this.initData()
641
+  mounted() {
642
+    this.initData();
596 643
   }
597
-}
644
+};
598 645
 </script>
599 646
 
600 647
 <style lang="scss" scoped>
@@ -606,10 +653,10 @@ export default {
606 653
 
607 654
 
608 655
 <style lang="scss">
609
-.header{
656
+.header {
610 657
   width: 50px;
611 658
   height: 50px;
612
-  img{
659
+  img {
613 660
     width: 100%;
614 661
     height: 100%;
615 662
   }
@@ -622,7 +669,7 @@ export default {
622 669
   overflow: hidden;
623 670
 }
624 671
 .avatar-uploader .el-upload:hover {
625
-  border-color: #409EFF;
672
+  border-color: #409eff;
626 673
 }
627 674
 .avatar-uploader-icon {
628 675
   font-size: 28px;
@@ -638,19 +685,23 @@ export default {
638 685
   display: block;
639 686
 }
640 687
 
641
-.flex-item .amap-demo{
688
+.flex-item .amap-demo {
642 689
   height: 300px;
643 690
 }
644 691
 
645
-.el-select{
692
+.el-form-item__content {
693
+  overflow-y: hidden;
694
+  
695
+}
696
+.el-select {
646 697
   width: 100% !important;
647 698
 }
648 699
 
649
-.el-select-dropdown{
700
+.el-select-dropdown {
650 701
   z-index: 10003 !important;
651 702
 }
652 703
 
653
-.el-date-picker{
704
+.el-date-picker {
654 705
   z-index: 10002 !important;
655 706
 }
656 707
 </style>

+ 1
- 1
src/views/customer/customerDetails.vue Visa fil

@@ -150,7 +150,7 @@ export default {
150 150
 
151 151
 <style lang="scss" scoped>
152 152
 .detail-box {
153
-  .access-records{
153
+  .access-records {
154 154
     border: 1px solid #dcdcdc;
155 155
     border-radius: 5px;
156 156
     padding: 12px 15px;

+ 48
- 0
src/views/index.js Visa fil

@@ -9,6 +9,54 @@ const pages = [
9 9
       title: 'Dashboard',
10 10
     }
11 11
   },
12
+  {
13
+    path: 'indexEcharts',
14
+    name: 'indexEcharts',
15
+    redirect: 'indexEcharts/index',
16
+    component: () => import('./index.vue'),
17
+    meta: {
18
+      menuShow: true,
19
+      title: '首页',
20
+    },
21
+    children:[
22
+      {
23
+        path: 'indexEcharts',
24
+        name: 'indexEcharts',
25
+        component: () => import('./indexEcharts/index.vue'),
26
+        meta: {
27
+          menuShow: false,
28
+          // title: '首页',
29
+        },
30
+      },
31
+      {
32
+        path: 'newUsers',
33
+        name: 'newUsers',
34
+        component: () => import('./indexEcharts/newUsers.vue'),
35
+        meta: {
36
+          menuShow: false,
37
+          title: '新增用户',
38
+        },
39
+      },
40
+      {
41
+        path: 'userSource',
42
+        name: 'userSource',
43
+        component: () => import('./indexEcharts/userSource.vue'),
44
+        meta: {
45
+          menuShow: false,
46
+          title: '用户来源',
47
+        },
48
+      },
49
+      {
50
+        path: 'behaviorAnalysis',
51
+        name: 'behaviorAnalysis',
52
+        component: () => import('./indexEcharts/behaviorAnalysis.vue'),
53
+        meta: {
54
+          menuShow: false,
55
+          title: '行为分析',
56
+        },
57
+      },
58
+    ]
59
+  },
12 60
   {
13 61
     path: 'consultant',
14 62
     name: 'consultant',

+ 216
- 0
src/views/indexEcharts/behaviorAnalysis.vue Visa fil

@@ -0,0 +1,216 @@
1
+<template>
2
+<div>
3
+  <div class="system-table-search">
4
+      <div>
5
+        <ul>
6
+          <li>
7
+            <span>用户事件</span>
8
+            <el-select v-model="form.verifyStatus" placeholder="请选择">
9
+              <el-option v-for="(item,i) in gridData || []" :key="i" :label="item.name" :value="item.value"></el-option>
10
+            </el-select>
11
+          </li>
12
+          <li>
13
+            <el-select v-model="form.verifyStatus" placeholder="请选择">
14
+              <el-option v-for="(item,i) in gridData || []" :key="i" :label="item.name" :value="item.value"></el-option>
15
+            </el-select>
16
+          </li>
17
+          <li>
18
+            <span>属性</span>
19
+            <el-select v-model="form.verifyStatus" placeholder="请选择">
20
+              <el-option v-for="(item,i) in gridData || []" :key="i" :label="item.name" :value="item.value"></el-option>
21
+            </el-select>
22
+          </li>
23
+        </ul>
24
+      </div>
25
+    </div>
26
+  <p>用户行为 最近一个月 
27
+    <el-date-picker
28
+      v-model="value"
29
+      type="daterange"
30
+      start-placeholder="开始日期"
31
+      end-placeholder="结束日期"
32
+      default-value="2019-08-08">
33
+    </el-date-picker>
34
+    <el-button class="btn" size="mini"  type="primary" @click="search">查询</el-button>
35
+  </p>
36
+  
37
+  <div class="grid-content" ref="thirdChart"  id="thirdChart"  :style="{ height: '500px',margin:'20px 0',border:'1px solid #eee', padding:'20px',borderRadius:'5px'}" ></div>
38
+   <el-table :data="tableData2"  border  center  style="width: 100%">
39
+    <el-table-column label="用户姓名" prop="name"></el-table-column>
40
+    <el-table-column label="手机号" prop="phone"></el-table-column>
41
+    <el-table-column label="意向楼盘" prop="building"></el-table-column>
42
+    <el-table-column label="意向值" prop="num"></el-table-column>
43
+  </el-table>
44
+
45
+</div>
46
+</template>
47
+
48
+<script>
49
+import { createNamespacedHelpers } from "vuex";
50
+import apis from "../../config/api";
51
+import { mapState } from "vuex";
52
+import Echarts from "echarts";
53
+
54
+export default {
55
+  components: {},
56
+  data() {
57
+    return {
58
+      form: {
59
+        verifyStatus: ""
60
+      },
61
+      gridData: [
62
+        {
63
+          name: "未通过",
64
+          value: "0"
65
+        },
66
+        {
67
+          name: "已通过",
68
+          value: "1"
69
+        },
70
+        {
71
+          name: "已驳回",
72
+          value: "2"
73
+        }
74
+      ],
75
+      value: "",
76
+      tableData2: [
77
+        {
78
+          num: "98",
79
+          name: "王晓红",
80
+          phone: "15742389456",
81
+          building: "香颂.蔚澜半岛"
82
+        },
83
+        {
84
+          num: "99",
85
+          name: "王晓红2",
86
+          phone: "15742389456",
87
+          building: "香颂.蔚澜半岛"
88
+        },
89
+        {
90
+          num: "88",
91
+          name: "王晓红3",
92
+          phone: "15742389456",
93
+          building: "香颂.蔚澜半岛"
94
+        },
95
+        {
96
+          num: "94",
97
+          name: "王晓红4",
98
+          phone: "15742389456",
99
+          building: "香颂.蔚澜半岛"
100
+        }
101
+      ]
102
+    };
103
+  },
104
+  computed: {},
105
+  methods: {
106
+    search() {},
107
+    drawLine() {
108
+      // 折线图
109
+      let thirdChart = Echarts.init(this.$refs.thirdChart);
110
+      // 绘制图表
111
+      thirdChart.setOption({
112
+        title: {
113
+          text: "访问人数"
114
+        },
115
+        color: ["#000", "green", "#5793f3", "#d14a61", "#241bba", "orange"],
116
+        tooltip: {
117
+          trigger: "axis"
118
+        },
119
+        legend: {
120
+          data: ["首页", "项目", "咨询", "名片", "活动", "资讯"]
121
+        },
122
+        grid: {
123
+          left: "3%",
124
+          right: "4%",
125
+          bottom: "3%",
126
+          containLabel: true
127
+        },
128
+        toolbox: {},
129
+        xAxis: {
130
+          type: "category",
131
+          boundaryGap: false,
132
+          data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
133
+        },
134
+        yAxis: {
135
+          type: "value"
136
+        },
137
+        series: [
138
+          {
139
+            name: "首页",
140
+            type: "line",
141
+            stack: "1",
142
+            data: [120, 132, 101, 134, 90, 230, 210]
143
+          },
144
+          {
145
+            name: "项目",
146
+            type: "line",
147
+            stack: "2",
148
+            data: [220, 182, 191, 234, 290, 330, 310]
149
+          },
150
+          {
151
+            name: "咨询",
152
+            type: "line",
153
+            stack: "3",
154
+            data: [150, 232, 201, 154, 190, 330, 410]
155
+          },
156
+          {
157
+            name: "名片",
158
+            type: "line",
159
+            stack: "4",
160
+            data: [320, 332, 301, 334, 390, 330, 320]
161
+          },
162
+          {
163
+            name: "活动",
164
+            type: "line",
165
+            stack: "5",
166
+            data: [820, 932, 901, 544, 1290, 1330, 1320]
167
+          },
168
+          {
169
+            name: "资讯",
170
+            type: "line",
171
+            stack: "6",
172
+            data: [400, 500, 201, 934, 1290, 1423, 777]
173
+          }
174
+        ]
175
+      });
176
+    }
177
+  },
178
+  mounted() {
179
+    this.drawLine();
180
+  }
181
+};
182
+</script>
183
+
184
+<style lang="scss" scoped>
185
+p {
186
+  margin: 0;
187
+}
188
+.system-table-search {
189
+  display: block;
190
+  margin: 16px auto 0;
191
+  height: 60px;
192
+  width: 100%;
193
+}
194
+
195
+.system-table-search ul > li {
196
+  margin-right: 20px;
197
+  display: flex;
198
+  float: left;
199
+  align-items: center;
200
+  margin-bottom: 10px;
201
+  span {
202
+    margin-right: 10px;
203
+  }
204
+}
205
+
206
+.system-table-search ul {
207
+  font-size: 15px;
208
+  white-space: nowrap;
209
+  padding: 0;
210
+}
211
+.btn {
212
+  margin-left: 60px;
213
+}
214
+</style>
215
+
216
+

+ 585
- 0
src/views/indexEcharts/index.vue Visa fil

@@ -0,0 +1,585 @@
1
+<template>
2
+<div>
3
+  <el-row class="top-info"  :gutter="20">
4
+    <el-col :span="8">
5
+      <div class="grid-content">
6
+        <p>{{echartsInfo.selectUserCount}}</p>
7
+        <span>总用户</span>
8
+      </div>
9
+    </el-col>
10
+    <el-col :span="8">
11
+      <div class="grid-content">
12
+        <p>{{echartsInfo.selectRegisteredCount}}</p>
13
+        <span>总注册用户</span>
14
+      </div>
15
+    </el-col>
16
+    <el-col :span="8">
17
+      <div @click="toNewUsers()" class="grid-content">
18
+        <p class="under-line">{{echartsInfo.selectRecentlyCount}}</p>
19
+        <span class="under-line">最近7天新增</span>
20
+      </div>
21
+    </el-col>
22
+  </el-row>
23
+  <p class="title under-line" @click="toUserSource()">用户来源</p>
24
+  <span class="title-desc under-line" @click="toUserSource()">最近7天</span>
25
+  <el-row :gutter="20" :style="{ height: '560px',margin:'20px 0',border:'1px solid #eee',borderRadius:'5px'}">
26
+    <el-col :span="14">
27
+      <div class="grid-content" ref="firstChart"  id="firstChart"  :style="{ height: '500px' ,padding:'20px 10px'}" >
28
+      </div>
29
+    </el-col>
30
+    <el-col :span="10" :style="{ height: '560px',borderLeft:'1px solid #eee'}">
31
+      <div class="grid-content" ref="secondChart"  id="secondChart"  :style="{ height: '500px',padding:'20px 10px'}" >
32
+      </div>
33
+    </el-col>
34
+  </el-row>
35
+  <p class="title under-line" @click="toBehaviorAnalysis()">用户行为</p>
36
+  <span class="title-desc under-line" @click="toBehaviorAnalysis()">最近7天</span>
37
+  <div class="grid-content" ref="thirdChart"  id="thirdChart"  :style="{ height: '500px',margin:'20px 0',border:'1px solid #eee', padding:'20px',borderRadius:'5px'}" ></div>
38
+  <el-row :gutter="20">
39
+    <el-col :span="12">
40
+      <div class="grid-content" ref="fourthChart"  id="fourthChart"  :style="{ height: '500px',margin:'20px 0',border:'1px solid #eee', padding:'20px',borderRadius:'5px'}" >
41
+      </div>
42
+    </el-col>
43
+    <el-col :span="12">
44
+      <div class="grid-content" ref="fifthChart"  id="fifthChart"  :style="{ height: '500px',margin:'20px 0',border:'1px solid #eee', padding:'20px',borderRadius:'5px'}" >
45
+      </div>
46
+    </el-col>
47
+    <el-col :span="12">
48
+      <div class="grid-content" ref="sixthChart"  id="sixthChart" :style="{ height: '500px',margin:'20px 0',border:'1px solid #eee', padding:'20px',borderRadius:'5px'}" >
49
+      </div>
50
+    </el-col>
51
+    <el-col :span="12">
52
+      <div class="grid-content" ref="seventhChart"  id="seventhChart" :style="{ height: '500px',margin:'20px 0',border:'1px solid #eee', padding:'20px',borderRadius:'5px'}" >
53
+      </div>
54
+    </el-col>
55
+  </el-row>
56
+  <p class="title under-line" @click="toNewUsers()">新增用户</p>
57
+  <span class="title-desc under-line" @click="toNewUsers()">最近7天</span>
58
+  <el-table :data="tableData"  border  center  style="width: 100%">
59
+    <el-table-column label=date prop="name" ></el-table-column>
60
+  </el-table>
61
+  <p class="title">意向客户</p>
62
+  <el-table :data="tableData2"  border  center  style="width: 100%">
63
+    <el-table-column label="用户姓名" prop="name"></el-table-column>
64
+    <el-table-column label="手机号" prop="phone"></el-table-column>
65
+    <el-table-column label="意向楼盘" prop="building"></el-table-column>
66
+    <el-table-column label="意向值" prop="num"></el-table-column>
67
+  </el-table>
68
+</div>
69
+</template>
70
+
71
+<script>
72
+import { createNamespacedHelpers } from "vuex";
73
+import apis from "../../config/api";
74
+import { mapState } from "vuex";
75
+import Echarts from "echarts";
76
+const {
77
+  mapState: mapIndexEchartsState,
78
+  mapActions: mapIndexEchartsActions
79
+} = createNamespacedHelpers("indexEcharts");
80
+
81
+export default {
82
+  components: {},
83
+  data() {
84
+    return {
85
+      tableData: [
86
+        {
87
+          date: "2016-05-02",
88
+          name: "15"
89
+        },
90
+        {
91
+          date: "2016-05-04",
92
+          name: "16"
93
+        },
94
+        {
95
+          date: "2016-05-01",
96
+          name: "17"
97
+        },
98
+        {
99
+          date: "2016-05-03",
100
+          name: "18"
101
+        }
102
+      ],
103
+      tableData2: [
104
+        {
105
+          num: "98",
106
+          name: "王晓红",
107
+          phone: "15742389456",
108
+          building: "香颂.蔚澜半岛"
109
+        },
110
+        {
111
+          num: "99",
112
+          name: "王晓红2",
113
+          phone: "15742389456",
114
+          building: "香颂.蔚澜半岛"
115
+        },
116
+        {
117
+          num: "88",
118
+          name: "王晓红3",
119
+          phone: "15742389456",
120
+          building: "香颂.蔚澜半岛"
121
+        },
122
+        {
123
+          num: "94",
124
+          name: "王晓红4",
125
+          phone: "15742389456",
126
+          building: "香颂.蔚澜半岛"
127
+        }
128
+      ],
129
+      userBehavior: [] // 用户行为
130
+    };
131
+  },
132
+  computed: {
133
+    ...mapIndexEchartsState({
134
+      echartsInfo: x => x.echartsInfo
135
+    })
136
+  },
137
+  methods: {
138
+    ...mapIndexEchartsActions(["getIndexEcharts", "setDetailNull"]),
139
+    initPage() {
140
+      this.setDetailNull();
141
+      this.getIndexEcharts();
142
+    },
143
+    toNewUsers() {
144
+      this.$router.push({ name: "newUsers" });
145
+    },
146
+    toUserSource() {
147
+      this.$router.push({ name: "userSource" });
148
+    },
149
+    toBehaviorAnalysis() {
150
+      this.$router.push({ name: "behaviorAnalysis" });
151
+    },
152
+    drawLine() {
153
+      // 基于准备好的dom,初始化echarts实例
154
+      let firstChart = Echarts.init(this.$refs.firstChart);
155
+      let labelOption = {
156
+        normal: {
157
+          show: true,
158
+          position: "top",
159
+          fontSize: 15,
160
+          rich: {
161
+            name: {
162
+              textBorderColor: "#fff"
163
+            }
164
+          }
165
+        }
166
+      };
167
+      // 绘制图表
168
+      firstChart.setOption({
169
+        color: ["#ff580f", "#ffb400"],
170
+        backgroundColor: "#fff",
171
+        tooltip: {
172
+          trigger: "axis"
173
+        },
174
+        toolbox: {
175
+          show: false,
176
+          feature: {
177
+            mark: { show: true },
178
+            dataView: { show: true, readOnly: false },
179
+            magicType: { show: true, type: ["bar"] },
180
+            restore: { show: true },
181
+            saveAsImage: { show: true }
182
+          }
183
+        },
184
+        calculable: true,
185
+        legend: {
186
+          data: ["所有用户", "注册用户"]
187
+        },
188
+        xAxis: [
189
+          {
190
+            type: "category",
191
+            axisLabel: {
192
+              interval: 0,
193
+              formatter: function(val) {
194
+                // return val.split("").join("\n");
195
+                return val;
196
+              }
197
+            },
198
+            data: [
199
+              "生成海报",
200
+              "好友分享",
201
+              "群分享",
202
+              "线下扫码",
203
+              "名片分享",
204
+              "小程序搜索"
205
+            ]
206
+          }
207
+        ],
208
+        yAxis: [
209
+          {
210
+            type: "value",
211
+            name: "人数(人)",
212
+            axisTick: {
213
+              inside: true
214
+            },
215
+            axisLabel: {
216
+              formatter: "{value}"
217
+            }
218
+          }
219
+        ],
220
+        grid: {
221
+          left: "1%",
222
+          right: "1%",
223
+          containLabel: true,
224
+          y2: 10
225
+        },
226
+        series: [
227
+          {
228
+            name: "所有用户",
229
+            type: "bar",
230
+            smooth: true,
231
+            label: labelOption,
232
+            data: [78, 90, 13, 81, 170, 77]
233
+          },
234
+          {
235
+            name: "注册用户",
236
+            type: "bar",
237
+            smooth: true,
238
+            label: labelOption,
239
+            data: [26, 49, 62, 45, 21, 89]
240
+          }
241
+        ]
242
+      });
243
+      // 饼图
244
+      let secondChart = Echarts.init(this.$refs.secondChart);
245
+      // 绘制图表
246
+      secondChart.setOption({
247
+        tooltip: {
248
+          trigger: "item",
249
+          formatter: "{a} <br/>{b} : {c} ({d}%)"
250
+        },
251
+        legend: {
252
+          orient: "vertical",
253
+          left: "left",
254
+          data: ["自主进入", "来源全民经纪人", "来源置业顾问"]
255
+        },
256
+        series: [
257
+          {
258
+            name: "访问来源",
259
+            type: "pie",
260
+            radius: "55%",
261
+            center: ["50%", "60%"],
262
+            label: {
263
+              normal: {
264
+                position: "inner"
265
+              }
266
+            },
267
+            data: [
268
+              { value: 15, name: "自主进入" },
269
+              { value: 30, name: "来源全民经纪人" },
270
+              { value: 75, name: "来源置业顾问" }
271
+            ],
272
+            itemStyle: {
273
+              emphasis: {
274
+                shadowBlur: 10,
275
+                shadowOffsetX: 0,
276
+                shadowColor: "rgba(0, 0, 0, 0.5)"
277
+              }
278
+            }
279
+          }
280
+        ]
281
+      });
282
+      // 折线图
283
+      let thirdChart = Echarts.init(this.$refs.thirdChart);
284
+      // 绘制图表
285
+      thirdChart.setOption({
286
+        title: {
287
+          text: "访问人数"
288
+        },
289
+        color: ["#000", "green", "#5793f3", "#d14a61", "#241bba", "orange"],
290
+        tooltip: {
291
+          trigger: "axis"
292
+        },
293
+        legend: {
294
+          data: ["首页", "项目", "咨询", "名片", "活动", "资讯"]
295
+        },
296
+        grid: {
297
+          left: "3%",
298
+          right: "4%",
299
+          bottom: "3%",
300
+          containLabel: true
301
+        },
302
+        toolbox: {},
303
+        xAxis: {
304
+          type: "category",
305
+          boundaryGap: false,
306
+          data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
307
+        },
308
+        yAxis: {
309
+          type: "value"
310
+        },
311
+        series: [
312
+          {
313
+            name: "首页",
314
+            type: "line",
315
+            stack: "1",
316
+            data: []
317
+          },
318
+          {
319
+            name: "项目",
320
+            type: "line",
321
+            stack: "2",
322
+            data: [220, 182, 191, 234, 290, 330, 310]
323
+          },
324
+          {
325
+            name: "咨询",
326
+            type: "line",
327
+            stack: "3",
328
+            data: [150, 232, 201, 154, 190, 330, 410]
329
+          },
330
+          {
331
+            name: "名片",
332
+            type: "line",
333
+            stack: "4",
334
+            data: [320, 332, 301, 334, 390, 330, 320]
335
+          },
336
+          {
337
+            name: "活动",
338
+            type: "line",
339
+            stack: "5",
340
+            data: [820, 932, 901, 544, 1290, 1330, 1320]
341
+          },
342
+          {
343
+            name: "资讯",
344
+            type: "line",
345
+            stack: "6",
346
+            data: [400, 500, 201, 934, 1290, 1423, 777]
347
+          }
348
+        ]
349
+      });
350
+      // 柱状图
351
+      let fourthChart = Echarts.init(this.$refs.fourthChart);
352
+      // 绘制图表
353
+      let labelOption2 = {
354
+        normal: {
355
+          show: true,
356
+          position: "top",
357
+          fontSize: 15,
358
+          rich: {
359
+            name: {
360
+              textBorderColor: "#fff"
361
+            }
362
+          }
363
+        }
364
+      };
365
+      fourthChart.setOption({
366
+        title: {
367
+          text: "活跃用户数"
368
+        },
369
+        color: ["#3398DB"],
370
+        tooltip: {
371
+          trigger: "axis",
372
+          axisPointer: {
373
+            type: "shadow"
374
+          }
375
+        },
376
+        grid: {
377
+          left: "3%",
378
+          right: "4%",
379
+          bottom: "3%",
380
+          containLabel: true
381
+        },
382
+        xAxis: [
383
+          {
384
+            type: "category",
385
+            data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
386
+            axisTick: {
387
+              alignWithLabel: true
388
+            }
389
+          }
390
+        ],
391
+        yAxis: [
392
+          {
393
+            type: "value"
394
+          }
395
+        ],
396
+        series: [
397
+          {
398
+            name: "直接访问",
399
+            type: "bar",
400
+            barWidth: "60%",
401
+            label: labelOption2,
402
+            data: [10, 52, 200, 334, 390, 330, 220]
403
+          }
404
+        ]
405
+      });
406
+      // 环形图
407
+      let fifthChart = Echarts.init(this.$refs.fifthChart);
408
+      // 绘制图表
409
+      fifthChart.setOption({
410
+        title: {
411
+          text: "转化率"
412
+        },
413
+        tooltip: {
414
+          trigger: "item",
415
+          formatter: "{a} <br/>{b}: {c} ({d}%)"
416
+        },
417
+        legend: {
418
+          orient: "vertical",
419
+          x: "right",
420
+          data: ["收藏楼盘", "查看楼盘"]
421
+        },
422
+        series: [
423
+          {
424
+            name: "访问来源",
425
+            type: "pie",
426
+            radius: ["50%", "70%"],
427
+            avoidLabelOverlap: false,
428
+            label: {
429
+              normal: {
430
+                show: false,
431
+                position: "center"
432
+              },
433
+              emphasis: {
434
+                show: true,
435
+                textStyle: {
436
+                  fontSize: "30",
437
+                  fontWeight: "bold"
438
+                }
439
+              }
440
+            },
441
+            data: [
442
+              { value: 335, name: "收藏楼盘" },
443
+              { value: 310, name: "查看楼盘" }
444
+            ]
445
+          }
446
+        ]
447
+      });
448
+      // 环形图
449
+      let sixthChart = Echarts.init(this.$refs.sixthChart);
450
+      // 绘制图表
451
+      sixthChart.setOption({
452
+        title: {
453
+          text: "性别比例"
454
+        },
455
+        tooltip: {
456
+          trigger: "item",
457
+          formatter: "{a} <br/>{b}: {c} ({d}%)"
458
+        },
459
+        legend: {
460
+          orient: "vertical",
461
+          x: "right",
462
+          data: ["男", "女"]
463
+        },
464
+        series: [
465
+          {
466
+            name: "访问来源",
467
+            type: "pie",
468
+            radius: ["50%", "70%"],
469
+            avoidLabelOverlap: false,
470
+            label: {
471
+              normal: {
472
+                show: false,
473
+                position: "center"
474
+              },
475
+              emphasis: {
476
+                show: true,
477
+                textStyle: {
478
+                  fontSize: "30",
479
+                  fontWeight: "bold"
480
+                }
481
+              }
482
+            },
483
+            labelLine: {
484
+              normal: {
485
+                show: false
486
+              }
487
+            },
488
+            data: [{ value: 335, name: "男" }, { value: 310, name: "女" }]
489
+          }
490
+        ]
491
+      });
492
+      // 饼图
493
+      let seventhChart = Echarts.init(this.$refs.seventhChart);
494
+      // 绘制图表
495
+      seventhChart.setOption({
496
+        title: {
497
+          text: "城市分布"
498
+        },
499
+        tooltip: {
500
+          trigger: "item",
501
+          formatter: "{a} <br/>{b} : {c} ({d}%)"
502
+        },
503
+        legend: {
504
+          orient: "vertical",
505
+          left: "right",
506
+          data: ["合肥", "南京", "南通"]
507
+        },
508
+        series: [
509
+          {
510
+            name: "访问来源",
511
+            type: "pie",
512
+            radius: "55%",
513
+            center: ["50%", "60%"],
514
+            label: {
515
+              normal: {
516
+                position: "inner"
517
+              }
518
+            },
519
+            data: [
520
+              { value: 21, name: "合肥" },
521
+              { value: 90, name: "南京" },
522
+              { value: 47, name: "南通" }
523
+            ],
524
+            itemStyle: {
525
+              emphasis: {
526
+                shadowBlur: 10,
527
+                shadowOffsetX: 0,
528
+                shadowColor: "rgba(0, 0, 0, 0.5)"
529
+              }
530
+            }
531
+          }
532
+        ]
533
+      });
534
+    }
535
+  },
536
+  mounted() {
537
+    if (this.echartsInfo) {
538
+      this.drawLine();
539
+      // for (var i = 0; i < this.echartsInfo.selectUserBehavior.length; i++) {
540
+      //   this.members.push(this.echartsInfo.selectUserBehavior[i].members);
541
+      // }
542
+    }
543
+    this.drawLine();
544
+  }
545
+};
546
+</script>
547
+
548
+<style lang="scss" scoped>
549
+p {
550
+  margin: 0;
551
+}
552
+.top-info {
553
+  margin: 20px 0;
554
+  .grid-content {
555
+    background-color: #044281;
556
+    text-align: center;
557
+    color: #fff;
558
+    padding: 26px 0;
559
+    border-radius: 4px;
560
+    p {
561
+      font-size: 24px;
562
+      margin: 0;
563
+      line-height: 40px;
564
+    }
565
+    span {
566
+      font-size: 16px;
567
+    }
568
+  }
569
+}
570
+.title {
571
+  line-height: 40px;
572
+  font-size: 22px;
573
+  font-weight: 600;
574
+}
575
+.title-desc {
576
+  font-size: 16px;
577
+  color: #888;
578
+  margin-bottom: 6px;
579
+}
580
+.under-line {
581
+  text-decoration: underline;
582
+}
583
+</style>
584
+
585
+

+ 123
- 0
src/views/indexEcharts/newUsers.vue Visa fil

@@ -0,0 +1,123 @@
1
+<template>
2
+<div>
3
+
4
+  <p class="title">用户行为 最近一个月 
5
+    <el-date-picker
6
+      v-model="value"
7
+      type="daterange"
8
+      start-placeholder="开始日期"
9
+      end-placeholder="结束日期"
10
+      default-value="2019-08-08">
11
+    </el-date-picker></p>
12
+  <div class="grid-content" ref="thirdChart"  id="thirdChart"  :style="{ height: '500px',margin:'20px 0',border:'1px solid #eee', padding:'20px',borderRadius:'5px'}" ></div>
13
+   <el-table :data="tableData2"  border  center  style="width: 100%">
14
+    <el-table-column label="用户姓名" prop="name"></el-table-column>
15
+    <el-table-column label="手机号" prop="phone"></el-table-column>
16
+    <el-table-column label="意向楼盘" prop="building"></el-table-column>
17
+    <el-table-column label="意向值" prop="num"></el-table-column>
18
+  </el-table>
19
+
20
+</div>
21
+</template>
22
+
23
+<script>
24
+import { createNamespacedHelpers } from "vuex";
25
+import apis from "../../config/api";
26
+import { mapState } from "vuex";
27
+import Echarts from "echarts";
28
+
29
+export default {
30
+  components: {},
31
+  data() {
32
+    return {
33
+      value: '',
34
+       tableData2: [
35
+        {
36
+          num: "98",
37
+          name: "王晓红",
38
+          phone: "15742389456",
39
+          building: "香颂.蔚澜半岛"
40
+        },
41
+        {
42
+          num: "99",
43
+          name: "王晓红2",
44
+          phone: "15742389456",
45
+          building: "香颂.蔚澜半岛"
46
+        },
47
+        {
48
+          num: "88",
49
+          name: "王晓红3",
50
+          phone: "15742389456",
51
+          building: "香颂.蔚澜半岛"
52
+        },
53
+        {
54
+          num: "94",
55
+          name: "王晓红4",
56
+          phone: "15742389456",
57
+          building: "香颂.蔚澜半岛"
58
+        }
59
+      ]
60
+    };
61
+  },
62
+  computed: {},
63
+  methods: {
64
+    drawLine() {
65
+      // 折线图
66
+      let thirdChart = Echarts.init(this.$refs.thirdChart);
67
+      // 绘制图表
68
+      thirdChart.setOption({
69
+        title: {
70
+          text: "新增用户"
71
+        },
72
+        color: ["purple", "green"],
73
+        tooltip: {
74
+          trigger: "axis"
75
+        },
76
+        legend: {
77
+          data: ["新用户数", "授权注册"]
78
+        },
79
+        grid: {
80
+          left: "3%",
81
+          right: "4%",
82
+          bottom: "3%",
83
+          containLabel: true
84
+        },
85
+        toolbox: {},
86
+        xAxis: {
87
+          type: "category",
88
+          boundaryGap: false,
89
+          data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
90
+        },
91
+        yAxis: {
92
+          type: "value"
93
+        },
94
+        series: [
95
+          {
96
+            name: "新用户数",
97
+            type: "line",
98
+            stack: "1",
99
+            data: [120, 132, 101, 134, 90, 230, 210]
100
+          },
101
+          {
102
+            name: "授权注册",
103
+            type: "line",
104
+            stack: "2",
105
+            data: [220, 182, 191, 234, 290, 330, 310]
106
+          },
107
+        ]
108
+      });
109
+    }
110
+  },
111
+  mounted() {
112
+    this.drawLine();
113
+  }
114
+};
115
+</script>
116
+
117
+<style lang="scss" scoped>
118
+p {
119
+  margin: 0;
120
+}
121
+</style>
122
+
123
+

+ 232
- 0
src/views/indexEcharts/userSource.vue Visa fil

@@ -0,0 +1,232 @@
1
+<template>
2
+<div>
3
+  <p class="title">用户行为 最近2个月 
4
+    <el-date-picker
5
+      v-model="value"
6
+      type="daterange"
7
+      start-placeholder="开始日期"
8
+      end-placeholder="结束日期"
9
+      default-value="2019-08-08">
10
+    </el-date-picker></p>
11
+  <el-row :gutter="20" :style="{ height: '560px',margin:'20px 0',border:'1px solid #eee',borderRadius:'5px'}">
12
+    <el-col :span="14">
13
+      <div class="grid-content" ref="firstChart"  id="firstChart"  :style="{ height: '500px' ,padding:'20px 10px'}" >
14
+      </div>
15
+    </el-col>
16
+    <el-col :span="10" :style="{ height: '560px',borderLeft:'1px solid #eee'}">
17
+      <div class="grid-content" ref="secondChart"  id="secondChart"  :style="{ height: '500px',padding:'20px 10px'}" >
18
+      </div>
19
+    </el-col>
20
+  </el-row>
21
+  <el-select  :style="{ margin:'10px 0'}"  v-model="value2" placeholder="请选择">
22
+    <el-option
23
+      v-for="item in options"
24
+      :key="item.value"
25
+      :label="item.label"
26
+      :value="item.value">
27
+    </el-option>
28
+  </el-select>
29
+   <el-table :data="tableData2"  border  center  style="width: 100%">
30
+    <el-table-column label="用户姓名" prop="name"></el-table-column>
31
+    <el-table-column label="手机号" prop="phone"></el-table-column>
32
+    <el-table-column label="意向楼盘" prop="building"></el-table-column>
33
+    <el-table-column label="意向值" prop="num"></el-table-column>
34
+  </el-table>
35
+
36
+</div>
37
+</template>
38
+
39
+<script>
40
+import { createNamespacedHelpers } from "vuex";
41
+import apis from "../../config/api";
42
+import { mapState } from "vuex";
43
+import Echarts from "echarts";
44
+
45
+export default {
46
+  components: {},
47
+  data() {
48
+    return {
49
+      value: '',
50
+       tableData2: [
51
+        {
52
+          num: "98",
53
+          name: "王晓红",
54
+          phone: "15742389456",
55
+          building: "香颂.蔚澜半岛"
56
+        },
57
+        {
58
+          num: "99",
59
+          name: "王晓红2",
60
+          phone: "15742389456",
61
+          building: "香颂.蔚澜半岛"
62
+        },
63
+        {
64
+          num: "88",
65
+          name: "王晓红3",
66
+          phone: "15742389456",
67
+          building: "香颂.蔚澜半岛"
68
+        },
69
+        {
70
+          num: "94",
71
+          name: "王晓红4",
72
+          phone: "15742389456",
73
+          building: "香颂.蔚澜半岛"
74
+        }
75
+      ],
76
+      options: [{
77
+          value: '选项1',
78
+          label: '所有用户'
79
+        }, {
80
+          value: '选项2',
81
+          label: '注册用户'
82
+        }],
83
+        value2: ''
84
+    };
85
+  },
86
+  computed: {},
87
+  methods: {
88
+    drawLine() {
89
+      // 基于准备好的dom,初始化echarts实例
90
+      let firstChart = Echarts.init(this.$refs.firstChart);
91
+      let labelOption = {
92
+        normal: {
93
+          show: true,
94
+          position: "top",
95
+          fontSize: 15,
96
+          rich: {
97
+            name: {
98
+              textBorderColor: "#fff"
99
+            }
100
+          }
101
+        }
102
+      };
103
+      // 绘制图表
104
+      firstChart.setOption({
105
+        color: ["#ff580f", "#ffb400"],
106
+        backgroundColor: "#fff",
107
+        tooltip: {
108
+          trigger: "axis"
109
+        },
110
+        toolbox: {
111
+          show: false,
112
+          feature: {
113
+            mark: { show: true },
114
+            dataView: { show: true, readOnly: false },
115
+            magicType: { show: true, type: ["bar"] },
116
+            restore: { show: true },
117
+            saveAsImage: { show: true }
118
+          }
119
+        },
120
+        calculable: true,
121
+        legend: {
122
+          data: ["所有用户", "注册用户"]
123
+        },
124
+        xAxis: [
125
+          {
126
+            type: "category",
127
+            axisLabel: {
128
+              interval: 0,
129
+              formatter: function(val) {
130
+                // return val.split("").join("\n");
131
+                return val;
132
+              }
133
+            },
134
+            data: [
135
+              "生成海报",
136
+              "好友分享",
137
+              "群分享",
138
+              "线下扫码",
139
+              "名片分享",
140
+              "小程序搜索"
141
+            ]
142
+          }
143
+        ],
144
+        yAxis: [
145
+          {
146
+            type: "value",
147
+            name: "人数(人)",
148
+            axisTick: {
149
+              inside: true
150
+            },
151
+            axisLabel: {
152
+              formatter: "{value}"
153
+            }
154
+          }
155
+        ],
156
+        grid: {
157
+          left: "1%",
158
+          right: "1%",
159
+          containLabel: true,
160
+          y2: 10
161
+        },
162
+        series: [
163
+          {
164
+            name: "所有用户",
165
+            type: "bar",
166
+            smooth: true,
167
+            label: labelOption,
168
+            data: [78, 90, 13, 81, 170, 77]
169
+          },
170
+          {
171
+            name: "注册用户",
172
+            type: "bar",
173
+            smooth: true,
174
+            label: labelOption,
175
+            data: [26, 49, 62, 45, 21, 89]
176
+          }
177
+        ]
178
+      });
179
+      // 饼图
180
+      let secondChart = Echarts.init(this.$refs.secondChart);
181
+      // 绘制图表
182
+      secondChart.setOption({
183
+        tooltip: {
184
+          trigger: "item",
185
+          formatter: "{a} <br/>{b} : {c} ({d}%)"
186
+        },
187
+        legend: {
188
+          orient: "vertical",
189
+          left: "left",
190
+          data: ["自主进入", "来源全民经纪人", "来源置业顾问"]
191
+        },
192
+        series: [
193
+          {
194
+            name: "访问来源",
195
+            type: "pie",
196
+            radius: "55%",
197
+            center: ["50%", "60%"],
198
+            label: {
199
+              normal: {
200
+                position: "inner"
201
+              }
202
+            },
203
+            data: [
204
+              { value: 15, name: "自主进入" },
205
+              { value: 30, name: "来源全民经纪人" },
206
+              { value: 75, name: "来源置业顾问" }
207
+            ],
208
+            itemStyle: {
209
+              emphasis: {
210
+                shadowBlur: 10,
211
+                shadowOffsetX: 0,
212
+                shadowColor: "rgba(0, 0, 0, 0.5)"
213
+              }
214
+            }
215
+          }
216
+        ]
217
+      });
218
+    }
219
+  },
220
+  mounted() {
221
+    this.drawLine();
222
+  }
223
+};
224
+</script>
225
+
226
+<style lang="scss" scoped>
227
+p {
228
+  margin: 0;
229
+}
230
+</style>
231
+
232
+

+ 2
- 2
vue.config.js Visa fil

@@ -4,8 +4,8 @@ module.exports = {
4 4
     port: 8080,
5 5
     proxy: {
6 6
       '/api': {
7
-        // target: 'http://192.168.0.238:8080',
8
-        target: 'http://localhost:8080',
7
+        target: 'http://192.168.0.131:8080',
8
+        // target: 'http://localhost:8080',
9 9
         changeOrigin: true,
10 10
         // pathRewrite: {
11 11
         //   '^/api': '/'