|
@@ -22,13 +22,13 @@
|
|
|
<el-col :span="12" class="right">
|
|
|
<el-col class="box" :span="20" style="margin:50px 10px 10px 15px;">
|
|
|
<el-col :span="24" class="three one">
|
|
|
- <p>在线人数</p>
|
|
|
+ <p>专家注册数量</p>
|
|
|
<p>{{ detail.num3 }}</p>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
<el-col class="box" :span="20">
|
|
|
<el-col :span="24" class="four one">
|
|
|
- <p>企业项目数量</p>
|
|
|
+ <p>发布需求数量</p>
|
|
|
<p>{{ detail.num4 }}</p>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
@@ -39,6 +39,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapState, mapActions, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: users } = createNamespacedHelpers('users');
|
|
|
+const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
|
|
|
+const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
|
|
|
export default {
|
|
|
name: 'userTwo',
|
|
|
props: {},
|
|
@@ -55,9 +59,35 @@ export default {
|
|
|
num4: 4,
|
|
|
},
|
|
|
}),
|
|
|
- created() {},
|
|
|
- computed: {},
|
|
|
- methods: {},
|
|
|
+ created() {
|
|
|
+ this.searchInfo();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...users({ userQuery: 'query' }),
|
|
|
+ ...expertsuser({ expertsuserQurty: 'query' }),
|
|
|
+ ...marketproduct({ marketproductQuery: 'query' }),
|
|
|
+ async searchInfo({} = {}) {
|
|
|
+ // 个人,企业
|
|
|
+ let res = await this.userQuery();
|
|
|
+ let s1 = res.data.filter(f => f.role == '2');
|
|
|
+ let s2 = res.data.filter(f => f.role == '3');
|
|
|
+ // 专家
|
|
|
+ let exportNum = await this.expertsuserQurty();
|
|
|
+ // 发布需求
|
|
|
+ let productNum = await this.marketproductQuery();
|
|
|
+ let listData = { num1: s1.length, num2: s2.length, num3: exportNum.data.length, num4: productNum.data.length };
|
|
|
+ this.$set(this, `detail`, listData);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ pageTitle() {
|
|
|
+ return `${this.$route.meta.title}`;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|