测试环境

pull/2/head
perry 2023-05-18 13:25:44 +08:00
parent a0c0fc8437
commit 6fac2affcc
22 changed files with 368 additions and 31 deletions

View File

@ -0,0 +1,76 @@
package cn.iocoder.yudao.module.shop.controller.app.qrcode;
import cn.iocoder.yudao.framework.common.enums.Constants;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.shop.service.qrcode.QrCodeService;
import com.alibaba.fastjson.JSONObject;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
*
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEBCRMEB
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
@Slf4j
@RestController
@RequestMapping("/qrcode")
@Tag(name = "用户APP - 二维码服务")
public class QrCodeController {
@Autowired
private QrCodeService qrCodeService;
/**
*
* @return CommonResult
*/
@Operation(summary="获取二维码")
@RequestMapping(value = "/get", method = RequestMethod.POST)
public CommonResult<Map<String, Object>> get(@RequestBody JSONObject data) {
return CommonResult.success(qrCodeService.get(data));
}
/**
* base64
* @return CommonResult
*/
@Operation(summary="远程图片转base64")
@RequestMapping(value = "/base64", method = RequestMethod.POST)
public CommonResult<Map<String, Object>> get(@RequestBody String url) {
return CommonResult.success(qrCodeService.base64(url));
}
/**
* base64
* @return CommonResult
*/
@Operation(summary="将字符串 转base64")
@RequestMapping(value = "/str2base64", method = RequestMethod.POST)
public CommonResult<Map<String, Object>> getQrcodeByString(
@RequestParam String text,
@RequestParam int width,
@RequestParam int height) {
if((width < 50 || height < 50) && (width > 500 || height > 500) && text.length() >= 999){
throw new ServiceException(Constants.RESULT_QRCODE_PRAMERROR);
}
return CommonResult.success(qrCodeService.base64String(text, width,height));
}
}

View File

@ -0,0 +1,41 @@
package cn.iocoder.yudao.module.shop.service.qrcode;
import com.alibaba.fastjson.JSONObject;
import java.util.Map;
/**
* QrCodeService
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEBCRMEB
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
public interface QrCodeService {
/**
*
* @return CommonResult
*/
Map<String, Object> get(JSONObject data);
/**
* base64
* @param url
*/
Map<String, Object> base64(String url);
/**
* base64
* @param text
* @param width
* @param height
*/
Map<String, Object> base64String(String text,int width, int height);
}

View File

@ -0,0 +1,88 @@
package cn.iocoder.yudao.module.shop.service.qrcode;
import cn.hutool.extra.qrcode.QrCodeUtil;
import cn.hutool.http.HttpUtil;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;
import org.springframework.util.Base64Utils;
import java.util.HashMap;
import java.util.Map;
/**
* QrCodeServiceImpl
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEBCRMEB
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
@Service
public class QrCodeServiceImpl implements QrCodeService {
/**
*
* @return Object
*/
@Override
public Map<String, Object> get(JSONObject data) {
Map<String, Object> map = new HashMap<>();
StringBuilder scene = new StringBuilder();
String page = "";
try{
if(null != data){
Map<Object, Object> dataMap = JSONObject.toJavaObject(data, Map.class);
for (Map.Entry<Object, Object> m : dataMap.entrySet()) {
if(m.getKey().equals("path")){
//前端路由, 不需要拼参数
page = m.getValue().toString();
continue;
}
if (scene.length() > 0) {
scene.append(",");
}
scene.append(m.getKey()).append(":").append(m.getValue());
}
}
}catch (Exception e){
throw new ServiceException("url参数错误 " + e.getMessage());
}
map.put("code", "");
return map;
}
@Override
public Map<String, Object> base64(String url) {
byte[] bytes = HttpUtil.downloadBytes(url);
String base64Image = Base64Utils.encodeToString(bytes);
Map<String, Object> map = new HashMap<>();
map.put("code", base64Image);
return map;
}
/**
* QRcode
* @param text
* @return QRcode base64
*/
@Override
public Map<String, Object> base64String(String text,int width, int height) {
String base64Image = null;
try {
base64Image = Base64Utils.encodeToString(QrCodeUtil.generatePng(text,width,height));
}catch (Exception e){
throw new ServiceException("生成二维码异常");
}
Map<String, Object> map = new HashMap<>();
map.put("code", base64Image);
return map;
}
}

