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