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("."));
//判断文件类型
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;
for (String fileTypeTemp : fileTypeArr) {
if (fileTypeTemp.equalsIgnoreCase(fileType)) {
@@ -101,6 +101,7 @@ public class SysCategoryController {
@AutoLog(value = "标签内容-树形结构-通过sysDictId查询")
@ApiOperation(value="标签内容-树形结构-通过sysDictId查询", notes="标签内容-树形结构-通过sysDictId查询")
@GetMapping(value = "/queryBySysDictId")
// @RequiresPermissions("sys:category:queryBySysDictId")
public Result<?> queryBySysDictId(@RequestParam(name="id",required=true) String sysDictId) {
List<SysCategory> sysCategory = sysCategoryService.queryBySysDictId(sysDictId);
if(sysCategory==null) {
@@ -365,26 +365,32 @@ public class SysDictController {
@ApiOperation(value = "字典控制器-新增字典", notes = "字典控制器-新增字典")
@RequiresRoles({"admin"})
@RequestMapping(value = "/add", method = RequestMethod.POST)
//@RequiresPermissions("dict:add")
public Result<SysDict> add(@RequestBody SysDict sysDict) {
Result<SysDict> result = new Result<SysDict>();
try {
Integer count = sysDictService.queryExitData(sysDict);
Integer countDictName=sysDictService.queryExitDictName(sysDict);
System.out.println("count="+count);
if (count > 0) {
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
} else {
if(sysDict.getIsTagDict() == 1){
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(sysDict.getDictName());
sysDict.setDictCode(pinYin);
if (countDictName > 0) {
result.error500("标签名称不能重复");
}else{
//判断逻辑删除
if (count > 0) {
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
} 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());
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
sysDictService.save(sysDict);
result.success("保存成功!");
//添加成功后需要刷新缓存
sysDictService.refreshCache();
}
result.success("保存成功!");
//添加成功后需要刷新缓存
sysDictService.refreshCache();
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
@@ -400,6 +406,7 @@ public class SysDictController {
@ApiOperation(value = "字典控制器-编辑字典", notes = "字典控制器-编辑字典")
@RequiresRoles({"admin"})
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
//@RequiresPermissions("dict:edit")
public Result<SysDict> edit(@RequestBody SysDict sysDict) {
Result<SysDict> result = new Result<SysDict>();
SysDict sysdict = sysDictService.getById(sysDict.getId());
@@ -460,6 +467,7 @@ public class SysDictController {
@RequiresRoles({"admin"})
@DeleteMapping(value = "/logicDelete")
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
//@RequiresPermissions("dict:logicDelete")
public Result<SysDict> logicDelete(@RequestParam(name="id",required=true) String id) {
Result<SysDict> result = new Result<SysDict>();
@@ -493,9 +501,9 @@ public class SysDictController {
}else {
if (StringUtils.isNotBlank(String.valueOf(sysDict.getIsReadOnly()))) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDict.getIsReadOnly())) {
result.error500("固定字段,不可删除");
result.error500("包含固定字段,不可删除");
} else {
sysDictService.removeByIds(Arrays.asList(ids.split(",")));
sysDict.setDelFlag(CommonConstant.DEL_FLAG_1);
result.success("删除成功!");
}
}
@@ -161,6 +161,5 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
"from sys_dict as d\n" +
"left join sys_dict_item as i on d.attribute_type=i.item_value\n" +
"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);
}
@@ -1,8 +1,6 @@
package com.jero.modules.system.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.system.vo.DictModel;
import com.jero.common.system.vo.DictQuery;
@@ -162,7 +160,7 @@ public interface ISysDictService extends IService<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);
}
@@ -382,13 +382,15 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
Integer count = sysDictMapper.selectCount(queryWrapper);
return count;
}
/*@Override
public List<Map<String, Object>> selectPageInfo(Page page, Wrapper<SysDict> queryWrapper) {
IPage<Map<String, Object>> info= sysDictMapper.selectPageInfo(page, queryWrapper);
List<Map<String, Object>> list = info.getRecords().stream().collect(Collectors.toList());
return list;
}*/
@Override
public Integer queryExitDictName(SysDict sysDict) {
LambdaQueryWrapper<SysDict> queryWrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotBlank(sysDict.getDictName())) {
queryWrapper.eq(SysDict::getDictName, sysDict.getDictName());
}
Integer count = sysDictMapper.selectCount(queryWrapper);
return count;
}
/**
* 标签内容-分页查询
@@ -1,30 +1,26 @@
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.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
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.service.IBussDocumentLibraryEOService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -47,27 +43,6 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@Autowired
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="分页查询")
@PostMapping(value = "/queryPageInfo")
@ResponseBody
// @RequiresPermissions("document:queryPageInfo")
public JSONObject queryPageInfo(@RequestBody Map<String,Object> parameter) {
IPage infoPage = bussDocumentLibraryEOService.getInfoPage(parameter);
Result<IPage> ok = Result.OK(infoPage);
@@ -94,6 +70,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value="代替标准分页列表查询", notes="代替标准分页列表查询")
@PostMapping(value = "/replacePageInfo")
@ResponseBody
// @RequiresPermissions("document:replacePageInfo")
public Result<?> replacePageInfo(@RequestBody Map<String,Object> parameter) {
IPage infoPage = bussDocumentLibraryEOService.replacePageInfo(parameter);
// Result<IPage> ok = Result.OK(infoPage);
@@ -110,6 +87,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value="ocr识别调取已入库文件", notes="ocr识别调取已入库文件")
@PostMapping(value = "/ocrPageInfo")
@ResponseBody
// @RequiresPermissions("document:ocrPageInfo")
public Result<?> ocrPageInfo(@RequestBody Map<String,Object> parameter) {
IPage infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
return Result.OK(infoPage);
@@ -138,6 +116,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-通过id删除")
@ApiOperation(value="文档库信息表-通过id删除", notes="文档库信息表-通过id删除")
@DeleteMapping(value = "/delete")
@RequiresPermissions("document:deleteBatch")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
bussDocumentLibraryEOService.deleteById(id);
return Result.OK("删除成功!");
@@ -152,6 +131,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-批量删除")
@ApiOperation(value="文档库信息表-批量删除", notes="文档库信息表-批量删除")
@DeleteMapping(value = "/deleteBatch")
@RequiresPermissions("document:deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.bussDocumentLibraryEOService.deleteByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
@@ -166,6 +146,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-通过id查询")
@ApiOperation(value="文档库信息表-通过id查询", notes="文档库信息表-通过id查询")
@GetMapping(value = "/queryById")
// @RequiresPermissions("document:queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(id);
if(bussDocumentLibraryEO==null) {
@@ -174,28 +155,6 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
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 = "文档库信息表-查询条件")
@ApiOperation(value="文档库信息表-查询条件", notes="文档库信息表-查询条件")
@GetMapping(value = "/queryCondition")
// @RequiresPermissions("document:queryCondition")
public Result<List<Map<String,Object>>> queryCondition(@RequestParam(name="flag",required=true) String flag,
@RequestParam(name="cut",required=true) String cut) {
List<Map<String,Object>> list = bussDocumentLibraryEOService.queryCondition(flag,cut);
@@ -220,6 +180,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-列表表头")
@ApiOperation(value="文档库信息表-列表表头", notes="文档库信息表-列表表头")
@GetMapping(value = "/getHeader")
// @RequiresPermissions("document:getHeader")
public Result<List<Map<String,Object>>> getHeader(@RequestParam(name="flag",required=true) String flag,
@RequestParam(name="cut",required=true) String cut) {
List<Map<String,Object>> list = bussDocumentLibraryEOService.getHeader(flag,cut);
@@ -234,6 +195,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-新增表单")
@ApiOperation(value="文档库信息表-新增表单", notes="文档库信息表-新增表单")
@GetMapping(value = "/getAddForm")
// @RequiresPermissions("document:getAddForm")
public Result<List<Map<String,Object>>> getAddForm(@RequestParam(name="flag",required=true) String flag,
@RequestParam(name="cut",required=true) String cut,
@RequestParam(name="type",required=true) String type) {
@@ -249,6 +211,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "文档库信息表-ocr表头和查询条件")
@ApiOperation(value="文档库信息表-ocr表头和查询条件", notes="文档库信息表-ocr表头和查询条件")
@GetMapping(value = "/getHeaderOrConditionForOcr")
// @RequiresPermissions("document:getHeaderOrConditionForOcr")
public Result<List<Map<String,Object>>> getHeaderOrConditionForOcr(@RequestParam(name="flag",required=true) String flag,
@RequestParam(name="cut",required=true) String cut) {
List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForOcr(flag,cut);
@@ -263,6 +226,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "编辑数据查询")
@ApiOperation(value="编辑数据查询", notes="编辑数据查询")
@GetMapping(value = "/getDocumentInfoById")
// @RequiresPermissions("document:getDocumentInfoById")
public Result<List<Map<String,Object>>> getDocumentInfoById(@RequestParam(name="id",required=true) String id,
@RequestParam(name="cut",required=true) String cut) {
List<Map<String, Object>> list = bussDocumentLibraryEOService.getDocumentInfoById(id,cut);
@@ -276,6 +240,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "详情数据查询")
@ApiOperation(value="详情数据查询", notes="详情数据查询")
@GetMapping(value = "/getInfoById")
// @RequiresPermissions("document:getInfoById")
public Result<List<Map<String,Object>>> getInfoById(@RequestParam(name="id",required=true) String id,
@RequestParam(name="cut",required=true) String cut) {
List<Map<String, Object>> list = bussDocumentLibraryEOService.getInfoById(id,cut);
@@ -290,7 +255,8 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "新增数据")
@ApiOperation(value="新增数据", notes="新增数据")
@PostMapping(value = "/addInfo")
public Result<?> addInfo(@RequestBody Map<String,Object> map) {
@RequiresPermissions("document:getInfoById")
public Result<?> getInfoById(@RequestBody Map<String,Object> map) {
try {
bussDocumentLibraryEOService.addInfo(map);
} catch (Exception e) {
@@ -307,6 +273,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "编辑数据")
@ApiOperation(value="编辑数据", notes="编辑数据")
@PostMapping(value = "/updateInfo")
@RequiresPermissions("document:updateInfo")
public Result<?> updateInfo(@RequestBody Map<String,Object> map) {
try {
bussDocumentLibraryEOService.updateInfo(map);
@@ -325,6 +292,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "添加收藏")
@ApiOperation(value="添加收藏", notes="添加收藏")
@GetMapping(value = "/addCollect")
@RequiresPermissions("document:addCollect")
public Result<?> addCollect(String id) {
try {
bussDocumentLibraryEOService.addCollect(id);
@@ -342,6 +310,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "取消收藏")
@ApiOperation(value="取消收藏", notes="取消收藏")
@GetMapping(value = "/cancelCollect")
@RequiresPermissions("document:addCollect")
public Result<?> cancelCollect(String id) {
try {
bussDocumentLibraryEOService.cancelCollect(id);
@@ -359,6 +328,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "添加订阅")
@ApiOperation(value="添加订阅", notes="添加订阅")
@GetMapping(value = "/addSubscribe")
@RequiresPermissions("document:addSubscribe")
public Result<?> addSubscribe(String id) {
try {
bussDocumentLibraryEOService.addSubscribe(id);
@@ -376,6 +346,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "取消订阅")
@ApiOperation(value="取消订阅", notes="取消订阅")
@GetMapping(value = "/cancelSubscribe")
@RequiresPermissions("document:addSubscribe")
public Result<?> cancelSubscribe(String id) {
try {
bussDocumentLibraryEOService.cancelSubscribe(id);
@@ -388,6 +359,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value = "导出excel")
@GetMapping(value = "/exportExcel")
@RequiresPermissions("document:exportExcel")
public void exportExcel(@RequestParam Map<String,Object> map,
HttpServletResponse response,
HttpServletRequest request){
@@ -396,6 +368,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value = "带文件导出")
@GetMapping(value = "/exportZip")
@RequiresPermissions("document:exportZip")
public void exportZip(@RequestParam Map<String,Object> map,
HttpServletResponse response,
HttpServletRequest request) throws Exception {
@@ -405,6 +378,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value = "模板下载")
@GetMapping(value = "/exportTemplate")
@RequiresPermissions("document:exportTemplate")
public void exportTemplate(@RequestParam Map<String,Object> map, HttpServletResponse response, HttpServletRequest request) throws Exception {
bussDocumentLibraryEOService.exportTemplate(map,response,request);
}
@@ -412,6 +386,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value = "导入.zip")
@PostMapping(value = "/importZip")
@RequiresPermissions("document:importZip")
public Result<?> importZip(@RequestParam(value = "file", required = false) MultipartFile file) throws Exception {
String result = bussDocumentLibraryEOService.importZip(file);
return Result.OK(result);
@@ -419,6 +394,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@ApiOperation(value = "推送")
@GetMapping(value = "/pullMessage")
@RequiresPermissions("document:pullMessage")
public Result<?> pullMessage(String departIds,String userIds,String 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");
@@ -878,9 +880,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<String> fieldFile = fieldFileList.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<SysCategory> categoryList = sysCategoryService.list();
//下拉选处理数据字典
for (Map.Entry<String, Object> entry : dataList.get(0).entrySet()) {
List<OnlCgformField> collect = fieldPullList.stream()
@@ -888,6 +896,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
.collect(Collectors.toList());
//下拉选处理数据字典
dictItem(sysDictItems, entry, collect, cut);
treeDictItem(categoryList, entry, treeFieldList, cut);
}
for (Map.Entry<String, Object> entry : mapTemp.entrySet()) {
List<OnlCgformField> collect = fieldPullList.stream()
@@ -895,6 +904,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
.collect(Collectors.toList());
//下拉选处理数据字典
dictItem(sysDictItems, entry, collect, cut);
treeDictItem(categoryList, entry, treeFieldList, cut);
}
StringBuilder sb = new StringBuilder();
@@ -1389,14 +1399,17 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//输入框
conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%')");
} 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 condition = new StringBuilder();
for (String valueTemp : value.split(",")) {
valueSb.append("'" + valueTemp + "',");
condition.append(" or " + key + " like concat(concat('%','" + valueTemp + "'),'%')");
}
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)) {
//日期(区分单日期还时间范围)
@@ -19,6 +19,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
@@ -91,6 +92,7 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
@AutoLog(value = "OCR识别转换记录表-同步至文档库")
@ApiOperation(value="OCR识别转换记录表-同步至文档库", notes="OCR识别转换记录表-同步至文档库")
@PostMapping(value = "/syncToDocument")
@RequiresPermissions("ocr:ocrRecord:syncToDocument")
public Result<?> syncToDocument(@RequestBody OcrRecordEO ocrRecordEO) {
if(StringUtils.isBlank(ocrRecordEO.getConnectId())){
return Result.error("同步失败");
@@ -209,6 +211,7 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
@AutoLog(value = "OCR识别转换记录表-通过id删除")
@ApiOperation(value="OCR识别转换记录表-通过id删除", notes="OCR识别转换记录表-通过id删除")
@DeleteMapping(value = "/delete")
@RequiresPermissions("ocr:ocrRecord:delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
if (StringUtils.isBlank(id)) {
return Result.error("删除数据不能为空");
@@ -226,6 +229,7 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
@AutoLog(value = "OCR识别转换记录表-批量删除")
@ApiOperation(value="OCR识别转换记录表-批量删除", notes="OCR识别转换记录表-批量删除")
@DeleteMapping(value = "/deleteBatch")
@RequiresPermissions("ocr:ocrRecord:deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
if (StringUtils.isBlank(ids)) {
return Result.error("删除数据不能为空");
@@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
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.Value;
import org.springframework.mock.web.MockMultipartFile;
@@ -64,12 +65,14 @@ public class OcrRestfulController{
@ApiOperation(value = "下载word文件")
@GetMapping("/downFile")
@RequiresPermissions("ocr:ocrRestful:downFile")
public void downFile(String fileName, HttpServletResponse response, HttpServletRequest request) throws Exception {
InputStream is = null;
OutputStream os = null;
response.reset();
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");
String fullPath = ocrPath + fileName;
@@ -151,6 +154,7 @@ public class OcrRestfulController{
*/
@ApiOperation(value = "新增OCR内容")
@PostMapping("/addOcrRecord")
@RequiresPermissions("ocr:ocrRestful:addOcrRecord")
public Result<?> addOcrRecord(@RequestBody OcrRecordEO ocrRecordEO) throws Exception {
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
log.info("收到文件上传请求,开始处理文件:【"+sdf.format(new Date())+"");
@@ -152,6 +152,7 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
ocrRecordEO.setStandName(getOcrEO.getStandName());
ocrRecordEO.setFileType(getOcrEO.getFileType());
ocrRecordEO.setConnectId(getOcrEO.getConnectId());
ocrRecordEO.setAttId(getOcrEO.getAttId());
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// ocrRecordEO.setCreateBy(sysUser.getId());
// ocrRecordEO.setCreateTime(new Date());
@@ -168,6 +169,7 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
ocrRecordEO.setFileType(getOcrEO.getFileType());
ocrRecordEO.setCreateTime(new Date());
ocrRecordEO.setConnectId(getOcrEO.getConnectId());
ocrRecordEO.setAttId(getOcrEO.getAttId());
ocrRecordEOService.editById(ocrRecordEO); //TODO ??
return Result.OK( "加入转换成功", taskId);
}
@@ -48,34 +48,11 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
@AutoLog(value = "区域管理表-分页列表查询")
@ApiOperation(value="区域管理表-分页列表查询", notes="区域管理表-分页列表查询")
@PostMapping(value = "/page")
//@RequiresPermissions("area:page")
public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
IPage<OnlCgformArea> pageList=onlCgformAreaService.queryPageList(params);
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 = "区域管理表-添加")
@ApiOperation(value="区域管理表-添加", notes="区域管理表-添加")
@PostMapping(value = "/add")
//@RequiresPermissions("area:add")
public Result<?> add(@Validated @RequestBody OnlCgformArea onlCgformArea) {
onlCgformAreaService.add(onlCgformArea);
return Result.OK("添加成功!");
@@ -125,6 +103,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
@AutoLog(value = "区域管理表-编辑")
@ApiOperation(value="区域管理表-编辑", notes="区域管理表-编辑")
@PutMapping(value = "/edit")
//@RequiresPermissions("area:edit")
public Result<?> edit(@Validated @RequestBody OnlCgformArea onlCgformArea) {
onlCgformAreaService.editById(onlCgformArea);
return Result.OK("编辑成功!");
@@ -139,6 +118,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
@AutoLog(value = "区域管理表-通过id删除")
@ApiOperation(value="区域管理表-通过id删除", notes="区域管理表-通过id删除")
@DeleteMapping(value = "/delete")
//@RequiresPermissions("area:delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id);
int count=onlCgformTagService.queryExitArea(onlCgformArea);
@@ -3,14 +3,13 @@ package com.jero.modules.tag.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.CommonConstant;
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.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.tag.entity.OnlCgformArea;
import com.jero.modules.tag.entity.OnlCgformTag;
import com.jero.modules.tag.service.IOnlCgformTagService;
import com.jero.modules.utils.HanYuPinYinUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -23,7 +22,6 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -46,6 +44,8 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
private OnlCgformTagController onlCgformAreaService;
@Autowired
private SysDictItemServiceImpl sysDictItemService;
@Autowired
private OnlCgformApiController onlCgformApiController;
/**
* 分页列表查询
*
@@ -81,29 +81,10 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-添加")
@ApiOperation(value="标签管理-添加", notes="标签管理-添加")
@PostMapping(value = "/add")
//@RequiresPermissions("tag:add")
public Result<?> add(@Validated @RequestBody OnlCgformTag onlCgformTag) {
Integer count=onlCgformTagService.queryExitData(onlCgformTag);
if (count > 0) {
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);
}
onlCgformTagService.add(onlCgformTag);
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
return Result.OK("添加成功!");
}
@@ -116,11 +97,13 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-编辑")
@ApiOperation(value="标签管理-编辑", notes="标签管理-编辑")
@PutMapping(value = "/edit")
//@RequiresPermissions("tag:edit")
public Result<?> edit(@Validated @RequestBody OnlCgformTag onlCgformTag) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
return Result.error("固定字段,不可修改");
}else {
onlCgformTagService.editById(onlCgformTag);
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
return Result.OK("编辑成功!");
}
}
@@ -134,6 +117,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-通过id删除")
@ApiOperation(value="标签管理-通过id删除", notes="标签管理-通过id删除")
@DeleteMapping(value = "/delete")
//@RequiresPermissions("tag:delete")
public Result<OnlCgformTag> delete(@RequestParam(name="id",required=true) String id) {
Result<OnlCgformTag> result = new Result<>();
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(id);
@@ -142,6 +126,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
result.error500("固定字段,不可删除");
} else {
onlCgformTagService.deleteById(id);
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
result.OK("删除成功!");
}
}
@@ -157,12 +142,14 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-批量删除")
@ApiOperation(value="标签管理-批量删除", notes="标签管理-批量删除")
@DeleteMapping(value = "/deleteBatch")
//@RequiresPermissions("tag:deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(ids);
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
return Result.error("固定字段,不可删除");
}else {
this.onlCgformTagService.deleteByIds(Arrays.asList(ids.split(",")));
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
return Result.OK("批量删除成功!");
}
}
@@ -17,9 +17,10 @@ import java.util.Map;
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" +
"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.order_num,f.field_must_input,f.is_show_form,f.is_show_list,\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.field_show_type,i.item_text as field_show_type_name,\n" +
"f.dict_id,f.db_length,f.order_num,f.field_must_input,\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" +
"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" +
@@ -103,9 +103,9 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
public List<OnlCgformArea> queryList(OnlCgformArea onlCgformArea) {
LambdaQueryWrapper<OnlCgformArea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(onlCgformArea.getIsModel())){
lambdaQueryWrapper.eq(OnlCgformArea::getIsModel,onlCgformArea.getIsModel())
.orderByAsc(OnlCgformArea::getSort);
lambdaQueryWrapper.eq(OnlCgformArea::getIsModel,onlCgformArea.getIsModel());
}
lambdaQueryWrapper.orderByAsc(OnlCgformArea::getSort);
return list(lambdaQueryWrapper);
}
@@ -152,4 +152,4 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
IPage<OnlCgformArea> result=onlCgformAreaMapper.querPageList(page,params);
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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.enums.CutEnum;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.tag.entity.OnlCgformArea;
import com.jero.modules.tag.entity.OnlCgformTag;
import com.jero.modules.tag.mapper.OnlCgformTagMapper;
import com.jero.modules.tag.service.IOnlCgformTagService;
import com.jero.modules.utils.HanYuPinYinUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -43,10 +45,30 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
*/
@Override
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();
onlCgformTag.setCreateTime(now);
onlCgformTag.setUpdateTime(now);
onlCgformTag.setIsReadOnly(0);
save(onlCgformTag);
}
@@ -59,6 +81,8 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
@Override
public void editById(OnlCgformTag onlCgformTag) {
Date now = new Date();
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(onlCgformTag.getDbFieldTxt());
onlCgformTag.setDbFieldName(pinYin.replace(" ","_"));
onlCgformTag.setUpdateTime(now);
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 moment from 'moment'
import 'moment/locale/zh-cn'
import Vue from 'vue'
import { mapGetters } from 'vuex'
moment.locale('zh-cn')
@@ -79,13 +81,15 @@
watch: {
$route: function(val) {
this.$nextTick(() => {
this.$watermark.set('fanqiangqiang 范强强')
this.$watermark.set(this.userInfo().updateBy + ' ' + this.userInfo().username)
})
}
},
computed: {},
methods: {}
methods: {
...mapGetters(['userInfo'])
}
}
</script>
<style>
@@ -104,7 +108,17 @@
.ant-layout {
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>
+3 -1
View File
@@ -503,7 +503,9 @@ module.exports = {
CannotExceed100characters:'cannot exceed 100 characters',
cantExeed:'cannot exceed ',
characters:' characters',
Processing:'Processing',
See:'See',
labelNameCannotDuplicate:'Label name cannot be duplicate',
list:'list',
paragraph:'paragraph',
}
+4
View File
@@ -509,4 +509,8 @@ module.exports = {
characters:'字符',
Processing:'办理',
See:'查看',
labelNameCannotDuplicate:'标签名称不能重复',
list:'列表',
paragraph:'段落',
}
@@ -140,15 +140,20 @@
handleSubmit() {
let content = []
let replace_standard_id = []
this.content.forEach(res => {
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.visible = false
if (this.content && this.content.length > 0){
this.content.forEach(res => {
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.visible = false
}else{
this.$message.warning(this.$t('selectLeastOne'))
}
},
indexclick(event) {
console.log(event)
this.$emit('input', event.target.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-row :gutter="24">
<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="title-text">
<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) {
rules[res.db_field_name] = rule
}
@@ -12,6 +12,11 @@
:columns="columns"
@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">
<a class="text" v-for="(ol,index) in OperationList"
@click="OperationClick(ol,record)">
@@ -8,7 +8,7 @@
</a-radio-group>
<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">
<span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
{{ item.text || item.label }}
@@ -8,7 +8,7 @@
</div>
<a-row :gutter="24">
<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="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
@@ -80,6 +80,7 @@
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
@change="dateChange(item)"
:disabledDate="disabledDate"
format="YYYY-MM-DD"
v-model="formInline[item.db_field_name]"
:disabled="disabled"
@@ -115,9 +116,9 @@
formInline[item.db_field_name] == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
</a-button>
<span class="button-text-text" v-if="formInline[item.db_field_name]">
{{formInline[item.db_field_name].split(',').length}}
</span>
<!-- <span class="button-text-text" v-if="formInline[item.db_field_name]">-->
<!-- {{formInline[item.db_field_name].split(',').length}}-->
<!-- </span>-->
</a-form-model-item>
</div>
</a-col>
@@ -292,6 +293,9 @@
},
methods: {
disabledDate(current) {
return current && current < moment().subtract(1,"day");
},
sumber() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
@@ -327,7 +331,7 @@
onChange(item) {
let dateOne = moment(this.formInline[item][0]).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) {
@@ -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) {
rules[res.db_field_name] = rule
}
@@ -449,6 +462,7 @@
},
StandardselectionChange(value, id) {
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
}
}
}
+17 -3
View File
@@ -271,9 +271,8 @@
},
methods: {
sumber() {
console.log('vilidate',this.formInline)
// console.log('vilidate',this.formInline)
this.$refs.ruleForm1.validate(valid => {
console.log('va',valid)
if (valid) {
let url = ''
if (this.formInline.id) {
@@ -310,7 +309,12 @@
/** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',')
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) {
@@ -331,6 +335,16 @@
message: res.db_field_txt + '不能为空',
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' ||
res.field_show_type === 'date' || res.field_show_type === 'file') {
rule.push({
+68 -65
View File
@@ -7,7 +7,7 @@
class="ant-upload-list"
name="file"
:file-list="myfileList"
:multiple="true"
:multiple="false"
:action = 'uploadAction'
:headers="headers"
:before-upload="beforeUpload"
@@ -47,19 +47,23 @@
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
},
methods:{
beforeUpload(file) {
// console.log(file)
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
if(file.type==this.accept){
this.fileTypeSatus = true;
this.$message.destroy()
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
beforeUpload(file,fileList) {
if(this.myfileList&&this.myfileList.length>=1){
this.$message.warning('只能上传一个文件')
return false
}else{
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
if(file.type==this.accept){
this.fileTypeSatus = true;
this.$message.destroy()
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
}
}
},
remove(){
this.fileTypeSatus = true;
// console.log('rrr',this.myfileList)
},
handleChange(info) {
// console.log('info',info)
@@ -71,38 +75,18 @@
info.fileList.splice(index,1)
}
})
if (this.fileTypeSatus) {
if (file.size > 100000000) {
this.$message.error(this.errorMessage)
return
}else {
if (status === 'error') {
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){
if (this.fileTypeSatus) {
if (file.size > 100000000) {
this.$message.error(this.errorMessage)
return
}else {
if (status === 'error') {
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.success(`${info.file.name} 删除成功。`);
}
} else if (status === 'done') {
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.$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)
@@ -110,36 +94,55 @@
this.fileList.push(res)
}
})
// console.log('file1111',this.fileList)
// console.log('remove',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)
}
})
this.$message.success(`${info.file.name} 删除成功。`);
} else if (status === 'done') {
this.fileList = []
this.myfileList = info.fileList;
// console.log('file3333',info.fileList)
if (info.fileList.length > 1) {
info.fileList.splice(1)
// this.myfileList = info.fileList;
if(this.myfileList.length > 0){
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.success(`${info.file.name} 文件上传成功。`);
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
} 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"
/>
</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">
<span>{{item.db_field_txt}}</span>
</div>
@@ -174,11 +175,11 @@
},
methods: {
searchQuery() {
eventBUs.$emit('searchQuery', this.queryParam)
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
},
searchReset() {
this.queryParam = {}
eventBUs.$emit('searchQuery', this.queryParam)
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
},
getSeach() {
let params = {
+6 -6
View File
@@ -13,17 +13,17 @@
@change="tableOnChange"
>
<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)">
<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')}}
</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')}}
</span>
<span v-else>
<span v-else v-has="ol.has" class="text">
{{ol.text}}
</span>
</span>
</a>
</span>
<span slot="detailClick" slot-scope="text,record">
@@ -189,7 +189,7 @@
this.loading = true
postAction(this.url.tableList, params).then((res) => {
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.getTableList()
return
+20 -1
View File
@@ -10,6 +10,7 @@
:multiple="true"
:action='uploadAction'
:headers="headers"
@preview="preview"
:before-upload="beforeUpload"
:remove='remove'
@change="handleChange">
@@ -25,6 +26,7 @@
<script>
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction, postAction, downFile, downloadFile } from '@/api/manage'
export default {
name: 'file',
@@ -114,7 +116,6 @@
})
},
mypreview(item) {
console.log(item)
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '/' + item.ext1)
window.open(url, '_blank')
},
@@ -193,6 +194,24 @@
resetFileList() {
this.myfileList = []
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"
@onCancel="onCancel"
@onSelectChange="onSelectChange"
@detailClick="detailClick"
></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>-->
@@ -259,8 +260,14 @@
//点击名称
titleClick(records){
},
detailClick(item) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: item
})
window.open(newUrl.href, '_blank')
}
}
}
</script>
@@ -69,7 +69,7 @@
<div class="TextInformation" v-else-if="val == $t('relatedInformation')">
<div class="TextInformationContent" v-for="(ol,index1) in item[val]" style="width: 100%">
<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 class="TextInformationContentcontentButton">
<span :title="ol.value">{{ol.value ? ol.value : '--'}}</span>
@@ -170,8 +170,22 @@
}
})
},
pdfPreview(item) {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + item.id))
pdfPreview(fileQuery) {
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) {
downloadFile('/sys/common/download', item.fileName, { id: item.id })
@@ -208,6 +222,7 @@
this.bussLogList()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.bussLogList()
},
@@ -218,6 +233,13 @@
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"/>
</div>
<div class="table-operator">
<div @click="handleDel" class="operator-text">
<div @click="handleDel" class="operator-text" v-has="'document:deleteBatch'">
<a-icon type="delete"/>
{{$t('BatchDelete')}}
</div>
<div @click="handleExport" class="operator-text">
<div @click="handleExport" class="operator-text" v-has="'document:exportExcel'">
<a-icon type="export" :rotate="-90"/>
{{$t('dataExport')}}
</div>
<div @click="handleFileExport" class="operator-text">
<div @click="handleFileExport" class="operator-text" v-has="'document:exportZip'">
<a-icon type="mail"/>
{{$t('exportWithFile')}}
</div>
<div @click="handleCompare" class="operator-text">
<div @click="handleCompare" class="operator-text" v-has="'document:pullMessage'">
<a-icon type="rocket" :rotate="45"/>
{{$t('Push')}}
</div>
<div @click="handleModule" class="operator-text">
<div @click="handleModule" class="operator-text" v-has="'document:exportTemplate'">
<a-icon type="download"/>
{{$t('templateDownload')}}
</div>
<div class="operator-text">
<div class="operator-text" v-has="'document:importZip'">
<ImportFile :url="url"/>
</div>
<div @click="handleAdd" class="operator-text">
<div @click="handleAdd" class="operator-text" v-has="'document:getInfoById'">
<a-icon type="plus"/>
{{$t('add')}}
</div>
@@ -91,19 +91,23 @@
OperationList: [
{
text: this.$t('CancelCollection'),
ClickEvent: 'Collection'
ClickEvent: 'Collection',
has:'document:addCollect'
},
{
text: this.$t('CancelSubscribe'),
ClickEvent: 'subscribe'
ClickEvent: 'subscribe',
has:'document:addSubscribe'
},
{
text: this.$t('edit'),
ClickEvent: 'editTable'
ClickEvent: 'editTable',
has:'document:updateInfo'
},
{
text: this.$t('deleteLib'),
ClickEvent: 'deleteTable'
ClickEvent: 'deleteTable',
has:'document:deleteBatch'
}
],
selectedRowKeys: [],
+33 -35
View File
@@ -133,20 +133,7 @@
checkVisible:false, //校核弹框
file:'',
form:{}, //表单数据
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' },
]
},
rules:{},
url: {
tableHeader: 'ocr/ocrRecord/getHeader', //表格头部字段
seachList: 'ocr/ocrRecord/queryCondition', //搜索字段
@@ -176,20 +163,33 @@
// this.loadData()
},
created() {
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秒刷新数据
this.refresh()
},
watch:{
drawVisible(val){
if(val&&this.timer){
clearInterval(this.timer)
}else{
clearInterval(this.timer)
this.initSetTimeout(this.today)//调用每隔10秒刷新数据
}
}
},
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(){
// if(this.timer){
@@ -200,6 +200,9 @@
//调取已入库文件
handleFileExport(){
this.drawVisible=true
if(this.timer){
clearInterval(this.timer)
}
},
//批量删除
handleDel(){
@@ -238,19 +241,13 @@
},
//校核
actionCheck(val){
// if(val.resultContent=='转换成功'&&val.syncState!='已同步'){
// this.checkVisible=true
// }else{
// this.$message.warning('未转换成功或已同步至文档库,不能进行校核')
// }
this.checkVisible=true
},
//下载
actionDown(val){
// downloadFile('/sys/common/download', val.docRealName, { id: val.attId })
downloadFile('ocr/OcrRestful/downFile', val.docRealName, { fileName: val.docRealName })
// downloadFile(val.docRealFile)
// window.open(val.docRealFile)
let fileName=val.docRealName.split('_')
fileName=fileName[fileName.length-1]
downloadFile('ocr/OcrRestful/downFile', fileName, { fileName: val.docRealName })
},
//删除
actionDelete(record){
@@ -336,10 +333,11 @@
},
docVisible(val){
this.drawVisible=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){
// this.fileVisible=val
@@ -146,7 +146,7 @@
})
},
afterVisibleChange(val) {
console.log('visible', val);
// console.log('visible', val);
},
onClose() {
this.visible = false;
@@ -4,37 +4,6 @@
<div class="subscribtion-search-wrapper">
<div class="subscribtion-search-header">
<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 class="table-operator">
@@ -56,26 +25,8 @@
@titleClick="titleClick"
@onCancel="onCancel"
@onSelectChange="onSelectChange"
@detailClick="detailClick"
></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>
<sub-area v-if="visible" :subVisible="visible" @visible="areaVisible"></sub-area>
</a-card>
@@ -272,6 +223,13 @@
},
areaVisible(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"
@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
v-if="treeData && treeData.length"
v-model="checkedKeys"
@@ -48,7 +48,8 @@
autoExpandParent: true,
treeData: [],
dataList:[],
searchValue:''
searchValue:'',
data:[]
}
},
props:{
@@ -68,15 +69,21 @@
methods:{
//获取数据
loadData(){
let params = {}
let params = {
title:this.searchValue
}
getAction(`sys/category/getSysCategoryTree`,params).then(res=> {
if(res.success){
let data=res.result
this.treeData=this.addAttr(data)
this.data=[...res.result]
this.treeData=this.addAttr(this.data)
// console.log('treeData',this.treeData)
}
})
},
onSearch(){
this.loadData()
},
//获取用户的订阅
getSubscribtion(){
postAction(`domain/domainUserRel/queryList`,{}).then(res=> {
@@ -96,6 +103,9 @@
if((Array.isArray(dataI)) && dataI.length>0){
dataI.forEach((item,index)=>{
this.$set(item,'key',item.id)
// if(item.title.indexOf(this.searchValue)!==-1){
// console.log('item.title',item.title)
// }
let arr = [];
this.addAttr(item.children,arr);
});
@@ -155,15 +165,17 @@
this.autoExpandParent = false;
},
onChange(e) {
// this.loadData()
const value = e.target.value;
const expandedKeys = this.dataList
.map(item => {
if (item.title.indexOf(value) > -1) {
return this.getParentKey(item.key, this.gData);
return this.getParentKey(item.key, this.treeData);
}
return null;
})
.filter((item, i, self) => item && self.indexOf(item) === i);
console.log('item',item)
Object.assign(this, {
expandedKeys,
searchValue: value,
@@ -171,11 +183,11 @@
})
},
onCheck(checkedKeys) {
console.log('onCheck', checkedKeys);
// console.log('onCheck', checkedKeys);
this.checkedKeys = checkedKeys;
},
onSelect(selectedKeys, info) {
console.log('onSelect', info);
// console.log('onSelect', info);
this.selectedKeys = selectedKeys;
},
@@ -267,6 +267,7 @@
deleteAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'));
this.queryParams.pageNo=1
this.loadData()
}else{
this.$message.warning(this.$t('operationFailed'));
@@ -353,6 +353,7 @@
deleteAction(`sys/dictItem/delete`, params).then(res => {
if(res.success) {
this.$message.success(this.$t('OperationSuccessful'));
this.queryParams.pageNo=1
this.loadData()
}else{
this.$message.warning(this.$t('operationFailed'));
@@ -381,6 +382,7 @@
async () => {
deleteAction(`sys/category/deleteBatch`, params).then(res => {
if(res.success){
this.queryParams.pageNo=1
this.loadData()
this.$message.success(this.$t('OperationSuccessful'))
}else{
@@ -394,7 +396,7 @@
}
},
ok(val){
this.queryParams.pageNo=val.pageSize
this.queryParams.pageNo=val.pageNo
this.queryParams.pageSize=val.pageSize
this.loadData()
}
@@ -32,17 +32,17 @@
:label-col="labelCol"
: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
v-model="form.dictName"
:placeholder="$t('PleaseEnterLabelName')"
/>
</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')" />
</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
v-model="form.description"
:placeholder="$t('PleaseEnterDescription')"
@@ -136,15 +136,15 @@
width: 170
}
],
labelCol: { span:4 },
wrapperCol: { span: 18 },
labelCol: { span:6 },
wrapperCol: { span: 16 },
form:{},
rules:{
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:[
{ required: true, message: this.$t('PleaseSelectLabelType'), trigger: 'blur' },
{ min:1, max: 300, message: this.$t('cantExeed')+'300'+this.$t('characters'), trigger: 'blur' },
],
},
// typeVisible:{},
@@ -210,7 +210,13 @@
this.contentVisible=false
this.form={}
}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={}
}else{
this.$message.warning(this.$t('operationFailed'))
}
})
}
}
})
},
@@ -326,6 +328,7 @@
}
}
.page{
margin-top: 20px;
text-align: right;
@@ -351,6 +354,13 @@
.ant-modal-footer{
text-align: center;
}
}
}
.tag-content{
.tag-item{
.ant-col-6{
min-width: 130px;
}
}
}
</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-detail">
<div class="search-detail-wrap">
<!-- <div class="search-detail-title">搜索内容</div>-->
<!-- <a-input placeholder="请输入搜索内容" />-->
<!-- <a-button type="primary">搜索</a-button>-->
<!-- <a-button>清空</a-button>-->
<a-input-group compact v-if="showList">
<a-input-group class="input-group" compact v-if="active === $t('DocumentLibrary')">
<a-select default-value="Option1">
<a-select-option value="Option1">
标题
@@ -26,107 +21,29 @@
></a-input-search>
</a-input-group>
<a-input-search
v-else
allowClear
v-else-if="active === $t('whole')"
class="inputSearch"
allow-clear
placeholder="请输入搜索内容"
@search="onSearch"
></a-input-search>
<!-- <a-button @click="searchReset(1)" style="margin-left: 20px" icon="redo">重置</a-button>-->
<!-- <a href="javascript:;">结果中检索</a>-->
</div>
</div>
<div class="search-center-content">
<div class="search-con-header">
<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('DocumentLibrary')" :tab="$t('DocumentLibrary')" force-render>
</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('weekly')" :tab="$t('weekly')"></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('weekly')" :tab="$t('weekly')"></a-tab-pane>-->
</a-tabs>
</div>
</div>
<div class="search-con-text">
<div class="search-text-wrap">
<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>
<whole v-if="active === $t('whole')"/>
<DocumentLibrary v-else-if="active === $t('DocumentLibrary')"/>
</div>
</div>
</div>
@@ -134,307 +51,28 @@
</template>
<script>
import whole from './components/whole'
import DocumentLibrary from './components/DocumentLibrary'
export default {
name: 'searchCenter',
components: {
whole,
DocumentLibrary
},
data() {
return {
selectedRowKeys: [],
isNullInput: 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]
active: this.$t('whole'),
showList: false
}
},
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) {
console.log(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
}
this.active = key
},
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 {
/*background-color: #ffffff;*/
.null-input {
background-color: #F2F4F8;
}
.no-null-input {
/*background-color: rgba(255, 255, 255, 0.8);*/
}
.search-center-wrap {
margin: 10px;
@@ -473,20 +103,6 @@
margin-right: 10px;
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;
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 {
float: left;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
.inputSearch {
width: 400px;
}
.text-text-right {
padding: 19px 28px;
box-sizing: border-box;
margin-left: 38px;
.input-group {
width: 488px;
}
.text-right-right {
border-left: 2px solid #E6E7EC;
padding: 24px 0 24px 24px !important;
box-sizing: border-box;
</style>
<style>
.inputSearch .ant-input {
height: 40px;
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>
+169 -153
View File
@@ -51,7 +51,8 @@
</a-form-item>
</a-col>
<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"/>
</a-col>
<a-col :span="3"></a-col>
@@ -64,13 +65,13 @@
</a-form-item>
</a-col>
<a-col :span="6"></a-col>
<a-col :span="5" style="text-align: right;color: #1891FF;">
<a-form-item>
<router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">
忘记密码
</router-link>
</a-form-item>
</a-col>
<!-- <a-col :span="5" style="text-align: right;color: #1891FF;">-->
<!-- <a-form-item>-->
<!-- <router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">-->
<!-- 忘记密码-->
<!-- </router-link>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
</a-row>
<a-row class="login-btn">
<a-col :span="3"></a-col>
@@ -84,7 +85,7 @@
:loading="loginBtn"
@click.stop.prevent="handleSubmit"
:disabled="loginBtn">
{{ loginBtn ? "登录中" : "登录" }}
{{ loginBtn ? '登录中' : '登录' }}
</a-button>
</a-form-item>
</a-col>
@@ -92,7 +93,8 @@
</a-row>
</div>
</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">
<a-row>
<a-col :span="24">
@@ -136,7 +138,8 @@
</a-form-item>
</a-col>
<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"/>
</a-col>
</a-row>
@@ -147,13 +150,13 @@
</a-form-item>
</a-col>
<a-col :span="4"></a-col>
<a-col :span="9" style="text-align: right;color: #1891FF;">
<a-form-item>
<router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">
忘记密码
</router-link>
</a-form-item>
</a-col>
<!-- <a-col :span="9" style="text-align: right;color: #1891FF;">-->
<!-- <a-form-item>-->
<!-- <router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">-->
<!-- 忘记密码-->
<!-- </router-link>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
</a-row>
<a-row class="login-btn">
<a-col :span="24">
@@ -166,7 +169,7 @@
:loading="loginBtn"
@click.stop.prevent="handleSubmit"
:disabled="loginBtn">
{{ loginBtn ? "登录中" : "登录" }}
{{ loginBtn ? '登录中' : '登录' }}
</a-button>
</a-form-item>
</a-col>
@@ -176,58 +179,59 @@
</div>
</template>
<script>
import { mapActions } from "vuex"
import { timeFix } from "@/utils/util"
import { mapActions } from 'vuex'
import { timeFix } from '@/utils/util'
import Vue from 'vue'
import { ACCESS_TOKEN ,ENCRYPTED_STRING} from "@/store/mutation-types"
import { putAction,postAction,getAction } from '@/api/manage'
import { USER_INFO } from "@/store/mutation-types"
import {getRSAPublicKey} from '@/api/login.js'
import { ACCESS_TOKEN, ENCRYPTED_STRING } from '@/store/mutation-types'
import { putAction, postAction, getAction } from '@/api/manage'
import { USER_INFO } from '@/store/mutation-types'
import { getRSAPublicKey } from '@/api/login.js'
const Base64 = require('js-base64').Base64
import {JSEncrypt} from 'jsencrypt'
import { JSEncrypt } from 'jsencrypt'
export default {
components: {},
data () {
data() {
return {
loginBtn: false,
mobile:isMobile(),
mobile: isMobile(),
// login type: 0 email, 1 username, 2 telephone
loginType: 0,
stepCaptchaVisible: false,
form: this.$form.createForm(this),
state: {
time: 60,
smsSendBtn: false,
smsSendBtn: false
},
validatorRules:{
username:{rules: [{ required: true, message: '请输入用户名!'},{validator: this.handleUsernameOrEmail}]},
password:{rules: [{ required: true, message: '请输入密码!',validator: 'click'}]},
mobile:{rules: [{validator:this.validateMobile}]},
captcha:{rule: [{ required: true, message: '请输入验证码!'}]},
inputCode:{rules: [{ required: true, message: '请输入验证码!'}]}
validatorRules: {
username: { rules: [{ required: true, message: '请输入用户名!' }, { validator: this.handleUsernameOrEmail }] },
password: { rules: [{ required: true, message: '请输入密码!', validator: 'click' }] },
mobile: { rules: [{ validator: this.validateMobile }] },
captcha: { rule: [{ required: true, message: '请输入验证码!' }] },
inputCode: { rules: [{ required: true, message: '请输入验证码!' }] }
},
velorifiedCode:"",
inputCodeContent:"",
inputCodeNull:true,
currentUsername:"",
currdatetime:'',
randCodeImage:'',
requestCodeSuccess:false,
rsaPublicKey:''
velorifiedCode: '',
inputCodeContent: '',
inputCodeNull: true,
currentUsername: '',
currdatetime: '',
randCodeImage: '',
requestCodeSuccess: false,
rsaPublicKey: ''
}
},
created () {
this.currdatetime = new Date().getTime();
created() {
this.currdatetime = new Date().getTime()
Vue.ls.remove(ACCESS_TOKEN)
this.getRouterData();
this.handleChangeCheckCode();
this.getRouterData()
this.handleChangeCheckCode()
},
methods: {
...mapActions(['Login', 'Logout', 'PhoneLogin']),
handleUsernameOrEmail (rule, value, callback) {
const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
handleUsernameOrEmail(rule, value, callback) {
const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/
if (regex.test(value)) {
this.loginType = 0
} else {
@@ -235,194 +239,201 @@
}
callback()
},
handleSubmit () {
handleSubmit() {
let that = this
let loginParams = {};
that.loginBtn = true;
that.form.validateFields([ 'username', 'password','inputCode', 'rememberMe' ], { force: true }, (err, values) => {
let loginParams = {}
that.loginBtn = true
that.form.validateFields(['username', 'password', 'inputCode', 'rememberMe'], { force: true }, (err, values) => {
if (!err) {
loginParams.remember_me = values.rememberMe
loginParams.captcha = that.inputCodeContent
loginParams.checkKey = that.currdatetime
loginParams.rsaPublicKey = that.rsaPublicKey;
loginParams.rsaPublicKey = that.rsaPublicKey
// 新建JSEncrypt对象
let encrypt = new JSEncrypt();
encrypt.setPublicKey(loginParams.rsaPublicKey);
// 公钥加密
loginParams.username = encrypt.encrypt(values.username)
loginParams.password = encrypt.encrypt(values.password)
let encrypt = new JSEncrypt()
encrypt.setPublicKey(loginParams.rsaPublicKey)
// 公钥加密
loginParams.username = encrypt.encrypt(values.username)
loginParams.password = encrypt.encrypt(values.password)
//登录
that.Login(loginParams).then((res) => {
this.loginSuccess()
}).catch((err) => {
if (err.code === 500) {
// 刷新验证码
this.handleChangeCheckCode();
this.handleChangeCheckCode()
}
that.requestFailed(err);
});
}else {
that.loginBtn = false;
that.requestFailed(err)
})
} else {
that.loginBtn = false
}
})
},
getCaptcha (e) {
e.preventDefault();
let that = this;
this.form.validateFields([ 'mobile' ], { force: true },(err,values) => {
if(!values.mobile){
that.cmsFailed("请输入手机号");
}else if (!err) {
this.state.smsSendBtn = true;
getCaptcha(e) {
e.preventDefault()
let that = this
this.form.validateFields(['mobile'], { force: true }, (err, values) => {
if (!values.mobile) {
that.cmsFailed('请输入手机号')
} else if (!err) {
this.state.smsSendBtn = true
let interval = window.setInterval(() => {
if (that.state.time-- <= 0) {
that.state.time = 60;
that.state.smsSendBtn = false;
window.clearInterval(interval);
that.state.time = 60
that.state.smsSendBtn = false
window.clearInterval(interval)
}
}, 1000);
}, 1000)
const hide = this.$message.loading('验证码发送中..', 0);
let smsParams = {};
smsParams.mobile=values.mobile;
smsParams.smsmode="0";
postAction("/sys/sms",smsParams)
const hide = this.$message.loading('验证码发送中..', 0)
let smsParams = {}
smsParams.mobile = values.mobile
smsParams.smsmode = '0'
postAction('/sys/sms', smsParams)
.then(res => {
if(!res.success){
setTimeout(hide, 0);
this.cmsFailed(res.message);
if (!res.success) {
setTimeout(hide, 0)
this.cmsFailed(res.message)
}
setTimeout(hide, 500);
setTimeout(hide, 500)
})
.catch(err => {
setTimeout(hide, 1);
clearInterval(interval);
that.state.time = 60;
that.state.smsSendBtn = false;
this.requestFailed(err);
});
setTimeout(hide, 1)
clearInterval(interval)
that.state.time = 60
that.state.smsSendBtn = false
this.requestFailed(err)
})
}
}
);
)
},
handleChangeCheckCode(){
this.currdatetime = new Date().getTime();
getAction(`/sys/randomImage/${this.currdatetime}`).then(res=>{
if(res.success){
handleChangeCheckCode() {
this.currdatetime = new Date().getTime()
getAction(`/sys/randomImage/${this.currdatetime}`).then(res => {
if (res.success) {
this.randCodeImage = res.result
this.requestCodeSuccess=true
}else{
this.requestCodeSuccess = true
} else {
this.$message.error(res.message)
this.requestCodeSuccess=false
this.requestCodeSuccess = false
}
}).catch(()=>{
this.requestCodeSuccess=false
}).catch(() => {
this.requestCodeSuccess = false
})
this.getPublicKey();
this.getPublicKey()
},
//获取RSA公钥
getPublicKey(){
getPublicKey() {
// 获取公钥
getRSAPublicKey().then(res => {
this.rsaPublicKey = res.result
})
},
loginSuccess () {
loginSuccess() {
let langCn = localStorage.language
// 默认中文
if (!langCn) {
localStorage.setItem('language', 'zh-cn')
}
this.$router.push({ path: "/dashboard/analysis" }).catch((res)=>{})
this.$router.push({ path: '/dashboard/analysis' }).catch((res) => {
})
this.$notification.success({
message: '欢迎',
description: `${timeFix()},欢迎回来`,
});
description: `${timeFix()},欢迎回来`
})
},
cmsFailed(err){
this.$notification[ 'error' ]({
message: "登录失败",
description:err,
duration: 4,
});
},
requestFailed (err) {
this.$notification[ 'error' ]({
cmsFailed(err) {
this.$notification['error']({
message: '登录失败',
description: ((err.response || {}).data || {}).message || err.message || "请求出现错误请稍后再试",
duration: 4,
});
this.loginBtn = false;
description: err,
duration: 4
})
},
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("您的手机号码格式不正确!");
requestFailed(err) {
this.form.resetFields()
this.$notification['error']({
message: '登录失败',
// 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){
if(!value || this.verifiedCode==this.inputCodeContent){
callback();
}else{
callback("您输入的验证码不正确!");
validateInputCode(rule, value, callback) {
if (!value || this.verifiedCode == this.inputCodeContent) {
callback()
} else {
callback('您输入的验证码不正确!')
}
},
generateCode(value){
generateCode(value) {
this.verifiedCode = value.toLowerCase()
},
inputCodeChange(e){
inputCodeChange(e) {
this.inputCodeContent = e.target.value
},
getRouterData(){
getRouterData() {
this.$nextTick(() => {
if (this.$route.params.username) {
this.form.setFieldsValue({
'username': this.$route.params.username
});
})
}
})
},
}
}
}
// 判断当前设备
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判断是否是手机
for (var v = 0; v < mobileAgents.length; v++) {
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
mobile_flag = true;
break;
mobile_flag = true
break
}
}
var screen_width = window.screen.width;
var screen_height = window.screen.height;
var screen_width = window.screen.width
var screen_height = window.screen.height
//根据屏幕分辨率判断是否是手机
if (screen_width < 500 && screen_height < 800) {
mobile_flag = true;
mobile_flag = true
}
return mobile_flag;
return mobile_flag
}
</script>
<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;
}
.ant-row{
.ant-row {
margin-bottom: 4%;
}
.main{
.main {
height: 100%;
.user-layout-login{
.user-layout-login {
z-index: 99;
width: 24%;
height: 56%;
@@ -435,14 +446,16 @@
right: 8%;
top: 50%;
transform: translateY(-50%);
.user-box{
.user-box {
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
justify-content: space-between;
flex-direction: column;
.title{
.title {
display: block;
color: #1891FF;
font-size: 28px;
@@ -450,13 +463,15 @@
margin: 0 0 5% 0;
text-align: center;
}
.login-btn{
.login-btn {
margin-bottom: 0;
font-size: 10px;
}
}
}
.user-layout-login-mobile{
.user-layout-login-mobile {
right: 0;
width: 100%;
min-width: 0 !important;
@@ -468,7 +483,8 @@
top: 50%;
margin-top: 6rem;
transform: translateY(-50%);
.ant-row{
.ant-row {
margin-bottom: 0;
}
}