View File

@ -23,6 +23,8 @@ public interface ErrorCodeConstants {
ErrorCode AUTH_THIRD_LOGIN_NOT_BIND = new ErrorCode(1004003005, "未绑定账号,需要进行绑定");
ErrorCode AUTH_WEIXIN_MINI_APP_PHONE_CODE_ERROR = new ErrorCode(1004003006, "获得手机号失败");
ErrorCode USER_PHONE_EXISTS = new ErrorCode(1004003007, "手机号已经存在");
// ========== 用户收件地址 1004004000 ==========
ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1004004000, "用户收件地址不存在");

View File

@ -16,7 +16,7 @@ public class PromoterBaseVO {
@Schema(description = "组织id", required = true, example = "18443")
@NotNull(message = "组织id不能为空")
private String orgId;
private String deptId;
@Schema(description = "推广员名称", required = true, example = "5841")
@NotEmpty(message = "推广员名称不能为空")

View File

@ -18,7 +18,7 @@ public class PromoterExcelVO {
private Long id;
@ExcelProperty("组织id")
private String orgId;
private String deptId;
@ExcelProperty("会员id")
private Long userId;

View File

@ -10,7 +10,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
public class PromoterExportReqVO {
@Schema(description = "组织id", example = "18443")
private String orgId;
private String deptId;
@Schema(description = "会员id", example = "5841")
private Long userId;

View File

@ -1,10 +1,15 @@
package cn.iocoder.yudao.module.member.controller.admin.promoter.vo;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.validation.Mobile;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 推广员分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ -12,9 +17,20 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
public class PromoterPageReqVO extends PageParam {
@Schema(description = "组织id", example = "18443")
private String orgId;
private String deptId;
@Schema(description = "会员id", example = "5841")
private Long userId;
@Schema(description = "推广员名称", example = "5841")
private String nickname;
@Schema(description = "推广员手机号", example = "15601691300")
private String mobile;
/**
*
* <p>
* {@link CommonStatusEnum}
*/
@Schema(description = "帐号状态")
private Integer status;
}

View File

@ -5,9 +5,11 @@ import cn.hutool.core.date.LocalDateTimeUtil;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoReqVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.UserSpreadBannerVO;
import cn.iocoder.yudao.module.member.convert.user.UserConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
import cn.iocoder.yudao.module.member.service.promoter.PromoterService;
@ -22,6 +24,9 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@ -32,6 +37,7 @@ import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.FILE_IS_EMP
@RequestMapping("/member/user")
@Validated
@Slf4j
public class AppUserController {
@Resource
@ -43,6 +49,7 @@ public class AppUserController {
@PutMapping("/update-nickname")
@Operation(summary = "修改用户昵称")
@PreAuthenticated
@TenantIgnore
public CommonResult<Boolean> updateUserNickname(@RequestParam("nickname") String nickname) {
userService.updateUserNickname(getLoginUserId(), nickname);
return success(true);
@ -51,6 +58,7 @@ public class AppUserController {
@PostMapping("/update-avatar")
@Operation(summary = "修改用户头像")
@PreAuthenticated
@TenantIgnore
public CommonResult<String> updateUserAvatar(@RequestParam("avatarFile") MultipartFile file) throws Exception {
if (file.isEmpty()) {
throw exception(FILE_IS_EMPTY);
@ -62,6 +70,7 @@ public class AppUserController {
@GetMapping("/get")
@Operation(summary = "获得基本信息")
@PreAuthenticated
@TenantIgnore
public CommonResult<AppUserInfoRespVO> getUserInfo() {
MemberUserDO user = userService.getUser(getLoginUserId());
AppUserInfoRespVO appUserInfoRespVO = UserConvert.INSTANCE.convert(user);
@ -76,6 +85,7 @@ public class AppUserController {
@PostMapping("/update-mobile")
@Operation(summary = "修改用户手机")
@PreAuthenticated
@TenantIgnore
public CommonResult<Boolean> updateMobile(@RequestBody @Valid AppUserUpdateMobileReqVO reqVO) {
userService.updateUserMobile(getLoginUserId(), reqVO);
return success(true);
@ -83,6 +93,7 @@ public class AppUserController {
@PostMapping("/update-user")
@Operation(summary = "修改用户信息")
@PreAuthenticated
@TenantIgnore
public CommonResult<Boolean> updateMobile(@RequestBody @Validated AppUserInfoReqVO req) {
req.setId(getLoginUserId());
MemberUserDO userDO = new MemberUserDO();
@ -92,6 +103,19 @@ public class AppUserController {
userService.updateById(userDO);
return success(true);
}
/**
*
*/
@Operation(summary = "推广海报图")
@RequestMapping(value = "/spread/banner", method = RequestMethod.GET)
public CommonResult<List<UserSpreadBannerVO>> getSpreadBannerList() {
List<UserSpreadBannerVO> list = new ArrayList<>();
UserSpreadBannerVO userSpreadBannerVO = new UserSpreadBannerVO();
userSpreadBannerVO.setId(1);
userSpreadBannerVO.setPic("http://192.168.1.147:48080/admin-api/infra/file/4/get/431efea27162d536d35f7b3c0b844ede98a6ba58f4fd72ac7181e7ee5ebae77a.jpg");
userSpreadBannerVO.setTitle("推广背景图");
list.add(userSpreadBannerVO);
return CommonResult.success(list);
}
}

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.member.controller.app.user.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
*
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEBCRMEB
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(description="用户推广海报")
public class UserSpreadBannerVO implements Serializable {
private static final long serialVersionUID=1L;
@Schema(description = "id")
private Integer id;
@Schema(description = "名称")
private String title;
@Schema(description = "背景图")
private String pic;
}

View File

@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.member.dal.dataobject.promoter;
import lombok.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
/**
@ -32,10 +34,12 @@ public class PromoterDO implements Serializable {
/**
* id
*/
private Long orgId;
private Long deptId;
/**
* id
*/
private Long userId;
private LocalDateTime createTime;
}

View File

@ -21,14 +21,13 @@ public interface PromoterMapper extends BaseMapperX<PromoterDO> {
default PageResult<PromoterDO> selectPage(PromoterPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<PromoterDO>()
.eqIfPresent(PromoterDO::getOrgId, reqVO.getOrgId())
.eqIfPresent(PromoterDO::getUserId, reqVO.getUserId())
.eqIfPresent(PromoterDO::getDeptId, reqVO.getDeptId())
.orderByDesc(PromoterDO::getId));
}
IPage<PromoterRespVO> findListPage(IPage<PromoterRespVO> page, @Param("data") PromoterPageReqVO data);
default List<PromoterDO> selectList(PromoterExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<PromoterDO>()
.eqIfPresent(PromoterDO::getOrgId, reqVO.getOrgId())
.eqIfPresent(PromoterDO::getDeptId, reqVO.getDeptId())
.eqIfPresent(PromoterDO::getUserId, reqVO.getUserId())
.orderByDesc(PromoterDO::getId));
}

View File

@ -1,10 +1,12 @@
package cn.iocoder.yudao.module.member.service.promoter;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
@ -17,8 +19,10 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.validation.Validator;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.time.LocalDateTime;
import java.util.*;
import cn.iocoder.yudao.module.member.controller.admin.promoter.vo.*;
import cn.iocoder.yudao.module.member.dal.dataobject.promoter.PromoterDO;
@ -75,18 +79,28 @@ public class PromoterServiceImpl implements PromoterService {
throw new ServiceException(PROMOTER_EXISTS);
}
promoter.setUserId(memberUserDO.getId());
promoter.setCreateTime(LocalDateTime.now());
promoterMapper.insert(promoter);
// 返回
return promoter.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updatePromoter(PromoterUpdateReqVO updateReqVO) {
// 校验存在
validatePromoterExists(updateReqVO.getId());
PromoterDO promoterDO = validatePromoterExists(updateReqVO.getId());
// 更新
PromoterDO updateObj = PromoterConvert.INSTANCE.convert(updateReqVO);
promoterMapper.updateById(updateObj);
MemberUserDO memberUserDO = memberUserService.getUserByMobile(updateReqVO.getMobile());
if(memberUserDO!=null&&!promoterDO.getUserId().equals(memberUserDO.getId())){
throw new ServiceException(ErrorCodeConstants.USER_PHONE_EXISTS);
}else {
memberUserDO.setMobile(updateReqVO.getMobile());
memberUserDO.setNickname(updateReqVO.getNickname());
memberUserService.updateById(memberUserDO);
}
}
@Override
@ -97,10 +111,12 @@ public class PromoterServiceImpl implements PromoterService {
promoterMapper.deleteById(id);
}
private void validatePromoterExists(Long id) {
if (promoterMapper.selectById(id) == null) {
private PromoterDO validatePromoterExists(Long id) {
PromoterDO promoterDO = promoterMapper.selectById(id);
if (promoterDO == null) {
throw exception(PROMOTER_NOT_EXISTS);
}
return promoterDO;
}
@Override
@ -127,6 +143,13 @@ public class PromoterServiceImpl implements PromoterService {
@Override
public PageResult<PromoterRespVO> getPromoterPage(PromoterPageReqVO pageReqVO) {
Page<PromoterRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
if(StrUtil.isNotBlank(pageReqVO.getDeptId())){
DeptRespDTO deptRespDTO = deptApi.getDept(Long.parseLong(pageReqVO.getDeptId()));
if(deptRespDTO!=null){
pageReqVO.setDeptId(deptRespDTO.getParentOrganizationIds());
}
}
promoterMapper.findListPage(page,pageReqVO);
return new PageResult<>(page.getRecords(), page.getTotal());
}
@ -174,6 +197,7 @@ public class PromoterServiceImpl implements PromoterService {
PromoterDO promoter = new PromoterDO();
promoter.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
promoter.setUserId(memberUserDO.getId());
promoter.setCreateTime(LocalDateTime.now());
Long count = promoterMapper.selectCount(Wrappers.lambdaQuery(PromoterDO.class).eq(PromoterDO::getUserId,memberUserDO.getId()));
if(count>0){
respVO.getFailureUsernames().put(importUser.getNickName(), "已经是推广员");
@ -184,7 +208,7 @@ public class PromoterServiceImpl implements PromoterService {
respVO.getFailureUsernames().put(importUser.getNickName(), "组织不存在");
return;
}
promoter.setOrgId(deptRespDTO.getId());
promoter.setDeptId(deptRespDTO.getId());
promoterMapper.insert(promoter);
respVO.getCreateUsernames().add(importUser.getNickName());
return;

View File

@ -10,9 +10,23 @@
-->
<select id="findListPage" resultType="cn.iocoder.yudao.module.member.controller.admin.promoter.vo.PromoterRespVO">
select a.id,a.user_id,a.org_id,b.nickname,b.status,b.mobile,c.parent_organization_name as 'orgName' from member_promoter a
select a.id,a.user_id,a.dept_id,b.nickname,b.status,b.mobile,c.parent_organization_name as 'orgName' from member_promoter a
left join member_user b on a.user_id = b.id
left join system_dept c on c.id=a.org_id
left join system_dept c on c.id=a.dept_id
<where>
<if test="data.deptId!=null and data.deptId!=''">
and c.parent_organization_ids like CONCAT(#{data.deptId},'%')
</if>
<if test="data.status!=null">
and b.status =#{data.status}
</if>
<if test="data.nickname!=null and data.nickname!=''">
and b.nickname like CONCAT('%',#{data.nickname},'%')
</if>
<if test="data.mobile!=null and data.mobile!=''">
and b.mobile like CONCAT('%',#{data.mobile},'%')
</if>
</where>
</select>
</mapper>

View File

@ -19,5 +19,15 @@ public class DeptSimpleRespVO {
@Schema(description = "父部门 ID", required = true, example = "1024")
private Long parentId;
/**
*
*/
private String parentOrganizationIds;
/**
*
*/
private String parentOrganizationName;
}

View File

@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -30,6 +31,7 @@ public class AppTenantController {
@GetMapping("/get")
@Operation(summary = "获得租户")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PermitAll
public CommonResult<TenantRespVO> getTenant(@RequestParam("id") Long id) {
TenantDO tenant = tenantService.getTenant(id);
return success(TenantConvert.INSTANCE.convert(tenant));

View File

@ -16,4 +16,4 @@ ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms512m -Xmx512m"
EXPOSE 48080
## 启动后端项目
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar app.jar
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar -Dspring.profiles.active=dev app.jar

View File

@ -108,8 +108,6 @@ yudao:
permit-all_urls:
- /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,不需要登录
- /admin-api/notice/wxpay/**
- /app-api/tenant/get
- /admin-api/system/tenant/get-id-by-name
websocket:
enable: true # websocket的开关
path: /websocket/message # 路径

View File

@ -66,7 +66,7 @@
</springProfile>
<!-- 其它环境 -->
<springProfile name="dev,test,stage,prod,default">
<root level="INFO">
<root level="DEBUG">
<appender-ref ref="STDOUT"/>
<appender-ref ref="ASYNC"/>
<appender-ref ref="GRPC"/>

View File

@ -5,8 +5,8 @@ ENV = 'development'
VUE_APP_TITLE = 创盈商户管理系统
# 芋道管理系统/开发环境
#VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/admin-api'
VUE_APP_BASE_API = 'http://192.168.1.147:48080'
VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/cyywl-api'
#VUE_APP_BASE_API = 'http://192.168.1.147:48080'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -9,7 +9,7 @@ VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/admin-api'
#VUE_APP_BASE_API = 'http://192.168.2.71'
# 根据服务器或域名修改
PUBLIC_PATH = 'https://cmx.bskies.cc:8000/cy-admin/'
PUBLIC_PATH = 'http://192.168.2.71/'
# 二级部署路径
VUE_APP_APP_NAME ='/cy-admin/'

View File

@ -3,8 +3,8 @@
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="所属组织" prop="orgId">
<treeselect style="width: 240px;" v-model="queryParams.orgId" :options="deptOptions" :show-count="true"
<el-form-item label="所属组织" prop="deptId">
<treeselect style="width: 240px;" v-model="queryParams.deptId" :options="deptOptions" :show-count="true"
:clearable="false"
placeholder="请选择所属组织" :normalizer="normalizer"/>
</el-form-item>
@ -75,8 +75,8 @@
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="所属组织" prop="orgId">
<treeselect style="width: 240px;" v-model="form.orgId" :options="deptOptions" :show-count="true"
<el-form-item label="所属组织" prop="deptId">
<treeselect style="width: 240px;" v-model="form.deptId" :options="deptOptions" :show-count="true"
:clearable="false"
placeholder="请选择所属组织" :normalizer="normalizer"/>
</el-form-item>
@ -213,14 +213,14 @@ export default {
queryParams: {
pageNo: 1,
pageSize: 10,
orgId: null,
deptId: null,
userId: null,
},
//
form: {},
//
rules: {
orgId: [{
deptId: [{
required: true,
message: '请选择所属组织',
trigger: 'blur'
@ -309,7 +309,7 @@ export default {
reset() {
this.form = {
id: undefined,
orgId: undefined,
deptId: undefined,
userId: undefined,
};
this.resetForm('form');