Browse Source

支持按不同社区统计积分区间人数

skym1024 1 year ago
parent
commit
b59a85b885
2 changed files with 88 additions and 0 deletions
  1. 9 0
      src/api/stat/index.js
  2. 79 0
      src/views/stat/activity/activity-table-c.vue

+ 9 - 0
src/api/stat/index.js

@@ -72,6 +72,15 @@ export function activityTableb(query) {
     })
 }
 
+// 统计不同社区,不同积分区间的用户人数
+export function activityTableC(query) {
+  return request({
+    url: '/community/stat/user-counts-by-community',
+    method: 'get',
+    params: query
+  })
+}
+
 // 统计各类代金券发放情况
 export function issuedCountTyType(query) {
   return request({

+ 79 - 0
src/views/stat/activity/activity-table-c.vue

@@ -0,0 +1,79 @@
+<template>
+    <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
+        <el-form-item label="活动社区" prop="community">
+          <el-select v-model="queryParams.community" placeholder="请选择社区">
+            <el-option
+            v-for="dict in dict.type.community"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+
+      <el-table v-loading="loading" :data="pointRangeList" show-summary>
+        <el-table-column label="积分区间" align="center" prop="name" />
+        <el-table-column label="用户人数" align="center" prop="value" />
+      </el-table>
+
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </div>
+  </template>
+
+  <script>
+  import { activityTableC } from "@/api/stat/index";
+  export default {
+    name: "Activity",
+    dicts: ['community'],
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 总条数
+        total: 0,
+        // 积分区间表格
+        pointRangeList: [],
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          community:null
+        }
+      };
+    },
+    created() {
+      this.getList();
+    },
+    methods: {
+      /** 查询活动管理列表 */
+      async getList() {
+        this.loading = true;
+        const res = await activityTableC(this.queryParams);
+        this.pointRangeList = res.data
+        this.loading = false;
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+    }
+  };
+  </script>