Переглянути джерело

Merge branch 'master' of http://git.cc-lotus.info/service-platform/web-test

guhongwei 5 роки тому
батько
коміт
bdc151a17c

+ 1 - 1
src/components/enterprise/duijiestatus.vue

@@ -82,7 +82,7 @@ export default {
 }
 .right {
   width: 79%;
-  height: 520px;
+  min-height: 520px;
   overflow: hidden;
   background-color: #fff;
 }

+ 5 - 4
src/views/dynamic/index.vue

@@ -22,7 +22,7 @@
               </el-col>
               <el-col :span="8" class="right">
                 <el-col :span="23" class="rightInfo">
-                  信息
+                  <top-right></top-right>
                 </el-col>
                 <el-col :span="1" class="rightTit">
                   <p></p>
@@ -67,11 +67,12 @@
 <script>
 import userTwo from './parts/userTwo.vue';
 import pie from './parts/down-pie.vue';
+import topRight from './parts/top-right.vue';
 import maps from './parts/map.vue';
 export default {
   name: 'index',
   props: {},
-  components: { userTwo, maps, pie },
+  components: { userTwo, maps, pie, topRight },
   data: () => ({
     centerImage: require('@/assets/dynamic5.png'),
   }),
@@ -147,13 +148,13 @@ export default {
   float: left;
   width: 33%;
   height: 707px;
-  border: 1px solid red;
+  // border: 1px solid red;
 }
 .dataShow .dataShowInfo .right {
   float: left;
   width: 34%;
   height: 707px;
-  border: 1px solid red;
+  // border: 1px solid red;
 }
 .dataShow .dataShowInfo .right p:first-child {
   float: left;

+ 0 - 1
src/views/dynamic/parts/down-pie.vue

@@ -69,7 +69,6 @@ export default {
         let taking = rooms.errcode == 0 ? rooms.total : 0;
         let s1 = res.data.filter(f => f.status == '1'); //达成意向
         let s2 = res.data.filter(f => f.status == '2'); //对接完成
-
         let s3 = res.data.filter(f => f.status == '3'); //未达成意向
         this.myChart = echarts.init(document.getElementById('chartPie'));
         const option = {

+ 18 - 7
src/views/dynamic/parts/map.vue

@@ -16,6 +16,7 @@ import 'echarts/lib/component/legend';
 import 'echarts/lib/component/toolbox';
 import 'echarts/lib/component/markPoint';
 import 'echarts/lib/component/tooltip';
+const { mapActions } = createNamespacedHelpers('dock');
 export default {
   name: 'maps',
   props: {},
@@ -29,14 +30,20 @@ export default {
     this.init();
   },
   methods: {
+    ...mapActions(['query']),
     async init() {
+      let res = await this.query();
+      let city = {};
+      if (this.$checkRes(res)) {
+        city = jlJson.features.map(i => {
+          let object = {};
+          object.name = _.get(i.properties, 'name');
+          let result = res.data.filter(f => f.place == object.name);
+          object.value = result.length;
+          return object;
+        });
+      }
       let newJson = this.setPos(_.cloneDeep(jlJson));
-      let city = jlJson.features.map(i => {
-        let object = {};
-        object.name = _.get(i.properties, 'name');
-        object.value = Math.ceil(Math.random() * 100);
-        return object;
-      });
       let option = {
         title: {
           text: '吉林省',
@@ -64,7 +71,7 @@ export default {
         visualMap: {
           //颜色轴,可以根据数据点的值大小,展示不同的颜色,或用来展示地图块的不同颜色
           min: 0,
-          max: 100,
+          max: _.maxBy(city, 'value').value,
           calculable: true,
           inRange: {
             color: ['#8dc5f4', '#266bce'],
@@ -111,6 +118,10 @@ export default {
       });
       return data;
     },
+    setData(city, data) {
+      console.log(city);
+      console.log(data);
+    },
   },
   computed: {
     ...mapState(['user']),

+ 88 - 0
src/views/dynamic/parts/top-right.vue

@@ -0,0 +1,88 @@
+<template>
+  <div id="top-right">
+    <div id="chart" class="" style="height:450px;"></div>
+  </div>
+</template>
+
+<script>
+import echarts from 'echarts/lib/echarts';
+import 'echarts/lib/chart/bar';
+import 'echarts/lib/chart/pie';
+import 'echarts/lib/chart/line';
+import 'echarts/lib/component/title';
+import 'echarts/lib/component/legend';
+import 'echarts/lib/component/toolbox';
+import 'echarts/lib/component/markPoint';
+import 'echarts/lib/component/tooltip';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('transaction');
+const { mapActions: personalRoom } = createNamespacedHelpers('personalroom');
+export default {
+  name: 'top-right',
+  props: {},
+  components: {},
+  data: () => {
+    return {
+      myChart: null,
+    };
+  },
+  created() {
+    this.init();
+  },
+  methods: {
+    ...mapActions(['query']),
+    ...personalRoom(['countRoom']),
+    async init() {
+      let res = await this.query();
+      let rooms = await this.countRoom();
+      if (this.$checkRes(res)) {
+        let arr = res.data.filter(f => f.status != '3');
+        let taking = rooms.errcode == 0 ? rooms.total : 0;
+        let s1 = res.data.filter(f => f.status == '1'); //达成意向
+        let s2 = res.data.filter(f => f.status == '2'); //对接完成
+        this.myChart = echarts.init(document.getElementById('chart'));
+        const option = {
+          title: { text: '交易情况' },
+          tooltip: { trigger: 'axis' },
+          legend: {
+            data: ['正在洽谈', '达成意向', '对接完成'],
+          },
+          xAxis: {
+            type: 'category',
+            data: ['正在洽谈', '达成意向', '对接完成'],
+          },
+          yAxis: {},
+          series: [
+            {
+              name: '交易情况',
+              label: {
+                show: true,
+                position: 'top',
+              },
+              type: 'bar',
+              data: [
+                { name: '正在洽谈', value: taking, itemStyle: { color: 'gray' } },
+                { name: '达成意向', value: s1.length, itemStyle: { color: 'blue' } },
+                { name: '对接完成', value: s2.length, itemStyle: { color: 'green' } },
+              ],
+              animationType: 'scale',
+            },
+          ],
+        };
+        this.myChart.setOption(option);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['top-right']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>