2 Commits 7c1fb36f48 ... 58af4b1ef3

Tác giả SHA1 Thông báo Ngày
  tom_glb 58af4b1ef3 Merge branch 'master' of http://git.cc-lotus.info/roose/MZbigScreen 4 năm trước cách đây
  tom_glb 52ac1a5561 yyl update 4 năm trước cách đây

+ 18 - 0
src/api/index.js

@@ -164,3 +164,21 @@ export const visitPerson = (params, requestMethod) => ajax(`${BASE_URL}/chart/vi
  * 今日探访(次)
  */
 export const visitNumDay = (params, requestMethod) => ajax(`${BASE_URL}/chart/visit/visitnumday`, params, requestMethod);
+
+/**
+ * ----------------------------------------------------------------------------------------------------------------------------------------
+ */
+
+/**
+ * 地区探访数据排行
+ */
+export const visitDeptPage = (params, requestMethod) => ajax(`${BASE_URL}/chart/visit/visitdeptpage`, params, requestMethod);
+
+/**
+ * 地区探访数据排行
+ */
+export const visitPersonPage = (params, requestMethod) => ajax(`${BASE_URL}/chart/visit/visitpersonpage`, params, requestMethod);
+
+
+
+export const selectDeptByName = (params, requestMethod) => ajax(`${BASE_URL}/chart/dept/selectDeptByName`, params, requestMethod);

+ 8 - 3
src/components/index/3.vue

@@ -20,7 +20,8 @@
             //     data: [{ label: '01月', value: 500 }, { label: '02月', value: 362 }, { label: '03月', value: 368 }, { label: '04月', value: 198 }, { label: '05月', value: 569 }, { label: '06月', value: 159 }]
             //   }
             // ],
-            colorArr: [ { lineColor: '#2796ff', areaColor: '#d7e6ff' }, { lineColor: '#ff8700', areaColor: '#fff3c6' } ]
+            colorArr: [ { lineColor: '#2796ff', areaColor: '#d7e6ff' }, { lineColor: '#ff8700', areaColor: '#fff3c6' } ],
+            myChart: null
           }
         },
         methods: {
@@ -49,8 +50,12 @@
               const barArr = new Array(valueArr2.length).fill(0);
               barArr[maxValueIndex] = yMaxValue;
 
-              let myChart = this.$echarts.init(document.getElementById('myChartindex3'));
-              myChart.setOption({
+              if(this.myChart != null) {
+                  this.myChart.clear();
+              }
+
+              this.myChart = this.$echarts.init(document.getElementById('myChartindex3'));
+              this.myChart.setOption({
                   grid:{
                       left:"12%",
                       right:"6%",

+ 3 - 0
src/components/index/jlMap.vue

@@ -33,6 +33,8 @@
         // this.$options.methods.mapChart();
         this.myChart.dispose();
         this.mapChart();
+
+        this.$parent.back();
       },
 
       // 配置渲染map
@@ -623,6 +625,7 @@
               }
             }
           }
+          this.$parent.mapClick(param.data.name);
         });
 
         //展示对应的省

+ 17 - 2
src/components/oldStatistics/4.vue

@@ -13,7 +13,7 @@
             dataArr: [],
             colorArr: [
               { color1: '#ff0900', color2: '#ff7367' },
-              { color1: '#4625FF', color2: '#6DC0FF' },
+              { color1: '#0083ff', color2: '#6DC0FF' },
               { color1: '#f6a314', color2: '#f4ff81' }
             ],
             myChart: null
@@ -27,7 +27,21 @@
                 const result = await oldPersonAbility({}, 'POST');
                 this.dataArr = result;
 
-                console.log(JSON.stringify(result))
+                const titleArr = [];
+                for(let i = 0; i < this.dataArr.length; i++) {
+                    const d = this.dataArr[i];
+                    titleArr.push({
+                        text: d.value,
+                        left: `72%`,
+                        top: `${ 12 + i * 33.3 }%`,
+                        textAlign: "center",
+                        textStyle: {
+                            fontSize: "14",
+                            fontWeight: 'normal',
+                            color: this.colorArr[i].color1
+                        }
+                    });
+                }
 
                 const seriesArr = [{
                     type: 'pictorialBar',
@@ -152,6 +166,7 @@
                 this.myChart = this.$echarts.init(document.getElementById('myChartold4'));
                 this.myChart.setOption(
                     {
+                        title: titleArr,
                         grid:{
                             right:"50%",
                         },

+ 4 - 0
src/components/oldStatistics/7.vue

@@ -76,6 +76,10 @@
                   });
               }
 
+              if(this.myChart != null) {
+                  this.myChart.clear();
+              }
+
               this.myChart = this.$echarts.init(document.getElementById('myChartold7'));
               this.myChart.setOption({
                   grid: {

+ 9 - 0
src/main.js

@@ -7,6 +7,7 @@ import 'echarts-liquidfill';
 import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
 import timeing from "./components/timeing";
+import storageUtil from './util/storageUtil'
 
 Vue.config.productionTip = false
 Vue.prototype.$echarts = echarts
@@ -14,6 +15,14 @@ Vue.use(ElementUI);
 Vue.component('timeing', timeing);
 import './font/font.css'
 
+router.beforeEach((to, from, next) => {
+    const path = to.path;
+    if (path == '/') {
+        storageUtil.save('dept-array', '');
+    }
+    next();
+});
+
 new Vue({
   router,
   store,

+ 35 - 76
src/pages/Home.vue

@@ -171,12 +171,14 @@
     import com4 from "../components/index/4.vue";
     import com5 from "../components/index/5.vue";
     import vueSeamlessScroll from "vue-seamless-scroll";
+    import storageUtil from '../util/storageUtil'
     import {
         selectUserByAuth,
         oldPersonSelectDeptValue,
         oldnum,
         visitnum,
-        visitNumDay
+        visitNumDay,
+        selectDeptByName
     } from "../api";
 
     export default {
@@ -263,81 +265,7 @@
                 mapdata1: [],
                 mapprodata: [],
                 data4: [],
-                mapDataArr: [],
-                mapDide: {
-                    //长春
-                    cc: [
-                        [125.35, 43.88],
-                        [125.35, 44.58],
-                        [126.35, 44.88],
-                        [125.85, 44.11],
-                        [125.85, 44.55]
-                    ],
-                    //四平
-                    sp: [
-                        [124.8, 43.47],
-                        [123.8, 43.77],
-                        [124.5, 43.87],
-                        [124.3, 43.47],
-                        [124.88, 43.77]
-                    ],
-                    // 辽源市
-                    ly: [
-                        [125.13, 42.88],
-                        [125.38, 42.9],
-                        [125.5, 43],
-                        [125.5, 42.6],
-                        [125.2, 42.6]
-                    ],
-                    // 吉林市
-                    jl: [
-                        [126.55, 43.83],
-                        [126.88, 43.99],
-                        [126.11, 43.11],
-                        [126.66, 43.33],
-                        [126.99, 43.66]
-                    ],
-                    //松原市
-                    sy: [
-                        [124.82, 45.11],
-                        [125.82, 45.11],
-                        [123.82, 44.66],
-                        [124.11, 44.33],
-                        [124.11, 45.11]
-                    ],
-                    // 白城市
-                    bc: [
-                        [122.84, 45.61],
-                        [123.33, 45.61],
-                        [122.84, 45.11],
-                        [123.33, 45.11],
-                        [122.66, 44.55]
-                    ],
-                    // //白山市
-                    bs: [
-                        [126.997839, 41.992505],
-                        [126.447839, 41.992505],
-                        [126.997839, 42.662505],
-                        [127.667839, 41.662505],
-                        [127.667839, 41.992505]
-                    ],
-                    // 通化市
-                    th: [
-                        [125.93, 41.73],
-                        [125.93, 41.11],
-                        [125.93, 42.11],
-                        [125.93, 42.55],
-                        [125.66, 42.11]
-                    ],
-                    // 延边朝鲜族自治州
-                    yb: [
-                        [129.5, 42.88],
-                        [128.5, 42.88],
-                        [128.5, 42.22],
-                        [128.5, 43.44],
-                        [129.5, 43.44]
-                    ]
-                }
+                mapDataArr: []
             };
         },
         mounted() {
@@ -356,6 +284,37 @@
             this.count5_method();
         },
         methods: {
+            async mapClick(deptName) {
+                storageUtil.save('dept-array', '');
+                const result = await selectDeptByName({ deptName }, 'POST');
+                storageUtil.save('dept-array', result.split('&'));
+
+                this.count1_method();
+                this.count2_method();
+                this.count3_method();
+                this.count4_method();
+                this.count5_method();
+
+                this.$refs.c1.draw();
+                this.$refs.c2.draw1();
+                this.$refs.c3.draw();
+                this.$refs.c4.draw1();
+                this.$refs.c5.draw();
+            },
+            back() {
+                storageUtil.save('dept-array', '');
+                this.count1_method();
+                this.count2_method();
+                this.count3_method();
+                this.count4_method();
+                this.count5_method();
+
+                this.$refs.c1.draw();
+                this.$refs.c2.draw1();
+                this.$refs.c3.draw();
+                this.$refs.c4.draw1();
+                this.$refs.c5.draw();
+            },
             async count1_method() {
                 const result = await oldnum({}, 'POST');
                 this.count1 = result.oldnum;

+ 104 - 171
src/pages/Ranking.vue

@@ -5,7 +5,7 @@
 
         <div class="select-div">
             <span class="address-title">省:</span>
-            <el-select class="input" v-model="dept1" clearable :popper-append-to-body="false" placeholder="请选择">
+            <el-select class="input" v-model="dept1" clearable :popper-append-to-body="false" placeholder="请选择" @change="provinceChange">
                 <el-option
                         v-for="item in provinces"
                         :key="item.value"
@@ -15,7 +15,7 @@
                 </el-option>
             </el-select>
             <span class="address-title">地市:</span>
-            <el-select class="input" v-model="dept2" clearable :popper-append-to-body="false" placeholder="请选择">
+            <el-select class="input" v-model="dept2" clearable :popper-append-to-body="false" placeholder="请选择" @change="cityChange">
                 <el-option
                         v-for="item in citys"
                         :key="item.value"
@@ -25,7 +25,7 @@
                 </el-option>
             </el-select>
             <span class="address-title">县(市区):</span>
-            <el-select class="input" v-model="dept3" clearable :popper-append-to-body="false" placeholder="请选择">
+            <el-select class="input" v-model="dept3" clearable :popper-append-to-body="false" placeholder="请选择" @change="areaChange">
                 <el-option
                         v-for="item in areas"
                         :key="item.value"
@@ -35,7 +35,7 @@
                 </el-option>
             </el-select>
             <span class="address-title">乡镇(街道):</span>
-            <el-select class="input1" clearable :popper-append-to-body="false" v-model="dept4" placeholder="请选择">
+            <el-select class="input1" clearable :popper-append-to-body="false" v-model="dept4" placeholder="请选择" @change="countyChange">
                 <el-option
                         v-for="item in countys"
                         :key="item.value"
@@ -101,66 +101,19 @@
     </div>
 </template>
 <script>
-    import {} from "../api";
+    import storageUtil from '../util/storageUtil'
+    import { findDept, visitDeptPage, visitPersonPage } from '../api'
 
     export default {
         name: "Home",
         components: {},
         data() {
             return {
-                provinces: [
-                    {
-                        value: '1',
-                        label: '吉林省',
-                    }, {
-                        value: '2',
-                        label: '辽宁省'
-                    }
-                ],   // 省份
-                citys: [
-                    {
-                        value: '3',
-                        label: '长春市',
-                    }, {
-                        value: '4',
-                        label: '四平市'
-                    }, {
-                        value: '5',
-                        label: '辽源市'
-                    }, {
-                        value: '6',
-                        label: '白城市'
-                    }], // 市
-                areas: [
-                    {
-                        value: '7',
-                        label: '宽城区'
-                    },
-                    {
-                        value: '8',
-                        label: '朝阳区'
-                    },
-                ],   // 县
-                countys: [
-                    {
-                        value: '9',
-                        label: '南广街道办事处'
-                    },
-                    {
-                        value: '10',
-                        label: '西广街道办事处'
-                    },
-                ],  // 乡
-                villages: [
-                    {
-                        value: '11',
-                        label: '东三条社区'
-                    },
-                    {
-                        value: '12',
-                        label: '西三条社区'
-                    },
-                ],  // 村
+                provinces: [],   // 省份
+                citys: [], // 市
+                areas: [],   // 县
+                countys: [],  // 乡
+                villages: [],  // 村
                 dept1: '',
                 dept2: '',
                 dept3: '',
@@ -172,118 +125,82 @@
                 dataArr1: [],
                 // 左二
                 dataArr2: [],
-                listData: [
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-
-                ],
-                listData1: [
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '张三', address: '桃园办事处', num: 56236},
-                    {name: '李四', address: '背景办事处', num: 50000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                    {name: '周五', address: '背景办事处', num: 48000},
-                ],
+                listData: [],  //地区
+                listData1: [], //个人
                 isText:false
             };
         },
-        mounted() {
+        async mounted() {
+            this.provinces = await this.findDept({'level': '1'});
+            this.loadDeptData({});
+            this.loadPersonData({});
+
+            const deptArray = storageUtil.read('dept-array');
+            if(deptArray != null && deptArray != '' && deptArray.length > 0) {
+                for(let i = 0; i < deptArray.length; i++) {
+                    this['dept' + (i + 1)] = deptArray[i];
+                }
+            }
+
+            if(this.dept1 != '') {
+                this.citys = await this.findDept({ fid: this.dept1 });
+            }
+
+            if(this.dept2 != '') {
+                this.areas = await this.findDept({ fid: this.dept2 });
+            }
+
+            if(this.dept3 != '') {
+                this.countys = await this.findDept({ fid: this.dept3 });
+            }
+
+            if(this.dept4 != '') {
+                this.villages = await this.findDept({ fid: this.dept4 });
+            }
         },
         methods: {
+            //获取地区
+            async findDept(data) {
+                const result = await findDept(data, 'POST');
+                return result;
+            },
+            async provinceChange(val) {
+                this.citys = await this.findDept({ fid: val });
+                this.dept2 = '';
+                this.dept3 = '';
+                this.dept4 = '';
+                this.dept5 = '';
+            },
+            async cityChange(val) {
+                this.areas = await this.findDept({ fid: val });
+                this.dept3 = '';
+                this.dept4 = '';
+                this.dept5 = '';
+            },
+            async areaChange(val) {
+                this.countys = await this.findDept({ fid: val });
+                this.dept4 = '';
+                this.dept5 = '';
+            },
+            async countyChange(val) {
+                this.villages = await this.findDept({ fid: val });
+                this.dept5 = '';
+            },
+
+            async loadDeptData(obj) {
+                const result = await visitDeptPage(obj, 'POST');
+                this.listData = result;
+            },
+
+            async loadPersonData(obj) {
+                const result = await visitPersonPage(obj, 'POST');
+                this.listData1 = result;
+            },
+
             //糊掉首页
             goHome() {
-                this.$router.push({
-                    path: '/'
-                });
+                storageUtil.save('dept-array', '');
+                this.$router.push({ path: '/' });
             },
             // 省市选择框 展开
             zhankai() {
@@ -296,13 +213,30 @@
             },
             // 省市选择框 确认
             queren() {
-                console.log(this.dept1)
-                console.log(this.dept2)
-                console.log(this.dept3)
-                console.log(this.dept4)
-                console.log(this.dept5)
-                console.log(this.date)
-                console.log("确定了")
+                let arr = new Array();
+                if(this.dept1 != '') {
+                    arr.push(this.dept1);
+                }
+                if(this.dept2 != '') {
+                    arr.push(this.dept2);
+                }
+                if(this.dept3 != '') {
+                    arr.push(this.dept3);
+                }
+                if(this.dept4 != '') {
+                    arr.push(this.dept4);
+                }
+                if(this.dept5 != '') {
+                    arr.push(this.dept5);
+                }
+                storageUtil.save('dept-array', arr);
+
+                let param = {};
+                if(this.date != '' && this.date != null) {
+                    param = {time: this.date};
+                }
+                this.loadDeptData(param);
+                this.loadPersonData(param);
             },
             // 滚动颜色
             scrollTextisColor: function (i) {
@@ -324,7 +258,6 @@
                 } else if (i == 2) {
                     return require("../assets/Ranking/3.png")
                 }
-
             },
         },
         computed: {