Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangzhijiang
2022-03-09 16:56:20 +08:00
44 changed files with 2954 additions and 1321 deletions
@@ -80,7 +80,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
fileType = orgName.substring(orgName.lastIndexOf(".")); fileType = orgName.substring(orgName.lastIndexOf("."));
//判断文件类型 //判断文件类型
if (StringUtils.isNotEmpty(fileType)) { if (StringUtils.isNotEmpty(fileType)) {
String[] fileTypeArr = {".doc", ".docx", ".xls", ".xlsx", ".pdf", ".png", ".jfif", ".pjpeg", ".jpeg", ".pjp", ".jpg", ".swf", ".bmp",".rar",".zip"}; String[] fileTypeArr = {".doc",".DOC","txt","TXT", ".docx",".DOCX", ".xls", ".XLS",".xlsx",".XLSX", ".pdf",".PDF", ".png",".PNG", ".jfif",".JFIF", ".pjpeg",".PJPEG", ".jpeg",".JPEG", ".pjp",".PJP", ".jpg",".JPG", ".swf",".SWF", ".bmp",".BMP",".rar",".RAR",".zip",".ZIP"};
boolean flag = true; boolean flag = true;
for (String fileTypeTemp : fileTypeArr) { for (String fileTypeTemp : fileTypeArr) {
if (fileTypeTemp.equalsIgnoreCase(fileType)) { if (fileTypeTemp.equalsIgnoreCase(fileType)) {
@@ -101,6 +101,7 @@ public class SysCategoryController {
@AutoLog(value = "标签内容-树形结构-通过sysDictId查询") @AutoLog(value = "标签内容-树形结构-通过sysDictId查询")
@ApiOperation(value="标签内容-树形结构-通过sysDictId查询", notes="标签内容-树形结构-通过sysDictId查询") @ApiOperation(value="标签内容-树形结构-通过sysDictId查询", notes="标签内容-树形结构-通过sysDictId查询")
@GetMapping(value = "/queryBySysDictId") @GetMapping(value = "/queryBySysDictId")
// @RequiresPermissions("sys:category:queryBySysDictId")
public Result<?> queryBySysDictId(@RequestParam(name="id",required=true) String sysDictId) { public Result<?> queryBySysDictId(@RequestParam(name="id",required=true) String sysDictId) {
List<SysCategory> sysCategory = sysCategoryService.queryBySysDictId(sysDictId); List<SysCategory> sysCategory = sysCategoryService.queryBySysDictId(sysDictId);
if(sysCategory==null) { if(sysCategory==null) {
@@ -365,26 +365,32 @@ public class SysDictController {
@ApiOperation(value = "字典控制器-新增字典", notes = "字典控制器-新增字典") @ApiOperation(value = "字典控制器-新增字典", notes = "字典控制器-新增字典")
@RequiresRoles({"admin"}) @RequiresRoles({"admin"})
@RequestMapping(value = "/add", method = RequestMethod.POST) @RequestMapping(value = "/add", method = RequestMethod.POST)
//@RequiresPermissions("dict:add")
public Result<SysDict> add(@RequestBody SysDict sysDict) { public Result<SysDict> add(@RequestBody SysDict sysDict) {
Result<SysDict> result = new Result<SysDict>(); Result<SysDict> result = new Result<SysDict>();
try { try {
Integer count = sysDictService.queryExitData(sysDict); Integer count = sysDictService.queryExitData(sysDict);
Integer countDictName=sysDictService.queryExitDictName(sysDict);
System.out.println("count="+count); System.out.println("count="+count);
if (countDictName > 0) {
if (count > 0) { result.error500("标签名称不能重复");
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0); }else{
} else { //判断逻辑删除
if(sysDict.getIsTagDict() == 1){ if (count > 0) {
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(sysDict.getDictName()); sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
sysDict.setDictCode(pinYin); } else {
if(sysDict.getIsTagDict() == 1){
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(sysDict.getDictName());
sysDict.setDictCode(pinYin.replace(" ","_"));
}
sysDict.setCreateTime(new Date());
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
sysDictService.save(sysDict);
} }
sysDict.setCreateTime(new Date()); result.success("保存成功!");
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0); //添加成功后需要刷新缓存
sysDictService.save(sysDict); sysDictService.refreshCache();
} }
result.success("保存成功!");
//添加成功后需要刷新缓存
sysDictService.refreshCache();
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
result.error500("操作失败"); result.error500("操作失败");
@@ -400,6 +406,7 @@ public class SysDictController {
@ApiOperation(value = "字典控制器-编辑字典", notes = "字典控制器-编辑字典") @ApiOperation(value = "字典控制器-编辑字典", notes = "字典控制器-编辑字典")
@RequiresRoles({"admin"}) @RequiresRoles({"admin"})
@RequestMapping(value = "/edit", method = RequestMethod.PUT) @RequestMapping(value = "/edit", method = RequestMethod.PUT)
//@RequiresPermissions("dict:edit")
public Result<SysDict> edit(@RequestBody SysDict sysDict) { public Result<SysDict> edit(@RequestBody SysDict sysDict) {
Result<SysDict> result = new Result<SysDict>(); Result<SysDict> result = new Result<SysDict>();
SysDict sysdict = sysDictService.getById(sysDict.getId()); SysDict sysdict = sysDictService.getById(sysDict.getId());
@@ -460,6 +467,7 @@ public class SysDictController {
@RequiresRoles({"admin"}) @RequiresRoles({"admin"})
@DeleteMapping(value = "/logicDelete") @DeleteMapping(value = "/logicDelete")
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true) @CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
//@RequiresPermissions("dict:logicDelete")
public Result<SysDict> logicDelete(@RequestParam(name="id",required=true) String id) { public Result<SysDict> logicDelete(@RequestParam(name="id",required=true) String id) {
Result<SysDict> result = new Result<SysDict>(); Result<SysDict> result = new Result<SysDict>();
@@ -493,9 +501,9 @@ public class SysDictController {
}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(sysDict.getIsReadOnly())) {
result.error500("固定字段,不可删除"); result.error500("包含固定字段,不可删除");
} else { } else {
sysDictService.removeByIds(Arrays.asList(ids.split(","))); sysDict.setDelFlag(CommonConstant.DEL_FLAG_1);
result.success("删除成功!"); result.success("删除成功!");
} }
} }
@@ -161,6 +161,5 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
"from sys_dict as d\n" + "from sys_dict as d\n" +
"left join sys_dict_item as i on d.attribute_type=i.item_value\n" + "left join sys_dict_item as i on d.attribute_type=i.item_value\n" +
"where i.dict_id=\"1494570247913512962\"") "where i.dict_id=\"1494570247913512962\"")
//IPage<Map<String,Object>> selectPageInfo(Page page, Wrapper<SysDict> queryWrapper);
IPage<SysDict> queryPageList(IPage page,@Param("params") Map<String,Object> params); IPage<SysDict> queryPageList(IPage page,@Param("params") Map<String,Object> params);
} }
@@ -1,8 +1,6 @@
package com.jero.modules.system.service; package com.jero.modules.system.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.system.vo.DictModel; import com.jero.common.system.vo.DictModel;
import com.jero.common.system.vo.DictQuery; import com.jero.common.system.vo.DictQuery;
@@ -162,7 +160,7 @@ public interface ISysDictService extends IService<SysDict> {
*/ */
Integer queryExitData(SysDict sysDict); Integer queryExitData(SysDict sysDict);
//List<Map<String, Object>> selectPageInfo(Page page, Wrapper<SysDict> queryWrapper); Integer queryExitDictName(SysDict sysDict);
IPage<SysDict> queryPageList(Map<String, Object> params); IPage<SysDict> queryPageList(Map<String, Object> params);
} }
@@ -382,13 +382,15 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
Integer count = sysDictMapper.selectCount(queryWrapper); Integer count = sysDictMapper.selectCount(queryWrapper);
return count; return count;
} }
@Override
/*@Override public Integer queryExitDictName(SysDict sysDict) {
public List<Map<String, Object>> selectPageInfo(Page page, Wrapper<SysDict> queryWrapper) { LambdaQueryWrapper<SysDict> queryWrapper = new LambdaQueryWrapper<>();
IPage<Map<String, Object>> info= sysDictMapper.selectPageInfo(page, queryWrapper); if (StringUtils.isNotBlank(sysDict.getDictName())) {
List<Map<String, Object>> list = info.getRecords().stream().collect(Collectors.toList()); queryWrapper.eq(SysDict::getDictName, sysDict.getDictName());
return list; }
}*/ Integer count = sysDictMapper.selectCount(queryWrapper);
return count;
}
/** /**
* 标签内容-分页查询 * 标签内容-分页查询
@@ -1,30 +1,26 @@
package com.jero.modules.document.controller; package com.jero.modules.document.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.document.entity.BussDocumentLibraryEO; import com.jero.modules.document.entity.BussDocumentLibraryEO;
import com.jero.modules.document.service.IBussDocumentLibraryEOService; import com.jero.modules.document.service.IBussDocumentLibraryEOService;
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 net.sf.json.JSONObject; import net.sf.json.JSONObject;
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.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
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;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@@ -47,27 +43,6 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@Autowired @Autowired
private IBussDocumentLibraryEOService bussDocumentLibraryEOService; private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
/**
* 分页列表查询
*
* @param bussDocumentLibraryEO
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "文档库信息表-分页列表查询")
@ApiOperation(value="文档库信息表-分页列表查询", notes="文档库信息表-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(BussDocumentLibraryEO bussDocumentLibraryEO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<BussDocumentLibraryEO> queryWrapper = QueryGenerator.initQueryWrapper(bussDocumentLibraryEO, req.getParameterMap());
Page<BussDocumentLibraryEO> page = new Page<BussDocumentLibraryEO>(pageNo, pageSize);
IPage<BussDocumentLibraryEO> pageList = bussDocumentLibraryEOService.page(page, queryWrapper);
return Result.OK(pageList);
}
/** /**
* 分页列表查询 * 分页列表查询
@@ -78,6 +53,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value="分页查询", notes="分页查询") @ApiOperation(value="分页查询", notes="分页查询")
@PostMapping(value = "/queryPageInfo") @PostMapping(value = "/queryPageInfo")
@ResponseBody @ResponseBody
// @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);
@@ -94,6 +70,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value="代替标准分页列表查询", notes="代替标准分页列表查询") @ApiOperation(value="代替标准分页列表查询", notes="代替标准分页列表查询")
@PostMapping(value = "/replacePageInfo") @PostMapping(value = "/replacePageInfo")
@ResponseBody @ResponseBody
// @RequiresPermissions("document:replacePageInfo")
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);
@@ -110,6 +87,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value="ocr识别调取已入库文件", notes="ocr识别调取已入库文件") @ApiOperation(value="ocr识别调取已入库文件", notes="ocr识别调取已入库文件")
@PostMapping(value = "/ocrPageInfo") @PostMapping(value = "/ocrPageInfo")
@ResponseBody @ResponseBody
// @RequiresPermissions("document:ocrPageInfo")
public Result<?> ocrPageInfo(@RequestBody Map<String,Object> parameter) { public Result<?> ocrPageInfo(@RequestBody Map<String,Object> parameter) {
IPage infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter); IPage infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
return Result.OK(infoPage); return Result.OK(infoPage);
@@ -138,6 +116,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-通过id删除") @AutoLog(value = "文档库信息表-通过id删除")
@ApiOperation(value="文档库信息表-通过id删除", notes="文档库信息表-通过id删除") @ApiOperation(value="文档库信息表-通过id删除", notes="文档库信息表-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
@RequiresPermissions("document:deleteBatch")
public Result<?> delete(@RequestParam(name="id",required=true) String id) { public Result<?> delete(@RequestParam(name="id",required=true) String id) {
bussDocumentLibraryEOService.deleteById(id); bussDocumentLibraryEOService.deleteById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
@@ -152,6 +131,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-批量删除") @AutoLog(value = "文档库信息表-批量删除")
@ApiOperation(value="文档库信息表-批量删除", notes="文档库信息表-批量删除") @ApiOperation(value="文档库信息表-批量删除", notes="文档库信息表-批量删除")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
@RequiresPermissions("document:deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.bussDocumentLibraryEOService.deleteByIds(Arrays.asList(ids.split(","))); this.bussDocumentLibraryEOService.deleteByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
@@ -166,6 +146,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-通过id查询") @AutoLog(value = "文档库信息表-通过id查询")
@ApiOperation(value="文档库信息表-通过id查询", notes="文档库信息表-通过id查询") @ApiOperation(value="文档库信息表-通过id查询", notes="文档库信息表-通过id查询")
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
// @RequiresPermissions("document:queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(id); BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(id);
if(bussDocumentLibraryEO==null) { if(bussDocumentLibraryEO==null) {
@@ -174,28 +155,6 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
return Result.OK(bussDocumentLibraryEO); return Result.OK(bussDocumentLibraryEO);
} }
/**
* 导出excel
*
* @param request
* @param bussDocumentLibraryEO
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, BussDocumentLibraryEO bussDocumentLibraryEO) {
return super.exportXls(request, bussDocumentLibraryEO, BussDocumentLibraryEO.class, "文档库信息表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, BussDocumentLibraryEO.class);
}
/** /**
@@ -206,6 +165,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")
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); List<Map<String,Object>> list = bussDocumentLibraryEOService.queryCondition(flag,cut);
@@ -220,6 +180,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")
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); List<Map<String,Object>> list = bussDocumentLibraryEOService.getHeader(flag,cut);
@@ -234,6 +195,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")
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) {
@@ -249,6 +211,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-ocr表头和查询条件") @AutoLog(value = "文档库信息表-ocr表头和查询条件")
@ApiOperation(value="文档库信息表-ocr表头和查询条件", notes="文档库信息表-ocr表头和查询条件") @ApiOperation(value="文档库信息表-ocr表头和查询条件", notes="文档库信息表-ocr表头和查询条件")
@GetMapping(value = "/getHeaderOrConditionForOcr") @GetMapping(value = "/getHeaderOrConditionForOcr")
// @RequiresPermissions("document:getHeaderOrConditionForOcr")
public Result<List<Map<String,Object>>> getHeaderOrConditionForOcr(@RequestParam(name="flag",required=true) String flag, public Result<List<Map<String,Object>>> getHeaderOrConditionForOcr(@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.getHeaderOrConditionForOcr(flag,cut); List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForOcr(flag,cut);
@@ -263,6 +226,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")
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);
@@ -276,6 +240,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")
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);
@@ -290,7 +255,8 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "新增数据") @AutoLog(value = "新增数据")
@ApiOperation(value="新增数据", notes="新增数据") @ApiOperation(value="新增数据", notes="新增数据")
@PostMapping(value = "/addInfo") @PostMapping(value = "/addInfo")
public Result<?> addInfo(@RequestBody Map<String,Object> map) { @RequiresPermissions("document:getInfoById")
public Result<?> getInfoById(@RequestBody Map<String,Object> map) {
try { try {
bussDocumentLibraryEOService.addInfo(map); bussDocumentLibraryEOService.addInfo(map);
} catch (Exception e) { } catch (Exception e) {
@@ -307,6 +273,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "编辑数据") @AutoLog(value = "编辑数据")
@ApiOperation(value="编辑数据", notes="编辑数据") @ApiOperation(value="编辑数据", notes="编辑数据")
@PostMapping(value = "/updateInfo") @PostMapping(value = "/updateInfo")
@RequiresPermissions("document:updateInfo")
public Result<?> updateInfo(@RequestBody Map<String,Object> map) { public Result<?> updateInfo(@RequestBody Map<String,Object> map) {
try { try {
bussDocumentLibraryEOService.updateInfo(map); bussDocumentLibraryEOService.updateInfo(map);
@@ -325,6 +292,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "添加收藏") @AutoLog(value = "添加收藏")
@ApiOperation(value="添加收藏", notes="添加收藏") @ApiOperation(value="添加收藏", notes="添加收藏")
@GetMapping(value = "/addCollect") @GetMapping(value = "/addCollect")
@RequiresPermissions("document:addCollect")
public Result<?> addCollect(String id) { public Result<?> addCollect(String id) {
try { try {
bussDocumentLibraryEOService.addCollect(id); bussDocumentLibraryEOService.addCollect(id);
@@ -342,6 +310,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "取消收藏") @AutoLog(value = "取消收藏")
@ApiOperation(value="取消收藏", notes="取消收藏") @ApiOperation(value="取消收藏", notes="取消收藏")
@GetMapping(value = "/cancelCollect") @GetMapping(value = "/cancelCollect")
@RequiresPermissions("document:addCollect")
public Result<?> cancelCollect(String id) { public Result<?> cancelCollect(String id) {
try { try {
bussDocumentLibraryEOService.cancelCollect(id); bussDocumentLibraryEOService.cancelCollect(id);
@@ -359,6 +328,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "添加订阅") @AutoLog(value = "添加订阅")
@ApiOperation(value="添加订阅", notes="添加订阅") @ApiOperation(value="添加订阅", notes="添加订阅")
@GetMapping(value = "/addSubscribe") @GetMapping(value = "/addSubscribe")
@RequiresPermissions("document:addSubscribe")
public Result<?> addSubscribe(String id) { public Result<?> addSubscribe(String id) {
try { try {
bussDocumentLibraryEOService.addSubscribe(id); bussDocumentLibraryEOService.addSubscribe(id);
@@ -376,6 +346,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "取消订阅") @AutoLog(value = "取消订阅")
@ApiOperation(value="取消订阅", notes="取消订阅") @ApiOperation(value="取消订阅", notes="取消订阅")
@GetMapping(value = "/cancelSubscribe") @GetMapping(value = "/cancelSubscribe")
@RequiresPermissions("document:addSubscribe")
public Result<?> cancelSubscribe(String id) { public Result<?> cancelSubscribe(String id) {
try { try {
bussDocumentLibraryEOService.cancelSubscribe(id); bussDocumentLibraryEOService.cancelSubscribe(id);
@@ -388,6 +359,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value = "导出excel") @ApiOperation(value = "导出excel")
@GetMapping(value = "/exportExcel") @GetMapping(value = "/exportExcel")
@RequiresPermissions("document:exportExcel")
public void exportExcel(@RequestParam Map<String,Object> map, public void exportExcel(@RequestParam Map<String,Object> map,
HttpServletResponse response, HttpServletResponse response,
HttpServletRequest request){ HttpServletRequest request){
@@ -396,6 +368,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value = "带文件导出") @ApiOperation(value = "带文件导出")
@GetMapping(value = "/exportZip") @GetMapping(value = "/exportZip")
@RequiresPermissions("document:exportZip")
public void exportZip(@RequestParam Map<String,Object> map, public void exportZip(@RequestParam Map<String,Object> map,
HttpServletResponse response, HttpServletResponse response,
HttpServletRequest request) throws Exception { HttpServletRequest request) throws Exception {
@@ -405,6 +378,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value = "模板下载") @ApiOperation(value = "模板下载")
@GetMapping(value = "/exportTemplate") @GetMapping(value = "/exportTemplate")
@RequiresPermissions("document:exportTemplate")
public void exportTemplate(@RequestParam Map<String,Object> map, HttpServletResponse response, HttpServletRequest request) throws Exception { public void exportTemplate(@RequestParam Map<String,Object> map, HttpServletResponse response, HttpServletRequest request) throws Exception {
bussDocumentLibraryEOService.exportTemplate(map,response,request); bussDocumentLibraryEOService.exportTemplate(map,response,request);
} }
@@ -412,6 +386,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value = "导入.zip") @ApiOperation(value = "导入.zip")
@PostMapping(value = "/importZip") @PostMapping(value = "/importZip")
@RequiresPermissions("document:importZip")
public Result<?> importZip(@RequestParam(value = "file", required = false) MultipartFile file) throws Exception { public Result<?> importZip(@RequestParam(value = "file", required = false) MultipartFile file) throws Exception {
String result = bussDocumentLibraryEOService.importZip(file); String result = bussDocumentLibraryEOService.importZip(file);
return Result.OK(result); return Result.OK(result);
@@ -419,6 +394,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value = "推送") @ApiOperation(value = "推送")
@GetMapping(value = "/pullMessage") @GetMapping(value = "/pullMessage")
@RequiresPermissions("document:pullMessage")
public Result<?> pullMessage(String departIds,String userIds,String documentIds) { public Result<?> pullMessage(String departIds,String userIds,String documentIds) {
bussDocumentLibraryEOService.pullMessage(departIds,userIds,documentIds); bussDocumentLibraryEOService.pullMessage(departIds,userIds,documentIds);
@@ -467,7 +467,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//区域管理 //区域管理
List<OnlCgformArea> areaList = onlCgformAreaServiceImpl.queryList(new OnlCgformArea()); OnlCgformArea onlCgformArea = new OnlCgformArea();
onlCgformArea.setIsModel(ModuleEnum.DOCUMENT_LIBRARY.getValue());
List<OnlCgformArea> areaList = onlCgformAreaServiceImpl.queryList(onlCgformArea);
//字段属性 //字段属性
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1"); List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
@@ -878,9 +880,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<String> fieldFile = fieldFileList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList()); List<String> fieldFile = fieldFileList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
//下拉类型的字段 //下拉类型的字段
List<String> fieldPull = fieldPullList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList()); List<String> fieldPull = fieldPullList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
//过滤出树形字段
List<OnlCgformField> treeFieldList = fieldList.stream()
.filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
.collect(Collectors.toList());
//数据字典 //数据字典
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll(); List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
//树形数据字典
List<SysCategory> categoryList = sysCategoryService.list();
//下拉选处理数据字典 //下拉选处理数据字典
for (Map.Entry<String, Object> entry : dataList.get(0).entrySet()) { for (Map.Entry<String, Object> entry : dataList.get(0).entrySet()) {
List<OnlCgformField> collect = fieldPullList.stream() List<OnlCgformField> collect = fieldPullList.stream()
@@ -888,6 +896,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
.collect(Collectors.toList()); .collect(Collectors.toList());
//下拉选处理数据字典 //下拉选处理数据字典
dictItem(sysDictItems, entry, collect, cut); dictItem(sysDictItems, entry, collect, cut);
treeDictItem(categoryList, entry, treeFieldList, cut);
} }
for (Map.Entry<String, Object> entry : mapTemp.entrySet()) { for (Map.Entry<String, Object> entry : mapTemp.entrySet()) {
List<OnlCgformField> collect = fieldPullList.stream() List<OnlCgformField> collect = fieldPullList.stream()
@@ -895,6 +904,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
.collect(Collectors.toList()); .collect(Collectors.toList());
//下拉选处理数据字典 //下拉选处理数据字典
dictItem(sysDictItems, entry, collect, cut); dictItem(sysDictItems, entry, collect, cut);
treeDictItem(categoryList, entry, treeFieldList, cut);
} }
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@@ -1389,14 +1399,17 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//输入框 //输入框
conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%')"); conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%')");
} else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldType) } else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldType)
|| FieldTypeEnum.PULL_MORE.getValue().equals(fieldType)) { || FieldTypeEnum.PULL_MORE.getValue().equals(fieldType)
|| FieldTypeEnum.TREE.getValue().equals(fieldType)) {
StringBuilder valueSb = new StringBuilder(); StringBuilder valueSb = new StringBuilder();
StringBuilder condition = new StringBuilder();
for (String valueTemp : value.split(",")) { for (String valueTemp : value.split(",")) {
valueSb.append("'" + valueTemp + "',"); valueSb.append("'" + valueTemp + "',");
condition.append(" or " + key + " like concat(concat('%','" + valueTemp + "'),'%')");
} }
String substring = valueSb.substring(0, valueSb.length() - 1); String substring = valueSb.substring(0, valueSb.length() - 1);
//下拉单选或下拉多选 //下拉单选或下拉多选
conditionSb.append(" and " + key + " in(" + substring + ")"); conditionSb.append(" and " + key + " in(" + substring + ")" + condition.toString());
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) { } else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) {
//日期(区分单日期还时间范围) //日期(区分单日期还时间范围)
@@ -19,6 +19,7 @@ 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.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@@ -91,6 +92,7 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
@AutoLog(value = "OCR识别转换记录表-同步至文档库") @AutoLog(value = "OCR识别转换记录表-同步至文档库")
@ApiOperation(value="OCR识别转换记录表-同步至文档库", notes="OCR识别转换记录表-同步至文档库") @ApiOperation(value="OCR识别转换记录表-同步至文档库", notes="OCR识别转换记录表-同步至文档库")
@PostMapping(value = "/syncToDocument") @PostMapping(value = "/syncToDocument")
@RequiresPermissions("ocr:ocrRecord:syncToDocument")
public Result<?> syncToDocument(@RequestBody OcrRecordEO ocrRecordEO) { public Result<?> syncToDocument(@RequestBody OcrRecordEO ocrRecordEO) {
if(StringUtils.isBlank(ocrRecordEO.getConnectId())){ if(StringUtils.isBlank(ocrRecordEO.getConnectId())){
return Result.error("同步失败"); return Result.error("同步失败");
@@ -209,6 +211,7 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
@AutoLog(value = "OCR识别转换记录表-通过id删除") @AutoLog(value = "OCR识别转换记录表-通过id删除")
@ApiOperation(value="OCR识别转换记录表-通过id删除", notes="OCR识别转换记录表-通过id删除") @ApiOperation(value="OCR识别转换记录表-通过id删除", notes="OCR识别转换记录表-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
@RequiresPermissions("ocr:ocrRecord:delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) { public Result<?> delete(@RequestParam(name="id",required=true) String id) {
if (StringUtils.isBlank(id)) { if (StringUtils.isBlank(id)) {
return Result.error("删除数据不能为空"); return Result.error("删除数据不能为空");
@@ -226,6 +229,7 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
@AutoLog(value = "OCR识别转换记录表-批量删除") @AutoLog(value = "OCR识别转换记录表-批量删除")
@ApiOperation(value="OCR识别转换记录表-批量删除", notes="OCR识别转换记录表-批量删除") @ApiOperation(value="OCR识别转换记录表-批量删除", notes="OCR识别转换记录表-批量删除")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
@RequiresPermissions("ocr:ocrRecord:deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
if (StringUtils.isBlank(ids)) { if (StringUtils.isBlank(ids)) {
return Result.error("删除数据不能为空"); return Result.error("删除数据不能为空");
@@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
@@ -64,12 +65,14 @@ public class OcrRestfulController{
@ApiOperation(value = "下载word文件") @ApiOperation(value = "下载word文件")
@GetMapping("/downFile") @GetMapping("/downFile")
@RequiresPermissions("ocr:ocrRestful:downFile")
public void downFile(String fileName, HttpServletResponse response, HttpServletRequest request) throws Exception { public void downFile(String fileName, HttpServletResponse response, HttpServletRequest request) throws Exception {
InputStream is = null; InputStream is = null;
OutputStream os = null; OutputStream os = null;
response.reset(); response.reset();
try { try {
response.setHeader("Content-Disposition", "attachment; filename=" + fileName); String downFileName = fileName.substring(fileName.lastIndexOf("_") + 1);
response.setHeader("Content-Disposition", "attachment; filename=" + downFileName);
response.setContentType("application/octet-stream"); response.setContentType("application/octet-stream");
String fullPath = ocrPath + fileName; String fullPath = ocrPath + fileName;
@@ -151,6 +154,7 @@ public class OcrRestfulController{
*/ */
@ApiOperation(value = "新增OCR内容") @ApiOperation(value = "新增OCR内容")
@PostMapping("/addOcrRecord") @PostMapping("/addOcrRecord")
@RequiresPermissions("ocr:ocrRestful:addOcrRecord")
public Result<?> addOcrRecord(@RequestBody OcrRecordEO ocrRecordEO) throws Exception { public Result<?> addOcrRecord(@RequestBody OcrRecordEO ocrRecordEO) throws Exception {
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
log.info("收到文件上传请求,开始处理文件:【"+sdf.format(new Date())+""); log.info("收到文件上传请求,开始处理文件:【"+sdf.format(new Date())+"");
@@ -152,6 +152,7 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
ocrRecordEO.setStandName(getOcrEO.getStandName()); ocrRecordEO.setStandName(getOcrEO.getStandName());
ocrRecordEO.setFileType(getOcrEO.getFileType()); ocrRecordEO.setFileType(getOcrEO.getFileType());
ocrRecordEO.setConnectId(getOcrEO.getConnectId()); ocrRecordEO.setConnectId(getOcrEO.getConnectId());
ocrRecordEO.setAttId(getOcrEO.getAttId());
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// ocrRecordEO.setCreateBy(sysUser.getId()); // ocrRecordEO.setCreateBy(sysUser.getId());
// ocrRecordEO.setCreateTime(new Date()); // ocrRecordEO.setCreateTime(new Date());
@@ -168,6 +169,7 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
ocrRecordEO.setFileType(getOcrEO.getFileType()); ocrRecordEO.setFileType(getOcrEO.getFileType());
ocrRecordEO.setCreateTime(new Date()); ocrRecordEO.setCreateTime(new Date());
ocrRecordEO.setConnectId(getOcrEO.getConnectId()); ocrRecordEO.setConnectId(getOcrEO.getConnectId());
ocrRecordEO.setAttId(getOcrEO.getAttId());
ocrRecordEOService.editById(ocrRecordEO); //TODO ?? ocrRecordEOService.editById(ocrRecordEO); //TODO ??
return Result.OK( "加入转换成功", taskId); return Result.OK( "加入转换成功", taskId);
} }
@@ -48,34 +48,11 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
@AutoLog(value = "区域管理表-分页列表查询") @AutoLog(value = "区域管理表-分页列表查询")
@ApiOperation(value="区域管理表-分页列表查询", notes="区域管理表-分页列表查询") @ApiOperation(value="区域管理表-分页列表查询", notes="区域管理表-分页列表查询")
@PostMapping(value = "/page") @PostMapping(value = "/page")
//@RequiresPermissions("area:page")
public Result<?> queryPageList(@RequestBody Map<String,Object> params) { public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
IPage<OnlCgformArea> pageList=onlCgformAreaService.queryPageList(params); IPage<OnlCgformArea> pageList=onlCgformAreaService.queryPageList(params);
return Result.OK(pageList); return Result.OK(pageList);
} }
/*@GetMapping(value = "/page")
public Result<?> queryPageList(@RequestParam(name = "cut") String cut,
OnlCgformArea onlCgformArea,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OnlCgformArea> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformArea, req.getParameterMap());
Page<OnlCgformArea> page = new Page<OnlCgformArea>(pageNo, pageSize);
if(StringUtils.isNotBlank("create_time")) {
queryWrapper.orderByDesc("create_time");
}
//中英切换-所属模块列
List<Map<String, Object>> pageList = onlCgformAreaService.selectPageInfo(page, queryWrapper);
if (CutEnum.CN.getValue().equals(cut)) {
return Result.OK(pageList);
} else {
JSONArray jsonArray = new JSONArray();
jsonArray.addAll(pageList);
List<OnlCgformArea> list = jsonArray.toJavaList(OnlCgformArea.class);
list.stream().forEach(f -> f.setIsModel(f.getEnName()));
return Result.OK(list);
}
}*/
/** /**
* 列表查询 * 列表查询
@@ -111,6 +88,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
@AutoLog(value = "区域管理表-添加") @AutoLog(value = "区域管理表-添加")
@ApiOperation(value="区域管理表-添加", notes="区域管理表-添加") @ApiOperation(value="区域管理表-添加", notes="区域管理表-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
//@RequiresPermissions("area:add")
public Result<?> add(@Validated @RequestBody OnlCgformArea onlCgformArea) { public Result<?> add(@Validated @RequestBody OnlCgformArea onlCgformArea) {
onlCgformAreaService.add(onlCgformArea); onlCgformAreaService.add(onlCgformArea);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
@@ -125,6 +103,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
@AutoLog(value = "区域管理表-编辑") @AutoLog(value = "区域管理表-编辑")
@ApiOperation(value="区域管理表-编辑", notes="区域管理表-编辑") @ApiOperation(value="区域管理表-编辑", notes="区域管理表-编辑")
@PutMapping(value = "/edit") @PutMapping(value = "/edit")
//@RequiresPermissions("area:edit")
public Result<?> edit(@Validated @RequestBody OnlCgformArea onlCgformArea) { public Result<?> edit(@Validated @RequestBody OnlCgformArea onlCgformArea) {
onlCgformAreaService.editById(onlCgformArea); onlCgformAreaService.editById(onlCgformArea);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
@@ -139,6 +118,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
@AutoLog(value = "区域管理表-通过id删除") @AutoLog(value = "区域管理表-通过id删除")
@ApiOperation(value="区域管理表-通过id删除", notes="区域管理表-通过id删除") @ApiOperation(value="区域管理表-通过id删除", notes="区域管理表-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
//@RequiresPermissions("area:delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) { public Result<?> delete(@RequestParam(name="id",required=true) String id) {
OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id); OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id);
int count=onlCgformTagService.queryExitArea(onlCgformArea); int count=onlCgformTagService.queryExitArea(onlCgformArea);
@@ -3,14 +3,13 @@ package com.jero.modules.tag.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.CommonConstant;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.generater.modules.online.cgform.controller.OnlCgformApiController;
import com.jero.modules.enums.FixedFieldEnum; import com.jero.modules.enums.FixedFieldEnum;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.tag.entity.OnlCgformArea; import com.jero.modules.tag.entity.OnlCgformArea;
import com.jero.modules.tag.entity.OnlCgformTag; import com.jero.modules.tag.entity.OnlCgformTag;
import com.jero.modules.tag.service.IOnlCgformTagService; import com.jero.modules.tag.service.IOnlCgformTagService;
import com.jero.modules.utils.HanYuPinYinUtil;
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;
@@ -23,7 +22,6 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -46,6 +44,8 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
private OnlCgformTagController onlCgformAreaService; private OnlCgformTagController onlCgformAreaService;
@Autowired @Autowired
private SysDictItemServiceImpl sysDictItemService; private SysDictItemServiceImpl sysDictItemService;
@Autowired
private OnlCgformApiController onlCgformApiController;
/** /**
* 分页列表查询 * 分页列表查询
* *
@@ -81,29 +81,10 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-添加") @AutoLog(value = "标签管理-添加")
@ApiOperation(value="标签管理-添加", notes="标签管理-添加") @ApiOperation(value="标签管理-添加", notes="标签管理-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
//@RequiresPermissions("tag:add")
public Result<?> add(@Validated @RequestBody OnlCgformTag onlCgformTag) { public Result<?> add(@Validated @RequestBody OnlCgformTag onlCgformTag) {
Integer count=onlCgformTagService.queryExitData(onlCgformTag); onlCgformTagService.add(onlCgformTag);
if (count > 0) { onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
} else {
onlCgformTag.setCreateTime(new Date());
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
onlCgformTag.setCgformHeadId("48308196e7b04761b533dc31bc899707");//设置文档库-表id
onlCgformTag.setDbIsKey(0);
onlCgformTag.setDbIsNull(1);
onlCgformTag.setDbPointLength(0);
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(onlCgformTag.getDbFieldTxt());
onlCgformTag.setDbFieldName(pinYin.replace(" ","_"));
onlCgformTag.setDbFieldEnName(onlCgformTag.getDbFieldEnName().replace(" ","_"));
if(onlCgformTag.getFieldShowType()=="2"){
onlCgformTag.setDbType("int");
}else if(onlCgformTag.getFieldShowType()=="5" && onlCgformTag.getFieldShowType()=="6"){
onlCgformTag.setDbType("Date");
}else{
onlCgformTag.setDbType("String");
}
onlCgformTagService.add(onlCgformTag);
}
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@@ -116,11 +97,13 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-编辑") @AutoLog(value = "标签管理-编辑")
@ApiOperation(value="标签管理-编辑", notes="标签管理-编辑") @ApiOperation(value="标签管理-编辑", notes="标签管理-编辑")
@PutMapping(value = "/edit") @PutMapping(value = "/edit")
//@RequiresPermissions("tag:edit")
public Result<?> edit(@Validated @RequestBody OnlCgformTag onlCgformTag) { public Result<?> edit(@Validated @RequestBody OnlCgformTag onlCgformTag) {
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())) {
return Result.error("固定字段,不可修改"); return Result.error("固定字段,不可修改");
}else { }else {
onlCgformTagService.editById(onlCgformTag); onlCgformTagService.editById(onlCgformTag);
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
} }
@@ -134,6 +117,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-通过id删除") @AutoLog(value = "标签管理-通过id删除")
@ApiOperation(value="标签管理-通过id删除", notes="标签管理-通过id删除") @ApiOperation(value="标签管理-通过id删除", notes="标签管理-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
//@RequiresPermissions("tag:delete")
public Result<OnlCgformTag> delete(@RequestParam(name="id",required=true) String id) { public Result<OnlCgformTag> delete(@RequestParam(name="id",required=true) String id) {
Result<OnlCgformTag> result = new Result<>(); Result<OnlCgformTag> result = new Result<>();
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(id); OnlCgformTag onlCgformTag = onlCgformTagService.queryById(id);
@@ -142,6 +126,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
result.error500("固定字段,不可删除"); result.error500("固定字段,不可删除");
} else { } else {
onlCgformTagService.deleteById(id); onlCgformTagService.deleteById(id);
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
result.OK("删除成功!"); result.OK("删除成功!");
} }
} }
@@ -157,12 +142,14 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-批量删除") @AutoLog(value = "标签管理-批量删除")
@ApiOperation(value="标签管理-批量删除", notes="标签管理-批量删除") @ApiOperation(value="标签管理-批量删除", notes="标签管理-批量删除")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
//@RequiresPermissions("tag:deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(ids); OnlCgformTag onlCgformTag = onlCgformTagService.queryById(ids);
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())) {
return Result.error("固定字段,不可删除"); return Result.error("固定字段,不可删除");
}else { }else {
this.onlCgformTagService.deleteByIds(Arrays.asList(ids.split(","))); this.onlCgformTagService.deleteByIds(Arrays.asList(ids.split(",")));
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }
} }
@@ -17,9 +17,10 @@ import java.util.Map;
public interface OnlCgformTagMapper extends BaseMapper<OnlCgformTag> { public interface OnlCgformTagMapper extends BaseMapper<OnlCgformTag> {
@Select("select f.id,f.create_by,f.create_time,f.update_by,f.update_time,f.cgform_head_id,\n" + @Select("select f.id,f.create_by,f.create_time,f.update_by,f.update_time,f.cgform_head_id,\n" +
"f.is_model,f.db_field_txt,f.db_field_en_name,\n" + "f.is_model,f.db_field_txt,f.db_field_en_name,\n" +
"f.field_show_type,i.item_text,f.dict_id,f.db_length,\n" + "f.field_show_type,i.item_text as field_show_type_name,\n" +
"f.order_num,f.field_must_input,f.is_show_form,f.is_show_list,\n" + "f.dict_id,f.db_length,f.order_num,f.field_must_input,\n" +
"f.is_read_only,f.show_area,a.show_area as show_area_name,f.is_query,f.is_show_laws_list,f.is_show_search,f.is_delete,\n" + "f.is_show_form,f.is_show_list,f.is_read_only,\n" +
"f.show_area,a.show_area as show_area_name,f.is_query,f.is_show_laws_list,f.is_show_search,f.is_delete,\n" +
"f.db_field_name,f.db_is_key,f.db_is_null,f.db_point_length,f.db_type,\n" + "f.db_field_name,f.db_is_key,f.db_is_null,f.db_point_length,f.db_type,\n" +
"i.en_name as field_show_type_en_name,a.en_name as show_area_en_name\n" + "i.en_name as field_show_type_en_name,a.en_name as show_area_en_name\n" +
"from onl_cgform_field as f \n" + "from onl_cgform_field as f \n" +
@@ -103,9 +103,9 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
public List<OnlCgformArea> queryList(OnlCgformArea onlCgformArea) { public List<OnlCgformArea> queryList(OnlCgformArea onlCgformArea) {
LambdaQueryWrapper<OnlCgformArea> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OnlCgformArea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(onlCgformArea.getIsModel())){ if(StringUtils.isNotBlank(onlCgformArea.getIsModel())){
lambdaQueryWrapper.eq(OnlCgformArea::getIsModel,onlCgformArea.getIsModel()) lambdaQueryWrapper.eq(OnlCgformArea::getIsModel,onlCgformArea.getIsModel());
.orderByAsc(OnlCgformArea::getSort);
} }
lambdaQueryWrapper.orderByAsc(OnlCgformArea::getSort);
return list(lambdaQueryWrapper); return list(lambdaQueryWrapper);
} }
@@ -152,4 +152,4 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
IPage<OnlCgformArea> result=onlCgformAreaMapper.querPageList(page,params); IPage<OnlCgformArea> result=onlCgformAreaMapper.querPageList(page,params);
return result; return result;
} }
} }
@@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.CutEnum;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl; import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.tag.entity.OnlCgformArea; import com.jero.modules.tag.entity.OnlCgformArea;
import com.jero.modules.tag.entity.OnlCgformTag; import com.jero.modules.tag.entity.OnlCgformTag;
import com.jero.modules.tag.mapper.OnlCgformTagMapper; import com.jero.modules.tag.mapper.OnlCgformTagMapper;
import com.jero.modules.tag.service.IOnlCgformTagService; import com.jero.modules.tag.service.IOnlCgformTagService;
import com.jero.modules.utils.HanYuPinYinUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -43,10 +45,30 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
*/ */
@Override @Override
public void add(OnlCgformTag onlCgformTag) { public void add(OnlCgformTag onlCgformTag) {
Integer count=queryExitData(onlCgformTag);
if (count > 0) {
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
} else {
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
onlCgformTag.setCgformHeadId("48308196e7b04761b533dc31bc899707");//设置文档库-表id
onlCgformTag.setDbIsKey(0);
onlCgformTag.setDbIsNull(1);
onlCgformTag.setDbPointLength(0);
onlCgformTag.setIsReadOnly(0);
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(onlCgformTag.getDbFieldTxt());
onlCgformTag.setDbFieldName(pinYin.replace(" ","_"));
onlCgformTag.setDbFieldEnName(onlCgformTag.getDbFieldEnName().replace(" ","_"));
if(onlCgformTag.getFieldShowType()=="2"){
onlCgformTag.setDbType("int");
}else if(onlCgformTag.getFieldShowType()=="5" && onlCgformTag.getFieldShowType()=="6"){
onlCgformTag.setDbType("Date");
}else{
onlCgformTag.setDbType("String");
}
}
Date now = new Date(); Date now = new Date();
onlCgformTag.setCreateTime(now); onlCgformTag.setCreateTime(now);
onlCgformTag.setUpdateTime(now); onlCgformTag.setUpdateTime(now);
onlCgformTag.setIsReadOnly(0);
save(onlCgformTag); save(onlCgformTag);
} }
@@ -59,6 +81,8 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
@Override @Override
public void editById(OnlCgformTag onlCgformTag) { public void editById(OnlCgformTag onlCgformTag) {
Date now = new Date(); Date now = new Date();
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(onlCgformTag.getDbFieldTxt());
onlCgformTag.setDbFieldName(pinYin.replace(" ","_"));
onlCgformTag.setUpdateTime(now); onlCgformTag.setUpdateTime(now);
saveOrUpdate(onlCgformTag); saveOrUpdate(onlCgformTag);
} }
+1594 -219
View File
File diff suppressed because it is too large Load Diff
+18 -4
View File
@@ -11,6 +11,8 @@
import enquireScreen from '@/utils/device' import enquireScreen from '@/utils/device'
import moment from 'moment' import moment from 'moment'
import 'moment/locale/zh-cn' import 'moment/locale/zh-cn'
import Vue from 'vue'
import { mapGetters } from 'vuex'
moment.locale('zh-cn') moment.locale('zh-cn')
@@ -79,13 +81,15 @@
watch: { watch: {
$route: function(val) { $route: function(val) {
this.$nextTick(() => { this.$nextTick(() => {
this.$watermark.set('fanqiangqiang 范强强') this.$watermark.set(this.userInfo().updateBy + ' ' + this.userInfo().username)
}) })
} }
}, },
computed: {}, computed: {},
methods: {} methods: {
...mapGetters(['userInfo'])
}
} }
</script> </script>
<style> <style>
@@ -104,7 +108,17 @@
.ant-layout { .ant-layout {
background: transparent !important; background: transparent !important;
} }
.ant-table-tbody > tr.ant-table-row-selected td{
background:transparent!important; .ant-table-tbody > tr.ant-table-row-selected td {
background: transparent !important;
} }
.ant-pagination-disabled .anticon-right {
cursor: not-allowed !important;
}
.ant-pagination-disabled .anticon-left {
cursor: not-allowed !important;
}
</style> </style>
+3 -1
View File
@@ -503,7 +503,9 @@ module.exports = {
CannotExceed100characters:'cannot exceed 100 characters', CannotExceed100characters:'cannot exceed 100 characters',
cantExeed:'cannot exceed ', cantExeed:'cannot exceed ',
characters:' characters', characters:' characters',
Processing:'Processing', Processing:'Processing',
See:'See', See:'See',
labelNameCannotDuplicate:'Label name cannot be duplicate',
list:'list',
paragraph:'paragraph',
} }
+4
View File
@@ -509,4 +509,8 @@ module.exports = {
characters:'字符', characters:'字符',
Processing:'办理', Processing:'办理',
See:'查看', See:'查看',
labelNameCannotDuplicate:'标签名称不能重复',
list:'列表',
paragraph:'段落',
} }
@@ -140,15 +140,20 @@
handleSubmit() { handleSubmit() {
let content = [] let content = []
let replace_standard_id = [] let replace_standard_id = []
this.content.forEach(res => { if (this.content && this.content.length > 0){
content.push(res.title) this.content.forEach(res => {
replace_standard_id.push(res.id) content.push(res.title)
}) replace_standard_id.push(res.id)
this.$emit('input', content.join(',')) })
this.$emit('change',this.query.db_field_name,replace_standard_id.join(',')) this.$emit('input', content.join(','))
this.visible = false this.$emit('change',this.query.db_field_name,replace_standard_id.join(','))
this.visible = false
}else{
this.$message.warning(this.$t('selectLeastOne'))
}
}, },
indexclick(event) { indexclick(event) {
console.log(event)
this.$emit('input', event.target.value) this.$emit('input', event.target.value)
}, },
onSelectChange(value) { onSelectChange(value) {
+10 -1
View File
@@ -3,7 +3,7 @@
<a-form-model :model="formInline" v-if="isFormInline" class="formAdd" :rules="rules" ref="ruleForm"> <a-form-model :model="formInline" v-if="isFormInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24"> <a-row :gutter="24">
<div v-for="(item,index) in dataList" :key="index"> <div v-for="(item,index) in dataList" :key="index">
<a-col :span="12" v-if="item.field_show_type === '1'"> <a-col :span="12" v-if="item.field_show_type === '1' || item.field_show_type === '11'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span> <span class="Required" v-if="item.field_must_input == 0">*</span>
@@ -349,6 +349,15 @@
}) })
} }
} }
if (res.field_show_type === '1' || res.field_show_type === '2' ||
res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10'
|| res.field_show_type === '11'){
rule.push({
max: res.db_length,
message: res.db_field_txt+'不能超出'+res.db_length+'个字符',
trigger: 'blur'
})
}
if (rule.length > 0) { if (rule.length > 0) {
rules[res.db_field_name] = rule rules[res.db_field_name] = rule
} }
@@ -12,6 +12,11 @@
:columns="columns" :columns="columns"
@change="tableOnChange" @change="tableOnChange"
> >
<span slot="detailClick" slot-scope="text,record">
<a class="text" :title="text" @click="detailClick(record)">
{{text && text.length > 18?text.slice(0,17)+'...':text}}
</a>
</span>
<span slot="operation" slot-scope="record"> <span slot="operation" slot-scope="record">
<a class="text" v-for="(ol,index) in OperationList" <a class="text" v-for="(ol,index) in OperationList"
@click="OperationClick(ol,record)"> @click="OperationClick(ol,record)">
@@ -8,7 +8,7 @@
</a-radio-group> </a-radio-group>
<a-select v-else-if="tagType=='select'" :getPopupContainer = "getPopupContainer" :placeholder="placeholder" :disabled="disabled" :value="getValueSting" @change="handleInput"> <a-select v-else-if="tagType=='select'" :getPopupContainer = "getPopupContainer" :placeholder="placeholder" :disabled="disabled" :value="getValueSting" @change="handleInput">
<a-select-option :value="undefined">{{$t('pleaseSelect')}}</a-select-option> <a-select-option :value="null">{{$t('pleaseSelect')}}</a-select-option>
<a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value"> <a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.text || item.label "> <span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
{{ item.text || item.label }} {{ item.text || item.label }}
@@ -8,7 +8,7 @@
</div> </div>
<a-row :gutter="24"> <a-row :gutter="24">
<div v-for="item in val.content"> <div v-for="item in val.content">
<a-col :span="12" v-if="item.field_show_type === '1'"> <a-col :span="12" v-if="item.field_show_type === '1' || item.field_show_type === '11'">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span> <span class="Required" v-if="item.field_must_input == 0">*</span>
@@ -80,6 +80,7 @@
<a-date-picker class="box-input" <a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+item.db_field_txt" :placeholder="$t('PleaseSelect')+item.db_field_txt"
@change="dateChange(item)" @change="dateChange(item)"
:disabledDate="disabledDate"
format="YYYY-MM-DD" format="YYYY-MM-DD"
v-model="formInline[item.db_field_name]" v-model="formInline[item.db_field_name]"
:disabled="disabled" :disabled="disabled"
@@ -115,9 +116,9 @@
formInline[item.db_field_name] == null) ? $t('clickUpload') : $t('viewUploadedFiles') formInline[item.db_field_name] == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}} }}
</a-button> </a-button>
<span class="button-text-text" v-if="formInline[item.db_field_name]"> <!-- <span class="button-text-text" v-if="formInline[item.db_field_name]">-->
{{formInline[item.db_field_name].split(',').length}} <!-- {{formInline[item.db_field_name].split(',').length}}-->
</span> <!-- </span>-->
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -292,6 +293,9 @@
}, },
methods: { methods: {
disabledDate(current) {
return current && current < moment().subtract(1,"day");
},
sumber() { sumber() {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
@@ -327,7 +331,7 @@
onChange(item) { onChange(item) {
let dateOne = moment(this.formInline[item][0]).format('YYYY-MM-DD') let dateOne = moment(this.formInline[item][0]).format('YYYY-MM-DD')
let dateTwo = moment(this.formInline[item][1]).format('YYYY-MM-DD') let dateTwo = moment(this.formInline[item][1]).format('YYYY-MM-DD')
this.formInline[item] =dateOne ? [dateOne, dateTwo] : [] this.formInline[item] = dateOne ? [dateOne, dateTwo] : []
}, },
clickButtonToUpload(current) { clickButtonToUpload(current) {
@@ -400,6 +404,15 @@
}) })
} }
} }
if (res.field_show_type === '1' || res.field_show_type === '2' ||
res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10'
|| res.field_show_type === '11') {
rule.push({
max: res.db_length,
message: res.db_field_txt + '不能超出' + res.db_length + '个字符',
trigger: 'blur'
})
}
if (rule.length > 0) { if (rule.length > 0) {
rules[res.db_field_name] = rule rules[res.db_field_name] = rule
} }
@@ -449,6 +462,7 @@
}, },
StandardselectionChange(value, id) { StandardselectionChange(value, id) {
this.formInline[value + '_id'] = id this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
} }
} }
} }
+17 -3
View File
@@ -271,9 +271,8 @@
}, },
methods: { methods: {
sumber() { sumber() {
console.log('vilidate',this.formInline) // console.log('vilidate',this.formInline)
this.$refs.ruleForm1.validate(valid => { this.$refs.ruleForm1.validate(valid => {
console.log('va',valid)
if (valid) { if (valid) {
let url = '' let url = ''
if (this.formInline.id) { if (this.formInline.id) {
@@ -310,7 +309,12 @@
/** 赋值给当前对应的表单文件 */ /** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',') this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
console.log('form',this.formInline) // console.log('form',this.formInline)
}else{
this.formInline[this.uploadName]=''
this.formInline = { ...this.formInline }
// console.log('form',this.formInline)
} }
}, },
handleInput(value) { handleInput(value) {
@@ -331,6 +335,16 @@
message: res.db_field_txt + '不能为空', message: res.db_field_txt + '不能为空',
trigger: 'blur' trigger: 'blur'
}) })
if(res.db_field_name=='standNumber'){
rule.push(
{ min:1, max: 200, message: this.$t('cantExeed')+'200'+this.$t('characters'), trigger: 'blur' },
)
}else if(res.db_field_name=='standName'){
rule.push(
{ min:1, max: 200, message: this.$t('cantExeed')+'200'+this.$t('characters'), trigger: 'blur' },
)
}
} else if (res.field_show_type === 'CHECKBOX' || res.field_show_type === 'list_multi' || } else if (res.field_show_type === 'CHECKBOX' || res.field_show_type === 'list_multi' ||
res.field_show_type === 'date' || res.field_show_type === 'file') { res.field_show_type === 'date' || res.field_show_type === 'file') {
rule.push({ rule.push({
+68 -65
View File
@@ -7,7 +7,7 @@
class="ant-upload-list" class="ant-upload-list"
name="file" name="file"
:file-list="myfileList" :file-list="myfileList"
:multiple="true" :multiple="false"
:action = 'uploadAction' :action = 'uploadAction'
:headers="headers" :headers="headers"
:before-upload="beforeUpload" :before-upload="beforeUpload"
@@ -47,19 +47,23 @@
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl); // console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
}, },
methods:{ methods:{
beforeUpload(file) { beforeUpload(file,fileList) {
// console.log(file) if(this.myfileList&&this.myfileList.length>=1){
// let thisFileType = this.thisFileType.replace(/\s+/g, ""); this.$message.warning('只能上传一个文件')
if(file.type==this.accept){ return false
this.fileTypeSatus = true; }else{
this.$message.destroy() // let thisFileType = this.thisFileType.replace(/\s+/g, "");
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量! if(file.type==this.accept){
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!"; this.fileTypeSatus = true;
this.$message.destroy()
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
}
} }
}, },
remove(){ remove(){
this.fileTypeSatus = true; this.fileTypeSatus = true;
// console.log('rrr',this.myfileList)
}, },
handleChange(info) { handleChange(info) {
// console.log('info',info) // console.log('info',info)
@@ -71,38 +75,18 @@
info.fileList.splice(index,1) info.fileList.splice(index,1)
} }
}) })
if (this.fileTypeSatus) { if (this.fileTypeSatus) {
if (file.size > 100000000) { if (file.size > 100000000) {
this.$message.error(this.errorMessage) this.$message.error(this.errorMessage)
return return
}else { }else {
if (status === 'error') { if (status === 'error') {
this.$emit('uploadSuccess', this.fileList) this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.error(`${info.file.name} 文件上传失败。`);
} else if (status === 'removed') {
this.myfileList = info.fileList;
this.fileList = []
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
} else {
this.fileList.push(res)
}
})
this.$emit('uploadSuccess', this.fileList)
if(this.myfileList.length > 0){
this.$message.destroy() this.$message.destroy()
this.$message.success(`${info.file.name} 删除成功。`); this.$message.error(`${info.file.name} 文件上传失败。`);
} } else if (status === 'removed') {
} else if (status === 'done') { this.myfileList = info.fileList;
this.fileList = [] this.fileList = []
this.myfileList = info.fileList;
// console.log('file3333',info.fileList)
if (info.fileList.length > 20) {
info.fileList.splice(20)
// this.myfileList = info.fileList;
this.myfileList.forEach((res) => { this.myfileList.forEach((res) => {
if (res.response) { if (res.response) {
this.fileList.push(res.response.result) this.fileList.push(res.response.result)
@@ -110,36 +94,55 @@
this.fileList.push(res) this.fileList.push(res)
} }
}) })
// console.log('file1111',this.fileList) // console.log('remove',this.fileList)
this.$emit('uploadSuccess', this.fileList) this.$emit('uploadSuccess', this.fileList)
this.$message.destroy() this.$message.destroy()
this.$message.error('最多只能上传二十个'); this.$message.success(`${info.file.name} 删除成功。`);
return } else if (status === 'done') {
} this.fileList = []
// console.log('my222',this.myfileList) this.myfileList = info.fileList;
this.myfileList.forEach((res) => { // console.log('file3333',info.fileList)
if (res.response) { if (info.fileList.length > 1) {
this.fileList.push(res.response.result) info.fileList.splice(1)
// console.log('flist',res.response) // this.myfileList = info.fileList;
} else {
this.fileList.push(res)
}
})
if(this.myfileList.length > 0){ this.myfileList.forEach((res) => {
this.$emit('uploadSuccess', this.fileList) if (res.response) {
this.$message.destroy() this.fileList.push(res.response.result)
this.$message.success(`${info.file.name} 文件上传成功。`); } else {
this.fileList.push(res)
}
})
// console.log('file1111',this.fileList)
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.error('最多只能上传一个文件');
return
}
// console.log('my222',this.myfileList)
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
// console.log('flist',res.response)
} else {
this.fileList.push(res)
}
})
if(this.myfileList.length > 0){
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.success(`${info.file.name} 文件上传成功。`);
}
} else if (status === 'uploading') {
this.myfileList = info.fileList;
this.$emit('uploadSuccess')
// this.$message.success(`${info.file.name} 文件上传成功。`);
} }
} else if (status === 'uploading') {
this.myfileList = info.fileList;
this.$emit('uploadSuccess')
// this.$message.success(`${info.file.name} 文件上传成功。`);
} }
}else{
this.$message.warning('不支持上传该类型的文件!')
} }
}else{
this.$message.warning('不支持上传该类型的文件!')
}
}, },
} }
} }
+4 -3
View File
@@ -16,7 +16,8 @@
:placeholder="$t('PleaseSelect')+item.db_field_txt" :placeholder="$t('PleaseSelect')+item.db_field_txt"
/> />
</div> </div>
<div class="box-title-text" v-if="item.field_show_type == '1'"> <div class="box-title-text" v-if="item.field_show_type == '1' || item.field_show_type == '8' ||
item.field_show_type == '9' || item.field_show_type == '10' || item.field_show_type == '11'">
<div class="title-text" :title="item.db_field_txt"> <div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span> <span>{{item.db_field_txt}}</span>
</div> </div>
@@ -174,11 +175,11 @@
}, },
methods: { methods: {
searchQuery() { searchQuery() {
eventBUs.$emit('searchQuery', this.queryParam) eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
}, },
searchReset() { searchReset() {
this.queryParam = {} this.queryParam = {}
eventBUs.$emit('searchQuery', this.queryParam) eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
}, },
getSeach() { getSeach() {
let params = { let params = {
+6 -6
View File
@@ -13,17 +13,17 @@
@change="tableOnChange" @change="tableOnChange"
> >
<span slot="operation" slot-scope="record"> <span slot="operation" slot-scope="record">
<a class="text" v-for="(ol,index) in OperationList" <a v-for="(ol,index) in OperationList"
@click="OperationClick(ol,record)"> @click="OperationClick(ol,record)">
<span v-if="ol.text == $t('CancelCollection')"> <span v-if="ol.text == $t('CancelCollection')" v-has="ol.has" class="text">
{{!record.collectFlag || record.collectFlag == 0 ? $t('Collection') :$t('CancelCollection')}} {{!record.collectFlag || record.collectFlag == 0 ? $t('Collection') :$t('CancelCollection')}}
</span> </span>
<span v-else-if="ol.text == $t('CancelSubscribe')"> <span v-else-if="ol.text == $t('CancelSubscribe')" v-has="ol.has" class="text">
{{!record.subscribeFlag || record.subscribeFlag == 0 ? $t('subscribe') :$t('CancelSubscribe')}} {{!record.subscribeFlag || record.subscribeFlag == 0 ? $t('subscribe') :$t('CancelSubscribe')}}
</span> </span>
<span v-else> <span v-else v-has="ol.has" class="text">
{{ol.text}} {{ol.text}}
</span> </span>
</a> </a>
</span> </span>
<span slot="detailClick" slot-scope="text,record"> <span slot="detailClick" slot-scope="text,record">
@@ -189,7 +189,7 @@
this.loading = true this.loading = true
postAction(this.url.tableList, params).then((res) => { postAction(this.url.tableList, params).then((res) => {
if (res.success) { if (res.success) {
if (res.result.current > 1 && res.result.records.length == 0){ if (res.result.current > 1 && res.result.records.length == 0) {
this.pageNo = res.result.current - 1 this.pageNo = res.result.current - 1
this.getTableList() this.getTableList()
return return
+20 -1
View File
@@ -10,6 +10,7 @@
:multiple="true" :multiple="true"
:action='uploadAction' :action='uploadAction'
:headers="headers" :headers="headers"
@preview="preview"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:remove='remove' :remove='remove'
@change="handleChange"> @change="handleChange">
@@ -25,6 +26,7 @@
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction, postAction, downFile, downloadFile } from '@/api/manage'
export default { export default {
name: 'file', name: 'file',
@@ -114,7 +116,6 @@
}) })
}, },
mypreview(item) { mypreview(item) {
console.log(item)
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '/' + item.ext1) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '/' + item.ext1)
window.open(url, '_blank') window.open(url, '_blank')
}, },
@@ -193,6 +194,24 @@
resetFileList() { resetFileList() {
this.myfileList = [] this.myfileList = []
this.fileList = [] this.fileList = []
},
preview(file) {
let fileQuery = file.response ? file.response.result : file
let fileName = fileQuery.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id))
} else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '/' + fileQuery.id)
window.open(url, '_blank')
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '/' + fileQuery.id)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/download', fileQuery.fileName, { id: fileQuery.id })
}
} }
} }
} }
@@ -52,6 +52,7 @@
@titleClick="titleClick" @titleClick="titleClick"
@onCancel="onCancel" @onCancel="onCancel"
@onSelectChange="onSelectChange" @onSelectChange="onSelectChange"
@detailClick="detailClick"
></tableData> ></tableData>
<!-- <a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" :loading="loading" class="tag-con-table">--> <!-- <a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" :loading="loading" class="tag-con-table">-->
<!-- <a slot="serialNumber" slot-scope="text, record" @click="numberClick(record)">{{ text }}</a>--> <!-- <a slot="serialNumber" slot-scope="text, record" @click="numberClick(record)">{{ text }}</a>-->
@@ -259,8 +260,14 @@
//点击名称 //点击名称
titleClick(records){ titleClick(records){
},
detailClick(item) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: item
})
window.open(newUrl.href, '_blank')
} }
} }
} }
</script> </script>
@@ -69,7 +69,7 @@
<div class="TextInformation" v-else-if="val == $t('relatedInformation')"> <div class="TextInformation" v-else-if="val == $t('relatedInformation')">
<div class="TextInformationContent" v-for="(ol,index1) in item[val]" style="width: 100%"> <div class="TextInformationContent" v-for="(ol,index1) in item[val]" style="width: 100%">
<span class="TextInformationContentLeft"> <span class="TextInformationContentLeft">
<span :title="ol.db_field_txt">{{ol.db_field_txt}}</span> <span :title="ol.db_field_txt" @click="relatedClick(ol)">{{ol.db_field_txt}}</span>
</span> </span>
<span class="TextInformationContentcontentButton"> <span class="TextInformationContentcontentButton">
<span :title="ol.value">{{ol.value ? ol.value : '--'}}</span> <span :title="ol.value">{{ol.value ? ol.value : '--'}}</span>
@@ -170,8 +170,22 @@
} }
}) })
}, },
pdfPreview(item) { pdfPreview(fileQuery) {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + item.id)) let fileName = fileQuery.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id))
} else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '/' + fileQuery.id)
window.open(url, '_blank')
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '/' + fileQuery.id)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/download', fileQuery.fileName, { id: fileQuery.id })
}
}, },
download(item) { download(item) {
downloadFile('/sys/common/download', item.fileName, { id: item.id }) downloadFile('/sys/common/download', item.fileName, { id: item.id })
@@ -208,6 +222,7 @@
this.bussLogList() this.bussLogList()
}, },
SizeChange(page, pageSize) { SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize this.pageSize = pageSize
this.bussLogList() this.bussLogList()
}, },
@@ -218,6 +233,13 @@
serial_number: this.$route.query.serial_number serial_number: this.$route.query.serial_number
} }
}) })
},
relatedClick(val) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: val
})
window.open(newUrl.href, '_blank')
} }
} }
} }
@@ -4,30 +4,30 @@
<search ref="searchRef" :flag="'1'" :url="url"/> <search ref="searchRef" :flag="'1'" :url="url"/>
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div @click="handleDel" class="operator-text"> <div @click="handleDel" class="operator-text" v-has="'document:deleteBatch'">
<a-icon type="delete"/> <a-icon type="delete"/>
{{$t('BatchDelete')}} {{$t('BatchDelete')}}
</div> </div>
<div @click="handleExport" class="operator-text"> <div @click="handleExport" class="operator-text" v-has="'document:exportExcel'">
<a-icon type="export" :rotate="-90"/> <a-icon type="export" :rotate="-90"/>
{{$t('dataExport')}} {{$t('dataExport')}}
</div> </div>
<div @click="handleFileExport" class="operator-text"> <div @click="handleFileExport" class="operator-text" v-has="'document:exportZip'">
<a-icon type="mail"/> <a-icon type="mail"/>
{{$t('exportWithFile')}} {{$t('exportWithFile')}}
</div> </div>
<div @click="handleCompare" class="operator-text"> <div @click="handleCompare" class="operator-text" v-has="'document:pullMessage'">
<a-icon type="rocket" :rotate="45"/> <a-icon type="rocket" :rotate="45"/>
{{$t('Push')}} {{$t('Push')}}
</div> </div>
<div @click="handleModule" class="operator-text"> <div @click="handleModule" class="operator-text" v-has="'document:exportTemplate'">
<a-icon type="download"/> <a-icon type="download"/>
{{$t('templateDownload')}} {{$t('templateDownload')}}
</div> </div>
<div class="operator-text"> <div class="operator-text" v-has="'document:importZip'">
<ImportFile :url="url"/> <ImportFile :url="url"/>
</div> </div>
<div @click="handleAdd" class="operator-text"> <div @click="handleAdd" class="operator-text" v-has="'document:getInfoById'">
<a-icon type="plus"/> <a-icon type="plus"/>
{{$t('add')}} {{$t('add')}}
</div> </div>
@@ -91,19 +91,23 @@
OperationList: [ OperationList: [
{ {
text: this.$t('CancelCollection'), text: this.$t('CancelCollection'),
ClickEvent: 'Collection' ClickEvent: 'Collection',
has:'document:addCollect'
}, },
{ {
text: this.$t('CancelSubscribe'), text: this.$t('CancelSubscribe'),
ClickEvent: 'subscribe' ClickEvent: 'subscribe',
has:'document:addSubscribe'
}, },
{ {
text: this.$t('edit'), text: this.$t('edit'),
ClickEvent: 'editTable' ClickEvent: 'editTable',
has:'document:updateInfo'
}, },
{ {
text: this.$t('deleteLib'), text: this.$t('deleteLib'),
ClickEvent: 'deleteTable' ClickEvent: 'deleteTable',
has:'document:deleteBatch'
} }
], ],
selectedRowKeys: [], selectedRowKeys: [],
+33 -35
View File
@@ -133,20 +133,7 @@
checkVisible:false, //校核弹框 checkVisible:false, //校核弹框
file:'', file:'',
form:{}, //表单数据 form:{}, //表单数据
rules:{ rules:{},
attId:[
{ required: true, message: '请选择文件', trigger: 'change' },
],
standNumber:[
{ required: true, message: '请输入编号', trigger: 'blur' },
],
standName:[
{ required: true, message: '请输入名称', trigger: 'blur' },
],
fileType:[
{ required: true, message: '请选择文本状态', trigger: 'blur' },
]
},
url: { url: {
tableHeader: 'ocr/ocrRecord/getHeader', //表格头部字段 tableHeader: 'ocr/ocrRecord/getHeader', //表格头部字段
seachList: 'ocr/ocrRecord/queryCondition', //搜索字段 seachList: 'ocr/ocrRecord/queryCondition', //搜索字段
@@ -176,20 +163,33 @@
// this.loadData() // this.loadData()
}, },
created() { created() {
const date = new Date(), this.refresh()
year = date.getFullYear(), },
month = date.getMonth()+1, watch:{
myDate = date.getDate() drawVisible(val){
this.today = `${year}/${month < 10 ? '0'+month : month}/${myDate < 10 ? '0'+myDate : myDate}` if(val&&this.timer){
if(this.timer){ clearInterval(this.timer)
clearInterval(this.timer) }else{
}else{ clearInterval(this.timer)
eventBUs.$emit('searchReset') this.initSetTimeout(this.today)//调用每隔10秒刷新数据
this.initSetTimeout(this.today)//调用每隔10秒刷新数据 }
} }
}, },
methods:{ methods:{
// 定时刷新页面
refresh(){
const date = new Date(),
year = date.getFullYear(),
month = date.getMonth()+1,
myDate = date.getDate()
this.today = `${year}/${month < 10 ? '0'+month : month}/${myDate < 10 ? '0'+myDate : myDate}`
if(this.timer){
clearInterval(this.timer)
}else{
eventBUs.$emit('searchReset')
this.initSetTimeout(this.today)//调用每隔10秒刷新数据
}
},
//上传 //上传
handleUpload(){ handleUpload(){
// if(this.timer){ // if(this.timer){
@@ -200,6 +200,9 @@
//调取已入库文件 //调取已入库文件
handleFileExport(){ handleFileExport(){
this.drawVisible=true this.drawVisible=true
if(this.timer){
clearInterval(this.timer)
}
}, },
//批量删除 //批量删除
handleDel(){ handleDel(){
@@ -238,19 +241,13 @@
}, },
//校核 //校核
actionCheck(val){ actionCheck(val){
// if(val.resultContent=='转换成功'&&val.syncState!='已同步'){
// this.checkVisible=true
// }else{
// this.$message.warning('未转换成功或已同步至文档库,不能进行校核')
// }
this.checkVisible=true this.checkVisible=true
}, },
//下载 //下载
actionDown(val){ actionDown(val){
// downloadFile('/sys/common/download', val.docRealName, { id: val.attId }) let fileName=val.docRealName.split('_')
downloadFile('ocr/OcrRestful/downFile', val.docRealName, { fileName: val.docRealName }) fileName=fileName[fileName.length-1]
// downloadFile(val.docRealFile) downloadFile('ocr/OcrRestful/downFile', fileName, { fileName: val.docRealName })
// window.open(val.docRealFile)
}, },
//删除 //删除
actionDelete(record){ actionDelete(record){
@@ -336,10 +333,11 @@
}, },
docVisible(val){ docVisible(val){
this.drawVisible=val this.drawVisible=val
}, },
//文件详情跳转 //文件详情跳转
detailClick(val){ detailClick(val){
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + val.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + val.attId))
}, },
exportVisible(val){ exportVisible(val){
// this.fileVisible=val // this.fileVisible=val
@@ -146,7 +146,7 @@
}) })
}, },
afterVisibleChange(val) { afterVisibleChange(val) {
console.log('visible', val); // console.log('visible', val);
}, },
onClose() { onClose() {
this.visible = false; this.visible = false;
@@ -4,37 +4,6 @@
<div class="subscribtion-search-wrapper"> <div class="subscribtion-search-wrapper">
<div class="subscribtion-search-header"> <div class="subscribtion-search-header">
<search :url="url" :flag="'1'"></search> <search :url="url" :flag="'1'"></search>
<!-- <a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">-->
<!-- <a-form-model-->
<!-- class="subscribtion-content"-->
<!-- :model="queryParams"-->
<!-- ref="tagEditForm"-->
<!-- >-->
<!-- <a-row :gutter="44">-->
<!-- <a-col :md="6" :sm="12">-->
<!-- <a-form-model-item :label="'编号'">-->
<!-- <j-input :placeholder="'请输入编号'" v-model="queryParams.serialNumber"></j-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :md="6" :sm="12">-->
<!-- <a-form-model-item :label="'标题'">-->
<!-- <j-input :placeholder="'请输入标题'" v-model="queryParams.title"></j-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :md="6" :sm="8">-->
<!-- <a-form-model-item :label="'状态'">-->
<!-- <j-dict-select-tag type="list" v-model="queryParams.state" dictCode="file_type" :placeholder="'请选择状态'" />-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :md="6" :sm="8">-->
<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">-->
<!-- <a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>-->
<!-- <a-button @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button>-->
<!-- </span>-->
<!-- </a-col>-->
<!-- </a-row>-->
<!-- </a-form-model>-->
<!-- </a-form>-->
</div> </div>
</div> </div>
<div class="table-operator"> <div class="table-operator">
@@ -56,26 +25,8 @@
@titleClick="titleClick" @titleClick="titleClick"
@onCancel="onCancel" @onCancel="onCancel"
@onSelectChange="onSelectChange" @onSelectChange="onSelectChange"
@detailClick="detailClick"
></tableData> ></tableData>
<!-- <a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" :loading="loading" class="tag-con-table">-->
<!-- <a slot="serialNumber" slot-scope="text, record" @click="numberClick(record)">{{ text }}</a>-->
<!--&lt;!&ndash; <a slot="title" slot-scope="text, record" @click="titleClick(record)">{{ text }}</a>&ndash;&gt;-->
<!-- <template slot="action" slot-scope="text, record">-->
<!-- <a class="action-delete" href="javascript:;" @click="onCancel(record)">取消订阅</a>-->
<!-- </template>-->
<!-- </a-table>-->
<!-- <div class="page" v-if="tableData.length > 0">-->
<!-- <a-pagination-->
<!-- :show-total="total => ` ${total} `"-->
<!-- show-quick-jumper-->
<!-- show-size-changer-->
<!-- :current="queryParams.pageNo"-->
<!-- :page-size.sync="queryParams.pageSize"-->
<!-- :total="total"-->
<!-- @change="onChangePage"-->
<!-- @showSizeChange="SizeChange"-->
<!-- />-->
<!-- </div>-->
</div> </div>
<sub-area v-if="visible" :subVisible="visible" @visible="areaVisible"></sub-area> <sub-area v-if="visible" :subVisible="visible" @visible="areaVisible"></sub-area>
</a-card> </a-card>
@@ -272,6 +223,13 @@
}, },
areaVisible(val){ areaVisible(val){
this.visible=val this.visible=val
},
detailClick(item) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: item
})
window.open(newUrl.href, '_blank')
} }
} }
} }
@@ -9,7 +9,7 @@
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
> >
<a-input-search v-model="searchValue" style="margin-bottom: 8px" :placeholder="$t('NodeQuickLookup')" @change="onChange" /> <a-input-search v-model="searchValue" style="margin-bottom: 8px" :placeholder="$t('NodeQuickLookup')" @change="onChange" @search="onSearch" />
<a-tree <a-tree
v-if="treeData && treeData.length" v-if="treeData && treeData.length"
v-model="checkedKeys" v-model="checkedKeys"
@@ -48,7 +48,8 @@
autoExpandParent: true, autoExpandParent: true,
treeData: [], treeData: [],
dataList:[], dataList:[],
searchValue:'' searchValue:'',
data:[]
} }
}, },
props:{ props:{
@@ -68,15 +69,21 @@
methods:{ methods:{
//获取数据 //获取数据
loadData(){ loadData(){
let params = {} let params = {
title:this.searchValue
}
getAction(`sys/category/getSysCategoryTree`,params).then(res=> { getAction(`sys/category/getSysCategoryTree`,params).then(res=> {
if(res.success){ if(res.success){
let data=res.result this.data=[...res.result]
this.treeData=this.addAttr(data) this.treeData=this.addAttr(this.data)
// console.log('treeData',this.treeData) // console.log('treeData',this.treeData)
} }
}) })
}, },
onSearch(){
this.loadData()
},
//获取用户的订阅 //获取用户的订阅
getSubscribtion(){ getSubscribtion(){
postAction(`domain/domainUserRel/queryList`,{}).then(res=> { postAction(`domain/domainUserRel/queryList`,{}).then(res=> {
@@ -96,6 +103,9 @@
if((Array.isArray(dataI)) && dataI.length>0){ if((Array.isArray(dataI)) && dataI.length>0){
dataI.forEach((item,index)=>{ dataI.forEach((item,index)=>{
this.$set(item,'key',item.id) this.$set(item,'key',item.id)
// if(item.title.indexOf(this.searchValue)!==-1){
// console.log('item.title',item.title)
// }
let arr = []; let arr = [];
this.addAttr(item.children,arr); this.addAttr(item.children,arr);
}); });
@@ -155,15 +165,17 @@
this.autoExpandParent = false; this.autoExpandParent = false;
}, },
onChange(e) { onChange(e) {
// this.loadData()
const value = e.target.value; const value = e.target.value;
const expandedKeys = this.dataList const expandedKeys = this.dataList
.map(item => { .map(item => {
if (item.title.indexOf(value) > -1) { if (item.title.indexOf(value) > -1) {
return this.getParentKey(item.key, this.gData); return this.getParentKey(item.key, this.treeData);
} }
return null; return null;
}) })
.filter((item, i, self) => item && self.indexOf(item) === i); .filter((item, i, self) => item && self.indexOf(item) === i);
console.log('item',item)
Object.assign(this, { Object.assign(this, {
expandedKeys, expandedKeys,
searchValue: value, searchValue: value,
@@ -171,11 +183,11 @@
}) })
}, },
onCheck(checkedKeys) { onCheck(checkedKeys) {
console.log('onCheck', checkedKeys); // console.log('onCheck', checkedKeys);
this.checkedKeys = checkedKeys; this.checkedKeys = checkedKeys;
}, },
onSelect(selectedKeys, info) { onSelect(selectedKeys, info) {
console.log('onSelect', info); // console.log('onSelect', info);
this.selectedKeys = selectedKeys; this.selectedKeys = selectedKeys;
}, },
@@ -267,6 +267,7 @@
deleteAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => { deleteAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')); this.$message.success(this.$t('OperationSuccessful'));
this.queryParams.pageNo=1
this.loadData() this.loadData()
}else{ }else{
this.$message.warning(this.$t('operationFailed')); this.$message.warning(this.$t('operationFailed'));
@@ -353,6 +353,7 @@
deleteAction(`sys/dictItem/delete`, params).then(res => { deleteAction(`sys/dictItem/delete`, params).then(res => {
if(res.success) { if(res.success) {
this.$message.success(this.$t('OperationSuccessful')); this.$message.success(this.$t('OperationSuccessful'));
this.queryParams.pageNo=1
this.loadData() this.loadData()
}else{ }else{
this.$message.warning(this.$t('operationFailed')); this.$message.warning(this.$t('operationFailed'));
@@ -381,6 +382,7 @@
async () => { async () => {
deleteAction(`sys/category/deleteBatch`, params).then(res => { deleteAction(`sys/category/deleteBatch`, params).then(res => {
if(res.success){ if(res.success){
this.queryParams.pageNo=1
this.loadData() this.loadData()
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
}else{ }else{
@@ -394,7 +396,7 @@
} }
}, },
ok(val){ ok(val){
this.queryParams.pageNo=val.pageSize this.queryParams.pageNo=val.pageNo
this.queryParams.pageSize=val.pageSize this.queryParams.pageSize=val.pageSize
this.loadData() this.loadData()
} }
@@ -32,17 +32,17 @@
:label-col="labelCol" :label-col="labelCol"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-form-model-item ref="tagName" :label="$t('LabeItemName')" prop="dictName"> <a-form-model-item ref="tagName" :label="$t('LabeItemName')" prop="dictName" class="tag-item">
<a-input <a-input
v-model="form.dictName" v-model="form.dictName"
:placeholder="$t('PleaseEnterLabelName')" :placeholder="$t('PleaseEnterLabelName')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item :label="$t('LabelType')" prop="attributeType" v-if="isEdit==1"> <a-form-model-item :label="$t('LabelType')" prop="attributeType" v-if="isEdit==1" class="tag-item">
<j-dict-select-tag type="list" v-model="form.attributeType" dictCode="attribute_type" :placeholder="$t('PleaseSelectLabelType')" /> <j-dict-select-tag type="list" v-model="form.attributeType" dictCode="attribute_type" :placeholder="$t('PleaseSelectLabelType')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item ref="describe" :label="$t('describe')" prop="description"> <a-form-model-item ref="describe" :label="$t('describe')" prop="description" class="tag-item">
<a-input <a-input
v-model="form.description" v-model="form.description"
:placeholder="$t('PleaseEnterDescription')" :placeholder="$t('PleaseEnterDescription')"
@@ -136,15 +136,15 @@
width: 170 width: 170
} }
], ],
labelCol: { span:4 }, labelCol: { span:6 },
wrapperCol: { span: 18 }, wrapperCol: { span: 16 },
form:{}, form:{},
rules:{ rules:{
dictName:[{ required: true, message: this.$t('PleaseEnterLabelName'), trigger: 'change' }, dictName:[{ required: true, message: this.$t('PleaseEnterLabelName'), trigger: 'change' },
{ min: 1, max: 100, message: this.$t('LengthBe1to100'), trigger: 'blur' }], { min:1, max: 30, message: this.$t('cantExeed')+'30'+this.$t('characters'), trigger: 'blur' },],
attributeType:[ attributeType:[
{ required: true, message: this.$t('PleaseSelectLabelType'), trigger: 'blur' }, { required: true, message: this.$t('PleaseSelectLabelType'), trigger: 'blur' },
{ min:1, max: 300, message: this.$t('cantExeed')+'300'+this.$t('characters'), trigger: 'blur' },
], ],
}, },
// typeVisible:{}, // typeVisible:{},
@@ -210,7 +210,13 @@
this.contentVisible=false this.contentVisible=false
this.form={} this.form={}
}else{ }else{
this.$message.warning(this.$t('operationFailed')) if(res.message='标签名称不能重复'){
this.$message.warning(this.$t('labelNameCannotDuplicate'))
}else{
this.$message.warning(this.$t('operationFailed'))
}
} }
}) })
@@ -226,14 +232,10 @@
this.form={} this.form={}
}else{ }else{
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
}) })
} }
} }
}) })
}, },
@@ -326,6 +328,7 @@
} }
} }
.page{ .page{
margin-top: 20px; margin-top: 20px;
text-align: right; text-align: right;
@@ -351,6 +354,13 @@
.ant-modal-footer{ .ant-modal-footer{
text-align: center; text-align: center;
} }
}
}
.tag-content{
.tag-item{
.ant-col-6{
min-width: 130px;
}
}
}
</style> </style>
@@ -0,0 +1,501 @@
<template>
<div class="search-con-text">
<div class="search-text-wrap">
<div class="text-left">
<div class="text-left-wrap">
<div class="text-left-select" v-for="item in searchOption" :key="item.id">
<span class="text-sel">{{item.value}}</span>
<a-select class="text-select" :default-value="item.option[0].value" style="width: 120px"
@change="handleChange">
<a-select-option v-for="opt in item.option" :value="opt.value">
{{opt.value}}
</a-select-option>
</a-select>
</div>
<div class="text-left-select">
<span class="text-sel">发布日期</span>
<a-date-picker class="text-select" @change="onChange"/>
</div>
<div class="text-left-select">
<span class="text-sel">标准实施日期</span>
<a-date-picker class="text-select" @change="onChange"/>
</div>
</div>
</div>
<div class="text-right">
<div class="search-text-list">
<div class="search-text-title">
<span>检索范围:</span>
<span>纯电动</span>
<div class="search-header-right">
<a-icon type="appstore" class="header-list" :title="$t('list')" :class="{'header-list-active':isTrue }"
@click="selectListModel('list')"></a-icon>
<a-icon type="unordered-list" class="header-list" :title="$t('paragraph')"
:class="{'header-list-active':!isTrue }"
@click="selectListModel('unord')"></a-icon>
</div>
</div>
<a-table
v-if="isTrue"
ref="table"
size="middle"
bordered
rowKey="id"
:data-source="tableData"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
>
<!-- 字符串超长截取省略号显示-->
<!-- <span slot="templateContent" slot-scope="text">-->
<!-- <j-ellipsis :value="text" :length="25"/>-->
<!-- </span>-->
</a-table>
<div v-if="!isTrue" class="box-content">
<a-checkbox-group v-model="checkboxText">
<li v-for="item in conList" :key="item.id">
<div style="margin-bottom: 10px;position: relative">
<a-checkbox :value="item.id" class="checkbox-left"></a-checkbox>
<div class="text-text-right"
@click="checkedClick(item)"
:class="{ 'null-input':item.checked }">
<div class="text-header">
<span>{{item.type}}</span>
<span>{{item.number}}</span>
<span>{{item.title}}</span>
</div>
<div class="text-content">
{{item.content}}
</div>
</div>
</div>
</li>
</a-checkbox-group>
</div>
<div class="page">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'DocumentLibrary',
data() {
return {
searchOption: [
{
id: 1,
label: 'categary',
value: '适用区域',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 2,
label: 'type',
value: '类别',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 3,
label: 'stand',
value: '标准体系',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 4,
label: 'state',
value: '状态',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 5,
label: 'trial',
value: '适用范围',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 6,
label: 'funArea',
value: '功能领域',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 7,
label: 'techArea',
value: '技术领域',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
}
],
tableData: [],
columns: [
{
title: '编号',
align: 'center',
dataIndex: 'templateCode'
},
{
title: '标题',
align: 'center',
dataIndex: 'templateName'
},
{
title: '文件名称',
align: 'center',
dataIndex: 'template'
},
{
title: '状态',
align: 'center',
dataIndex: 'templateCon',
sorter: (a, b) => a.age - b.age
},
{
title: '适用地区',
align: 'center',
dataIndex: 'templateCont',
sorter: (a, b) => a.age - b.age
},
{
title: '功能领域',
align: 'center',
dataIndex: 'templateContent1'
},
{
title: '技术领域',
align: 'center',
dataIndex: 'templateContent2'
}
],
selectedRowKeys: [],
isTrue: true,
checkboxText: [],
conList: [
{
id: 1,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 2,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 3,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 4,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 5,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
}
],
total: 0,
pageSize: 10,
pageNo: 1
}
},
watch: {
checkboxText: function(value) {
this.conList.forEach(val => {
val.checked = false
})
if (value.length > 0) {
this.conList.forEach(val => {
value.forEach(res => {
if (res === val.id) {
val.checked = true
}
})
})
}
this.conList = [...this.conList]
}
},
methods: {
handleChange() {
},
onChange(date, dateString) {
// console.log(date, dateString);
},
selectListModel(val) {
this.isTrue = val == 'list' ? true : false
},
onSelectChange() {
},
checkedClick(item) {
if (item.checked) {
this.checkboxText = this.checkboxText.filter(res => {
return res !== item.id
})
} else {
this.checkboxText.push(item.id)
}
},
pageOnChange(page, pageSize) {
this.pageNo = page
},
SizeChange(page, pageSize) {
this.pageSize = pageSize
}
}
}
</script>
<style>
.checkbox-left .ant-checkbox-inner {
width: 18px !important;
height: 18px !important;
line-height: 18px !important;
}
</style>
<style lang="less" scoped>
.search-con-text {
.search-text-wrap {
margin-top: -27px;
height: 100%;
display: flex;
justify-content: flex-start;
.text-left {
width: 358px;
padding: 24px 24px 24px 0;
box-sizing: border-box;
.text-left-wrap {
.text-left-select {
display: flex;
justify-content: space-between;
margin-bottom: 24px;
line-height: 32px;
.text-sel {
font-size: 14px;
font-weight: 400;
color: #000F16;
text-align: right;
margin-right: 14px;
width: 83px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-select {
flex: 1;
}
}
}
}
.text-right {
width: 100%;
position: relative;
padding: 26px 0 22px 24px;
box-sizing: border-box;
border-left: 2px solid #E6E7EC;
.search-text-title {
padding: 0 0 24px 0;
span {
font-size: 14px;
font-weight: 400;
color: #040B29;
}
.search-header-right {
float: right;
margin-top: -7px;
a-icon {
border: 1px solid rgba(0, 0, 0, 0.65);
cursor: pointer;
padding: 2px 5px;
border-right: none;
}
a-icon:last-child {
border-right: 1px solid rgba(0, 0, 0, 0.65);
}
.header-list {
font-size: 20px;
border: 1px solid gray;
border-radius: 3px;
padding: 3px;
}
.header-list:hover {
color: #00B3BE;
border: 1px solid #00B3BE;
}
.header-list-active {
border: 1px solid #00B3BE;
color: #00B3BE;
}
}
}
.search-text-list {
ul {
padding: 0 0 0 18px;
margin: 0;
li {
list-style: none;
.text-content {
font-size: 14px;
font-weight: 400;
color: #040B29;
opacity: 0.8;
}
}
}
}
}
}
}
.checkbox-left {
float: left;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
.text-text-right {
padding: 19px 28px;
box-sizing: border-box;
margin-left: 38px;
}
.null-input {
background-color: #F2F4F8;
}
.text-header {
margin-bottom: 11px;
span {
margin-right: 52px;
font-size: 16px;
font-weight: bold;
color: #040B29;
}
}
.text-content {
font-size: 14px;
font-weight: 400;
color: #040B29;
opacity: 0.7;
}
.box-content {
padding: 0 0 0 8px;
box-sizing: border-box;
}
.page {
text-align: right;
margin-top: 20px;
}
</style>
@@ -0,0 +1,181 @@
<template>
<div class="box">
<div class="search-text-title">
<span>检索范围:</span>
<span>纯电动</span>
<!-- <div class="search-header-right" v-if="showList">-->
<!-- &lt;!&ndash; <a-icon type="appstore" />&ndash;&gt;-->
<!-- <a-icon :type="item.type" v-for="item in listOption" class="header-list"-->
<!-- :class="{'header-list-active':selectList.indexOf(item.value) !== -1 }"-->
<!-- @click="selectListModel(item.value)"-->
<!-- ></a-icon>-->
<!-- </div>-->
</div>
<a-checkbox-group v-model="checkboxText">
<li v-for="item in conList" :key="item.id">
<div style="margin-bottom: 10px;position: relative">
<a-checkbox :value="item.id" class="checkbox-left"></a-checkbox>
<div class="text-text-right"
@click="checkedClick(item)"
:class="{ 'null-input':item.checked }">
<div class="text-header">
<span>{{item.type}}</span>
<span>{{item.number}}</span>
<span>{{item.title}}</span>
</div>
<div class="text-content">
{{item.content}}
</div>
</div>
</div>
</li>
</a-checkbox-group>
<div class="page">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
</div>
</template>
<script>
export default {
name: 'whole',
data() {
return {
checkboxText: [],
conList: [
{
id: 1,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 2,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 3,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 4,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 5,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
}
],
total: 0,
pageSize: 10,
pageNo: 1
}
},
watch: {
checkboxText: function(value) {
this.conList.forEach(val => {
val.checked = false
})
if (value.length > 0) {
this.conList.forEach(val => {
value.forEach(res => {
if (res === val.id) {
val.checked = true
}
})
})
}
this.conList = [...this.conList]
}
},
methods: {
checkedClick(item) {
if (item.checked) {
this.checkboxText = this.checkboxText.filter(res => {
return res !== item.id
})
} else {
this.checkboxText.push(item.id)
}
},
pageOnChange(page, pageSize) {
this.pageNo = page
},
SizeChange(page, pageSize) {
this.pageSize = pageSize
}
}
}
</script>
<style scoped lang="less">
.box {
padding: 0 0 0 18px;
box-sizing: border-box;
}
.checkbox-left {
float: left;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
.text-text-right {
padding: 19px 28px;
box-sizing: border-box;
margin-left: 38px;
}
.null-input {
background-color: #F2F4F8;
}
.search-text-title {
margin-bottom: 22px;
}
.text-header {
margin-bottom: 11px;
span {
margin-right: 52px;
font-size: 16px;
font-weight: bold;
color: #040B29;
}
}
.text-content {
font-size: 14px;
font-weight: 400;
color: #040B29;
opacity: 0.7;
}
.page {
text-align: right;
margin-top: 20px;
}
</style>
@@ -4,12 +4,7 @@
<div class="search-center-wrap"> <div class="search-center-wrap">
<div class="search-detail"> <div class="search-detail">
<div class="search-detail-wrap"> <div class="search-detail-wrap">
<!-- <div class="search-detail-title">搜索内容</div>--> <a-input-group class="input-group" compact v-if="active === $t('DocumentLibrary')">
<!-- <a-input placeholder="请输入搜索内容" />-->
<!-- <a-button type="primary">搜索</a-button>-->
<!-- <a-button>清空</a-button>-->
<a-input-group compact v-if="showList">
<a-select default-value="Option1"> <a-select default-value="Option1">
<a-select-option value="Option1"> <a-select-option value="Option1">
标题 标题
@@ -26,107 +21,29 @@
></a-input-search> ></a-input-search>
</a-input-group> </a-input-group>
<a-input-search <a-input-search
v-else v-else-if="active === $t('whole')"
allowClear class="inputSearch"
allow-clear
placeholder="请输入搜索内容" placeholder="请输入搜索内容"
@search="onSearch" @search="onSearch"
></a-input-search> ></a-input-search>
<!-- <a-button @click="searchReset(1)" style="margin-left: 20px" icon="redo">重置</a-button>-->
<!-- <a href="javascript:;">结果中检索</a>-->
</div> </div>
</div> </div>
<div class="search-center-content"> <div class="search-center-content">
<div class="search-con-header"> <div class="search-con-header">
<div class="search-header-left"> <div class="search-header-left">
<a-tabs :default-active-key="$t('whole')" @change="callback"> <a-tabs :default-active-key="active" @change="callback">
<a-tab-pane :key="$t('whole')" :tab="$t('whole')"></a-tab-pane> <a-tab-pane :key="$t('whole')" :tab="$t('whole')"></a-tab-pane>
<a-tab-pane :key="$t('DocumentLibrary')" :tab="$t('DocumentLibrary')" force-render> <a-tab-pane :key="$t('DocumentLibrary')" :tab="$t('DocumentLibrary')" force-render>
</a-tab-pane> </a-tab-pane>
<a-tab-pane :key="$t('KnowledgeDatabase')" :tab="$t('KnowledgeDatabase')"></a-tab-pane> <!-- <a-tab-pane :key="$t('KnowledgeDatabase')" :tab="$t('KnowledgeDatabase')"></a-tab-pane>-->
<a-tab-pane :key="$t('DocumentComparisonLibrary')" :tab="$t('DocumentComparisonLibrary')"></a-tab-pane> <!-- <a-tab-pane :key="$t('DocumentComparisonLibrary')" :tab="$t('DocumentComparisonLibrary')"></a-tab-pane>-->
<a-tab-pane :key="$t('weekly')" :tab="$t('weekly')"></a-tab-pane> <!-- <a-tab-pane :key="$t('weekly')" :tab="$t('weekly')"></a-tab-pane>-->
</a-tabs> </a-tabs>
</div> </div>
</div> </div>
<div class="search-con-text"> <whole v-if="active === $t('whole')"/>
<div class="search-text-wrap"> <DocumentLibrary v-else-if="active === $t('DocumentLibrary')"/>
<div class="text-left" v-if="searchShow">
<div class="text-left-wrap">
<div class="text-left-select" v-for="item in searchOption" :key="item.id">
<span class="text-sel">{{item.value}}</span>
<a-select class="text-select" :default-value="item.option[0].value" style="width: 120px"
@change="handleChange">
<a-select-option v-for="opt in item.option" :value="opt.value">
{{opt.value}}
</a-select-option>
</a-select>
</div>
<div class="text-left-date">
<span class="data-fb">发布日期</span>
<a-date-picker @change="onChange"/>
</div>
<div class="text-left-date">
<span class="data-fb">标准实施日期</span>
<a-date-picker @change="onChange"/>
</div>
</div>
</div>
<div class="text-right" :class="{'text-right-right':searchShow}">
<div class="search-text-title">
<span>检索范围:</span>
<span>纯电动</span>
<div class="search-header-right" v-if="showList">
<!-- <a-icon type="appstore" />-->
<a-icon :type="item.type" v-for="item in listOption" class="header-list"
:class="{'header-list-active':selectList.indexOf(item.value) !== -1 }"
@click="selectListModel(item.value)"
></a-icon>
</div>
</div>
<div class="search-text-list">
<a-table
v-if="searchShow"
ref="table"
size="middle"
bordered
rowKey="id"
:data-source="tableData"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
>
<!-- 字符串超长截取省略号显示-->
<span slot="templateContent" slot-scope="text">
<j-ellipsis :value="text" :length="25"/>
</span>
</a-table>
<ul v-if="!searchShow">
<a-checkbox-group v-model="checkboxText">
<li v-for="item in conList" :key="item.id">
<div style="margin-bottom: 10px;position: relative">
<a-checkbox :value="item.id" class="checkbox-left"></a-checkbox>
<div class="text-text-right"
@click="checkedClick(item)"
:class="{ 'null-input':item.checked }">
<div class="text-header">
<span>{{item.type}}</span>
<span>{{item.number}}</span>
<span>{{item.title}}</span>
</div>
<div class="text-content">
{{item.content}}
</div>
</div>
</div>
</li>
</a-checkbox-group>
</ul>
<a-pagination size="small" :total="50" class="paginationbox" :show-total="total => `总共 ${total} `"
show-size-changer show-quick-jumper/>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -134,307 +51,28 @@
</template> </template>
<script> <script>
import whole from './components/whole'
import DocumentLibrary from './components/DocumentLibrary'
export default { export default {
name: 'searchCenter', name: 'searchCenter',
components: {
whole,
DocumentLibrary
},
data() { data() {
return { return {
selectedRowKeys: [], active: this.$t('whole'),
isNullInput: false, showList: false
columns: [
{
title: '编号',
align: 'center',
dataIndex: 'templateCode'
},
{
title: '标题',
align: 'center',
dataIndex: 'templateName'
},
{
title: '文件名称',
align: 'center',
dataIndex: 'templateContent'
},
{
title: '状态',
align: 'center',
dataIndex: 'templateContent',
sorter: (a, b) => a.age - b.age
},
{
title: '适用地区',
align: 'center',
dataIndex: 'templateContent',
sorter: (a, b) => a.age - b.age
},
{
title: '功能领域',
align: 'center',
dataIndex: 'templateContent'
},
{
title: '技术领域',
align: 'center',
dataIndex: 'templateContent'
}
],
options: [
{
label: 'all',
value: '全部'
},
{
label: 'library',
value: '文档库'
}, {
label: 'questions',
value: '知识问题库'
},
{
label: 'contract',
value: '文档对比库'
}, {
label: 'report',
value: '法规月报'
}
],
selectOption: '全部',
showList: false,
showbox: false,
listOption: [
{
label: 'list',
value: '列表',
type: 'appstore'
},
{
label: 'graph',
value: '段落',
type: 'unordered-list'
}
],
selectList: '列表',
conList: [
{
id: 1,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 2,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 3,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 4,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
},
{
id: 5,
type: '文档库',
number: 'GB20999-2019',
title: '内饰件阻燃特性',
content: '区域:东亚 国家/地区:中国 标准性质:-- 标准状态:现行 内容摘要: 标准文: 标准类别:-- 标准号: 1229导入-中国市场11-中国市场11 标准名称:1229导入-中国市场11 标准英文名称:Englist 发布日期:2021-12-26 实施日期:2021-12-30 新定型车实施日期:2021-12-26 新生产车实施日期:-- 注册登记车实施日期:-- 在产车实施日期:-- 适用认证:公告, 发布部门: 代替标准号:1229导入 被代替标准号:1229导入-中国市场11 采用国际标准号: 采标程度:-- 适用车型:M1,M2,M3, 能源种类:汽油,纯电, 起草单位: 起草人: 关键词: 备注:-- 责任部门:-- 所属专业领域:-- '
}
],
searchOption: [
{
id: 1,
label: 'categary',
value: '适用区域',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 2,
label: 'type',
value: '类别',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 3,
label: 'stand',
value: '标准体系',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 4,
label: 'state',
value: '状态',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 5,
label: 'trial',
value: '适用范围',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 6,
label: 'funArea',
value: '功能领域',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
},
{
id: 7,
label: 'techArea',
value: '技术领域',
option: [
{
label: 'china',
value: '中国'
},
{
label: 'english',
value: '英国'
}
]
}
],
searchShow: false,
checkboxText: []
}
},
watch: {
checkboxText: function(value) {
this.conList.forEach(val => {
val.checked = false
})
if (value.length > 0) {
this.conList.forEach(val => {
value.forEach(res => {
if (res === val.id) {
val.checked = true
}
})
})
}
this.conList = [...this.conList]
} }
}, },
methods: { methods: {
checkedClick(item) {
if (item.checked) {
this.checkboxText = this.checkboxText.filter(res => {
return res !== item.id
})
} else {
this.checkboxText.push(item.id)
}
console.log(this.checkboxText)
},
selectModel(value) {
this.selectOption = value
if (value == '文档库') {
this.showList = true
} else {
this.showList = false
}
},
callback(key) { callback(key) {
console.log(key) this.active = key
this.selectOption = key
// if(key =='全部' || key =='知识问题库' || key =='文档对比库' || key =='周报') {
// this.showbox = true
// }else{
// this.showbox = false
// this.showList=true
// }
if (key == '文档库') {
this.showList = true
} else {
this.showList = false
}
if (key == '段落') {
this.searchShow = true
} else {
this.searchShow = false
}
}, },
onSearch() { onSearch() {
},
selectListModel(value) {
this.selectList = value
if (value == '段落') {
this.searchShow = true
} else {
this.searchShow = false
}
},
handleChange() {
},
onChange(date, dateString) {
// console.log(date, dateString);
} }
} }
} }
@@ -450,14 +88,6 @@
.search-center { .search-center {
/*background-color: #ffffff;*/ /*background-color: #ffffff;*/
.null-input {
background-color: #F2F4F8;
}
.no-null-input {
/*background-color: rgba(255, 255, 255, 0.8);*/
}
.search-center-wrap { .search-center-wrap {
margin: 10px; margin: 10px;
@@ -473,20 +103,6 @@
margin-right: 10px; margin-right: 10px;
line-height: 32px; line-height: 32px;
} }
input {
min-width: 300px;
margin-right: 30px;
}
button {
margin-right: 20px;
}
a {
width: 140px;
line-height: 32px;
}
} }
} }
@@ -504,202 +120,43 @@
margin-right: 10px; margin-right: 10px;
padding: 4px 20px; padding: 4px 20px;
} }
.search-header-item:hover {
color: #1890FF;
cursor: pointer;
}
.search-header-item-active {
background: #1890FF;
border-radius: 15px;
color: #ffffff;
}
.search-header-item-active:hover {
color: #ffffff;
}
}
}
.search-con-text {
.search-text-wrap {
margin-top: -27px;
/*background: #ffffff;*/
height: 100%;
display: flex;
justify-content: flex-start;
.text-left {
width: 358px;
padding: 24px 24px 24px 0;
box-sizing: border-box;
.text-left-wrap {
.text-left-select {
display: flex;
justify-content: space-between;
margin-bottom: 24px;
line-height: 32px;
.text-sel {
//span{
// float: right;
//}
font-size: 14px;
font-weight: 400;
color: #000F16;
text-align: right;
margin-right: 14px;
min-width: 83px;
}
.text-select {
flex: 1;
//margin-top: 10px;
}
}
.text-left-date {
display: flex;
justify-content: space-between;
line-height: 32px;
margin: 23px 0;
span.data-fb {
text-align: right;
margin-right: 14px;
min-width: 84px;
font-size: 14px;
font-weight: 400;
color: #000F16;
}
}
}
}
.text-right {
width: 100%;
position: relative;
padding: 26px 0 22px 0;
box-sizing: border-box;
.search-text-title {
padding: 0 0 22px 0;
span {
font-size: 14px;
font-weight: 400;
color: #040B29;
}
.search-header-right {
float: right;
margin-top: -2px;
a-icon {
border: 1px solid rgba(0, 0, 0, 0.65);
cursor: pointer;
padding: 2px 5px;
border-right: none;
}
a-icon:last-child {
border-right: 1px solid rgba(0, 0, 0, 0.65);
}
.header-list {
font-size: 20px;
border: 1px solid gray;
border-radius: 3px;
padding: 3px;
}
.header-list:hover {
color: #00B3BE;
}
.header-list-active {
border: 1px solid #00B3BE;
color: #00B3BE;
}
.header-list-active:hover {
color: gray;
}
}
}
.search-text-list {
ul {
padding: 0 0 0 18px;
margin: 0;
li {
list-style: none;
//background: #f6f6f6;
//border: 1px solid #000000;
//border-radius: 10px;
/*padding: 10px;*/
.text-header {
margin-bottom: 11px;
span {
margin-right: 52px;
font-size: 16px;
font-weight: bold;
color: #040B29;
}
}
.text-content {
font-size: 14px;
font-weight: 400;
color: #040B29;
opacity: 0.8;
}
}
}
.paginationbox {
position: absolute;
bottom: 0;
right: 0;
}
}
.ant-pagination {
margin-bottom: 10px;
}
}
} }
} }
} }
} }
} }
.checkbox-left { .inputSearch {
float: left; width: 400px;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
} }
.text-text-right { .input-group {
padding: 19px 28px; width: 488px;
box-sizing: border-box;
margin-left: 38px;
} }
</style>
.text-right-right { <style>
border-left: 2px solid #E6E7EC; .inputSearch .ant-input {
padding: 24px 0 24px 24px !important; height: 40px;
box-sizing: border-box; line-height: 40px;
}
.input-group .ant-select-selection{
width: 88px;
height: 40px;
line-height: 40px;
padding: 0 0 0 6px;
}
.input-group .ant-select-selection__rendered{
height: 40px;
line-height: 40px;
}
.input-group .ant-input{
height: 40px;
line-height: 40px;
}
.input-group .ant-select-arrow{
right: 15px;
}
.input-group .ant-select{
background: #F6F7FA;
} }
</style> </style>
+169 -153
View File
@@ -51,7 +51,8 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6" style="text-align: right"> <a-col :span="6" style="text-align: right">
<img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage" @click="handleChangeCheckCode"/> <img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage"
@click="handleChangeCheckCode"/>
<img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode"/> <img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode"/>
</a-col> </a-col>
<a-col :span="3"></a-col> <a-col :span="3"></a-col>
@@ -64,13 +65,13 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"></a-col> <a-col :span="6"></a-col>
<a-col :span="5" style="text-align: right;color: #1891FF;"> <!-- <a-col :span="5" style="text-align: right;color: #1891FF;">-->
<a-form-item> <!-- <a-form-item>-->
<router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;"> <!-- <router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">-->
忘记密码 <!-- 忘记密码-->
</router-link> <!-- </router-link>-->
</a-form-item> <!-- </a-form-item>-->
</a-col> <!-- </a-col>-->
</a-row> </a-row>
<a-row class="login-btn"> <a-row class="login-btn">
<a-col :span="3"></a-col> <a-col :span="3"></a-col>
@@ -84,7 +85,7 @@
:loading="loginBtn" :loading="loginBtn"
@click.stop.prevent="handleSubmit" @click.stop.prevent="handleSubmit"
:disabled="loginBtn"> :disabled="loginBtn">
{{ loginBtn ? "登录中" : "登录" }} {{ loginBtn ? '登录中' : '登录' }}
</a-button> </a-button>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -92,7 +93,8 @@
</a-row> </a-row>
</div> </div>
</a-form> </a-form>
<a-form v-if="mobile" :form="form" class="user-layout-login user-layout-login-mobile" ref="formLogin" id="formLogin"> <a-form v-if="mobile" :form="form" class="user-layout-login user-layout-login-mobile" ref="formLogin"
id="formLogin">
<div class="user-box user-box-mobile"> <div class="user-box user-box-mobile">
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
@@ -136,7 +138,8 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="10" style="text-align: right"> <a-col :span="10" style="text-align: right">
<img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage" @click="handleChangeCheckCode"/> <img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage"
@click="handleChangeCheckCode"/>
<img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode"/> <img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode"/>
</a-col> </a-col>
</a-row> </a-row>
@@ -147,13 +150,13 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="4"></a-col> <a-col :span="4"></a-col>
<a-col :span="9" style="text-align: right;color: #1891FF;"> <!-- <a-col :span="9" style="text-align: right;color: #1891FF;">-->
<a-form-item> <!-- <a-form-item>-->
<router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;"> <!-- <router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">-->
忘记密码 <!-- 忘记密码-->
</router-link> <!-- </router-link>-->
</a-form-item> <!-- </a-form-item>-->
</a-col> <!-- </a-col>-->
</a-row> </a-row>
<a-row class="login-btn"> <a-row class="login-btn">
<a-col :span="24"> <a-col :span="24">
@@ -166,7 +169,7 @@
:loading="loginBtn" :loading="loginBtn"
@click.stop.prevent="handleSubmit" @click.stop.prevent="handleSubmit"
:disabled="loginBtn"> :disabled="loginBtn">
{{ loginBtn ? "登录中" : "登录" }} {{ loginBtn ? '登录中' : '登录' }}
</a-button> </a-button>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -176,58 +179,59 @@
</div> </div>
</template> </template>
<script> <script>
import { mapActions } from "vuex" import { mapActions } from 'vuex'
import { timeFix } from "@/utils/util" import { timeFix } from '@/utils/util'
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN ,ENCRYPTED_STRING} from "@/store/mutation-types" import { ACCESS_TOKEN, ENCRYPTED_STRING } from '@/store/mutation-types'
import { putAction,postAction,getAction } from '@/api/manage' import { putAction, postAction, getAction } from '@/api/manage'
import { USER_INFO } from "@/store/mutation-types" import { USER_INFO } from '@/store/mutation-types'
import {getRSAPublicKey} from '@/api/login.js' import { getRSAPublicKey } from '@/api/login.js'
const Base64 = require('js-base64').Base64 const Base64 = require('js-base64').Base64
import {JSEncrypt} from 'jsencrypt' import { JSEncrypt } from 'jsencrypt'
export default { export default {
components: {}, components: {},
data () { data() {
return { return {
loginBtn: false, loginBtn: false,
mobile:isMobile(), mobile: isMobile(),
// login type: 0 email, 1 username, 2 telephone // login type: 0 email, 1 username, 2 telephone
loginType: 0, loginType: 0,
stepCaptchaVisible: false, stepCaptchaVisible: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
state: { state: {
time: 60, time: 60,
smsSendBtn: false, smsSendBtn: false
}, },
validatorRules:{ validatorRules: {
username:{rules: [{ required: true, message: '请输入用户名!'},{validator: this.handleUsernameOrEmail}]}, username: { rules: [{ required: true, message: '请输入用户名!' }, { validator: this.handleUsernameOrEmail }] },
password:{rules: [{ required: true, message: '请输入密码!',validator: 'click'}]}, password: { rules: [{ required: true, message: '请输入密码!', validator: 'click' }] },
mobile:{rules: [{validator:this.validateMobile}]}, mobile: { rules: [{ validator: this.validateMobile }] },
captcha:{rule: [{ required: true, message: '请输入验证码!'}]}, captcha: { rule: [{ required: true, message: '请输入验证码!' }] },
inputCode:{rules: [{ required: true, message: '请输入验证码!'}]} inputCode: { rules: [{ required: true, message: '请输入验证码!' }] }
}, },
velorifiedCode:"", velorifiedCode: '',
inputCodeContent:"", inputCodeContent: '',
inputCodeNull:true, inputCodeNull: true,
currentUsername:"", currentUsername: '',
currdatetime:'', currdatetime: '',
randCodeImage:'', randCodeImage: '',
requestCodeSuccess:false, requestCodeSuccess: false,
rsaPublicKey:'' rsaPublicKey: ''
} }
}, },
created () { created() {
this.currdatetime = new Date().getTime(); this.currdatetime = new Date().getTime()
Vue.ls.remove(ACCESS_TOKEN) Vue.ls.remove(ACCESS_TOKEN)
this.getRouterData(); this.getRouterData()
this.handleChangeCheckCode(); this.handleChangeCheckCode()
}, },
methods: { methods: {
...mapActions(['Login', 'Logout', 'PhoneLogin']), ...mapActions(['Login', 'Logout', 'PhoneLogin']),
handleUsernameOrEmail (rule, value, callback) { handleUsernameOrEmail(rule, value, callback) {
const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/; const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/
if (regex.test(value)) { if (regex.test(value)) {
this.loginType = 0 this.loginType = 0
} else { } else {
@@ -235,194 +239,201 @@
} }
callback() callback()
}, },
handleSubmit () { handleSubmit() {
let that = this let that = this
let loginParams = {}; let loginParams = {}
that.loginBtn = true; that.loginBtn = true
that.form.validateFields([ 'username', 'password','inputCode', 'rememberMe' ], { force: true }, (err, values) => { that.form.validateFields(['username', 'password', 'inputCode', 'rememberMe'], { force: true }, (err, values) => {
if (!err) { if (!err) {
loginParams.remember_me = values.rememberMe loginParams.remember_me = values.rememberMe
loginParams.captcha = that.inputCodeContent loginParams.captcha = that.inputCodeContent
loginParams.checkKey = that.currdatetime loginParams.checkKey = that.currdatetime
loginParams.rsaPublicKey = that.rsaPublicKey; loginParams.rsaPublicKey = that.rsaPublicKey
// 新建JSEncrypt对象 // 新建JSEncrypt对象
let encrypt = new JSEncrypt(); let encrypt = new JSEncrypt()
encrypt.setPublicKey(loginParams.rsaPublicKey); encrypt.setPublicKey(loginParams.rsaPublicKey)
// 公钥加密 // 公钥加密
loginParams.username = encrypt.encrypt(values.username) loginParams.username = encrypt.encrypt(values.username)
loginParams.password = encrypt.encrypt(values.password) loginParams.password = encrypt.encrypt(values.password)
//登录 //登录
that.Login(loginParams).then((res) => { that.Login(loginParams).then((res) => {
this.loginSuccess() this.loginSuccess()
}).catch((err) => { }).catch((err) => {
if (err.code === 500) { if (err.code === 500) {
// 刷新验证码 // 刷新验证码
this.handleChangeCheckCode(); this.handleChangeCheckCode()
} }
that.requestFailed(err); that.requestFailed(err)
}); })
}else { } else {
that.loginBtn = false; that.loginBtn = false
} }
}) })
}, },
getCaptcha (e) { getCaptcha(e) {
e.preventDefault(); e.preventDefault()
let that = this; let that = this
this.form.validateFields([ 'mobile' ], { force: true },(err,values) => { this.form.validateFields(['mobile'], { force: true }, (err, values) => {
if(!values.mobile){ if (!values.mobile) {
that.cmsFailed("请输入手机号"); that.cmsFailed('请输入手机号')
}else if (!err) { } else if (!err) {
this.state.smsSendBtn = true; this.state.smsSendBtn = true
let interval = window.setInterval(() => { let interval = window.setInterval(() => {
if (that.state.time-- <= 0) { if (that.state.time-- <= 0) {
that.state.time = 60; that.state.time = 60
that.state.smsSendBtn = false; that.state.smsSendBtn = false
window.clearInterval(interval); window.clearInterval(interval)
} }
}, 1000); }, 1000)
const hide = this.$message.loading('验证码发送中..', 0); const hide = this.$message.loading('验证码发送中..', 0)
let smsParams = {}; let smsParams = {}
smsParams.mobile=values.mobile; smsParams.mobile = values.mobile
smsParams.smsmode="0"; smsParams.smsmode = '0'
postAction("/sys/sms",smsParams) postAction('/sys/sms', smsParams)
.then(res => { .then(res => {
if(!res.success){ if (!res.success) {
setTimeout(hide, 0); setTimeout(hide, 0)
this.cmsFailed(res.message); this.cmsFailed(res.message)
} }
setTimeout(hide, 500); setTimeout(hide, 500)
}) })
.catch(err => { .catch(err => {
setTimeout(hide, 1); setTimeout(hide, 1)
clearInterval(interval); clearInterval(interval)
that.state.time = 60; that.state.time = 60
that.state.smsSendBtn = false; that.state.smsSendBtn = false
this.requestFailed(err); this.requestFailed(err)
}); })
} }
} }
); )
}, },
handleChangeCheckCode(){ handleChangeCheckCode() {
this.currdatetime = new Date().getTime(); this.currdatetime = new Date().getTime()
getAction(`/sys/randomImage/${this.currdatetime}`).then(res=>{ getAction(`/sys/randomImage/${this.currdatetime}`).then(res => {
if(res.success){ if (res.success) {
this.randCodeImage = res.result this.randCodeImage = res.result
this.requestCodeSuccess=true this.requestCodeSuccess = true
}else{ } else {
this.$message.error(res.message) this.$message.error(res.message)
this.requestCodeSuccess=false this.requestCodeSuccess = false
} }
}).catch(()=>{ }).catch(() => {
this.requestCodeSuccess=false this.requestCodeSuccess = false
}) })
this.getPublicKey(); this.getPublicKey()
}, },
//获取RSA公钥 //获取RSA公钥
getPublicKey(){ getPublicKey() {
// 获取公钥 // 获取公钥
getRSAPublicKey().then(res => { getRSAPublicKey().then(res => {
this.rsaPublicKey = res.result this.rsaPublicKey = res.result
}) })
}, },
loginSuccess () { loginSuccess() {
let langCn = localStorage.language let langCn = localStorage.language
// 默认中文 // 默认中文
if (!langCn) { if (!langCn) {
localStorage.setItem('language', 'zh-cn') localStorage.setItem('language', 'zh-cn')
} }
this.$router.push({ path: "/dashboard/analysis" }).catch((res)=>{}) this.$router.push({ path: '/dashboard/analysis' }).catch((res) => {
})
this.$notification.success({ this.$notification.success({
message: '欢迎', message: '欢迎',
description: `${timeFix()},欢迎回来`, description: `${timeFix()},欢迎回来`
}); })
}, },
cmsFailed(err){ cmsFailed(err) {
this.$notification[ 'error' ]({ this.$notification['error']({
message: "登录失败",
description:err,
duration: 4,
});
},
requestFailed (err) {
this.$notification[ 'error' ]({
message: '登录失败', message: '登录失败',
description: ((err.response || {}).data || {}).message || err.message || "请求出现错误请稍后再试", description: err,
duration: 4, duration: 4
}); })
this.loginBtn = false;
}, },
validateMobile(rule,value,callback){ requestFailed(err) {
if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)){ this.form.resetFields()
callback(); this.$notification['error']({
}else{ message: '登录失败',
callback("您的手机号码格式不正确!"); // description:'账号或密码错误',
description: err.message == '验证码错误' ? err.message : '账号或密码错误',
duration: 4
})
this.loginBtn = false
},
validateMobile(rule, value, callback) {
if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)) {
callback()
} else {
callback('您的手机号码格式不正确!')
} }
}, },
validateInputCode(rule,value,callback){ validateInputCode(rule, value, callback) {
if(!value || this.verifiedCode==this.inputCodeContent){ if (!value || this.verifiedCode == this.inputCodeContent) {
callback(); callback()
}else{ } else {
callback("您输入的验证码不正确!"); callback('您输入的验证码不正确!')
} }
}, },
generateCode(value){ generateCode(value) {
this.verifiedCode = value.toLowerCase() this.verifiedCode = value.toLowerCase()
}, },
inputCodeChange(e){ inputCodeChange(e) {
this.inputCodeContent = e.target.value this.inputCodeContent = e.target.value
}, },
getRouterData(){ getRouterData() {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$route.params.username) { if (this.$route.params.username) {
this.form.setFieldsValue({ this.form.setFieldsValue({
'username': this.$route.params.username 'username': this.$route.params.username
}); })
} }
}) })
}, }
} }
} }
// 判断当前设备 // 判断当前设备
function isMobile() { function isMobile() {
var userAgentInfo = navigator.userAgent; var userAgentInfo = navigator.userAgent
var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var mobileAgents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']
var mobile_flag = false; var mobile_flag = false
//根据userAgent判断是否是手机 //根据userAgent判断是否是手机
for (var v = 0; v < mobileAgents.length; v++) { for (var v = 0; v < mobileAgents.length; v++) {
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) { if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
mobile_flag = true; mobile_flag = true
break; break
} }
} }
var screen_width = window.screen.width; var screen_width = window.screen.width
var screen_height = window.screen.height; var screen_height = window.screen.height
//根据屏幕分辨率判断是否是手机 //根据屏幕分辨率判断是否是手机
if (screen_width < 500 && screen_height < 800) { if (screen_width < 500 && screen_height < 800) {
mobile_flag = true; mobile_flag = true
} }
return mobile_flag; return mobile_flag
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ant-input-affix-wrapper/deep/ .ant-input:not(:first-child){ .ant-input-affix-wrapper /deep/ .ant-input:not(:first-child) {
padding-left: 40px; padding-left: 40px;
} }
.ant-row{
.ant-row {
margin-bottom: 4%; margin-bottom: 4%;
} }
.main{
.main {
height: 100%; height: 100%;
.user-layout-login{
.user-layout-login {
z-index: 99; z-index: 99;
width: 24%; width: 24%;
height: 56%; height: 56%;
@@ -435,14 +446,16 @@
right: 8%; right: 8%;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
.user-box{
.user-box {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-direction: column; flex-direction: column;
.title{
.title {
display: block; display: block;
color: #1891FF; color: #1891FF;
font-size: 28px; font-size: 28px;
@@ -450,13 +463,15 @@
margin: 0 0 5% 0; margin: 0 0 5% 0;
text-align: center; text-align: center;
} }
.login-btn{
.login-btn {
margin-bottom: 0; margin-bottom: 0;
font-size: 10px; font-size: 10px;
} }
} }
} }
.user-layout-login-mobile{
.user-layout-login-mobile {
right: 0; right: 0;
width: 100%; width: 100%;
min-width: 0 !important; min-width: 0 !important;
@@ -468,7 +483,8 @@
top: 50%; top: 50%;
margin-top: 6rem; margin-top: 6rem;
transform: translateY(-50%); transform: translateY(-50%);
.ant-row{
.ant-row {
margin-bottom: 0; margin-bottom: 0;
} }
} }