Merge remote-tracking branch 'origin/fix-bug-202303' into fix-bug-202303

This commit is contained in:
梁琦涛
2023-03-06 11:37:07 +08:00
37 changed files with 436 additions and 373 deletions
@@ -8,8 +8,10 @@ import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.vo.SysDepartTreeModel;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils;
import com.jero.common.api.vo.Result;
import com.jero.common.constant.CacheConstant;
@@ -69,7 +71,8 @@ public class SysDepartController {
*
* @return
*/
@RequestMapping(value = "/queryMyDeptTreeList", method = RequestMethod.GET)
// @RequestMapping(value = "/queryMyDeptTreeList", method = RequestMethod.GET)
@GetMapping("/queryMyDeptTreeList")
public Result<List<SysDepartTreeModel>> queryMyDeptTreeList() {
Result<List<SysDepartTreeModel>> result = new Result<>();
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -99,7 +102,8 @@ public class SysDepartController {
*
* @return
*/
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
// @RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
@GetMapping("/queryTreeList")
public Result<List<SysDepartTreeModel>> queryTreeList() {
Result<List<SysDepartTreeModel>> result = new Result<>();
try {
@@ -122,7 +126,8 @@ public class SysDepartController {
*
* @return
*/
@RequestMapping(value = "/queryDepartTreeSync", method = RequestMethod.GET)
// @RequestMapping(value = "/queryDepartTreeSync", method = RequestMethod.GET)
@GetMapping("/queryDepartTreeSync")
public Result<List<SysDepartTreeModel>> queryDepartTreeSync(@RequestParam(name = "pid", required = false) String parentId) {
Result<List<SysDepartTreeModel>> result = new Result<>();
try {
@@ -142,7 +147,7 @@ public class SysDepartController {
* @param orgCode 根据orgCode查,departId和orgCode必须有一个不为空
*/
@GetMapping("/queryAllParentId")
public Result queryParentIds(
public Result<JSONObject> queryParentIds(
@RequestParam(name = "departId", required = false) String departId,
@RequestParam(name = "orgCode", required = false) String orgCode
) {
@@ -170,7 +175,8 @@ public class SysDepartController {
*/
//@RequiresRoles({"admin"})
@RequiresPermissions("sys:depart:add")
@RequestMapping(value = "/add", method = RequestMethod.POST)
// @RequestMapping(value = "/add", method = RequestMethod.POST)
@PostMapping("/add")
@CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
public Result<Object> add(@RequestBody SysDepart sysDepart, HttpServletRequest request) {
String username = JwtUtil.getUserNameByToken(request);
@@ -192,7 +198,8 @@ public class SysDepartController {
*/
//@RequiresRoles({"admin"})
@RequiresPermissions("sys:depart:edit")
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
// @RequestMapping(value = "/edit", method = RequestMethod.PUT)
@PutMapping("/edit")
@CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
public Result<Object> edit(@RequestBody SysDepart sysDepart, HttpServletRequest request) {
String username = JwtUtil.getUserNameByToken(request);
@@ -216,7 +223,8 @@ public class SysDepartController {
*/
//@RequiresRoles({"admin"})
@RequiresPermissions("sys:depart:del")
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
// @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@DeleteMapping("/delete")
@CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
public Result<Object> delete(@RequestParam(name="id",required=true) String id) {
SysDepart sysDepart = sysDepartService.getById(id);
@@ -240,7 +248,8 @@ public class SysDepartController {
*/
//@RequiresRoles({"admin"})
@RequiresPermissions("sys:depart:del")
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
// @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
@DeleteMapping("/deleteBatch")
@CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
public Result<Object> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
if (ids == null || "".equals(ids.trim())) {
@@ -256,7 +265,8 @@ public class SysDepartController {
*
* @return
*/
@RequestMapping(value = "/queryIdTree", method = RequestMethod.GET)
// @RequestMapping(value = "/queryIdTree", method = RequestMethod.GET)
@GetMapping("/queryIdTree")
public Result<List<DepartIdModel>> queryIdTree() {
try {
List<DepartIdModel> list = sysDepartService.queryDepartIdTreeList();
@@ -275,7 +285,8 @@ public class SysDepartController {
* @param keyWord
* @return
*/
@RequestMapping(value = "/searchBy", method = RequestMethod.GET)
// @RequestMapping(value = "/searchBy", method = RequestMethod.GET)
@GetMapping("/searchBy")
public Result<List<SysDepartTreeModel>> searchBy(@RequestParam(name = "keyWord", required = true) String keyWord,@RequestParam(name = "myDeptSearch", required = false) String myDeptSearch) {
//部门查询,myDeptSearch为1时为我的部门查询,登录用户为上级时查只查负责部门下数据
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -284,7 +295,7 @@ public class SysDepartController {
departIds = user.getDepartIds();
}
List<SysDepartTreeModel> treeList = this.sysDepartService.searhBy(keyWord,myDeptSearch,departIds);
if (treeList == null || treeList.size() == 0) {
if (treeList == null || treeList.isEmpty()) {
return Result.error("未查询匹配数据!");
}
return Result.OK(treeList);
@@ -305,17 +316,12 @@ public class SysDepartController {
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<SysDepart> pageList = sysDepartService.list(queryWrapper);
//按字典排序
Collections.sort(pageList, new Comparator<SysDepart>() {
@Override
public int compare(SysDepart arg0, SysDepart arg1) {
return arg0.getOrgCode().compareTo(arg1.getOrgCode());
}
});
Collections.sort(pageList,(SysDepart arg0, SysDepart arg1)-> arg0.getOrgCode().compareTo(arg1.getOrgCode()));
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "部门列表");
mv.addObject(NormalExcelConstants.CLASS, SysDepart.class);
mv.addObject(JeroController.FILE_NAME, "部门列表");
mv.addObject(JeroController.CLASS, SysDepart.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("部门列表数据", "导出人:"+user.getRealname(), "导出信息"));
mv.addObject(JeroController.PARAMS, new ExportParams("部门列表数据", "导出人:"+user.getRealname(), "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@@ -329,9 +335,10 @@ public class SysDepartController {
*/
//@RequiresRoles({"admin"})
@RequiresPermissions("sys:depart:import")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
@PostMapping("/importExcel")
@CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
public Result<T> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
List<String> errorMessageList = new ArrayList<>();
List<SysDepart> listSysDeparts = null;
@@ -346,24 +353,25 @@ public class SysDepartController {
// orgCode编码长度
int codeLength = YouBianCodeUtil.ZHANWEI_LENGTH;
listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), SysDepart.class, params);
//按长度排序
Collections.sort(listSysDeparts, new Comparator<SysDepart>() {
//按长度排序 todo 当比较到最后一个元素时会出现空指针 导入需要做orgCode必填效验
/*Collections.sort(listSysDeparts, new Comparator<SysDepart>() {
@Override
public int compare(SysDepart arg0, SysDepart arg1) {
return arg0.getOrgCode().length() - arg1.getOrgCode().length();
}
});
});*/
Collections.sort(listSysDeparts, (SysDepart arg0, SysDepart arg1) -> arg0.getOrgCode().length() - arg1.getOrgCode().length());
int num = 0;
for (SysDepart sysDepart : listSysDeparts) {
String orgCode = sysDepart.getOrgCode();
if(orgCode.length() > codeLength) {
String parentCode = orgCode.substring(0, orgCode.length()-codeLength);
QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<SysDepart>();
QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", parentCode);
try {
SysDepart parentDept = sysDepartService.getOne(queryWrapper);
if(!parentDept.equals(null)) {
if(parentDept != null) {
sysDepart.setParentId(parentDept.getId());
} else {
sysDepart.setParentId("");
@@ -408,10 +416,10 @@ public class SysDepartController {
*/
@GetMapping("listAll")
public Result<List<SysDepart>> listAll(@RequestParam(name = "id", required = false) String id) {
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<>();
query.orderByAsc(SysDepart::getOrgCode);
if(oConvertUtils.isNotEmpty(id)){
String arr[] = id.split(",");
String[] arr = id.split(",");
query.in(SysDepart::getId,arr);
}
List<SysDepart> ls = this.sysDepartService.list(query);
@@ -422,14 +430,15 @@ public class SysDepartController {
*
* @return
*/
@RequestMapping(value = "/queryTreeByKeyWord", method = RequestMethod.GET)
// @RequestMapping(value = "/queryTreeByKeyWord", method = RequestMethod.GET)
@GetMapping("/queryTreeByKeyWord")
public Result<Map<String,Object>> queryTreeByKeyWord(@RequestParam(name = "keyWord", required = false) String keyWord) {
Result<Map<String,Object>> result = new Result<>();
try {
Map<String,Object> map=new HashMap<String,Object>();
Map<String,Object> map=new HashMap<>();
List<SysDepartTreeModel> list = sysDepartService.queryTreeByKeyWord(keyWord);
//根据keyWord获取用户信息
LambdaQueryWrapper<SysUser> queryUser = new LambdaQueryWrapper<SysUser>();
LambdaQueryWrapper<SysUser> queryUser = new LambdaQueryWrapper<>();
queryUser.eq(SysUser::getDelFlag,CommonConstant.DEL_FLAG_0);
queryUser.and(i -> i.like(SysUser::getUsername, keyWord).or().like(SysUser::getRealname, keyWord));
List<SysUser> sysUsers = this.sysUserService.list(queryUser);
@@ -24,6 +24,7 @@ import lombok.extern.slf4j.Slf4j;
import com.jero.modules.system.service.ISysPermissionDataRuleService;
import com.jero.modules.system.service.ISysPermissionService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@@ -61,16 +62,16 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
*/
@ApiOperation(value="部门权限表-分页列表查询", notes="部门权限表-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(SysDepartPermission sysDepartPermission,
public Result<IPage<SysDepartPermission>> queryPageList(SysDepartPermission sysDepartPermission,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<SysDepartPermission> queryWrapper = QueryGenerator.initQueryWrapper(sysDepartPermission, req.getParameterMap());
Page<SysDepartPermission> page = new Page<SysDepartPermission>(pageNo, pageSize);
Page<SysDepartPermission> page = new Page<>(pageNo, pageSize);
IPage<SysDepartPermission> pageList = sysDepartPermissionService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
@@ -79,11 +80,11 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
*/
@ApiOperation(value="部门权限表-添加", notes="部门权限表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody SysDepartPermission sysDepartPermission) {
public Result<T> add(@RequestBody SysDepartPermission sysDepartPermission) {
sysDepartPermissionService.save(sysDepartPermission);
return Result.OK("操作成功!");
}
/**
* 编辑
*
@@ -92,11 +93,11 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
*/
@ApiOperation(value="部门权限表-编辑", notes="部门权限表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody SysDepartPermission sysDepartPermission) {
public Result<T> edit(@RequestBody SysDepartPermission sysDepartPermission) {
sysDepartPermissionService.updateById(sysDepartPermission);
return Result.OK("操作成功!");
}
/**
* 通过id删除
*
@@ -105,11 +106,11 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
*/
@ApiOperation(value="部门权限表-通过id删除", notes="部门权限表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
public Result<T> delete(@RequestParam(name="id",required=true) String id) {
sysDepartPermissionService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
@@ -118,11 +119,11 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
*/
@ApiOperation(value="部门权限表-批量删除", notes="部门权限表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
public Result<T> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.sysDepartPermissionService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
@@ -131,7 +132,7 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
*/
@ApiOperation(value="部门权限表-通过id查询", notes="部门权限表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
public Result<SysDepartPermission> queryById(@RequestParam(name="id",required=true) String id) {
SysDepartPermission sysDepartPermission = sysDepartPermissionService.getById(id);
return Result.OK(sysDepartPermission);
}
@@ -154,8 +155,9 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
@PostMapping("/importExcel")
public Result<SysDepartPermission> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, SysDepartPermission.class);
}
@@ -163,9 +165,9 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
* 部门管理授权查询数据规则数据
*/
@GetMapping(value = "/datarule/{permissionId}/{departId}")
public Result<?> loadDatarule(@PathVariable("permissionId") String permissionId,@PathVariable("departId") String departId) {
public Result<Map<String, Object>> loadDatarule(@PathVariable("permissionId") String permissionId,@PathVariable("departId") String departId) {
List<SysPermissionDataRule> list = sysPermissionDataRuleService.getPermRuleListByPermId(permissionId);
if(list==null || list.size()==0) {
if(list==null || list.isEmpty()) {
return Result.error("未找到权限配置信息");
}else {
Map<String,Object> map = new HashMap<>();
@@ -192,13 +194,14 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
* @param request
* @return
*/
@RequestMapping(value = "/queryTreeListForDeptRole", method = RequestMethod.GET)
// @RequestMapping(value = "/queryTreeListForDeptRole", method = RequestMethod.GET)
@GetMapping("/queryTreeListForDeptRole")
public Result<Map<String,Object>> queryTreeListForDeptRole(@RequestParam(name="departId",required=true) String departId,HttpServletRequest request) {
Result<Map<String,Object>> result = new Result<>();
//全部权限ids
List<String> ids = new ArrayList<>();
try {
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<>();
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
query.orderByAsc(SysPermission::getSortNo);
query.inSql(SysPermission::getId,"select permission_id from sys_depart_permission where depart_id='"+departId+"'");
@@ -208,7 +211,7 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
}
List<TreeModel> treeList = new ArrayList<>();
getTreeModelList(treeList, list, null);
Map<String,Object> resMap = new HashMap<String,Object>();
Map<String,Object> resMap = new HashMap<>();
resMap.put("treeList", treeList); //全部树节点数据
resMap.put("ids", ids);//全部树ids
result.setResult(resMap);
@@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.system.base.controller.JeroController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
@@ -69,13 +71,18 @@ public class SysDictController {
@Autowired
public RedisTemplate<String, Object> redisTemplate;
@RequestMapping(value = "/page", method = RequestMethod.GET)
private String DICT_CODE_ERROE = "字典Code格式不正确!";
private String OPTION_SUCCESS = "操作成功!";
private String DEL_SUCCESS = "删除成功!";
// @RequestMapping(value = "/page", method = RequestMethod.GET)
@GetMapping("/page")
@ApiOperation(value = "字典控制器-分页列表查询", notes = "字典控制器-分页列表查询")
public Result<IPage<SysDict>> queryPageList(SysDict sysDict, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) {
Result<IPage<SysDict>> result = new Result<IPage<SysDict>>();
Result<IPage<SysDict>> result = new Result<>();
QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, req.getParameterMap());
Page<SysDict> page = new Page<SysDict>(pageNo, pageSize);
Page<SysDict> page = new Page<>(pageNo, pageSize);
IPage<SysDict> pageList = sysDictService.page(page, queryWrapper);
log.debug("查询当前页:"+pageList.getCurrent());
log.debug("查询当前页数量:"+pageList.getSize());
@@ -95,7 +102,8 @@ public class SysDictController {
* @return
*/
@ApiOperation(value = "字典控制器-树形字典数据", notes = "字典控制器-树形字典数据")
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
// @RequestMapping(value = "/treeList", method = RequestMethod.GET)
@GetMapping("/treeList")
public Result<List<SysDictTree>> treeList(SysDict sysDict, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) {
Result<List<SysDictTree>> result = new Result<>();
@@ -122,9 +130,10 @@ public class SysDictController {
* @return
*/
@ApiOperation(value = "字典控制器-获取全部字典数据", notes = "字典控制器-获取全部字典数据")
@RequestMapping(value = "/queryAllDictItems", method = RequestMethod.GET)
public Result<?> queryAllDictItems(HttpServletRequest request) {
Map<String, List<DictModel>> res = new HashMap<String, List<DictModel>>();
// @RequestMapping(value = "/queryAllDictItems", method = RequestMethod.GET)
@GetMapping("/queryAllDictItems")
public Result<Map<String, List<DictModel>>> queryAllDictItems(HttpServletRequest request) {
Map<String, List<DictModel>> res ;
res = sysDictService.queryAllDictItems();
return Result.OK(res);
}
@@ -135,10 +144,11 @@ public class SysDictController {
* @return
*/
@ApiOperation(value = "字典控制器-通过字典code和字典值key获取字典数据", notes = "字典控制器-通过字典code和字典值key获取字典数据")
@RequestMapping(value = "/getDictText/{dictCode}/{key}", method = RequestMethod.GET)
// @RequestMapping(value = "/getDictText/{dictCode}/{key}", method = RequestMethod.GET)
@GetMapping("/getDictText/{dictCode}/{key}")
public Result<String> getDictText(@PathVariable("dictCode") String dictCode, @PathVariable("key") String key) {
log.info(" dictCode : "+ dictCode);
Result<String> result = new Result<String>();
Result<String> result = new Result<>();
String text = null;
try {
text = sysDictService.queryDictTextByKey(dictCode, key);
@@ -157,14 +167,15 @@ public class SysDictController {
* @param dictCode 表名,文本字段,code字段 | 举例:sys_user,realname,id
* @return
*/
@RequestMapping(value = "/getDictItems/{dictCode}", method = RequestMethod.GET)
// @RequestMapping(value = "/getDictItems/{dictCode}", method = RequestMethod.GET)
@GetMapping("/getDictItems/{dictCode}")
public Result<List<DictModel>> getDictItems(@PathVariable String dictCode, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
log.info(" dictCode : "+ dictCode);
Result<List<DictModel>> result = new Result<List<DictModel>>();
Result<List<DictModel>> result = new Result<>();
try {
List<DictModel> ls = sysDictService.getDictItems(dictCode);
if (ls == null) {
return Result.error("字典Code格式不正确!");
return Result.error(DICT_CODE_ERROE);
}
result.setSuccess(true);
result.setResult(ls);
@@ -183,17 +194,18 @@ public class SysDictController {
* @param dictCode 字典code格式:table,text,code
* @return
*/
@RequestMapping(value = "/loadDict/{dictCode}", method = RequestMethod.GET)
// @RequestMapping(value = "/loadDict/{dictCode}", method = RequestMethod.GET)
@GetMapping("/loadDict/{dictCode}")
public Result<List<DictModel>> loadDict(@PathVariable String dictCode,
@RequestParam(name="keyword") String keyword,
@RequestParam(value = "sign",required = false) String sign,
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
log.info(" 加载字典表数据,加载关键字: "+ keyword);
Result<List<DictModel>> result = new Result<List<DictModel>>();
Result<List<DictModel>> result = new Result<>();
try {
List<DictModel> ls = sysDictService.loadDict(dictCode, keyword, pageSize);
if (ls == null) {
return Result.error("字典Code格式不正确!");
return Result.error(DICT_CODE_ERROE);
}
result.setSuccess(true);
result.setResult(ls);
@@ -213,7 +225,8 @@ public class SysDictController {
* @param pageSize
* @return
*/
@RequestMapping(value = "/loadDictOrderByValue/{dictCode}", method = RequestMethod.GET)
// @RequestMapping(value = "/loadDictOrderByValue/{dictCode}", method = RequestMethod.GET)
@GetMapping("/loadDictOrderByValue/{dictCode}")
public Result<List<DictModel>> loadDictOrderByValue(
@PathVariable String dictCode,
@RequestParam(name = "keyword") String keyword,
@@ -255,14 +268,15 @@ public class SysDictController {
* @param request
* @return
*/
@RequestMapping(value = "/loadDictItem/{dictCode}", method = RequestMethod.GET)
// @RequestMapping(value = "/loadDictItem/{dictCode}", method = RequestMethod.GET)
@GetMapping("/loadDictItem/{dictCode}")
public Result<List<String>> loadDictItem(@PathVariable String dictCode,@RequestParam(name="key") String keys, @RequestParam(value = "sign",required = false) String sign,@RequestParam(value = "delNotExist",required = false,defaultValue = "true") boolean delNotExist,HttpServletRequest request) {
Result<List<String>> result = new Result<>();
try {
if(dictCode.indexOf(",")!=-1) {
String[] params = dictCode.split(",");
if(params.length!=3) {
return Result.error("字典Code格式不正确!");
return Result.error(DICT_CODE_ERROE);
}
List<String> texts = sysDictService.queryTableDictByKeys(params[0], params[1], params[2], keys, delNotExist);
@@ -270,7 +284,7 @@ public class SysDictController {
result.setResult(texts);
log.info(result.toString());
}else {
return Result.error("字典Code格式不正确!");
return Result.error(DICT_CODE_ERROE);
}
} catch (Exception e) {
log.error(e.getMessage(),e);
@@ -285,14 +299,15 @@ public class SysDictController {
* 根据表名——显示字段-存储字段 pid 加载树形数据
*/
@ApiOperation(value = "字典控制器-根据表名—显示字段-存储字段 pid 加载树形数据", notes = "字典控制器-根据表名—显示字段-存储字段 pid 加载树形数据")
@RequestMapping(value = "/loadTreeData", method = RequestMethod.GET)
// @RequestMapping(value = "/loadTreeData", method = RequestMethod.GET)
@GetMapping("/loadTreeData")
public Result<List<TreeSelectModel>> loadTreeData(@RequestParam(name="pid") String pid, @RequestParam(name="pidField") String pidField,
@RequestParam(name="tableName") String tbname,
@RequestParam(name="text") String text,
@RequestParam(name="code") String code,
@RequestParam(name="hasChildField", required = false) String hasChildField,
@RequestParam(value = "sign", required = false) String sign, HttpServletRequest request) {
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
Result<List<TreeSelectModel>> result = new Result<>();
// SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件)
String dictCode = tbname +","+ text +","+ code;
@@ -307,13 +322,14 @@ public class SysDictController {
* 查询后返回树型数据
*/
@ApiOperation(value = "字典控制器-根据表名—显示字段-存储字段 加载树形数据", notes = "字典控制器-根据表名—显示字段-存储字段 加载树形数据")
@RequestMapping(value = "/queryAllTreeData", method = RequestMethod.GET)
// @RequestMapping(value = "/queryAllTreeData", method = RequestMethod.GET)
@GetMapping("/queryAllTreeData")
public Result<List<TreeSelectModel>> queryAllTreeData(@RequestParam(name="pidField") String pidField,
@RequestParam(name="tableName") String tbname,
@RequestParam(name="text") String text,
@RequestParam(name="code") String code,
HttpServletRequest request) {
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
Result<List<TreeSelectModel>> result = new Result<>();
// SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件)
String dictCode = tbname +","+ text +","+ code;
@@ -330,7 +346,8 @@ public class SysDictController {
* @return
*/
@ApiOperation(value = "字典控制器-新增字典", notes = "字典控制器-新增字典")
@RequestMapping(value = "/add", method = RequestMethod.POST)
// @RequestMapping(value = "/add", method = RequestMethod.POST)
@PostMapping("/add")
public Result<Object> add(@RequestBody SysDict sysDict) {
try {
sysDict.setCreateTime(new Date());
@@ -338,7 +355,7 @@ public class SysDictController {
sysDictService.save(sysDict);
//添加成功后需要刷新缓存
sysDictService.refreshCache();
return Result.OK("操作成功!");
return Result.OK(OPTION_SUCCESS);
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("操作失败");
@@ -351,7 +368,8 @@ public class SysDictController {
* @return
*/
@ApiOperation(value = "字典控制器-编辑字典", notes = "字典控制器-编辑字典")
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
// @RequestMapping(value = "/edit", method = RequestMethod.PUT)
@PutMapping("/edit")
public Result<Object> edit(@RequestBody SysDict sysDict) {
SysDict sysdict = sysDictService.getById(sysDict.getId());
if(sysdict==null) {
@@ -362,7 +380,7 @@ public class SysDictController {
if(ok) {
//编辑成功后需要刷新缓存
sysDictService.refreshCache();
return Result.OK("操作成功!");
return Result.OK(OPTION_SUCCESS);
}
}
return Result.OK();
@@ -379,7 +397,7 @@ public class SysDictController {
public Result<Object> delete(@RequestParam(name="id",required=true) String id) {
boolean ok = sysDictService.removeById(id);
if(ok) {
return Result.OK("删除成功!");
return Result.OK(DEL_SUCCESS);
}else{
return Result.error("删除失败!");
}
@@ -398,7 +416,7 @@ public class SysDictController {
return Result.error("参数不识别!");
}else {
sysDictService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("删除成功!");
return Result.OK(DEL_SUCCESS);
}
}
@@ -408,8 +426,8 @@ public class SysDictController {
* @return
*/
@RequestMapping(value = "/refleshCache")
public Result<?> refleshCache() {
Result<?> result = new Result<SysDict>();
public Result<SysDict> refleshCache() {
Result<SysDict> result = new Result<>();
sysDictService.refreshCache();
return result;
}
@@ -425,7 +443,7 @@ public class SysDictController {
QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, request.getParameterMap());
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<SysDictPage> pageList = new ArrayList<SysDictPage>();
List<SysDictPage> pageList = new ArrayList<>();
List<SysDict> sysDictList = sysDictService.list(queryWrapper);
for (SysDict dictMain : sysDictList) {
@@ -438,12 +456,12 @@ public class SysDictController {
}
// 导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "数据字典");
mv.addObject(JeroController.FILE_NAME, "数据字典");
// 注解对象Class
mv.addObject(NormalExcelConstants.CLASS, SysDictPage.class);
mv.addObject(JeroController.CLASS, SysDictPage.class);
// 自定义表格参数
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("数据字典列表", "导出人:"+user.getRealname(), "数据字典"));
mv.addObject(JeroController.PARAMS, new ExportParams("数据字典列表", "导出人:"+user.getRealname(), "数据字典"));
// 导出数据列表
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
@@ -451,7 +469,7 @@ public class SysDictController {
@PostMapping(value = "/importExcel")
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
public Result<T> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
@@ -469,7 +487,8 @@ public class SysDictController {
List<SysDictPage> list = ExcelImportUtil.importExcel(file.getInputStream(), SysDictPage.class, params);
// 错误信息
List<String> errorMessage = new ArrayList<>();
int successLines = 0, errorLines = 0;
int successLines = 0;
int errorLines = 0;
for (int i=0;i< list.size();i++) {
SysDict po = new SysDict();
BeanUtils.copyProperties(list.get(i), po);
@@ -521,10 +540,10 @@ public class SysDictController {
* @return
*/
@DeleteMapping(value = "/deletePhysic/{id}")
public Result<?> deletePhysic(@PathVariable String id) {
public Result<T> deletePhysic(@PathVariable String id) {
try {
sysDictService.deleteOneDictPhysically(id);
return Result.OK("删除成功!");
return Result.OK(DEL_SUCCESS);
} catch (Exception e) {
e.printStackTrace();
return Result.error("删除失败!");
@@ -537,10 +556,10 @@ public class SysDictController {
* @return
*/
@PutMapping(value = "/back/{id}")
public Result<?> back(@PathVariable String id) {
public Result<T> back(@PathVariable String id) {
try {
sysDictService.updateDictDelFlag(0,id);
return Result.OK("操作成功!");
return Result.OK(OPTION_SUCCESS);
} catch (Exception e) {
e.printStackTrace();
return Result.error("操作失败!");
+68 -68
View File
@@ -23,89 +23,89 @@
</template>
<script>
export default {
name: "ChartCard",
props: {
title: {
type: String,
default: ''
},
total: {
type: String,
default: ''
},
loading: {
type: Boolean,
default: false
}
export default {
name: 'ChartCard',
props: {
title: {
type: String,
default: ''
},
total: {
type: String,
default: ''
},
loading: {
type: Boolean,
default: false
}
}
}
</script>
<style lang="less" scoped>
.chart-card-header {
.chart-card-header {
position: relative;
overflow: hidden;
width: 100%;
.meta {
position: relative;
overflow: hidden;
width: 100%;
.meta {
position: relative;
overflow: hidden;
width: 100%;
color: rgba(0, 0, 0, .45);
font-size: 14px;
line-height: 22px;
}
color: rgba(0, 0, 0, .45);
font-size: 14px;
line-height: 22px;
}
}
.chart-card-action {
cursor: pointer;
position: absolute;
top: 0;
right: 0;
}
.chart-card-action {
cursor: pointer;
position: absolute;
top: 0;
right: 0;
}
.chart-card-footer {
border-top: 1px solid #e8e8e8;
padding-top: 9px;
margin-top: 8px;
.chart-card-footer {
border-top: 1px solid #e8e8e8;
padding-top: 9px;
margin-top: 8px;
> * {
position: relative;
}
.field {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0;
}
}
.chart-card-content {
margin-bottom: 12px;
> * {
position: relative;
height: 46px;
width: 100%;
.content-fix {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
}
}
.total {
.field {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
color: #000;
margin-top: 4px;
margin-bottom: 0;
font-size: 30px;
line-height: 38px;
height: 38px;
margin: 0;
}
</style>
}
.chart-card-content {
margin-bottom: 12px;
position: relative;
height: 46px;
width: 100%;
.content-fix {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
}
}
.total {
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
color: #000;
margin-top: 4px;
margin-bottom: 0;
font-size: 30px;
line-height: 38px;
height: 38px;
}
</style>
@@ -1,45 +1,49 @@
<template>
<div>
<template v-if="hasFile" v-for="(file, fileKey) of [innerFile || {}]">
<div :key="fileKey" style="position: relative;">
<a-tooltip v-if="file.status==='uploading'" :title="`上传中(${Math.floor(file.percent)}%)`">
<a-icon type="loading"/>
<span style="margin-left:5px">上传中</span>
</a-tooltip>
<template v-if="hasFile">
<a-tooltip v-else-if="file.status==='done'" :title="file.name">
<a-icon type="paper-clip"/>
<span style="margin-left:5px">{{ ellipsisFileName }}</span>
</a-tooltip>
<template v-for="(file, fileKey) of [innerFile || {}]">
<div :key="fileKey" style="position: relative;">
<a-tooltip v-if="file.status==='uploading'" :title="`上传中(${Math.floor(file.percent)}%)`">
<a-icon type="loading"/>
<span style="margin-left:5px">上传中</span>
</a-tooltip>
<a-tooltip v-else :title="file.message||'上传失败'">
<a-icon type="exclamation-circle" style="color:red;"/>
<span style="margin-left:5px">{{ ellipsisFileName }}</span>
</a-tooltip>
<a-tooltip v-else-if="file.status==='done'" :title="file.name">
<a-icon type="paper-clip"/>
<span style="margin-left:5px">{{ ellipsisFileName }}</span>
</a-tooltip>
<template style="width: 30px">
<a-dropdown :trigger="['click']" placement="bottomRight" style="margin-left: 10px;">
<a-tooltip title="操作">
<a-icon
v-if="file.status!=='uploading'"
type="setting"
style="cursor: pointer;"/>
</a-tooltip>
<a-tooltip v-else :title="file.message||'上传失败'">
<a-icon type="exclamation-circle" style="color:red;"/>
<span style="margin-left:5px">{{ ellipsisFileName }}</span>
</a-tooltip>
<template style="width: 30px">
<a-dropdown :trigger="['click']" placement="bottomRight" style="margin-left: 10px;">
<a-tooltip title="操作">
<a-icon
v-if="file.status!=='uploading'"
type="setting"
style="cursor: pointer;"/>
</a-tooltip>
<a-menu slot="overlay">
<a-menu-item v-if="originColumn.allowDownload !== false" @click="handleClickDownloadFile">
<span><a-icon type="download"/>&nbsp;下载</span>
</a-menu-item>
<a-menu-item v-if="originColumn.allowRemove !== false" @click="handleClickDeleteFile">
<span><a-icon type="delete"/>&nbsp;删除</span>
</a-menu-item>
<a-menu-item @click="handleMoreOperation(originColumn)">
<span><a-icon type="bars"/> 更多</span>
</a-menu-item>
</a-menu>
</a-dropdown>
</template>
</div>
</template>
<a-menu slot="overlay">
<a-menu-item v-if="originColumn.allowDownload !== false" @click="handleClickDownloadFile">
<span><a-icon type="download"/>&nbsp;下载</span>
</a-menu-item>
<a-menu-item v-if="originColumn.allowRemove !== false" @click="handleClickDeleteFile">
<span><a-icon type="delete"/>&nbsp;删除</span>
</a-menu-item>
<a-menu-item @click="handleMoreOperation(originColumn)">
<span><a-icon type="bars"/> 更多</span>
</a-menu-item>
</a-menu>
</a-dropdown>
</template>
</div>
</template>
<a-upload
@@ -166,7 +170,7 @@ export default {
},
handleChangeUpload (info) {
const { originColumn: col } = this
// const { originColumn: col } = this
const { file } = info
const value = {
name: file.name,
@@ -1,44 +1,47 @@
<template>
<div>
<template v-if="hasFile" v-for="(file, fileKey) of [innerFile || {}]">
<div :key="fileKey" style="position: relative;">
<template v-if="!file || !(file['url'] || file['path'] || file['message'])">
<a-tooltip :title="'请稍后: ' + JSON.stringify (file) + ((file['url'] || file['path'] || file['message']))">
<a-icon type="loading"/>
</a-tooltip>
</template>
<template v-else-if="file['path']">
<img class="j-editable-image" :src="imgSrc" alt="无图片" @click="handleMoreOperation"/>
</template>
<a-tooltip v-else :title="file.message||'上传失败'" @click="handleClickShowImageError">
<a-icon type="exclamation-circle" style="color:red;"/>
</a-tooltip>
<template style="width: 30px">
<a-dropdown :trigger="['click']" placement="bottomRight" style="margin-left: 10px;">
<a-tooltip title="操作">
<a-icon
v-if="file.status!=='uploading'"
type="setting"
style="cursor: pointer;"/>
<template v-if="hasFile">
<template v-for="(file, fileKey) of [innerFile || {}]">
<div :key="fileKey" style="position: relative;">
<template v-if="!file || !(file['url'] || file['path'] || file['message'])">
<a-tooltip :title="'请稍后: ' + JSON.stringify (file) + ((file['url'] || file['path'] || file['message']))">
<a-icon type="loading"/>
</a-tooltip>
</template>
<template v-else-if="file['path']">
<img class="j-editable-image" :src="imgSrc" alt="无图片" @click="handleMoreOperation"/>
</template>
<a-tooltip v-else :title="file.message||'上传失败'" @click="handleClickShowImageError">
<a-icon type="exclamation-circle" style="color:red;"/>
</a-tooltip>
<a-menu slot="overlay">
<a-menu-item v-if="originColumn.allowDownload !== false" @click="handleClickDownloadFile">
<span><a-icon type="download"/>&nbsp;下载</span>
</a-menu-item>
<a-menu-item v-if="originColumn.allowRemove !== false" @click="handleClickDeleteFile">
<span><a-icon type="delete"/>&nbsp;删除</span>
</a-menu-item>
<a-menu-item @click="handleMoreOperation(originColumn)">
<span><a-icon type="bars"/> 更多</span>
</a-menu-item>
</a-menu>
</a-dropdown>
</template>
<template style="width: 30px">
<a-dropdown :trigger="['click']" placement="bottomRight" style="margin-left: 10px;">
<a-tooltip title="操作">
<a-icon
v-if="file.status!=='uploading'"
type="setting"
style="cursor: pointer;"/>
</a-tooltip>
</div>
<a-menu slot="overlay">
<a-menu-item v-if="originColumn.allowDownload !== false" @click="handleClickDownloadFile">
<span><a-icon type="download"/>&nbsp;下载</span>
</a-menu-item>
<a-menu-item v-if="originColumn.allowRemove !== false" @click="handleClickDeleteFile">
<span><a-icon type="delete"/>&nbsp;删除</span>
</a-menu-item>
<a-menu-item @click="handleMoreOperation(originColumn)">
<span><a-icon type="bars"/> 更多</span>
</a-menu-item>
</a-menu>
</a-dropdown>
</template>
</div>
</template>
</template>
<a-upload
v-show="!hasFile"
name="file"
@@ -172,7 +175,7 @@ export default {
},
handleChangeUpload (info) {
const { originColumn: col } = this
// const { originColumn: col } = this
const { file } = info
const value = {
name: file.name,
@@ -1,7 +1,7 @@
import { getVmParentByName } from '@/utils/util'
import { JVXETypes } from '@comp/jero/JVxeTable'
export const VALIDATE_FAILED = Symbol()
export const VALIDATE_FAILED = Symbol('')
/**
* 获取指定的 $refs 对象
@@ -69,6 +69,7 @@ import { cloneDeep } from 'lodash'
export default {
name: 'JSelectBizComponentModal',
mixins: [JeroListMixin],
// eslint-disable-next-line vue/no-unused-components
components: { Ellipsis, JSelectBizQueryItem },
props: {
value: {
@@ -284,7 +285,7 @@ export default {
}
if (!notExist) return
getAction(this.valueUrl || this.listUrl, {
// 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
// 这里最后加一个 , 的原因是无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
[this.valueKey]: value.join(',') + ',',
pageNo: 1,
pageSize: value.length
@@ -308,7 +309,10 @@ export default {
const key = data[this.valueKey]
this.dataSourceMap[key] = data
pushIfNotExist(this.options, { label: data[this.displayKey || this.valueKey], value: key }, 'value')
typeof callback === 'function' ? callback(data) : ''
// typeof callback === 'function' ? callback(data) : ''
if (typeof callback === 'function') {
callback(data)
}
})
this.$emit('options', this.options, this.dataSourceMap)
},
@@ -320,7 +324,7 @@ export default {
this.close()
},
/** 删除已选择的 */
handleDeleteSelected (record, index) {
handleDeleteSelected (record/* , index */) {
this.selectedRowKeys.splice(this.selectedRowKeys.indexOf(record[this.rowKey]), 1)
// update--begin--autor:wangshuai-----date:20200722------forJSelectBizComponent组件切换页数值问题------
this.selectedTable.dataSource.splice(this.selectedTable.dataSource.indexOf(record), 1)
@@ -16,6 +16,7 @@ import JSelectBizComponent from './JSelectBizComponent'
export default {
name: 'JSelectMultiUser',
// eslint-disable-next-line vue/no-unused-components
components: { JDate, JSelectBizComponent },
props: {
value: null, // any type
@@ -13,7 +13,7 @@
<a-spin tip="Loading..." :spinning="false">
<a-input-search style="margin-bottom: 1px" placeholder="请输入部门名称按回车进行搜索" @search="onSearch" />
<a-tree
checkable
:checkable="true"
:class="treeScreenClass"
:treeData="treeData"
:checkStrictly="checkStrictly"
@@ -117,7 +117,7 @@ export default {
initDepartComponent (flag) {
const arr = []
// 该方法两个地方用 1.visible改变事件重新设置选中项 2.组件编辑页面回显
const fieldName = flag == true ? 'key' : this.text
const fieldName = flag === true ? 'key' : this.text
if (this.departId) {
const arr2 = this.departId.split(',')
for (const item of this.dataList) {
@@ -126,7 +126,7 @@ export default {
}
}
}
if (flag == true) {
if (flag === true) {
this.checkedKeys = [...arr]
} else {
this.$emit('initComp', arr.join(','))
@@ -196,7 +196,7 @@ export default {
this.autoExpandParent = false
},
handleSubmit () {
if (!this.checkedKeys || this.checkedKeys.length == 0) {
if (!this.checkedKeys || this.checkedKeys.length === 0) {
this.$emit('ok', '')
} else {
const checkRow = this.getCheckedRows(this.checkedKeys)
@@ -267,9 +267,9 @@ export default {
return rows
},
switchCheckStrictly (v) {
if (v == 1) {
if (v === 1) {
this.checkStrictly = false
} else if (v == 2) {
} else if (v === 2) {
this.checkStrictly = true
}
},
@@ -63,7 +63,7 @@
<script>
import { filterObj } from '@/utils/util'
import { queryDepartTreeList, getUserList, queryUserByDepId, queryDepartTreeSync } from '@/api/api'
import { getUserList, queryUserByDepId, queryDepartTreeSync } from '@/api/api'
import { getAction } from '@/api/manage'
export default {
@@ -135,7 +135,7 @@ export default {
computed: {
// 计算属性的 getter
getType: function () {
return this.multi == true ? 'checkbox' : 'radio'
return this.multi === true ? 'checkbox' : 'radio'
}
},
watch: {
@@ -154,7 +154,7 @@ export default {
methods: {
initUserNames () {
if (this.userIds) {
// 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
// 这里最后加一个 , 的原因是无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
const values = this.userIds.split(',') + ','
const param = { [this.store]: values }
getAction('/sys/user/getMultiUser', param).then((list) => {
@@ -258,7 +258,7 @@ export default {
that.close()
},
// 获取选择用户信息
getSelectUserRows (rowId) {
getSelectUserRows (/* rowId */) {
const dataSource = this.dataSource
let userIds = ''
this.selectUserRows = []
@@ -316,7 +316,7 @@ export default {
queryDepartTreeSync({ pid: treeNode.dataRef.id }).then((res) => {
if (res.success) {
// 判断chidlren是否为空,并修改isLeaf属性值
if (res.result.length == 0) {
if (res.result.length === 0) {
treeNode.dataRef.isLeaf = true
} else {
treeNode.dataRef.children = res.result
@@ -97,7 +97,7 @@ export default {
} else {
selectedRowKeys = []
}
return new Promise((resolve, reject) => {
return new Promise((resolve/* , reject */) => {
const model = this.$confirm({
title: '同步',
content,
@@ -202,7 +202,7 @@ export async function loadEnabledTypes () {
enabledTypes = cloneObject(result)
return result
} else {
console.warn('getEnabledType查询失败', res)
console.warn('getEnabledType查询失败', result)
}
}
return {}
@@ -5,8 +5,8 @@
</template>
<script>
import PageLayout from '../page/PageLayout'
import RouteView from './RouteView'
// import PageLayout from '../page/PageLayout'
// import RouteView from './RouteView'
export default {
name: 'IframePageContent',
@@ -23,15 +23,14 @@ export default {
this.goUrl()
},
watch: {
$route (to, from) {
$route (/* to, from */) {
this.goUrl()
}
},
methods: {
goUrl () {
const url = this.$route.meta.url
const id = this.$route.path
this.id = id
this.id = this.$route.path
// url = "http://www.baidu.com"
console.log('------url------' + url)
if (url !== null && url !== undefined) {
@@ -7,8 +7,8 @@
<script>
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import PageLayout from '../page/PageLayout'
import RouteView from './RouteView'
// import PageLayout from '../page/PageLayout'
// import RouteView from './RouteView'
export default {
name: 'IframePageContent',
@@ -26,22 +26,22 @@ export default {
this.goUrl()
},
watch: {
$route (to, from) {
$route (/* to, from */) {
this.goUrl()
}
},
methods: {
goUrl () {
const url = this.$route.meta.url
const id = this.$route.path
this.id = id
this.id = this.$route.path
// url = "http://www.baidu.com"
console.log('------url------' + url)
if (url !== null && url !== undefined) {
// -----------------------------------------------------------------------------------------
// url支持通过 ${token}方式传递当前登录TOKEN
// eslint-disable-next-line no-template-curly-in-string
const tokenStr = '${token}'
if (url.indexOf(tokenStr) != -1) {
if (url.indexOf(tokenStr) !== -1) {
const token = Vue.ls.get(ACCESS_TOKEN)
this.url = url.replace(tokenStr, token)
} else {
@@ -50,7 +50,7 @@ export default {
// -----------------------------------------------------------------------------------------
/* update_begin author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
if (this.$route.meta.internalOrExternal != undefined && this.$route.meta.internalOrExternal == true) {
if (this.$route.meta.internalOrExternal !== undefined && this.$route.meta.internalOrExternal === true) {
this.closeCurrent()
window.open(this.url)
}
+2 -2
View File
@@ -1,7 +1,7 @@
<template>
<page-layout :desc="description" :title="getTitle" :link-list="linkList" :search="search" :tabs="tabs">
<div slot="extra" class="extra-img">
<img :src="extraImage"/>
<img :src="extraImage" alt=""/>
</div>
<!-- keep-alive -->
<route-view ref="content"></route-view>
@@ -52,7 +52,7 @@ export default {
this.description = content.description
this.linkList = content.linkList
this.extraImage = content.extraImage
this.search = content.search == true
this.search = content.search === true
this.tabs = content.tabs
}
}
@@ -98,7 +98,7 @@ export default {
this.linkList = [newRoute.fullPath]
this.pageList = [Object.assign({}, newRoute)]
// update-begin-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
} else if (indexKey == newRoute.fullPath) {
} else if (indexKey === newRoute.fullPath) {
// 首页时 判断是否缓存 没有缓存 刷新之
if (newRoute.meta.keepAlive === false) {
this.routeReload()
@@ -171,7 +171,7 @@ export default {
return
}
console.log('this.pageList ', this.pageList)
const removeRoute = this.pageList.filter(item => item.fullPath == key)
const removeRoute = this.pageList.filter(item => (item.fullPath + '') === (key + ''))
this.pageList = this.pageList.filter(item => item.fullPath !== key)
let index = this.linkList.indexOf(key)
this.linkList = this.linkList.filter(item => item !== key)
@@ -234,7 +234,7 @@ export default {
/* update_end author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
closeOthers (pageKey) {
const index = this.linkList.indexOf(pageKey)
if (pageKey == indexKey || pageKey.indexOf('?ticke=') >= 0) {
if ((pageKey + '') === (indexKey + '') || pageKey.indexOf('?ticke=') >= 0) {
this.linkList = this.linkList.slice(index, index + 1)
this.pageList = this.pageList.slice(index, index + 1)
this.activePage = this.linkList[0]
@@ -245,10 +245,10 @@ export default {
}
},
closeLeft (pageKey) {
if (pageKey == indexKey) {
if ((pageKey + '') === (indexKey + '')) {
return
}
const tempList = [...this.pageList]
// const tempList = [...this.pageList]
const index = this.linkList.indexOf(pageKey)
this.linkList = this.linkList.slice(index)
this.pageList = this.pageList.slice(index)
+10 -10
View File
@@ -53,27 +53,27 @@ export default {
}
// 判断当前设备
function isMobile () {
var userAgentInfo = navigator.userAgent
const userAgentInfo = navigator.userAgent
var mobileAgents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']
const mobileAgents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']
var mobile_flag = false
let mobileFlag = false
// 根据userAgent判断是否是手机
for (var v = 0; v < mobileAgents.length; v++) {
for (let v = 0; v < mobileAgents.length; v++) {
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
mobile_flag = true
mobileFlag = true
break
}
}
var screen_width = window.screen.width
var screen_height = window.screen.height
const screenWidth = window.screen.width
const screenHeight = window.screen.height
// 根据屏幕分辨率判断是否是手机
if (screen_width < 500 && screen_height < 800) {
mobile_flag = true
if (screenWidth < 500 && screenHeight < 800) {
mobileFlag = true
}
return mobile_flag
return mobileFlag
}
</script>
<style lang="less" >
+3 -3
View File
@@ -58,9 +58,9 @@ import {
Slider,
Transfer,
Rate,
Collapse,
Collapse
} from 'ant-design-vue'
import Viser from 'viser-vue'
// import Viser from 'viser-vue'
Vue.use(ConfigProvider)
Vue.use(Layout)
@@ -123,4 +123,4 @@ Vue.prototype.$success = Modal.success
Vue.prototype.$error = Modal.error
Vue.prototype.$warning = Modal.warning
process.env.NODE_ENV !== 'production' && console.warn('[jero-boot-vue] NOTICE: Antd use lazy-load.')
process.env.NODE_ENV !== 'production' && console.warn('[jero-boot-vue] NOTICE: Antd use lazy-load.')
@@ -56,7 +56,7 @@
}
.jeecg-mask-cust[data-v-7750c39d] {
height: 0%;
height: 0;
width: 100%;
opacity: .3;
position: absolute;
@@ -367,7 +367,7 @@ th[data-v-125d8be6] {
}
.jeecg-mask-cust[data-v-4070e3c9] {
height: 0%;
height: 0;
width: 100%;
opacity: .3;
position: absolute;
@@ -466,18 +466,29 @@ th[data-v-125d8be6] {
border-radius: 4px 0 0 4px
}
.j-table-force-nowrap {
td, th {
white-space: nowrap
}
/*.j-table-force-nowrap {*/
/* td, th {*/
/* white-space: nowrap*/
/* }*/
.ant-table-selection-column {
padding: 12px 22px !important
}
/* .ant-table-selection-column {*/
/* padding: 12px 22px !important*/
/* }*/
&.ant-table-wrapper .ant-table-content {
overflow-x: auto
}
/* &.ant-table-wrapper .ant-table-content {*/
/* overflow-x: auto*/
/* }*/
/*}*/
.j-table-force-nowrap td,
.j-table-force-nowrap th {
white-space: nowrap;
}
.j-table-force-nowrap .ant-table-selection-column {
padding: 12px 22px !important;
}
.j-table-force-nowrap.ant-table-wrapper .ant-table-content {
overflow-x: auto;
}
.ant-card-body .table-operator[data-v-67102101] {
@@ -664,7 +675,7 @@ th[data-v-125d8be6] {
}
.jeecg-mask-cust[data-v-22098770] {
height: 0%;
height: 0;
width: 100%;
opacity: .3;
position: absolute;
+10 -10
View File
@@ -1,5 +1,6 @@
import T from 'ant-design-vue/es/table/Table'
import get from 'lodash.get'
export default {
data () {
return {
@@ -84,12 +85,10 @@ export default {
},
loadData (pagination, filters, sorter) {
this.localLoading = true
var result = this.data(
const result = this.data(
Object.assign({
pageNo: (pagination && pagination.current) ||
this.localPagination.current,
pageSize: (pagination && pagination.pageSize) ||
this.localPagination.pageSize
pageNo: (pagination && pagination.current) || this.localPagination.current,
pageSize: (pagination && pagination.pageSize) || this.localPagination.pageSize
},
(sorter && sorter.field && {
sortField: sorter.field
@@ -98,8 +97,7 @@ export default {
sortOrder: sorter.order
}) || {}, {
...filters
}
)
})
)
if (result instanceof Promise) {
@@ -112,7 +110,7 @@ export default {
this.localPagination.pageSize
});
// update--begin--autor:wangshuai-----date:20200724------for:判断showPagination是否为false------
(!this.showPagination || !r.totalCount && this.showPagination === 'auto') && (this.localPagination = false)
((!this.showPagination || !r.totalCount) && this.showPagination === 'auto') && (this.localPagination = false)
// update--end--autor:wangshuai-----date:20200724------for:判断showPagination是否为false-----
this.localDataSource = r.data // 返回结果中的数组数据
this.localLoading = false
@@ -217,9 +215,11 @@ export default {
Object.keys(T.props).forEach(k => {
const localKey = `local${k.substring(0, 1).toUpperCase()}${k.substring(1)}`
if (localKeys.includes(localKey)) {
return props[k] = _vm[localKey]
const tempItem = props[k] = _vm[localKey]
return tempItem
}
return props[k] = _vm[k]
const tempItemA = props[k] = _vm[k]
return tempItemA
})
// 显示信息提示
+1 -1
View File
@@ -1,7 +1,7 @@
<template>
<a-breadcrumb class="breadcrumb">
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
<router-link v-if="item.name != name" :to="{ path: item.path }">
<router-link v-if="item.name + '' !== name + ''" :to="{ path: item.path }">
{{ item.meta.title }}
</router-link>
<span v-else>{{ item.meta.title }}</span>
@@ -20,9 +20,9 @@
<template slot="title">
<span>您隶属于多部门请选择当前所在部门</span>
</template>
<a-avatar style="backgroundColor:#87d068" icon="gold" />
<a-avatar style="background-color:#87d068" icon="gold" />
</a-tooltip>
<a-select v-model="departSelected" :class="{'valid-error':validate_status=='error'}" placeholder="请选择登录部门" style="margin-left:10px;width: 80%">
<a-select v-model="departSelected" :class="{'valid-error':validate_status + '' === 'error' + ''}" placeholder="请选择登录部门" style="margin-left:10px;width: 80%">
<a-icon slot="suffixIcon" type="gold" />
<a-select-option
v-for="d in departList"
@@ -94,7 +94,7 @@ export default {
const orgCode = res.result.orgCode
if (departs && departs.length > 0) {
for (const i of departs) {
if (i.orgCode == orgCode) {
if (i.orgCode + '' === orgCode + '') {
this.currDepartName = i.departName
break
}
+1 -3
View File
@@ -44,9 +44,7 @@ const responsive = {
export default {
name: 'DetailList',
Item: Item,
components: {
Col
},
components: { Col },
props: {
title: {
type: String,
+15 -15
View File
@@ -32,7 +32,7 @@
<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>
<p style="color: rgba(0,0,0,.45);margin-bottom: 0">{{ record.createTime }} 发布</p>
</div>
<div style="text-align: right">
<a-tag @click="showAnnouncement(record)" v-if="record.priority === 'L'" color="blue">一般消息</a-tag>
@@ -50,7 +50,7 @@
<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>
<p style="color: rgba(0,0,0,.45);margin-bottom: 0">{{ record.createTime }} 发布</p>
</div>
<div style="text-align: right">
<a-tag @click="showAnnouncement(record)" v-if="record.priority === 'L'" color="blue">一般消息</a-tag>
@@ -130,7 +130,7 @@ export default {
this.stopTimer = false
const myTimer = setInterval(() => {
// 停止定时器
if (this.stopTimer == true) {
if (this.stopTimer === true) {
clearInterval(myTimer)
return
}
@@ -197,8 +197,8 @@ export default {
initWebSocket: function () {
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
var userId = store.getters.userInfo.id
var url = window._CONFIG.domianWebSocketURL.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId
const userId = store.getters.userInfo.id
const 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
@@ -211,17 +211,17 @@ export default {
// 心跳检测重置
// this.heartCheck.reset().start();
},
websocketOnerror: function (e) {
websocketOnerror: function () {
console.log('WebSocket连接发生错误')
this.reconnect()
},
websocketOnmessage: function (e) {
console.log('-----接收消息-------', e.data)
var data = eval('(' + e.data + ')') // 解析对象
if (data.cmd == 'topic') {
const data = eval('(' + e.data + ')') // 解析对象
if (data.cmd + '' === 'topic') {
// 系统通知
this.loadData()
} else if (data.cmd == 'user') {
} else if (data.cmd + '' === 'user') {
// 用户消息
this.loadData()
}
@@ -244,7 +244,7 @@ export default {
},
openNotification (data) {
var text = data.msgTxt
const text = data.msgTxt
const key = `open${Date.now()}`
this.$notification.open({
message: '消息提醒',
@@ -266,7 +266,7 @@ export default {
},
reconnect () {
var that = this
const that = this
if (that.lockReconnect) return
that.lockReconnect = true
// 没连接上会一直重连,设置延迟避免请求过多
@@ -277,7 +277,7 @@ export default {
}, 5000)
},
heartCheckFun () {
var that = this
const that = this
// 心跳检测,每20s心跳一次
that.heartCheck = {
timeout: 20000,
@@ -289,7 +289,7 @@ export default {
return this
},
start: function () {
var self = this
// const self = this
this.timeoutObj = setTimeout(function () {
// 这里发送一个心跳,后端收到后,返回一个心跳消息,
// onmessage拿到返回的心跳就说明连接正常
@@ -305,10 +305,10 @@ export default {
showDetail (key, data) {
this.$notification.close(key)
var id = data.msgId
const id = data.msgId
getAction(this.url.queryById, { id: id }).then((res) => {
if (res.success) {
var record = res.result
const record = res.result
this.showAnnouncement(record)
}
})
+1 -1
View File
@@ -135,7 +135,7 @@ export default {
},
mounted () {
// 如果是单点登录模式
if (process.env.VUE_APP_SSO == 'true') {
if (process.env.VUE_APP_SSO + '' === 'true') {
const depart = this.userInfo().orgCode
if (!depart) {
this.updateCurrentDepart()
@@ -136,6 +136,7 @@ export default {
compareToFirstPassword (rule, value, callback) {
const form = this.form
if (value && value !== form.getFieldValue('password')) {
// eslint-disable-next-line standard/no-callback-literal
callback('两次输入的密码不一样')
} else {
callback()
+1 -1
View File
@@ -1,4 +1,4 @@
import { UserLayout, TabLayout, RouteView, BlankLayout, PageView } from '@/components/layouts'
import { UserLayout, TabLayout, BlankLayout } from '@/components/layouts'
/**
* 走菜单,走权限控制
+6 -3
View File
@@ -20,7 +20,8 @@ export const JEditableTableMixin = {
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 }
}
},
addDefaultRowNum: null // 这个变量应该是一个数字,但是为了保留原本代码中的提示逻辑,定义为null
}
},
methods: {
@@ -72,7 +73,7 @@ export const JEditableTableMixin = {
},
/** 当点击了编辑(修改)按钮时调用此方法 */
edit (record) {
if (record && JSON.stringify(record) != '{}') {
if (record && JSON.stringify(record) !== '{}') {
this.tableReset()
}
if (typeof this.editBefore === 'function') this.editBefore(record)
@@ -107,7 +108,9 @@ export const JEditableTableMixin = {
}
}
tab.dataSource = dataSource
typeof success === 'function' ? success(res) : ''
if (typeof success === 'function') {
success(res)
}
}).finally(() => {
tab.loading = false
})
@@ -19,7 +19,9 @@ export const JEditableTableModelMixin = {
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 }
}
},
addDefaultRowNum: null, // 这个变量应该是一个数字,但是为了保留原本代码中的提示逻辑,定义为null
refKeys: null
}
},
methods: {
@@ -70,7 +72,7 @@ export const JEditableTableModelMixin = {
},
/** 当点击了编辑(修改)按钮时调用此方法 */
edit (record) {
if (record && JSON.stringify(record) != '{}' && record.id) {
if (record && JSON.stringify(record) !== '{}' && record.id) {
this.tableReset()
}
if (typeof this.editBefore === 'function') this.editBefore(record)
@@ -105,7 +107,9 @@ export const JEditableTableModelMixin = {
}
}
tab.dataSource = dataSource
typeof success === 'function' ? success(res) : ''
if (typeof success === 'function') {
success(res)
}
}).finally(() => {
tab.loading = false
})
+11 -4
View File
@@ -1,6 +1,8 @@
import { VALIDATE_FAILED, getRefPromise, validateFormAndTables } from '@/components/jero/JVxeTable/utils/vxeUtils.js'
import { getRefPromise, validateFormAndTables } from '@/components/jero/JVxeTable/utils/vxeUtils.js'
import { httpAction, getAction } from '@/api/manage'
const VALIDATE_NO_PASSED = ''
export const JVxeTableMixin = {
data () {
return {
@@ -17,7 +19,9 @@ export const JVxeTableMixin = {
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 }
}
},
refKeys: null,
addDefaultRowNum: null // 这个变量应该是一个数字,但是为了保留原本代码中的提示逻辑,定义为null
}
},
methods: {
@@ -92,14 +96,17 @@ export const JVxeTableMixin = {
}
}
tab.dataSource = dataSource
typeof success === 'function' ? success(res) : ''
if (typeof success === 'function') {
success(res)
}
}).finally(() => {
tab.loading = false
})
},
/** 发起请求,自动判断是执行新增还是修改操作 */
request (formData) {
let url = this.url.add; let method = 'post'
let url = this.url.add
let method = 'post'
if (this.model.id) {
url = this.url.edit
method = 'put'
+7 -3
View File
@@ -1,4 +1,4 @@
import { VALIDATE_FAILED, getRefPromise, validateFormAndTables, validateFormModelAndTables } from '@/components/jero/JVxeTable/utils/vxeUtils.js'
import { VALIDATE_FAILED, getRefPromise, validateFormModelAndTables } from '@/components/jero/JVxeTable/utils/vxeUtils.js'
import { httpAction, getAction } from '@/api/manage'
export const JVxeTableModelMixin = {
@@ -16,7 +16,9 @@ export const JVxeTableModelMixin = {
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 }
}
},
refKeys: null,
addDefaultRowNum: null // 这个变量应该是一个数字,但是为了保留原本代码中的提示逻辑,定义为null
}
},
methods: {
@@ -94,7 +96,9 @@ export const JVxeTableModelMixin = {
}
}
tab.dataSource = dataSource
typeof success === 'function' ? success(res) : ''
if (typeof success === 'function') {
success(res)
}
}).finally(() => {
tab.loading = false
})
+10 -11
View File
@@ -4,7 +4,7 @@
* data中url定义 list为查询列表 delete为删除单条记录 deleteBatch为批量删除
*/
import { filterObj } from '@/utils/util'
import { deleteAction, getAction, downFile, getFileAccessHttpUrl } from '@/api/manage'
import { deleteAction, downFile, getAction, getFileAccessHttpUrl } from '@/api/manage'
import Vue from 'vue'
import { ACCESS_TOKEN, TENANT_ID } from '@/store/mutation-types'
import store from '@/store'
@@ -79,7 +79,7 @@ export const JeroListMixin = {
if (arg === 1) {
this.ipagination.current = 1
}
var params = this.getQueryParams()// 查询条件
const params = this.getQueryParams()// 查询条件
this.loading = true
getAction(this.url.list, params).then((res) => {
if (res.success) {
@@ -120,7 +120,7 @@ export const JeroListMixin = {
sqp.superQueryParams = encodeURI(this.superQueryParams)
sqp.superQueryMatchType = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters)
const param = Object.assign(sqp, this.queryParam, this.isorter, this.filters)
param.field = this.getQueryField()
param.pageNo = this.ipagination.current
param.pageSize = this.ipagination.pageSize
@@ -128,7 +128,7 @@ export const JeroListMixin = {
},
getQueryField () {
// TODO 字段权限控制
var str = 'id,'
let str = 'id,'
this.columns.forEach(function (value) {
str += ',' + value.dataIndex
})
@@ -164,11 +164,11 @@ export const JeroListMixin = {
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录')
} else {
var ids = ''
for (var a = 0; a < this.selectedRowKeys.length; a++) {
let ids = ''
for (let a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ','
}
var that = this
const that = this
this.$confirm({
title: '确认删除',
content: '是否删除选中数据?',
@@ -196,7 +196,7 @@ export const JeroListMixin = {
this.$message.error('请设置url.delete属性!')
return
}
var that = this
const that = this
deleteAction(that.url.delete, { id: id }).then((res) => {
if (res.success) {
// 重新计算分页问题
@@ -233,7 +233,7 @@ export const JeroListMixin = {
// 分页、排序、筛选变化时触发
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field
this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc'
}
this.ipagination = pagination
this.loadData()
@@ -259,8 +259,7 @@ export const JeroListMixin = {
/* 导出 */
handleExportXls2 () {
const paramsStr = encodeURI(JSON.stringify(this.getQueryParams()))
const url = `${window._CONFIG.domianURL}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`
window.location.href = url
window.location.href = `${window._CONFIG.domianURL}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`
},
handleExportXls (fileName) {
if (!fileName || typeof fileName !== 'string') {
-1
View File
@@ -1,6 +1,5 @@
import { formatDate } from '@/utils/util'
import Area from '@/components/_util/Area'
import { postAction } from '@/api/manage'
const onlUtil = {
data () {
+5 -5
View File
@@ -15,14 +15,14 @@ export const WebsocketMixin = {
const token = Vue.ls.get(ACCESS_TOKEN)
console.log('------------WebSocket连接成功')
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
var userId = store.getters.userInfo.id
const userId = store.getters.userInfo.id
if (!this.socketUrl.startsWith('/')) {
this.socketUrl = '/' + this.socketUrl
}
if (!this.socketUrl.endsWith('/')) {
this.socketUrl = this.socketUrl + '/'
}
var url = window._CONFIG.domianURL.replace('https://', 'wss://').replace('http://', 'ws://') + this.socketUrl + userId + '/' + token
const url = window._CONFIG.domianURL.replace('https://', 'wss://').replace('http://', 'ws://') + this.socketUrl + userId + '/' + token
this.websock = new WebSocket(url)
this.websock.onopen = this.websocketOnopen
this.websock.onerror = this.websocketOnerror
@@ -32,11 +32,11 @@ export const WebsocketMixin = {
websocketOnopen: function () {
console.log('WebSocket连接成功')
},
websocketOnerror: function (e) {
websocketOnerror: function () {
console.log('WebSocket连接发生错误')
this.reconnect()
},
websocketOnclose: function (e) {
websocketOnclose: function () {
this.reconnect()
},
websocketSend (text) {
@@ -48,7 +48,7 @@ export const WebsocketMixin = {
}
},
reconnect () {
var that = this
const that = this
if (that.lockReconnect) return
that.lockReconnect = true
// 没连接上会一直重连,设置延迟避免请求过多
-2
View File
@@ -1,6 +1,4 @@
import Vue from 'vue'
import { ONL_AUTH_FIELDS } from '@/store/mutation-types'
import { getAction } from '@/api/manage'
const online = {
state: {
+2 -4
View File
@@ -38,7 +38,7 @@ function hasRole(roles, route) {
}
function filterAsyncRouter (routerMap, roles) {
const accessedRouters = routerMap.filter(route => {
return routerMap.filter(route => {
if (hasPermission(roles.permissionList, route)) {
if (route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, roles)
@@ -47,7 +47,6 @@ function filterAsyncRouter (routerMap, roles) {
}
return false
})
return accessedRouters
}
const permission = {
@@ -65,8 +64,7 @@ const permission = {
GenerateRoutes ({ commit }, data) {
return new Promise(resolve => {
const { roles } = data
let accessedRouters
accessedRouters = filterAsyncRouter(asyncRouterMap, roles)
const accessedRouters = filterAsyncRouter(asyncRouterMap, roles)
commit('SET_ROUTERS', accessedRouters)
resolve()
})
+7 -8
View File
@@ -5,7 +5,6 @@ import store from '@/store'
import { welcome } from '@/utils/util'
import { queryPermissionsByUser } from '@/api/api'
import { getAction } from '@/api/manage'
import notification from 'ant-design-vue/lib/notification'
const user = {
state: {
@@ -71,7 +70,7 @@ const user = {
Login ({ commit }, userInfo) {
return new Promise((resolve, reject) => {
login(userInfo).then(response => {
if (response.code == '200') {
if (response.code + '' === '200') {
const result = response.result
const userInfo = result.userInfo
Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
@@ -95,7 +94,7 @@ const user = {
PhoneLogin ({ commit }, userInfo) {
return new Promise((resolve, reject) => {
phoneLogin(userInfo).then(response => {
if (response.code == '200') {
if (response.code + '' === '200') {
const result = response.result
const userInfo = result.userInfo
Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
@@ -127,12 +126,12 @@ const user = {
sessionStorage.setItem(SYS_BUTTON_AUTH, JSON.stringify(allAuthData))
if (menuData && menuData.length > 0) {
// update--begin--autor:qinfeng-----date:20200109------for 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
menuData.forEach((item, index) => {
menuData.forEach((item) => {
if (item.children) {
const hasChildrenMenu = item.children.filter((i) => {
return !i.hidden || i.hidden == false
return !i.hidden || i.hidden === false
})
if (hasChildrenMenu == null || hasChildrenMenu.length == 0) {
if (hasChildrenMenu == null || hasChildrenMenu.length === 0) {
item.hidden = true
}
}
@@ -173,7 +172,7 @@ const user = {
Vue.ls.remove(TENANT_ID)
// console.log('logoutToken: '+ logoutToken)
logout(logoutToken).then(() => {
if (process.env.VUE_APP_SSO == 'true') {
if (process.env.VUE_APP_SSO + '' === 'true') {
const sevice = 'http://' + window.location.host + '/'
const serviceUrl = encodeURIComponent(sevice)
window.location.href = process.env.VUE_APP_CAS_BASE_URL + '/logout?service=' + serviceUrl
@@ -189,7 +188,7 @@ const user = {
ThirdLogin ({ commit }, param) {
return new Promise((resolve, reject) => {
thirdLogin(param.token, param.thirdType).then(response => {
if (response.code == '200') {
if (response.code + '' === '200') {
const result = response.result
const userInfo = result.userInfo
Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)