Commit 8908a81b authored by lcl's avatar lcl

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents 90fdcd52 066a12fe
...@@ -22,6 +22,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -22,6 +22,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -70,7 +71,7 @@ public class SysOssController extends BaseController { ...@@ -70,7 +71,7 @@ public class SysOssController extends BaseController {
@SaCheckPermission("system:oss:upload") @SaCheckPermission("system:oss:upload")
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT) @Log(title = "OSS对象存储", businessType = BusinessType.INSERT)
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R<Map<String, String>> upload(@RequestPart("file") MultipartFile file) { public R<Map<String, String>> upload(@RequestPart("file") MultipartFile file) throws UnsupportedEncodingException {
if (ObjectUtil.isNull(file)) { if (ObjectUtil.isNull(file)) {
return R.fail("上传文件不能为空"); return R.fail("上传文件不能为空");
} }
...@@ -90,7 +91,7 @@ public class SysOssController extends BaseController { ...@@ -90,7 +91,7 @@ public class SysOssController extends BaseController {
@SaCheckPermission("system:oss:download") @SaCheckPermission("system:oss:download")
@GetMapping("/download/{ossId}") @GetMapping("/download/{ossId}")
public void download(@PathVariable Long ossId, HttpServletResponse response) throws IOException { public void download(@PathVariable Long ossId, HttpServletResponse response) throws IOException {
iSysOssService.download(ossId,response); iSysOssService.download(ossId, response);
} }
/** /**
......
...@@ -19,6 +19,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -19,6 +19,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.UnsupportedEncodingException;
import java.util.Arrays; import java.util.Arrays;
import java.util.Base64; import java.util.Base64;
import java.util.HashMap; import java.util.HashMap;
...@@ -108,7 +109,7 @@ public class SysProfileController extends BaseController { ...@@ -108,7 +109,7 @@ public class SysProfileController extends BaseController {
*/ */
@Log(title = "用户头像", businessType = BusinessType.UPDATE) @Log(title = "用户头像", businessType = BusinessType.UPDATE)
@PostMapping(value = "/avatar", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @PostMapping(value = "/avatar", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R<Map<String, Object>> avatar(@RequestPart("avatarfile") MultipartFile avatarfile) { public R<Map<String, Object>> avatar(@RequestPart("avatarfile") MultipartFile avatarfile) throws UnsupportedEncodingException {
Map<String, Object> ajax = new HashMap<>(); Map<String, Object> ajax = new HashMap<>();
if (!avatarfile.isEmpty()) { if (!avatarfile.isEmpty()) {
String extension = FileUtil.extName(avatarfile.getOriginalFilename()); String extension = FileUtil.extName(avatarfile.getOriginalFilename());
......
...@@ -170,7 +170,8 @@ tenant: ...@@ -170,7 +170,8 @@ tenant:
- d_subcontract - d_subcontract
- advisory_body - advisory_body
- advisory_body_project - advisory_body_project
- advisory_body_custom_form - advisory_body_custom_form_data
- advisory_body_custom_form_template
- dim_area - dim_area
- biz_dict_data - biz_dict_data
- push_monitor_rules - push_monitor_rules
......
...@@ -5,13 +5,14 @@ import com.dsk.common.core.controller.BaseController; ...@@ -5,13 +5,14 @@ import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.PageQuery; import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.R; import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.AdvisoryBodyCustomForm; import com.dsk.cscec.domain.AdvisoryBodyCustomFormData;
import com.dsk.cscec.domain.AdvisoryBodyCustomFormTemplate;
import com.dsk.cscec.domain.bo.*; import com.dsk.cscec.domain.bo.*;
import com.dsk.cscec.domain.vo.*; import com.dsk.cscec.domain.vo.*;
import com.dsk.cscec.service.AdvisoryBodyCustomFormService; import com.dsk.cscec.service.AdvisoryBodyCustomFormDataService;
import com.dsk.cscec.service.AdvisoryBodyCustomFormTemplateService;
import com.dsk.cscec.service.AdvisoryBodyService; import com.dsk.cscec.service.AdvisoryBodyService;
import com.dsk.cscec.service.IDProjectService; import com.dsk.cscec.service.IDProjectService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -33,7 +34,9 @@ public class AdvisoryBodyManageController extends BaseController { ...@@ -33,7 +34,9 @@ public class AdvisoryBodyManageController extends BaseController {
@Resource @Resource
private AdvisoryBodyService advisoryBodyService; private AdvisoryBodyService advisoryBodyService;
@Resource @Resource
private AdvisoryBodyCustomFormService advisoryBodyCustomFormService; private AdvisoryBodyCustomFormDataService customFormDataService;
@Resource
private AdvisoryBodyCustomFormTemplateService templateService;
/** /**
* 获取项目列表 * 获取项目列表
...@@ -95,28 +98,36 @@ public class AdvisoryBodyManageController extends BaseController { ...@@ -95,28 +98,36 @@ public class AdvisoryBodyManageController extends BaseController {
} }
/** /**
* 获取咨询机构自定义表单 * 获取自定义表单模板
*/
@GetMapping("/getCustomFormTemplate")
public R<AdvisoryBodyCustomFormTemplate> getCustomFormTemplate() {
//业务上确定只有一个模板
List<AdvisoryBodyCustomFormTemplate> templates = templateService.list();
return R.ok(templates.isEmpty() ? null : templates.get(0));
}
/**
* 编辑自定义表单模板
*/ */
@GetMapping("/getAdvisoryBodyCustomForm") @PostMapping("/editCustomFormTemplate")
public R<List<AdvisoryBodyCustomForm>> getAdvisoryBodyCustomForm() { public R<Void> editCustomFormTemplate(@Validated @RequestBody AdvisoryBodyCustomFormTemplate customFormTemplate) {
return R.ok(advisoryBodyCustomFormService.list()); return toAjax(templateService.editCustomFormTemplate(customFormTemplate));
} }
/** /**
* 新增咨询机构自定义表单 * 根据项目主键查询自定义表单数据表数据
*/ */
@PostMapping("/addAdvisoryBodyCustomForm") @GetMapping("/getCustomFormDataByProjectKey/{projectKey}")
@Transactional(rollbackFor = Exception.class) public R<AdvisoryBodyCustomFormData> getCustomFormDataByProjectKey(@PathVariable Long projectKey) {
public R<Void> addAdvisoryBodyCustomForm(@Validated @RequestBody AdvisoryBodyCustomForm advisoryBodyCustomForm) { return R.ok(customFormDataService.getById(projectKey));
return toAjax(advisoryBodyCustomFormService.save(advisoryBodyCustomForm));
} }
/** /**
* 更新咨询机构自定义表单 * 编辑自定义表单数据表数据
*/ */
@PutMapping("/updateAdvisoryBodyCustomForm") @PostMapping("/editCustomFormData")
@Transactional(rollbackFor = Exception.class) public R<Void> editCustomFormData(@Validated @RequestBody AdvisoryBodyCustomFormData customFormData) {
public R<Void> updateAdvisoryBodyCustomForm(@Validated @RequestBody EditAdvisoryBodyCustomFormBo editBo) { return toAjax(customFormDataService.editCustomFormData(customFormData));
return toAjax(advisoryBodyCustomFormService.updateById(editBo));
} }
} }
\ No newline at end of file
package com.dsk.cscec.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.dsk.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 咨询机构自定义表单数据表(AdvisoryBodyCustomFormData)实体类
*
* @author sxk
* @since 2023-12-20 16:39:43
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class AdvisoryBodyCustomFormData extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 项目主键
*/
@TableId(value = "project_key")
@NotNull(message = "项目主键不能为空")
private Long projectKey;
/**
* 模板ID
*/
@NotNull(message = "模板ID不能为空")
private Long templateId;
/**
* json数据
*/
@NotBlank(message = "json数据不能为空")
private String jsonData;
}
...@@ -9,20 +9,20 @@ import javax.validation.constraints.NotBlank; ...@@ -9,20 +9,20 @@ import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
/** /**
* 咨询机构自定义表单(AdvisoryBodyCustomForm)实体类 * 咨询机构自定义表单模板表(AdvisoryBodyCustomFormTemplate)实体类
* *
* @author sxk * @author sxk
* @since 2023-12-20 16:39:43 * @since 2024-01-15 16:53:19
*/ */
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
public class AdvisoryBodyCustomForm extends BaseEntity implements Serializable { public class AdvisoryBodyCustomFormTemplate extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 324906245942046585L;
/** /**
* 项目主键 * 模板ID
*/ */
@TableId(value = "ab_custom_form_id") @TableId(value = "template_id")
private Long abCustomFormId; private Long templateId;
/** /**
* json数据 * json数据
*/ */
......
package com.dsk.cscec.domain.bo;
import com.dsk.cscec.domain.AdvisoryBodyCustomForm;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @author sxk
* @date 2024.01.09
* @time 11:24
*/
@Data
public class EditAdvisoryBodyCustomFormBo extends AdvisoryBodyCustomForm {
/**
* 项目主键
*/
@NotNull(message = "自定义表单ID不能为空")
private Long abCustomFormId;
}
...@@ -32,6 +32,10 @@ public class ProjectDetailVo { ...@@ -32,6 +32,10 @@ public class ProjectDetailVo {
*/ */
private AdvisoryBodyProject advisoryBodyProject; private AdvisoryBodyProject advisoryBodyProject;
/**
* 项目名称
*/
private String projectName;
//工程基本信息-项目主体 //工程基本信息-项目主体
/** /**
* 业主名称(业主单位) * 业主名称(业主单位)
......
...@@ -67,7 +67,10 @@ public class ProjectSearchVo { ...@@ -67,7 +67,10 @@ public class ProjectSearchVo {
* 合同金额 * 合同金额
*/ */
private BigDecimal contractOrigValue; private BigDecimal contractOrigValue;
/**
* 业主单位Cid
*/
private Long ownerUnitCid;
/** /**
* 业主单位 * 业主单位
*/ */
......
package com.dsk.cscec.mapper; package com.dsk.cscec.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.cscec.domain.AdvisoryBodyCustomForm; import com.dsk.cscec.domain.AdvisoryBodyCustomFormData;
/** /**
* 咨询机构自定义表单(AdvisoryBodyCustomForm)表数据库访问层 * 咨询机构自定义表单数据表(AdvisoryBodyCustomFormData)表数据库访问层
* *
* @author sxk * @author sxk
* @since 2023-12-20 16:39:37 * @since 2023-12-20 16:39:37
*/ */
public interface AdvisoryBodyCustomFormMapper extends BaseMapper<AdvisoryBodyCustomForm> { public interface AdvisoryBodyCustomFormDataMapper extends BaseMapper<AdvisoryBodyCustomFormData> {
} }
package com.dsk.cscec.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.cscec.domain.AdvisoryBodyCustomFormTemplate;
/**
* 咨询机构自定义表单模板表(AdvisoryBodyCustomFormTemplate)表数据库访问层
*
* @author sxk
* @since 2024-01-15 16:53:17
*/
public interface AdvisoryBodyCustomFormTemplateMapper extends BaseMapper<AdvisoryBodyCustomFormTemplate> {
}
package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.cscec.domain.AdvisoryBodyCustomFormData;
/**
* 咨询机构自定义表单数据表(AdvisoryBodyCustomFormData)表服务接口
*
* @author sxk
* @since 2023-12-20 17:33:31
*/
public interface AdvisoryBodyCustomFormDataService extends IService<AdvisoryBodyCustomFormData> {
/**
* 编辑自定义表单数据表数据
*
* @param customFormData 编辑信息
* @return 编辑结果
*/
Integer editCustomFormData(AdvisoryBodyCustomFormData customFormData);
}
\ No newline at end of file
package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.cscec.domain.AdvisoryBodyCustomForm;
/**
* 咨询机构自定义表单(AdvisoryBodyCustomForm)表服务接口
*
* @author makejava
* @since 2023-12-20 17:33:31
*/
public interface AdvisoryBodyCustomFormService extends IService<AdvisoryBodyCustomForm> {
}
package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.cscec.domain.AdvisoryBodyCustomFormTemplate;
/**
* 咨询机构自定义表单模板表(AdvisoryBodyCustomFormTemplate)表服务接口
*
* @author sxk
* @since 2024-01-15 16:53:20
*/
public interface AdvisoryBodyCustomFormTemplateService extends IService<AdvisoryBodyCustomFormTemplate> {
/**
* 编辑自定义表单模板
*
* @param customFormTemplate 编辑对象
* @return 编辑结果
*/
Integer editCustomFormTemplate(AdvisoryBodyCustomFormTemplate customFormTemplate);
}
package com.dsk.cscec.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.exception.ServiceException;
import com.dsk.cscec.domain.AdvisoryBodyCustomFormData;
import com.dsk.cscec.domain.AdvisoryBodyCustomFormTemplate;
import com.dsk.cscec.mapper.AdvisoryBodyCustomFormDataMapper;
import com.dsk.cscec.mapper.AdvisoryBodyCustomFormTemplateMapper;
import com.dsk.cscec.service.AdvisoryBodyCustomFormDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* 咨询机构自定义表单数据表(AdvisoryBodyCustomFormData)表服务实现类
*
* @author sxk
* @since 2023-12-20 17:33:31
*/
@Slf4j
@Service("advisoryBodyCustomFormService")
public class AdvisoryBodyCustomFormDataServiceImpl extends ServiceImpl<AdvisoryBodyCustomFormDataMapper, AdvisoryBodyCustomFormData> implements AdvisoryBodyCustomFormDataService {
@Resource
private AdvisoryBodyCustomFormDataMapper baseMapper;
@Resource
private AdvisoryBodyCustomFormTemplateMapper templateMapper;
/**
* 编辑自定义表单数据表数据
*
* @param customFormData 编辑信息
* @return 编辑结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Integer editCustomFormData(AdvisoryBodyCustomFormData customFormData) {
//校验自定义表单模板是否存在
if (!templateMapper.exists(new LambdaQueryWrapper<AdvisoryBodyCustomFormTemplate>()
.eq(AdvisoryBodyCustomFormTemplate::getTemplateId, customFormData.getTemplateId()))) {
throw new ServiceException("自定义表单模板不存在");
}
//数据存在,走更新覆盖;否则走新增
if (baseMapper.exists(new LambdaQueryWrapper<AdvisoryBodyCustomFormData>()
.eq(AdvisoryBodyCustomFormData::getProjectKey, customFormData.getProjectKey()))) {
log.info("项目{}更新自定义表单数据", customFormData.getTemplateId());
return baseMapper.updateById(customFormData);
} else {
log.info("项目{}新增自定义表单数据", customFormData.getTemplateId());
return baseMapper.insert(customFormData);
}
}
}
package com.dsk.cscec.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.cscec.domain.AdvisoryBodyCustomForm;
import com.dsk.cscec.mapper.AdvisoryBodyCustomFormMapper;
import com.dsk.cscec.service.AdvisoryBodyCustomFormService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 咨询机构自定义表单(AdvisoryBodyCustomForm)表服务实现类
*
* @author sxk
* @since 2023-12-20 17:33:31
*/
@Service("advisoryBodyCustomFormService")
public class AdvisoryBodyCustomFormServiceImpl extends ServiceImpl<AdvisoryBodyCustomFormMapper, AdvisoryBodyCustomForm> implements AdvisoryBodyCustomFormService {
@Resource
private AdvisoryBodyCustomFormMapper baseMapper;
}
package com.dsk.cscec.service.impl;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.exception.ServiceException;
import com.dsk.cscec.domain.AdvisoryBodyCustomFormTemplate;
import com.dsk.cscec.mapper.AdvisoryBodyCustomFormTemplateMapper;
import com.dsk.cscec.service.AdvisoryBodyCustomFormTemplateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* 咨询机构自定义表单模板表(AdvisoryBodyCustomFormTemplate)表服务实现类
*
* @author sxk
* @since 2024-01-15 16:53:20
*/
@Slf4j
@Service("advisoryBodyCustomFormTemplateService")
public class AdvisoryBodyCustomFormTemplateServiceImpl extends ServiceImpl<AdvisoryBodyCustomFormTemplateMapper, AdvisoryBodyCustomFormTemplate> implements AdvisoryBodyCustomFormTemplateService {
@Resource
private AdvisoryBodyCustomFormTemplateMapper baseMapper;
/**
* 编辑自定义表单模板
*
* @param customFormTemplate 编辑对象
* @return 编辑结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Integer editCustomFormTemplate(AdvisoryBodyCustomFormTemplate customFormTemplate) {
//模板ID为空,则为新增,否则为更新覆盖
Long templateId = customFormTemplate.getTemplateId();
if (ObjectUtil.isNull(templateId)) {
templateId = IdUtil.getSnowflakeNextId();
customFormTemplate.setTemplateId(templateId);
log.info("新增自定义表单模板,模板ID:{}", templateId);
return baseMapper.insert(customFormTemplate);
} else {
//校验模板是否存在
if (!baseMapper.exists(new LambdaQueryWrapper<AdvisoryBodyCustomFormTemplate>()
.eq(AdvisoryBodyCustomFormTemplate::getTemplateId, customFormTemplate.getTemplateId()))) {
throw new ServiceException("该自定义表单模板不存在");
}
log.info("更新自定义表单模板{}", templateId);
return baseMapper.updateById(customFormTemplate);
}
}
}
...@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.core.domain.PageQuery; import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.exception.ServiceException;
import com.dsk.common.utils.StringUtils; import com.dsk.common.utils.StringUtils;
import com.dsk.cscec.constant.AdvisoryBodyManageQueryConstants; import com.dsk.cscec.constant.AdvisoryBodyManageQueryConstants;
import com.dsk.cscec.domain.AdvisoryBody; import com.dsk.cscec.domain.AdvisoryBody;
...@@ -19,6 +20,7 @@ import com.dsk.cscec.domain.DProject; ...@@ -19,6 +20,7 @@ import com.dsk.cscec.domain.DProject;
import com.dsk.cscec.domain.bo.CooperateProjectDetailSearchBo; import com.dsk.cscec.domain.bo.CooperateProjectDetailSearchBo;
import com.dsk.cscec.domain.bo.ProjectDetailBo; import com.dsk.cscec.domain.bo.ProjectDetailBo;
import com.dsk.cscec.domain.bo.ProjectSearchBo; import com.dsk.cscec.domain.bo.ProjectSearchBo;
import com.dsk.cscec.domain.vo.AdvisoryBodyExistVo;
import com.dsk.cscec.domain.vo.CooperateProjectDetailSearchVo; import com.dsk.cscec.domain.vo.CooperateProjectDetailSearchVo;
import com.dsk.cscec.domain.vo.ProjectDetailVo; import com.dsk.cscec.domain.vo.ProjectDetailVo;
import com.dsk.cscec.domain.vo.ProjectSearchVo; import com.dsk.cscec.domain.vo.ProjectSearchVo;
...@@ -33,10 +35,7 @@ import org.apache.commons.collections4.MapUtils; ...@@ -33,10 +35,7 @@ import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collections; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* 咨询机构管理 * 咨询机构管理
...@@ -121,6 +120,23 @@ public class IDProjectServiceImpl extends ServiceImpl<DProjectMapper, DProject> ...@@ -121,6 +120,23 @@ public class IDProjectServiceImpl extends ServiceImpl<DProjectMapper, DProject>
if (StringUtils.isNotBlank(projectSearchBo.getProjectName())) { if (StringUtils.isNotBlank(projectSearchBo.getProjectName())) {
projectSearchVo.setProjectName(StringUtils.markInRed(projectSearchVo.getProjectName(), projectSearchBo.getProjectName())); projectSearchVo.setProjectName(StringUtils.markInRed(projectSearchVo.getProjectName(), projectSearchBo.getProjectName()));
} }
//查询业主单位Cid
String ownerName = projectSearchVo.getOwnerName();
Map<String, Object> params = new HashMap<>();
params.put("keyword", ownerName);
Map jskData = MapUtils.getMap(dskOpenApiUtil.requestBody("/nationzj/enterprice/index", params), "data", null);
//防止没有数据而导致强转错误,所以先判断下total
if (MapUtils.getInteger(jskData, "total", 0) > 0) {
List<Map<String, Object>> data = (List<Map<String, Object>>) jskData.get("list");
for (Map<String, Object> companyData : data) {
//企业名称完全匹配上,则直接返回给前端
if (ownerName.equals(StringUtils.removeRed(MapUtils.getString(companyData, "name", "NotExist")))) {
//jskEid就是cid
projectSearchVo.setOwnerUnitCid(MapUtils.getLong(companyData, "jskEid"));
}
}
}
} }
return TableDataInfo.build(page); return TableDataInfo.build(page);
} }
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsk.cscec.mapper.AdvisoryBodyCustomFormMapper"> <mapper namespace="com.dsk.cscec.mapper.AdvisoryBodyCustomFormDataMapper">
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsk.cscec.mapper.AdvisoryBodyCustomFormTemplateMapper">
</mapper>
...@@ -73,7 +73,7 @@ export const updateConsultingDetailApi = (data) => request({ ...@@ -73,7 +73,7 @@ export const updateConsultingDetailApi = (data) => request({
* @returns * @returns
*/ */
export const getCustomFormDetailApi = () => request({ export const getCustomFormDetailApi = () => request({
url: "/advisory/body/getAdvisoryBodyCustomForm", url: "/advisory/body/getCustomFormTemplate",
method: "get", method: "get",
params: {} params: {}
}); });
...@@ -84,23 +84,33 @@ export const getCustomFormDetailApi = () => request({ ...@@ -84,23 +84,33 @@ export const getCustomFormDetailApi = () => request({
* @returns * @returns
*/ */
export const addCustomFormDataApi = (data) => request({ export const addCustomFormDataApi = (data) => request({
url: "/advisory/body/addAdvisoryBodyCustomForm", url: "/advisory/body/editCustomFormTemplate",
method: "post", method: "post",
data data
}); });
/** /**
* 更新自定义表单 * 获取自定义表单数据
* @param {*} projectKey
* @returns
*/
export const getCustomFormDataByProjectKeyApi = (projectKey) => request({
url: `/advisory/body/getCustomFormDataByProjectKey/${projectKey}`,
method: "get",
params: {}
});
/**
* 新增 更新 自定义表单数据
* @param {*} data * @param {*} data
* @returns * @returns
*/ */
export const updateCustomFormDataApi = (data) => request({ export const updateCustomFormData = (data) => request({
url: "/advisory/body/updateAdvisoryBodyCustomForm", url: "/advisory/body/editCustomFormData",
method: "post", method: "post",
data data
}); });
/** /**
* oss文件上传地址 * oss文件上传地址
* @param {*} data * @param {*} data
...@@ -111,3 +121,14 @@ export const uploadFileToOssApi = (data) => request({ ...@@ -111,3 +121,14 @@ export const uploadFileToOssApi = (data) => request({
method: "post", method: "post",
data data
}); });
/**
* 根据ossId 删除资源
* @param {*} ossId
* @returns
*/
export const removeFileFromOssApi = (ossId) => request({
url: `/system/oss/${ossId}`,
method: "delete",
params: {}
});
...@@ -613,12 +613,6 @@ ...@@ -613,12 +613,6 @@
"id": 431, "id": 431,
"type": 6, "type": 6,
"parentId": 303 "parentId": 303
},
{
"name": "工程设计农林行业(林业工程)",
"id": 433,
"type": 6,
"parentId": 303
} }
], ],
"parentId": 231 "parentId": 231
......
.el-dialog__header {
padding: 0px 20px;
height: 56px;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #eeeeee;
.el-dialog__title {
color: #232323;
font-size: 16px;
font-weight: bold;
}
.el-dialog__headerbtn {
position: static;
height: 16px;
width: 16px;
}
}
.el-dialog {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
margin: 0px;
margin-top: 0px !important;
.el-dialog__body {
padding: 24px 20px;
box-sizing: border-box;
.el-table {
th {
height: 40px;
padding: 9px 0px;
box-sizing: border-box;
font-size: 12px;
font-weight: 400;
color: #232323;
}
.cell {
display: block;
line-height: 22px;
}
}
.el-image {
width: 100%;
.el-image__error {
height: 300px;
}
}
.el-pagination {
margin-top: 16px;
padding: 0px;
display: flex;
align-items: center;
justify-content: flex-end;
.el-pager {
height: 28px;
}
}
}
}
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
line-height: 1; line-height: 1;
height: 100%; height: 100%;
width: 100%; width: 100%;
padding: 0px 12px; padding: 0px 7px;
border: none; border: none;
} }
} }
......
<template>
<div class="dsk-custom-item-render" :class="classCreate(comCustomItem.comType)">
<!-- 编辑模式 -->
<el-form-item class="dsk-custom-form-render-item" :prop="validatorTarget" :rules="validatorRules(comCustomItem)" :show-message="false">
<template v-if="isModify">
<!-- 单行文本类型 -->
<el-input v-model="comCustomItem.componentAttribute.value" :placeholder="comCustomItem.componentAttribute.placeholder" clearable
v-if="comCustomItem.comType == 'text'"></el-input>
<!-- 多行文本类型 -->
<el-input type="textarea" v-model="comCustomItem.componentAttribute.value" :placeholder="comCustomItem.componentAttribute.placeholder"
:show-word-limit="false" clearable v-if="comCustomItem.comType == 'textarea'"></el-input>
<!-- 下拉框类型 -->
<el-select v-model="comCustomItem.componentAttribute.value" :multiple="comCustomItem.formAttribute.isMultiple"
:collapse-tags="comCustomItem.formAttribute.isMultiple" :placeholder="comCustomItem.componentAttribute.placeholder"
v-if="comCustomItem.comType == 'select'">
<el-option v-for="(item,index) in comCustomItem.formAttribute.selectOptions" :key="item.id" :label="item.value" :value="item.value">
</el-option>
</el-select>
<!-- 时间类型 -->
<el-date-picker v-model="comCustomItem.componentAttribute.value" type="datetime" :value-format="'yyyy-MM-dd HH:mm:ss'"
:placeholder="comCustomItem.componentAttribute.placeholder" v-if="comCustomItem.comType == 'date'">
</el-date-picker>
<!-- 电话类型 -->
<el-input v-model="comCustomItem.componentAttribute.value" :placeholder="comCustomItem.componentAttribute.placeholder" clearable
v-if="comCustomItem.comType == 'phone'"></el-input>
<!-- 电子邮箱类型 -->
<dsk-email-input v-model="comCustomItem.componentAttribute.value" :placeholder="comCustomItem.componentAttribute.placeholder"
:clearable="true" v-if="comCustomItem.comType == 'email'"></dsk-email-input>
</template>
<!-- 图片类型 -->
<dsk-photo-input v-model="comCustomItem.componentAttribute.value" v-if="comCustomItem.comType == 'photo'"
:limit="comCustomItem.formAttribute.limit" :disabled="!isModify"></dsk-photo-input>
<!-- 文件类型 -->
<dsk-file-input v-model="comCustomItem.componentAttribute.value" v-if="comCustomItem.comType == 'file'"
:limit="comCustomItem.formAttribute.limit" :disabled="!isModify"></dsk-file-input>
<!-- 详情模式下 -->
<template v-if="!isModify && detailTypes.includes(comCustomItem.comType)">
<div class="dsk-cutom-form-render-detail-item">
<div class="render-detail-item-inner">
<dsk-text-over-flow-tip>
<span>{{detailRender(comCustomItem)}}</span>
<template slot="overflow">{{detailRender(comCustomItem)}}</template>
</dsk-text-over-flow-tip>
</div>
</div>
</template>
</el-form-item>
</div>
</template>
<script>
import DskEmailInput from "@/components/DskEmailInput";
import DskPhotoInput from "@/components/DskPhotoInput";
import DskFileInput from "@/components/DskFileInput";
import DskTextOverFlowTip from "@/components/DskTextOverFlowTip";
export default {
name: "dskCustomItemRender",
components: {
DskEmailInput,
DskPhotoInput,
DskFileInput,
DskTextOverFlowTip
},
props: {
customItem: Object,
// 模块下标
customModuleIndex: Number,
// 父级下标
customRowIndex: Number,
// 当前下标
customItemIndex: Number,
// 是否处于修改模式
isModify: Boolean
},
watch: {
customItem: {
handler(newValue) {
this.comCustomItem = newValue;
},
deep: true
},
customRowIndex: {
handler(newValue) {
this.comCustomRowIndex = newValue;
},
immediate: true
},
customItemIndex: {
handler(newValue) {
this.comCustomItemIndex = newValue;
},
immediate: true
},
customModuleIndex: {
handler(newValue) {
this.comCustomModuleIndex = newValue;
},
immediate: true
},
isModify: {
handler(newValue) {
this.comIsModify = newValue;
},
immediate: true
}
},
data() {
return {
comCustomItem: this.customItem,
comCustomModuleIndex: this.customModuleIndex,
comCustomRowIndex: this.customRowIndex,
comCustomItemIndex: this.customItemIndex,
comIsModify: this.isModify,
detailTypes: ["text", "textarea", "select", "date", "phone", "email"]
};
},
//可访问data属性
created() {
},
//计算集
computed: {
// prop传递的验证值
validatorTarget() {
return `subfieldModuleList.${this.comCustomModuleIndex}.childrentGroup.${this.comCustomRowIndex}.${this.comCustomItemIndex}.componentAttribute.value`;
}
},
//方法集
methods: {
// 验证规则
validatorRules(item) {
let type = Object.prototype.toString.call(item.componentAttribute.value).split(" ")[1].replace("]", "").toLowerCase();
if (!item.formAttribute) return { required: false, type };
if (item.formAttribute.required) {
if (item.formAttribute.requiredRules) return item.formAttribute.requiredRules;
return { required: true, type, message: `${item.formAttribute.label}不能为空` };
}
if (Object.keys(item.formAttribute.rules).length) {
return item.formAttribute.rules;
} else {
return { required: false, type };
};
},
classCreate(comType) {
const classParams = {
[`custom-render-item-${comType}`]: true
};
return classParams;
},
detailRender(item) {
const value = item.componentAttribute.value;
const valueType = Object.prototype.toString.call(value);
if (valueType === "[object String]") return value || value == "0" ? value : "-";
if (valueType === "[object Array]") return value?.length ? value.join(",") : "-";
}
},
}
</script>
<style lang="scss" scoped>
.dsk-custom-item-render {
width: 100%;
height: 100%;
position: relative;
&.custom-render-item-file,
&.custom-render-item-photo {
::v-deep .dsk-photo-input-container,
.dsk-file-input-container {
height: 40px;
display: flex;
align-items: center;
padding-left: 12px;
box-sizing: border-box;
}
}
::v-deep .dsk-custom-form-render-item {
.dsk-cutom-form-render-detail-item {
width: 100%;
display: flex;
align-items: center;
height: 40px;
line-height: 40px;
padding: 9px 12px;
box-sizing: border-box;
.render-detail-item-inner {
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
::v-deep &.custom-render-item-textarea {
.dsk-custom-form-render-item {
.dsk-cutom-form-render-detail-item {
}
}
}
}
</style>
<template> <template>
<div class="dsk-email-input-container"> <div class="dsk-email-input-container">
<el-autocomplete :popper-class="popperClass" v-model="comEmailValue" :clearable="clearable" :fetch-suggestions="searchQuery" <el-autocomplete :popper-class="popperClass" v-model="comEmailValue" :clearable="clearable" :fetch-suggestions="searchQuery"
:placeholder="placeholder" @select="handleSelect" @input="valueChange"> :placeholder="placeholder" @select="handleSelect" @input="valueChange" :disabled="disabled">
<template slot-scope="{ item }"> <template slot-scope="{ item }">
<slot :optionData="item"> <slot :optionData="item">
<div class="email-type-option"> <div class="email-type-option">
<div class="email-type-inner"> <div class="email-type-inner">
<div class="email-icon-box"></div> <!-- <div class="email-icon-box"></div> -->
<div class="email-content-box">{{item.value}}</div> <div class="email-content-box">
<div class="email-content-box-inner">{{item.value}}</div>
</div>
</div> </div>
<div class="email-vfx-box"></div> <div class="email-vfx-box"></div>
</div> </div>
...@@ -88,14 +90,6 @@ export default { ...@@ -88,14 +90,6 @@ export default {
prop: "emailValue", prop: "emailValue",
event: "update:emailValue" event: "update:emailValue"
}, },
watch: {
emailValue: {
handler(newValue) {
this.comEmailValue = newValue;
},
immediate: true
}
},
data() { data() {
return { return {
comEmailValue: this.emailValue, comEmailValue: this.emailValue,
...@@ -167,6 +161,7 @@ export default { ...@@ -167,6 +161,7 @@ export default {
</style> </style>
<style lang="scss"> <style lang="scss">
.dsk-email-options-popper { .dsk-email-options-popper {
min-width: 240px;
.el-autocomplete-suggestion__wrap { .el-autocomplete-suggestion__wrap {
.el-autocomplete-suggestion__list { .el-autocomplete-suggestion__list {
& > [id*="el-autocomplete"] { & > [id*="el-autocomplete"] {
...@@ -216,13 +211,21 @@ export default { ...@@ -216,13 +211,21 @@ export default {
} }
.email-content-box { .email-content-box {
width: calc(100% - 40px); /* width: calc(100% - 40px); */
width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
margin-left: 16px; margin-left: 16px;
color: rgba(35, 35, 35, 0.8); color: rgba(35, 35, 35, 0.8);
.email-content-box-inner {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
} }
} }
} }
......
<template>
<div class="dsk-file-input-container" :class="{'upload-is-disabled' : disabled}">
<div class="dsk-file-input-inner" @click.stop="uploadFile" v-if="!comFileList.length">
<i class="el-icon-plus"></i>
<span>上传文件</span>
</div>
<el-badge :value="comFileList.length" class="item" type="primary" v-if="comFileList.length" @click.native="showFileListDialog">
<div class="dsk-file-input-inner" @click.stop="uploadFile">
<i class="el-icon-plus"></i>
<span>上传文件</span>
</div>
</el-badge>
<el-upload :on-change="handleChange" action="#" :accept="allowTypes.join(',')" :auto-upload="false" :show-file-list="false"
ref="elUploadDskUploadIns" class="el-upload-dsk-upload-ins"></el-upload>
<el-dialog title="已上传文件" :visible.sync="fileListDialog" width="800px" @close="fileListDialogClose" :close-on-click-modal="false"
class="dsk-upload-file-dialog" append-to-body>
<el-table :data="comFileList.slice((pageInfo.currentPage -1) * pageInfo.pageSize, pageInfo.pageSize * pageInfo.currentPage)" border stripe>
<el-table-column prop="fileName" label="文件名称"></el-table-column>
<el-table-column prop="type" label="文件类型"></el-table-column>
<el-table-column prop="url" label="文件地址" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span style="color:#0081ff;cursor: pointer;" @click="viewFile(scope.row)">{{scope.row.url}}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="90" v-if="!disabled">
<template slot-scope="scope">
<span style="color:#F56C6C;cursor: pointer;" @click="removeImg(scope.row)">删除</span>
</template>
</el-table-column>
</el-table>
<el-pagination background layout="prev, pager, next" :total="comFileList.length" @current-change="currentChange"
v-if="comFileList.length > 10"></el-pagination>
</el-dialog>
</div>
</template>
<script>
import { uploadFileToOssApi, removeFileFromOssApi } from "@/api/consultingOrgManagement";
import { elementMessageSingleton } from "@/utils";
export default {
name: "dskFileInput",
props: {
limit: {
type: [String, Number]
},
disabled: {
type: Boolean,
default: false
},
fileList: {
type: Array,
default: () => []
},
// 是否是演示模式
presentationModel: {
type: Boolean,
default: false
}
},
model: {
prop: "fileList",
event: "update:fileList"
},
data() {
return {
allowTypes: [".docx", ".pdf", ".doc", ".xlsx", ".xls", ".xlt", ".xlsm", ".txt", ".xltm"],
comFileList: JSON.parse(JSON.stringify(this.fileList)),
fileListDialog: false,
pageInfo: {
pageSize: 10,
currentPage: 1
}
};
},
//可访问data属性
created() {
},
beforeDestroy() {
if (this.presentationModel) {
this.comFileList.forEach(item => {
if (item?.url?.indexOf("localhost") > -1) {
URL.revokeObjectURL(item.url);
}
});
}
},
//计算集
computed: {
limitRestrict() {
return this.limit === -1 ? true : this.comFileList.length >= this.limit ? false : true;
}
},
//方法集
methods: {
async handleChange(file, fileList) {
try {
/**
* @type {string}
*/
let fileName = file.name;
let fileType = "";
const index = fileName.lastIndexOf(".");
if (index) fileType = fileName.slice(index);
if (!this.allowTypes.includes(fileType.toLowerCase())) {
return this.$message.warning(`只支持上传${this.allowTypes.join(" , ")}类型文件`);
}
// 是否是演示模式
if (this.presentationModel) {
await this.uploadHandleLocal(file, fileType);
} else {
// 验证通过进行上传
await this.uploadHandle(new File([file.raw], encodeURIComponent(fileName)), fileType);
}
} catch (error) {
console.log(error);
} finally {
this.$refs["elUploadDskUploadIns"].clearFiles();
}
},
uploadFile() {
// 禁用状态
if (this.disabled) return;
// 超出个数限制
if (!this.limitRestrict) return elementMessageSingleton("warning", `文件限制上传${this.limit}个,已上传${this.comFileList.length}个文件`);
this.$refs["elUploadDskUploadIns"].$el.querySelector(".el-upload__input").click();
},
async uploadHandle(file, fileType) {
try {
const formData = new FormData();
formData.append("file", file);
const result = await uploadFileToOssApi(formData);
if (result.code == 200 && result.data) {
this.comFileList.push({
url: result.data.url,
type: fileType,
id: result.data.ossId,
fileName: result.data.fileName
});
this.$emit("update:fileList", this.comFileList);
this.$message.success("上传成功");
}
} catch (error) {
console.log(error);
}
},
async uploadHandleLocal(file, fileType) {
try {
const localUrl = URL.createObjectURL(file.raw);
this.comFileList.push({
url: localUrl,
type: fileType,
id: `${new Date().getTime()}${generateRandomLowerCaseLetter()}`,
fileName: file.name
});
this.$emit("update:fileList", this.comFileList);
this.$message.success("上传成功");
} catch (error) {
console.log(error);
}
},
showFileListDialog() {
this.fileListDialog = true;
},
fileListDialogClose() {
this.pageInfo = this.$options.data.call(this).pageInfo;
},
viewFile(row) {
this.$download.saveAs(row.url, row.fileName);
},
currentChange(current) {
this.pageInfo.currentPage = current;
},
removeImg(row) {
if (row.id) {
if (this.presentationModel) {
return this.removeLocalImg(row.id);
}
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const index = this.comFileList.findIndex(item => item.id == row.id);
if (index > -1) {
const removeResult = await removeFileFromOssApi(row.id);
if (removeResult.code == 200) {
this.comFileList.splice(index, 1);
this.$emit("update:fileList", this.comFileList);
this.$message({
type: 'success',
message: '删除成功!'
});
}
}
}).catch(() => { });
}
},
removeLocalImg(id) {
const index = this.comFileList.findIndex(item => item.id == id);
if (index > -1) {
const url = this.comFileList[index].url;
URL.revokeObjectURL(url);
this.comFileList.splice(index, 1);
this.$emit("update:fileList", this.comFileList);
this.$message({
type: 'success',
message: '删除成功!'
});
}
}
},
}
</script>
<style lang="scss" scoped>
.dsk-file-input-container {
width: 100%;
height: 32px;
&.upload-is-disabled {
.dsk-file-input-inner {
cursor: not-allowed;
&:hover {
color: rgba(35, 35, 35, 0.8);
border-color: #dcdfe6;
}
}
}
.dsk-file-input-inner {
width: 106px;
height: 32px;
background: #ffffff;
border: 1px solid #dcdfe6;
display: flex;
align-items: center;
justify-content: center;
padding: 0px 16px;
box-sizing: border-box;
color: rgba(35, 35, 35, 0.8);
font-size: 14px;
font-weight: 400;
cursor: pointer;
&:hover {
color: #0081ff;
border-color: #0081ff;
}
}
::v-deep .el-upload-dsk-upload-ins {
width: 0px;
height: 0px;
opacity: 0;
position: relative;
z-index: -999;
}
::v-deep .el-badge__content {
background: #0081ff;
cursor: pointer;
border-color: #0081ff;
}
}
</style>
<style lang="scss">
.dsk-upload-file-dialog {
@import "@/assets/styles/dsk-upload-dialog.scss";
}
</style>
<template> <template>
<div class="dsk-photo-input-container"> <div class="dsk-photo-input-container" :class="{'upload-is-disabled' : disabled}">
<el-badge :value="0" class="item" type="primary"> <div class="dsk-photo-input-inner" @click.stop="uploadFile" v-if="!comFileList.length">
<i class="el-icon-plus"></i>
<span>上传图片</span>
</div>
<el-badge :value="comFileList.length" class="item" type="primary" v-if="comFileList.length" @click.native="showFileListDialog">
<div class="dsk-photo-input-inner" @click.stop="uploadFile"> <div class="dsk-photo-input-inner" @click.stop="uploadFile">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<span>上传图片</span> <span>上传图片</span>
</div> </div>
</el-badge> </el-badge>
<el-upload :on-change="handleChange" action="#" :accept="allowTypes.join(',')" :auto-upload="false" :show-file-list="false" :limit="limit" <el-upload :on-change="handleChange" action="#" :accept="allowTypes.join(',')" :auto-upload="false" :show-file-list="false"
ref="elUploadDskUploadIns" class="el-upload-dsk-upload-ins"></el-upload> ref="elUploadDskUploadIns" class="el-upload-dsk-upload-ins"></el-upload>
<el-dialog title="已上传图片" :visible.sync="fileListDialog" width="800px" @close="fileListDialogClose" :close-on-click-modal="false"
class="dsk-upload-photo-dialog" append-to-body>
<el-table :data="comFileList.slice((pageInfo.currentPage -1) * pageInfo.pageSize, pageInfo.pageSize * pageInfo.currentPage)" border stripe>
<el-table-column prop="fileName" label="图片名称"></el-table-column>
<el-table-column prop="type" label="图片类型"></el-table-column>
<el-table-column prop="url" label="图片地址" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span style="color:#0081ff;cursor: pointer;" @click="viewPhoto(scope.row)">{{scope.row.url}}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="90" v-if="!disabled">
<template slot-scope="scope">
<span style="color:#F56C6C;cursor: pointer;" @click="removeImg(scope.row)">删除</span>
</template>
</el-table-column>
</el-table>
<el-pagination background layout="prev, pager, next" :total="comFileList.length" @current-change="currentChange"
v-if="comFileList.length > 10"></el-pagination>
</el-dialog>
<el-dialog title="图片预览" :visible.sync="photoViewDialog" width="800px" @close="photoViewDialogClose" :close-on-click-modal="false"
class="dsk-upload-view-dialog" append-to-body>
<el-image :src="viewTemp.url" fit="fill"></el-image>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { uploadFileToOssApi } from "@/api/consultingOrgManagement"; import { uploadFileToOssApi, removeFileFromOssApi } from "@/api/consultingOrgManagement";
import { elementMessageSingleton } from "@/utils";
import { generateRandomLowerCaseLetter } from "@/utils/";
export default { export default {
name: "dskPhotoInput", name: "dskPhotoInput",
props: { props: {
limit: { limit: {
type: [String, Number], type: [String, Number]
default: 1 },
disabled: {
type: Boolean,
default: false
},
fileList: {
type: Array,
default: () => []
},
// 是否是演示模式
presentationModel: {
type: Boolean,
default: false
} }
}, },
model: {
prop: "fileList",
event: "update:fileList"
},
data() { data() {
return { return {
allowTypes: [".jpg", ".png", ".svg", ".gif", ".jpeg"], allowTypes: [".jpg", ".png", ".svg", ".gif", ".jpeg"],
comFileList: [] comFileList: JSON.parse(JSON.stringify(this.fileList)),
fileListDialog: false,
photoViewDialog: false,
viewTemp: {},
pageInfo: {
pageSize: 10,
currentPage: 1
}
}; };
}, },
//可访问data属性 //可访问data属性
created() { created() {
},
beforeDestroy() {
if (this.presentationModel) {
this.comFileList.forEach(item => {
if (item?.url?.indexOf("localhost") > -1) {
URL.revokeObjectURL(item.url);
}
});
}
}, },
//计算集 //计算集
computed: { computed: {
limitRestrict() {
return this.limit === -1 ? true : this.comFileList.length >= this.limit ? false : true;
}
}, },
//方法集 //方法集
methods: { methods: {
...@@ -49,13 +115,25 @@ export default { ...@@ -49,13 +115,25 @@ export default {
if (!this.allowTypes.includes(fileType.toLowerCase())) { if (!this.allowTypes.includes(fileType.toLowerCase())) {
return this.$message.warning(`只支持上传${this.allowTypes.join(" , ")}类型图片`); return this.$message.warning(`只支持上传${this.allowTypes.join(" , ")}类型图片`);
} }
// 验证通过进行上传
const result = this.uploadHandle(file.raw, fileType);
} catch (error) {
// 是否是演示模式
if (this.presentationModel) {
await this.uploadHandleLocal(file, fileType);
} else {
// 验证通过进行上传
await this.uploadHandle(new File([file.raw], encodeURIComponent(fileName)), fileType);
}
} catch (error) {
console.log(error);
} finally {
this.$refs["elUploadDskUploadIns"].clearFiles();
} }
}, },
uploadFile() { uploadFile() {
// 禁用状态
if (this.disabled) return;
// 超出个数限制
if (!this.limitRestrict) return elementMessageSingleton("warning", `图片限制上传${this.limit}张,已上传${this.comFileList.length}张图片`);
this.$refs["elUploadDskUploadIns"].$el.querySelector(".el-upload__input").click(); this.$refs["elUploadDskUploadIns"].$el.querySelector(".el-upload__input").click();
}, },
async uploadHandle(file, fileType) { async uploadHandle(file, fileType) {
...@@ -67,12 +145,84 @@ export default { ...@@ -67,12 +145,84 @@ export default {
this.comFileList.push({ this.comFileList.push({
url: result.data.url, url: result.data.url,
type: fileType, type: fileType,
fileName: "" id: result.data.ossId,
fileName: result.data.fileName
}); });
this.$emit("update:fileList", this.comFileList);
this.$message.success("上传成功");
} }
} catch (error) { } catch (error) {
} }
},
async uploadHandleLocal(file, fileType) {
try {
const localUrl = URL.createObjectURL(file.raw);
this.comFileList.push({
url: localUrl,
type: fileType,
id: `${new Date().getTime()}${generateRandomLowerCaseLetter()}`,
fileName: file.name
});
this.$emit("update:fileList", this.comFileList);
this.$message.success("上传成功");
} catch (error) {
console.log(error);
}
},
showFileListDialog() {
this.fileListDialog = true;
},
fileListDialogClose() {
this.pageInfo = this.$options.data.call(this).pageInfo;
},
viewPhoto(row) {
this.viewTemp = row;
this.photoViewDialog = true;
},
photoViewDialogClose() {
this.viewTemp = {};
},
currentChange(current) {
this.pageInfo.currentPage = current;
},
removeImg(row) {
if (row.id) {
if (this.presentationModel) {
return this.removeLocalImg(row.id);
}
this.$confirm('此操作将永久删除该图片, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const index = this.comFileList.findIndex(item => item.id == row.id);
if (index > -1) {
const removeResult = await removeFileFromOssApi(row.id);
if (removeResult.code == 200) {
this.comFileList.splice(index, 1);
this.$emit("update:fileList", this.comFileList);
this.$message({
type: 'success',
message: '删除成功!'
});
}
}
}).catch(() => { });
}
},
removeLocalImg(id) {
const index = this.comFileList.findIndex(item => item.id == id);
if (index > -1) {
const url = this.comFileList[index].url;
URL.revokeObjectURL(url);
this.comFileList.splice(index, 1);
this.$emit("update:fileList", this.comFileList);
this.$message({
type: 'success',
message: '删除成功!'
});
}
} }
}, },
} }
...@@ -82,6 +232,16 @@ export default { ...@@ -82,6 +232,16 @@ export default {
width: 100%; width: 100%;
height: 32px; height: 32px;
&.upload-is-disabled {
.dsk-photo-input-inner {
cursor: not-allowed;
&:hover {
color: rgba(35, 35, 35, 0.8);
border-color: #dcdfe6;
}
}
}
.dsk-photo-input-inner { .dsk-photo-input-inner {
width: 106px; width: 106px;
height: 32px; height: 32px;
...@@ -111,5 +271,17 @@ export default { ...@@ -111,5 +271,17 @@ export default {
position: relative; position: relative;
z-index: -999; z-index: -999;
} }
::v-deep .el-badge__content {
background: #0081ff;
cursor: pointer;
border-color: #0081ff;
}
}
</style>
<style lang="scss">
.dsk-upload-photo-dialog,
.dsk-upload-view-dialog {
@import "@/assets/styles/dsk-upload-dialog.scss";
} }
</style> </style>
<template>
<div class="dsk-text-over-flow-tip">
<el-tooltip class="item" placement="top" effect="dark" ref="elToolTip" :disabled="tipDisable">
<div class="text-over-flow-tip-inner" :class="[$attrs['custom-class'] ? $attrs['custom-class'] : '' ]" @mouseover.stop.self="textHover">
<slot></slot>
</div>
<template slot="content">
<slot name="overflow"></slot>
</template>
</el-tooltip>
</div>
</template>
<script>
// 只能传入一个根元素 不能多级
export default {
name: "dskTextOverFlowTip",
data() {
return {
tipDisable: true
};
},
//可访问data属性
created() {
},
//计算集
computed: {
},
//方法集
methods: {
textHover(e) {
/**
* @type {{
* target : HTMLDivElement
* }}
*/
const { target } = e;
const clientWidth = target.clientWidth;
const scrollWidth = target.scrollWidth;
if (scrollWidth > clientWidth) {
this.tipDisable = false;
} else {
this.tipDisable = true;
}
},
},
}
</script>
<style lang="scss" scoped>
.dsk-text-over-flow-tip {
width: 100%;
.text-over-flow-tip-inner {
width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
</style>
// 默认自定义表单组件 // 默认自定义表单组件
import { validEmail } from "@/utils/validate";
/** /**
* 模块模板 * 模块模板
...@@ -42,7 +42,8 @@ export const defaultComOptions = [ ...@@ -42,7 +42,8 @@ export const defaultComOptions = [
label: "单行文本", label: "单行文本",
// 组件宽度 // 组件宽度
width: 100, width: 100,
isError: false isError: false,
allowDefaultValue: true
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -72,7 +73,8 @@ export const defaultComOptions = [ ...@@ -72,7 +73,8 @@ export const defaultComOptions = [
label: "多行文本", label: "多行文本",
// 组件宽度 // 组件宽度
width: 100, width: 100,
isError: false isError: false,
allowDefaultValue: true
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -94,9 +96,13 @@ export const defaultComOptions = [ ...@@ -94,9 +96,13 @@ export const defaultComOptions = [
formAttribute: { formAttribute: {
// 验证规则 // 验证规则
rules: { rules: {
required: true, validator: (rules, value, callback) => {
message: "请输入选项值", const type = Object.prototype.toString.call(value);
trigger: ["change", "blur"] if (type == "[object String]" || type == "[object Array]") {
callback();
}
callback(new Error("类型错误"));
}
}, },
// 是否必填 // 是否必填
required: false, required: false,
...@@ -105,11 +111,12 @@ export const defaultComOptions = [ ...@@ -105,11 +111,12 @@ export const defaultComOptions = [
// 展示label // 展示label
label: "下拉选项", label: "下拉选项",
// 组件宽度 // 组件宽度
width: 100, width: 50,
selectOptions: [], selectOptions: [],
// 是否多选 // 是否多选
isMultiple: false, isMultiple: false,
isError: false isError: false,
allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -138,8 +145,9 @@ export const defaultComOptions = [ ...@@ -138,8 +145,9 @@ export const defaultComOptions = [
// 展示label // 展示label
label: "日期/时间", label: "日期/时间",
// 组件宽度 // 组件宽度
width: 100, width: 50,
isError: false isError: false,
allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -190,8 +198,9 @@ export const defaultComOptions = [ ...@@ -190,8 +198,9 @@ export const defaultComOptions = [
// 展示label // 展示label
label: "电话", label: "电话",
// 组件宽度 // 组件宽度
width: 100, width: 50,
isError: false isError: false,
allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -216,7 +225,8 @@ export const defaultComOptions = [ ...@@ -216,7 +225,8 @@ export const defaultComOptions = [
trigger: ["blur"], trigger: ["blur"],
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
// console.log("value", value); // console.log("value", value);
if (value && !validEmail(value)) { const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (value && !reg.test(value)) {
return callback(new Error(`请输入正确的电子邮箱`)); return callback(new Error(`请输入正确的电子邮箱`));
} }
return callback(); return callback();
...@@ -225,10 +235,11 @@ export const defaultComOptions = [ ...@@ -225,10 +235,11 @@ export const defaultComOptions = [
requiredRules: { requiredRules: {
trigger: ["blur"], trigger: ["blur"],
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (!value && !value?.toString()?.trim()) { if (!value && !value?.toString()?.trim()) {
return callback(new Error(`请输入电子邮箱`)); return callback(new Error(`请输入电子邮箱`));
} }
if (!validEmail(value)) { if (!reg.test(value)) {
return callback(new Error(`请输入正确的电子邮箱`)); return callback(new Error(`请输入正确的电子邮箱`));
} }
return callback(); return callback();
...@@ -241,8 +252,9 @@ export const defaultComOptions = [ ...@@ -241,8 +252,9 @@ export const defaultComOptions = [
// 展示label // 展示label
label: "电子邮箱", label: "电子邮箱",
// 组件宽度 // 组件宽度
width: 100, width: 50,
isError: false isError: false,
allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -273,19 +285,19 @@ export const defaultComOptions = [ ...@@ -273,19 +285,19 @@ export const defaultComOptions = [
width: 100, width: 100,
limit: -1, limit: -1,
astrict: false, astrict: false,
fileList: [], isError: false,
isError: false allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
// 绑定的值 // 绑定的值
value: "", value: [],
// 输入值为空提示 // 输入值为空提示
placeholder: "请选择" placeholder: "请选择"
} }
}, },
{ {
// 图片类型 // 文件类型
comType: "file", comType: "file",
// 组件展示图标 // 组件展示图标
comShowIcon: "icon_attachments@2x.png", comShowIcon: "icon_attachments@2x.png",
...@@ -305,13 +317,13 @@ export const defaultComOptions = [ ...@@ -305,13 +317,13 @@ export const defaultComOptions = [
width: 100, width: 100,
limit: -1, limit: -1,
astrict: false, astrict: false,
fileList: [], isError: false,
isError: false allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
// 绑定的值 // 绑定的值
value: "", value: [],
// 输入值为空提示 // 输入值为空提示
placeholder: "请选择" placeholder: "请选择"
} }
......
...@@ -954,3 +954,79 @@ export const deserializeFn = (fnStr) => { ...@@ -954,3 +954,79 @@ export const deserializeFn = (fnStr) => {
return null; return null;
} }
}; };
/**
* json字符串转换为json
* @param {*} jsonStr
* @returns
*/
export const jsonStrToObject = (jsonStr) => {
if (typeof jsonStr !== "string") return null;
return eval(`(${jsonStr})`);
};
/**
* 数组元素分组
* @param {Array<any>} arr 分组元素
* @param {*} max 最大值
* @returns
*/
export function groupArray(arr, max = 100, target = "") {
let result = [];
let currentGroup = [];
const len = arr.length;
for (let i = 0; i < len; i++) {
let currentValue = arr[i];
// 如果内部元素是一个对象
if (Object.prototype.toString.call(currentValue) === "[object Object]") {
const _temp = target.split(".");
for (const key of _temp) {
currentValue = currentValue[key];
}
}
const sumResult = currentGroup.reduce((sum, value) => {
let _tempValue = value;
if (Object.prototype.toString.call(_tempValue) === "[object Object]") {
const _temp = target.split(".");
for (const key of _temp) {
_tempValue = _tempValue[key];
}
}
return sum + _tempValue;
}, 0);
if (sumResult + currentValue <= max) {
currentGroup.push(arr[i]);
} else {
result.push(currentGroup);
currentGroup = [arr[i]];
}
}
// 处理剩余的元素,如果有的话
if (currentGroup.length > 0) {
result.push(currentGroup);
}
return result;
}
/**
* 去掉dom元素两边的标签
* @param {string} str
*/
export function replaceDomTags(str) {
const reg = /<[^>]*>/gmi;
return str.replace(reg, "");
}
/**
* 生成随机字母
* @returns
*/
export function generateRandomLowerCaseLetter() {
const alphabet = 'abcdefghijklmnopqrstuvwxyz';
const randomIndex = Math.floor(Math.random() * alphabet.length);
return alphabet[randomIndex];
}
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
</template> </template>
<!-- label展示名称 --> <!-- label展示名称 -->
<el-form-item label="字段label" class="set-field-option-item" prop="formAttribute.label" v-if="comActiveFieldData.formAttribute"> <el-form-item label="字段label" class="set-field-option-item" prop="formAttribute.label" :rules="setFieldOptionRules.labelName"
v-if="comActiveFieldData.formAttribute">
<el-input v-model="comActiveFieldData.formAttribute.label" placeholder="请输入字段label" clearable></el-input> <el-input v-model="comActiveFieldData.formAttribute.label" placeholder="请输入字段label" clearable></el-input>
</el-form-item> </el-form-item>
...@@ -35,7 +36,7 @@ ...@@ -35,7 +36,7 @@
</template> </template>
<!-- 默认值 --> <!-- 默认值 -->
<template v-if="defaultValueContain.includes(comActiveFieldData.comType)"> <template v-if="comActiveFieldData.formAttribute.allowDefaultValue">
<el-form-item label="默认值" class="set-field-option-item" prop="componentAttribute.value" v-if="comActiveFieldData.componentAttribute"> <el-form-item label="默认值" class="set-field-option-item" prop="componentAttribute.value" v-if="comActiveFieldData.componentAttribute">
<el-input v-model="comActiveFieldData.componentAttribute.value" placeholder="请输入默认值" clearable></el-input> <el-input v-model="comActiveFieldData.componentAttribute.value" placeholder="请输入默认值" clearable></el-input>
</el-form-item> </el-form-item>
...@@ -45,7 +46,7 @@ ...@@ -45,7 +46,7 @@
<template v-if="comActiveFieldData.comType == 'select'"> <template v-if="comActiveFieldData.comType == 'select'">
<el-form-item label="类型" class="set-field-option-item set-field-option-radio" prop="formAttribute.isMultiple" <el-form-item label="类型" class="set-field-option-item set-field-option-radio" prop="formAttribute.isMultiple"
v-if="comActiveFieldData.formAttribute"> v-if="comActiveFieldData.formAttribute">
<el-radio-group v-model="comActiveFieldData.formAttribute.isMultiple"> <el-radio-group v-model="comActiveFieldData.formAttribute.isMultiple" @input="modeChange">
<el-radio :label="false">单选</el-radio> <el-radio :label="false">单选</el-radio>
<el-radio :label="true">多选</el-radio> <el-radio :label="true">多选</el-radio>
</el-radio-group> </el-radio-group>
...@@ -63,7 +64,7 @@ ...@@ -63,7 +64,7 @@
<transition-group name="fade" tag="div" class="select-option-list"> <transition-group name="fade" tag="div" class="select-option-list">
<div class="select-option-list-item" v-for="(item,index) of comActiveFieldData.formAttribute.selectOptions" :key="item.id"> <div class="select-option-list-item" v-for="(item,index) of comActiveFieldData.formAttribute.selectOptions" :key="item.id">
<img src="@/assets/images/consultingAgencyManagement/customForm/icon_drag@2x.png" alt="" class="select-option-list-item-drag-icon"> <img src="@/assets/images/consultingAgencyManagement/customForm/icon_drag@2x.png" alt="" class="select-option-list-item-drag-icon">
<el-form-item label="" :prop="`formAttribute.selectOptions.${index}.value`" :rules="comActiveFieldData.formAttribute.rules" <el-form-item label="" :prop="`formAttribute.selectOptions.${index}.value`" :rules="setFieldOptionRules.selectOptionsRules"
:show-message="false"> :show-message="false">
<el-input v-model="comActiveFieldData.formAttribute.selectOptions[index].value" placeholder="请输入" clearable></el-input> <el-input v-model="comActiveFieldData.formAttribute.selectOptions[index].value" placeholder="请输入" clearable></el-input>
</el-form-item> </el-form-item>
...@@ -131,6 +132,7 @@ export default { ...@@ -131,6 +132,7 @@ export default {
componentOptions: {} componentOptions: {}
}) })
}, },
activeFieldOrigin: Object,
parentUid: String, parentUid: String,
activeUid: String activeUid: String
}, },
...@@ -153,6 +155,12 @@ export default { ...@@ -153,6 +155,12 @@ export default {
this.$mitt.emit("fieldOptionChange", newValue); this.$mitt.emit("fieldOptionChange", newValue);
}, },
deep: true deep: true
},
activeFieldOrigin: {
handler(newValue) {
this.comActiveFieldOrigin = cloneDeep(newValue);
},
deep: true
} }
}, },
data() { data() {
...@@ -178,11 +186,18 @@ export default { ...@@ -178,11 +186,18 @@ export default {
return { return {
// 通过保存更新源数据按钮 // 通过保存更新源数据按钮
comActiveFieldData: cloneDeep(this.activeFieldData), comActiveFieldData: cloneDeep(this.activeFieldData),
// 源数据
comActiveFieldOrigin: cloneDeep(this.activeFieldOrigin),
setFieldOptionRules: { setFieldOptionRules: {
fieldName: [{ required: true, trigger: ["blur", "change"], validator: fieldNameValidor }], fieldName: [{ required: true, trigger: ["blur", "change"], validator: fieldNameValidor }],
limit: [{ required: true, type: "number", trigger: ["blur", "change"], validator: limitValidor }] limit: [{ required: true, type: "number", trigger: ["blur", "change"], validator: limitValidor }],
selectOptionsRules: {
required: true,
message: "请输入选项值",
trigger: ["change", "blur"]
},
labelName: [{ required: true, trigger: ["change", "blur"], message: "字段label不能为空" }]
}, },
defaultValueContain: ["text", "textarea"],
placeholderContain: ["text", "textarea", "select", "date", "phone", "email"], placeholderContain: ["text", "textarea", "select", "date", "phone", "email"],
limitContain: ["photo", "file"] limitContain: ["photo", "file"]
}; };
...@@ -210,6 +225,7 @@ export default { ...@@ -210,6 +225,7 @@ export default {
this.comActiveFieldData = value; this.comActiveFieldData = value;
}, },
cancelSet() { cancelSet() {
this.$mitt.emit("fieldOptionChange", cloneDeep(this.comActiveFieldOrigin));
this.$emit("cancelSetOptions"); this.$emit("cancelSetOptions");
}, },
async formCheck() { async formCheck() {
...@@ -238,6 +254,13 @@ export default { ...@@ -238,6 +254,13 @@ export default {
} }
this.$refs["customDesignFormRef"].clearValidate("formAttribute.limit"); this.$refs["customDesignFormRef"].clearValidate("formAttribute.limit");
this.$set(this.comActiveFieldData.formAttribute, "limit", -1); this.$set(this.comActiveFieldData.formAttribute, "limit", -1);
},
modeChange(value) {
if (value) {
this.$set(this.comActiveFieldData.componentAttribute, "value", []);
return;
}
this.$set(this.comActiveFieldData.componentAttribute, "value", "");
} }
}, },
} }
...@@ -495,6 +518,19 @@ export default { ...@@ -495,6 +518,19 @@ export default {
.el-form-item { .el-form-item {
margin-bottom: 0px; margin-bottom: 0px;
margin-left: 8px; margin-left: 8px;
&.is-error {
.el-form-item__content {
.el-input {
.el-input__inner {
&:focus {
border-color: #ff4949;
}
}
}
}
}
.el-form-item__content { .el-form-item__content {
line-height: 32px; line-height: 32px;
......
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
<dsk-email-input v-model="comChildModuleInfo.componentAttribute.value" :placeholder="comChildModuleInfo.componentAttribute.placeholder" <dsk-email-input v-model="comChildModuleInfo.componentAttribute.value" :placeholder="comChildModuleInfo.componentAttribute.placeholder"
:clearable="true" :disabled="isDisabled" v-if="comChildModuleInfo.comType == 'email'"></dsk-email-input> :clearable="true" :disabled="isDisabled" v-if="comChildModuleInfo.comType == 'email'"></dsk-email-input>
<!-- 图片类型 --> <!-- 图片类型 -->
<dsk-photo-input v-if="comChildModuleInfo.comType == 'photo'"></dsk-photo-input> <dsk-photo-input v-model="comChildModuleInfo.componentAttribute.value" :disabled="isDisabled" v-if="comChildModuleInfo.comType == 'photo'"
:limit="comChildModuleInfo.formAttribute.limit" :presentationModel="true"></dsk-photo-input>
<!-- 文件类型 -->
<dsk-file-input v-model="comChildModuleInfo.componentAttribute.value" :disabled="isDisabled" v-if="comChildModuleInfo.comType == 'file'"
:limit="comChildModuleInfo.formAttribute.limit" :presentationModel="true"></dsk-file-input>
</el-form-item> </el-form-item>
<img src="@/assets/images/consultingAgencyManagement/customForm/icon_delete@2x.png" alt="" class="remove-subfield-item-icon" <img src="@/assets/images/consultingAgencyManagement/customForm/icon_delete@2x.png" alt="" class="remove-subfield-item-icon"
...@@ -40,11 +44,13 @@ import { cloneDeep } from "lodash-es"; ...@@ -40,11 +44,13 @@ import { cloneDeep } from "lodash-es";
import Schema from "async-validator"; import Schema from "async-validator";
import DskEmailInput from "@/components/DskEmailInput"; import DskEmailInput from "@/components/DskEmailInput";
import DskPhotoInput from "@/components/DskPhotoInput"; import DskPhotoInput from "@/components/DskPhotoInput";
import DskFileInput from "@/components/DskFileInput";
export default { export default {
name: "subfieldItem", name: "subfieldItem",
components: { components: {
DskEmailInput, DskEmailInput,
DskPhotoInput DskPhotoInput,
DskFileInput
}, },
props: { props: {
childModuleInfo: Object, childModuleInfo: Object,
...@@ -63,7 +69,7 @@ export default { ...@@ -63,7 +69,7 @@ export default {
}, },
comChildModuleInfo: { comChildModuleInfo: {
handler(newValue) { handler(newValue) {
console.log(this.comActiveUid !== this.comChildModuleInfo?.uid, "是否不是更改的当前元素"); // console.log(this.comActiveUid !== this.comChildModuleInfo?.uid, "是否不是更改的当前元素");
if (this.comActiveUid !== this.comChildModuleInfo?.uid) return; if (this.comActiveUid !== this.comChildModuleInfo?.uid) return;
this.checkValidator(newValue); this.checkValidator(newValue);
this.$mitt.emit("subfieldItemChange", newValue); this.$mitt.emit("subfieldItemChange", newValue);
...@@ -73,9 +79,9 @@ export default { ...@@ -73,9 +79,9 @@ export default {
activeUid: { activeUid: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
// 当前命中高亮的元素id 不跟当前元素uid相同 移除事件订阅 否者 添加订阅 // 当前命中高亮的元素id 不跟当前元素uid相同 移除事件订阅 否者 添加订阅
this.addSubscription(newValue);
this.comActiveUid = newValue; this.comActiveUid = newValue;
this.comOldActiveUid = oldValue; this.comOldActiveUid = oldValue;
this.addSubscription(newValue);
}, },
// 保证首次触发 判断是否订阅 // 保证首次触发 判断是否订阅
immediate: true immediate: true
...@@ -105,7 +111,7 @@ export default { ...@@ -105,7 +111,7 @@ export default {
}, },
//可访问data属性 //可访问data属性
created() { created() {
this.$mitt.on("fieldOptionChange", this.setFieldOption);
}, },
beforeDestroy() { beforeDestroy() {
this.$mitt.off("fieldOptionChange"); this.$mitt.off("fieldOptionChange");
...@@ -138,13 +144,18 @@ export default { ...@@ -138,13 +144,18 @@ export default {
this.$set(this.comChildModuleInfo.formAttribute, "isError", false); this.$set(this.comChildModuleInfo.formAttribute, "isError", false);
} }
} catch (error) { } catch (error) {
const { errors, fields } = error;
// console.log(errors, fields);
this.$set(this.comChildModuleInfo.formAttribute, "isError", true); this.$set(this.comChildModuleInfo.formAttribute, "isError", true);
} }
}, },
// 根据命中的id 来添加发布订阅 // 根据命中的id 来添加发布订阅
addSubscription(newValue) { addSubscription(newValue) {
if (newValue === this.comChildModuleInfo.uid) return this.$mitt.on("fieldOptionChange", this.setFieldOption); // if (newValue === this.comChildModuleInfo.uid) {
this.$mitt.off("fieldOptionChange"); // this.$mitt.on("fieldOptionChange", this.setFieldOption);
// return;
// };
// this.$mitt.off("fieldOptionChange");
}, },
classCreate(comType) { classCreate(comType) {
const classParams = { const classParams = {
...@@ -154,10 +165,10 @@ export default { ...@@ -154,10 +165,10 @@ export default {
return classParams; return classParams;
}, },
setFieldOption(value) { setFieldOption(value) {
// console.log("触发:fieldOptionChange");
// value.uid 等同于 comActiveUid (原因 : 能修改的元素一定是当前comActiveUid命中的元素,取value.uid 为了修改数据的严谨) // value.uid 等同于 comActiveUid (原因 : 能修改的元素一定是当前comActiveUid命中的元素,取value.uid 为了修改数据的严谨)
// 要修改的uid元素不是当前元素的id 不进行修改 // 要修改的uid元素不是当前元素的id 不进行修改
// console.log(`${this.comChildModuleInfo?.uid} 当前组件元素uid`, `${value.uid} 当前需要触发修改数据的uid`); // console.log(`${this.comChildModuleInfo?.uid} 当前组件元素uid`, `${value.uid} 当前需要触发修改数据的uid`);
if (value.uid !== this.comChildModuleInfo?.uid) return; if (value.uid !== this.comChildModuleInfo?.uid) return;
this.comChildModuleInfo = value; this.comChildModuleInfo = value;
}, },
...@@ -195,6 +206,9 @@ export default { ...@@ -195,6 +206,9 @@ export default {
::v-deep .subfield-module-form-item { ::v-deep .subfield-module-form-item {
display: flex; display: flex;
max-width: calc(100% - 14px - 16px - 12px - 12px);
margin-bottom: 0px;
margin-left: 12px;
.el-form-item__label { .el-form-item__label {
line-height: 32px; line-height: 32px;
...@@ -202,9 +216,43 @@ export default { ...@@ -202,9 +216,43 @@ export default {
font-weight: 400; font-weight: 400;
color: rgba(35, 35, 35, 0.8); color: rgba(35, 35, 35, 0.8);
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 55%;
} }
.el-form-item__content { .el-form-item__content {
flex: 1; flex: 1;
line-height: 32px;
height: 32px;
.el-input {
line-height: 32px;
height: 32px;
.el-input__suffix {
display: flex;
align-items: center;
}
}
}
.el-input {
width: 100%;
.el-input__inner {
width: 100%;
height: 32px;
line-height: 32px;
padding-left: 12px;
&::placeholder {
color: #c0c4cc !important;
font-size: 14px !important;
}
}
.el-input__suffix {
.el-input__icon {
line-height: 32px;
}
}
} }
} }
......
...@@ -8,7 +8,12 @@ ...@@ -8,7 +8,12 @@
<el-input v-model="comModuleInfo.subfieldModuleName" :placeholder="comModuleInfo.subfieldModulePlaceholder" clearable <el-input v-model="comModuleInfo.subfieldModuleName" :placeholder="comModuleInfo.subfieldModulePlaceholder" clearable
@keyup.enter.native.stop="editOk"></el-input> @keyup.enter.native.stop="editOk"></el-input>
</el-form-item> </el-form-item>
<span v-else>{{comModuleInfo.defaultSubfieldModuleName}}</span> <div v-else class="no-edit-module-name">
<dsk-text-over-flow-tip>
<span>{{comModuleInfo.defaultSubfieldModuleName}}</span>
<template slot="overflow">{{comModuleInfo.defaultSubfieldModuleName}}</template>
</dsk-text-over-flow-tip>
</div>
</div> </div>
<div class="subfield-module-title-tool" v-if="comModuleInfo.edit"> <div class="subfield-module-title-tool" v-if="comModuleInfo.edit">
<img src="@/assets/images/consultingAgencyManagement/customForm/icon_verify@2x.png" alt="" class="title-tool-edit-ok" @click.stop="editOk"> <img src="@/assets/images/consultingAgencyManagement/customForm/icon_verify@2x.png" alt="" class="title-tool-edit-ok" @click.stop="editOk">
...@@ -25,8 +30,12 @@ ...@@ -25,8 +30,12 @@
</template> </template>
<script> <script>
import { cloneDeep } from "lodash-es"; import { cloneDeep } from "lodash-es";
import DskTextOverFlowTip from "@/components/DskTextOverFlowTip";
export default { export default {
name: "subfieldModule", name: "subfieldModule",
components: {
DskTextOverFlowTip
},
props: { props: {
moduleInfo: Object, moduleInfo: Object,
moduleIndex: Number moduleIndex: Number
...@@ -111,19 +120,26 @@ export default { ...@@ -111,19 +120,26 @@ export default {
.subfield-module-title { .subfield-module-title {
display: flex; display: flex;
align-items: center; align-items: center;
flex: 1; width: calc(100% - 60px);
& > img { & > img {
width: 14px; width: 14px;
height: 14px; height: 14px;
cursor: move; cursor: move;
} }
& > span { .no-edit-module-name {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
margin-left: 12px; margin-left: 12px;
color: rgba(35, 35, 35, 0.8); color: rgba(35, 35, 35, 0.8);
} }
.no-edit-module-name {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
} }
.subfield-module-title-tool { .subfield-module-title-tool {
...@@ -145,10 +161,13 @@ export default { ...@@ -145,10 +161,13 @@ export default {
} }
::v-deep .subfield-module-form-item { ::v-deep .subfield-module-form-item {
display: flex;
margin-bottom: 0px; margin-bottom: 0px;
margin-left: 12px; margin-left: 12px;
flex: 1; width: 100%;
.el-form-item__content { .el-form-item__content {
flex: 1;
line-height: 32px; line-height: 32px;
height: 32px; height: 32px;
.el-input { .el-input {
......
<template> <template>
<div class="custom-form-container"> <div class="custom-form-container">
<div class="custom-form-inner"> <div class="custom-form-outer-inner">
<div class="custom-form-header"> <div class="custom-form-inner">
<div class="custom-form-title">咨询机构结算信息表单配置</div> <div class="custom-form-header">
<!-- 提示 --> <div class="custom-form-title">咨询机构结算信息表单配置</div>
<div class="custom-form-tip"> <!-- 提示 -->
<img src="@/assets/images/consultingAgencyManagement/custom-form-tip-icon.png" alt=""> <div class="custom-form-tip">
<span>自定义表格模板保存方案后将同步更新至项目详情 “咨询机构结算信息” 表格。</span> <img src="@/assets/images/consultingAgencyManagement/custom-form-tip-icon.png" alt="">
<span>自定义表格模板保存方案后将同步更新至项目详情 “咨询机构结算信息” 表格。</span>
</div>
</div> </div>
</div> <!-- 表单设计组件部分 -->
<!-- 表单设计组件部分 --> <div class="custom-form-design-container">
<div class="custom-form-design-container"> <div class="custom-form-design-outer">
<div class="custom-form-design-outer"> <custom-form-design></custom-form-design>
<custom-form-design></custom-form-design> </div>
</div> </div>
</div> </div>
</div> </div>
...@@ -49,13 +51,21 @@ export default { ...@@ -49,13 +51,21 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 16px 24px 24px 24px; padding: 16px 24px 24px 24px;
box-sizing: border-box;
overflow: hidden; overflow: hidden;
.custom-form-outer-inner {
width: 100%;
height: 100%;
overflow: auto;
}
.custom-form-inner { .custom-form-inner {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #fff; background: #fff;
border-radius: 4px; border-radius: 4px;
min-width: 1600px;
.custom-form-header { .custom-form-header {
width: 100%; width: 100%;
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
</tr> </tr>
<tr> <tr>
<td class="table-key">履约责任单位</td> <td class="table-key">履约责任单位</td>
<td>{{comProjectDetailInfo.ownerName ? comProjectDetailInfo.ownerName : "-"}}</td> <td>{{"-"}}</td>
<td class="table-key">咨询单位</td> <td class="table-key">咨询单位</td>
<td>{{comProjectDetailInfo.advisoryBodyName ? comProjectDetailInfo.advisoryBodyName : "-"}}</td> <td>{{comProjectDetailInfo.advisoryBody && comProjectDetailInfo.advisoryBody.advisoryBodyName ? comProjectDetailInfo.advisoryBody.advisoryBodyName : "-"}}</td>
</tr> </tr>
</table> </table>
</div> </div>
...@@ -39,17 +39,17 @@ ...@@ -39,17 +39,17 @@
<td class="table-key">国内外</td> <td class="table-key">国内外</td>
<td>{{"-"}}</td> <td>{{"-"}}</td>
<td class="table-key">省市</td> <td class="table-key">省市</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.provinceName ? comProjectDetailInfo.provinceName : "-"}}</td>
</tr> </tr>
<tr> <tr>
<td class="table-key">投资来源</td> <td class="table-key">投资来源</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.ownerNature ? comProjectDetailInfo.ownerNature : "-"}}</td>
<td class="table-key">项目承接类型</td> <td class="table-key">项目承接类型</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.isinvestproject ? comProjectDetailInfo.isinvestproject : "-"}}</td>
</tr> </tr>
<tr> <tr>
<td class="table-key">合同签订日期</td> <td class="table-key">合同签订日期</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.contractSignDate ? comProjectDetailInfo.contractSignDate : "-"}}</td>
<td class="table-key">合同总工期</td> <td class="table-key">合同总工期</td>
<td>{{comProjectDetailInfo.contractWorkDays ? `${comProjectDetailInfo.contractWorkDays}天` : "-"}}</td> <td>{{comProjectDetailInfo.contractWorkDays ? `${comProjectDetailInfo.contractWorkDays}天` : "-"}}</td>
</tr> </tr>
...@@ -57,19 +57,19 @@ ...@@ -57,19 +57,19 @@
<td class="table-key">开工日期方式</td> <td class="table-key">开工日期方式</td>
<td>{{"-"}}</td> <td>{{"-"}}</td>
<td class="table-key">开工具体时间</td> <td class="table-key">开工具体时间</td>
<td>{{comProjectDetailInfo.actualStartDate ? comProjectDetailInfo.actualStartDate : "-"}}</td> <td>{{comProjectDetailInfo.planStartDate ? comProjectDetailInfo.planStartDate : "-"}}</td>
</tr> </tr>
<tr> <tr>
<td class="table-key">竣工具体方式</td> <td class="table-key">竣工具体方式</td>
<td>{{"-"}}</td> <td>{{"-"}}</td>
<td class="table-key">竣工具体时间</td> <td class="table-key">竣工具体时间</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.actualEndDate ? comProjectDetailInfo.actualEndDate : "-"}}</td>
</tr> </tr>
<tr> <tr>
<td class="table-key">工程类型大类</td> <td class="table-key">工程类型大类</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.projectType1 ? comProjectDetailInfo.projectType1 : "-"}}</td>
<td class="table-key">工程类型明细</td> <td class="table-key">工程类型明细</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.projectType2 ? comProjectDetailInfo.projectType2 : "-"}}</td>
</tr> </tr>
<tr> <tr>
<td class="table-key">建筑高度</td> <td class="table-key">建筑高度</td>
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<td class="table-key">预收益率</td> <td class="table-key">预收益率</td>
<td>{{comProjectDetailInfo.estiProfitRate ? `${comProjectDetailInfo.estiProfitRate}%` : "-"}}</td> <td>{{comProjectDetailInfo.estiProfitRate ? `${comProjectDetailInfo.estiProfitRate}%` : "-"}}</td>
<td class="table-key">预收益额</td> <td class="table-key">预收益额</td>
<td>{{comProjectDetailInfo.estiTtlProfit ? `${comProjectDetailInfo.estiTtlProfit}元` : "-"}}</td> <td>{{comProjectDetailInfo.estimatedEarning ? `${comProjectDetailInfo.estimatedEarning}元` : "-"}}</td>
</tr> </tr>
</table> </table>
</div> </div>
...@@ -115,9 +115,9 @@ ...@@ -115,9 +115,9 @@
</colgroup> </colgroup>
<tr> <tr>
<td class="table-key">合同金额</td> <td class="table-key">合同金额</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.contractOrigValue ? `${comProjectDetailInfo.contractOrigValue}元` : "-"}}</td>
<td class="table-key">自施部分</td> <td class="table-key">自施部分</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.contractOrigSelfvalue ? `${comProjectDetailInfo.contractOrigSelfvalue}元` : "-"}}</td>
</tr> </tr>
<tr> <tr>
<td class="table-key">计价依据</td> <td class="table-key">计价依据</td>
...@@ -149,9 +149,9 @@ ...@@ -149,9 +149,9 @@
</colgroup> </colgroup>
<tr> <tr>
<td class="table-key">工程预付款</td> <td class="table-key">工程预付款</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.steppayType ? comProjectDetailInfo.steppayType : "-"}}</td>
<td class="table-key">支付比例</td> <td class="table-key">支付比例</td>
<td>{{"-"}}</td> <td>{{comProjectDetailInfo.steppayScale ? `${comProjectDetailInfo.steppayScale}%` : "-"}}</td>
</tr> </tr>
</table> </table>
</div> </div>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!-- 项目名称 logo --> <!-- 项目名称 logo -->
<div class="prject-icon-and-title"> <div class="prject-icon-and-title">
<img src="@/assets/images/financing/head_icon.png" alt=""> <img src="@/assets/images/financing/head_icon.png" alt="">
<div class="prject-title">{{projectDetailInfo.finProjectName ? projectDetailInfo.finProjectName : "-"}}</div> <div class="prject-title">{{projectDetailInfo.projectName ? projectDetailInfo.projectName : "-"}}</div>
</div> </div>
<!-- 项目承接单位 --> <!-- 项目承接单位 -->
<div class="project-undertaking-unit-container"> <div class="project-undertaking-unit-container">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<!-- 编辑按钮 展示咨询机构结算信息显示 --> <!-- 编辑按钮 展示咨询机构结算信息显示 -->
<transition name="fade" appear mode="out-in"> <transition name="fade" appear mode="out-in">
<div class="edit-project-detail-container" v-if="currentList === 'consultingAgency' && !isModify" :key="'edit-project'"> <div class="edit-project-detail-container" v-if="currentList === 'consultingAgency' && !isModify" :key="'edit-project'">
<el-button type="primary" @click="editProjectDetail">编辑信息</el-button> <el-button type="primary" @click="editProjectDetail" :disabled="loading">编辑信息</el-button>
</div> </div>
<div class="save-project-detail-container" v-if="currentList === 'consultingAgency' && isModify" :key="'save-project'"> <div class="save-project-detail-container" v-if="currentList === 'consultingAgency' && isModify" :key="'save-project'">
<el-button type="primary" @click="saveProjectDetail" :disabled="loading">保存</el-button> <el-button type="primary" @click="saveProjectDetail" :disabled="loading">保存</el-button>
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
<!-- 工程基本信息 --> <!-- 工程基本信息 -->
<basic-engineering-information v-if="currentList === 'project'" :projectDetailInfo="projectDetailInfo"></basic-engineering-information> <basic-engineering-information v-if="currentList === 'project'" :projectDetailInfo="projectDetailInfo"></basic-engineering-information>
<!-- 咨询机构结算信息 --> <!-- 咨询机构结算信息 -->
<consulting-agency v-if="currentList === 'consultingAgency'" :projectDetailInfo="projectDetailInfo" :isModify="isModify" <consulting-agency v-if="currentList === 'consultingAgency'" :projectKey="projectKey" :projectDetailInfo="projectDetailInfo"
ref="consultingAgency" @editComProjectDetailSuccess="editComProjectDetailSuccess" :isModify="isModify" ref="consultingAgency" @editComProjectDetailSuccess="editComProjectDetailSuccess"
@searchLoadingChange="searchLoadingChange"></consulting-agency> @searchLoadingChange="searchLoadingChange"></consulting-agency>
</div> </div>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</template> </template>
<script> <script>
import DskTabToggle from "@/components/DskTabToggle"; import DskTabToggle from "@/components/DskTabToggle";
import { getConsultingOrgProjectDetailApi, updateConsultingDetailApi } from "@/api/consultingOrgManagement"; import { getConsultingOrgProjectDetailApi, updateConsultingDetailApi, updateCustomFormData } from "@/api/consultingOrgManagement";
import { v4 } from 'uuid'; import { v4 } from 'uuid';
import BasicEngineeringInformation from "@/views/consultingOrgManagement/components/EnterpriseList/detail/basicEngineeringInformation"; import BasicEngineeringInformation from "@/views/consultingOrgManagement/components/EnterpriseList/detail/basicEngineeringInformation";
import consultingAgency from "@/views/consultingOrgManagement/components/EnterpriseList/detail/consultingAgency"; import consultingAgency from "@/views/consultingOrgManagement/components/EnterpriseList/detail/consultingAgency";
...@@ -120,13 +120,14 @@ export default { ...@@ -120,13 +120,14 @@ export default {
this.$refs["consultingAgency"].updateConsultingDetail(); this.$refs["consultingAgency"].updateConsultingDetail();
}, },
// 编辑成功提交信息 // 编辑成功提交信息
async editComProjectDetailSuccess(data) { async editComProjectDetailSuccess(data, customFormData) {
try { try {
const result = await updateConsultingDetailApi(data); const result = await updateConsultingDetailApi(data);
if (result.code) { const customFormResult = await updateCustomFormData(customFormData);
if (result.code == 200 && customFormResult.code == 200) {
this.$message.success("更新咨询机构结算信息成功"); this.$message.success("更新咨询机构结算信息成功");
this.isModify = false; this.isModify = false;
this.$router.push({ this.$tab.closeOpenPage({
path: `/redirect/${"consultingOrgManagement/projectDetail"}`, path: `/redirect/${"consultingOrgManagement/projectDetail"}`,
query: { query: {
projectKey: this.projectKey, projectKey: this.projectKey,
...@@ -136,7 +137,7 @@ export default { ...@@ -136,7 +137,7 @@ export default {
}); });
} }
} catch (error) { } catch (error) {
console.log(error);
} }
}, },
cancelSave() { cancelSave() {
...@@ -156,10 +157,12 @@ export default { ...@@ -156,10 +157,12 @@ export default {
padding: 16px 24px 24px 24px; padding: 16px 24px 24px 24px;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
/* min-width: 1300px; */
.project-detail-inner { .project-detail-inner {
width: 100%; width: 100%;
height: 100%; height: 100%;
min-width: 1300px;
.project-header-container { .project-header-container {
width: 100%; width: 100%;
...@@ -227,6 +230,13 @@ export default { ...@@ -227,6 +230,13 @@ export default {
box-sizing: border-box; box-sizing: border-box;
background-color: #0081ff; background-color: #0081ff;
border-color: #0081ff; border-color: #0081ff;
&.is-disabled {
color: #c0c4cc;
background-image: none;
background-color: #ffffff;
border-color: #e6ebf5;
}
} }
} }
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="合同金额"> <el-form-item label="合同金额">
<dsk-amount-range v-model="form.contractAmount" :range-text="'至'" :start-placeholder="'最小金额(万元)'" <dsk-amount-range v-model="form.contractAmount" :range-text="'至'" :start-placeholder="'最小金额(万元)'"
:end-placeholder="'最大金额(万元)'"></dsk-amount-range> :end-placeholder="'最大金额(万元)'"></dsk-amount-range>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -78,10 +78,13 @@ ...@@ -78,10 +78,13 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<!-- 业主单位 --> <!-- 业主单位 -->
<!-- <template slot="ownerName" slot-scope="{data,row}"> <template slot="ownerName" slot-scope="{data,row}">
<div v-if="row.ownerName" class="no-line-feed">{{row.ownerName}}</div> <div v-if="row.ownerName">
<span v-if="row.ownerUnitCid" class="no-line-feed" @click="viewOwnerUnit(row)">{{row.ownerName}}</span>
<span v-else>{{row.ownerName}}</span>
</div>
<span v-else>-</span> <span v-else>-</span>
</template> --> </template>
<!-- 项目承接单位 --> <!-- 项目承接单位 -->
<!-- <template slot="contractOrgName" slot-scope="{data,row}"> <!-- <template slot="contractOrgName" slot-scope="{data,row}">
<div v-if="row.contractOrgName" class="no-line-feed">{{row.contractOrgName}}</div> <div v-if="row.contractOrgName" class="no-line-feed">{{row.contractOrgName}}</div>
...@@ -89,8 +92,11 @@ ...@@ -89,8 +92,11 @@
</template> --> </template> -->
<!-- 咨询机构名称 --> <!-- 咨询机构名称 -->
<template slot="advisoryBodyName" slot-scope="{data,row}"> <template slot="advisoryBodyName" slot-scope="{data,row}">
<div v-if="row.advisoryBody && row.advisoryBody.advisoryBodyName" class="no-line-feed" @click="viewEnterprise(row)"> <div v-if="row.advisoryBody && row.advisoryBody.advisoryBodyName">
{{row.advisoryBody.advisoryBodyName}}</div> <span v-if="row.advisoryBody.advisoryBodyCid" class="no-line-feed"
@click="viewEnterprise(row)">{{row.advisoryBody.advisoryBodyName}}</span>
<span v-else>{{row.advisoryBody.advisoryBodyName}}</span>
</div>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<!-- 项目负责人姓名 --> <!-- 项目负责人姓名 -->
...@@ -169,6 +175,7 @@ export default { ...@@ -169,6 +175,7 @@ export default {
{ label: '序号', prop: "staticSerialNumber", type: "index", lock: true, fixed: false, uid: v4() }, { label: '序号', prop: "staticSerialNumber", type: "index", lock: true, fixed: false, uid: v4() },
{ label: '项目列表', prop: 'projectName', width: "220px", lock: true, fixed: false, slot: true, uid: v4(), showOverflowTooltip: true }, { label: '项目列表', prop: 'projectName', width: "220px", lock: true, fixed: false, slot: true, uid: v4(), showOverflowTooltip: true },
{ label: '项目编码', prop: 'projectCode', width: "121px", uid: v4() }, { label: '项目编码', prop: 'projectCode', width: "121px", uid: v4() },
{ label: '业主单位', prop: 'ownerName', slot: true, uid: v4(), width: "185px", showOverflowTooltip: true },
{ label: '省市', prop: 'provinceName', width: "100px", uid: v4() }, { label: '省市', prop: 'provinceName', width: "100px", uid: v4() },
{ label: '项目承接类型', prop: 'isinvestproject', width: "100px", uid: v4() }, { label: '项目承接类型', prop: 'isinvestproject', width: "100px", uid: v4() },
{ label: '工程基础大类', prop: 'projectType1', minWidth: "100px", uid: v4() }, { label: '工程基础大类', prop: 'projectType1', minWidth: "100px", uid: v4() },
...@@ -179,7 +186,7 @@ export default { ...@@ -179,7 +186,7 @@ export default {
{ label: '合同金额(元)', prop: 'contractOrigValue', width: "110px", align: "right", uid: v4() }, { label: '合同金额(元)', prop: 'contractOrigValue', width: "110px", align: "right", uid: v4() },
// { label: '业主单位', prop: 'ownerName', slot: true, uid: v4(), width: "185px", showOverflowTooltip: true }, // { label: '业主单位', prop: 'ownerName', slot: true, uid: v4(), width: "185px", showOverflowTooltip: true },
// { label: '项目承接单位', prop: 'contractOrgName', width: "196px", slot: true, uid: v4() }, // { label: '项目承接单位', prop: 'contractOrgName', width: "196px", slot: true, uid: v4() },
{ label: '咨询机构名称', prop: 'advisoryBodyName', width: "172px", slot: true, uid: v4() }, { label: '咨询机构名称', prop: 'advisoryBodyName', width: "172px", slot: true, uid: v4(), showOverflowTooltip: true },
{ label: '创建时间', prop: 'contractSignDate', width: "172px", uid: v4() }, { label: '创建时间', prop: 'contractSignDate', width: "172px", uid: v4() },
], ],
fixedPropsKey: ["staticSerialNumber", "projectName"], fixedPropsKey: ["staticSerialNumber", "projectName"],
...@@ -344,6 +351,10 @@ export default { ...@@ -344,6 +351,10 @@ export default {
viewEnterprise(row) { viewEnterprise(row) {
if (!row?.advisoryBody?.advisoryBodyCid) return this.$message.warning("缺少咨询机构id"); if (!row?.advisoryBody?.advisoryBodyCid) return this.$message.warning("缺少咨询机构id");
this.$tab.openPage(row.advisoryBody.advisoryBodyName ? row.advisoryBody.advisoryBodyName : "咨询机构详情", `/enterprise/${encodeStr(row.advisoryBody.advisoryBodyCid)}?companyName=${row.advisoryBody.advisoryBodyName}`); this.$tab.openPage(row.advisoryBody.advisoryBodyName ? row.advisoryBody.advisoryBodyName : "咨询机构详情", `/enterprise/${encodeStr(row.advisoryBody.advisoryBodyCid)}?companyName=${row.advisoryBody.advisoryBodyName}`);
},
// 业主单位跳转企业详情
viewOwnerUnit(row) {
} }
}, },
} }
......
...@@ -220,6 +220,12 @@ export default { ...@@ -220,6 +220,12 @@ export default {
const searchParams = JSON.parse(JSON.stringify({ ...params, ...this.queryParams })); const searchParams = JSON.parse(JSON.stringify({ ...params, ...this.queryParams }));
this.handleQuery(searchParams); this.handleQuery(searchParams);
}, },
handleCurrentChange(page) {
this.queryParams.pageNum = page;
const params = this.createQueryCondition(this.formData);
const searchParams = JSON.parse(JSON.stringify({ ...params, ...this.queryParams }));
this.handleQuery(searchParams);
},
async handleQuery(params) { async handleQuery(params) {
try { try {
let data = params ? params : this.queryParams; let data = params ? params : this.queryParams;
......
...@@ -285,6 +285,12 @@ export default { ...@@ -285,6 +285,12 @@ export default {
const searchParams = JSON.parse(JSON.stringify({ ...params, ...this.queryParams })); const searchParams = JSON.parse(JSON.stringify({ ...params, ...this.queryParams }));
this.handleQuery(searchParams); this.handleQuery(searchParams);
}, },
handleCurrentChange(page) {
this.queryParams.pageNum = page;
const params = this.createQueryCondition(this.formData);
const searchParams = JSON.parse(JSON.stringify({ ...params, ...this.queryParams }));
this.handleQuery(searchParams);
},
async handleQuery(params) { async handleQuery(params) {
try { try {
let data = params ? params : this.queryParams; let data = params ? params : this.queryParams;
......
...@@ -213,6 +213,12 @@ export default { ...@@ -213,6 +213,12 @@ export default {
}); });
return params; return params;
}, },
handleCurrentChange(page) {
this.queryParams.pageNum = page;
const params = this.createQueryCondition(this.formData);
const searchParams = JSON.parse(JSON.stringify({ ...params, ...this.queryParams }));
this.handleQuery(searchParams);
},
// 查询 // 查询
async handleSearch() { async handleSearch() {
const params = this.createQueryCondition(this.formData); const params = this.createQueryCondition(this.formData);
......
...@@ -298,6 +298,7 @@ export default { ...@@ -298,6 +298,7 @@ export default {
await this.getStatistic(this.companyName); await this.getStatistic(this.companyName);
await this.handleQuery(); await this.handleQuery();
await this.association(this.$route.query.customerId); await this.association(this.$route.query.customerId);
console.log(this.$refs.sidebar,"sidebar");
this.$refs.sidebar.getFinancial(data); this.$refs.sidebar.getFinancial(data);
} }
}, },
......
...@@ -43,9 +43,9 @@ export default { ...@@ -43,9 +43,9 @@ export default {
{ label: '处罚原因', prop: 'punishReason', slot: true, fixed: true, width: '508' }, { label: '处罚原因', prop: 'punishReason', slot: true, fixed: true, width: '508' },
{ label: '决定日期', prop: 'punishBegin', width: '105' }, { label: '决定日期', prop: 'punishBegin', width: '105' },
{ label: '处罚结果', prop: 'punishResult', width: '264' }, { label: '处罚结果', prop: 'punishResult', width: '264' },
{ label: '处罚文书号', prop: 'fileNum', width: '240' }, { label: '处罚文书号', prop: 'fileNum', minWidth: '240' },
{ label: '处罚机关', prop: 'office', width: '264' }, { label: '处罚机关', prop: 'office', minWidth: '264' },
{ label: '处罚结束日期', prop: 'punishEnd', width: '110' }, { label: '处罚结束日期', prop: 'punishEnd', minWidth: '110' },
], ],
formData: [ formData: [
{ type: 1, fieldName: 'penalizeReasonType', value: '', placeholder: '处罚类别', options: [] }, { type: 1, fieldName: 'penalizeReasonType', value: '', placeholder: '处罚类别', options: [] },
...@@ -130,17 +130,18 @@ export default { ...@@ -130,17 +130,18 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 4; -webkit-line-clamp: 5;
cursor: pointer; cursor: pointer;
> span { > span {
display: inline-block; display: flex;
width: 37px; width: 37px;
position: absolute; position: absolute;
right: 0; right: 11px;
bottom: 0; bottom: 0;
background-color: #fff; background-color: #fff;
z-index: 1; z-index: 1;
white-space: nowrap
} }
} }
} }
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
type="text" type="text"
auto-complete="off" auto-complete="off"
placeholder="请输入登录账号" placeholder="请输入登录账号"
:onkeyup="loginForm.username = loginForm.username.replace(/\s+/g,'')" @keyup="loginForm.username = loginForm.username.replace(/\s+/g,'')"
> >
<img class="img" slot="prefix" src="../assets/images/user.png"/> <img class="img" slot="prefix" src="../assets/images/user.png"/>
</el-input> </el-input>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
auto-complete="off" auto-complete="off"
placeholder="请输入账号密码" placeholder="请输入账号密码"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin"
:onkeyup="loginForm.password = loginForm.password.replace(/\s+/g,'')" @keyup="loginForm.password = loginForm.password.replace(/\s+/g,'')"
> >
<img class="img" slot="prefix" src="../assets/images/password.png"/> <img class="img" slot="prefix" src="../assets/images/password.png"/>
</el-input> </el-input>
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
placeholder="请输入图形验证码" placeholder="请输入图形验证码"
style="width: 290px;float: left;" style="width: 290px;float: left;"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin"
:onkeyup="loginForm.code = loginForm.code.replace(/\s+/g,'')" @keyup="loginForm.code = loginForm.code.replace(/\s+/g,'')"
> >
<img class="img" slot="prefix" src="../assets/images/txyzm.png"/> <img class="img" slot="prefix" src="../assets/images/txyzm.png"/>
</el-input> </el-input>
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
<div class="table-item"> <div class="table-item">
<div v-if="tableDataTotal > 0 && !isSkeleton"> <div v-if="tableDataTotal > 0 && !isSkeleton">
<el-table <el-table
class="fixed-table"
element-loading-text="Loading" element-loading-text="Loading"
:data="tableData" :data="tableData"
border border
...@@ -43,7 +42,14 @@ ...@@ -43,7 +42,14 @@
<el-table-column label="序号" width="60" align="left" fixed> <el-table-column label="序号" width="60" align="left" fixed>
<template slot-scope="scope">{{ queryParams.pageNum * queryParams.pageSize - queryParams.pageSize + scope.$index + 1 }}</template> <template slot-scope="scope">{{ queryParams.pageNum * queryParams.pageSize - queryParams.pageSize + scope.$index + 1 }}</template>
</el-table-column> </el-table-column>
<el-table-column label="监控对象" align="left" prop="companyName"></el-table-column> <el-table-column label="监控对象" align="left" prop="companyName">
<template slot-scope="scope">
<div v-if="scope.row.companyId">
<router-link :to="`/monitoring/MonitoringReportDetails/${scope.row.companyId}`" tag="a" class="a-link companyName">{{scope.row.companyName}}</router-link>
</div>
<div v-else>{{scope.row.companyName}}</div>
</template>
</el-table-column>
<el-table-column label="风险动态" align="left"> <el-table-column label="风险动态" align="left">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="color1 span">高风险 {{scope.row.highRiskCount}}</span> <span class="color1 span">高风险 {{scope.row.highRiskCount}}</span>
...@@ -93,7 +99,7 @@ ...@@ -93,7 +99,7 @@
<div class="enterprise"> <div class="enterprise">
<div class="label">企业名称</div> <div class="label">企业名称</div>
<el-input class="name" placeholder="请输入企业名称" v-model="companyName"> <el-input class="name" placeholder="请输入企业名称" v-model="companyName">
<el-button slot="append" @click="handleKeyword()">搜索</el-button> <span slot="append" @click="handleKeyword()">搜索</span>
</el-input> </el-input>
</div> </div>
<div class="companyList"> <div class="companyList">
...@@ -107,7 +113,8 @@ ...@@ -107,7 +113,8 @@
<p class="right-title" v-html="item.companyName"></p> <p class="right-title" v-html="item.companyName"></p>
<p class="right-tips">推荐监控</p> <p class="right-tips">推荐监控</p>
</div> </div>
<el-checkbox @change="changeCheckbox(item)"></el-checkbox> <span v-if="item.monitor" style="font-size: 12px;">已监控</span>
<el-checkbox v-else @change="changeCheckbox(item)" style="margin-left: 15px;"></el-checkbox>
</div> </div>
</div> </div>
</div> </div>
...@@ -127,6 +134,7 @@ ...@@ -127,6 +134,7 @@
accept=".excel,.xlsx" accept=".excel,.xlsx"
:headers="headers" :headers="headers"
:on-change="handleFileListChange" :on-change="handleFileListChange"
:on-success="onSuccess"
:auto-upload="false" :auto-upload="false"
ref="upload" ref="upload"
multiple> multiple>
...@@ -365,14 +373,10 @@ ...@@ -365,14 +373,10 @@
}, },
onSuccess(res, file, fileList) { onSuccess(res, file, fileList) {
if(res.code == 200 ){ if(res.code == 200 ){
this.$refs.upload.submit();
let _this = this let _this = this
setTimeout(function() { _this.querySubmit()
// _this.getList() _this.$message.success('上传成功!')
_this.$message.success('上传成功!') _this.pldrVisible = false
// _this.isupload = false
},3000)
} }
else else
this.$message.error({message:res.msg,showClose:true}) this.$message.error({message:res.msg,showClose:true})
...@@ -569,7 +573,7 @@ ...@@ -569,7 +573,7 @@
} }
} }
.item-right{ .item-right{
width: 360px; width: 344px;
margin-right: 10px; margin-right: 10px;
p{ p{
margin: 0; margin: 0;
...@@ -670,6 +674,13 @@ ...@@ -670,6 +674,13 @@
background: #F5F5F5; background: #F5F5F5;
width: 60px; width: 60px;
color: #0081FF; color: #0081FF;
padding: 0;
text-align: center;
cursor: pointer;
}
.el-input-group__append:hover{
background: #F5F5F5 !important;
color: #0081FF;
} }
} }
} }
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</div> </div>
<div class="main-item" style="line-height: 32px;"> <div class="main-item" style="line-height: 32px;">
<div class="label">手机号码</div> <div class="label">手机号码</div>
<el-input class="phone" v-model="queryParams.phones" placeholder="请输入手机号" oninput="value=value.replace(/[^\d]/g,'')"></el-input> <el-input class="phone" v-model="queryParams.phones" placeholder="请输入手机号" oninput="if(value.length>11)value=value.slice(0,11)" onkeyup="value = value.replace(/[^\d]/g,'');"></el-input>
</div> </div>
</div> </div>
<div class="search"> <div class="search">
......
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
<div class="table-item"> <div class="table-item">
<div v-if="tableDataTotal > 0 && !isSkeleton"> <div v-if="tableDataTotal > 0 && !isSkeleton">
<el-table <el-table
class="fixed-table"
:data="tableData" :data="tableData"
element-loading-text="Loading" element-loading-text="Loading"
border border
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
<div class="table-item"> <div class="table-item">
<div v-if="tableDataTotal > 0 && !isSkeleton"> <div v-if="tableDataTotal > 0 && !isSkeleton">
<el-table <el-table
class="fixed-table"
:data="tableData" :data="tableData"
element-loading-text="Loading" element-loading-text="Loading"
border border
...@@ -125,7 +124,14 @@ ...@@ -125,7 +124,14 @@
<el-dialog :visible.sync="dialogVisible" custom-class='dialog-claim' :title="title" width="720px" :close-on-click-modal="false"> <el-dialog :visible.sync="dialogVisible" custom-class='dialog-claim' :title="title" width="720px" :close-on-click-modal="false">
<div class="dialog-content"> <div class="dialog-content">
<template v-if="title=='开庭公告详情'"> <template v-if="title=='开庭公告详情'">
<info-table class="info-tab" :list="defaultList0" :obj="detail" :labelWidth="labelWidth"></info-table> <info-table class="info-tab" :list="defaultList0" :obj="detail" :labelWidth="labelWidth">
<template v-slot:relatedCompanies="row">
<p v-for="i in row.data.relatedCompanies">
{{i.role}}:<br/>
{{i.name}}
</p>
</template>
</info-table>
</template> </template>
<template v-if="title=='失信被执行人详情'"> <template v-if="title=='失信被执行人详情'">
<info-table class="info-tab" :list="defaultList1" :obj="detail" :labelWidth="labelWidth"></info-table> <info-table class="info-tab" :list="defaultList1" :obj="detail" :labelWidth="labelWidth"></info-table>
...@@ -140,7 +146,14 @@ ...@@ -140,7 +146,14 @@
<info-table class="info-tab" :list="defaultList4" :obj="detail" :labelWidth="labelWidth"></info-table> <info-table class="info-tab" :list="defaultList4" :obj="detail" :labelWidth="labelWidth"></info-table>
</template> </template>
<template v-if="title=='裁判文书详情'"> <template v-if="title=='裁判文书详情'">
<info-table class="info-tab" :list="defaultList5" :obj="detail" :labelWidth="labelWidth"></info-table> <info-table class="info-tab" :list="defaultList5" :obj="detail" :labelWidth="labelWidth">
<template v-slot:relatedCompanies="row">
<p v-for="i in row.data.relatedCompanies">
{{i.role}}:<br/>
{{i.name}}
</p>
</template>
</info-table>
</template> </template>
</div> </div>
</el-dialog> </el-dialog>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="content_item content_item_padding0"> <div class="content_item content_item_padding0">
<div class="label">企业名称</div> <div class="label">企业名称</div>
<div class="content_right item_ckquery_list"> <div class="content_right item_ckquery_list">
<el-input class="ename_input" clearable placeholder="多个企业用空格隔开" v-model="keyword" > <el-input class="ename_input" clearable placeholder="输入企业名称,多个企业用空格隔开" v-model="keyword" >
<div slot="append" class="btn-search" @click="search(1)">搜索</div> <div slot="append" class="btn-search" @click="search(1)">搜索</div>
</el-input> </el-input>
</div> </div>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="label label1" >资质条件</div> <div class="label label1" >资质条件</div>
<div class="content_right content_item_ckquery"> <div class="content_right content_item_ckquery">
<div class="item_ckquery_list" v-for="(item,i) in aptitudeDtoList" :key="i" :class="i>0?'item_ckquery_distance':''"> <div class="item_ckquery_list" v-for="(item,i) in aptitudeDtoList" :key="i" :class="i>0?'item_ckquery_distance':''">
<el-cascader :options="optionss" separator='丨' clearable :ref="i" class="content_item_list" v-model="item.codeStr" @change='optionsbtn(i)' <el-cascader placeholder="输入关键字快速查找,如建筑业企业资质" :options="optionss" separator='丨' clearable :ref="i" class="content_item_list" v-model="item.codeStr" @change='optionsbtn(i)'
filterable :props="{ filterable :props="{
checkStrictly:true, checkStrictly:true,
label:'name', label:'name',
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
</div> </div>
<div class="input"> <div class="input">
<div class="label">推送电话号码</div> <div class="label">推送电话号码</div>
<el-input class="name" placeholder="请输入推送人联系方式" v-model="contact"></el-input> <el-input class="name" placeholder="请输入推送人联系方式" v-model="contact" oninput="if(value.length>11)value=value.slice(0,11)" onkeyup="value = value.replace(/[^\d]/g,'');"></el-input>
</div> </div>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
handleUpdate(){ handleUpdate(){
let params={ let params={
id:this.id, id:this.id,
status:'1', status:this.status===1 ? 0:1,
} }
updateStatus(params).then(res => { updateStatus(params).then(res => {
console.log(res) console.log(res)
......
...@@ -10,6 +10,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -10,6 +10,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
...@@ -26,7 +27,7 @@ public interface ISysOssService { ...@@ -26,7 +27,7 @@ public interface ISysOssService {
SysOssVo getById(Long ossId); SysOssVo getById(Long ossId);
SysOssVo upload(MultipartFile file); SysOssVo upload(MultipartFile file) throws UnsupportedEncodingException;
SysOssVo upload(File file); SysOssVo upload(File file);
......
...@@ -34,6 +34,8 @@ import javax.servlet.http.HttpServletResponse; ...@@ -34,6 +34,8 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
...@@ -92,7 +94,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService { ...@@ -92,7 +94,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
lqw.eq(StringUtils.isNotBlank(bo.getFileSuffix()), SysOss::getFileSuffix, bo.getFileSuffix()); lqw.eq(StringUtils.isNotBlank(bo.getFileSuffix()), SysOss::getFileSuffix, bo.getFileSuffix());
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysOss::getUrl, bo.getUrl()); lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysOss::getUrl, bo.getUrl());
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
SysOss::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); SysOss::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), SysOss::getCreateBy, bo.getCreateBy()); lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), SysOss::getCreateBy, bo.getCreateBy());
lqw.eq(StringUtils.isNotBlank(bo.getService()), SysOss::getService, bo.getService()); lqw.eq(StringUtils.isNotBlank(bo.getService()), SysOss::getService, bo.getService());
return lqw; return lqw;
...@@ -113,7 +115,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService { ...@@ -113,7 +115,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName()); FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName());
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8"); response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
OssClient storage = OssFactory.instance(sysOss.getService()); OssClient storage = OssFactory.instance(sysOss.getService());
try(InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) { try (InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) {
int available = inputStream.available(); int available = inputStream.available();
IoUtil.copy(inputStream, response.getOutputStream(), available); IoUtil.copy(inputStream, response.getOutputStream(), available);
response.setContentLength(available); response.setContentLength(available);
...@@ -123,8 +125,10 @@ public class SysOssServiceImpl implements ISysOssService, OssService { ...@@ -123,8 +125,10 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
} }
@Override @Override
public SysOssVo upload(MultipartFile file) { public SysOssVo upload(MultipartFile file) throws UnsupportedEncodingException {
String originalfileName = file.getOriginalFilename(); String originalfileName = file.getOriginalFilename();
//文件名解码防止上传中文名文件导致的文件名乱码
originalfileName = URLDecoder.decode(originalfileName,"UTF-8");
String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length()); String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length());
OssClient storage = OssFactory.instance(); OssClient storage = OssFactory.instance();
UploadResult uploadResult; UploadResult uploadResult;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment