会员管理查询条件

master
382696293@qq.com 2 years ago
parent 745bc56b62
commit ff3b36036c

@ -34,7 +34,7 @@ public class WxUserTag extends BaseEntity {
private Long tagId;
/**
* 1 2
* 1 2
*/
private Integer type;

@ -6,7 +6,7 @@ package com.flossom.common.core.enums;
* @author flossom
*/
public enum TagTypeStatus {
ENTERPRISE_WECHAT(1, "正常"), MINI_PROGRAM(2, "停用");
MINI_PROGRAM(1, "小程序标签"), ENTERPRISE_WECHAT(2, "企业微信标签");
private final Integer code;
private final String info;

@ -115,4 +115,6 @@ public interface SysTagMapper {
* @return
*/
public int deleteDeptById(Long id);
List<SysTag> selectSecondTagByType(@Param("type") Integer type);
}

@ -89,7 +89,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where tag_name=#{tagName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select>
<insert id="insertDept" parameterType="SysTag">
<select id="selectSecondTagByType" resultMap="SysTagResult">
<include refid="selectDeptVo"/>
WHERE
type = #{type}
AND parent_id != 0
AND del_flag = 0
ORDER BY order_num asc
</select>
<insert id="insertDept" parameterType="SysTag">
insert into sys_tag(
<if test="id != null and id != 0">id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>

@ -4,6 +4,7 @@ import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
@ -103,4 +104,13 @@ public class ActivityChannelInfoController extends BaseController
{
return toAjax(activityChannelInfoService.deleteActivityChannelInfoByIds(ids));
}
/**
*
* @return
*/
@GetMapping("/getPurchaseChannel")
public R getPurchaseChannel() {
return R.ok(activityChannelInfoService.getPurchaseChannel());
}
}

@ -1,6 +1,7 @@
package com.flossom.system.controller;
import com.flossom.common.core.constant.UserConstants;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.SysDept;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.utils.StringUtils;
@ -26,8 +27,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/tagInfo")
public class SysTagController extends BaseController
{
public class SysTagController extends BaseController {
@Autowired
private ISysTagService tagService;
@ -36,8 +36,7 @@ public class SysTagController extends BaseController
*/
@RequiresPermissions("system:dept:list")
@GetMapping("/list")
public AjaxResult list(SysTag sysTag)
{
public AjaxResult list(SysTag sysTag) {
List<SysTag> tags = tagService.selectDeptList(sysTag);
return success(tags);
}
@ -47,8 +46,7 @@ public class SysTagController extends BaseController
*/
@RequiresPermissions("system:tagInfo:list")
@GetMapping("/list/exclude/{id}")
public AjaxResult excludeChild(@PathVariable(value = "id", required = false) Long id)
{
public AjaxResult excludeChild(@PathVariable(value = "id", required = false) Long id) {
List<SysTag> tags = tagService.selectDeptList(new SysTag());
tags.removeIf(d -> d.getId().intValue() == id || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), id + ""));
return success(tags);
@ -59,8 +57,7 @@ public class SysTagController extends BaseController
*/
@RequiresPermissions("system:tagInfo:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable Long id)
{
public AjaxResult getInfo(@PathVariable Long id) {
tagService.checkDeptDataScope(id);
return success(tagService.selectDeptById(id));
}
@ -71,10 +68,8 @@ public class SysTagController extends BaseController
@RequiresPermissions("system:tagInfo:add")
@Log(title = "标签管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysTag tag)
{
if (!tagService.checkDeptNameUnique(tag))
{
public AjaxResult add(@Validated @RequestBody SysTag tag) {
if (!tagService.checkDeptNameUnique(tag)) {
return error("新增标签'" + tag.getTagName() + "'失败,标签名称已存在");
}
tag.setCreateBy(SecurityUtils.getUsername());
@ -87,20 +82,14 @@ public class SysTagController extends BaseController
@RequiresPermissions("system:tagInfo:edit")
@Log(title = "标签管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysTag tag)
{
public AjaxResult edit(@Validated @RequestBody SysTag tag) {
Long id = tag.getId();
tagService.checkDeptDataScope(id);
if (!tagService.checkDeptNameUnique(tag))
{
if (!tagService.checkDeptNameUnique(tag)) {
return error("修改标签'" + tag.getTagName() + "'失败,标签名称已存在");
}
else if (tag.getParentId().equals(id))
{
} else if (tag.getParentId().equals(id)) {
return error("修改标签'" + tag.getTagName() + "'失败,上级标签不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, tag.getStatus()) && tagService.selectNormalChildrenDeptById(id) > 0)
{
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, tag.getStatus()) && tagService.selectNormalChildrenDeptById(id) > 0) {
return error("该标签包含未停用的子标签!");
}
tag.setUpdateBy(SecurityUtils.getUsername());
@ -113,10 +102,8 @@ public class SysTagController extends BaseController
@RequiresPermissions("system:dept:remove")
@Log(title = "标签管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id)
{
if (tagService.hasChildByDeptId(id))
{
public AjaxResult remove(@PathVariable Long id) {
if (tagService.hasChildByDeptId(id)) {
return warn("存在下级标签,不允许删除");
}
// if (tagService.checkDeptExistUser(id))
@ -133,8 +120,27 @@ public class SysTagController extends BaseController
*/
@RequiresPermissions("system:user:list")
@GetMapping("/tagTree")
public AjaxResult tagTree(SysTag tag)
{
public AjaxResult tagTree(SysTag tag) {
return success(tagService.selectTagTreeList(tag));
}
/**
*
*
* @return
*/
@GetMapping("/getMiniProgramTags")
public R getMiniProgramTags() {
return R.ok(tagService.getMiniProgramTags());
}
/**
*
*
* @return
*/
@GetMapping("/getWecomTags")
public R getWecomTags() {
return R.ok(tagService.getWecomTags());
}
}

@ -3,6 +3,7 @@ package com.flossom.system.service;
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
import java.util.List;
import java.util.Map;
/**
* Service
@ -59,4 +60,7 @@ public interface IActivityChannelInfoService
* @return
*/
public int deleteActivityChannelInfoById(Long id);
List<Map<String, Object>> getPurchaseChannel();
}

@ -5,6 +5,7 @@ import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.vo.TreeSelect;
import java.util.List;
import java.util.Map;
/**
@ -132,4 +133,8 @@ public interface ISysTagService
* @return
*/
public List<TreeSelect> selectTagTreeList(SysTag tag);
List<Map<String, Object>> getMiniProgramTags();
List<Map<String, Object>> getWecomTags();
}

@ -1,8 +1,12 @@
package com.flossom.system.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.mapper.ActivityChannelInfoMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,8 +20,7 @@ import com.flossom.system.service.IActivityChannelInfoService;
* @date 2023-12-20
*/
@Service
public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoService
{
public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoService {
@Autowired
private ActivityChannelInfoMapper activityChannelInfoMapper;
@ -28,8 +31,7 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public ActivityChannelInfo selectActivityChannelInfoById(Long id)
{
public ActivityChannelInfo selectActivityChannelInfoById(Long id) {
return activityChannelInfoMapper.selectActivityChannelInfoById(id);
}
@ -40,8 +42,7 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public List<ActivityChannelInfo> selectActivityChannelInfoList(ActivityChannelInfo activityChannelInfo)
{
public List<ActivityChannelInfo> selectActivityChannelInfoList(ActivityChannelInfo activityChannelInfo) {
return activityChannelInfoMapper.selectActivityChannelInfoList(activityChannelInfo);
}
@ -52,8 +53,7 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public int insertActivityChannelInfo(ActivityChannelInfo activityChannelInfo)
{
public int insertActivityChannelInfo(ActivityChannelInfo activityChannelInfo) {
activityChannelInfo.setCreateTime(DateUtils.getNowDate());
return activityChannelInfoMapper.insertActivityChannelInfo(activityChannelInfo);
}
@ -65,8 +65,7 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public int updateActivityChannelInfo(ActivityChannelInfo activityChannelInfo)
{
public int updateActivityChannelInfo(ActivityChannelInfo activityChannelInfo) {
return activityChannelInfoMapper.updateActivityChannelInfo(activityChannelInfo);
}
@ -77,8 +76,7 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public int deleteActivityChannelInfoByIds(Long[] ids)
{
public int deleteActivityChannelInfoByIds(Long[] ids) {
return activityChannelInfoMapper.deleteActivityChannelInfoByIds(ids);
}
@ -89,8 +87,25 @@ public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoServi
* @return
*/
@Override
public int deleteActivityChannelInfoById(Long id)
{
public int deleteActivityChannelInfoById(Long id) {
return activityChannelInfoMapper.deleteActivityChannelInfoById(id);
}
@Override
public List<Map<String, Object>> getPurchaseChannel() {
List<Map<String, Object>> channelList = new ArrayList<>();
ActivityChannelInfo query = new ActivityChannelInfo();
List<ActivityChannelInfo> activityChannelInfoList = activityChannelInfoMapper.selectActivityChannelInfoList(query);
if (activityChannelInfoList != null && activityChannelInfoList.size() > 0) {
Map<String, Object> map;
for (ActivityChannelInfo activityChannelInfo : activityChannelInfoList) {
map = new HashMap<>();
map.put("label", activityChannelInfo.getChannelName());
map.put("value", activityChannelInfo.getId());
channelList.add(map);
}
}
return channelList;
}
}

@ -6,6 +6,7 @@ import com.flossom.common.core.domain.entity.SysRole;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.entity.SysUser;
import com.flossom.common.core.domain.vo.TreeSelect;
import com.flossom.common.core.enums.TagTypeStatus;
import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.mapper.SysDeptMapper;
import com.flossom.common.core.mapper.SysRoleMapper;
@ -20,10 +21,7 @@ import com.flossom.system.service.ISysTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -32,8 +30,7 @@ import java.util.stream.Collectors;
* @author flossom
*/
@Service
public class SysTagServiceImpl implements ISysTagService
{
public class SysTagServiceImpl implements ISysTagService {
@Autowired
private SysTagMapper tagMapper;
@ -48,8 +45,7 @@ public class SysTagServiceImpl implements ISysTagService
*/
@Override
@DataScope(deptAlias = "d")
public List<SysTag> selectDeptList(SysTag tag)
{
public List<SysTag> selectDeptList(SysTag tag) {
return tagMapper.selectDeptList(tag);
}
@ -60,8 +56,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public List<TreeSelect> selectDeptTreeList(SysTag tag)
{
public List<TreeSelect> selectDeptTreeList(SysTag tag) {
List<SysTag> tags = SpringUtils.getAopProxy(this).selectDeptList(tag);
return buildDeptTreeSelect(tags);
}
@ -73,21 +68,17 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public List<SysTag> buildDeptTree(List<SysTag> tags)
{
public List<SysTag> buildDeptTree(List<SysTag> tags) {
List<SysTag> returnList = new ArrayList<SysTag>();
List<Long> tempList = tags.stream().map(SysTag::getId).collect(Collectors.toList());
for (SysTag tag : tags)
{
for (SysTag tag : tags) {
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(tag.getParentId()))
{
if (!tempList.contains(tag.getParentId())) {
recursionFn(tags, tag);
returnList.add(tag);
}
}
if (returnList.isEmpty())
{
if (returnList.isEmpty()) {
returnList = tags;
}
return returnList;
@ -100,8 +91,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public List<TreeSelect> buildDeptTreeSelect(List<SysTag> tags)
{
public List<TreeSelect> buildDeptTreeSelect(List<SysTag> tags) {
List<SysTag> deptTrees = buildDeptTree(tags);
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
}
@ -113,8 +103,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public List<Long> selectDeptListByRoleId(Long roleId)
{
public List<Long> selectDeptListByRoleId(Long roleId) {
SysRole role = roleMapper.selectRoleById(roleId);
return tagMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
}
@ -126,8 +115,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public SysTag selectDeptById(Long id)
{
public SysTag selectDeptById(Long id) {
return tagMapper.selectDeptById(id);
}
@ -138,8 +126,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public int selectNormalChildrenDeptById(Long id)
{
public int selectNormalChildrenDeptById(Long id) {
return tagMapper.selectNormalChildrenDeptById(id);
}
@ -150,8 +137,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public boolean hasChildByDeptId(Long id)
{
public boolean hasChildByDeptId(Long id) {
int result = tagMapper.hasChildByDeptId(id);
return result > 0;
}
@ -163,8 +149,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return true false
*/
@Override
public boolean checkDeptExistUser(Long id)
{
public boolean checkDeptExistUser(Long id) {
int result = tagMapper.checkDeptExistUser(id);
return result > 0;
}
@ -176,12 +161,10 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public boolean checkDeptNameUnique(SysTag tag)
{
public boolean checkDeptNameUnique(SysTag tag) {
Long deptId = StringUtils.isNull(tag.getId()) ? -1L : tag.getId();
SysTag info = tagMapper.checkDeptNameUnique(tag.getTagName(), tag.getParentId());
if (StringUtils.isNotNull(info) && info.getId().longValue() != deptId.longValue())
{
if (StringUtils.isNotNull(info) && info.getId().longValue() != deptId.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
@ -193,15 +176,12 @@ public class SysTagServiceImpl implements ISysTagService
* @param id id
*/
@Override
public void checkDeptDataScope(Long id)
{
if (!SysUser.isAdmin(SecurityUtils.getUserId()))
{
public void checkDeptDataScope(Long id) {
if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
SysTag tag = new SysTag();
tag.setId(id);
List<SysTag> tags = SpringUtils.getAopProxy(this).selectDeptList(tag);
if (StringUtils.isEmpty(tags))
{
if (StringUtils.isEmpty(tags)) {
throw new ServiceException("没有权限访问标签数据!");
}
}
@ -214,15 +194,14 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public int insertDept(SysTag tag)
{
public int insertDept(SysTag tag) {
SysTag info = tagMapper.selectDeptById(tag.getParentId());
// 如果父节点不为正常状态,则不允许新增子节点
// if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
// {
// throw new ServiceException("标签停用,不允许新增");
// }
if(Objects.isNull(info)) {
if (Objects.isNull(info)) {
tag.setAncestors("0");
tag.setParentId(0l);
}
@ -237,12 +216,10 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public int updateDept(SysTag tag)
{
public int updateDept(SysTag tag) {
SysTag newParentDept = tagMapper.selectDeptById(tag.getParentId());
SysTag oldDept = tagMapper.selectDeptById(tag.getId());
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept))
{
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getId();
String oldAncestors = oldDept.getAncestors();
tag.setAncestors(newAncestors);
@ -250,8 +227,7 @@ public class SysTagServiceImpl implements ISysTagService
}
int result = tagMapper.updateDept(tag);
if (UserConstants.DEPT_NORMAL.equals(tag.getStatus()) && StringUtils.isNotEmpty(tag.getAncestors())
&& !StringUtils.equals("0", tag.getAncestors()))
{
&& !StringUtils.equals("0", tag.getAncestors())) {
// 如果该标签是启用状态,则启用该标签的所有上级标签
updateParentDeptStatusNormal(tag);
}
@ -263,8 +239,7 @@ public class SysTagServiceImpl implements ISysTagService
*
* @param
*/
private void updateParentDeptStatusNormal(SysTag tag)
{
private void updateParentDeptStatusNormal(SysTag tag) {
String ancestors = tag.getAncestors();
Long[] deptIds = Convert.toLongArray(ancestors);
tagMapper.updateDeptStatusNormal(deptIds);
@ -277,15 +252,12 @@ public class SysTagServiceImpl implements ISysTagService
* @param newAncestors ID
* @param oldAncestors ID
*/
public void updateDeptChildren(Long id, String newAncestors, String oldAncestors)
{
public void updateDeptChildren(Long id, String newAncestors, String oldAncestors) {
List<SysTag> children = tagMapper.selectChildrenDeptById(id);
for (SysTag child : children)
{
for (SysTag child : children) {
child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
}
if (children.size() > 0)
{
if (children.size() > 0) {
tagMapper.updateDeptChildren(children);
}
}
@ -297,8 +269,7 @@ public class SysTagServiceImpl implements ISysTagService
* @return
*/
@Override
public int deleteDeptById(Long id)
{
public int deleteDeptById(Long id) {
return tagMapper.deleteDeptById(id);
}
@ -308,18 +279,49 @@ public class SysTagServiceImpl implements ISysTagService
return buildDeptTreeSelect(tags);
}
@Override
public List<Map<String, Object>> getMiniProgramTags() {
List<Map<String, Object>> tagList = new ArrayList<>();
// 获取小程序标签
List<SysTag> miniProgramTags = tagMapper.selectSecondTagByType(TagTypeStatus.MINI_PROGRAM.getCode());
if (miniProgramTags != null && miniProgramTags.size() > 0) {
Map<String, Object> map;
for (SysTag miniProgramTag : miniProgramTags) {
map = new HashMap<>();
map.put("label", miniProgramTag.getTagName());
map.put("value", miniProgramTag.getId());
tagList.add(map);
}
}
return tagList;
}
@Override
public List<Map<String, Object>> getWecomTags() {
List<Map<String, Object>> tagList = new ArrayList<>();
// 获取小程序标签
List<SysTag> miniProgramTags = tagMapper.selectSecondTagByType(TagTypeStatus.ENTERPRISE_WECHAT.getCode());
if (miniProgramTags != null && miniProgramTags.size() > 0) {
Map<String, Object> map;
for (SysTag miniProgramTag : miniProgramTags) {
map = new HashMap<>();
map.put("label", miniProgramTag.getTagName());
map.put("value", miniProgramTag.getId());
tagList.add(map);
}
}
return tagList;
}
/**
*
*/
private void recursionFn(List<SysTag> list, SysTag t)
{
private void recursionFn(List<SysTag> list, SysTag t) {
// 得到子节点列表
List<SysTag> childList = getChildList(list, t);
t.setChildren(childList);
for (SysTag tChild : childList)
{
if (hasChild(list, tChild))
{
for (SysTag tChild : childList) {
if (hasChild(list, tChild)) {
recursionFn(list, tChild);
}
}
@ -328,15 +330,12 @@ public class SysTagServiceImpl implements ISysTagService
/**
*
*/
private List<SysTag> getChildList(List<SysTag> list, SysTag t)
{
private List<SysTag> getChildList(List<SysTag> list, SysTag t) {
List<SysTag> tlist = new ArrayList<SysTag>();
Iterator<SysTag> it = list.iterator();
while (it.hasNext())
{
while (it.hasNext()) {
SysTag n = (SysTag) it.next();
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue())
{
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue()) {
tlist.add(n);
}
}
@ -346,8 +345,7 @@ public class SysTagServiceImpl implements ISysTagService
/**
*
*/
private boolean hasChild(List<SysTag> list, SysTag t)
{
private boolean hasChild(List<SysTag> list, SysTag t) {
return getChildList(list, t).size() > 0 ? true : false;
}
}

@ -42,3 +42,33 @@ export function delMember(id) {
method: 'delete'
})
}
export function selectUserCount() {
return request({
url: '/system/member/selectUserCount',
method: 'get',
})
}
export function getMiniProgramTags() {
return request({
url: '/system/tagInfo/getMiniProgramTags',
method: 'get',
})
}
export function getWecomTags() {
return request({
url: '/system/tagInfo/getWecomTags',
method: 'get',
})
}
export function getPurchaseChannel() {
return request({
url: '/system/channelInfo/getPurchaseChannel',
method: 'get',
})
}

@ -1,5 +1,10 @@
<template>
<div class="app-container">
<el-descriptions size="medium" >
<el-descriptions-item label="用户总数">{{count.userNum}}</el-descriptions-item>
<el-descriptions-item label="已注册用户">{{count.userRegisterNum}}</el-descriptions-item>
<el-descriptions-item label="已绑定仪器用户数">{{count.userDeviceNum}}</el-descriptions-item>
</el-descriptions>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="用户类型" prop="userType">
<el-select v-model="queryParams.userType" @keyup.enter.native="handleQuery" style="width: 50%">
@ -69,11 +74,56 @@
align="right">
</el-date-picker>
</el-form-item>
<el-form-item label="仪器数量" prop="credit">
<el-input-number v-model="queryParams.devicesNumStart" @keyup.enter.native="handleQuery"></el-input-number>
<el-input-number v-model="queryParams.devicesNumEnd" @keyup.enter.native="handleQuery"></el-input-number>
</el-form-item>
<el-form-item label="积分范围" prop="credit">
<el-input-number v-model="queryParams.creditStart" @keyup.enter.native="handleQuery"></el-input-number>
<el-input-number v-model="queryParams.creditEnd" @keyup.enter.native="handleQuery"></el-input-number>
</el-form-item>
<el-form-item label="仪器绑定" prop="devicesTags">
<el-select v-model="queryParams.devicesTags" multiple placeholder="请选择">
<el-option
v-for="item in devicesTags"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="购买渠道" prop="purchaseChannel">
<el-select v-model="queryParams.purchaseChannel" multiple placeholder="请选择">
<el-option
v-for="item in purchaseChannel"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="企微标签" prop="wecomTags">
<el-select v-model="queryParams.wecomTags" multiple placeholder="请选择">
<el-option
v-for="item in miniProgramTags"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="小程序标签" prop="miniProgramTags">
<el-select v-model="queryParams.miniProgramTags" multiple placeholder="请选择">
<el-option
v-for="item in wecomTags"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</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>
@ -282,12 +332,35 @@
</template>
<script>
import { listMember, getMember, delMember, addMember, updateMember } from "@/api/system/member";
import {
listMember,
getMember,
delMember,
addMember,
updateMember,
selectUserCount,
getMiniProgramTags,
getWecomTags,
getPurchaseChannel,
} from "@/api/system/member";
export default {
name: "Member",
data() {
return {
devicesTags: [{
value: '仪器标签1',
label: '仪器标签1'
}, {
value: '仪器标签2',
label: '仪器标签2'
}, {
value: '仪器标签3',
label: '仪器标签3'
}],
miniProgramTags: [],
wecomTags: [],
purchaseChannel: null,
//
loading: true,
//
@ -308,6 +381,11 @@ export default {
open: false,
//
dateRange: [],
count: {
userNum: 0,
userRegisterNum: 0,
userDeviceNum: 0
},
//
queryParams: {
pageNum: 1,
@ -315,6 +393,8 @@ export default {
nickname: null,
headimg: null,
username: null,
devicesNumStart: undefined,
devicesNumEnd: undefined,
creditStart: undefined,
creditEnd: undefined,
openid: null,
@ -341,6 +421,10 @@ export default {
loginTime: null,
status: null,
// createTime: [],
devicesTags: [], //
wecomTags:[], //
miniProgramTags: [], //
purchaseChannel: null, //
},
//
form: {},
@ -350,7 +434,12 @@ export default {
};
},
created() {
//
this.getUserCount();
//
this.getList();
//
this.getTags();
},
methods: {
/** 查询用户列表 */
@ -362,6 +451,27 @@ export default {
this.loading = false;
});
},
getUserCount() {
selectUserCount().then(Response => {
this.count.userNum = Response.data[0];
this.count.userRegisterNum = Response.data[1];
this.count.userDeviceNum = Response.data[2];
})
},
getTags() {
//
getMiniProgramTags().then(Response => {
this.miniProgramTags = Response.data
})
//
getWecomTags().then(Response => {
this.wecomTags = Response.data
})
//
getPurchaseChannel().then(Response => {
this.purchaseChannel = Response.data
})
},
//
cancel() {
this.open = false;

Loading…
Cancel
Save