Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangzhijiang
2022-03-04 15:10:03 +08:00
44 changed files with 965 additions and 836 deletions
@@ -146,6 +146,13 @@ public interface CommonConstant {
*/ */
public static final Integer USER_UNFREEZE = 1; public static final Integer USER_UNFREEZE = 1;
public static final Integer USER_FREEZE = 2; public static final Integer USER_FREEZE = 2;
/**
* 员工种类(1-正式工,2-临时工)
*/
public static final String WORKER_TYPE_1 = "1";
public static final String WORKER_TYPE_2 = "2";
/**字典翻译文本后缀*/ /**字典翻译文本后缀*/
public static final String DICT_TEXT_SUFFIX = "_dictText"; public static final String DICT_TEXT_SUFFIX = "_dictText";
@@ -47,6 +47,7 @@ public class OnlCgformField implements Serializable {
private Integer orderNum; private Integer orderNum;
private String updateBy; private String updateBy;
private String showArea; private String showArea;
private String dictId;
@JsonFormat( @JsonFormat(
timezone = "GMT+8", timezone = "GMT+8",
pattern = "yyyy-MM-dd HH:mm:ss" pattern = "yyyy-MM-dd HH:mm:ss"
@@ -75,6 +76,14 @@ public class OnlCgformField implements Serializable {
private String queryMustInput; private String queryMustInput;
private String sortFlag; private String sortFlag;
public String getDictId() {
return dictId;
}
public void setDictId(String dictId) {
this.dictId = dictId;
}
public String getShowArea() { public String getShowArea() {
return showArea; return showArea;
} }
@@ -48,7 +48,7 @@ import java.util.stream.Collectors;
public class SysCategoryController { public class SysCategoryController {
@Autowired @Autowired
private ISysCategoryService sysCategoryService; private ISysCategoryService sysCategoryService;
/** /**
* 分页列表查询 * 分页列表查询
* @param sysCategory * @param sysCategory
@@ -67,7 +67,7 @@ public class SysCategoryController {
sysCategory.setPid("0"); sysCategory.setPid("0");
} }
Result<IPage<SysCategory>> result = new Result<IPage<SysCategory>>(); Result<IPage<SysCategory>> result = new Result<IPage<SysCategory>>();
//--author:os_chengtgen---date:20190804 -----for: 分类字典页面显示错误,issues:377--------start //--author:os_chengtgen---date:20190804 -----for: 分类字典页面显示错误,issues:377--------start
//QueryWrapper<SysCategory> queryWrapper = QueryGenerator.initQueryWrapper(sysCategory, req.getParameterMap()); //QueryWrapper<SysCategory> queryWrapper = QueryGenerator.initQueryWrapper(sysCategory, req.getParameterMap());
QueryWrapper<SysCategory> queryWrapper = new QueryWrapper<SysCategory>(); QueryWrapper<SysCategory> queryWrapper = new QueryWrapper<SysCategory>();
@@ -126,7 +126,7 @@ public class SysCategoryController {
} }
return result; return result;
} }
/** /**
* 编辑 * 编辑
* @param sysCategory * @param sysCategory
@@ -145,7 +145,7 @@ public class SysCategoryController {
} }
return result; return result;
} }
/** /**
* 通过id删除 * 通过id删除
* @param id * @param id
@@ -162,10 +162,10 @@ public class SysCategoryController {
this.sysCategoryService.deleteSysCategory(id); this.sysCategoryService.deleteSysCategory(id);
result.success("删除成功!"); result.success("删除成功!");
} }
return result; return result;
} }
/** /**
* 批量删除 * 批量删除
* @param ids * @param ids
@@ -183,7 +183,7 @@ public class SysCategoryController {
} }
return result; return result;
} }
/** /**
* 通过id查询 * 通过id查询
* @param id * @param id
@@ -285,9 +285,9 @@ public class SysCategoryController {
} }
return Result.error("文件导入失败!"); return Result.error("文件导入失败!");
} }
/** /**
* 加载单个数据 用于回显 * 加载单个数据 用于回显
*/ */
@@ -296,7 +296,7 @@ public class SysCategoryController {
public Result<SysCategory> loadOne(@RequestParam(name="field") String field,@RequestParam(name="val") String val) { public Result<SysCategory> loadOne(@RequestParam(name="field") String field,@RequestParam(name="val") String val) {
Result<SysCategory> result = new Result<SysCategory>(); Result<SysCategory> result = new Result<SysCategory>();
try { try {
QueryWrapper<SysCategory> query = new QueryWrapper<SysCategory>(); QueryWrapper<SysCategory> query = new QueryWrapper<SysCategory>();
query.eq(field, val); query.eq(field, val);
List<SysCategory> ls = this.sysCategoryService.list(query); List<SysCategory> ls = this.sysCategoryService.list(query);
@@ -317,7 +317,7 @@ public class SysCategoryController {
} }
return result; return result;
} }
/** /**
* 加载节点的子数据 * 加载节点的子数据
*/ */
@@ -336,7 +336,7 @@ public class SysCategoryController {
} }
return result; return result;
} }
/** /**
* 加载一级节点/如果是同步 则所有数据 * 加载一级节点/如果是同步 则所有数据
*/ */
@@ -358,7 +358,7 @@ public class SysCategoryController {
} }
return result; return result;
} }
/** /**
* 递归求子节点 同步加载用到 * 递归求子节点 同步加载用到
*/ */
@@ -518,7 +518,7 @@ public class SysCategoryController {
@GetMapping("/getSysCategoryTree") @GetMapping("/getSysCategoryTree")
public Result getSysCategoryTree() { public Result getSysCategoryTree() {
return sysCategoryService.getSysCategoryTree(); return Result.OK(sysCategoryService.getSysCategoryTree());
} }
} }
@@ -1,20 +1,14 @@
package com.jero.modules.system.controller; package com.jero.modules.system.controller;
import java.io.IOException;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.system.vo.SysDepartTreeModel; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.shiro.SecurityUtils;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.constant.CacheConstant; import com.jero.common.constant.CacheConstant;
import com.jero.common.constant.CommonConstant; import com.jero.common.constant.CommonConstant;
import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.util.JwtUtil; import com.jero.common.system.util.JwtUtil;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.common.system.vo.SysDepartTreeModel;
import com.jero.common.util.ImportExcelUtil; import com.jero.common.util.ImportExcelUtil;
import com.jero.common.util.YouBianCodeUtil; import com.jero.common.util.YouBianCodeUtil;
import com.jero.common.util.oConvertUtils; import com.jero.common.util.oConvertUtils;
@@ -24,6 +18,9 @@ import com.jero.modules.system.model.DepartIdModel;
import com.jero.modules.system.service.ISysDepartService; import com.jero.modules.system.service.ISysDepartService;
import com.jero.modules.system.service.ISysUserDepartService; import com.jero.modules.system.service.ISysUserDepartService;
import com.jero.modules.system.service.ISysUserService; import com.jero.modules.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -38,9 +35,10 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j; import java.io.IOException;
import java.util.*;
/** /**
* <p> * <p>
@@ -299,6 +297,12 @@ public class SysDepartController {
//Step.2 AutoPoi 导出Excel //Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<SysDepart> pageList = sysDepartService.list(queryWrapper); List<SysDepart> pageList = sysDepartService.list(queryWrapper);
for(SysDepart depart : pageList){
if(StringUtils.isNotBlank(depart.getParentId())){
SysDepart parentDepart = sysDepartService.getById(depart.getParentId());
depart.setParentName(parentDepart.getDepartName());
}
}
//按字典排序 //按字典排序
Collections.sort(pageList, new Comparator<SysDepart>() { Collections.sort(pageList, new Comparator<SysDepart>() {
@Override @Override
@@ -335,7 +335,7 @@ public class SysDictController {
return result; return result;
} }
/** /**
* 查询选项内容--数据字典名称 * 查询被删除的列表
* @return * @return
*/ */
@GetMapping(value = "/deleteList") @GetMapping(value = "/deleteList")
@@ -602,9 +602,10 @@ public class SysDictController {
} }
/** /**
* 查询被删除的列表 * 查询选项内容
* @return *
*/ */
@GetMapping(value = "/queryDictName") @GetMapping(value = "/queryDictName")
public Result<List<SysDict>> queryDictName(SysDict sysDict) { public Result<List<SysDict>> queryDictName(SysDict sysDict) {
@@ -3,35 +3,36 @@ package com.jero.modules.system.controller;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.PermissionData; import com.jero.common.aspect.annotation.PermissionData;
import com.jero.common.constant.CommonConstant; import com.jero.common.constant.CommonConstant;
import com.jero.common.system.api.ISysBaseAPI; import com.jero.common.system.api.ISysBaseAPI;
import com.jero.modules.base.service.BaseCommonService;
import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.util.JwtUtil; import com.jero.common.system.util.JwtUtil;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.*; import com.jero.common.util.ImportExcelUtil;
import com.jero.common.util.PasswordUtil;
import com.jero.common.util.RedisUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.modules.base.service.BaseCommonService;
import com.jero.modules.system.entity.*; import com.jero.modules.system.entity.*;
import com.jero.modules.system.model.DepartIdModel; import com.jero.modules.system.model.DepartIdModel;
import com.jero.modules.system.model.SysUserSysDepartModel; import com.jero.modules.system.model.SysUserSysDepartModel;
import com.jero.modules.system.service.*; import com.jero.modules.system.service.*;
import com.jero.modules.system.vo.SysDepartUsersVO; import com.jero.modules.system.vo.SysDepartUsersVO;
import com.jero.modules.system.vo.SysUserRoleVO; import com.jero.modules.system.vo.SysUserRoleVO;
import org.apache.shiro.subject.Subject; import io.swagger.annotations.Api;
import org.checkerframework.framework.qual.RequiresQualifier; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -61,6 +62,7 @@ import java.util.stream.Collectors;
*/ */
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "用户管理")
@RequestMapping("/sys/user") @RequestMapping("/sys/user")
public class SysUserController { public class SysUserController {
@Autowired @Autowired
@@ -104,6 +106,7 @@ public class SysUserController {
* @param req * @param req
* @return * @return
*/ */
@ApiOperation(value = "用户管理-分页查询")
@RequiresPermissions("sys:user:list") @RequiresPermissions("sys:user:list")
@PermissionData(pageComponent = "system/UserList") @PermissionData(pageComponent = "system/UserList")
@RequestMapping(value = "/page", method = RequestMethod.GET) @RequestMapping(value = "/page", method = RequestMethod.GET)
@@ -647,6 +650,7 @@ public class SysUserController {
/** /**
* 部门用户列表 * 部门用户列表
*/ */
@ApiOperation(value = "用户管理-查询组织下的用户列表")
@RequestMapping(value = "/departUserList", method = RequestMethod.GET) @RequestMapping(value = "/departUserList", method = RequestMethod.GET)
@RequiresPermissions("sys:user:list") @RequiresPermissions("sys:user:list")
public Result<IPage<SysUser>> departUserList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, public Result<IPage<SysUser>> departUserList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@@ -654,16 +658,20 @@ public class SysUserController {
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>(); Result<IPage<SysUser>> result = new Result<IPage<SysUser>>();
Page<SysUser> page = new Page<SysUser>(pageNo, pageSize); Page<SysUser> page = new Page<SysUser>(pageNo, pageSize);
String depId = req.getParameter("depId"); String depId = req.getParameter("depId");
String username = req.getParameter("username"); // String username = req.getParameter("username");
String username = null;
//根据部门ID查询,当前和下级所有的部门IDS //根据部门ID查询,当前和下级所有的部门IDS
List<String> subDepids = new ArrayList<>(); List<String> subDepids = new ArrayList<>();
//部门id为空时,查询我的部门下所有用户 //部门id为空时,查询我的部门下所有用户
if(oConvertUtils.isEmpty(depId)){ if(oConvertUtils.isEmpty(depId)){
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LambdaQueryWrapper<SysDepart> queryWrapper = new LambdaQueryWrapper<>();
int userIdentity = user.getUserIdentity() != null?user.getUserIdentity():CommonConstant.USER_IDENTITY_1; queryWrapper.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0);
if(oConvertUtils.isNotEmpty(userIdentity) && userIdentity == CommonConstant.USER_IDENTITY_2 ){ subDepids = sysDepartService.list(queryWrapper).stream().map(SysDepart::getId).collect(Collectors.toList());
subDepids = sysDepartService.getMySubDepIdsByDepId(user.getDepartIds()); // LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
} // int userIdentity = user.getUserIdentity() != null?user.getUserIdentity():CommonConstant.USER_IDENTITY_1;
// if(oConvertUtils.isNotEmpty(userIdentity) && userIdentity == CommonConstant.USER_IDENTITY_2 ){
// subDepids = sysDepartService.getMySubDepIdsByDepId(user.getDepartIds());
// }
}else{ }else{
subDepids = sysDepartService.getSubDepIdsByDepId(depId); subDepids = sysDepartService.getSubDepIdsByDepId(depId);
} }
@@ -13,10 +13,14 @@ public class SysCategoryTreeVO {
private String id; private String id;
private String key;
private String parentId; private String parentId;
private String title; private String title;
private String dictId;
private List<SysCategoryTreeVO> children; private List<SysCategoryTreeVO> children;
} }
@@ -1,11 +1,11 @@
package com.jero.modules.system.entity; package com.jero.modules.system.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import com.jero.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@@ -32,46 +32,49 @@ public class SysDepart implements Serializable {
/**父机构ID*/ /**父机构ID*/
private String parentId; private String parentId;
/**机构/部门名称*/ /**机构/部门名称*/
@Excel(name="机构/部门名称",width=15) @Excel(name="机构名称",width=15)
private String departName; private String departName;
/**英文名*/ /**英文名*/
@Excel(name="英文名",width=15) // @Excel(name="英文名",width=15)
private String departNameEn; private String departNameEn;
/**缩写*/ /**缩写*/
private String departNameAbbr; private String departNameAbbr;
/**排序*/
@Excel(name="排序",width=15)
private Integer departOrder;
/**描述*/ /**描述*/
@Excel(name="描述",width=15) // @Excel(name="描述",width=15)
private String description; private String description;
/**机构类别 1公司,2组织机构,2岗位*/
@Excel(name="机构类别",width=15,dicCode="org_category")
private String orgCategory;
/**机构类型*/ /**机构类型*/
private String orgType; private String orgType;
@Excel(name = "上级部门", width = 15)
@TableField(exist = false)
private String parentName;
/**机构编码*/ /**机构编码*/
@Excel(name="机构编码",width=15) @Excel(name="机构编码",width=15)
private String orgCode; private String orgCode;
/**机构类别 1公司,2组织机构,2岗位*/
@Excel(name="机构类型",width=15,dicCode="org_category")
private String orgCategory;
/**排序*/
@Excel(name="排序",width=15)
private Integer departOrder;
/**父级机构编码*/ /**父级机构编码*/
private String parentCode; private String parentCode;
/**手机号*/ /**手机号*/
@Excel(name="手机号",width=15) // @Excel(name="手机号",width=15)
private String mobile; private String mobile;
/**传真*/ /**传真*/
@Excel(name="传真",width=15) // @Excel(name="传真",width=15)
private String fax; private String fax;
/**地址*/ /**地址*/
@Excel(name="地址",width=15) // @Excel(name="地址",width=15)
private String address; private String address;
/**备注*/ /**备注*/
@Excel(name="备注",width=15) // @Excel(name="备注",width=15)
private String memo; private String memo;
/**状态(1启用,0不启用)*/ /**状态(1启用,0不启用)*/
@Dict(dicCode = "depart_status") // @Dict(dicCode = "depart_status")
private String status; private String status;
/**删除状态(0,正常,1已删除)*/ /**删除状态(0,正常,1已删除)*/
@Dict(dicCode = "del_flag") // @Dict(dicCode = "del_flag")
private String delFlag; private String delFlag;
/**创建人*/ /**创建人*/
private String createBy; private String createBy;
@@ -106,7 +106,7 @@ public class SysDict implements Serializable {
/** /**
* 表单控件类型 * 表单控件类型
*/ */
@Excel(name = "标签类型 1下拉选择 2树形结构", width = 15) @Excel(name = "标签类型 1下拉选择 2树形结构", width = 15,dicCode = "attribute_type")
@ApiModelProperty(value = "标签类型 1下拉选择 2树形结构") @ApiModelProperty(value = "标签类型 1下拉选择 2树形结构")
@Dict(dicCode = "attribute_type") @Dict(dicCode = "attribute_type")
private java.lang.String attributeType; private java.lang.String attributeType;
@@ -1,23 +1,19 @@
package com.jero.modules.system.entity; package com.jero.modules.system.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.jero.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable; import com.jero.common.aspect.annotation.Dict;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/** /**
* <p> * <p>
@@ -43,13 +39,13 @@ public class SysUser implements Serializable {
/** /**
* 登录账号 * 登录账号
*/ */
@Excel(name = "登录账号", width = 15) @Excel(name = "账号", width = 15)
private String username; private String username;
/** /**
* 真实姓名 * 真实姓名
*/ */
@Excel(name = "真实姓名", width = 15) @Excel(name = "姓名", width = 15)
private String realname; private String realname;
/** /**
@@ -67,13 +63,13 @@ public class SysUser implements Serializable {
/** /**
* 头像 * 头像
*/ */
@Excel(name = "头像", width = 15,type = 2) // @Excel(name = "头像", width = 15,type = 2)
private String avatar; private String avatar;
/** /**
* 生日 * 生日
*/ */
@Excel(name = "生日", width = 15, format = "yyyy-MM-dd") // @Excel(name = "生日", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private Date birthday; private Date birthday;
@@ -81,20 +77,20 @@ public class SysUser implements Serializable {
/** /**
* 性别(1:男 2:女) * 性别(1:男 2:女)
*/ */
@Excel(name = "性别", width = 15,dicCode="sex") // @Excel(name = "性别", width = 15,dicCode="sex")
@Dict(dicCode = "sex") @Dict(dicCode = "sex")
private Integer sex; private Integer sex;
/** /**
* 电子邮件 * 电子邮件
*/ */
@Excel(name = "电子邮件", width = 15) // @Excel(name = "电子邮件", width = 15)
private String email; private String email;
/** /**
* 电话 * 电话
*/ */
@Excel(name = "电话", width = 15) // @Excel(name = "电话", width = 15)
private String phone; private String phone;
/** /**
@@ -103,32 +99,26 @@ public class SysUser implements Serializable {
private String orgCode; private String orgCode;
/**部门名称*/ /**部门名称*/
@Excel(name = "部门", width = 15)
private transient String orgCodeTxt; private transient String orgCodeTxt;
/**
* 状态(1:正常 2:冻结 )
*/
@Excel(name = "状态", width = 15,dicCode="user_status")
@Dict(dicCode = "user_status")
private Integer status;
/** /**
* 删除状态(0,正常,1已删除) * 删除状态(0,正常,1已删除)
*/ */
@Excel(name = "删除状态", width = 15,dicCode="del_flag") // @Excel(name = "删除状态", width = 15,dicCode="del_flag")
@TableLogic @TableLogic
private Integer delFlag; private Integer delFlag;
/** /**
* 工号,唯一键 * 工号,唯一键
*/ */
@Excel(name = "工号", width = 15) @Excel(name = "工号", width = 15)
private String workNo; private String workNo;
/** /**
* 座机号 * 座机号
*/ */
@Excel(name = "座机号", width = 15) // @Excel(name = "座机号", width = 15)
private String telephone; private String telephone;
/** /**
@@ -158,13 +148,13 @@ public class SysUser implements Serializable {
/** /**
* 身份(0 普通成员 1 上级) * 身份(0 普通成员 1 上级)
*/ */
@Excel(name="1普通成员 2上级)",width = 15) // @Excel(name="1普通成员 2上级)",width = 15)
private Integer userIdentity; private Integer userIdentity;
/** /**
* 负责部门 * 负责部门
*/ */
@Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id") // @Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id") @Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
private String departIds; private String departIds;
@@ -177,4 +167,15 @@ public class SysUser implements Serializable {
private String clientId; private String clientId;
private String thirdId;//用户域账号 private String thirdId;//用户域账号
@Excel(name = "员工类型", width = 15, dicCode = "worker_type")
@Dict(dicCode = "worker_type")
private String workerType;//员工种类(1-正式工,2-临时工)
/**
* 状态(1:正常 2:冻结 )
*/
@Excel(name = "状态", width = 15,dicCode="user_status")
@Dict(dicCode = "user_status")
private Integer status;
} }
@@ -55,6 +55,6 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
* @return * @return
*/ */
@Select("UPDATE sys_depart t1 JOIN sys_depart t2 ON t1.parent_code = t2.org_code SET t1.parent_id = t2.id") @Select("UPDATE sys_depart t1 JOIN sys_depart t2 ON t1.parent_code = t2.org_code SET t1.parent_id = t2.id")
int updateAllParentId(); void updateAllParentId();
} }
@@ -3,28 +3,34 @@
<mapper namespace="com.jero.modules.system.mapper.SysDepartMapper"> <mapper namespace="com.jero.modules.system.mapper.SysDepartMapper">
<select id="queryUserDeparts" parameterType="String" resultType="com.jero.modules.system.entity.SysDepart"> <select id="queryUserDeparts" parameterType="String" resultType="com.jero.modules.system.entity.SysDepart">
select * from sys_depart where id IN ( select dep_id from sys_user_depart where user_id = #{userId} ) select d.*
from sys_depart d, sys_depart_role_user dru, sys_depart_role dr
WHERE d.id = dr.depart_id
and dr.id = dru.drole_id
and dru.user_id = #{userId}
</select> </select>
<!-- 根据username查询所拥有的部门 --> <!-- 根据username查询所拥有的部门 -->
<select id="queryDepartsByUsername" parameterType="String" resultType="com.jero.modules.system.entity.SysDepart"> <select id="queryDepartsByUsername" parameterType="String" resultType="com.jero.modules.system.entity.SysDepart">
SELECT * select d.*
FROM sys_depart from sys_depart d, sys_depart_role_user dru, sys_depart_role dr
WHERE id IN ( WHERE d.id = dr.depart_id
SELECT dep_id and dr.id = dru.drole_id
FROM sys_user_depart and dru.user_id in (
WHERE user_id = (
SELECT id SELECT id
FROM sys_user FROM sys_user
WHERE username = #{username} WHERE username = #{username}
) )
)
</select> </select>
<!-- 根据部门Id查询,当前和下级所有部门IDS --> <!-- 根据部门Id查询,当前和下级所有部门IDS -->
<select id="getSubDepIdsByDepId" resultType="java.lang.String"> <select id="getSubDepIdsByDepId" resultType="java.lang.String">
select id from sys_depart where del_flag = '0' and org_code like concat((select org_code from sys_depart where id=#{departId}),'%') SELECT sd.id
</select> FROM sys_depart sd,( SELECT ( @nodes := queryChildrenTempNode (#{departId})) AS pids ) t
WHERE
FIND_IN_SET( sd.id, t.pids )
AND del_flag = 0
</select>
<!--根据部门编码获取我的部门下所有部门ids --> <!--根据部门编码获取我的部门下所有部门ids -->
<select id="getSubDepIdsByOrgCodes" resultType="java.lang.String"> <select id="getSubDepIdsByOrgCodes" resultType="java.lang.String">
@@ -46,7 +46,7 @@
<select id="getUserByDepIds" resultType="com.jero.modules.system.entity.SysUser"> <select id="getUserByDepIds" resultType="com.jero.modules.system.entity.SysUser">
select * from sys_user where del_flag = 0 select * from sys_user where del_flag = 0
<if test="departIds!=null and departIds.size()>0"> <if test="departIds!=null and departIds.size()>0">
and id in (select user_id from sys_user_depart where dep_id in and id in (select dru.user_id from sys_depart_role dr, sys_depart_role_user dru where dr.id = dru.drole_id and dr.depart_id in
<foreach collection="departIds" index="index" item="id" open="(" separator="," close=")"> <foreach collection="departIds" index="index" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
@@ -1,9 +1,9 @@
package com.jero.modules.system.service; package com.jero.modules.system.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.api.vo.Result;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.modules.system.entity.SysCategory; import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysCategoryTreeVO;
import com.jero.modules.system.model.TreeSelectModel; import com.jero.modules.system.model.TreeSelectModel;
import java.util.List; import java.util.List;
@@ -21,16 +21,16 @@ public interface ISysCategoryService extends IService<SysCategory> {
public static final String ROOT_PID_VALUE = "0"; public static final String ROOT_PID_VALUE = "0";
void addSysCategory(SysCategory sysCategory); void addSysCategory(SysCategory sysCategory);
void updateSysCategory(SysCategory sysCategory); void updateSysCategory(SysCategory sysCategory);
/** /**
* 根据父级编码加载分类字典的数据 * 根据父级编码加载分类字典的数据
* @param pcode * @param pcode
* @return * @return
*/ */
public List<TreeSelectModel> queryListByCode(String pcode) throws JeroBootException; public List<TreeSelectModel> queryListByCode(String pcode) throws JeroBootException;
/** /**
* 根据pid查询子节点集合 * 根据pid查询子节点集合
* @param pid * @param pid
@@ -70,5 +70,5 @@ public interface ISysCategoryService extends IService<SysCategory> {
* 获取树形结构 * 获取树形结构
* @return * @return
*/ */
Result getSysCategoryTree(); List<SysCategoryTreeVO> getSysCategoryTree();
} }
@@ -135,5 +135,5 @@ public interface ISysDepartService extends IService<SysDepart>{
* 更新所有组织的父节点id * 更新所有组织的父节点id
* @return * @return
*/ */
int updateAllParentId(); void updateAllParentId();
} }
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jero.common.constant.CommonConstant; import com.jero.common.constant.CommonConstant;
import com.jero.common.system.util.JwtUtil;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.PasswordUtil; import com.jero.common.util.PasswordUtil;
import com.jero.common.util.oConvertUtils; import com.jero.common.util.oConvertUtils;
@@ -20,11 +19,12 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.IOException; import java.io.IOException;
import java.io.PipedOutputStream;
import java.net.MalformedURLException;
import java.security.InvalidKeyException; import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.*; import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -245,6 +245,7 @@ public class SyncDataServiceImpl implements ISyncDataService{
sysUser.setThirdId(employee.getWorker_user_id()); sysUser.setThirdId(employee.getWorker_user_id());
sysUser.setActivitiSync(CommonConstant.ACT_SYNC_1); sysUser.setActivitiSync(CommonConstant.ACT_SYNC_1);
sysUser.setWorkNo(employee.getEmployee_id()); sysUser.setWorkNo(employee.getEmployee_id());
sysUser.setWorkerType("Employee".equals(employee.getWorker_type())? CommonConstant.WORKER_TYPE_1 : CommonConstant.WORKER_TYPE_2);
// sysUser.setUpdateTime(employee.getUpdate_time()); // sysUser.setUpdateTime(employee.getUpdate_time());
sysUser.setCreateTime(new Date()); sysUser.setCreateTime(new Date());
@@ -62,7 +62,7 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
sysCategory.setPid(categoryPid); sysCategory.setPid(categoryPid);
baseMapper.insert(sysCategory); baseMapper.insert(sysCategory);
} }
@Override @Override
public void updateSysCategory(SysCategory sysCategory) { public void updateSysCategory(SysCategory sysCategory) {
if(oConvertUtils.isEmpty(sysCategory.getPid())){ if(oConvertUtils.isEmpty(sysCategory.getPid())){
@@ -221,14 +221,14 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
} }
@Override @Override
public Result getSysCategoryTree() { public List<SysCategoryTreeVO> getSysCategoryTree() {
try { try {
List<SysCategory> list = super.baseMapper.selectList(new QueryWrapper<>()); List<SysCategory> list = super.baseMapper.selectList(new QueryWrapper<>());
List<SysCategoryTreeVO> tree = new ArrayList<>(); List<SysCategoryTreeVO> tree = new ArrayList<>();
if(CollectionUtils.isNotEmpty(list)){ if(CollectionUtils.isNotEmpty(list)){
tree = TreeUtils.getSysCategoryTree(list); tree = TreeUtils.getSysCategoryTree(list);
} }
return Result.OK(tree); return tree;
}catch (Exception ex){ }catch (Exception ex){
log.error("查询树形结构失败: " + ex.getMessage()); log.error("查询树形结构失败: " + ex.getMessage());
throw new JeroBootException("查询树形结构失败!"); throw new JeroBootException("查询树形结构失败!");
@@ -1,13 +1,12 @@
package com.jero.modules.system.service.impl; package com.jero.modules.system.service.impl;
import java.util.*;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jero.common.system.vo.SysDepartTreeModel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.commons.lang.StringUtils; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.CacheConstant; import com.jero.common.constant.CacheConstant;
import com.jero.common.constant.CommonConstant; import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.FillRuleConstant; import com.jero.common.constant.FillRuleConstant;
import com.jero.common.system.vo.SysDepartTreeModel;
import com.jero.common.util.FillRuleUtil; import com.jero.common.util.FillRuleUtil;
import com.jero.common.util.YouBianCodeUtil; import com.jero.common.util.YouBianCodeUtil;
import com.jero.modules.system.entity.*; import com.jero.modules.system.entity.*;
@@ -15,15 +14,14 @@ import com.jero.modules.system.mapper.*;
import com.jero.modules.system.model.DepartIdModel; import com.jero.modules.system.model.DepartIdModel;
import com.jero.modules.system.service.ISysDepartService; import com.jero.modules.system.service.ISysDepartService;
import com.jero.modules.system.util.FindsDepartsChildrenUtil; import com.jero.modules.system.util.FindsDepartsChildrenUtil;
import io.netty.util.internal.StringUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import java.util.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.netty.util.internal.StringUtil;
/** /**
* <p> * <p>
@@ -535,8 +533,10 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
return this.list(queryWrapper); return this.list(queryWrapper);
} }
@Autowired
private SysDepartMapper departMapper;
@Override @Override
public int updateAllParentId() { public void updateAllParentId() {
return this.updateAllParentId(); departMapper.updateAllParentId();
} }
} }
@@ -198,7 +198,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
@Override @Override
public List<SysDict> queryDictName(SysDict sysDict) { public List<SysDict> queryDictName(SysDict sysDict) {
QueryWrapper<SysDict> QueryWrapper = new QueryWrapper<>(); QueryWrapper<SysDict> QueryWrapper = new QueryWrapper<>();
QueryWrapper.select("id", "dict_name").eq("is_tag_dict",1); QueryWrapper.select("id", "dict_name","attribute_type").eq("is_tag_dict",1);
return list(QueryWrapper); return list(QueryWrapper);
} }
@@ -25,6 +25,8 @@ public class TreeUtils {
if (TREE_ROOT_CODE.equals(sysCategory.getPid())) { if (TREE_ROOT_CODE.equals(sysCategory.getPid())) {
SysCategoryTreeVO sysCategoryTreeVO = new SysCategoryTreeVO(); SysCategoryTreeVO sysCategoryTreeVO = new SysCategoryTreeVO();
sysCategoryTreeVO.setId(sysCategory.getId()); sysCategoryTreeVO.setId(sysCategory.getId());
sysCategoryTreeVO.setKey(sysCategory.getId());
sysCategoryTreeVO.setDictId(sysCategory.getSysDictId());
sysCategoryTreeVO.setTitle(sysCategory.getName()); sysCategoryTreeVO.setTitle(sysCategory.getName());
sysCategoryTreeVO.setParentId(sysCategory.getPid()); sysCategoryTreeVO.setParentId(sysCategory.getPid());
sysCategoryTreeVO.setChildren(getSysCategoryTreeChild(sysCategory.getId(), sysCategoryList)); sysCategoryTreeVO.setChildren(getSysCategoryTreeChild(sysCategory.getId(), sysCategoryList));
@@ -39,7 +41,9 @@ public class TreeUtils {
for (SysCategory sysCategory : sysCategoryList) { for (SysCategory sysCategory : sysCategoryList) {
if (id.equals(sysCategory.getPid())) { if (id.equals(sysCategory.getPid())) {
SysCategoryTreeVO sysCategoryTreeVO = new SysCategoryTreeVO(); SysCategoryTreeVO sysCategoryTreeVO = new SysCategoryTreeVO();
sysCategoryTreeVO.setDictId(sysCategory.getSysDictId());
sysCategoryTreeVO.setId(sysCategory.getId()); sysCategoryTreeVO.setId(sysCategory.getId());
sysCategoryTreeVO.setKey(sysCategory.getId());
sysCategoryTreeVO.setTitle(sysCategory.getName()); sysCategoryTreeVO.setTitle(sysCategory.getName());
sysCategoryTreeVO.setParentId(sysCategory.getPid()); sysCategoryTreeVO.setParentId(sysCategory.getPid());
sysCategoryTreeVO.setChildren(getSysCategoryTreeChild(sysCategory.getId(), sysCategoryList)); sysCategoryTreeVO.setChildren(getSysCategoryTreeChild(sysCategory.getId(), sysCategoryList));
@@ -12,6 +12,7 @@ public enum FieldTypeEnum {
// FILE("文件","file"), // FILE("文件","file"),
// DATE("日期","date"); // DATE("日期","date");
//属性类型 1输入框(字符串),2输入框(数字),3单选下拉框,4多选下拉框,5单日期选择,6多日期选择,7文件,8文本框,9人员选择,10标准选择 //属性类型 1输入框(字符串),2输入框(数字),3单选下拉框,4多选下拉框,5单日期选择,6多日期选择,7文件,8文本框,9人员选择,10标准选择
TREE("树形结构","0"),
TEXT_STRING("输入框(字符串)","1"), TEXT_STRING("输入框(字符串)","1"),
TEXT_NUMBER("输入框(数字)","2"), TEXT_NUMBER("输入框(数字)","2"),
PULL_SINGLE("单选下拉框","3"), PULL_SINGLE("单选下拉框","3"),
@@ -29,13 +29,12 @@ import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.subscribe.entity.OnlCgformSubscribe; import com.jero.modules.subscribe.entity.OnlCgformSubscribe;
import com.jero.modules.subscribe.service.IOnlCgformSubscribeService; import com.jero.modules.subscribe.service.IOnlCgformSubscribeService;
import com.jero.modules.system.entity.SysAnnouncement; import com.jero.modules.system.entity.SysAnnouncement;
import com.jero.modules.system.entity.SysAnnouncementSend; import com.jero.modules.system.entity.SysCategoryTreeVO;
import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.entity.SysUser; import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.mapper.SysUserMapper; import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.ISysAnnouncementSendService;
import com.jero.modules.system.service.ISysAnnouncementService; import com.jero.modules.system.service.ISysAnnouncementService;
import com.jero.modules.system.service.impl.SysBaseApiImpl; import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.tag.entity.OnlCgformArea; import com.jero.modules.tag.entity.OnlCgformArea;
import com.jero.modules.tag.service.impl.OnlCgformAreaServiceImpl; import com.jero.modules.tag.service.impl.OnlCgformAreaServiceImpl;
@@ -112,6 +111,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
private SysUserMapper sysUserMapper; private SysUserMapper sysUserMapper;
@Autowired @Autowired
private DomainUserRelService domainUserRelService; private DomainUserRelService domainUserRelService;
@Autowired
private SysCategoryServiceImpl sysCategoryService;
@Value(value = "${jero.path.upload}") @Value(value = "${jero.path.upload}")
private String uploadpath; private String uploadpath;
@@ -258,13 +259,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<OnlCgformArea> areaList = onlCgformAreaServiceImpl.queryList(onlCgformArea); List<OnlCgformArea> areaList = onlCgformAreaServiceImpl.queryList(onlCgformArea);
//字段属性 //字段属性
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(flag); List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(flag);
//过滤出字段为树形结构的
List<OnlCgformField> onlCgformFieldTree = fieldList.stream().filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
if (fieldList.size() != 0) { if (fieldList.size() != 0) {
//过滤出表单字段(is_show_form-->表单是否显示0否 1是) //过滤出表单字段(is_show_form-->表单是否显示0否 1是)
if ("add".equals(type)) { if ("add".equals(type)) {
//新增时,被代替标准在表单中不显示 //新增时,被代替标准在表单中不显示.
fieldList = fieldList.stream() fieldList = fieldList.stream()
.filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm())) && !e.getDbFieldName().equals("replaced_standard")) .filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowForm())) && !"replaced_standard" .equals(e.getDbFieldName()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} else { } else {
fieldList = fieldList.stream() fieldList = fieldList.stream()
@@ -273,6 +276,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
} }
//树形数据字典
List<SysCategoryTreeVO> sysCategoryTree = sysCategoryService.getSysCategoryTree();
List<Map<String, Object>> result = new ArrayList<>(); List<Map<String, Object>> result = new ArrayList<>();
for (OnlCgformArea onlCgformAreaTemp : areaList) { for (OnlCgformArea onlCgformAreaTemp : areaList) {
String areaName = ""; String areaName = "";
@@ -283,8 +288,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
List<OnlCgformField> fieldListTemp = fieldList.stream().filter(e -> onlCgformAreaTemp.getId().equals(e.getShowArea())).collect(Collectors.toList()); List<OnlCgformField> fieldListTemp = fieldList.stream().filter(e -> onlCgformAreaTemp.getId().equals(e.getShowArea())).collect(Collectors.toList());
for (OnlCgformField onlCgformField : fieldListTemp) { for (OnlCgformField onlCgformField : fieldListTemp) {
String dictId = onlCgformField.getDictId();
List<SysCategoryTreeVO> sysCategoryTreeVOList = new ArrayList<>();
if(StringUtils.isNotBlank(dictId)){
sysCategoryTreeVOList = sysCategoryTree.stream().filter(e -> dictId.equals(e.getDictId())).collect(Collectors.toList());
}
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
mapPut(cut, map, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName); mapPut(cut, map, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName,sysCategoryTreeVOList);
map.put("field_must_input", onlCgformField.getFieldMustInput());//区域 map.put("field_must_input", onlCgformField.getFieldMustInput());//区域
result.add(map); result.add(map);
} }
@@ -479,14 +489,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
for (OSSFile fileInfo : fileInfos) { for (OSSFile fileInfo : fileInfos) {
Map<String, Object> mapNew = new HashMap<>(); Map<String, Object> mapNew = new HashMap<>();
mapNew.put("value", fileInfo); mapNew.put("value", fileInfo);
mapPut(cut, mapNew, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName); mapPut(cut, mapNew, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName,null);
resultTemp.add(mapNew); resultTemp.add(mapNew);
} }
} }
} else if (fileInfos.size() == 1) { } else if (fileInfos.size() == 1) {
//单个文件处理 //单个文件处理
map.put("value", fileInfos.get(0)); map.put("value", fileInfos.get(0));
mapPut(cut, map, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName); mapPut(cut, map, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName,null);
resultTemp.add(map); resultTemp.add(map);
} }
} }
@@ -513,7 +523,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
}); });
} }
mapPut(cut, map, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName); mapPut(cut, map, "field_show_type", onlCgformField.getFieldShowType(), "dict_field", onlCgformField.getDictField(), "db_field_name", onlCgformField.getDbFieldName(), "db_field_txt", onlCgformField.getDbFieldTxt(), "db_field_en_name", onlCgformField.getDbFieldEnName(), "area", areaName,null);
} }
if (map.size() != 0) { if (map.size() != 0) {
resultTemp.add(map); resultTemp.add(map);
@@ -531,7 +541,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
return result; return result;
} }
private void mapPut(String cut, Map<String, Object> map, String field_show_type, String fieldShowType2, String dict_field, String dictField, String db_field_name, String dbFieldName2, String db_field_txt, String dbFieldTxt, String db_field_en_name, String dbFieldEnName, String area, String showArea) { private void mapPut(String cut, Map<String, Object> map, String field_show_type,
String fieldShowType2, String dict_field, String dictField,
String db_field_name, String dbFieldName2, String db_field_txt,
String dbFieldTxt, String db_field_en_name, String dbFieldEnName,
String area, String showArea,List<SysCategoryTreeVO> sysCategoryTreeVOS) {
map.put(field_show_type, fieldShowType2);//类型(判断是下拉还是输入框,等等) map.put(field_show_type, fieldShowType2);//类型(判断是下拉还是输入框,等等)
map.put(dict_field, dictField); map.put(dict_field, dictField);
map.put(db_field_name, dbFieldName2);//字段 map.put(db_field_name, dbFieldName2);//字段
@@ -545,6 +559,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
map.put(db_field_txt, dbFieldTxt);//字段中文名 map.put(db_field_txt, dbFieldTxt);//字段中文名
} }
map.put(area, showArea);//区域 map.put(area, showArea);//区域
map.put("tree", sysCategoryTreeVOS);//区域
} }
/** /**
@@ -64,7 +64,8 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
QueryWrapper<OnlCgformTag> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformTag, req.getParameterMap()); QueryWrapper<OnlCgformTag> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformTag, req.getParameterMap());
Page<OnlCgformTag> page = new Page<OnlCgformTag>(pageNo, pageSize); Page<OnlCgformTag> page = new Page<OnlCgformTag>(pageNo, pageSize);
if(StringUtils.isNotBlank("create_time")) { if(StringUtils.isNotBlank("create_time")) {
queryWrapper.orderByDesc("create_time"); queryWrapper.orderByDesc("create_time").eq("is_show_list",1)
.eq("cgform_head_id","48308196e7b04761b533dc31bc899707");//筛选文档库数据
} }
IPage<OnlCgformTag> pageList = onlCgformTagService.page(page, queryWrapper); IPage<OnlCgformTag> pageList = onlCgformTagService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
@@ -125,6 +126,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
} else { } else {
onlCgformTag.setCreateTime(new Date()); onlCgformTag.setCreateTime(new Date());
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0); onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
onlCgformTag.setCgformHeadId("48308196e7b04761b533dc31bc899707");//设置文档库-表id
onlCgformTagService.add(onlCgformTag); onlCgformTagService.add(onlCgformTag);
} }
return Result.OK("添加成功!"); return Result.OK("添加成功!");
@@ -62,6 +62,12 @@ public class OnlCgformTag implements Serializable {
@ApiModelProperty(value = "所属部门") @ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode; private java.lang.String sysOrgCode;
/**文档库-表id*/
@Excel(name = "文档库-表id", width = 15,dictTable = "onl_cgform_field", dicText = "cgform_head_id", dicCode = "cgform_head_id")
@Dict(dictTable = "onl_cgform_field", dicText = "cgform_head_id", dicCode = "cgform_head_id")
@ApiModelProperty(value = "文档库-表id")
private java.lang.String cgformHeadId;
/**所属模块(1文档库,0文档拆分)*/ /**所属模块(1文档库,0文档拆分)*/
@Excel(name = "所属模块(1文档库,0文档拆分", width = 15, dicCode = "module") @Excel(name = "所属模块(1文档库,0文档拆分", width = 15, dicCode = "module")
@Dict(dicCode = "module") @Dict(dicCode = "module")
@@ -87,12 +93,11 @@ public class OnlCgformTag implements Serializable {
@ApiModelProperty(value = "表单控件类型") @ApiModelProperty(value = "表单控件类型")
private java.lang.String fieldShowType; private java.lang.String fieldShowType;
/**字典名称*/ /**字典id*/
@TableField(exist = false) @Excel(name = "字典id", width = 15, dictTable = "onl_cgform_field", dicText = "dict_id", dicCode = "dict_id")
@Excel(name = "字典名称", width = 15, dictTable = "sys_dict", dicText = "dict_name", dicCode = "dict_name") @Dict(dictTable = "onl_cgform_field", dicText = "dict_id", dicCode = "dict_id")
@Dict(dictTable = "sys_dict", dicText = "dict_name", dicCode = "dict_name")
@ApiModelProperty(value = "字典名称") @ApiModelProperty(value = "字典名称")
private java.lang.String dictName; private java.lang.String dictId;
/**数据库字段长度*/ /**数据库字段长度*/
@Excel(name = "数据库字段长度", width = 15,dictTable = "onl_cgform_field", dicText = "db_length", dicCode = "db_length") @Excel(name = "数据库字段长度", width = 15,dictTable = "onl_cgform_field", dicText = "db_length", dicCode = "db_length")
+10 -3
View File
@@ -6,7 +6,7 @@ module.exports = {
pleaseSelect: 'please select', pleaseSelect: 'please select',
male: 'male', male: 'male',
female: 'female', female: 'female',
RealName: 'real name', RealName: 'User name',
pleaseEnter: 'please enter', pleaseEnter: 'please enter',
phoneNumber: 'phone number', phoneNumber: 'phone number',
query: 'query', query: 'query',
@@ -35,7 +35,7 @@ module.exports = {
freezePassword: 'Are you sure to freeze?', freezePassword: 'Are you sure to freeze?',
youThaw: 'Are you sure to thaw?', youThaw: 'Are you sure to thaw?',
freezePasManagementPage: 'This is the user management page?', freezePasManagementPage: 'This is the user management page?',
serialNumber: 'serial number', serialNumber: 'number',
userAccount: 'user account', userAccount: 'user account',
userName: 'User name', userName: 'User name',
department: 'department', department: 'department',
@@ -408,5 +408,12 @@ module.exports = {
PleaseSelectData: 'Please select data first', PleaseSelectData: 'Please select data first',
MessageContent: 'Message Content', MessageContent: 'Message Content',
MessageType: 'Message Type', MessageType: 'Message Type',
NotificationTime: 'Notification Time' NotificationTime: 'Notification Time',
MessageNotification:'Message Notification',
SeeMore:'See more',
OperationSuccessful:'Operation successful',
operationFailed:'operation failed',
PersonnelSelection:'Personnel selection',
EmployeeNumber:'Employee number',
EmployeeType:'Employee type',
} }
+10 -3
View File
@@ -1,12 +1,12 @@
module.exports = { module.exports = {
home: '首页', home: '首页',
account: '账号', account: '用户账号',
EnterAccountFuzzyQuery:'输入账号模糊查询', EnterAccountFuzzyQuery:'输入用户账号模糊查询',
Gender:'性别', Gender:'性别',
pleaseSelect:'请选择', pleaseSelect:'请选择',
male:'男', male:'男',
female:'女', female:'女',
RealName:'真实姓名', RealName:'用户名称',
pleaseEnter:'请输入', pleaseEnter:'请输入',
phoneNumber:'手机号码', phoneNumber:'手机号码',
query:'搜索', query:'搜索',
@@ -413,4 +413,11 @@ module.exports = {
MessageContent:'消息内容', MessageContent:'消息内容',
MessageType:'消息类型', MessageType:'消息类型',
NotificationTime:'通知时间', NotificationTime:'通知时间',
MessageNotification:'消息通知',
SeeMore:'查看更多',
OperationSuccessful:'操作成功',
operationFailed:'操作失败',
PersonnelSelection:'人员选择',
EmployeeNumber:'员工号',
EmployeeType:'员工类型',
} }
@@ -3,11 +3,11 @@
<div class="box-title-text"> <div class="box-title-text">
<a-input class="box-input" :value="value" @input="indexclick($event)" :placeholder="$t('PleaseEnterOrSelect')+query.db_field_txt"/> <a-input class="box-input" :value="value" @input="indexclick($event)" :placeholder="$t('PleaseEnterOrSelect')+query.db_field_txt"/>
<a-button type="primary" class="button-box" @click="standardClick"> <a-button type="primary" class="button-box" @click="standardClick">
人员选择 {{this.$t('PersonnelSelection')}}
</a-button> </a-button>
</div> </div>
<a-drawer <a-drawer
:title="'人员选择'" :title="$t('PersonnelSelection')"
:maskClosable="false" :maskClosable="false"
:width="600" :width="600"
placement="right" placement="right"
@@ -34,7 +34,7 @@
</a-table> </a-table>
<div class="page" v-if="dataList.length > 0"> <div class="page" v-if="dataList.length > 0">
<a-pagination <a-pagination
:show-total="total => ` ${total} `" :show-total="total => $t('total')+`${total}`+$t('strip')"
show-quick-jumper show-quick-jumper
show-size-changer show-size-changer
:page-size.sync="pageSize" :page-size.sync="pageSize"
+7 -8
View File
@@ -277,11 +277,11 @@
} }
postAction(url, this.formInline).then((res) => { postAction(url, this.formInline).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset') eventBUs.$emit('searchReset')
this.$emit('addFormClick') this.$emit('addFormClick')
} else { } else {
this.$message.warning(res.message) this.$message.warning(this.$t('operationFailed'))
} }
}) })
} else { } else {
@@ -295,7 +295,6 @@
}, },
/** 上传文件的回调 */ /** 上传文件的回调 */
uploadSuccess(data) { uploadSuccess(data) {
console.log(data)
let attIdList = [] let attIdList = []
data.map(item => { data.map(item => {
attIdList.push(item.id || data.name) attIdList.push(item.id || data.name)
@@ -319,7 +318,7 @@
if (res.field_show_type === '1') { if (res.field_show_type === '1') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.field_show_type === '4' || res.field_show_type === '6' || } else if (res.field_show_type === '4' || res.field_show_type === '6' ||
@@ -327,25 +326,25 @@
) { ) {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
}) })
} else if (res.field_show_type === '2') { } else if (res.field_show_type === '2') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10') { } else if (res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.field_show_type === '3') { } else if (res.field_show_type === '3') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
}) })
} }
@@ -105,6 +105,5 @@
} }
} }
</script> </script>
<style scoped> <style scoped>
</style> </style>
@@ -463,4 +463,7 @@
.ant-table-placeholder { .ant-table-placeholder {
background: transparent !important; background: transparent !important;
} }
.ant-input-number{
background: transparent !important;
}
</style> </style>
@@ -180,7 +180,7 @@
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'treeSelect'"> <a-col :span="12" v-else-if="item.field_show_type === '0'">
<div class="box-title-text" :title="item.db_field_txt"> <div class="box-title-text" :title="item.db_field_txt">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span> <span class="Required" v-if="item.field_must_input == 0">*</span>
@@ -191,9 +191,9 @@
v-model="formInline[item.db_field_name]" v-model="formInline[item.db_field_name]"
style="width: 100%" style="width: 100%"
:maxTagCount="1" :maxTagCount="1"
:tree-data="treeData" :tree-data="item.tree"
tree-checkable tree-checkable
placeholder="Please select" :placeholder="$t('PleaseSelect')+item.db_field_txt"
/> />
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -283,50 +283,6 @@
content: [] content: []
} }
], ],
treeData: [
{
title: 'Node1',
value: '0-0',
key: '0-0',
children: [
{
title: 'Child Node1',
value: '0-0-0',
key: '0-0-0',
children: [
{
title: 'Child Node1',
value: '0-0-0-0',
key: '0-0-0-0'
}
]
}
]
},
{
title: 'Node2',
value: '0-1',
key: '0-1',
children: [
{
title: 'Child Node3',
value: '0-1-0',
key: '0-1-0',
disabled: true
},
{
title: 'Child Node4',
value: '0-1-1',
key: '0-1-1'
},
{
title: 'Child Node5',
value: '0-1-2',
key: '0-1-2'
}
]
}
]
} }
}, },
mounted() { mounted() {
@@ -350,11 +306,11 @@
}) })
postAction(url, formInline).then((res) => { postAction(url, formInline).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset') eventBUs.$emit('searchReset')
this.$emit('addFormClick') this.$emit('addFormClick')
} else { } else {
this.$message.warning(res.message) this.$message.warning(this.$t('operationFailed'))
} }
}) })
} else { } else {
@@ -410,7 +366,7 @@
if (res.field_show_type === '1') { if (res.field_show_type === '1') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.field_show_type === '4' || res.field_show_type === '6' || } else if (res.field_show_type === '4' || res.field_show_type === '6' ||
@@ -418,25 +374,25 @@
) { ) {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
}) })
} else if (res.field_show_type === '2') { } else if (res.field_show_type === '2') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10') { } else if (res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.field_show_type === '3') { } else if (res.field_show_type === '3') {
rule.push({ rule.push({
required: true, required: true,
message: res.db_field_txt + '不能为空', message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
}) })
} }
+2 -2
View File
@@ -17,7 +17,7 @@
<a-input-number class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt" <a-input-number class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/> v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/>
</div> </div>
<div class="box-title-text" v-else-if="item.field_show_type == '3'"> <div class="box-title-text" v-else-if="item.field_show_type == '4'">
<div class="title-text" :title="item.db_field_txt"> <div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span> <span>{{item.db_field_txt}}</span>
</div> </div>
@@ -42,7 +42,7 @@
@change="dateChange(item.db_field_name)" @change="dateChange(item.db_field_name)"
v-model="queryParam[item.db_field_name]"/> v-model="queryParam[item.db_field_name]"/>
</div> </div>
<div class="box-title-text" v-else-if="item.field_show_type == '4'"> <div class="box-title-text" v-else-if="item.field_show_type == '3'">
<div class="title-text" :title="item.db_field_txt"> <div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span> <span>{{item.db_field_txt}}</span>
</div> </div>
+1 -1
View File
@@ -39,7 +39,7 @@
</div> </div>
<div class="page" v-if="dataSource.length > 0"> <div class="page" v-if="dataSource.length > 0">
<a-pagination <a-pagination
:show-total="total => ` ${total} `" :show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper show-quick-jumper
show-size-changer show-size-changer
:page-size.sync="pageSize" :page-size.sync="pageSize"
+18 -94
View File
@@ -13,39 +13,17 @@
<a-tab-pane :tab="msg1Title" key="1"> <a-tab-pane :tab="msg1Title" key="1">
<a-list> <a-list>
<a-list-item :key="index" v-for="(record, index) in announcement1"> <a-list-item :key="index" v-for="(record, index) in announcement1">
<div style="margin-left: 5%;width: 80%"> <div style="margin-left: 5%;width: 80%;">
<p><a @click="showAnnouncement(record)">{{ record.titile }}</a></p> <p style="overflow: hidden; text-overflow: ellipsis;white-space: nowrap;color:#00B3BE">
<p style="color: rgba(0,0,0,.45);margin-bottom: 0px">{{ record.createTime }} 发布</p> <a :title="record.msgContent" @click="showAnnouncement(record)">{{ record.msgContent }}</a>
</p>
</div> </div>
<!-- <div style="text-align: right">-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'L'" color="blue">一般消息</a-tag>-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'M'" color="orange">重要消息</a-tag>-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'H'" color="red">紧急消息</a-tag>-->
<!-- </div>-->
</a-list-item> </a-list-item>
<div style="margin-top: 5px;text-align: center"> <div style="margin-top: 5px;text-align: center">
<a-button @click="toMyAnnouncement()" type="dashed" block>查看更多</a-button> <a-button @click="toMyAnnouncement()" type="dashed" block>{{this.$t('SeeMore')}}</a-button>
</div> </div>
</a-list> </a-list>
</a-tab-pane> </a-tab-pane>
<!-- <a-tab-pane :tab="msg2Title" key="2">-->
<!-- <a-list>-->
<!-- <a-list-item :key="index" v-for="(record, index) in announcement2">-->
<!-- <div style="margin-left: 5%;width: 80%">-->
<!-- <p><a @click="showAnnouncement(record)">{{ record.titile }}</a></p>-->
<!-- <p style="color: rgba(0,0,0,.45);margin-bottom: 0px">{{ record.createTime }} 发布</p>-->
<!-- </div>-->
<!-- <div style="text-align: right">-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'L'" color="blue">一般消息</a-tag>-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'M'" color="orange">重要消息</a-tag>-->
<!-- <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'H'" color="red">紧急消息</a-tag>-->
<!-- </div>-->
<!-- </a-list-item>-->
<!-- <div style="margin-top: 5px;text-align: center">-->
<!-- <a-button @click="toMyAnnouncement()" type="dashed" block>查看更多</a-button>-->
<!-- </div>-->
<!-- </a-list>-->
<!-- </a-tab-pane>-->
</a-tabs> </a-tabs>
</a-spin> </a-spin>
</template> </template>
@@ -54,14 +32,12 @@
<a-icon style="font-size: 16px; padding: 4px" type="bell"/> <a-icon style="font-size: 16px; padding: 4px" type="bell"/>
</a-badge> </a-badge>
</span> </span>
<show-announcement ref="ShowAnnouncement" @ok="modalFormOk"></show-announcement>
<dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/> <dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
</a-popover> </a-popover>
</template> </template>
<script> <script>
import { getAction, putAction } from '@/api/manage' import { getAction, putAction } from '@/api/manage'
import ShowAnnouncement from './ShowAnnouncement'
import store from '@/store/' import store from '@/store/'
import DynamicNotice from './DynamicNotice' import DynamicNotice from './DynamicNotice'
@@ -70,7 +46,6 @@
name: 'HeaderNotice', name: 'HeaderNotice',
components: { components: {
DynamicNotice, DynamicNotice,
ShowAnnouncement
}, },
data() { data() {
return { return {
@@ -78,14 +53,15 @@
url: { url: {
listCementByUser: '/sys/sysAnnouncementSend/getMessageUnreadList', listCementByUser: '/sys/sysAnnouncementSend/getMessageUnreadList',
editCementSend: '/sys/sysAnnouncementSend/editByAnntIdAndUserId', editCementSend: '/sys/sysAnnouncementSend/editByAnntIdAndUserId',
queryById: '/sys/annountCement/queryById' queryById: '/sys/annountCement/queryById',
readAllMsg:'sys/sysAnnouncementSend/read',
}, },
hovered: false, hovered: false,
announcement1: [], announcement1: [],
announcement2: [], announcement2: [],
msg1Count: '0', msg1Count: '0',
msg2Count: '0', msg2Count: '0',
msg1Title: '消息通知(0)', msg1Title: this.$t('MessageNotification')+'(0)',
msg2Title: '', msg2Title: '',
stopTimer: false, stopTimer: false,
websock: null, websock: null,
@@ -102,9 +78,9 @@
}, },
mounted() { mounted() {
this.loadData() this.loadData()
//this.timerFun(); // this.timerFun();
this.initWebSocket() this.initWebSocket()
// this.heartCheckFun(); this.heartCheckFun()
}, },
destroyed: function() { // 离开页面生命周期函数 destroyed: function() { // 离开页面生命周期函数
this.websocketOnclose() this.websocketOnclose()
@@ -126,12 +102,9 @@
// 获取系统消息 // 获取系统消息
getAction(this.url.listCementByUser).then((res) => { getAction(this.url.listCementByUser).then((res) => {
if (res.success) { if (res.success) {
this.announcement1 = res.result.anntMsgList this.announcement1 = res.result
this.msg1Count = res.result.anntMsgTotal this.msg1Count = res.result.length
this.msg1Title = '消息通知(' + res.result.anntMsgTotal + ')' this.msg1Title = this.$t('MessageNotification')+'(' + res.result.length + ')'
this.announcement2 = res.result.sysMsgList
this.msg2Count = res.result.sysMsgTotal
this.msg2Title = '系统消息(' + res.result.sysMsgTotal + ')'
} }
}).catch(error => { }).catch(error => {
this.stopTimer = true this.stopTimer = true
@@ -148,31 +121,21 @@
this.loadding = true this.loadding = true
setTimeout(() => { setTimeout(() => {
this.loadding = false this.loadding = false
this.loadData()
}, 200) }, 200)
}, },
showAnnouncement(record) { showAnnouncement(record) {
putAction(this.url.editCementSend, { anntId: record.id }).then((res) => { getAction(this.url.readAllMsg, { ids: record.id }).then((res) => {
if (res.success) { })
this.loadData() this.$router.push({
} path: '/system/MessageDetails',
query: record
}) })
this.hovered = false
if (record.openType === 'component') {
this.openPath = record.openPage
this.formData = { id: record.busId }
this.$refs.showDynamNotice.detail(record.openPage)
} else {
this.$refs.ShowAnnouncement.detail(record)
}
}, },
toMyAnnouncement() { toMyAnnouncement() {
this.$router.push({ this.$router.push({
path: '/isps/userAnnouncement' path: '/isps/userAnnouncement'
}) })
}, },
modalFormOk() {
},
handleHoverChange(visible) { handleHoverChange(visible) {
this.hovered = visible this.hovered = visible
}, },
@@ -181,7 +144,6 @@
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
var userId = store.getters.userInfo.id var userId = store.getters.userInfo.id
var url = window._CONFIG['domianWebSocketURL'].replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId var url = window._CONFIG['domianWebSocketURL'].replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId
//console.log(url);
this.websock = new WebSocket(url) this.websock = new WebSocket(url)
this.websock.onopen = this.websocketOnopen this.websock.onopen = this.websocketOnopen
this.websock.onerror = this.websocketOnerror this.websock.onerror = this.websocketOnerror
@@ -190,8 +152,6 @@
}, },
websocketOnopen: function() { websocketOnopen: function() {
console.log('WebSocket连接成功') console.log('WebSocket连接成功')
//心跳检测重置
//this.heartCheck.reset().start();
}, },
websocketOnerror: function(e) { websocketOnerror: function(e) {
console.log('WebSocket连接发生错误') console.log('WebSocket连接发生错误')
@@ -207,8 +167,6 @@
//用户消息 //用户消息
this.loadData() this.loadData()
} }
//心跳检测重置
//this.heartCheck.reset().start();
}, },
websocketOnclose: function(e) { websocketOnclose: function(e) {
console.log('connection closed (' + e + ')') console.log('connection closed (' + e + ')')
@@ -225,28 +183,6 @@
} }
}, },
openNotification(data) {
var text = data.msgTxt
const key = `open${Date.now()}`
this.$notification.open({
message: '消息提醒',
placement: 'bottomRight',
description: text,
key,
btn: (h) => {
return h('a-button', {
props: {
type: 'primary',
size: 'small'
},
on: {
click: () => this.showDetail(key, data)
}
}, '查看详情')
}
})
},
reconnect() { reconnect() {
var that = this var that = this
if (that.lockReconnect) return if (that.lockReconnect) return
@@ -283,18 +219,6 @@
}, this.timeout) }, this.timeout)
} }
} }
},
showDetail(key, data) {
this.$notification.close(key)
var id = data.msgId
getAction(this.url.queryById, { id: id }).then((res) => {
if (res.success) {
var record = res.result
this.showAnnouncement(record)
}
})
} }
} }
} }
+2 -1
View File
@@ -18,12 +18,13 @@ export const JeroListMixin = {
/* 数据源 */ /* 数据源 */
dataSource:[], dataSource:[],
/* 分页参数 */ /* 分页参数 */
//range[0] + "-" + range[1] +
ipagination:{ ipagination:{
current: 1, current: 1,
pageSize: 10, pageSize: 10,
pageSizeOptions: ['10', '20', '30'], pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => { showTotal: (total, range) => {
return range[0] + "-" + range[1] + "" + total + "" return this.$t('total') +' '+ total + ' '+this.$t('strip')
}, },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
@@ -36,7 +36,7 @@
</div> </div>
<div style="overflow: auto;margin-top: 68px;background: #fff"> <div style="overflow: auto;margin-top: 68px;background: #fff">
<div class="detail-content"> <div class="detail-content">
<div v-for="(item,index) in detailList" class="content-box" > <div v-for="(item,index) in detailList" class="content-box">
<div v-for="val in Object.keys(item)" class="content"> <div v-for="val in Object.keys(item)" class="content">
<div class="header-text"> <div class="header-text">
{{val}} {{val}}
@@ -83,7 +83,7 @@
</div> </div>
<a-modal <a-modal
title="更新log" :title="$t('UpdateLog')"
:width="900" :width="900"
:visible="visible" :visible="visible"
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
@@ -102,10 +102,10 @@
</a-table> </a-table>
<div class="page" v-if="dataSource.length > 0"> <div class="page" v-if="dataSource.length > 0">
<a-pagination <a-pagination
:show-total="total => ` ${total} `" :show-total="total => $t('total')+`${total}`+$t('strip')"
show-quick-jumper show-quick-jumper
show-size-changer show-size-changer
:page-size.sync="pageSize" :page-size.sync="pageSize "
:total="total" :total="total"
@change="onChange" @change="onChange"
@showSizeChange="SizeChange" @showSizeChange="SizeChange"
@@ -228,6 +228,7 @@
.doc-detail { .doc-detail {
background: #fff; background: #fff;
height: 100%; height: 100%;
.doc-detail-wrap { .doc-detail-wrap {
.doc-detail-header { .doc-detail-header {
width: 100%; width: 100%;
@@ -177,7 +177,7 @@
} }
}) })
} else { } else {
this.$message.warning('请选择需要删除的数据') this.$message.warning(this.$t('selectLeastOne'))
} }
}, },
//推送 //推送
@@ -202,10 +202,10 @@
onOk() { onOk() {
deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => { deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success(res.message) _this.$message.success(_this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset') eventBUs.$emit('searchReset')
} else { } else {
this.$message.warning(res.message) _this.$message.warning(_this.$t('operationFailed'))
} }
}) })
} }
@@ -225,10 +225,10 @@
} }
getAction(url, { id: val.id }).then((res) => { getAction(url, { id: val.id }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success(res.message) _this.$message.success(_this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset') eventBUs.$emit('searchReset')
} else { } else {
_this.$message.warning(res.message) _this.$message.warning(_this.$t('operationFailed'))
} }
}) })
} }
@@ -248,10 +248,10 @@
} }
getAction(url, { id: val.id }).then((res) => { getAction(url, { id: val.id }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success(res.message) _this.$message.success(_this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset') eventBUs.$emit('searchReset')
} else { } else {
_this.$message.warning(res.message) _this.$message.warning(_this.$t('operationFailed'))
} }
}) })
} }
+178 -167
View File
@@ -1,34 +1,35 @@
<template xmlns:background-color="http://www.w3.org/1999/xhtml"> <template xmlns:background-color="http://www.w3.org/1999/xhtml">
<a-row :gutter="10"> <a-row :gutter="10" class="box-ant">
<a-col :md="10" :sm="24" > <a-col :md="10" :sm="24">
<a-card :bordered="false" style="padding: 12px 0;"> <a-card :bordered="false" style="padding: 12px 0;">
<!-- 按钮操作区域 --> <!-- 按钮操作区域 -->
<a-row style="margin-left: 14px"> <a-row style="margin-left: 14px">
<a-button @click="handleAdd(1)" type="primary">{{$t('AddDepartment')}}</a-button> <!-- <a-button @click="handleAdd(1)" type="primary">{{$t('AddDepartment')}}</a-button>-->
<a-button @click="handleAdd(2)" type="primary">{{$t('AddSubordinate')}}</a-button> <!-- <a-button @click="handleAdd(2)" type="primary">{{$t('AddSubordinate')}}</a-button>-->
<a-button type="primary" icon="download" @click="handleExportXls($t('DepartmentInformation'))">{{$t('export')}}</a-button> <!-- <a-button type="primary" icon="download" @click="handleExportXls($t('DepartmentInformation'))">{{$t('export')}}</a-button>-->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<a-button type="primary" icon="import">{{$t('import')}}</a-button> <!-- <a-button type="primary" icon="import">{{$t('import')}}</a-button>-->
</a-upload> <!-- </a-upload>-->
<a-button :title="$t('DeleteMultiplePiecesData')" @click="batchDel" type="default">{{$t('BatchDelete')}}</a-button> <!-- <a-button :title="$t('DeleteMultiplePiecesData')" @click="batchDel" type="default">{{$t('BatchDelete')}}</a-button>-->
<!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">刷新</a-button>--> <!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">刷新</a-button>-->
</a-row> </a-row>
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px"> <div style="padding-left:16px;height: 100%;">
<a-alert type="info" :showIcon="true"> <!-- <a-alert type="info" :showIcon="true">-->
<div slot="message"> <!-- <div slot="message">-->
{{$t('CurrentSelection')}}<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span> <!-- {{$t('CurrentSelection')}}<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span>-->
<a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">{{$t('Deselect')}}</a> <!-- <a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">{{$t('Deselect')}}</a>-->
</div> <!-- </div>-->
</a-alert> <!-- </a-alert>-->
<a-input-search @search="onSearch" style="width:100%;margin-top: 10px" :placeholder="$t('enterDepartmentName')"/> <a-input-search @search="onSearch" style="width:100%;margin-top: 6px"
:placeholder="$t('enterDepartmentName')"/>
<!-- 树--> <!-- 树-->
<a-col :md="10" :sm="24"> <template>
<template> <!-- <a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus">-->
<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus"> <!-- checkable-->
<span style="user-select: none"> <!-- :expandedKeys="iExpandedKeys" -->
<a-tree <a-tree
checkable
multiple multiple
style="height:600px;overflow: auto;width: 100%"
@select="onSelect" @select="onSelect"
@check="onCheck" @check="onCheck"
@rightClick="rightHandle" @rightClick="rightHandle"
@@ -36,49 +37,48 @@
:checkedKeys="checkedKeys" :checkedKeys="checkedKeys"
:treeData="departTree" :treeData="departTree"
:checkStrictly="checkStrictly" :checkStrictly="checkStrictly"
:expandedKeys="iExpandedKeys" :autoExpandParent="false"
:autoExpandParent="autoExpandParent"
@expand="onExpand"/> @expand="onExpand"/>
</span> <!--新增右键点击事件,和增加添加和删除功能-->
<!--新增右键点击事件,和增加添加和删除功能--> <!-- <a-menu slot="overlay">-->
<a-menu slot="overlay"> <!-- <a-menu-item @click="handleAdd(3)" key="1">{{$t('addTo')}}</a-menu-item>-->
<a-menu-item @click="handleAdd(3)" key="1">{{$t('addTo')}}</a-menu-item> <!-- <a-menu-item @click="handleDelete" key="2">{{$t('delete')}}</a-menu-item>-->
<a-menu-item @click="handleDelete" key="2">{{$t('delete')}}</a-menu-item> <!-- <a-menu-item @click="closeDrop" key="3">{{$t('cancel')}}</a-menu-item>-->
<a-menu-item @click="closeDrop" key="3">{{$t('cancel')}}</a-menu-item> <!-- </a-menu>-->
</a-menu> <!-- </a-dropdown>-->
</a-dropdown> </template>
</template>
</a-col>
</div> </div>
</a-card> </a-card>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------> <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
<div class="drawer-bootom-button"> <!-- <div class="drawer-bootom-button">-->
<a-dropdown :trigger="['click']" placement="topCenter"> <!-- <a-dropdown :trigger="['click']" placement="topCenter">-->
<a-menu slot="overlay"> <!-- <a-menu slot="overlay">-->
<!--<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>--> <!-- &lt;!&ndash;<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>&ndash;&gt;-->
<!--<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>--> <!-- &lt;!&ndash;<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>&ndash;&gt;-->
<a-menu-item key="3" @click="checkALL">{{$t('checkAll')}}</a-menu-item> <!-- <a-menu-item key="3" @click="checkALL">{{$t('checkAll')}}</a-menu-item>-->
<a-menu-item key="4" @click="cancelCheckALL">{{$t('DeselectAll')}}</a-menu-item> <!-- <a-menu-item key="4" @click="cancelCheckALL">{{$t('DeselectAll')}}</a-menu-item>-->
<a-menu-item key="5" @click="expandAll">{{$t('ExpandAll')}}</a-menu-item> <!-- <a-menu-item key="5" @click="expandAll">{{$t('ExpandAll')}}</a-menu-item>-->
<a-menu-item key="6" @click="closeAll">{{$t('MergeAll')}}</a-menu-item> <!-- <a-menu-item key="6" @click="closeAll">{{$t('MergeAll')}}</a-menu-item>-->
</a-menu> <!-- </a-menu>-->
<a-button> <!-- <a-button>-->
{{$t('TreeOperation')}} <a-icon type="up" /> <!-- {{$t('TreeOperation')}} <a-icon type="up" />-->
</a-button> <!-- </a-button>-->
</a-dropdown> <!-- </a-dropdown>-->
</div> <!-- </div>-->
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------> <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
</a-col> </a-col>
<a-col :md="14" :sm="24" style="background: #fff;padding: 24px;"> <a-col :md="14" :sm="24" style="padding: 24px;">
<a-tabs defaultActiveKey="1"> <a-tabs defaultActiveKey="1" @change="tabChange">
<a-tab-pane :tab="$t('essentialInformation')" key="1" > <a-tab-pane :tab="$t('essentialInformation')" key="1">
<a-card :bordered="false" v-if="selectedKeys.length>0"> <a-card :bordered="false" v-if="selectedKeys.length>0">
<a-form :form="form"> <a-form :form="form">
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('OrganizationName')"> :label="$t('OrganizationName')">
<a-input :placeholder="$t('EnterOrganizationDepartment')" v-decorator="['departName', validatorRules.departName ]"/> <a-input :placeholder="$t('EnterOrganizationDepartment')"
:disabled="disable"
v-decorator="['departName', validatorRules.departName ]"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('SuperiorDepartment')"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('SuperiorDepartment')">
<a-tree-select <a-tree-select
@@ -94,59 +94,75 @@
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('OrganizationCode')"> :label="$t('OrganizationCode')">
<a-input disabled :placeholder="$t('enterOrganizationCode')" v-decorator="['orgCode', validatorRules.orgCode ]"/> <a-input :disabled="disable"
:placeholder="$t('enterOrganizationCode')"
v-decorator="['orgCode', validatorRules.orgCode ]"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('OrganizationType')"> :label="$t('OrganizationType')">
<template v-if="orgCategoryDisabled"> <j-dict-select-tag class="box-input"
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" :placeholder="$t('PleaseSelectOrganizationType')"> v-decorator="['orgCategory',validatorRules.orgCategory]"
<a-radio value="1"> :disabled="disable"
{{$t('company')}} :placeholder="$t('pleaseSelect')+$t('OrganizationType')"
</a-radio> :type="'select'"
</a-radio-group> triggerChange dictCode="org_category"/>
</template> <!-- <template v-if="orgCategoryDisabled">-->
<template v-else> <!-- <a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]"-->
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" :placeholder="$t('PleaseSelectOrganizationType')"> <!-- :disabled="disable"-->
<a-radio value="2"> <!-- :placeholder="$t('PleaseSelectOrganizationType')">-->
{{$t('department')}} <!-- <a-radio value="1">-->
</a-radio> <!-- {{$t('company')}}-->
<a-radio value="3"> <!-- </a-radio>-->
{{$t('post')}} <!-- </a-radio-group>-->
</a-radio> <!-- </template>-->
</a-radio-group> <!-- <template v-else>-->
</template> <!-- <a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]"-->
<!-- :disabled="disable"-->
<!-- :placeholder="$t('PleaseSelectOrganizationType')">-->
<!-- <a-radio value="2">-->
<!-- {{$t('department')}}-->
<!-- </a-radio>-->
<!-- <a-radio value="3">-->
<!-- {{$t('post')}}-->
<!-- </a-radio>-->
<!-- </a-radio-group>-->
<!-- </template>-->
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('sort')"> :label="$t('sort')">
<a-input-number v-decorator="[ 'departOrder',{'initialValue':0}]"/> <a-input-number :disabled="disable" v-decorator="[ 'departOrder',{'initialValue':0}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:label="$t('phoneNumber')">
<a-input :placeholder="$t('enterMobileNumber')" v-decorator="['mobile', {'initialValue':''}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:label="$t('address')">
<a-input :placeholder="$t('enterAddress')" v-decorator="['address', {'initialValue':''}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:label="$t('remarks')">
<a-textarea :placeholder="$t('enterComments')" v-decorator="['memo', {'initialValue':''}]"/>
</a-form-item> </a-form-item>
<!-- <a-form-item-->
<!-- :labelCol="labelCol"-->
<!-- :wrapperCol="wrapperCol"-->
<!-- :label="$t('phoneNumber')">-->
<!-- <a-input :disabled="disable" :placeholder="$t('enterMobileNumber')"-->
<!-- v-decorator="['mobile', {'initialValue':''}]"/>-->
<!-- </a-form-item>-->
<!-- <a-form-item-->
<!-- :labelCol="labelCol"-->
<!-- :wrapperCol="wrapperCol"-->
<!-- :label="$t('address')">-->
<!-- <a-input :disabled="disable" :placeholder="$t('enterAddress')"-->
<!-- v-decorator="['address', {'initialValue':''}]"/>-->
<!-- </a-form-item>-->
<!-- <a-form-item-->
<!-- :labelCol="labelCol"-->
<!-- :wrapperCol="wrapperCol"-->
<!-- :label="$t('remarks')">-->
<!-- <a-textarea :disabled="disable" :placeholder="$t('enterComments')"-->
<!-- v-decorator="['memo', {'initialValue':''}]"/>-->
<!-- </a-form-item>-->
</a-form> </a-form>
<div class="anty-form-btn"> <!-- <div class="anty-form-btn">-->
<a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">{{$t('reset')}}</a-button> <!-- <a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">{{$t('reset')}}</a-button>-->
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">{{$t('preservation')}}</a-button> <!-- <a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">{{$t('preservation')}}-->
</div> <!-- </a-button>-->
<!-- </div>-->
</a-card> </a-card>
<a-card v-else :bordered="false" style="height:248px !important;"> <a-card v-else :bordered="false" style="height:248px !important;">
<a-empty> <a-empty>
@@ -154,9 +170,9 @@
</a-empty> </a-empty>
</a-card> </a-card>
</a-tab-pane> </a-tab-pane>
<!-- <a-tab-pane tab="部门权限" key="2" forceRender>--> <!-- <a-tab-pane tab="部门权限" key="2" forceRender>-->
<!-- <depart-auth-modal ref="departAuth"/>--> <!-- <depart-auth-modal ref="departAuth"/>-->
<!-- </a-tab-pane>--> <!-- </a-tab-pane>-->
<a-tab-pane :tab="$t('userInformation')" key="3"> <a-tab-pane :tab="$t('userInformation')" key="3">
<Dept-User-Info ref="DeptUserInfo"></Dept-User-Info> <Dept-User-Info ref="DeptUserInfo"></Dept-User-Info>
</a-tab-pane> </a-tab-pane>
@@ -169,9 +185,9 @@
import DepartModal from './modules/DepartModal' import DepartModal from './modules/DepartModal'
import DeptUserInfo from './modules/DeptUserInfo' import DeptUserInfo from './modules/DeptUserInfo'
import pick from 'lodash.pick' import pick from 'lodash.pick'
import {queryDepartTreeList, searchByKeywords, deleteByDepartId} from '@/api/api' import { queryDepartTreeList, searchByKeywords, deleteByDepartId } from '@/api/api'
import {httpAction, deleteAction} from '@/api/manage' import { httpAction, deleteAction } from '@/api/manage'
import {JeroListMixin} from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import DepartAuthModal from './modules/DepartAuthModal' import DepartAuthModal from './modules/DepartAuthModal'
// 表头 // 表头
@@ -187,7 +203,6 @@
return { return {
iExpandedKeys: [], iExpandedKeys: [],
loading: false, loading: false,
autoExpandParent: true,
currFlowId: '', currFlowId: '',
currFlowName: '', currFlowName: '',
disable: true, disable: true,
@@ -200,7 +215,7 @@
model: {}, model: {},
dropTrigger: '', dropTrigger: '',
depart: {}, depart: {},
columns:[ columns: [
{ {
title: this.$t('OrganizationName'), title: this.$t('OrganizationName'),
dataIndex: 'departName' dataIndex: 'departName'
@@ -212,7 +227,7 @@
}, },
{ {
title: this.$t('OrganizationCode'), title: this.$t('OrganizationCode'),
dataIndex: 'orgCode', dataIndex: 'orgCode'
}, },
{ {
title: this.$t('phoneNumber'), title: this.$t('phoneNumber'),
@@ -235,7 +250,7 @@
title: this.$t('operation'), title: this.$t('operation'),
align: 'center', align: 'center',
dataIndex: 'action', dataIndex: 'action',
scopedSlots: {customRender: 'action'} scopedSlots: { customRender: 'action' }
} }
], ],
disableSubmit: false, disableSubmit: false,
@@ -244,46 +259,47 @@
autoIncr: 1, autoIncr: 1,
currSelected: {}, currSelected: {},
allTreeKeys:[], allTreeKeys: [],
checkStrictly: true, checkStrictly: true,
form: this.$form.createForm(this), form: this.$form.createForm(this),
labelCol: { labelCol: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 5} sm: { span: 5 }
}, },
wrapperCol: { wrapperCol: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 16} sm: { span: 16 }
}, },
graphDatasource: { graphDatasource: {
nodes: [], nodes: [],
edges: [] edges: []
}, },
validatorRules: { validatorRules: {
departName: {rules: [{required: true, message: this.$t('EnterOrganizationDepartment')}]}, // departName: { rules: [{ required: true, message: this.$t('EnterOrganizationDepartment') }] },
orgCode: {rules: [{required: true, message: this.$t('enterOrganizationCode')}]}, // orgCode: { rules: [{ required: true, message: this.$t('enterOrganizationCode') }] },
orgCategory: {rules: [{required: true, message: this.$t('enterOrganizationType')}]}, // orgCategory: { rules: [{ required: true, message: this.$t('enterOrganizationType') }] },
mobile: {rules: [{validator: this.validateMobile}]} // mobile: { rules: [{ validator: this.validateMobile }] }
}, },
url: { url: {
delete: '/sys/sysDepart/delete', delete: '/sys/sysDepart/delete',
edit: '/sys/sysDepart/edit', edit: '/sys/sysDepart/edit',
deleteBatch: '/sys/sysDepart/deleteBatch', deleteBatch: '/sys/sysDepart/deleteBatch',
exportXlsUrl: "sys/sysDepart/exportXls", exportXlsUrl: 'sys/sysDepart/exportXls',
importExcelUrl: "sys/sysDepart/importExcel", importExcelUrl: 'sys/sysDepart/importExcel'
}, },
orgCategoryDisabled:false, orgCategoryDisabled: false,
recordTab: {}
} }
}, },
computed: { computed: {
importExcelUrl: function () { importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
} }
}, },
methods: { methods: {
loadData() { loadData() {
this.refresh(); this.refresh()
}, },
loadTree() { loadTree() {
var that = this var that = this
@@ -292,13 +308,13 @@
queryDepartTreeList().then((res) => { queryDepartTreeList().then((res) => {
if (res.success) { if (res.success) {
//部门全选后,再添加部门,选中数量增多 //部门全选后,再添加部门,选中数量增多
this.allTreeKeys = []; this.allTreeKeys = []
for (let i = 0; i < res.result.length; i++) { for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i] let temp = res.result[i]
that.treeData.push(temp) that.treeData.push(temp)
that.departTree.push(temp) that.departTree.push(temp)
that.setThisExpandedKeys(temp) that.setThisExpandedKeys(temp)
that.getAllKeys(temp); that.getAllKeys(temp)
// console.log(temp.id) // console.log(temp.id)
} }
this.loading = false this.loading = false
@@ -325,11 +341,7 @@
this.rightClickSelectedOrgCode = node.node.dataRef.orgCode this.rightClickSelectedOrgCode = node.node.dataRef.orgCode
}, },
onExpand(expandedKeys) { onExpand(expandedKeys) {
console.log('onExpand', expandedKeys)
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.iExpandedKeys = expandedKeys this.iExpandedKeys = expandedKeys
this.autoExpandParent = false
}, },
backFlowList() { backFlowList() {
this.$router.back(-1) this.$router.back(-1)
@@ -347,8 +359,7 @@
addRootNode() { addRootNode() {
this.$refs.nodeModal.add(this.currFlowId, '') this.$refs.nodeModal.add(this.currFlowId, '')
}, },
batchDel: function () { batchDel: function() {
console.log(this.checkedKeys)
if (this.checkedKeys.length <= 0) { if (this.checkedKeys.length <= 0) {
this.$message.warning(this.$t('selectARecored')) this.$message.warning(this.$t('selectARecored'))
} else { } else {
@@ -360,8 +371,8 @@
this.$confirm({ this.$confirm({
title: this.$t('confirmDeletion'), title: this.$t('confirmDeletion'),
content: this.$t('sureDeleteSelected') + this.checkedKeys.length + this.$t('pieceData'), content: this.$t('sureDeleteSelected') + this.checkedKeys.length + this.$t('pieceData'),
onOk: function () { onOk: function() {
deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => { deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message) that.$message.success(res.message)
that.loadTree() that.loadTree()
@@ -377,7 +388,7 @@
onSearch(value) { onSearch(value) {
let that = this let that = this
if (value) { if (value) {
searchByKeywords({keyWord: value}).then((res) => { searchByKeywords({ keyWord: value }).then((res) => {
if (res.success) { if (res.success) {
that.departTree = [] that.departTree = []
for (let i = 0; i < res.result.length; i++) { for (let i = 0; i < res.result.length; i++) {
@@ -403,42 +414,45 @@
this.visible = false this.visible = false
}, },
onCheck(checkedKeys, info) { onCheck(checkedKeys, info) {
console.log('onCheck', checkedKeys, info)
this.hiding = false this.hiding = false
//this.checkedKeys = checkedKeys.checked if (this.checkStrictly) {
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------> this.checkedKeys = checkedKeys.checked
if(this.checkStrictly){ } else {
this.checkedKeys = checkedKeys.checked;
}else{
this.checkedKeys = checkedKeys this.checkedKeys = checkedKeys
} }
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
}, },
onSelect(selectedKeys, e) { onSelect(selectedKeys, e) {
console.log('selected', selectedKeys, e)
this.hiding = false this.hiding = false
let record = e.node.dataRef let record = e.node.dataRef
console.log('onSelect-record', record)
this.currSelected = Object.assign({}, record) this.currSelected = Object.assign({}, record)
this.model = this.currSelected this.model = this.currSelected
this.selectedKeys = [record.key] this.selectedKeys = [record.key]
this.model.parentId = record.parentId this.model.parentId = record.parentId
this.setValuesToForm(record) this.setValuesToForm(record)
this.$refs.departAuth.show(record.id); this.recordTab = record
// this.$refs.departAuth.show(record.id)
// 传用户信息参数 // 传用户信息参数
this.$refs.DeptUserInfo.open(record) if (this.$refs.DeptUserInfo) {
this.$refs.DeptUserInfo.open(record)
}
},
tabChange(event) {
if (event == 3) {
this.$nextTick(() => {
this.$refs.DeptUserInfo.open(this.recordTab)
})
}
}, },
// 触发onSelect事件时,为部门树右侧的form表单赋值 // 触发onSelect事件时,为部门树右侧的form表单赋值
setValuesToForm(record) { setValuesToForm(record) {
if(record.orgCategory == '1'){ if (record.orgCategory == '1') {
this.orgCategoryDisabled = true; this.orgCategoryDisabled = true
}else{ } else {
this.orgCategoryDisabled = false; this.orgCategoryDisabled = false
} }
this.$nextTick(() => { this.$nextTick(() => {
this.form.getFieldDecorator('fax', {initialValue: ''}) this.form.getFieldDecorator('fax', { initialValue: '' })
this.form.setFieldsValue(pick(record, 'departName','orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo')) this.form.setFieldsValue(pick(record, 'departName', 'orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
}) })
}, },
getCurrSelectedTitle() { getCurrSelectedTitle() {
@@ -517,16 +531,16 @@
this.$confirm({ this.$confirm({
title: this.$t('confirmDeletion'), title: this.$t('confirmDeletion'),
content: this.$t('deleteDepartmentData'), content: this.$t('deleteDepartmentData'),
onOk: function () { onOk: function() {
deleteByDepartId({id: that.rightClickSelectedKey}).then((resp) => { deleteByDepartId({ id: that.rightClickSelectedKey }).then((resp) => {
if (resp.success) { if (resp.success) {
//删除成功后,去除已选中中的数据 //删除成功后,去除已选中中的数据
that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1); that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1)
that.$message.success(this.$t('DeleteSucceeded')) that.$message.success(this.$t('DeleteSucceeded'))
that.loadTree() that.loadTree()
//删除后同步清空右侧基本信息内容 //删除后同步清空右侧基本信息内容
let orgCode=that.form.getFieldValue("orgCode"); let orgCode = that.form.getFieldValue('orgCode')
if(orgCode && orgCode === that.rightClickSelectedOrgCode){ if (orgCode && orgCode === that.rightClickSelectedOrgCode) {
that.onClearSelected() that.onClearSelected()
} }
} else { } else {
@@ -538,7 +552,7 @@
}, },
selectDirectiveOk(record) { selectDirectiveOk(record) {
// console.log('选中指令数据', record) // console.log('选中指令数据', record)
this.nodeSettingForm.setFieldsValue({directiveCode: record.directiveCode}) this.nodeSettingForm.setFieldsValue({ directiveCode: record.directiveCode })
this.currSelected.sysCode = record.sysCode this.currSelected.sysCode = record.sysCode
}, },
getFlowGraphData(node) { getFlowGraphData(node) {
@@ -557,28 +571,21 @@
} }
} }
}, },
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------> // <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
expandAll () { expandAll() {
this.iExpandedKeys = this.allTreeKeys this.iExpandedKeys = this.allTreeKeys
}, },
closeAll () { closeAll() {
this.iExpandedKeys = [] this.iExpandedKeys = []
}, },
checkALL () { checkALL() {
this.checkStriccheckStrictlytly = false this.checkStriccheckStrictlytly = false
this.checkedKeys = this.allTreeKeys this.checkedKeys = this.allTreeKeys
}, },
cancelCheckALL () { cancelCheckALL() {
//this.checkedKeys = this.defaultCheckedKeys //this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = [] this.checkedKeys = []
}, },
// switchCheckStrictly (v) {
// if(v==1){
// this.checkStrictly = false
// }else if(v==2){
// this.checkStrictly = true
// }
// },
getAllKeys(node) { getAllKeys(node) {
// console.log('node',node); // console.log('node',node);
this.allTreeKeys.push(node.key) this.allTreeKeys.push(node.key)
@@ -595,7 +602,7 @@
this.currFlowId = this.$route.params.id this.currFlowId = this.$route.params.id
this.currFlowName = this.$route.params.name this.currFlowName = this.$route.params.name
// this.loadTree() // this.loadTree()
}, }
} }
</script> </script>
@@ -659,4 +666,8 @@
background: #fff; background: #fff;
border-radius: 0 0 2px 2px; border-radius: 0 0 2px 2px;
} }
.box-ant {
margin-right: 0 !important;
}
</style> </style>
+137 -85
View File
@@ -4,40 +4,59 @@
<!-- 左侧面板 --> <!-- 左侧面板 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="12"> <a-row :gutter="24">
<a-col :md="7" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item :label="$t('DictionaryName')" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}"> <div class="box-title-text">
<a-input :placeholder="$t('enterDictionary')" v-model="queryParam.dictName"></a-input> <div class="title-text" :title="$t('DictionaryName')">
</a-form-item> <span>{{$t('DictionaryName')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('DictionaryName')"
v-model="queryParam.dictName"></j-input>
</div>
</a-col> </a-col>
<a-col :md="7" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item :label="$t('DictionaryEnName')" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}"> <div class="box-title-text">
<a-input :placeholder="$t('enterEnDictionary')" v-model="queryParam.dictEnName"></a-input> <div class="title-text" :title="$t('DictionaryEnName')">
</a-form-item> <span>{{$t('DictionaryEnName')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('DictionaryEnName')"
v-model="queryParam.dictEnName"></j-input>
</div>
</a-col> </a-col>
<a-col :md="7" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item :label="$t('DictionaryNumber')" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}"> <div class="box-title-text">
<a-input :placeholder="$t('enterDictionaryNumber')" v-model="queryParam.dictCode"></a-input> <div class="title-text" :title="$t('DictionaryNumber')">
</a-form-item> <span>{{$t('DictionaryNumber')}}</span>
</a-col> </div>
<a-col :md="7" :sm="8"> <j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('DictionaryNumber')"
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> v-model="queryParam.dictCode"></j-input>
<a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button> </div>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{$t('reset')}}</a-button>
</span>
</a-col> </a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col>
</span>
</a-row> </a-row>
</a-form> </a-form>
<div class="table-operator" style="border-top: 5px"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">{{$t('addTo')}}</a-button> <!-- <a-button @click="handleAdd" type="primary" icon="plus">{{$t('addTo')}}</a-button>-->
<a-button type="primary" icon="download" @click="handleExportXls(this.$t('DictionaryInformation'))">{{$t('export')}}</a-button> <div @click="handleAdd" class="operator-text">
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-icon type="plus"/>
<a-button type="primary" icon="import">{{$t('import')}}</a-button> {{$t('addTo')}}
</a-upload> </div>
<a-button type="primary" icon="sync" @click="refleshCache()">{{$t('RefreshCache')}}}</a-button> <!-- <a-button type="primary" icon="download" @click="handleExportXls(this.$t('DictionaryInformation'))">-->
<!-- {{$t('export')}}-->
<!-- </a-button>-->
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"-->
<!-- @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">{{$t('import')}}</a-button>-->
<!-- </a-upload>-->
<!-- <a-button type="primary" icon="sync" @click="refleshCache()">{{$t('RefreshCache')}}}</a-button>-->
<a-button type="primary" icon="hdd" @click="openDeleteList">{{$t('recycleBin')}}</a-button> <!-- <a-button type="primary" icon="hdd" @click="openDeleteList">{{$t('recycleBin')}}</a-button>-->
</div> </div>
<a-table <a-table
@@ -51,11 +70,10 @@
@change="handleTableChange"> @change="handleTableChange">
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"> <a @click="handleEdit(record)">
<a-icon type="edit"/>
{{$t('edit')}} {{$t('edit')}}
</a> </a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a @click="editDictItem(record)"><a-icon type="setting"/> {{$t('DictionaryConfiguration')}}</a> <a @click="editDictItem(record)"> {{$t('DictionaryConfiguration')}}</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-popconfirm :title="$t('areYouSure')" @confirm="() =>handleDelete(record.id)"> <a-popconfirm :title="$t('areYouSure')" @confirm="() =>handleDelete(record.id)">
<a>{{$t('delete')}}</a> <a>{{$t('delete')}}</a>
@@ -71,27 +89,27 @@
</template> </template>
<script> <script>
import { filterObj } from '@/utils/util'; import { filterObj } from '@/utils/util'
import { JeroListMixin } from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import DictModal from './modules/DictModal' import DictModal from './modules/DictModal'
import DictItemList from './DictItemList' import DictItemList from './DictItemList'
import DictDeleteList from './DictDeleteList' import DictDeleteList from './DictDeleteList'
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types" import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
import Vue from 'vue' import Vue from 'vue'
export default { export default {
name: "DictList", name: 'DictList',
mixins:[JeroListMixin], mixins: [JeroListMixin],
components: {DictModal, DictItemList,DictDeleteList}, components: { DictModal, DictItemList, DictDeleteList },
data() { data() {
return { return {
description: this.$t('dataDictionaryPage'), description: this.$t('dataDictionaryPage'),
visible: false, visible: false,
// 查询条件 // 查询条件
queryParam: { queryParam: {
dictCode: "", dictCode: '',
dictName: "", dictName: ''
}, },
// 表头 // 表头
columns: [ columns: [
@@ -100,15 +118,15 @@
dataIndex: '', dataIndex: '',
key: 'rowIndex', key: 'rowIndex',
width: 120, width: 120,
align: "center", align: 'center',
customRender: function (t, r, index) { customRender: function(t, r, index) {
return parseInt(index) + 1; return parseInt(index) + 1
} }
}, },
{ {
title: this.$t('DictionaryName'), title: this.$t('DictionaryName'),
align: "left", align: 'left',
dataIndex: 'dictName', dataIndex: 'dictName'
}, },
// { // {
// title: this.$t('DictionaryEnName'), // title: this.$t('DictionaryEnName'),
@@ -118,80 +136,80 @@
// }, // },
{ {
title: this.$t('DictionaryNumber'), title: this.$t('DictionaryNumber'),
align: "left", align: 'left',
dataIndex: 'dictCode', dataIndex: 'dictCode'
}, },
{ {
title: this.$t('describe'), title: this.$t('describe'),
align: "left", align: 'left',
dataIndex: 'description', dataIndex: 'description'
}, },
{ {
title: this.$t('operation'), title: this.$t('operation'),
dataIndex: 'action', dataIndex: 'action',
align: "center", align: 'center',
width: 230, width: 430,
scopedSlots: {customRender: 'action'}, scopedSlots: { customRender: 'action' }
} }
], ],
dict: "", dict: '',
labelCol: { labelCol: {
xs: {span: 8}, xs: { span: 8 },
sm: {span: 5}, sm: { span: 5 }
}, },
wrapperCol: { wrapperCol: {
xs: {span: 16}, xs: { span: 16 },
sm: {span: 19}, sm: { span: 19 }
}, },
url: { url: {
list: "/sys/dict/page", list: '/sys/dict/page',
delete: "/sys/dict/delete", delete: '/sys/dict/delete',
exportXlsUrl: "sys/dict/exportXls", exportXlsUrl: 'sys/dict/exportXls',
importExcelUrl: "sys/dict/importExcel", importExcelUrl: 'sys/dict/importExcel',
refleshCache: "sys/dict/refleshCache", refleshCache: 'sys/dict/refleshCache',
queryAllDictItems: "sys/dict/queryAllDictItems", queryAllDictItems: 'sys/dict/queryAllDictItems'
}, }
} }
}, },
computed: { computed: {
importExcelUrl: function () { importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
} }
}, },
methods: { methods: {
getQueryParams() { getQueryParams() {
var param = Object.assign({}, this.queryParam, this.isorter); var param = Object.assign({}, this.queryParam, this.isorter)
param.field = this.getQueryField(); param.field = this.getQueryField()
param.pageNo = this.ipagination.current; param.pageNo = this.ipagination.current
param.pageSize = this.ipagination.pageSize; param.pageSize = this.ipagination.pageSize
if (this.superQueryParams) { if (this.superQueryParams) {
param['superQueryParams'] = encodeURI(this.superQueryParams) param['superQueryParams'] = encodeURI(this.superQueryParams)
param['superQueryMatchType'] = this.superQueryMatchType param['superQueryMatchType'] = this.superQueryMatchType
} }
return filterObj(param); return filterObj(param)
}, },
//取消选择 //取消选择
cancelDict() { cancelDict() {
this.dict = ""; this.dict = ''
this.visible = false; this.visible = false
this.loadData(); this.loadData()
}, },
//编辑字典数据 //编辑字典数据
editDictItem(record) { editDictItem(record) {
this.$refs.dictItemList.edit(record); this.$refs.dictItemList.edit(record)
}, },
// 重置字典类型搜索框的内容 // 重置字典类型搜索框的内容
searchReset() { searchReset() {
var that = this; var that = this
that.queryParam.dictName = ""; that.queryParam.dictName = ''
that.queryParam.dictEnName = ""; that.queryParam.dictEnName = ''
that.queryParam.dictCode = ""; that.queryParam.dictCode = ''
that.loadData(this.ipagination.current); that.loadData(this.ipagination.current)
}, },
openDeleteList(){ openDeleteList() {
this.$refs.dictDeleteList.show() this.$refs.dictDeleteList.show()
}, },
refleshCache(){ refleshCache() {
getAction(this.url.refleshCache).then((res) => { getAction(this.url.refleshCache).then((res) => {
if (res.success) { if (res.success) {
//重新加载缓存 //重新加载缓存
@@ -201,21 +219,55 @@
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000) Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
} }
}) })
this.$message.success(this.$t('DescriptionRefreshCache')); this.$message.success(this.$t('DescriptionRefreshCache'))
} }
}).catch(e=>{ }).catch(e => {
this.$message.warn(this.$t('FailedRefreshCache')); this.$message.warn(this.$t('FailedRefreshCache'))
console.log(this.$t('refreshFailed'),e) console.log(this.$t('refreshFailed'), e)
}) })
} }
}, },
watch: { watch: {
openKeys(val) { openKeys(val) {
console.log('openKeys', val) console.log('openKeys', val)
}, }
}, }
} }
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less' @import '~@assets/less/common.less';
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 90px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
/*margin-top: 2px;*/
}
</style> </style>
+90 -39
View File
@@ -6,18 +6,20 @@
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item :label="$t('roleName')"> <div class="box-title-text">
<a-input placeholder="" v-model="queryParam.roleName"></a-input> <div class="title-text" :title="$t('roleName')">
</a-form-item> <span>{{$t('roleName')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('roleName')"
v-model="queryParam.roleName"></j-input>
</div>
</a-col> </a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-button type="primary" @click="searchQuery" icon="search" <a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
style="margin-left: 21px">{{$t('query')}}</a-button> <a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
<a-button type="primary" @click="searchReset" icon="reload" </a-col>
style="margin-left: 8px">{{$t('reset')}}</a-button> </span>
</a-col>
</span>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
@@ -28,7 +30,10 @@
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">{{$t('import')}}</a-button>--> <!-- <a-button type="primary" icon="import">{{$t('import')}}</a-button>-->
<!-- </a-upload>--> <!-- </a-upload>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls($t('RoleManagement'))">{{$t('export')}}</a-button>--> <div @click="handleExportXls($t('RoleManagement'))" class="operator-text">
<a-icon type="export" :rotate="-90"/>
{{$t('export')}}
</div>
</div> </div>
<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
@@ -40,6 +45,7 @@
<div style="margin-top: 15px"> <div style="margin-top: 15px">
<a-table <a-table
ref="table" ref="table"
rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
@@ -106,34 +112,46 @@
selectionRows2: [], selectionRows2: [],
test: {}, test: {},
rightcolval: 0, rightcolval: 0,
columns: columns: [
[ {
{ title: this.$t('serialNumber'),
title: this.$t('RoleCode'), dataIndex: '',
align: 'center', key: 'rowIndex',
dataIndex: 'roleCode' width: 20,
}, align: 'center',
{ customRender: function(t, r, index) {
title: this.$t('roleName'), return parseInt(index) + 1
align: 'center',
dataIndex: 'roleName'
},
{
title: this.$t('createTime'),
dataIndex: 'createTime',
align: 'center',
sorter: true,
customRender: (text) => {
return moment(text).format('YYYY-MM-DD')
}
} }
// { },
// title: this.$t('operation'), {
// dataIndex: 'action', title: this.$t('RoleCode'),
// align: 'center', align: 'center',
// scopedSlots: { customRender: 'action' } dataIndex: 'roleCode',
// } width: 180
], },
{
title: this.$t('roleName'),
align: 'center',
dataIndex: 'roleName',
width: 180
},
{
title: this.$t('createTime'),
dataIndex: 'createTime',
align: 'center',
width: 180,
sorter: true,
customRender: (text) => {
return moment(text).format('YYYY-MM-DD')
}
}
// {
// title: this.$t('operation'),
// dataIndex: 'action',
// align: 'center',
// scopedSlots: { customRender: 'action' }
// }
],
// 高级查询拼接条件 // 高级查询拼接条件
superQueryMatchType2: 'and', superQueryMatchType2: 'and',
url: { url: {
@@ -351,4 +369,37 @@
.ant-btn { .ant-btn {
margin-left: 8px margin-left: 8px
} }
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 90px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
/*margin-top: 2px;*/
}
</style> </style>
@@ -135,10 +135,6 @@
} }
}, },
methods: { methods: {
handleDetail: function(record) {
this.$refs.sysAnnouncementModal.detail(record)
this.$refs.sysAnnouncementModal.title = '查看'
},
showAnnouncement(record) { showAnnouncement(record) {
putAction(this.url.editCementSend, { anntId: record.anntId }).then((res) => { putAction(this.url.editCementSend, { anntId: record.anntId }).then((res) => {
if (res.success) { if (res.success) {
@@ -164,8 +160,10 @@
getAction(that.url.readAllMsg, { ids: selectedRowKeys.join(',') }).then((res) => { getAction(that.url.readAllMsg, { ids: selectedRowKeys.join(',') }).then((res) => {
if (res.success) { if (res.success) {
that.selectedRowKeys = [] that.selectedRowKeys = []
that.$message.success(res.message) that.$message.success(this.$t('OperationSuccessful'))
that.loadData() that.loadData()
}else{
that.$message.success(this.$t('operationFailed'))
} }
}) })
} }
@@ -195,8 +193,10 @@
deleteAction(that.url.deleteUrl, { ids: selectedRowKeys.join(',') }).then((res) => { deleteAction(that.url.deleteUrl, { ids: selectedRowKeys.join(',') }).then((res) => {
if (res.success) { if (res.success) {
that.selectedRowKeys = [] that.selectedRowKeys = []
that.$message.success(res.message) that.$message.success(this.$t('OperationSuccessful'))
that.loadData() that.loadData()
}else{
that.$message.success(this.$t('operationFailed'))
} }
}) })
} }
+181 -130
View File
@@ -5,75 +5,84 @@
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item :label="$t('account')">
<j-input :placeholder="$t('EnterAccountFuzzyQuery')" v-model="queryParam.username"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item :label="$t('Gender')"> <div class="box-title-text">
<a-select v-model="queryParam.sex" :placeholder="$t('pleaseSelect')+$t('Gender')"> <div class="title-text" :title="$t('account')">
<span>{{$t('account')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('account')"
v-model="queryParam.username"></j-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('RealName')">
<span>{{$t('RealName')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('RealName')"
v-model="queryParam.realname"></j-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('EmployeeNumber')">
<span>{{$t('EmployeeNumber')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('EmployeeNumber')"
v-model="queryParam.workNo"></j-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('EmployeeType')">
<span>{{$t('EmployeeType')}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParam.workerType"
:placeholder="$t('pleaseSelect')+$t('EmployeeType')"
:type="'select'"
:triggerChange="false" dictCode="worker_type"/>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('status')">
<span>{{$t('status')}}</span>
</div>
<a-select class="box-input" v-model="queryParam.status"
:placeholder="$t('pleaseSelect')+$t('status')">
<a-select-option value="">{{$t('pleaseSelect')}}</a-select-option> <a-select-option value="">{{$t('pleaseSelect')}}</a-select-option>
<a-select-option value="1">{{$t('male')}}</a-select-option> <a-select-option value="1">{{$t('normal')}}</a-select-option>
<a-select-option value="2">{{$t('female')}}</a-select-option> <a-select-option value="2">{{$t('frozen')}}</a-select-option>
</a-select> </a-select>
</a-form-item> </div>
</a-col> </a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<template v-if="toggleSearchStatus"> <a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-col :md="6" :sm="8"> <a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
<a-form-item :label="$t('RealName')"> </a-col>
<a-input :placeholder="$t('pleaseEnter')+$t('RealName')" v-model="queryParam.realname"></a-input> </span>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item :label="$t('phoneNumber')">
<a-input :placeholder="$t('pleaseEnter')+$t('phoneNumber')+$t('query')" v-model="queryParam.phone"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item :label="$t('userStatues')">
<a-select v-model="queryParam.status" :placeholder="$t('pleaseSelect')">
<a-select-option value="">{{$t('pleaseSelect')}}</a-select-option>
<a-select-option value="1">{{$t('normal')}}</a-select-option>
<a-select-option value="2">{{$t('frozen')}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{$t('reset')}}</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? $t('putAway') : $t('open') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator" style="border-top: 5px"> <div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus" >{{$t('addUser')}}</a-button>--> <!-- <a-button @click="handleAdd" type="primary" icon="plus" >{{$t('addUser')}}</a-button>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls($t('userInformation'))">{{$t('export')}}</a-button>--> <!-- <a-button type="primary" icon="download" @click="handleExportXls($t('userInformation'))">{{$t('export')}}</a-button>-->
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">{{$t('import')}}</a-button>--> <!-- <a-button type="primary" icon="import">{{$t('import')}}</a-button>-->
<!-- </a-upload>--> <!-- </a-upload>-->
<!-- <a-button type="primary" icon="hdd" @click="recycleBinVisible=true">{{$t('recycleBin')}}</a-button>--> <!-- <a-button type="primary" icon="hdd" @click="recycleBinVisible=true">{{$t('recycleBin')}}</a-button>-->
<div @click="handleExportXls($t('userInformation'))" class="operator-text">
<a-icon type="export" :rotate="-90"/>
{{$t('export')}}
</div>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"-->
<a-table <a-table
ref="table" ref="table"
rowKey="id" rowKey="id"
@@ -81,7 +90,6 @@
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"> @change="handleTableChange">
<template slot="avatarslot" slot-scope="text, record, index"> <template slot="avatarslot" slot-scope="text, record, index">
@@ -106,15 +114,15 @@
<script> <script>
import UserModal from './modules/UserModal' import UserModal from './modules/UserModal'
import PasswordModal from './modules/PasswordModal' import PasswordModal from './modules/PasswordModal'
import {putAction,getFileAccessHttpUrl} from '@/api/manage'; import { putAction, getFileAccessHttpUrl } from '@/api/manage'
import {frozenBatch} from '@/api/api' import { frozenBatch } from '@/api/api'
import {JeroListMixin} from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import JInput from '@/components/jero/JInput' import JInput from '@/components/jero/JInput'
import UserRecycleBinModal from './modules/UserRecycleBinModal' import UserRecycleBinModal from './modules/UserRecycleBinModal'
import JSuperQuery from '@/components/jero/JSuperQuery' import JSuperQuery from '@/components/jero/JSuperQuery'
export default { export default {
name: "UserList", name: 'UserList',
mixins: [JeroListMixin], mixins: [JeroListMixin],
components: { components: {
UserModal, UserModal,
@@ -132,42 +140,41 @@
{ {
title: this.$t('serialNumber'), title: this.$t('serialNumber'),
dataIndex: '', dataIndex: '',
key:'rowIndex', key: 'rowIndex',
width:20, width: 20,
align:"center", align: 'center',
customRender:function (t,r,index) { customRender: function(t, r, index) {
return parseInt(index)+1; return parseInt(index) + 1
} }
}, },
{ {
title: this.$t('userAccount'), title: this.$t('userAccount'),
align: "center", align: 'center',
dataIndex: 'username', dataIndex: 'username',
width: 120, width: 120,
sorter: true sorter: true
}, },
{ {
title: this.$t('userName'), title: this.$t('userName'),
align: "center", align: 'center',
width: 100, width: 100,
dataIndex: 'realname', dataIndex: 'realname'
}, },
{ {
title: this.$t('Gender'), title: this.$t('EmployeeNumber'),
align: "center", align: 'center',
width: 80, width: 100,
dataIndex: 'sex_dictText', dataIndex: 'workNo'
sorter: true
}, },
{ {
title: this.$t('phoneNumber'), title: this.$t('EmployeeType'),
align: "center", align: 'center',
width: 100, width: 100,
dataIndex: 'phone' dataIndex: 'workerType_dictText'
}, },
{ {
title: this.$t('department'), title: this.$t('department'),
align: "center", align: 'center',
width: 180, width: 180,
dataIndex: 'orgCodeTxt' dataIndex: 'orgCodeTxt'
}, },
@@ -185,10 +192,10 @@
// }, // },
{ {
title: this.$t('status'), title: this.$t('status'),
align: "center", align: 'center',
width: 80, width: 80,
dataIndex: 'status_dictText' dataIndex: 'status_dictText'
}, }
// { // {
// title: this.$t('operation'), // title: this.$t('operation'),
// dataIndex: 'action', // dataIndex: 'action',
@@ -198,94 +205,94 @@
// } // }
], ],
superQueryFieldList: [ superQueryFieldList: [
{ type: 'input', value: 'username', text: this.$t('userAccount'), }, { type: 'input', value: 'username', text: this.$t('userAccount') },
{ type: 'input', value: 'realname', text: this.$t('userName'), }, { type: 'input', value: 'realname', text: this.$t('userName') },
{ type: 'select', value: 'sex', text: this.$t('Gender'), dictCode: 'sex' }, { type: 'select', value: 'sex', text: this.$t('Gender'), dictCode: 'sex' }
], ],
url: { url: {
syncUser: "/act/process/extActProcess/doSyncUser", syncUser: '/act/process/extActProcess/doSyncUser',
list: "/sys/user/page", list: '/sys/user/page',
delete: "/sys/user/delete", delete: '/sys/user/delete',
deleteBatch: "/sys/user/deleteBatch", deleteBatch: '/sys/user/deleteBatch',
exportXlsUrl: "/sys/user/exportXls", exportXlsUrl: '/sys/user/exportXls',
importExcelUrl: "sys/user/importExcel", importExcelUrl: 'sys/user/importExcel'
}, }
} }
}, },
computed: { computed: {
importExcelUrl: function(){ importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
} }
}, },
methods: { methods: {
getAvatarView: function (avatar) { getAvatarView: function(avatar) {
return getFileAccessHttpUrl(avatar) return getFileAccessHttpUrl(avatar)
}, },
batchFrozen: function (status) { batchFrozen: function(status) {
if (this.selectedRowKeys.length <= 0) { if (this.selectedRowKeys.length <= 0) {
this.$message.warning(this.$t('pleaseSelect')+this.$t('aRcord')); this.$message.warning(this.$t('pleaseSelect') + this.$t('aRcord'))
return false; return false
} else { } else {
let ids = ""; let ids = ''
let that = this; let that = this
let isAdmin = false; let isAdmin = false
that.selectionRows.forEach(function (row) { that.selectionRows.forEach(function(row) {
if (row.username == 'admin') { if (row.username == 'admin') {
isAdmin = true; isAdmin = true
} }
}); })
if (isAdmin) { if (isAdmin) {
that.$message.warning(this.$t('operationAllowedAccount')); that.$message.warning(this.$t('operationAllowedAccount'))
return; return
} }
that.selectedRowKeys.forEach(function (val) { that.selectedRowKeys.forEach(function(val) {
ids += val + ","; ids += val + ','
}); })
that.$confirm({ that.$confirm({
title: this.$t('confirm')+this.$t('operation'), title: this.$t('confirm') + this.$t('operation'),
content: this.whether + (status == 1 ? this.$t('thaw') : this.$t('frozen')) + this.$t('selectedAccount'), content: this.whether + (status == 1 ? this.$t('thaw') : this.$t('frozen')) + this.$t('selectedAccount'),
onOk: function () { onOk: function() {
frozenBatch({ids: ids, status: status}).then((res) => { frozenBatch({ ids: ids, status: status }).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message); that.$message.success(res.message)
that.loadData(); that.loadData()
that.onClearSelected(); that.onClearSelected()
} else { } else {
that.$message.warning(res.message); that.$message.warning(res.message)
} }
}); })
} }
}); })
} }
}, },
handleMenuClick(e) { handleMenuClick(e) {
if (e.key == 1) { if (e.key == 1) {
this.batchDel(); this.batchDel()
} else if (e.key == 2) { } else if (e.key == 2) {
this.batchFrozen(2); this.batchFrozen(2)
} else if (e.key == 3) { } else if (e.key == 3) {
this.batchFrozen(1); this.batchFrozen(1)
} }
}, },
handleFrozen: function (id, status, username) { handleFrozen: function(id, status, username) {
let that = this; let that = this
//TODO 后台校验管理员角色 //TODO 后台校验管理员角色
if ('admin' == username) { if ('admin' == username) {
that.$message.warning(this.$t('adminDoNotAllowOperation')); that.$message.warning(this.$t('adminDoNotAllowOperation'))
return; return
} }
frozenBatch({ids: id, status: status}).then((res) => { frozenBatch({ ids: id, status: status }).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message); that.$message.success(res.message)
that.loadData(); that.loadData()
} else { } else {
that.$message.warning(res.message); that.$message.warning(res.message)
} }
}); })
}, },
handleChangePassword(username) { handleChangePassword(username) {
this.$refs.passwordmodal.show(username); this.$refs.passwordmodal.show(username)
}, },
passwordModalOk() { passwordModalOk() {
//TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下 //TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
@@ -295,5 +302,49 @@
} }
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less' @import '~@assets/less/common.less';
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 90px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
/*margin-top: 2px;*/
}
</style>
<style>
.box-input .ant-select-selection {
height: 38px !important;
}
.box-input .ant-select-selection__rendered {
line-height: 38px;
}
</style> </style>
@@ -7,18 +7,13 @@
<a-row :gutter="10"> <a-row :gutter="10">
<a-col :md="10" :sm="12"> <a-col :md="10" :sm="12">
<a-form-item :label="$t('userAccount')" style="margin-left:8px"> <a-form-item :label="$t('userAccount')" style="margin-left:8px">
<a-input :placeholder="$t('enterAccountNumber')" v-model="queryParam.username"></a-input> <j-input :placeholder="$t('enterAccountNumber')" v-model="queryParam.username"></j-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<!--<a-col :md="8" :sm="8">--> <span style="float: left;overflow: hidden;margin-top: 1px" class="table-page-search-submitButtons">
<!--<a-form-item label="用户名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">-->
<!--<a-input placeholder="请输入名称查询" v-model="queryParam.realname"></a-input>-->
<!--</a-form-item>-->
<!--</a-col>-->
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 18px">{{$t('query')}}</a-button> <a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{$t('reset')}}</a-button> <a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
@@ -27,72 +22,66 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator" :md="24" :sm="24" style="margin-top: -15px"> <div class="table-operator" :md="24" :sm="24" style="margin-top: -15px">
<!--<a-button @click="handleEdit" type="primary" icon="edit" style="margin-top: 16px">用户编辑</a-button>--> <!--<a-button @click="handleEdit" type="primary" icon="edit" style="margin-top: 16px">用户编辑</a-button>-->
<a-button @click="handleAddUserDepart" type="primary" icon="plus">{{$t('AddExistingUsers')}}</a-button> <!-- <a-button @click="handleAddUserDepart" type="primary" icon="plus">{{$t('AddExistingUsers')}}</a-button>-->
<a-button @click="handleAdd" type="primary" icon="plus" style="margin-top: 16px">{{$t('newUser')}}</a-button> <!-- <a-button @click="handleAdd" type="primary" icon="plus" style="margin-top: 16px">{{$t('newUser')}}</a-button>-->
<a-dropdown v-if="selectedRowKeys.length > 0"> <!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<a-menu slot="overlay"> <!-- <a-menu slot="overlay">-->
<a-menu-item key="1" @click="batchDel"> <!-- <a-menu-item key="1" @click="batchDel">-->
<a-icon type="delete"/> <!-- <a-icon type="delete"/>-->
{{$t('disassociate')}} <!-- {{$t('disassociate')}}-->
</a-menu-item> <!-- </a-menu-item>-->
</a-menu> <!-- </a-menu>-->
<a-button style="margin-left: 8px"> {{$t('batchOperation')}} <!-- <a-button style="margin-left: 8px"> {{$t('batchOperation')}}-->
<a-icon type="down"/> <!-- <a-icon type="down"/>-->
</a-button> <!-- </a-button>-->
</a-dropdown> <!-- </a-dropdown>-->
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
<i class="anticon anticon-info-circle ant-alert-icon"></i> {{$t('selected')}} <a style="font-weight: 600">{{ <!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> {{$t('selected')}} <a style="font-weight: 600">{{-->
selectedRowKeys.length }}</a> {{$t('term')}} <!-- selectedRowKeys.length }}</a> {{$t('term')}}-->
<a style="margin-left: 24px" @click="onClearSelected">{{$t('empty')}}</a> <!-- <a style="margin-left: 24px" @click="onClearSelected">{{$t('empty')}}</a>-->
</div> <!-- </div>-->
<!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"-->
<!-- rowKey="id" bordered-->
<a-table <a-table
ref="table" ref="table"
size="middle" size="middle"
bordered
rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"> @change="handleTableChange">
<!-- <span slot="action" slot-scope="text, record">-->
<!-- <a @click="handleEdit(record)">{{$t('edit')}}</a>-->
<!-- <a-divider type="vertical"/>-->
<span slot="action" slot-scope="text, record"> <!-- <a-dropdown>-->
<a @click="handleEdit(record)">{{$t('edit')}}</a> <!-- <a class="ant-dropdown-link">-->
<!-- {{$t('more')}} <a-icon type="down"/>-->
<a-divider type="vertical"/> <!-- </a>-->
<!-- <a-menu slot="overlay">-->
<a-dropdown> <!-- <a-menu-item>-->
<a class="ant-dropdown-link"> <!-- <a href="javascript:;" @click="handleDeptRole(record)">{{$t('AssignDepartmentRoles')}}</a>-->
{{$t('more')}} <a-icon type="down"/> <!-- </a-menu-item>-->
</a>
<a-menu slot="overlay">
<a-menu-item>
<a href="javascript:;" @click="handleDeptRole(record)">{{$t('AssignDepartmentRoles')}}</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">{{$t('userDetail')}}</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm :title="$t('AreYouCancelAssociation')" @confirm="() => handleDelete(record.id)">
<a>{{$t('disassociate')}}</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
<!-- <a-menu-item>-->
<!-- <a href="javascript:;" @click="handleDetail(record)">{{$t('userDetail')}}</a>-->
<!-- </a-menu-item>-->
<!-- <a-menu-item>-->
<!-- <a-popconfirm :title="$t('AreYouCancelAssociation')" @confirm="() => handleDelete(record.id)">-->
<!-- <a>{{$t('disassociate')}}</a>-->
<!-- </a-popconfirm>-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- </a-dropdown>-->
<!-- </span>-->
</a-table> </a-table>
</div> </div>
<!-- table区域-end --> <!-- table区域-end -->
@@ -140,29 +129,32 @@
align: "center", align: "center",
dataIndex: 'orgCode' dataIndex: 'orgCode'
}, },
{ // {
title: this.$t('Gender'), // title: this.$t('Gender'),
align: "center", // align: "center",
dataIndex: 'sex_dictText' // dataIndex: 'sex_dictText'
}, // },
{ // {
title: this.$t('phoneNumber'), // title: this.$t('phoneNumber'),
align: "center", // align: "center",
dataIndex: 'phone' // dataIndex: 'phone'
}, // },
{ // {
title: this.$t('operation'), // title: this.$t('operation'),
dataIndex: 'action', // dataIndex: 'action',
scopedSlots: {customRender: 'action'}, // scopedSlots: {customRender: 'action'},
align: "center", // align: "center",
width: 150 // width: 150
}], // }
],
url: { url: {
list: "/sys/user/departUserList", list: "/sys/user/departUserList",
edit: "/sys/user/editSysDepartWithUser", edit: "/sys/user/editSysDepartWithUser",
delete: "/sys/user/deleteUserInDepart", delete: "/sys/user/deleteUserInDepart",
deleteBatch: "/sys/user/deleteUserInDepartBatch", deleteBatch: "/sys/user/deleteUserInDepartBatch",
} },
loading:false,
dataSource:[],
} }
}, },
created() { created() {
@@ -171,13 +163,15 @@
methods: { methods: {
searchReset() { searchReset() {
this.queryParam = {} this.queryParam = {}
this.loadData(1); this.loadDataIndex(1);
}, },
loadData(arg) { loadData(){},
loadDataIndex(arg) {
if (!this.url.list) { if (!this.url.list) {
this.$message.error(this.$t('setURLListAttribute')) this.$message.error(this.$t('setURLListAttribute'))
return return
} }
this.loading = true
//加载数据 若传入参数1则加载第一页的内容 //加载数据 若传入参数1则加载第一页的内容
if (arg === 1) { if (arg === 1) {
this.ipagination.current = 1; this.ipagination.current = 1;
@@ -186,9 +180,12 @@
let params = this.getQueryParams();//查询条件 let params = this.getQueryParams();//查询条件
params.depId = this.currentDeptId; params.depId = this.currentDeptId;
getAction(this.url.list, params).then((res) => { getAction(this.url.list, params).then((res) => {
this.loading = false
if (res.success && res.result) { if (res.success && res.result) {
this.dataSource = res.result.records; this.dataSource = res.result.records || [];
this.ipagination.total = res.result.total; this.ipagination.total = res.result.total;
}else{
this.dataSource = []
} }
}) })
}, },
@@ -220,7 +217,7 @@
deleteAction(that.url.deleteBatch, {depId: that.currentDeptId, userIds: ids}).then((res) => { deleteAction(that.url.deleteBatch, {depId: that.currentDeptId, userIds: ids}).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(this.$t('SuccessfullyDeleted')); that.$message.success(this.$t('SuccessfullyDeleted'));
that.loadData(); that.loadDataIndex();
that.onClearSelected(); that.onClearSelected();
} else { } else {
that.$message.warning(res.message); that.$message.warning(res.message);
@@ -252,17 +249,16 @@
} }
} }
} }
that.loadData(); that.loadDataIndex();
} else { } else {
that.$message.warning(res.message); that.$message.warning(res.message);
} }
}); });
}, },
open(record) { open(record) {
//console.log(record);
this.currentDeptId = record.id; this.currentDeptId = record.id;
this.currentDept = record; this.currentDept = record;
this.loadData(1); this.loadDataIndex(1);
}, },
clearList() { clearList() {
this.currentDeptId = ''; this.currentDeptId = '';
@@ -313,7 +309,7 @@
postAction(this.url.edit, params).then((res) => { postAction(this.url.edit, params).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(res.message); this.$message.success(res.message);
this.loadData(); this.loadDataIndex();
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }