silent 4 лет назад
Родитель
Сommit
ecc2603946
2 измененных файлов с 57 добавлено и 14 удалено
  1. 14 2
      src/api/wel/index.js
  2. 43 12
      src/views/wel/index.vue

+ 14 - 2
src/api/wel/index.js

@@ -1,8 +1,20 @@
 import request from '@/router/axios';
 
-export const getList = (current, size, params) => {
+export const censusAllTotal = (current, size, params) => {
   return request({
-    url: '/api/sing_heat_value/heatrecord/list',
+    url: '/api/app/index/census/censusAllTotal',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const censusTodayTotal = (current, size, params) => {
+  return request({
+    url: '/api/app/index/census/censusTodayTotal',
     method: 'get',
     params: {
       ...params,

+ 43 - 12
src/views/wel/index.vue

@@ -15,8 +15,9 @@
 </template>
 
 <script>
+import {censusAllTotal, censusTodayTotal} from "@/api/wel/index.js";
 
-  export default {
+export default {
     name: "wel",
     data() {
       return {
@@ -24,18 +25,20 @@
           data: [
             {
               click: () => {
-                this.$router.push({path: "/sing_active/activerecord"});
+                this.$router.push({path: "/sing_active/activeproductrecord"});
               },
-              title: '今日作品总数',
+              title: '作品总数',
+              prop: 'activeProductCount',
               count: 0,
               icon: 'el-icon-star-on',
               color: '#00a7d0',
             },
             {
               click: () => {
-                this.$router.push({path: "/sing_active/activeproductrecord"});
+                this.$router.push({path: "/sing_active/activerecord"});
               },
-              title: '今日活动总数',
+              title: '活动总数',
+              prop: 'activeCount',
               count: 0,
               icon: 'el-icon-s-flag',
               color: 'rgb(27, 201, 142)',
@@ -44,7 +47,8 @@
               click: () => {
                 this.$router.push({path: "/sing_user/loginuser"});
               },
-              title: '今日用户总数',
+              title: '用户总数',
+              prop: 'userCount',
               count: 0,
               icon: 'el-icon-user-solid',
               color: 'rgb(230, 71, 88)',
@@ -56,8 +60,9 @@
           data: [
             {
               click: () => {
-                this.$router.push({path: "/sing_active/activerecord"});
+                this.$router.push({path: "/sing_active/activeproductrecord"});
               },
+              prop: 'activeProductCount',
               title: '今日新增作品',
               count: 0,
               icon: 'el-icon-star-on',
@@ -65,9 +70,10 @@
             },
             {
               click: () => {
-                this.$router.push({path: "/sing_active/activeproductrecord"});
+                this.$router.push({path: "/sing_active/activerecord"});
               },
-              title: '今日新增总数',
+              title: '今日新增活动',
+              prop: 'activeCount',
               count: 0,
               icon: 'el-icon-s-flag',
               color: 'rgb(27, 201, 142)',
@@ -76,7 +82,8 @@
               click: () => {
                 this.$router.push({path: "/sing_user/loginuser"});
               },
-              title: '今日新增总数',
+              title: '今日新增用户',
+              prop: 'userCount',
               count: 0,
               icon: 'el-icon-user-solid',
               color: 'rgb(230, 71, 88)',
@@ -86,10 +93,34 @@
         },
       };
     },
-    computed: {
+    created() {
+      this.init();
     },
     methods: {
-
+      init(){
+        censusAllTotal().then(res=>{
+          let data = res.data.data;
+          for(const item in data){
+            let find = this.optionTotal.data.find(ele=>{
+              return ele.prop===item;
+            });
+            if(find!==undefined){
+              find.count = data[item];
+            }
+          }
+        });
+        censusTodayTotal().then(res=>{
+          let data = res.data.data;
+          for(const item in data){
+            let find = this.optionToday.data.find(ele=>{
+              return ele.prop===item;
+            });
+            if(find!==undefined){
+              find.count = data[item];
+            }
+          }
+        });
+      }
     },
   };
 </script>