|
@@ -61,6 +61,19 @@
|
|
|
<span>{{ zjinfo.xuqiu }}次</span>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24" class="three">
|
|
|
+ <el-tabs v-model="act">
|
|
|
+ <el-tab-pane name="0" label="产品发布统计">
|
|
|
+ <pie :data="productList" :axis="proAxis" gid="pie0" v-if="act == 0"></pie>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane name="1" label="人员参会统计">
|
|
|
+ <donut :data="personList" :axis="perAxis" gid="donut1" v-if="act == 1"></donut>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane name="2" label="交易统计">
|
|
|
+ <bar :data="transList" :axis="transAxis" gid="bar2" v-if="act == 2"></bar>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</div>
|
|
@@ -71,13 +84,25 @@
|
|
|
<script>
|
|
|
import _ from 'lodash';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
-
|
|
|
+import pie from '@c/statistics/pie.vue';
|
|
|
+import bar from '@c/statistics/bar.vue';
|
|
|
+import donut from '@c/statistics/donut.vue';
|
|
|
const { mapActions: dock } = createNamespacedHelpers('dock');
|
|
|
+const { mapActions: transaction } = createNamespacedHelpers('transaction');
|
|
|
+const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
|
|
|
export default {
|
|
|
name: 'zongjie',
|
|
|
props: {},
|
|
|
- components: {},
|
|
|
+ components: { pie, donut, bar }, //
|
|
|
data: () => ({
|
|
|
+ act: '0',
|
|
|
+ productList: [],
|
|
|
+ proTitle: ['技术', '产品', '服务'],
|
|
|
+ proAxis: { x: 'name', xAlias: '产品类型', y: 'value', yAlias: '数量' },
|
|
|
+ personList: [],
|
|
|
+ perAxis: { x: 'name', xAlias: '用户类型', y: 'value', yAlias: '人数' },
|
|
|
+ transList: [],
|
|
|
+ transAxis: { x: 'name', xAlias: '交易动态', y: 'value', yAlias: '数量' },
|
|
|
zjinfo: {
|
|
|
top: '计算中心',
|
|
|
title: '测试直播',
|
|
@@ -116,12 +141,72 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...dock({ dockQuery: 'query', dockFetch: 'fetch' }),
|
|
|
+ ...marketproduct({ productQuery: 'query' }),
|
|
|
+ ...transaction({ transQuery: 'query' }),
|
|
|
async searchInfo() {
|
|
|
- console.log('ccc');
|
|
|
let res = await this.dockFetch(this.id);
|
|
|
- console.log('dad');
|
|
|
+ let resPro = await this.productQuery();
|
|
|
+ let resTran = await this.transQuery({ dockid: this.id });
|
|
|
+ if (this.$checkRes(res)) this.proPerson(res.data);
|
|
|
+ if (this.$checkRes(resPro)) this.proProduct(resPro.data);
|
|
|
+ if (this.$checkRes(resTran)) this.proTrans(resTran.data);
|
|
|
this.zjinfo.top = res.data.title;
|
|
|
- console.log(res.data.title);
|
|
|
+ },
|
|
|
+ proProduct(data) {
|
|
|
+ let garr = _.groupBy(data, 'totaltype');
|
|
|
+ let keys = Object.keys(garr);
|
|
|
+ let res = keys.map(i => {
|
|
|
+ let obj = { value: garr[i].length, type: i };
|
|
|
+ if (i == 0) obj.name = '技术';
|
|
|
+ if (i == 1) obj.name = '产品';
|
|
|
+ if (i == 2) obj.name = '服务';
|
|
|
+ return obj;
|
|
|
+ });
|
|
|
+ let r = res.some(f => f.type == 0);
|
|
|
+ if (!r) res.push({ value: 0, name: '技术', type: 0 });
|
|
|
+ r = res.some(f => f.type == 1);
|
|
|
+ if (!r) res.push({ value: 0, name: '产品', type: 1 });
|
|
|
+ r = res.some(f => f.type == 2);
|
|
|
+ if (!r) res.push({ value: 0, name: '服务', type: 2 });
|
|
|
+ this.$set(this, `productList`, res);
|
|
|
+ },
|
|
|
+ proPerson(data) {
|
|
|
+ let garr = _.groupBy(_.get(data, 'apply', []), 'role');
|
|
|
+ let keys = Object.keys(garr);
|
|
|
+ let res = keys.map(i => {
|
|
|
+ let obj = { value: garr[i].length, type: i };
|
|
|
+ if (i == 2) obj.name = '个人';
|
|
|
+ if (i == 3) obj.name = '机构';
|
|
|
+ if (i == 6) obj.name = '专家';
|
|
|
+ return obj;
|
|
|
+ });
|
|
|
+ //查类型,个人,机构,专家,没有的填0
|
|
|
+ let r = res.some(f => f.type == 2);
|
|
|
+ if (!r) res.push({ value: 0, name: '个人', type: 2 });
|
|
|
+ r = res.some(f => f.type == 3);
|
|
|
+ if (!r) res.push({ value: 0, name: '机构', type: 3 });
|
|
|
+ r = res.some(f => f.type == 6);
|
|
|
+ if (!r) res.push({ value: 0, name: '专家', type: 6 });
|
|
|
+ this.$set(this, `personList`, res);
|
|
|
+ },
|
|
|
+ proTrans(data) {
|
|
|
+ let garr = _.groupBy(data, 'status');
|
|
|
+ let keys = Object.keys(garr);
|
|
|
+ let res = keys.map(i => {
|
|
|
+ let obj = { value: garr[i].length, type: i };
|
|
|
+ if (i == 0) obj.name = '正在洽谈';
|
|
|
+ if (i == 1) obj.name = '达成意向';
|
|
|
+ if (i == 2) obj.name = '对接完成';
|
|
|
+ return obj;
|
|
|
+ });
|
|
|
+ //查类型,个人,机构,专家,没有的填0
|
|
|
+ let r = res.some(f => f.type == 0);
|
|
|
+ if (!r) res.push({ value: 0, name: '正在洽谈', type: 0 });
|
|
|
+ r = res.some(f => f.type == 1);
|
|
|
+ if (!r) res.push({ value: 0, name: '达成意向', type: 1 });
|
|
|
+ r = res.some(f => f.type == 2);
|
|
|
+ if (!r) res.push({ value: 0, name: '对接完成', type: 2 });
|
|
|
+ this.$set(this, `transList`, res);
|
|
|
},
|
|
|
},
|
|
|
};
|