Explorar el Código

上传照片统计、账号统计

梁展鹏 hace 3 años
padre
commit
904f1df20b

+ 2 - 0
src/api/statistics/index.js

@@ -6,3 +6,5 @@ export const getDownloadPage = params =>
   api.post(`/yxl-back-end/admin/data/statistics/download/page`, params);
 export const getUploadPage = params =>
   api.post(`/yxl-back-end/admin/data/statistics/upload/page`, params);
+export const getUploadCount = params =>
+  api.post(`/yxl-back-end/admin/data/statistics/upload/count`, params);

+ 2 - 0
src/api/system/account.js

@@ -2,6 +2,8 @@ import api from '@/utils/request';
 
 export const getPage = params =>
   api.post(`/yxl-back-end/framework/uiac/account/page`, params);
+export const getCount = params =>
+  api.post(`/yxl-back-end/framework/uiac/account/count`, params);
 export const getList = params =>
   api.post(`/yxl-back-end/framework/uiac/role/list`, params);
 export const getItem = ({ id, ...params }) =>

+ 47 - 1
src/views/statistics/uploadImage/index.vue

@@ -1,5 +1,21 @@
 <template>
   <div class="">
+    <div
+      class="m-10 bg-w p-20 br-10 f-sa-s">
+      <div class="f-fs-c f-col">
+        <div style="font-size: 16px;">总量</div>
+        <div class="mt-4" style="font-weight: bold; font-size: 18px;">{{statistics.all}}</div>
+      </div>
+      <div class="f-fs-c f-col">
+        <div style="font-size: 16px;">月新增</div>
+        <div class="mt-4" style="font-weight: bold; font-size: 18px;">{{statistics.month}}</div>
+      </div>
+      <div class="f-fs-c f-col">
+        <div style="font-size: 16px;">周新增</div>
+        <div class="mt-4" style="font-weight: bold; font-size: 18px;">{{statistics.week}}</div>
+      </div>
+    </div>
+
     <toolbar @on-filter="filterData" @on-reset="filterData" />
 
     <base-table
@@ -15,7 +31,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
-import { getUploadPage } from '@/api/statistics';
+import { getUploadPage, getUploadCount } from '@/api/statistics';
 
 
 export default {
@@ -31,6 +47,7 @@ export default {
 
   data() {
     return {
+      statistics: {},
       columns: [
         {
           key: 'kindergartenName',
@@ -75,6 +92,35 @@ export default {
         },
       ]
     };
+  },
+  methods:{
+    async pageChange(page) {
+      this.pagination.page = page;
+      const inParams = {
+        ...this.filter,
+        ...this.internalFilterObj,
+        page: this.pagination.page,
+        size: this.pagination.pageSize
+      };
+
+      const { data, msg } = await this.apiList(inParams, {
+        limit: this.pagination.pageSize,
+        start: this.pagination.page
+      });
+
+      const res2 = await getUploadCount(inParams)
+      this.statistics = res2.data
+      if ('data' in data) {
+        const items = data.data;
+        if (items.length === 0 && this.pagination.page > 1) {
+          this.pageChange(1);
+        } else {
+          this.items = items;
+          this.pagination.total = data.total;
+        }
+        this.loadCallBack(data);
+      }
+    }
   }
 };
 </script>

+ 47 - 1
src/views/systemManagement/accountManagement/index.vue

@@ -1,5 +1,21 @@
 <template>
   <div class="">
+    <div
+      class="m-10 bg-w p-20 br-10 f-sa-s">
+      <div class="f-fs-c f-col">
+        <div style="font-size: 16px;">总量</div>
+        <div class="mt-4" style="font-weight: bold; font-size: 18px;">{{statistics.all}}</div>
+      </div>
+      <div class="f-fs-c f-col">
+        <div style="font-size: 16px;">月新增</div>
+        <div class="mt-4" style="font-weight: bold; font-size: 18px;">{{statistics.month}}</div>
+      </div>
+      <div class="f-fs-c f-col">
+        <div style="font-size: 16px;">周新增</div>
+        <div class="mt-4" style="font-weight: bold; font-size: 18px;">{{statistics.week}}</div>
+      </div>
+    </div>
+
     <toolbar @on-filter="filterData" @on-reset="filterData" />
 
     <div class="m-10 bg-w p-20 br-10">
@@ -19,7 +35,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
-import { getPage } from '@/api/system/account';
+import { getPage, getCount } from '@/api/system/account';
 
 export default {
   name: 'AccountManagement',
@@ -37,6 +53,7 @@ export default {
 
   data() {
     return {
+      statistics: {},
       columns: [
         {
           key: 'id',
@@ -107,6 +124,35 @@ export default {
         // }
       ]
     };
+  },
+  methods:{
+    async pageChange(page) {
+      this.pagination.page = page;
+      const inParams = {
+        ...this.filter,
+        ...this.internalFilterObj,
+        page: this.pagination.page,
+        size: this.pagination.pageSize
+      };
+
+      const { data, msg } = await this.apiList(inParams, {
+        limit: this.pagination.pageSize,
+        start: this.pagination.page
+      });
+
+      const res2 = await getCount(inParams)
+      this.statistics = res2.data
+      if ('data' in data) {
+        const items = data.data;
+        if (items.length === 0 && this.pagination.page > 1) {
+          this.pageChange(1);
+        } else {
+          this.items = items;
+          this.pagination.total = data.total;
+        }
+        this.loadCallBack(data);
+      }
+    }
   }
 };
 </script>