Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangzhijiang
2022-04-15 18:31:36 +08:00
27 changed files with 731 additions and 469 deletions
@@ -229,6 +229,11 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
return null; return null;
} }
@Override
public String translateDictEn(String code, String key, String cut) {
return null;
}
@Override @Override
public List<SysPermissionDataRuleModel> queryPermissionDataRule(String component, String requestPath, String username) { public List<SysPermissionDataRuleModel> queryPermissionDataRule(String component, String requestPath, String username) {
return null; return null;
@@ -64,6 +64,14 @@ public interface CommonAPI {
*/ */
String translateDict(String code, String key); String translateDict(String code, String key);
/**
* 数据字典英文
* @param code
* @param key
* @return
*/
String translateDictEn(String code, String key,String cut);
/** /**
* 8查询数据权限 * 8查询数据权限
* @return * @return
@@ -3,6 +3,7 @@ package com.jero.common.api.vo;
import java.io.Serializable; import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jero.common.constant.enums.CutEnum;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.jero.common.constant.CommonConstant; import com.jero.common.constant.CommonConstant;
@@ -31,18 +32,24 @@ public class Result<T> implements Serializable {
@ApiModelProperty(value = "返回处理消息") @ApiModelProperty(value = "返回处理消息")
private String message = "操作成功!"; private String message = "操作成功!";
/**
* 返回处理消息
*/
@ApiModelProperty(value = "中英文切换标识")
private String cut = CutEnum.CN.getValue();
/** /**
* 返回代码 * 返回代码
*/ */
@ApiModelProperty(value = "返回代码") @ApiModelProperty(value = "返回代码")
private Integer code = 0; private Integer code = 0;
/** /**
* 返回数据对象 data * 返回数据对象 data
*/ */
@ApiModelProperty(value = "返回数据对象") @ApiModelProperty(value = "返回数据对象")
private T result; private T result;
/** /**
* 时间戳 * 时间戳
*/ */
@@ -50,9 +57,9 @@ public class Result<T> implements Serializable {
private long timestamp = System.currentTimeMillis(); private long timestamp = System.currentTimeMillis();
public Result() { public Result() {
} }
public Result<T> success(String message) { public Result<T> success(String message) {
this.message = message; this.message = message;
this.code = CommonConstant.SC_OK_200; this.code = CommonConstant.SC_OK_200;
@@ -108,14 +115,17 @@ public class Result<T> implements Serializable {
r.setSuccess(true); r.setSuccess(true);
r.setCode(CommonConstant.SC_OK_200); r.setCode(CommonConstant.SC_OK_200);
r.setMessage(msg); r.setMessage(msg);
if(CutEnum.CN.getValue().equals(msg) || CutEnum.EN.getValue().equals(msg)){
r.setCut(msg);
}
r.setResult(data); r.setResult(data);
return r; return r;
} }
public static Result<Object> error(String msg) { public static Result<Object> error(String msg) {
return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg); return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg);
} }
public static Result<Object> error(int code, String msg) { public static Result<Object> error(int code, String msg) {
Result<Object> r = new Result<Object>(); Result<Object> r = new Result<Object>();
r.setCode(code); r.setCode(code);
@@ -140,4 +150,4 @@ public class Result<T> implements Serializable {
@JsonIgnore @JsonIgnore
private String onlTable; private String onlTable;
} }
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.jero.common.constant.enums.CutEnum;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Around;
@@ -82,24 +83,34 @@ public class DictAspect {
private void parseDictText(Object result) { private void parseDictText(Object result) {
if (result instanceof Result) { if (result instanceof Result) {
if (((Result) result).getResult() instanceof IPage) { if (((Result) result).getResult() instanceof IPage) {
String cut = ((Result) result).getCut();
List<JSONObject> items = new ArrayList<>(); List<JSONObject> items = new ArrayList<>();
for (Object record : ((IPage) ((Result) result).getResult()).getRecords()) { for (Object record : ((IPage) ((Result) result).getResult()).getRecords()) {
JSONObject item = getJsonObject(record); JSONObject item = getJsonObject(record,cut);
items.add(item); items.add(item);
} }
((IPage) ((Result) result).getResult()).setRecords(items); ((IPage) ((Result) result).getResult()).setRecords(items);
}else if(((Result) result).getResult() instanceof List){ }else if(((Result) result).getResult() instanceof List){
// List<JSONObject> items = new ArrayList<>(); String cut = ((Result) result).getCut();
// for (Object record : (List)((Result) result).getResult()) { //返回结果中只处理实体对象的不处理其他类型
// JSONObject item = getJsonObject(record); if(((List) ((Result) result).getResult()).size() != 0){
// items.add(item); String name = ((ArrayList) ((Result) result).getResult()).get(0).getClass().getName();
// } if(!"java.util.LinkedHashMap".equals(name) && !"java.util.HashMap".equals(name) && !"java.lang.String".equals(name)){
// ((Result) result).setResult(items); List<JSONObject> items = new ArrayList<>();
for (Object record : (List)((Result) result).getResult()) {
JSONObject item = getJsonObject(record,cut);
items.add(item);
}
((Result) result).setResult(items);
}
}
} }
} }
} }
private JSONObject getJsonObject(Object record) { private JSONObject getJsonObject(Object record,String cut) {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
String json = "{}"; String json = "{}";
try { try {
@@ -120,7 +131,7 @@ public class DictAspect {
String key = String.valueOf(item.get(field.getName())); String key = String.valueOf(item.get(field.getName()));
//翻译字典值对应的txt //翻译字典值对应的txt
String textValue = translateDictValue(code, text, table, key); String textValue = translateDictValue(code, text, table, key,cut);
log.debug(" 字典Val : " + textValue); log.debug(" 字典Val : " + textValue);
log.debug(" __翻译字典字段__ " + field.getName() + CommonConstant.DICT_TEXT_SUFFIX + " " + textValue); log.debug(" __翻译字典字段__ " + field.getName() + CommonConstant.DICT_TEXT_SUFFIX + " " + textValue);
@@ -143,7 +154,7 @@ public class DictAspect {
* @param key * @param key
* @return * @return
*/ */
private String translateDictValue(String code, String text, String table, String key) { private String translateDictValue(String code, String text, String table, String key,String cut) {
if(oConvertUtils.isEmpty(key)) { if(oConvertUtils.isEmpty(key)) {
return null; return null;
} }
@@ -159,13 +170,20 @@ public class DictAspect {
log.debug("--DictAspect------dicTable="+ table+" ,dicText= "+text+" ,dicCode="+code); log.debug("--DictAspect------dicTable="+ table+" ,dicText= "+text+" ,dicCode="+code);
tmpValue= commonAPI.translateDictFromTable(table,text,code,k.trim()); tmpValue= commonAPI.translateDictFromTable(table,text,code,k.trim());
}else { }else {
tmpValue = commonAPI.translateDict(code, k.trim()); if(CutEnum.CN.getValue().equals(cut)){
tmpValue = commonAPI.translateDict(code, k.trim());
}else if(CutEnum.EN.getValue().equals(cut)){
tmpValue = commonAPI.translateDictEn(code, k.trim(),cut);
}
} }
if (tmpValue != null) { if (tmpValue != null) {
if (!"".equals(textValue.toString())) { if (!"".equals(textValue.toString())) {
textValue.append(","); textValue.append(",");
} }
textValue.append(tmpValue); textValue.append(tmpValue);
}else{
tmpValue = "";
} }
} }
@@ -430,7 +430,7 @@ public class SysDictController {
result.error500("未找到对应实体"); result.error500("未找到对应实体");
}else { }else {
if (StringUtils.isNotBlank(String.valueOf(sysDict.getIsReadOnly()))) { if (StringUtils.isNotBlank(String.valueOf(sysDict.getIsReadOnly()))) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDict.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(sysDict.getIsReadOnly()))) {
result.error500("固定字段,不可修改"); result.error500("固定字段,不可修改");
}else{ }else{
sysDict.setUpdateTime(new Date()); sysDict.setUpdateTime(new Date());
@@ -460,7 +460,7 @@ public class SysDictController {
Result<SysDict> result = new Result<SysDict>(); Result<SysDict> result = new Result<SysDict>();
SysDict sysDict = sysDictService.queryById(id); SysDict sysDict = sysDictService.queryById(id);
if (StringUtils.isNotBlank(String.valueOf(sysDict.getIsReadOnly()))) { if (StringUtils.isNotBlank(String.valueOf(sysDict.getIsReadOnly()))) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDict.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(sysDict.getIsReadOnly()))) {
result.error500("固定字段,不可删除"); result.error500("固定字段,不可删除");
} else { } else {
boolean ok = sysDictService.removeById(id); boolean ok = sysDictService.removeById(id);
@@ -489,7 +489,7 @@ public class SysDictController {
Result<SysDict> result = new Result<SysDict>(); Result<SysDict> result = new Result<SysDict>();
try{ try{
SysDict sysDict = sysDictService.queryById(id); SysDict sysDict = sysDictService.queryById(id);
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDict.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(sysDict.getIsReadOnly()))) {
result.error500("固定字段,不可删除"); result.error500("固定字段,不可删除");
} else { } else {
sysDictService.updateDictDelFlag(CommonConstant.DEL_FLAG_1,id); sysDictService.updateDictDelFlag(CommonConstant.DEL_FLAG_1,id);
@@ -519,7 +519,7 @@ public class SysDictController {
List<String> idList = Arrays.asList(ids.split(",")); List<String> idList = Arrays.asList(ids.split(","));
for (String list : idList) { for (String list : idList) {
SysDict midDict = sysDictService.getById(list); SysDict midDict = sysDictService.getById(list);
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDict.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(midDict.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(sysDict.getIsReadOnly())) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(String.valueOf(midDict.getIsReadOnly()))) {
return result.error500("包含固定字段,不可删除"); return result.error500("包含固定字段,不可删除");
} else { } else {
sysDictService.removeByIds(idList); sysDictService.removeByIds(idList);
@@ -547,7 +547,7 @@ public class SysDictController {
result.error500("参数不识别!"); result.error500("参数不识别!");
}else { }else {
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(joinSystem.getIsReadOnly()))) { if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(joinSystem.getIsReadOnly()))) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(joinSystem.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(joinSystem.getIsReadOnly()))) {
result.error500("包含固定字段,不可删除"); result.error500("包含固定字段,不可删除");
} else { } else {
sysDictService.updateDictDelFlag(CommonConstant.DEL_FLAG_1,joinSystem.getId()); sysDictService.updateDictDelFlag(CommonConstant.DEL_FLAG_1,joinSystem.getId());
@@ -1467,6 +1467,9 @@ public class SysUserController {
@ApiOperation(value="文档库推送部门和人员的模糊搜索", notes="文档库推送部门和人员的模糊搜索") @ApiOperation(value="文档库推送部门和人员的模糊搜索", notes="文档库推送部门和人员的模糊搜索")
@GetMapping(value = "/getUserAndDepart") @GetMapping(value = "/getUserAndDepart")
public List<SysUserDepartVO> getUserAndDepart(String name){ public List<SysUserDepartVO> getUserAndDepart(String name){
if("%".equals(name)){
name = "/%";
}
LambdaQueryWrapper<SysUser> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysUser> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.like(SysUser::getRealname,name); lambdaQueryWrapper.like(SysUser::getRealname,name);
List<SysUser> sysUserList = sysUserService.list(lambdaQueryWrapper); List<SysUser> sysUserList = sysUserService.list(lambdaQueryWrapper);
@@ -24,7 +24,7 @@ import java.util.Map;
* @since 2018-12-28 * @since 2018-12-28
*/ */
public interface SysDictMapper extends BaseMapper<SysDict> { public interface SysDictMapper extends BaseMapper<SysDict> {
/** /**
* 重复检查SQL * 重复检查SQL
* @return * @return
@@ -32,7 +32,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
public Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo); public Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo);
public Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo); public Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo);
public List<DictModel> queryDictItemsByCode(@Param("code") String code); public List<DictModel> queryDictItemsByCode(@Param("code") String code);
@Deprecated @Deprecated
@@ -47,6 +47,8 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
public String queryDictTextByKey(@Param("code") String code,@Param("key") String key); public String queryDictTextByKey(@Param("code") String code,@Param("key") String key);
public String queryDictTextByKeyEn(@Param("code") String code,@Param("key") String key);
public String queryDictKeyByText(@Param("code") String code,@Param("text") String key); public String queryDictKeyByText(@Param("code") String code,@Param("text") String key);
@Deprecated @Deprecated
@@ -60,13 +62,13 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @return * @return
*/ */
public List<DictModel> queryAllDepartBackDictModel(); public List<DictModel> queryAllDepartBackDictModel();
/** /**
* 查询所有用户 作为字典信息 username -->value,realname -->text * 查询所有用户 作为字典信息 username -->value,realname -->text
* @return * @return
*/ */
public List<DictModel> queryAllUserBackDictModel(); public List<DictModel> queryAllUserBackDictModel();
/** /**
* 通过关键字查询出字典表 * 通过关键字查询出字典表
* @param table * @param table
@@ -15,6 +15,12 @@
where s.dict_id = (select id from sys_dict where dict_code = #{code}) where s.dict_id = (select id from sys_dict where dict_code = #{code})
and s.item_value = #{key} and s.item_value = #{key}
</select> </select>
<!-- 通过字典code获取字典数据(英文) -->
<select id="queryDictTextByKeyEn" parameterType="String" resultType="String">
select s.en_name from sys_dict_item s
where s.dict_id = (select id from sys_dict where dict_code = #{code})
and s.item_value = #{key}
</select>
<!-- 通过字典code获取字典数据 --> <!-- 通过字典code获取字典数据 -->
<select id="queryDictKeyByText" parameterType="String" resultType="String"> <select id="queryDictKeyByText" parameterType="String" resultType="String">
@@ -33,6 +33,7 @@ public interface ISysDictService extends IService<SysDict> {
public List<DictModel> queryTableDictItemsByCodeAndFilter(String table, String text, String code, String filterSql); public List<DictModel> queryTableDictItemsByCodeAndFilter(String table, String text, String code, String filterSql);
public String queryDictTextByKey(String code, String key); public String queryDictTextByKey(String code, String key);
public String queryDictTextByKeyEn(String code, String key,String cut);
@Deprecated @Deprecated
String queryTableDictTextByKey(String table, String text, String code, String key); String queryTableDictTextByKey(String table, String text, String code, String key);
@@ -51,7 +51,7 @@ import java.util.*;
/** /**
* @Description: 底层共通业务API,提供其他独立模块调用 * @Description: 底层共通业务API,提供其他独立模块调用
* @Author: scott * @Author: scott
* @Date:2019-4-20 * @Date:2019-4-20
* @Version:V1.0 * @Version:V1.0
*/ */
@Slf4j @Slf4j
@@ -118,6 +118,11 @@ public class SysBaseApiImpl implements ISysBaseAPI {
return sysDictService.queryDictTextByKey(code, key); return sysDictService.queryDictTextByKey(code, key);
} }
@Override
public String translateDictEn(String code, String key, String cut) {
return sysDictService.queryDictTextByKeyEn(code, key,cut);
}
@Override @Override
public List<SysPermissionDataRuleModel> queryPermissionDataRule(String component, String requestPath, String username) { public List<SysPermissionDataRuleModel> queryPermissionDataRule(String component, String requestPath, String username) {
List<SysPermission> currentSyspermission = null; List<SysPermission> currentSyspermission = null;
@@ -1015,4 +1020,4 @@ public class SysBaseApiImpl implements ISysBaseAPI {
public List<SysDepartTreeModel> listSonDepartsByDepId(String departId) { public List<SysDepartTreeModel> listSonDepartsByDepId(String departId) {
return sysDepartService.listSonDepartsByDepId(departId); return sysDepartService.listSonDepartsByDepId(departId);
} }
} }
@@ -123,6 +123,12 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
log.debug("无缓存dictText的时候调用这里!"); log.debug("无缓存dictText的时候调用这里!");
return sysDictMapper.queryDictTextByKey(code, key); return sysDictMapper.queryDictTextByKey(code, key);
} }
@Override
@Cacheable(value = CacheConstant.SYS_DICT_CACHE,key = "#code+':'+#key+#cut")
public String queryDictTextByKeyEn(String code, String key,String cut) {
log.debug("无缓存dictText的时候调用这里!");
return sysDictMapper.queryDictTextByKeyEn(code, key);
}
/** /**
* 通过查询指定table的 text code 获取字典 * 通过查询指定table的 text code 获取字典
@@ -49,7 +49,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value="分页查询", notes="分页查询") @ApiOperation(value="分页查询", notes="分页查询")
@PostMapping(value = "/queryPageInfo") @PostMapping(value = "/queryPageInfo")
@ResponseBody @ResponseBody
// @RequiresPermissions("document:queryPageInfo") @RequiresPermissions("document:queryPageInfo")
public JSONObject queryPageInfo(@RequestBody Map<String,Object> parameter) { public JSONObject queryPageInfo(@RequestBody Map<String,Object> parameter) {
IPage infoPage = bussDocumentLibraryEOService.getInfoPage(parameter); IPage infoPage = bussDocumentLibraryEOService.getInfoPage(parameter);
Result<IPage> ok = Result.OK(infoPage); Result<IPage> ok = Result.OK(infoPage);
@@ -66,7 +66,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value="代替标准分页列表查询", notes="代替标准分页列表查询") @ApiOperation(value="代替标准分页列表查询", notes="代替标准分页列表查询")
@PostMapping(value = "/replacePageInfo") @PostMapping(value = "/replacePageInfo")
@ResponseBody @ResponseBody
// @RequiresPermissions("document:replacePageInfo") @RequiresPermissions("document:getInfoById")
public Result<?> replacePageInfo(@RequestBody Map<String,Object> parameter) { public Result<?> replacePageInfo(@RequestBody Map<String,Object> parameter) {
IPage infoPage = bussDocumentLibraryEOService.replacePageInfo(parameter); IPage infoPage = bussDocumentLibraryEOService.replacePageInfo(parameter);
// Result<IPage> ok = Result.OK(infoPage); // Result<IPage> ok = Result.OK(infoPage);
@@ -161,7 +161,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-查询条件") @AutoLog(value = "文档库信息表-查询条件")
@ApiOperation(value="文档库信息表-查询条件", notes="文档库信息表-查询条件") @ApiOperation(value="文档库信息表-查询条件", notes="文档库信息表-查询条件")
@GetMapping(value = "/queryCondition") @GetMapping(value = "/queryCondition")
// @RequiresPermissions("document:queryCondition") @RequiresPermissions("document:queryPageInfo")
public Result<List<Map<String,Object>>> queryCondition(@RequestParam(name="flag",required=true) String flag, public Result<List<Map<String,Object>>> queryCondition(@RequestParam(name="flag",required=true) String flag,
@RequestParam(name="cut",required=true) String cut) { @RequestParam(name="cut",required=true) String cut) {
List<Map<String,Object>> list = bussDocumentLibraryEOService.queryCondition(flag,cut,null); List<Map<String,Object>> list = bussDocumentLibraryEOService.queryCondition(flag,cut,null);
@@ -176,7 +176,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-列表表头") @AutoLog(value = "文档库信息表-列表表头")
@ApiOperation(value="文档库信息表-列表表头", notes="文档库信息表-列表表头") @ApiOperation(value="文档库信息表-列表表头", notes="文档库信息表-列表表头")
@GetMapping(value = "/getHeader") @GetMapping(value = "/getHeader")
// @RequiresPermissions("document:getHeader") @RequiresPermissions("document:queryPageInfo")
public Result<List<Map<String,Object>>> getHeader(@RequestParam(name="flag",required=true) String flag, public Result<List<Map<String,Object>>> getHeader(@RequestParam(name="flag",required=true) String flag,
@RequestParam(name="cut",required=true) String cut) { @RequestParam(name="cut",required=true) String cut) {
List<Map<String,Object>> list = bussDocumentLibraryEOService.getHeader(flag,cut,null); List<Map<String,Object>> list = bussDocumentLibraryEOService.getHeader(flag,cut,null);
@@ -191,7 +191,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-新增表单") @AutoLog(value = "文档库信息表-新增表单")
@ApiOperation(value="文档库信息表-新增表单", notes="文档库信息表-新增表单") @ApiOperation(value="文档库信息表-新增表单", notes="文档库信息表-新增表单")
@GetMapping(value = "/getAddForm") @GetMapping(value = "/getAddForm")
// @RequiresPermissions("document:getAddForm") @RequiresPermissions("document:queryPageInfo")
public Result<List<Map<String,Object>>> getAddForm(@RequestParam(name="flag",required=true) String flag, public Result<List<Map<String,Object>>> getAddForm(@RequestParam(name="flag",required=true) String flag,
@RequestParam(name="cut",required=true) String cut, @RequestParam(name="cut",required=true) String cut,
@RequestParam(name="type",required=true) String type) { @RequestParam(name="type",required=true) String type) {
@@ -237,7 +237,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "编辑数据查询") @AutoLog(value = "编辑数据查询")
@ApiOperation(value="编辑数据查询", notes="编辑数据查询") @ApiOperation(value="编辑数据查询", notes="编辑数据查询")
@GetMapping(value = "/getDocumentInfoById") @GetMapping(value = "/getDocumentInfoById")
// @RequiresPermissions("document:getDocumentInfoById") @RequiresPermissions("document:updateInfo")
public Result<List<Map<String,Object>>> getDocumentInfoById(@RequestParam(name="id",required=true) String id, public Result<List<Map<String,Object>>> getDocumentInfoById(@RequestParam(name="id",required=true) String id,
@RequestParam(name="cut",required=true) String cut) { @RequestParam(name="cut",required=true) String cut) {
List<Map<String, Object>> list = bussDocumentLibraryEOService.getDocumentInfoById(id,cut); List<Map<String, Object>> list = bussDocumentLibraryEOService.getDocumentInfoById(id,cut);
@@ -251,7 +251,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "详情数据查询") @AutoLog(value = "详情数据查询")
@ApiOperation(value="详情数据查询", notes="详情数据查询") @ApiOperation(value="详情数据查询", notes="详情数据查询")
@GetMapping(value = "/getInfoById") @GetMapping(value = "/getInfoById")
// @RequiresPermissions("document:getInfoById") @RequiresPermissions("document:queryPageInfo")
public Result<List<Map<String,Object>>> getInfoById(@RequestParam(name="id",required=true) String id, public Result<List<Map<String,Object>>> getInfoById(@RequestParam(name="id",required=true) String id,
@RequestParam(name="cut",required=true) String cut) { @RequestParam(name="cut",required=true) String cut) {
List<Map<String, Object>> list = bussDocumentLibraryEOService.getInfoById(id,cut); List<Map<String, Object>> list = bussDocumentLibraryEOService.getInfoById(id,cut);
@@ -588,8 +588,6 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
*/ */
@Override @Override
public List<Map<String, Object>> getDocumentInfoById(String id, String cut) { public List<Map<String, Object>> getDocumentInfoById(String id, String cut) {
LambdaQueryWrapper<BussDocumentLibraryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BussDocumentLibraryEO::getId, id);
//字段属性 //字段属性
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1"); List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
List<OnlCgformField> treeOnlCgformFieldList = fieldList.stream().filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList()); List<OnlCgformField> treeOnlCgformFieldList = fieldList.stream().filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
@@ -59,7 +59,7 @@ public class DummyInventoryBaseEOController extends JeroController<DummyInventor
queryWrapper.orderByDesc("create_time"); queryWrapper.orderByDesc("create_time");
Page<DummyInventoryBaseEO> page = new Page<DummyInventoryBaseEO>(pageNo, pageSize); Page<DummyInventoryBaseEO> page = new Page<DummyInventoryBaseEO>(pageNo, pageSize);
IPage<DummyInventoryBaseEO> pageList = dummyInventoryBaseEOService.getPageInfo(page,queryWrapper); IPage<DummyInventoryBaseEO> pageList = dummyInventoryBaseEOService.getPageInfo(page,queryWrapper);
return Result.OK(pageList); return Result.OK(dummyInventoryBaseEO.getCut(),pageList);
} }
/** /**
@@ -8,6 +8,7 @@ import com.jero.modules.searchcenter.vo.SearchVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@@ -43,6 +44,7 @@ public class DocumentSearchController {
@AutoLog(value = "文档库信息表-查询条件") @AutoLog(value = "文档库信息表-查询条件")
@ApiOperation(value="文档库信息表-查询条件", notes="文档库信息表-查询条件") @ApiOperation(value="文档库信息表-查询条件", notes="文档库信息表-查询条件")
@GetMapping(value = "/queryCondition") @GetMapping(value = "/queryCondition")
@RequiresPermissions("document:search")
public Result<List<Map<String,Object>>> queryCondition(@RequestParam(name="flag",required=true) String flag, public Result<List<Map<String,Object>>> queryCondition(@RequestParam(name="flag",required=true) String flag,
@RequestParam(name="cut",required=true) String cut, @RequestParam(name="cut",required=true) String cut,
@RequestParam(name="searchFlag",required=true) String searchFlag) { @RequestParam(name="searchFlag",required=true) String searchFlag) {
@@ -66,6 +68,7 @@ public class DocumentSearchController {
@ApiOperation(value="列表查询", notes="列表查询") @ApiOperation(value="列表查询", notes="列表查询")
@PostMapping(value = "/getInfoList") @PostMapping(value = "/getInfoList")
@RequiresPermissions("document:search")
public Result<?> getInfoList(@RequestBody Map<String,Object> map) { public Result<?> getInfoList(@RequestBody Map<String,Object> map) {
IPage infoList = iDocumentSearchService.getInfoList(map); IPage infoList = iDocumentSearchService.getInfoList(map);
return Result.OK(infoList); return Result.OK(infoList);
@@ -73,6 +76,7 @@ public class DocumentSearchController {
@ApiOperation(value="全部查询", notes="全部查询") @ApiOperation(value="全部查询", notes="全部查询")
@PostMapping(value = "/getFullTextInfoList") @PostMapping(value = "/getFullTextInfoList")
@RequiresPermissions("/search:search")
public Result<?> getFullTextInfoList(@RequestBody SearchVO searchVO) { public Result<?> getFullTextInfoList(@RequestBody SearchVO searchVO) {
IPage pageInfo = iDocumentSearchService.getFullTextInfoList(searchVO); IPage pageInfo = iDocumentSearchService.getFullTextInfoList(searchVO);
return Result.OK(pageInfo); return Result.OK(pageInfo);
@@ -80,6 +84,7 @@ public class DocumentSearchController {
@ApiOperation(value="文档库查询段落", notes="文档库查询段落") @ApiOperation(value="文档库查询段落", notes="文档库查询段落")
@PostMapping(value = "/getParagraphInfoList") @PostMapping(value = "/getParagraphInfoList")
@RequiresPermissions("document:search")
public Result<?> getParagraphInfoList(@RequestBody Map<String,Object> map) { public Result<?> getParagraphInfoList(@RequestBody Map<String,Object> map) {
IPage pageInfo = iDocumentSearchService.getParagraphInfoList(map); IPage pageInfo = iDocumentSearchService.getParagraphInfoList(map);
return Result.OK(pageInfo); return Result.OK(pageInfo);
@@ -95,7 +95,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
int count=onlCgformAreaService.queryExitAreaName(onlCgformArea); int count=onlCgformAreaService.queryExitAreaName(onlCgformArea);
if (count > 0) { if (count > 0) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(onlCgformArea.getCut())) {
return Result.error("同一所属模块下,展示区域名称不能重复!"); return Result.error("同一所属模块下,展示区域名称不能重复!");
}else{ }else{
return Result.error("Under the same module, the display area name cannot be duplicate!"); return Result.error("Under the same module, the display area name cannot be duplicate!");
@@ -121,7 +121,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
int count=onlCgformAreaService.queryExitAreaName(onlCgformArea); int count=onlCgformAreaService.queryExitAreaName(onlCgformArea);
if (count > 0) { if (count > 0) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(onlCgformArea.getCut())) {
return Result.error("同一所属模块下,展示区域名称不能重复!"); return Result.error("同一所属模块下,展示区域名称不能重复!");
}else{ }else{
return Result.error("Under the same module, the display area name cannot be duplicate!"); return Result.error("Under the same module, the display area name cannot be duplicate!");
@@ -187,7 +187,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id); OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id);
if(onlCgformArea==null) { if(onlCgformArea==null) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(onlCgformArea.getCut())) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
}else{ }else{
return Result.error("No corresponding data was found."); return Result.error("No corresponding data was found.");
@@ -232,7 +232,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
OnlCgformArea onlCgformArea = (OnlCgformArea) onlCgformAreaService.selectShowAreaById(id); OnlCgformArea onlCgformArea = (OnlCgformArea) onlCgformAreaService.selectShowAreaById(id);
if(onlCgformArea==null) { if(onlCgformArea==null) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(onlCgformArea.getCut())) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
}else{ }else{
return Result.error("No corresponding data was found."); return Result.error("No corresponding data was found.");
@@ -127,7 +127,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
} }
}else{ }else{
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(onlCgformTag.getCut())) {
throw new JeroBootException("属性已存在,请检查"); throw new JeroBootException("属性已存在,请检查");
}else{ }else{
throw new JeroBootException("Attribute already exists, please check!"); throw new JeroBootException("Attribute already exists, please check!");
@@ -159,7 +159,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
checkData(); checkData();
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(onlCgformTag.getCut())) {
return Result.error("固定字段,不可修改"); return Result.error("固定字段,不可修改");
}else{ }else{
return Result.error("Fixed field, which cannot be modified."); return Result.error("Fixed field, which cannot be modified.");
@@ -191,7 +191,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
} }
}else {//有未删数据,报错 }else {//有未删数据,报错
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(onlCgformTag.getCut())) {
return Result.error("属性已存在,请检查"); return Result.error("属性已存在,请检查");
}else{ }else{
return Result.error("Attribute already exists, please check!"); return Result.error("Attribute already exists, please check!");
@@ -252,7 +252,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
if(StringUtils.isNotBlank(String.valueOf(onlCgformTag.getIsReadOnly()))) { if(StringUtils.isNotBlank(String.valueOf(onlCgformTag.getIsReadOnly()))) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(onlCgformTag.getCut())) {
result.error500("固定字段,不可删除"); result.error500("固定字段,不可删除");
}else{ }else{
result.error500("Fixed field, cannot be deleted."); result.error500("Fixed field, cannot be deleted.");
@@ -307,18 +307,18 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
List<String> idList = Arrays.asList(ids.split(",")); List<String> idList = Arrays.asList(ids.split(","));
for(String list:idList){ for(String list:idList){
OnlCgformTag midTag=onlCgformTagService.getById(list); OnlCgformTag midTag=onlCgformTagService.getById(list);
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(midTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(midTag.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(midTag.getIsReadOnly())) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(String.valueOf(midTag.getIsReadOnly()))) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(midTag.getCut())) {
result.error500("包含固定字段,不可删除"); result.error500("包含固定字段,不可删除");
}else{ }else{
result.error500("It contains fixed fields and cannot be deleted."); result.error500("It contains fixed fields and cannot be deleted.");
} }
}else { }else {
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(midTag.getIsReadOnly()))) { if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(midTag.getIsReadOnly()))) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(midTag.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(midTag.getIsReadOnly()))) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(midTag.getCut())) {
result.error500("包含固定字段,不可删除"); result.error500("包含固定字段,不可删除");
}else{ }else{
result.error500("It contains fixed fields and cannot be deleted."); result.error500("It contains fixed fields and cannot be deleted.");
@@ -327,7 +327,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
onlCgformTagService.updateDictDelFlag(CommonConstant.DEL_FLAG_1, midTag.getId()); onlCgformTagService.updateDictDelFlag(CommonConstant.DEL_FLAG_1, midTag.getId());
//onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID),"normal");//逻辑删除-->改变状态,数据库不删 //onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID),"normal");//逻辑删除-->改变状态,数据库不删
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals("cut")) { if(CutEnum.CN.getValue().equals(midTag.getCut())) {
result.success("批量删除成功!"); result.success("批量删除成功!");
}else{ }else{
result.success("Batch deletion succeeded!"); result.success("Batch deletion succeeded!");
+72 -66
View File
@@ -390,7 +390,7 @@ module.exports = {
check: 'check', check: 'check',
enName: 'English name', enName: 'English name',
selectLeastOne: 'Please select at least one piece of data', selectLeastOne: 'Please select at least one piece of data',
selectFileType:'Please select a file type', selectFileType: 'Please select a file type',
sureVerified: 'Are you sure this file is not verified?', sureVerified: 'Are you sure this file is not verified?',
sureSynchronize: 'The file has not been verified. Are you sure you want to synchronize to the document library?', sureSynchronize: 'The file has not been verified. Are you sure you want to synchronize to the document library?',
UploadFile: 'Upload file', UploadFile: 'Upload file',
@@ -591,69 +591,75 @@ module.exports = {
confirmationOfDesignConformity: 'Confirmation of design conformity', confirmationOfDesignConformity: 'Confirmation of design conformity',
Deliverables: 'Deliverables', Deliverables: 'Deliverables',
personLiable: 'person liable', personLiable: 'person liable',
PrehomoConfirmation:'Prehomo confirmation', PrehomoConfirmation: 'Prehomo confirmation',
verificationAndConformityconfirmation:'Verification and conformity confirmation', verificationAndConformityconfirmation: 'Verification and conformity confirmation',
StandardImplementationDate:'Standard implementation date', StandardImplementationDate: 'Standard implementation date',
regulatoryEngineer:'Regulatory Engineer', regulatoryEngineer: 'Regulatory Engineer',
certifiedEngineer:'Certified Engineer', certifiedEngineer: 'Certified Engineer',
engineeringInterfacePerson:'Engineering interface person', engineeringInterfacePerson: 'Engineering interface person',
typeOfDeliverables:'Type of deliverables', typeOfDeliverables: 'Type of deliverables',
deliverableTemplate:'Deliverable template', deliverableTemplate: 'Deliverable template',
entryName:'entry name', entryName: 'entry name',
targetMarket:'target market', targetMarket: 'target market',
projectStatus:'Project status', projectStatus: 'Project status',
StudioEngineer:'Studio engineer', StudioEngineer: 'Studio engineer',
CertificationTime:'Certification time', CertificationTime: 'Certification time',
NTplatform:'NT platform', NTplatform: 'NT platform',
NPplatform:'NP platform', NPplatform: 'NP platform',
IPDInformation:'IPD information', IPDInformation: 'IPD information',
certificationProgramInformation:'Certification program information', certificationProgramInformation: 'Certification program information',
taskReleaseStatus:'Task release status', taskReleaseStatus: 'Task release status',
task:'task', task: 'task',
TaskCutOffTime:'Task cut-off time', TaskCutOffTime: 'Task cut-off time',
Transfer:'Transfer', Transfer: 'Transfer',
CertificationDirectory:'Certification directory', CertificationDirectory: 'Certification directory',
TaskRequirements:'Task requirements', TaskRequirements: 'Task requirements',
CertificationProgress:'Certification progress', CertificationProgress: 'Certification progress',
CurrentProjectStatusEvaluation:'Current project status evaluation', CurrentProjectStatusEvaluation: 'Current project status evaluation',
NiONumber:'NiO number', NiONumber: 'NiO number',
ParameterName:'Parameter name', ParameterName: 'Parameter name',
ParameterDescription:'Parameter description', ParameterDescription: 'Parameter description',
Version:'Version', Version: 'Version',
certificationProgramTime:'Certification program time', certificationProgramTime: 'Certification program time',
ArchitecturePlatform:'Architecture platform', ArchitecturePlatform: 'Architecture platform',
ModelPlatform:'Model platform', ModelPlatform: 'Model platform',
ListOfRelevantPersonnel:'List of relevant personnel', ListOfRelevantPersonnel: 'List of relevant personnel',
DeliverableStatus:'Deliverable status', DeliverableStatus: 'Deliverable status',
CurrentStatusOfTheProject:'Current status of the project', CurrentStatusOfTheProject: 'Current status of the project',
NonConformance:'Non conformance', NonConformance: 'Non conformance',
listSubclauses:'list subclauses', listSubclauses: 'list subclauses',
fileType:'file type', fileType: 'file type',
view:'view', view: 'view',
KMVSS_Table:'KMVSS Table', KMVSS_Table: 'KMVSS Table',
KMVSS_Article:'KMVSS Article', KMVSS_Article: 'KMVSS Article',
America:'America', America: 'America',
Europe:'Europe', Europe: 'Europe',
Japan_one:'Japan Attachment', Japan_one: 'Japan Attachment',
Japan_two:'Japan Article', Japan_two: 'Japan Article',
China:'China', China: 'China',
onlyOnefileUploaded:'only one file can be uploaded', onlyOnefileUploaded: 'only one file can be uploaded',
typeCannotUploaded:'this type of file cannot be uploaded', typeCannotUploaded: 'this type of file cannot be uploaded',
confirmWithdraw:'confirm Withdraw ?', confirmWithdraw: 'confirm Withdraw ?',
OperationDetails:'Operation details', OperationDetails: 'Operation details',
OperationTime:'Operation time', OperationTime: 'Operation time',
oneTableAdded:'only one table can be added', oneTableAdded: 'only one table can be added',
addATable:'please add a table', addATable: 'please add a table',
pleaseUploadSplitFile:'please upload split file', pleaseUploadSplitFile: 'please upload split file',
release:'release', release: 'release',
confirmRelease:'confirm Release ?', confirmRelease: 'confirm Release ?',
UploadMost:'You can only upload 20 at most', UploadMost: 'You can only upload 20 at most',
FileUploadFailed:'File upload failed', FileUploadFailed: 'File upload failed',
FileUploadedSuccessfully:'File uploaded successfully', FileUploadedSuccessfully: 'File uploaded successfully',
DeletedSuccessfully:'Deleted successfully', DeletedSuccessfully: 'Deleted successfully',
confirmCopy:'confirm Copy ?', confirmCopy: 'confirm Copy ?',
DigitalPlatform:'Digital platform', DigitalPlatform: 'Digital platform',
dehicleDevelopmentPlan:'Vehicle development plan', dehicleDevelopmentPlan: 'Vehicle development plan',
certificationProgram:'certificationProgram', certificationProgram: 'certificationProgram',
DocumentStandard:'Document standard', DocumentStandard: 'Document standard',
standardName: 'standard Name',
initiateListConfirmation: 'Initiate list confirmation',
initiateTaskConfirmation: 'Initiate task confirmation',
alteration: 'alteration',
fixedPlate: 'Fixed plate',
taskAffirmStatus: 'task Affirm Status'
} }
+13 -7
View File
@@ -652,12 +652,18 @@ module.exports = {
release: '发布', release: '发布',
confirmRelease: '确认发布', confirmRelease: '确认发布',
UploadMost: '最多只能上传二十个', UploadMost: '最多只能上传二十个',
FileUploadFailed:'文件上传失败', FileUploadFailed: '文件上传失败',
FileUploadedSuccessfully:'文件上传成功', FileUploadedSuccessfully: '文件上传成功',
DeletedSuccessfully:'删除成功', DeletedSuccessfully: '删除成功',
confirmCopy: '确定复制', confirmCopy: '确定复制',
DigitalPlatform:'数字平台', DigitalPlatform: '数字平台',
dehicleDevelopmentPlan:'整车开发计划', dehicleDevelopmentPlan: '整车开发计划',
certificationProgram:'认证计划', certificationProgram: '认证计划',
DocumentStandard:'文档标准', DocumentStandard: '文档标准',
standardName: '标准名称',
initiateListConfirmation: '发起清单确认',
initiateTaskConfirmation:'发起任务确认',
alteration:'变更',
fixedPlate:'定版',
taskAffirmStatus:'任务发布状态',
} }
@@ -222,6 +222,35 @@
</span> </span>
</a-table> </a-table>
</a-modal> </a-modal>
<a-modal
:title="'查看文件'"
:width="600"
:visible="visibleFile"
:maskClosable="false"
@ok="visibleFile = false"
@cancel="visibleFile = false"
>
<a-table
class="table"
:columns="columnsFile"
:pagination="false"
:scroll="{x:500,y: 400}"
:data-source="dataSourceFile"
:loading="loading"
>
<span slot="fileOperation" slot-scope="record">
<a class="text" @click="pdfPreview(record)">
{{$t('See')}}
</a>
<a class="text" @click="download(record)">
{{$t('download')}}
</a>
<a class="text" @click="breakdown(record)">
{{$t('StandardBreakdown')}}
</a>
</span>
</a-table>
</a-modal>
<uploadFile ref="uploadFile" :isUploadFile="true" :disabled="true"></uploadFile> <uploadFile ref="uploadFile" :isUploadFile="true" :disabled="true"></uploadFile>
</div> </div>
</template> </template>
@@ -241,15 +270,31 @@
getInfo: 'document/bussDocumentLibraryEO/getInfoById', getInfo: 'document/bussDocumentLibraryEO/getInfoById',
list: 'log/bussLogEO/page' list: 'log/bussLogEO/page'
}, },
visibleFile: false,
columnsRelated: [ columnsRelated: [
{ {
title: '标准名称', title: this.$t('standardName'),
dataIndex: 'title', dataIndex: 'title',
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
} }
], ],
columnsFile: [
{
title: this.$t('fileName'),
dataIndex: 'fileName',
align: 'center',
width: 260,
ellipsis: true
},
{
title: this.$t('operation'),
align: 'center',
width: 130,
scopedSlots: { customRender: 'fileOperation' }
}
],
dataSourceRelated: [], dataSourceRelated: [],
detailList: [], detailList: [],
visible: false, visible: false,
@@ -261,6 +306,7 @@
pageSize: 10, pageSize: 10,
total: 0, total: 0,
visibleRelated: false, visibleRelated: false,
dataSourceFile: [],
columns: [ columns: [
{ {
title: this.$t('ModificationContent'), title: this.$t('ModificationContent'),
@@ -300,13 +346,15 @@
}) })
}, },
clickButtonToUpload(item) { clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc() this.loading = true
this.$refs.uploadFile.visible = true this.visibleFile = true
getAction('sys/common/getFileInfos', { id: item.join(',') }).then((res) => { getAction('sys/common/getFileInfos', { id: item.join(',') }).then((res) => {
if (res.success) { if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result) this.dataSourceFile = res.result
this.loading = false
} else { } else {
this.$refs.uploadFile.perentHandleFunc() this.dataSourceFile = []
this.loading = false
} }
}) })
}, },
@@ -272,11 +272,11 @@
align: 'center', align: 'center',
dataIndex: 'region' dataIndex: 'region'
}, },
{ // {
title: this.$t('functionalAreas'), // title: this.$t('functionalAreas'),
align: 'center', // align: 'center',
dataIndex: 'function_territory' // dataIndex: 'function_territory'
}, // },
{ {
title: this.$t('technicalField'), title: this.$t('technicalField'),
align: 'center', align: 'center',
@@ -29,10 +29,20 @@
:placeholder="$t('pleaseEnter')+$t('searchContent')" :placeholder="$t('pleaseEnter')+$t('searchContent')"
@search="wholeOnSearch" @search="wholeOnSearch"
></a-input-search> ></a-input-search>
<span v-if="active === $t('whole') || active === $t('DocumentLibrary')" class="textSearch" <a-button class="textSearch"
@click="wholeTextSearch(selectValueTwo)">{{$t('searchInResults')}}</span> v-if="active === $t('whole') || active === $t('DocumentLibrary')"
<span v-if="active === $t('whole') || active === $t('DocumentLibrary')" class="textSearch" @click="wholeTextSearch(selectValueTwo)"
@click="ResetSearch()">{{$t('reset')}}</span> >{{$t('searchInResults')}}
</a-button>
<a-button class="textSearch"
v-if="active === $t('whole') || active === $t('DocumentLibrary')"
@click="ResetSearch()"
>{{$t('reset')}}
</a-button>
<!-- <span v-if="active === $t('whole') || active === $t('DocumentLibrary')" class="textSearch"-->
<!-- @click="wholeTextSearch(selectValueTwo)">{{$t('searchInResults')}}</span>-->
<!-- <span v-if="active === $t('whole') || active === $t('DocumentLibrary')" class="textSearch"-->
<!-- @click="ResetSearch()">{{$t('reset')}}</span>-->
</div> </div>
</div> </div>
<div class="search-center-content"> <div class="search-center-content">
@@ -174,10 +184,12 @@
.search-detail { .search-detail {
display: flex; display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
//justify-content: center; //justify-content: center;
.search-detail-wrap { .search-detail-wrap {
display: flex; display: flex;
justify-content: space-between;
.search-detail-title { .search-detail-title {
width: 120px; width: 120px;
@@ -208,11 +220,12 @@
} }
.inputSearch { .inputSearch {
width: 400px; width: 608px;
} }
.input-group { .input-group {
width: 488px; width: 608px;
display: inline-block;
} }
</style> </style>
<style> <style>
@@ -250,7 +263,20 @@
line-height: 40px; line-height: 40px;
display: inline-block; display: inline-block;
margin-left: 8px; margin-left: 8px;
color: #21c9cc; /*color: #21c9cc;*/
cursor: pointer; cursor: pointer;
height: 40px;
} }
.textSearch .ant-btn {
height: 40px;
}
.search-header-left .ant-tabs-nav-wrap {
display: flex;
justify-content: center;
}
</style>
<style>
</style> </style>
@@ -29,6 +29,10 @@
<a-icon type="container"/> <a-icon type="container"/>
任务参数收集 任务参数收集
</div> </div>
<div class="Virtual-detail-left-text" @click="textClick(4,'未符合项')">
<a-icon type="container"/>
未符合项
</div>
</div> </div>
<div class="Virtual-detail-right"> <div class="Virtual-detail-right">
<ProjectDetailsName v-if="textTitle === '项目详情'"/> <ProjectDetailsName v-if="textTitle === '项目详情'"/>
@@ -63,12 +63,12 @@
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('StudioEngineer')">{{$t('StudioEngineer')}}</span> <span class="title-text-text" :title="$t('StudioEngineer')">{{$t('StudioEngineer')}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="'StudioEngineer'"> <a-form-model-item class="itemModel" :prop="'studioEngineerName'">
<PersonnelSelection :query="{db_field_name:'studioEngineer',db_field_txt:$t('StudioEngineer')}" <PersonnelSelection :query="{db_field_name:'studioEngineer',db_field_txt:$t('StudioEngineer')}"
:personneQuery="formInline" :personneQuery="formInline"
@change="PersonnelSelectionChange" @change="PersonnelSelectionChange"
:disabled="disabled" :disabled="disabled"
v-model="formInline.studioEngineer"/> v-model="formInline.studioEngineerName"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -79,13 +79,13 @@
<div class="title-text"> <div class="title-text">
<span class="title-text-text" :title="$t('certifiedEngineer')">{{$t('certifiedEngineer')}}</span> <span class="title-text-text" :title="$t('certifiedEngineer')">{{$t('certifiedEngineer')}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="'certificationEngineer'"> <a-form-model-item class="itemModel" :prop="'certificationEngineerName'">
<PersonnelSelection <PersonnelSelection
:query="{db_field_name:'certificationEngineer',db_field_txt:$t('certifiedEngineer')}" :query="{db_field_name:'certificationEngineer',db_field_txt:$t('certifiedEngineer')}"
:personneQuery="formInline" :personneQuery="formInline"
@change="PersonnelSelectionChange" @change="PersonnelSelectionChange"
:disabled="disabled" :disabled="disabled"
v-model="formInline.certificationEngineer"/> v-model="formInline.certificationEngineerName"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -245,7 +245,7 @@
}) })
}, },
PersonnelSelectionChange(value, id) { PersonnelSelectionChange(value, id) {
this.formInline[value + '_id'] = id this.formInline[value] = id
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
} }
} }
@@ -25,7 +25,7 @@
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text" :title="$t('subtitle')"> <div class="title-text" style="width: 44px" :title="$t('subtitle')">
<span>{{$t('subtitle')}}</span> <span>{{$t('subtitle')}}</span>
</div> </div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('subtitle')" <a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('subtitle')"
@@ -41,13 +41,25 @@
</a-row> </a-row>
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div style="float: left;margin-bottom: 19px"> <div style="float: left;margin-bottom: 19px;margin-left: 20px">
<a-icon type="solution" title="发起清单确认" class="operator-text-left"/> <div class="operator-text">
<a-icon type="file-protect" title="发起任务确认" class="operator-text-left"/> <a-icon type="solution"/>
<a-icon type="file-search" title="变更" class="operator-text-left"/> {{$t('initiateListConfirmation')}}
<a-icon type="bulb" title="定板" class="operator-text-left"/> </div>
<div class="operator-text">
<a-icon type="file-protect"/>
{{$t('initiateTaskConfirmation')}}
</div>
<div class="operator-text">
<a-icon type="file-search"/>
{{$t('alteration')}}
</div>
<div class="operator-text">
<a-icon type="bulb"/>
{{$t('fixedPlate')}}
</div>
</div> </div>
<div style="float: right;margin-top: 4px"> <div style="float: right;margin-top: 1px">
<div class="operator-text" v-has="'document:importZip'"> <div class="operator-text" v-has="'document:importZip'">
<ImportFile :url="url"/> <ImportFile :url="url"/>
</div> </div>
@@ -95,8 +107,8 @@
</span> </span>
</a-table> </a-table>
</div> </div>
<listAddModel ref="addModelRef"/> <listAddModel :url="url" ref="addModelRef"/>
<listEditModel ref="editModelRef"/> <listEditModel :url="url" ref="editModelRef"/>
</a-card> </a-card>
</template> </template>
@@ -104,6 +116,7 @@
import ImportFile from '@/components/ImportFile/index' import ImportFile from '@/components/ImportFile/index'
import listAddModel from './listAddModel' import listAddModel from './listAddModel'
import listEditModel from './listEditModel' import listEditModel from './listEditModel'
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
export default { export default {
name: 'listOfRegulations', name: 'listOfRegulations',
@@ -118,14 +131,17 @@
{ {
title: 'WVTA ID', title: 'WVTA ID',
align: 'center', align: 'center',
dataIndex: 'WVTAID', dataIndex: 'wvtaId',
width: 100, width: 100,
ellipsis: true,
fixed: 'left' fixed: 'left'
}, },
{ {
title: this.$t('standard'), title: this.$t('standard'),
align: 'center', align: 'center',
dataIndex: 'standard', dataIndex: 'serialNumber',
width: 180,
ellipsis: true,
fixed: 'left' fixed: 'left'
}, },
{ {
@@ -133,6 +149,7 @@
align: 'center', align: 'center',
dataIndex: 'title', dataIndex: 'title',
width: 100, width: 100,
ellipsis: true,
fixed: 'left' fixed: 'left'
}, },
{ {
@@ -140,84 +157,102 @@
align: 'center', align: 'center',
dataIndex: 'subtitle', dataIndex: 'subtitle',
width: 100, width: 100,
ellipsis: true,
fixed: 'left' fixed: 'left'
}, },
{ // {
title: this.$t('taskReleaseStatus'), // title: this.$t('taskReleaseStatus'),
align: 'center', // align: 'center',
dataIndex: 'taskReleaseStatus' // dataIndex: 'taskReleaseStatus'
}, // },
{ {
title: this.$t('correspondingStandard'), title: this.$t('correspondingStandard'),
align: 'center', align: 'center',
ellipsis: true,
dataIndex: 'correspondingStandard' dataIndex: 'correspondingStandard'
}, },
{ {
title: this.$t('implementationCategory'), title: this.$t('implementationCategory'),
align: 'center', align: 'center',
dataIndex: 'implementationCategory' ellipsis: true,
dataIndex: 'implementType'
}, },
{ {
title: this.$t('ImplementationDate'), title: this.$t('ImplementationDate'),
align: 'center', align: 'center',
dataIndex: 'ImplementationDate' ellipsis: true,
dataIndex: 'xin1Che1Xing2Shi2Shi1Ri4Qi1'
}, },
{ {
title: this.$t('vehicleInProductionDate'), title: this.$t('vehicleInProductionDate'),
align: 'center', align: 'center',
dataIndex: 'vehicleInProductionDate' ellipsis: true,
dataIndex: 'implementTime'
}, },
{ {
title: this.$t('certificationType'), title: this.$t('certificationType'),
align: 'center', align: 'center',
dataIndex: 'certificationType' ellipsis: true,
dataIndex: 'attestationType_dictText'
}, },
{ {
title: this.$t('certificationLevel'), title: this.$t('certificationLevel'),
align: 'center', align: 'center',
dataIndex: 'certificationLevel' ellipsis: true,
dataIndex: 'attestationRank_dictText'
}, },
//
{ {
title: this.$t('areaOfResponsibility'), title: this.$t('areaOfResponsibility'),
align: 'center', align: 'center',
dataIndex: 'areaOfResponsibility' ellipsis: true,
dataIndex: 'dutyTerritory_dictText'
}, },
{ {
title: this.$t('regulatoryEngineer'), title: this.$t('regulatoryEngineer'),
align: 'center', align: 'center',
dataIndex: 'regulatoryEngineer' ellipsis: true,
dataIndex: 'regulationOwnerName'
},
{
title: this.$t('certifiedEngineer'),
align: 'center',
ellipsis: true,
dataIndex: 'homologationEngineerName'
}, },
{ {
title: this.$t('engineeringInterfacePerson'), title: this.$t('engineeringInterfacePerson'),
align: 'center', align: 'center',
dataIndex: 'engineeringInterfacePerson' ellipsis: true,
dataIndex: 'engineeringInterfacePersonName'
}, },
{ {
title: this.$t('remarks'), title: this.$t('remarks'),
align: 'center', align: 'center',
dataIndex: 'remarks' ellipsis: true,
dataIndex: 'remark'
}, },
{ {
title: this.$t('confirmationOfDesignConformity'), title: this.$t('confirmationOfDesignConformity'),
children: [ children: [
{ {
title: this.$t('task'), title: this.$t('Deliverables'),
dataIndex: 'task', dataIndex: 'designDeliverableTemplate',
align: 'center' align: 'center'
}, },
{ {
title: this.$t('Sponsor'), title: this.$t('Sponsor'),
dataIndex: 'Sponsor', dataIndex: 'designInitiator',
align: 'center' align: 'center'
}, },
{ {
title: this.$t('personLiable'), title: this.$t('personLiable'),
dataIndex: 'personLiable', dataIndex: 'designDuty',
align: 'center' align: 'center'
}, },
{ {
title: this.$t('TaskCutOffTime'), title: this.$t('TaskCutOffTime'),
dataIndex: 'TaskCutOffTime', dataIndex: 'designDueDate',
align: 'center' align: 'center'
} }
] ]
@@ -226,23 +261,23 @@
title: this.$t('PrehomoConfirmation'), title: this.$t('PrehomoConfirmation'),
children: [ children: [
{ {
title: this.$t('task'), title: this.$t('Deliverables'),
dataIndex: 'task', dataIndex: 'prehomoDeliverableTemplate',
align: 'center' align: 'center'
}, },
{ {
title: this.$t('Sponsor'), title: this.$t('Sponsor'),
dataIndex: 'Sponsor', dataIndex: 'prehomoInitiator',
align: 'center' align: 'center'
}, },
{ {
title: this.$t('personLiable'), title: this.$t('personLiable'),
dataIndex: 'personLiable', dataIndex: 'prehomoDuty',
align: 'center' align: 'center'
}, },
{ {
title: this.$t('TaskCutOffTime'), title: this.$t('TaskCutOffTime'),
dataIndex: 'TaskCutOffTime', dataIndex: 'prehomoDueDate',
align: 'center' align: 'center'
} }
] ]
@@ -251,27 +286,33 @@
title: this.$t('verificationAndConformityconfirmation'), title: this.$t('verificationAndConformityconfirmation'),
children: [ children: [
{ {
title: this.$t('task'), title: this.$t('Deliverables'),
dataIndex: 'task', dataIndex: 'verifyDeliverableTemplate',
align: 'center' align: 'center'
}, },
{ {
title: this.$t('Sponsor'), title: this.$t('Sponsor'),
dataIndex: 'Sponsor', dataIndex: 'verifyInitiator',
align: 'center' align: 'center'
}, },
{ {
title: this.$t('personLiable'), title: this.$t('personLiable'),
dataIndex: 'personLiable', dataIndex: 'verifyDuty',
align: 'center' align: 'center'
}, },
{ {
title: this.$t('TaskCutOffTime'), title: this.$t('TaskCutOffTime'),
dataIndex: 'TaskCutOffTime', dataIndex: 'verifyDueDate',
align: 'center' align: 'center'
} }
] ]
}, },
{
title: this.$t('taskAffirmStatus'),
align: 'center',
ellipsis: true,
dataIndex: 'taskAffirmStatusName'
},
{ {
title: this.$t('operation'), title: this.$t('operation'),
align: 'center', align: 'center',
@@ -282,12 +323,19 @@
], ],
selectedRowKeys: [], selectedRowKeys: [],
queryParam: {}, queryParam: {},
url: {}, url: {
list: '/project/projectLawsInventoryEO/list',
add: 'project/projectLawsInventoryEO/add',
edit: '/project/projectLawsInventoryEO/edit',
deleteBatch: '/project/projectLawsInventoryEO/deleteBatch',
deleteOne: '/project/projectLawsInventoryEO/delete'
},
loading: false, loading: false,
dataSource: [] dataSource: []
} }
}, },
mounted() { mounted() {
this.getList()
}, },
methods: { methods: {
handleModule() { handleModule() {
@@ -306,22 +354,70 @@
this.$refs.addModelRef.addModel() this.$refs.addModelRef.addModel()
}, },
handleDel() { handleDel() {
this.$refs.editModelRef.editModel() if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
}, },
edit() { edit(item) {
this.$refs.editModelRef.editModel(JSON.parse(JSON.stringify(item)))
}, },
deleteLib() { deleteLib(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
deleteAction(_this.url.deleteOne, { id: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
}, },
onSelectChange() { onSelectChange(value) {
this.selectedRowKeys = value
}, },
searchQuery() { searchQuery() {
this.getList()
}, },
searchReset() { searchReset() {
this.queryParam = {}
this.getList()
},
getList() {
let query = {
...this.queryParam,
projectLibraryId: this.$route.query.id
}
this.loading = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
this.dataSource = res.result
this.loading = false
} else {
this.loading = false
}
})
} }
} }
} }
@@ -398,15 +494,14 @@
} }
.title-text { .title-text {
width: 20%; width: 32px;
min-width: 110px;
color: #000F16; color: #000F16;
display: inline-block; display: inline-block;
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
margin-right: 16px; margin-right: 16px;
margin-top: 3px; margin-top: 3px;
text-align: right; text-align: left;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@@ -115,6 +115,7 @@
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="edit(record)">{{$t('edit')}}</a> <a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation" @click="deleteLib(record)">{{$t('deleteLib')}}</a> <a class="text-operation" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
<a class="text-operation" @click="entryNameClick(record)">{{$t('see')}}</a>
</span> </span>
</a-table> </a-table>
</div> </div>
@@ -7,170 +7,179 @@
:confirmLoading="confirmLoading"> :confirmLoading="confirmLoading">
<div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form :form="form"> <a-form :form="form">
<a-form-item :label="$t('MenuType')" :labelCol="labelCol" :wrapperCol="wrapperCol" > <a-form-item :label="$t('MenuType')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group @change="onChangeMenuType" v-decorator="['menuType',{'initialValue':localMenuType}]"> <a-radio-group @change="onChangeMenuType" v-decorator="['menuType',{'initialValue':localMenuType}]">
<a-radio :value="0">{{$t('FirstLevelMenu')}}</a-radio> <a-radio :value="0">{{$t('FirstLevelMenu')}}</a-radio>
<a-radio :value="1">{{$t('Submenu')}}</a-radio> <a-radio :value="1">{{$t('Submenu')}}</a-radio>
<a-radio :value="2">{{$t('ButtonsPermissions')}}</a-radio> <a-radio :value="2">{{$t('ButtonsPermissions')}}</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="menuLabel" :label="menuLabel"
hasFeedback > hasFeedback>
<a-input :placeholder="$t('enterMenuName')" v-decorator="[ 'name', validatorRules.name]" :readOnly="disableSubmit"/> <a-input :placeholder="$t('enterMenuName')" v-decorator="[ 'name', validatorRules.name]"
</a-form-item> :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('MenuEnName')" :label="$t('MenuEnName')"
hasFeedback > hasFeedback>
<a-input :placeholder="$t('enterMenuEnName')" v-decorator="[ 'menuEn', validatorRules.menuEn]" :readOnly="disableSubmit"/> <a-input :placeholder="$t('enterMenuEnName')" v-decorator="[ 'menuEn', validatorRules.menuEn]"
</a-form-item> :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
v-show="localMenuType!=0" v-show="localMenuType!=0"
:label="$t('SuperiorMenu')" :label="$t('SuperiorMenu')"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:validate-status="validateStatus" :validate-status="validateStatus"
:hasFeedback="true" :hasFeedback="true"
:required="true"> :required="true">
<span slot="help">{{ validateStatus=='error'? $t('selectSuperiorMenu'):'&nbsp;&nbsp;' }}</span> <span slot="help">{{ validateStatus=='error'? $t('selectSuperiorMenu'):'&nbsp;&nbsp;' }}</span>
<a-tree-select <a-tree-select
style="width:100%" style="width:100%"
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }" :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
:treeData="treeData" :treeData="treeData"
v-model="model.parentId" v-model="model.parentId"
:placeholder="$t('selectParentMenu')" :placeholder="$t('selectParentMenu')"
:disabled="disableSubmit" :disabled="disableSubmit"
@change="handleParentIdChange"> @change="handleParentIdChange">
</a-tree-select> </a-tree-select>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('MenuPath')"> :label="$t('MenuPath')">
<a-input :placeholder="$t('enterMenuPath')" v-decorator="[ 'url',validatorRules.url]" :readOnly="disableSubmit"/> <a-input :placeholder="$t('enterMenuPath')" v-decorator="[ 'url',validatorRules.url]"
</a-form-item> :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('FrontAssembly')"> :label="$t('FrontAssembly')">
<a-input :placeholder="$t('enterFrontComponents')" v-decorator="[ 'component',validatorRules.component]" :readOnly="disableSubmit"/> <a-input :placeholder="$t('enterFrontComponents')" v-decorator="[ 'component',validatorRules.component]"
</a-form-item> :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
v-show="localMenuType==0" v-show="localMenuType==0"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('DefaultJumpAddress')"> :label="$t('DefaultJumpAddress')">
<a-input :placeholder="$t('enterRoutingParameters')+' redirect'" v-decorator="[ 'redirect',{}]" :readOnly="disableSubmit"/> <a-input :placeholder="$t('enterRoutingParameters')+' redirect'" v-decorator="[ 'redirect',{}]"
</a-form-item> :readOnly="disableSubmit"/>
</a-form-item>
<!-- v-show="!show"-->
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:label="$t('AuthorizationID')">
<a-input :placeholder="$t('enterAuthorizationID')+' user:list'"
v-decorator="[ 'perms', {rules:[{ required: false, message: $t('PleaseEnterAuthorizationID') },{validator: this.validatePerms }]}]"
:readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
v-show="!show" v-show="!show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('AuthorizationID')"> :label="$t('AuthorizationPolicy')">
<a-input :placeholder="$t('enterAuthorizationID')+' user:list'" v-decorator="[ 'perms', {rules:[{ required: false, message: $t('PleaseEnterAuthorizationID') },{validator: this.validatePerms }]}]" :readOnly="disableSubmit"/> <j-dict-select-tag v-decorator="['permsType', {}]" :placeholder="$t('selectAuthorizationPolicy')"
</a-form-item> :type="'radio'" :triggerChange="true" dictCode="global_perms_type"/>
<a-form-item
v-show="!show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:label="$t('AuthorizationPolicy')">
<j-dict-select-tag v-decorator="['permsType', {}]" :placeholder="$t('selectAuthorizationPolicy')" :type="'radio'" :triggerChange="true" dictCode="global_perms_type"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="!show" v-show="!show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('status')"> :label="$t('status')">
<j-dict-select-tag v-decorator="['status', {}]" :placeholder="$t('selectStatus')" :type="'radio'" :triggerChange="true" dictCode="valid_status"/> <j-dict-select-tag v-decorator="['status', {}]" :placeholder="$t('selectStatus')" :type="'radio'"
:triggerChange="true" dictCode="valid_status"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('MenuIcon')"> :label="$t('MenuIcon')">
<a-input :placeholder="$t('ClickSelectIcon')" v-model="model.icon" :readOnly="disableSubmit"> <a-input :placeholder="$t('ClickSelectIcon')" v-model="model.icon" :readOnly="disableSubmit">
<a-icon slot="addonAfter" type="setting" @click="selectIcons" /> <a-icon slot="addonAfter" type="setting" @click="selectIcons"/>
</a-input> </a-input>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('sort')"> :label="$t('sort')">
<a-input-number :placeholder="$t('enterMenuSort')" style="width: 200px" v-decorator="[ 'sortNo',validatorRules.sortNo]" :readOnly="disableSubmit"/> <a-input-number :placeholder="$t('enterMenuSort')" style="width: 200px"
</a-form-item> v-decorator="[ 'sortNo',validatorRules.sortNo]" :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('RouteMenu')"> :label="$t('RouteMenu')">
<a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="routeSwitch"/> <a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="routeSwitch"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('HideRoute')"> :label="$t('HideRoute')">
<a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="menuHidden"/> <a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="menuHidden"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('CacheRoute')"> :label="$t('CacheRoute')">
<a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="isKeepalive"/> <a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="isKeepalive"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('AggregateRouting')"> :label="$t('AggregateRouting')">
<a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="alwaysShow"/> <a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="alwaysShow"/>
</a-form-item> </a-form-item>
<!--update_begin author:wuxianquan date:20190908 for:增加组件外链打开方式可选 --> <!--update_begin author:wuxianquan date:20190908 for:增加组件外链打开方式可选 -->
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('OpenMode')"> :label="$t('OpenMode')">
<a-switch :checkedChildren="$t('external')" :unCheckedChildren="$t('inside')" v-model="internalOrExternal"/> <a-switch :checkedChildren="$t('external')" :unCheckedChildren="$t('inside')" v-model="internalOrExternal"/>
</a-form-item> </a-form-item>
<!--update_end author:wuxianquan date:20190908 for:增加组件外链打开方式可选 --> <!--update_end author:wuxianquan date:20190908 for:增加组件外链打开方式可选 -->
</a-form> </a-form>
<!-- 选择图标 --> <!-- 选择图标 -->
<icons @choose="handleIconChoose" @close="handleIconCancel" :iconChooseVisible="iconChooseVisible"></icons> <icons @choose="handleIconChoose" @close="handleIconCancel" :iconChooseVisible="iconChooseVisible"></icons>
</a-spin> </a-spin>
<a-row :style="{textAlign:'right'}"> <a-row :style="{textAlign:'right'}">
<a-button :style="{marginRight: '8px'}" @click="handleCancel"> <a-button :style="{marginRight: '8px'}" @click="handleCancel">
{{$t('close')}} {{$t('close')}}
@@ -182,194 +191,194 @@
</template> </template>
<script> <script>
import {addPermission,editPermission,queryTreeList, duplicateCheck} from '@/api/api' import { addPermission, editPermission, queryTreeList, duplicateCheck } from '@/api/api'
import Icons from './icon/Icons' import Icons from './icon/Icons'
import pick from 'lodash.pick' import pick from 'lodash.pick'
export default { export default {
name: "PermissionModal", name: 'PermissionModal',
components: {Icons}, components: { Icons },
data () { data() {
return { return {
drawerWidth:700, drawerWidth: 700,
treeData:[], treeData: [],
treeValue: '0-0-4', treeValue: '0-0-4',
title:this.$t('operation'), title: this.$t('operation'),
visible: false, visible: false,
disableSubmit:false, disableSubmit: false,
model: {}, model: {},
localMenuType:0, localMenuType: 0,
alwaysShow:false,//表单元素-聚合路由 alwaysShow: false,//表单元素-聚合路由
menuHidden:false,//表单元素-隐藏路由 menuHidden: false,//表单元素-隐藏路由
routeSwitch:true, //是否路由菜单 routeSwitch: true, //是否路由菜单
/*update_begin author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/ /*update_begin author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/
internalOrExternal:false,//菜单打开方式 internalOrExternal: false,//菜单打开方式
/*update_end author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/ /*update_end author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/
isKeepalive:true, //是否缓存路由 isKeepalive: true, //是否缓存路由
show:true,//根据菜单类型动态显示隐藏表单元素 show: true,//根据菜单类型动态显示隐藏表单元素
menuLabel:this.$t('MenuName'), menuLabel: this.$t('MenuName'),
isRequrie:true, // 是否需要验证 isRequrie: true, // 是否需要验证
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 5 }, sm: { span: 5 }
}, },
wrapperCol: { wrapperCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 16 }, sm: { span: 16 }
}, },
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
iconChooseVisible: false, iconChooseVisible: false,
validateStatus:"" validateStatus: ''
} }
}, },
computed:{ computed: {
validatorRules:function() { validatorRules: function() {
return { return {
name:{rules: [{ required: true, message: this.$t('enterMenuTitle') }]}, name: { rules: [{ required: true, message: this.$t('enterMenuTitle') }] },
menuEn:{rules: [{ required: true, message: this.$t('enterMenuEnName') }]}, menuEn: { rules: [{ required: true, message: this.$t('enterMenuEnName') }] },
component:{rules: [{ required: this.show, message: this.$t('enterFrontComponents') }]}, component: { rules: [{ required: this.show, message: this.$t('enterFrontComponents') }] },
url:{rules: [{ required: this.show, message: this.$t('enterMenuPath') }]}, url: { rules: [{ required: this.show, message: this.$t('enterMenuPath') }] },
permsType:{rules: [{ required: true, message: this.$t('enterAuthorizationPolicy') }]}, permsType: { rules: [{ required: true, message: this.$t('enterAuthorizationPolicy') }] },
sortNo:{initialValue:1.0}, sortNo: { initialValue: 1.0 }
} }
} }
}, },
created () { created() {
this.initDictConfig(); this.initDictConfig()
}, },
methods: { methods: {
loadTree(){ loadTree() {
var that = this; var that = this
queryTreeList().then((res)=>{ queryTreeList().then((res) => {
if(res.success){ if (res.success) {
that.treeData = []; that.treeData = []
let treeList = res.result.treeList let treeList = res.result.treeList
for(let a=0;a<treeList.length;a++){ for (let a = 0; a < treeList.length; a++) {
let temp = treeList[a]; let temp = treeList[a]
temp.isLeaf = temp.leaf; temp.isLeaf = temp.leaf
that.treeData.push(temp); that.treeData.push(temp)
} }
} }
}); })
}, },
add () { add() {
// 默认值 // 默认值
this.edit({status:'1',permsType:'1',route:true}); this.edit({ status: '1', permsType: '1', route: true })
}, },
edit (record) { edit(record) {
this.resetScreenSize(); // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度 this.resetScreenSize() // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度
this.form.resetFields(); this.form.resetFields()
this.model = Object.assign({}, record); this.model = Object.assign({}, record)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
//根据菜单类型动态展示页面字段 //根据菜单类型动态展示页面字段
this.alwaysShow = !record.alwaysShow?false:true; this.alwaysShow = !record.alwaysShow ? false : true
this.menuHidden = !record.hidden?false:true; this.menuHidden = !record.hidden ? false : true
if(record.route!=null){ if (record.route != null) {
this.routeSwitch = record.route?true:false; this.routeSwitch = record.route ? true : false
} }
if(record.keepAlive!=null){ if (record.keepAlive != null) {
this.isKeepalive = record.keepAlive?true:false; this.isKeepalive = record.keepAlive ? true : false
}else{ } else {
this.isKeepalive = false; // 升级兼容 如果没有后台没有传过来或者是新建默认为false this.isKeepalive = false // 升级兼容 如果没有后台没有传过来或者是新建默认为false
} }
/*update_begin author:wuxianquan date:20190908 for:编辑初始化数据*/ /*update_begin author:wuxianquan date:20190908 for:编辑初始化数据*/
if(record.internalOrExternal!=null){ if (record.internalOrExternal != null) {
this.internalOrExternal = record.internalOrExternal?true:false; this.internalOrExternal = record.internalOrExternal ? true : false
}else{ } else {
this.internalOrExternal = false; this.internalOrExternal = false
} }
/*update_end author:wuxianquan date:20190908 for:编辑初始化数据*/ /*update_end author:wuxianquan date:20190908 for:编辑初始化数据*/
this.show = record.menuType==2?false:true; this.show = record.menuType == 2 ? false : true
this.menuLabel = record.menuType==2?this.$t('ButtonsPermissions'):this.$t('MenuName'); this.menuLabel = record.menuType == 2 ? this.$t('ButtonsPermissions') : this.$t('MenuName')
if(this.model.parentId){ if (this.model.parentId) {
this.localMenuType = 1; this.localMenuType = 1
}else{ } else {
this.localMenuType = 0; this.localMenuType = 0
} }
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
this.visible = true; this.visible = true
this.loadTree(); this.loadTree()
let fieldsVal = pick(this.model,'name','menuEn','perms','permsType','component','redirect','url','sortNo','menuType','status'); let fieldsVal = pick(this.model, 'name', 'menuEn', 'perms', 'permsType', 'component', 'redirect', 'url', 'sortNo', 'menuType', 'status')
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(fieldsVal) this.form.setFieldsValue(fieldsVal)
}); })
}, },
close () { close() {
this.$emit('close'); this.$emit('close')
this.disableSubmit = false; this.disableSubmit = false
this.visible = false; this.visible = false
}, },
handleOk () { handleOk() {
const that = this; const that = this
// 触发表单验证 // 触发表单验证
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
this.model.alwaysShow = this.alwaysShow; this.model.alwaysShow = this.alwaysShow
this.model.hidden = this.menuHidden; this.model.hidden = this.menuHidden
this.model.route = this.routeSwitch; this.model.route = this.routeSwitch
this.model.keepAlive = this.isKeepalive; this.model.keepAlive = this.isKeepalive
/*update_begin author:wuxianquan date:20190908 for:获取值*/ /*update_begin author:wuxianquan date:20190908 for:获取值*/
this.model.internalOrExternal = this.internalOrExternal; this.model.internalOrExternal = this.internalOrExternal
/*update_end author:wuxianquan date:20190908 for:获取值*/ /*update_end author:wuxianquan date:20190908 for:获取值*/
let formData = Object.assign(this.model, values); let formData = Object.assign(this.model, values)
if ((formData.menuType == 1 || formData.menuType == 2) && !formData.parentId) { if ((formData.menuType == 1 || formData.menuType == 2) && !formData.parentId) {
that.validateStatus = 'error'; that.validateStatus = 'error'
that.$message.error("请检查你填的类型以及信息是否正确"); that.$message.error('请检查你填的类型以及信息是否正确')
return; return
} else { } else {
that.validateStatus = 'success'; that.validateStatus = 'success'
} }
that.confirmLoading = true; that.confirmLoading = true
let obj; let obj
if (!this.model.id) { if (!this.model.id) {
obj = addPermission(formData); obj = addPermission(formData)
} else { } else {
obj = editPermission(formData); obj = editPermission(formData)
} }
obj.then((res) => { obj.then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message); that.$message.success(res.message)
that.$emit('ok'); that.$emit('ok')
} else { } else {
that.$message.warning(res.message); that.$message.warning(res.message)
} }
}).finally(() => { }).finally(() => {
that.confirmLoading = false; that.confirmLoading = false
that.close(); that.close()
}); })
} }
}) })
}, },
handleCancel () { handleCancel() {
this.close() this.close()
}, },
validateNumber(rule, value, callback){ validateNumber(rule, value, callback) {
if(!value || new RegExp(/^[0-9]*[1-9][0-9]*$/).test(value)){ if (!value || new RegExp(/^[0-9]*[1-9][0-9]*$/).test(value)) {
callback(); callback()
}else{ } else {
callback(this.$t('enterPositiveInteger')); callback(this.$t('enterPositiveInteger'))
} }
}, },
validatePerms(rule, value, callback){ validatePerms(rule, value, callback) {
if(value && value.length>0){ if (value && value.length > 0) {
//校验授权标识是否存在 //校验授权标识是否存在
var params = { var params = {
tableName: 'sys_permission', tableName: 'sys_permission',
fieldName: 'perms', fieldName: 'perms',
fieldVal: value, fieldVal: value,
dataId: this.model.id dataId: this.model.id
}; }
duplicateCheck(params).then((res) => { duplicateCheck(params).then((res) => {
if (res.success) { if (res.success) {
callback() callback()
@@ -377,50 +386,50 @@
callback(this.$t('AuthorizationIDExists')) callback(this.$t('AuthorizationIDExists'))
} }
}) })
}else{ } else {
callback() callback()
} }
}, },
onChangeMenuType(e) { onChangeMenuType(e) {
this.localMenuType=e.target.value this.localMenuType = e.target.value
if(e.target.value == 2){ if (e.target.value == 2) {
this.show = false; this.show = false
this.menuLabel = this.$t('ButtonsPermissions'); this.menuLabel = this.$t('ButtonsPermissions')
}else{ } else {
this.show = true; this.show = true
this.menuLabel = this.$t('MenuName'); this.menuLabel = this.$t('MenuName')
} }
this.$nextTick(() => { this.$nextTick(() => {
this.form.validateFields(['url','component'], { force: true }); this.form.validateFields(['url', 'component'], { force: true })
}); })
}, },
selectIcons(){ selectIcons() {
this.iconChooseVisible = true this.iconChooseVisible = true
}, },
handleIconCancel () { handleIconCancel() {
this.iconChooseVisible = false this.iconChooseVisible = false
}, },
handleIconChoose (value) { handleIconChoose(value) {
this.model.icon = value this.model.icon = value
this.form.icon = value this.form.icon = value
this.iconChooseVisible = false this.iconChooseVisible = false
}, },
// 根据屏幕变化,设置抽屉尺寸 // 根据屏幕变化,设置抽屉尺寸
resetScreenSize(){ resetScreenSize() {
let screenWidth = document.body.clientWidth; let screenWidth = document.body.clientWidth
if(screenWidth < 500){ if (screenWidth < 500) {
this.drawerWidth = screenWidth; this.drawerWidth = screenWidth
}else{ } else {
this.drawerWidth = 700; this.drawerWidth = 700
} }
}, },
initDictConfig() { initDictConfig() {
}, },
handleParentIdChange(value){ handleParentIdChange(value) {
if(!value){ if (!value) {
this.validateStatus="error" this.validateStatus = 'error'
}else{ } else {
this.validateStatus="success" this.validateStatus = 'success'
} }
} }
} }