guhongwei 4 gadi atpakaļ
vecāks
revīzija
31cf23332b

+ 54 - 0
src/store/count.js

@@ -0,0 +1,54 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  countInfo: `/api/market/count`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  // e专利数据统计
+  async patentQuery({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.countInfo}/patent`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  // 技术成果数据统计-所属领域
+  async productQuery({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.countInfo}/product`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  // 专家数据统计-所属单位
+  async expertQuery({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.countInfo}/expert`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  // 统计数据
+  async circleQuery({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.countInfo}/circle`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 3 - 0
src/store/index.js

@@ -17,6 +17,8 @@ import codeCategory from './codeCategory';
 import codeitem from './codeitem';
 import place from './place';
 import password from './market/password';
+import count from './count';
+
 // 新闻资讯
 import journcolumn from './market/journcolumn';
 import journnews from './market/journnews';
@@ -76,6 +78,7 @@ export default new Vuex.Store({
     codeitem,
     place,
     password,
+    count,
     // 新闻资讯
     journcolumn,
     journnews,

+ 17 - 42
src/views/dynamic/parts/achieveCom.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col :span="24" class="main" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
         <el-col :span="24" class="one">
-          技术成果
+          e专利
         </el-col>
         <el-col :span="24" class="two">
           <div id="achieveCom" class="style"></div>
@@ -24,7 +24,7 @@ import 'echarts/lib/component/toolbox';
 import 'echarts/lib/component/markPoint';
 import 'echarts/lib/component/tooltip';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: product } = createNamespacedHelpers('marketproduct');
+const { mapActions: count } = createNamespacedHelpers('count');
 export default {
   name: 'top-right',
   props: {},
@@ -39,35 +39,11 @@ export default {
     this.init();
   },
   methods: {
-    ...product(['query']),
+    ...count(['patentQuery']),
     async init() {
-      let res = await this.query();
+      let res = await this.patentQuery();
       if (this.$checkRes(res)) {
-        // 中科院长春分院
-        let s1 = res.data.filter(f => f.company.includes('中科院长春分院'));
-        // 中国科学院东北地理与农业生态研究所
-        // let s2 = res.data.filter(f => f.company.includes('中国科学院东北地理与农业生态研究所'));
-        // 中国科学院长春应用化学研究所
-        let s3 = res.data.filter(f => f.company.includes('中国科学院长春应用化学研究所'));
-        // 中科院长春光学精密机械与物理研究所
-        let s4 = res.data.filter(f => f.company.includes('中科院长春光学精密机械与物理研究所'));
-        // 吉林大学
-        let s5 = res.data.filter(f => f.company.includes('吉林大学'));
-        // 长春工业大学
-        let s6 = res.data.filter(f => f.company.includes('长春工业大学'));
-        // 长春工程学院
-        let s7 = res.data.filter(f => f.company.includes('长春工程学院'));
-        // 其他
-        let s8 = res.data.filter(
-          i =>
-            i.company != '中科院长春分院' &&
-            i.company != '中国科学院东北地理与农业生态研究所' &&
-            i.company != '中国科学院长春应用化学研究所' &&
-            i.company != '中科院长春光学精密机械与物理研究所' &&
-            i.company != '吉林大学' &&
-            i.company != '长春工业大学' &&
-            i.company != '长春工程学院'
-        );
+        let viewData = res.data.map(i => i.name);
         this.myChart = echarts.init(document.getElementById('achieveCom'));
         const option = {
           title: {},
@@ -78,8 +54,8 @@ export default {
           xAxis: {
             type: 'category',
             boundaryGap: [0, 0.01],
-            name: '单位',
-            data: ['长春分院', '应化所', '光机所', '吉林大学', '长春工业大学', '长春工程学院', '其他'],
+            name: '申请人',
+            data: viewData,
             axisLabel: {
               interval: 0, //横轴信息全部显示
               rotate: -30, //-30度角倾斜显示
@@ -100,22 +76,21 @@ export default {
           yAxis: {},
           series: [
             {
-              name: '技术成果',
+              name: 'e专利',
               label: {
                 show: true,
                 position: 'top',
               },
               type: 'bar',
-              data: [
-                { name: '中科院长春分院', value: s1.length, itemStyle: { color: '#800000' } },
-                // { name: '地理所', value: s2.length, itemStyle: { color: '#F08080' } },
-                { name: '应化所', value: s3.length, itemStyle: { color: '#8B4513' } },
-                { name: '光机所', value: s4.length, itemStyle: { color: '#D2B48C' } },
-                { name: '吉林大学', value: s5.length, itemStyle: { color: '#FFD700' } },
-                { name: '长春工业大学', value: s6.length, itemStyle: { color: '#7CFC00' } },
-                { name: '长春工程学院', value: s7.length, itemStyle: { color: '#40E0D0' } },
-                { name: '其他', value: s8.length, itemStyle: { color: '#00FFFF' } },
-              ],
+              itemStyle: {
+                normal: {
+                  color: function(params) {
+                    var colorList = ['#C1232B', '#B5C334', '#FCCE10', '#E87C25', '#27727B', '#FE8463', '#9BCA63', '#FAD860', '#F3A43B', '#60C0DD', '#778899'];
+                    return colorList[params.dataIndex];
+                  },
+                },
+              },
+              data: res.data,
             },
           ],
         };

+ 4 - 19
src/views/dynamic/parts/achieveFiled.vue

@@ -15,9 +15,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
-const { mapActions: product } = createNamespacedHelpers('marketproduct');
-const { mapActions: markettype } = createNamespacedHelpers('markettype');
+const { mapActions: count } = createNamespacedHelpers('count');
 import echarts from 'echarts/lib/echarts';
 import 'echarts/lib/chart/pie';
 import 'echarts/lib/chart/pie';
@@ -41,20 +39,13 @@ export default {
     };
   },
   created() {
-    this.searchType();
     this.init();
   },
   methods: {
-    ...markettype({ typeQuery: 'query' }),
-    ...product({ productList: 'newquery' }),
-    ...expertsuser(['query']),
+    ...count(['productQuery']),
     async init() {
-      let res = await this.productList({ type: '1', status: '1' });
+      let res = await this.productQuery();
       if (this.$checkRes(res)) {
-        let dataList = this.fieldList.map(i => ({ seriesId: i.code, name: i.name }));
-        for (const val of dataList) {
-          val.value = res.data.filter(i => i.field == val.name).length;
-        }
         this.myChart = echarts.init(document.getElementById('chartPie'));
         const option = {
           title: {},
@@ -84,7 +75,7 @@ export default {
                 position: 'top',
               },
               type: 'pie',
-              data: dataList,
+              data: res.data,
               animationType: 'scale',
               // 显示名称,数目,百分比
               itemStyle: {
@@ -111,12 +102,6 @@ export default {
         this.loading = false;
       }
     },
-    async searchType() {
-      let res = await this.typeQuery({ category: '01' });
-      if (this.$checkRes(res)) {
-        this.$set(this, `fieldList`, res.data);
-      }
-    },
   },
   computed: {
     ...mapState(['user']),

+ 9 - 35
src/views/dynamic/parts/expertCom.vue

@@ -15,7 +15,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
+const { mapActions: count } = createNamespacedHelpers('count');
 import echarts from 'echarts/lib/echarts';
 import 'echarts/lib/chart/pie';
 import 'echarts/lib/chart/pie';
@@ -40,30 +40,10 @@ export default {
     this.init();
   },
   methods: {
-    ...expertsuser(['query']),
-
+    ...count(['expertQuery']),
     async init() {
-      let res = await this.query();
+      let res = await this.expertQuery();
       if (this.$checkRes(res)) {
-        // 光机所
-        let s1 = res.data.filter(i => i.company == '中科院长春光学精密机械与物理研究所');
-        // 应化所
-        let s2 = res.data.filter(i => i.company == '中国科学院长春应用化学研究所');
-        // 地理所
-        let s3 = res.data.filter(i => i.company == '中国科学院东北地理与农业生态研究所');
-        // 吉林大学
-        let s4 = res.data.filter(f => f.company == '吉林大学');
-        // 长春工业大学
-        let s5 = res.data.filter(f => f.company == '长春工业大学');
-        // 其他
-        let s6 = res.data.filter(
-          i =>
-            i.company != '中科院长春光学精密机械与物理研究所' &&
-            i.company != '中国科学院长春应用化学研究所' &&
-            i.company != '中国科学院东北地理与农业生态研究所' &&
-            i.company != '吉林大学' &&
-            i.company != '长春工业大学'
-        );
         this.myChart = echarts.init(document.getElementById('chatCom'));
         const option = {
           title: {},
@@ -75,10 +55,7 @@ export default {
             borderWidth: 1,
           },
           tooltip: { trigger: 'item', formatter: '{a} <br/>{b} : {c} ({d}%)' },
-          legend: {
-            // orient: 'vertical',
-            // data: ['光机所', '应化所', '地理所', '吉林大学', '长春工业大学', '其他'],
-          },
+          legend: {},
           series: [
             {
               name: '专家一览',
@@ -91,14 +68,7 @@ export default {
                 position: 'top',
               },
               type: 'pie',
-              data: [
-                { seriesId: 's1', name: '光机所', value: s1.length, itemStyle: { color: '#4169E1' } },
-                { seriesId: 's2', name: '应化所', value: s2.length, itemStyle: { color: '#00FFFF' } },
-                { seriesId: 's3', name: '地理所', value: s3.length, itemStyle: { color: '#00FF7F' } },
-                { seriesId: 's4', name: '吉林大学', value: s4.length, itemStyle: { color: '#FFFF00' } },
-                { seriesId: 's5', name: '长春工业大学', value: s5.length, itemStyle: { color: '#FF8C00' } },
-                { seriesId: 's6', name: '其他', value: s6.length, itemStyle: { color: '#FF7F50' } },
-              ],
+              data: res.data,
               animationType: 'scale',
               // 显示名称,数目,百分比
               itemStyle: {
@@ -108,6 +78,10 @@ export default {
                     formatter: '{b} : {c} ({d}%)',
                   },
                   labelLine: { show: true },
+                  color: function(params) {
+                    var colorList = ['#4169E1', '#00FFFF', '#00FF7F', '#FFFF00', '#FF8C00', '#FF7F50'];
+                    return colorList[params.dataIndex];
+                  },
                 },
               },
             },

+ 45 - 69
src/views/dynamic/parts/userTwo.vue

@@ -6,13 +6,13 @@
           统计数据
         </el-col>
         <el-col :span="24" class="left">
-          <el-col class="box" :span="5">
-            <el-col :span="24" class="four one">
-              <p>企业注册数量</p>
-              <p>{{ detail.num1 }}</p>
+          <el-col class="list" :span="5" v-for="(item, index) in list" :key="index">
+            <el-col :span="24" class="one">
+              <p>{{ item.name }}</p>
+              <p>{{ item.value }}</p>
             </el-col>
           </el-col>
-          <el-col class="box" :span="5">
+          <!-- <el-col class="box" :span="5">
             <el-col :span="24" class="two one">
               <p>个人注册数量</p>
               <p>{{ detail.num2 }}</p>
@@ -53,7 +53,7 @@
               <p>对接完成</p>
               <p>{{ transaction3 }}</p>
             </el-col>
-          </el-col>
+          </el-col> -->
         </el-col>
       </el-col>
     </el-row>
@@ -62,61 +62,25 @@
 
 <script>
 import { mapState, mapActions, createNamespacedHelpers } from 'vuex';
-const { mapActions: users } = createNamespacedHelpers('users');
-const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
-const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
-const { mapActions: transaction } = createNamespacedHelpers('transaction');
-const { mapActions: survey } = createNamespacedHelpers('survey');
+const { mapActions: count } = createNamespacedHelpers('count');
 export default {
   name: 'userTwo',
   props: {},
   components: {},
   data: () => ({
-    dynamic1: require('@/assets/dynamic1.png'),
-    dynamic2: require('@/assets/dynamic2.png'),
-    dynamic3: require('@/assets/dynamic3.png'),
-    dynamic4: require('@/assets/dynamic4.png'),
-    transaction1: '',
-    transaction2: '',
-    transaction3: '',
-    detail: {
-      num1: 0,
-      num2: 0,
-      num3: 0,
-      num4: 0,
-      num5: 0,
-    },
+    list: [],
     loading: true,
   }),
   created() {
     this.searchInfo();
   },
   methods: {
-    ...users({ userQuery: 'query' }),
-    ...expertsuser({ expertsuserQurty: 'query' }),
-    ...marketproduct({ marketproductQuery: 'query' }),
-    ...transaction({ transactionQuery: 'query' }),
-    ...survey({ surveyquery: 'query' }),
+    ...count(['circleQuery']),
     async searchInfo({} = {}) {
-      // 个人,企业
-      let res = await this.userQuery();
-      let s1 = res.data.filter(f => f.role == '4');
-      let s2 = res.data.filter(f => f.role == '5');
-      // 专家
-      let exportNum = await this.expertsuserQurty();
-      // 发布需求
-      let productNum = await this.marketproductQuery({ status: 1 });
-      // 在线咨询
-      let zxzx = await this.surveyquery();
-      let listData = { num1: s2.length, num2: s1.length, num3: exportNum.data.length, num4: productNum.data.length, num5: zxzx.total };
-      this.$set(this, `detail`, listData);
-      //交易
-      let transaction1 = await this.transactionQuery({ status: 0 });
-      let transaction2 = await this.transactionQuery({ status: 1 });
-      let transaction3 = await this.transactionQuery({ status: 2 });
-      this.$set(this, `transaction1`, transaction1.total);
-      this.$set(this, `transaction2`, transaction2.total);
-      this.$set(this, `transaction3`, transaction3.total);
+      let res = await this.circleQuery();
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+      }
       this.loading = false;
     },
   },
@@ -149,44 +113,56 @@ export default {
 .right {
   float: right;
 }
-.box {
+.list {
   overflow: hidden;
   border-radius: 10px;
   box-shadow: 0 0 5px #ccc;
   padding: 10px;
   margin: 30px 5px 30px 14px;
+  .one {
+    height: 110px;
+    p {
+      font-size: 22px;
+      color: #346da4;
+      font-weight: bold;
+      text-align: center;
+    }
+    p:first-child {
+      padding: 40px 0 0 0;
+      font-size: 12px;
+    }
+  }
 }
-.one {
+.list:nth-child(1) .one {
+  background: url('~@/assets/dynamic4.png') no-repeat;
+  background-size: 100% 100%;
+}
+.list:nth-child(2) .one {
   background: url('~@/assets/dynamic1.png') no-repeat;
   background-size: 100% 100%;
-  // height: 150px;
-  height: 110px;
 }
-.one p {
-  font-size: 22px;
-  color: #346da4;
-  font-weight: bold;
-  text-align: center;
+.list:nth-child(3) .one {
+  background: url(../../../assets/dynamic3.png) no-repeat;
+  background-size: 100% 100%;
 }
-.one p:first-child {
-  // padding: 60px 0 0 0;
-  padding: 40px 0 0 0;
-  font-size: 12px;
+.list:nth-child(4) .one {
+  background: url(../../../assets/dynamic2.png) no-repeat;
+  background-size: 100% 100%;
 }
-.two {
-  background: url('~@/assets/dynamic1.png') no-repeat;
+.list:nth-child(5) .one {
+  background: url(../../../assets/dynamic2.png) no-repeat;
   background-size: 100% 100%;
 }
-.three {
+.list:nth-child(6) .one {
   background: url(../../../assets/dynamic3.png) no-repeat;
   background-size: 100% 100%;
 }
-.four {
-  background: url(../../../assets/dynamic4.png) no-repeat;
+.list:nth-child(7) .one {
+  background: url(../../../assets/dynamic1.png) no-repeat;
   background-size: 100% 100%;
 }
-.five {
-  background: url(../../../assets/dynamic2.png) no-repeat;
+.list:nth-child(8) .one {
+  background: url(../../../assets/dynamic4.png) no-repeat;
   background-size: 100% 100%;
 }
 </style>