合并分支 'feature_dev_20221010_extend' 到 'dev_2nd_period_test'

Feature dev 20221010 extend

查看合并请求 laws-nio/laws-weilai!210
This commit is contained in:
高嵩
2022-10-27 09:38:05 +08:00
32 changed files with 2231 additions and 448 deletions
@@ -0,0 +1,20 @@
-- 二期一阶段的表变更,必须添加的固定数据以sql形式放到此处
-- 项目库添加字段(项目版本,软件版本,说明)---------2022-10-18 未同步生产环境
ALTER TABLE `laws_weilai`.`project_library_base`
ADD COLUMN `parent_id` varchar(255) NULL COMMENT '主项目id' AFTER `update_by`,
ADD COLUMN `project_version` varchar(255) NULL COMMENT '项目版本' AFTER `parent_id`,
ADD COLUMN `explanation` varchar(2000) NULL COMMENT '说明' AFTER `project_version`,
ADD COLUMN `software_version` varchar(255) NULL COMMENT '软件版本' AFTER `explanation`;
-- 项目库添加字段(排序)---------2022-10-18 未同步生产环境
ALTER TABLE `laws_weilai`.`project_library_base`
ADD COLUMN `sort` varchar(255) NULL COMMENT '排序(用于置顶功能)' AFTER `software_version`,
ADD COLUMN `flag` varchar(255) NULL COMMENT '置顶(flag为空的时候为置顶, flag为1的时候取消置顶)' AFTER `sort`;
-- 认证参数列表添加字段--------2022-10-20 未同步生产环境
ALTER TABLE `laws_weilai`.`params_manifest`
ADD COLUMN `project_version` varchar(255) NULL COMMENT '相关项目版本' AFTER `params_template_name`,
ADD COLUMN `explanation` varchar(2000) NULL COMMENT '说明' AFTER `project_version`;
@@ -103,4 +103,10 @@ public class ParamsManifestEO implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String projectName; private String projectName;
//相关项目版本
private String projectVersion;
//说明
private String explanation;
} }
@@ -16,6 +16,8 @@
<result column="params_template_id" property="paramsTemplateId" /> <result column="params_template_id" property="paramsTemplateId" />
<result column="params_template_publish_version" property="paramsTemplatePublishVersion" /> <result column="params_template_publish_version" property="paramsTemplatePublishVersion" />
<result column="params_template_name" property="paramsTemplateName" /> <result column="params_template_name" property="paramsTemplateName" />
<result column="project_version" property="projectVersion" />
<result column="explanation" property="explanation" />
</resultMap> </resultMap>
<resultMap id="ParamsManifestEOResultMapForCopy" type="com.jero.modules.cert.collect.vo.ParamsManifestVO"> <resultMap id="ParamsManifestEOResultMapForCopy" type="com.jero.modules.cert.collect.vo.ParamsManifestVO">
<id column="id" property="id" /> <id column="id" property="id" />
@@ -27,6 +29,8 @@
<result column="params_template_name" property="paramsTemplateName" /> <result column="params_template_name" property="paramsTemplateName" />
<result column="params_template_id" property="paramsTemplateId" /> <result column="params_template_id" property="paramsTemplateId" />
<result column="params_template_publish_version" property="paramsTemplatePublishVersion" /> <result column="params_template_publish_version" property="paramsTemplatePublishVersion" />
<result column="project_version" property="projectVersion" />
<result column="explanation" property="explanation" />
</resultMap> </resultMap>
<sql id="BaseColumnList"> <sql id="BaseColumnList">
@@ -43,6 +47,8 @@
pm.project_id as project_id, pm.project_id as project_id,
pm.params_template_id as params_template_id, pm.params_template_id as params_template_id,
pm.params_template_publish_version as params_template_publish_version, pm.params_template_publish_version as params_template_publish_version,
pm.project_version as project_version,
pm.explanation as explanation,
if (pt.params_template_name is not null, pt.params_template_name, pm.params_template_name) as params_template_name if (pt.params_template_name is not null, pt.params_template_name, pm.params_template_name) as params_template_name
</sql> </sql>
@@ -134,4 +140,4 @@
where project_id = #{projectId} where project_id = #{projectId}
order by create_time desc order by create_time desc
</select> </select>
</mapper> </mapper>
@@ -187,6 +187,8 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
ParamsManifestEO updateEO = new ParamsManifestEO(); ParamsManifestEO updateEO = new ParamsManifestEO();
updateEO.setId(paramsManifestEO.getId()); updateEO.setId(paramsManifestEO.getId());
updateEO.setTitle(paramsManifestEO.getTitle()); updateEO.setTitle(paramsManifestEO.getTitle());
updateEO.setProjectVersion(paramsManifestEO.getProjectVersion());
updateEO.setExplanation(paramsManifestEO.getExplanation());
Date now = new Date(); Date now = new Date();
updateEO.setUpdateTime(now); updateEO.setUpdateTime(now);
return updateById(updateEO); return updateById(updateEO);
@@ -24,4 +24,10 @@ public class ParamsManifestVO {
private String ids; private String ids;
private String cut; private String cut;
private String sourceManifestId; private String sourceManifestId;
//相关项目版本
private String projectVersion;
//说明
private String explanation;
} }
@@ -1,6 +1,6 @@
package com.jero.modules.project.controller; package com.jero.modules.project.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
@@ -12,7 +12,15 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@@ -46,8 +54,9 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
@ApiOperation(value="项目库基础表-分页列表查询", notes="项目库基础表-分页列表查询") @ApiOperation(value="项目库基础表-分页列表查询", notes="项目库基础表-分页列表查询")
@PostMapping(value = "/page") @PostMapping(value = "/page")
public Result<?> queryPageList(@RequestBody Map<String,Object> params) { public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
IPage<ProjectLibraryBase> pageList= projectLibraryBaseService.queryPageList(params); List<ProjectLibraryBase> pageList= projectLibraryBaseService.queryPageList(params);
return Result.OK(params.get("cut").toString(),pageList); Page pages = projectLibraryBaseService.getPages(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()), pageList);
return Result.OK(params.get("cut").toString(),pages);
} }
/** /**
@@ -77,6 +86,20 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
projectLibraryBaseService.add(projectLibraryBase); projectLibraryBaseService.add(projectLibraryBase);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
/**
* 项目扩展(添加子项目子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致)
*
* @param projectLibraryBase
* @return
*/
@AutoLog(value = "项目扩展(添加子项目)")
@ApiOperation(value="项目扩展(添加子项目)", notes="项目扩展(添加子项目)")
@RequiresPermissions("projectLibraryBase:add")
@PostMapping(value = "/addChild")
public Result<?> addChild(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) throws ParseException {
projectLibraryBaseService.addChild(projectLibraryBase);
return Result.OK("添加成功!");
}
/** /**
* 编辑 * 编辑
@@ -137,7 +160,7 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id, public Result<?> queryById(@RequestParam(name="id",required=true) String id,
@RequestParam(name="cut",required=true) String cut) { @RequestParam(name="cut",required=true) String cut) {
List<ProjectLibraryBase> data = projectLibraryBaseService.queryById(id); List<ProjectLibraryBase> data = projectLibraryBaseService.queryById(id,cut);
if(data==null) { if(data==null) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
} }
@@ -205,4 +228,45 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
} }
/**
* 项目置顶,取消置顶(只置顶主项目)
* @param id
* @param flag 0为置顶, 1为取消置顶
* @return
*/
@AutoLog(value = "项目置顶,取消置顶(只置顶主项目)")
@ApiOperation(value="项目置顶,取消置顶(只置顶主项目)", notes="项目置顶,取消置顶(只置顶主项目)")
@GetMapping(value = "/top")
public Result<?> top(String id,String flag) {
projectLibraryBaseService.top(id,flag);
return Result.OK("编辑成功!");
}
/**
* 获取项目所有的版本(主版本和子版本的集合)
* @param id 项目id
* @return
*/
@AutoLog(value = "获取项目所有的版本(主版本和子版本的集合)")
@ApiOperation(value="获取项目所有的版本(主版本和子版本的集合)", notes="获取项目所有的版本(主版本和子版本的集合)")
@GetMapping(value = "/getVersionsInfo")
public Result<?> getVersionsInfo(String id) {
List<String> versionsInfoList = projectLibraryBaseService.getVersionsInfo(id);
return Result.OK(versionsInfoList);
}
/**
* 版本统计
* @return
*/
@AutoLog(value = "版本统计")
@ApiOperation(value="版本统计)", notes="版本统计")
@PostMapping(value = "/versionStatistics")
public Result<?> versionStatistics(@RequestBody Map<String,Object> params) {
List<ProjectLibraryBase> projectLibraryBasesList = projectLibraryBaseService.versionStatistics(String.valueOf(params.get("id")));
Page pages = projectLibraryBaseService.getPages(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()), projectLibraryBasesList);
return Result.OK(pages);
}
} }
@@ -12,7 +12,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.util.List;
/** /**
@@ -25,7 +25,7 @@ import java.io.Serializable;
@TableName("project_library_base") @TableName("project_library_base")
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
public class ProjectLibraryBase implements Serializable { public class ProjectLibraryBase implements Comparable<ProjectLibraryBase> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**主键*/ /**主键*/
@@ -109,4 +109,36 @@ public class ProjectLibraryBase implements Serializable {
/**目标市场展示名称*/ /**目标市场展示名称*/
@TableField(exist = false) @TableField(exist = false)
private java.lang.String targetMarketName; private java.lang.String targetMarketName;
//主项目id parent_id
private String parentId;
//项目版本
private String projectVersion;
//软件版本
private String softwareVersion;
//最后一个版本
@TableField(exist = false)
private String versionLast;
//说明
private String explanation;
//排序(用于项目置顶)
private String sort;
//置顶标识(flag为空的时候为置顶, flag为1的时候取消置顶)
private String flag;
@TableField(exist = false)
private List<ProjectLibraryBase> children;
@Override
public int compareTo(ProjectLibraryBase o) {
return Integer.valueOf(this.projectVersion)-Integer.valueOf(o.projectVersion);//升序
// return o.id-this.id;//降序
}
} }
@@ -0,0 +1,44 @@
package com.jero.modules.project.enums;
/**
* 任务状态枚举类
*/
public enum TopEnum {
TOP_CANCEL("取消置顶","1"),
;
String name;
String value;
private TopEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static String getTextByValue(String value) {
TopEnum[] values = values();
for (TopEnum taskStatusEnum : values) {
if (taskStatusEnum.value.equals(value)) {
return taskStatusEnum.name;
}
}
return null;
}
}
@@ -16,7 +16,8 @@ import java.util.Map;
*/ */
public interface ProjectLibraryBaseMapper extends BaseMapper<ProjectLibraryBase> { public interface ProjectLibraryBaseMapper extends BaseMapper<ProjectLibraryBase> {
/**分页列表*/ /**分页列表*/
IPage<ProjectLibraryBase> queryPageList(IPage page, Map<String, Object> params); List<ProjectLibraryBase> queryPageList(@Param("params") Map<String, Object> params);
// IPage<ProjectLibraryBase> queryPageList(IPage page, Map<String, Object> params);
List<ProjectLibraryBase> getList(@Param("projectLibraryBase") ProjectLibraryBase projectLibraryBase); List<ProjectLibraryBase> getList(@Param("projectLibraryBase") ProjectLibraryBase projectLibraryBase);
@@ -55,7 +55,10 @@
from from
project_laws_inventory project_laws_inventory
where where
project_library_id = #{projectLibraryId} project_library_id in
<foreach collection="projectLibraryId.split(',')" index="index" separator="," open="(" close=")" item="item">
#{item}
</foreach>
group by inventory_affirm_status group by inventory_affirm_status
</select> </select>
@@ -67,7 +70,10 @@
from from
project_laws_inventory project_laws_inventory
where where
project_library_id = #{projectLibraryId} project_library_id in
<foreach collection="projectLibraryId.split(',')" index="index" separator="," open="(" close=")" item="item">
#{item}
</foreach>
group by task_affirm_status group by task_affirm_status
</select> </select>
@@ -43,7 +43,13 @@
plb.create_time, plb.create_time,
plb.sys_org_code, plb.sys_org_code,
plb.update_by, plb.update_by,
plb.update_time plb.update_time,
plb.parent_id,
plb.project_version,
plb.explanation,
plb.software_version,
plb.sort,
plb.flag
from project_library_base as plb from project_library_base as plb
left join project_name_info as pni on plb.project_name_id=pni.id left join project_name_info as pni on plb.project_name_id=pni.id
left join sys_user as studiouser on plb.studio_engineer=studiouser.id left join sys_user as studiouser on plb.studio_engineer=studiouser.id
@@ -62,10 +68,10 @@
( pni.project_name like '%1%%' escape '1' or pni.project_name like '%1%%' escape '1') ( pni.project_name like '%1%%' escape '1' or pni.project_name like '%1%%' escape '1')
</when> </when>
<otherwise> <otherwise>
(pni.project_name like concat('%',#{params.projectName},'%') or pyni.year_name like concat('%',#{params.projectName},'%')) <!--(pni.project_name like concat('%',#{params.projectName},'%') or pyni.year_name like concat('%',#{params.projectName},'%'))-->
</otherwise> </otherwise>
</choose> </choose>
</if> </if>
<!--搜索条件:目标市场--> <!--搜索条件:目标市场-->
<if test="params.targetMarket != null and params.targetMarket != '' "> <if test="params.targetMarket != null and params.targetMarket != '' ">
@@ -111,8 +117,71 @@
and plb.digital_platform like concat('%',#{params.digitalPlatform},'%') and plb.digital_platform like concat('%',#{params.digitalPlatform},'%')
</if> </if>
</where> </where>
order by plb.create_time desc order by plb.sort desc, plb.create_time desc
</select> </select>
<!-- <select id="queryPageList" resultType="com.jero.modules.project.entity.ProjectLibraryBase">-->
<!-- <include refid="select_item"/>-->
<!-- <where>-->
<!-- <if test="params.projectName != null and params.projectName != ''">-->
<!-- &lt;!&ndash;搜索条件:项目名称,包含%,单独搜索&ndash;&gt;-->
<!-- <choose>-->
<!-- <when test='params.projectName != null and params.projectName != "" and params.projectName.contains("%")'>-->
<!-- ( pni.project_name like '%1%%' escape '1' or pni.project_name like '%1%%' escape '1')-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- (pni.project_name like concat('%',#{params.projectName},'%') or pyni.year_name like concat('%',#{params.projectName},'%'))-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </if>-->
<!-- &lt;!&ndash;搜索条件:目标市场&ndash;&gt;-->
<!-- <if test="params.targetMarket != null and params.targetMarket != '' ">-->
<!-- and plb.target_market like concat('%',#{params.targetMarket},'%')-->
<!-- </if>-->
<!-- &lt;!&ndash;搜索条件:项目状态&ndash;&gt;-->
<!-- <if test="params.projectStatus != null and params.projectStatus != '' ">-->
<!-- and plb.project_status like concat('%',#{params.projectStatus},'%')-->
<!-- </if>-->
<!-- <if test="params.studioEngineer != null and params.studioEngineer != ''">-->
<!-- &lt;!&ndash;搜索条件:studio工程师,包含%,单独搜索&ndash;&gt;-->
<!-- <choose>-->
<!-- <when test='params.studioEngineer != null and params.studioEngineer != "" and params.studioEngineer.contains("%")'>-->
<!-- and plb.studio_engineer like '%1%%' escape '1'-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- and plb.studio_engineer like concat('%',#{params.studioEngineer},'%')-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </if>-->
<!-- <if test="params.certificationEngineer != null and params.certificationEngineer != ''">-->
<!-- &lt;!&ndash;搜索条件:认证工程师,包含%,单独搜索&ndash;&gt;-->
<!-- <choose>-->
<!-- <when test='params.certificationEngineer != null and params.certificationEngineer != "" and params.certificationEngineer.contains("%")'>-->
<!-- and plb.certification_engineer like '%1%%' escape '1'-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- and plb.certification_engineer like concat('%',#{params.certificationEngineer},'%')-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </if>-->
<!-- &lt;!&ndash;搜索条件:车型平台&ndash;&gt;-->
<!-- <if test="params.vehiclePlatform != null and params.vehiclePlatform != '' ">-->
<!-- and plb.vehicle_platform like concat('%',#{params.vehiclePlatform},'%')-->
<!-- </if>-->
<!-- &lt;!&ndash;搜索条件:数字平台&ndash;&gt;-->
<!-- <if test="params.digitalPlatform != null and params.digitalPlatform != '' ">-->
<!-- and plb.digital_platform like concat('%',#{params.digitalPlatform},'%')-->
<!-- </if>-->
<!-- </where>-->
<!-- order by plb.create_time desc-->
<!-- </select>-->
<select id="getList" resultType="com.jero.modules.project.entity.ProjectLibraryBase"> <select id="getList" resultType="com.jero.modules.project.entity.ProjectLibraryBase">
<include refid="select_item"/> <include refid="select_item"/>
@@ -1,6 +1,6 @@
package com.jero.modules.project.service; package com.jero.modules.project.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.project.entity.ProjectLibraryBase; import com.jero.modules.project.entity.ProjectLibraryBase;
@@ -26,6 +26,14 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
*/ */
void add(ProjectLibraryBase projectLibraryBase) throws ParseException; void add(ProjectLibraryBase projectLibraryBase) throws ParseException;
/**
* 项目扩展(添加子项目-子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致)
*
* @param projectLibraryBase
* @return
*/
void addChild(ProjectLibraryBase projectLibraryBase) throws ParseException;
/** /**
* 更新 * 更新
* *
@@ -56,7 +64,7 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
* @param id * @param id
* @return * @return
*/ */
List<ProjectLibraryBase> queryById(String id); List<ProjectLibraryBase> queryById(String id,String cut);
/** /**
* 列表查询 * 列表查询
@@ -70,7 +78,8 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
* *
* @return * @return
*/ */
IPage<ProjectLibraryBase> queryPageList(Map<String, Object> params); List<ProjectLibraryBase> queryPageList(Map<String, Object> params);
// IPage<ProjectLibraryBase> queryPageList(Map<String, Object> params);
/** /**
* 项目详情-统计接口 * 项目详情-统计接口
@@ -91,4 +100,28 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
void checkData(String id, String cut); void checkData(String id, String cut);
void disposeData(List<ProjectLibraryBase> records,String cut,boolean disposeTargetMarketFlag); void disposeData(List<ProjectLibraryBase> records,String cut,boolean disposeTargetMarketFlag);
Page getPages(Integer currentPage, Integer pageSize, List<ProjectLibraryBase> list);
/**
* 项目置顶,取消置顶(只置顶主项目)
* @param id
* @param flag 0为置顶, 1为取消置顶
* @return
*/
void top(String id,String flag);
/**
* 获取项目所有的版本(主版本和子版本的集合)
* @param id
* @return
*/
List<String> getVersionsInfo(String id);
/**
* 版本统计
* @param id
* @return
*/
List<ProjectLibraryBase> versionStatistics(String id);
} }
@@ -8416,7 +8416,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
List<SysRole> sysRoles = new LinkedList<>(); List<SysRole> sysRoles = new LinkedList<>();
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//项目详情中取R&H Studio和认证工程师 //项目详情中取R&H Studio和认证工程师
List<ProjectLibraryBase> projectLibraryBases = projectLibraryBaseService.queryById(projectLibraryId); List<ProjectLibraryBase> projectLibraryBases = projectLibraryBaseService.queryById(projectLibraryId,null);
String certificationEngineerName = ""; String certificationEngineerName = "";
if(projectLibraryBases.size() != 0){ if(projectLibraryBases.size() != 0){
certificationEngineerName = projectLibraryBases.get(0).getCertificationEngineerName(); certificationEngineerName = projectLibraryBases.get(0).getCertificationEngineerName();
@@ -1,8 +1,8 @@
package com.jero.modules.project.service.impl; package com.jero.modules.project.service.impl;
import cn.hutool.core.lang.func.Func1; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.CutEnum;
@@ -11,9 +11,27 @@ import com.jero.common.system.vo.DictModel;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.modules.cert.collect.service.IParamsManifestEOService; import com.jero.modules.cert.collect.service.IParamsManifestEOService;
import com.jero.modules.enums.DictCodeEnum; import com.jero.modules.enums.DictCodeEnum;
import com.jero.modules.project.entity.*; import com.jero.modules.project.entity.ConditionAssessmentEO;
import com.jero.modules.project.enums.*; import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.project.mapper.*; import com.jero.modules.project.entity.ProjectLawsInventoryLogEO;
import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.project.entity.ProjectLibraryRoleRelEO;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
import com.jero.modules.project.entity.ProjectTaskPlanning;
import com.jero.modules.project.enums.CertificationProgressEnum;
import com.jero.modules.project.enums.CurrentProjectStatusEnum;
import com.jero.modules.project.enums.DesignComplianceStatusEnum;
import com.jero.modules.project.enums.InventoryAffirmStatusEnum;
import com.jero.modules.project.enums.OperatorTypeEnum;
import com.jero.modules.project.enums.ProjectRoleEnum;
import com.jero.modules.project.enums.TaskAffirmStatusEnum;
import com.jero.modules.project.enums.TopEnum;
import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper;
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
import com.jero.modules.project.mapper.ProjectNameInfoEOMapper;
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
import com.jero.modules.project.mapper.ProjectTaskInventoryEOMapper;
import com.jero.modules.project.service.IConditionAssessmentEOService; import com.jero.modules.project.service.IConditionAssessmentEOService;
import com.jero.modules.project.service.IProjectLibraryBaseService; import com.jero.modules.project.service.IProjectLibraryBaseService;
import com.jero.modules.project.service.IProjectLibraryRoleRelEOService; import com.jero.modules.project.service.IProjectLibraryRoleRelEOService;
@@ -26,6 +44,7 @@ import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.system.util.StringUtils; import com.jero.modules.system.util.StringUtils;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Cell;
@@ -33,6 +52,7 @@ import org.apache.poi.ss.usermodel.Row;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@@ -40,7 +60,15 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -131,8 +159,64 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
projectLibraryRoleRelEOService.add(projectLibraryRoleRelEO); projectLibraryRoleRelEOService.add(projectLibraryRoleRelEO);
} }
/**
* 项目扩展(添加子项目--子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致)
* @param projectLibraryBase
* @throws ParseException
*/
@Override
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public void addChild(ProjectLibraryBase projectLibraryBase) throws ParseException {
String id = projectLibraryBase.getId();//主项目id
String projectId = UUID.randomUUID().toString().replace("-", "");
//主表中添加数据
ProjectLibraryBase projectLibraryBaseTemp = this.getById(id);
projectLibraryBaseTemp.setId(projectId);
projectLibraryBaseTemp.setParentId(id);
projectLibraryBaseTemp.setProjectVersion(projectLibraryBase.getProjectVersion());
projectLibraryBaseTemp.setExplanation(projectLibraryBase.getExplanation());
this.save(projectLibraryBaseTemp);
/**检查车型名称id,年款号,目标市场同时存在,报错*/
//相关人员名单中添加数据
List<ProjectRelatedPersonnel> projectRelatedPersonnelList = projectRelatedPersonnelMapper.queryPageList(id,
DictCodeEnum.DUTY_TERRITORY.getValue(),
null,
null,
null,
null);
if(projectRelatedPersonnelList.size() != 0){
for (ProjectRelatedPersonnel projectRelatedPersonnel : projectRelatedPersonnelList) {
projectRelatedPersonnel.setId(UUID.randomUUID().toString().replace("-", ""));
projectRelatedPersonnel.setProjectId(projectId);
}
projectRelatedPersonnelService.saveBatch(projectRelatedPersonnelList);
}
//法规/认证任务计划添加数据 projectTaskPlanningService
LambdaQueryWrapper<ProjectTaskPlanning> wrapper = new LambdaQueryWrapper<>();
wrapper.in(ProjectTaskPlanning::getProjectId,projectLibraryBase.getId());
ProjectTaskPlanning projectTaskPlanning = projectTaskPlanningService.getOne(wrapper);
if(ObjectUtils.isNotEmpty(projectTaskPlanning)){
projectTaskPlanning.setId(UUID.randomUUID().toString().replace("-", ""));
projectTaskPlanning.setProjectId(projectId);
projectTaskPlanningService.add(projectTaskPlanning);
}
//初始化当前项目的studio与项目库 角色关系 projectLibraryRoleRelEOService
LambdaQueryWrapper<ProjectLibraryRoleRelEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ProjectLibraryRoleRelEO::getProjectLibraryId,projectLibraryBase.getId());
ProjectLibraryRoleRelEO projectLibraryRoleRelEO = projectLibraryRoleRelEOService.getOne(queryWrapper);
if(ObjectUtils.isNotEmpty(projectLibraryRoleRelEO)){
projectLibraryRoleRelEO.setId(UUID.randomUUID().toString().replace("-", ""));
projectLibraryRoleRelEO.setProjectLibraryId(projectId);
projectLibraryRoleRelEOService.add(projectLibraryRoleRelEO);
}
}
/**检查车型名称id,年款号,目标市场,版本同时存在,报错*/
public void checkExitData(ProjectLibraryBase projectLibraryBase){ public void checkExitData(ProjectLibraryBase projectLibraryBase){
String projectNameId = projectLibraryBase.getProjectNameId(); String projectNameId = projectLibraryBase.getProjectNameId();
String yearNameId = projectLibraryBase.getYearNameId(); String yearNameId = projectLibraryBase.getYearNameId();
@@ -140,7 +224,8 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
QueryWrapper<ProjectLibraryBase> queryWrapper = new QueryWrapper<>(); QueryWrapper<ProjectLibraryBase> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("project_name_id",projectNameId) queryWrapper.eq("project_name_id",projectNameId)
.eq("year_name_id",yearNameId) .eq("year_name_id",yearNameId)
.eq("target_market",targetMarket); .eq("target_market",targetMarket)
.eq("project_version",targetMarket);
if(StringUtils.isNotBlank(projectLibraryBase.getId())){ if(StringUtils.isNotBlank(projectLibraryBase.getId())){
queryWrapper.ne("id",projectLibraryBase.getId()); queryWrapper.ne("id",projectLibraryBase.getId());
} }
@@ -253,7 +338,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
public void checkData(String id, String cut) { public void checkData(String id, String cut) {
//判断该条项目是否是自己创建,如果不是则不能删除 //判断该条项目是否是自己创建,如果不是则不能删除
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<ProjectLibraryBase> projectLibraryBases = this.queryById(id); List<ProjectLibraryBase> projectLibraryBases = this.queryById(id,null);
if(!loginUser.getUsername().equals(projectLibraryBases.get(0).getCreateBy())){ if(!loginUser.getUsername().equals(projectLibraryBases.get(0).getCreateBy())){
if(CutEnum.CN.getValue().equals(cut)){ if(CutEnum.CN.getValue().equals(cut)){
throw new JeroBootException("该条项目非本人创建,不能删除"); throw new JeroBootException("该条项目非本人创建,不能删除");
@@ -335,12 +420,32 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
* @return * @return
*/ */
@Override @Override
public List<ProjectLibraryBase> queryById(String id) { public List<ProjectLibraryBase> queryById(String id,String cut) {
List<ProjectLibraryBase> records = projectLibraryBaseMapper.queryById(id); List<ProjectLibraryBase> records = projectLibraryBaseMapper.queryById(id);
disposeData(records,"",false); disposeData(records,"",false);
//目标市场数据字典
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
for(ProjectLibraryBase projectLibraryBase: records){ for(ProjectLibraryBase projectLibraryBase: records){
//历史数据的主版本没有版本号,所以默认给00
if(StringUtils.isBlank(projectLibraryBase.getParentId()) && StringUtils.isBlank(projectLibraryBase.getProjectVersion())){
projectLibraryBase.setProjectVersion("00");
}
//目标市场
Map<String,Object> param = new HashMap<>();
param.put("cut",cut);
String targetMarket = getMarket(param, targetMarketList, projectLibraryBase);
//主项目的版本号
String projectVersion = "";
if(StringUtils.isBlank(projectLibraryBase.getParentId())){
projectVersion = "00";
}else{
projectVersion = projectLibraryBase.getProjectVersion();
}
if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){ if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + "-" + projectLibraryBase.getYearName()); projectLibraryBase.setProjectName(projectLibraryBase.getProjectName()
+ "-" + projectLibraryBase.getYearName()
+ "-" + targetMarket
+ "-" + projectVersion);
} }
} }
return records; return records;
@@ -363,21 +468,141 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
* @return * @return
*/ */
@Override @Override
public IPage<ProjectLibraryBase> queryPageList(Map<String,Object> params) { public List<ProjectLibraryBase> queryPageList(Map<String,Object> params) {
Integer pageNo = Integer.parseInt(params.get("pageNo").toString()); List<ProjectLibraryBase> result = projectLibraryBaseMapper.queryPageList(params);
Integer pageSize = Integer.parseInt(params.get("pageSize").toString()); disposeData(result,"",false);
IPage page = new Page(pageNo, pageSize); //目标市场
IPage<ProjectLibraryBase> result = projectLibraryBaseMapper.queryPageList(page, params); List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
List<ProjectLibraryBase> records = result.getRecords();
disposeData(records,"",false); for(ProjectLibraryBase projectLibraryBase: result){
for(ProjectLibraryBase projectLibraryBase: records){ //目标市场
String targetMarket = getMarket(params, targetMarketList, projectLibraryBase);
//主项目的版本号
String projectVersion = "";
if(StringUtils.isBlank(projectLibraryBase.getParentId())){
projectVersion = "00";
}else{
projectVersion = projectLibraryBase.getProjectVersion();
}
if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){ if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + "-" + projectLibraryBase.getYearName()); projectLibraryBase.setProjectName(projectLibraryBase.getProjectName()
+ "-" + projectLibraryBase.getYearName()
+ "-" + targetMarket
+ "-" + projectVersion);
} }
} }
return result; //项目名称模糊查询特殊处理(因为项目名称是多字段拼接的)
if(ObjectUtils.isNotEmpty(params.get("projectName"))){
result = result.stream().filter(e->e.getProjectName().toLowerCase().contains(String.valueOf(params.get("projectName")).toLowerCase())).collect(Collectors.toList());
}
//数据组装
List<ProjectLibraryBase> resultTemp = new LinkedList<>();
for (ProjectLibraryBase projectLibraryBase : result) {
if(StringUtils.isBlank(projectLibraryBase.getParentId())){
resultTemp.add(projectLibraryBase);
}
}
for (ProjectLibraryBase projectLibraryBase : resultTemp) {
//子项目
List<ProjectLibraryBase> children = result.stream()
.filter(e -> StringUtils.isNotBlank(e.getParentId()) && projectLibraryBase.getId().equals(e.getParentId())).collect(Collectors.toList());
if(children.size() != 0){
//子项目的基础上添加的子项目
List<String> childrenIdList = children.stream().map(ProjectLibraryBase::getId).distinct().collect(Collectors.toList());
List<ProjectLibraryBase> childrenList = result.stream()
.filter(e -> StringUtils.isNotBlank(e.getParentId()) && childrenIdList.contains(e.getParentId())).collect(Collectors.toList());
children.addAll(childrenList);
//按版本排序
Collections.sort(children);
projectLibraryBase.setChildren(children);
//最后一个版本号(主项目和主项目都需要设置)
String versionLast = children.get(children.size() - 1).getProjectVersion();
//主版本设置最后一个版本号(用于项目扩展中的版本号)
projectLibraryBase.setVersionLast(versionLast);
for (ProjectLibraryBase child : children) {
//每个子版本版本设置最后一个版本号(用于项目扩展中的版本号)
child.setVersionLast(versionLast);
}
}
}
return resultTemp;
} }
private String getMarket(Map<String, Object> params, List<DictModel> targetMarketList, ProjectLibraryBase projectLibraryBase) {
List<DictModel> dictModelList = new ArrayList<>();
for (String s : projectLibraryBase.getTargetMarket().split(",")) {
List<DictModel> dictModelListTemp = targetMarketList.stream()
.filter(e -> s.equals(e.getValue())).collect(Collectors.toList());
dictModelList.addAll(dictModelListTemp);
}
String targetMarket = "";
if(dictModelList.size() != 0){
StringBuilder sb = new StringBuilder();
for (DictModel dictModel : dictModelList) {
if(CutEnum.CN.getValue().equals(params.get("cut"))){
sb.append(dictModel.getText()+",");
}else{
sb.append(dictModel.getTextEn()+",");
}
}
if(StringUtils.isNotBlank(sb)){
targetMarket = sb.substring(0,sb.length()-1);
}
}
return targetMarket;
}
public Page getPages(Integer currentPage, Integer pageSize, List<ProjectLibraryBase> list){
Page page =new Page();
if(list==null){
return null;
}
int size = list.size();
if(pageSize > size){
pageSize = size;
}
if(pageSize!=0){
//求出最⼤页数,防⽌currentPage越界
int maxPage = size % pageSize ==0? size / pageSize : size / pageSize +1;
if(currentPage > maxPage){
currentPage = maxPage;
}
}
//当前页第⼀条数据的下标
int curIdx = currentPage >1?(currentPage -1)* pageSize :0;
List pageList =new ArrayList();
//将当前页的数据放进pageList
for(int i =0; i < pageSize && curIdx + i < size; i++){
pageList.add(list.get(curIdx + i));
}
page.setCurrent(currentPage).setSize(pageSize).setTotal(list.size()).setRecords(pageList);
return page;
}
// /**
// * 分页列表查询
// *
// * @return
// */
// @Override
// public IPage<ProjectLibraryBase> queryPageList(Map<String,Object> params) {
// Integer pageNo = Integer.parseInt(params.get("pageNo").toString());
// Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
// IPage page = new Page(pageNo, pageSize);
// IPage<ProjectLibraryBase> result = projectLibraryBaseMapper.queryPageList(page, params);
// List<ProjectLibraryBase> records = result.getRecords();
// disposeData(records,"",false);
// for(ProjectLibraryBase projectLibraryBase: records){
// if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
// projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + "-" + projectLibraryBase.getYearName());
// }
// }
// return result;
// }
@Override @Override
public void disposeData(List<ProjectLibraryBase> records,String cut,boolean disposeTargetMarketFlag) { public void disposeData(List<ProjectLibraryBase> records,String cut,boolean disposeTargetMarketFlag) {
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode()); List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
@@ -474,7 +699,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
result.put("taskToConfirmMap",taskToConfirmMap); result.put("taskToConfirmMap",taskToConfirmMap);
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = new QueryWrapper<>(); QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = new QueryWrapper<>();
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,id); lawsInventoryEOQueryWrapper.lambda().in(ProjectLawsInventoryEO::getProjectLibraryId,Arrays.asList(id.split(",")));
//lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue()); //lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue());
//lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue()); //lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue());
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper); List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper);
@@ -555,6 +780,117 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
return result; return result;
} }
// @Override
// public Map<String, Object> getProjectDetailsStatistics(String id) {
// Map<String,Object> result = new HashMap<>();
//
// //当前项目状态
// Map<String,Object> currentProjectStatusMap = new HashMap<>();
// //清单确认
// Map<String,Object> listingToConfirmMap = new HashMap<>();
// //任务确认
// Map<String,Object> taskToConfirmMap = new HashMap<>();
// //设计符合性
// Map<String,Object> designComplianceMap = new HashMap<>();
// //prehomo确认
// Map<String,Object> prehomoMap = new HashMap<>();
// //验证符合性
// Map<String,Object> verifyComplianceMap = new HashMap<>();
// //认证进度
// Map<String,Object> certificationProgressMap = new HashMap<>();
//
// //清单确认统计
// List<Map<String,Object>> listingToConfirmMapList = this.projectLawsInventoryEOMapper.getlistingToConfirmStatistics(id);
// listingToConfirmMap.put("listingToConfirmMapList",listingToConfirmMapList);
// result.put("listingToConfirmMap",listingToConfirmMap);
//
// //任务确认统计
// List<Map<String,Object>> taskToConfirmMapList = this.projectLawsInventoryEOMapper.getTaskToConfirmStatistics(id);
// taskToConfirmMap.put("taskToConfirmMapList",taskToConfirmMapList);
// result.put("taskToConfirmMap",taskToConfirmMap);
//
// QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = new QueryWrapper<>();
// lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,id);
// //lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue());
// //lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue());
// List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper);
// if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
// List<String> projectLawsInventoryIdList = projectLawsInventoryEOList.stream().distinct().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList());
//
// //当前项目状态统计 获取一个 最差的结果 统计的数据 就是studio看到的数据。
// List<Map<String,Object>> currentProjectStatusMapList = new ArrayList<>();
// CurrentProjectStatusEnum[] values = CurrentProjectStatusEnum.values();
// for (CurrentProjectStatusEnum value : values) {
// Map<String,Object> map = new HashMap<>();
// map.put("color",value.getValue());
// currentProjectStatusMapList.add(map);
// }
// int currentProjectStatusTotal;
// List<ConditionAssessmentEO> projectStatusAssessList = this.conditionAssessmentEOService.getProjectStatusAssessList(projectLawsInventoryIdList);
//
// for (Map<String, Object> map : currentProjectStatusMapList) {
// List<ConditionAssessmentEO> collect = projectStatusAssessList.stream().filter(
// projectStatusAssess -> StringUtils.equals(projectStatusAssess.getConditionAssessment(),map.get("color").toString())
// ).collect(Collectors.toList());
// map.put("conditionAssessmentCount",collect.size());
// }
//
// currentProjectStatusTotal = currentProjectStatusMapList.stream().filter(
// currentProjectStatus -> Integer.parseInt(currentProjectStatus.get("conditionAssessmentCount").toString()) != 0
// ).mapToInt(currentProjectStatus -> Integer.parseInt(currentProjectStatus.get("conditionAssessmentCount").toString())).sum();
//
// currentProjectStatusMap.put("currentProjectStatusMapList",currentProjectStatusMapList);
// currentProjectStatusMap.put("currentProjectStatusTotal",currentProjectStatusTotal);
// result.put("currentProjectStatusMap",currentProjectStatusMap);
//
// //设计符合性
// List<Map<String,Object>> designComplianceMapList = this.projectTaskInventoryEOMapper.getDesignComplianceStatistice(projectLawsInventoryIdList);
// designComplianceMap.put("designComplianceMapList",designComplianceMapList);
// result.put("designComplianceMap",designComplianceMap);
//
// //prehomo确认
// List<Map<String,Object>> prehomoMapList = this.projectTaskInventoryEOMapper.getPrehomoStatistice(projectLawsInventoryIdList);
// prehomoMap.put("prehomoMapList",prehomoMapList);
// result.put("prehomoMap",prehomoMap);
//
// //验证符合性
// List<Map<String,Object>> verifyComplianceMapList = this.projectTaskInventoryEOMapper.getVerifyComplianceStatistice(projectLawsInventoryIdList);
// verifyComplianceMap.put("verifyComplianceMapList",verifyComplianceMapList);
// result.put("verifyComplianceMap",verifyComplianceMap);
//
// //认证进度统计
// int certificationProgressTotal;
// List<Map<String,Object>> certificationProgressMapList = this.projectTaskInventoryEOMapper.getCertificationProgressStatistics(projectLawsInventoryIdList);
// certificationProgressTotal = certificationProgressMapList.stream().filter(
// certificationProgress -> Integer.parseInt(certificationProgress.get("certificationProgressCount").toString()) != 0
// ).mapToInt(certificationProgress -> Integer.parseInt(certificationProgress.get("certificationProgressCount").toString())).sum();
//
// CertificationProgressEnum[] CertificationProgressEnumValues = CertificationProgressEnum.values();
// for (CertificationProgressEnum certificationProgressEnumValue : CertificationProgressEnumValues) {
// boolean flag = true;
// for (Map<String, Object> map : certificationProgressMapList) {
// if(map.get("certificationProgress") != null){
// if(StringUtils.equals(certificationProgressEnumValue.getValue(),map.get("certificationProgress").toString())){
// flag = false;
// break;
// }
// }
// }
// if(flag){
// Map<String,Object> map = new HashMap<>();
// map.put("certificationProgress",certificationProgressEnumValue.getValue());
// map.put("certificationProgressCount",0);
// certificationProgressMapList.add(map);
// }
// }
//
// certificationProgressMap.put("certificationProgressTotal",certificationProgressTotal);
// certificationProgressMap.put("certificationProgressMapList",certificationProgressMapList);
// result.put("certificationProgressMap",certificationProgressMap);
// }
//
// return result;
// }
/** /**
* 项目详情-统计接口-根据领域分组 * 项目详情-统计接口-根据领域分组
@@ -761,6 +1097,64 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
} }
} }
} }
@Override
public void top(String id, String flag) {
ProjectLibraryBase projectLibraryBase = this.getById(id);
//置顶的时候将取消置顶标识传过来即:flag=1
if(TopEnum.TOP_CANCEL.getValue().equals(flag)){
//置顶
LambdaQueryWrapper<ProjectLibraryBase> wrapper = new LambdaQueryWrapper<>();
wrapper.isNotNull(ProjectLibraryBase::getSort).orderByDesc(ProjectLibraryBase::getSort);
List<ProjectLibraryBase> list = this.list(wrapper);
if(list.size() != 0){
String sort = list.get(list.size() - 1).getSort();
int sortTemp = Integer.valueOf(sort) + 1;
projectLibraryBase.setSort(String.valueOf(sortTemp));
}else{
//首个置顶的项目排序为1
projectLibraryBase.setSort("1");
}
projectLibraryBase.setFlag(TopEnum.TOP_CANCEL.getValue());
this.updateById(projectLibraryBase);
}else{
//取消置顶
LambdaUpdateWrapper<ProjectLibraryBase> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(ProjectLibraryBase::getId,id);
updateWrapper.set(ProjectLibraryBase::getSort,null).set(ProjectLibraryBase::getFlag,null);
this.update(projectLibraryBase,updateWrapper);
}
}
@Override
public List<String> getVersionsInfo(String id) {
LambdaUpdateWrapper<ProjectLibraryBase> wrapper = new LambdaUpdateWrapper<>();
wrapper.in(ProjectLibraryBase::getId,id).or().in(ProjectLibraryBase::getParentId,id);
List<ProjectLibraryBase> list = this.list(wrapper);
List<String> result = new ArrayList<>();
if(list.size() != 0){
result = list.stream().map(ProjectLibraryBase::getProjectVersion).collect(Collectors.toList());
Collections.sort(result);
}
return result;
}
/**
* 版本统计
* @param id
* @return
*/
@Override
public List<ProjectLibraryBase> versionStatistics(String id) {
LambdaUpdateWrapper<ProjectLibraryBase> wrapper = new LambdaUpdateWrapper<>();
wrapper.in(ProjectLibraryBase::getId,id).or().in(ProjectLibraryBase::getParentId,id);
List<ProjectLibraryBase> list = this.list(wrapper);
if(list.size() != 0){
Collections.sort(list);
}
return list;
}
} }
@@ -31,6 +31,7 @@ import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.util.StringUtils; import com.jero.modules.system.util.StringUtils;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRichTextString; import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFSheet;
@@ -856,7 +857,10 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
ProjectRelatedPersonnel projectRelatedPersonnel = new ProjectRelatedPersonnel(); ProjectRelatedPersonnel projectRelatedPersonnel = new ProjectRelatedPersonnel();
//责任领域不能为空 //责任领域不能为空
String dutyTerritory = row.getCell(0).toString(); String dutyTerritory = "";
if(ObjectUtils.isNotEmpty(row.getCell(0))){
dutyTerritory = row.getCell(0).toString();
}
if(StringUtils.isNotBlank(dutyTerritory)) { if(StringUtils.isNotBlank(dutyTerritory)) {
projectRelatedPersonnel.setDutyTerritory(row.getCell(0).toString()); projectRelatedPersonnel.setDutyTerritory(row.getCell(0).toString());
}else{//责任领域不能为空,报错 }else{//责任领域不能为空,报错
+8
View File
@@ -793,6 +793,7 @@ module.exports = {
parameter: 'Parameter', parameter: 'Parameter',
changeExtension: 'Change Extension', changeExtension: 'Change Extension',
addDetailList: 'Add', addDetailList: 'Add',
editDetailList:'Edit DetailList',
detailedList: 'DetailedList', detailedList: 'DetailedList',
copyParamDetailList: 'Copy Parameter List', copyParamDetailList: 'Copy Parameter List',
collectionCompletionTime: 'Collection Completed', collectionCompletionTime: 'Collection Completed',
@@ -1329,4 +1330,11 @@ module.exports = {
thereForTheCurrentlySelectedData:'There is no standard breakdown for the currently selected data', thereForTheCurrentlySelectedData:'There is no standard breakdown for the currently selected data',
secondaryDirectory:'Secondary Directory', secondaryDirectory:'Secondary Directory',
OnlyPersonsCanBeSelected:'The maximum upper limit is exceeded; Only 100 persons can be selected', OnlyPersonsCanBeSelected:'The maximum upper limit is exceeded; Only 100 persons can be selected',
projectVersion:'Project Version',
softwareVersion:'Authentication Software version',
versionStatistics:'Version statistics',
addSubproject:'Add Subproject',
Topping:'Topping',
cancelTopping:'Cancel Topping',
relatedProjectVersion:'Related project version',
} }
+8
View File
@@ -809,6 +809,7 @@ module.exports = {
parameter: '参数', parameter: '参数',
changeExtension: '变更扩展', changeExtension: '变更扩展',
addDetailList: '添加清单', addDetailList: '添加清单',
editDetailList:'编辑清单',
detailedList: '清单', detailedList: '清单',
copyParamDetailList: '复制参数清单', copyParamDetailList: '复制参数清单',
collectionCompletionTime: '收集完成时间', collectionCompletionTime: '收集完成时间',
@@ -1430,4 +1431,11 @@ module.exports = {
thereForTheCurrentlySelectedData:'当前所选数据暂无标准分解单', thereForTheCurrentlySelectedData:'当前所选数据暂无标准分解单',
secondaryDirectory:'二级目录', secondaryDirectory:'二级目录',
OnlyPersonsCanBeSelected:'超出最大上限最多只能选择100个人员', OnlyPersonsCanBeSelected:'超出最大上限最多只能选择100个人员',
projectVersion:'项目版本',
softwareVersion:'认证软件版本',
versionStatistics:'版本统计',
addSubproject:'添加子项目',
Topping:'置顶',
cancelTopping:'取消置顶',
relatedProjectVersion:'相关项目版本',
} }
@@ -225,6 +225,7 @@
<a-input class="box-input add-input" <a-input class="box-input add-input"
:disabled="disabled" :disabled="disabled"
type="textarea" type="textarea"
@input="onInput"
v-model.trim="formInline.controlValues" v-model.trim="formInline.controlValues"
:placeholder="$t('PleaseEnter')+$t('NcontrolAlternatives')"/> :placeholder="$t('PleaseEnter')+$t('NcontrolAlternatives')"/>
</a-form-model-item> </a-form-model-item>
@@ -600,9 +601,12 @@ export default {
}; };
}) })
},
onInput(r) {
let value = r.target.value
r.target.value = value.replace(/[!#]/g, '')
this.formInline.controlValues = r.target.value
this.formInline = {...this.formInline}
}, },
getSysCategoryTree() { getSysCategoryTree() {
getAction('/sys/category/getSysCategoryTree', {}).then((res) => { getAction('/sys/category/getSysCategoryTree', {}).then((res) => {
@@ -57,6 +57,12 @@
<a-icon type="profile"/> <a-icon type="profile"/>
{{$t('TaskParameterCollection')}} {{$t('TaskParameterCollection')}}
</div> </div>
<div class="Virtual-detail-left-text"
:title="$t('projectStatus')"
@click="textClick(5,$t('projectStatus'))">
<a-icon type="cluster" />
{{$t('projectStatus')}}
</div>
<a-icon @click="textIconClick" type="menu-fold" class="text-icon"/> <a-icon @click="textIconClick" type="menu-fold" class="text-icon"/>
</div> </div>
<div v-if="!isDisplay" class="Virtual-detail-left-One"> <div v-if="!isDisplay" class="Virtual-detail-left-One">
@@ -85,17 +91,24 @@
@click="textClick(4,$t('TaskParameterCollection'))"> @click="textClick(4,$t('TaskParameterCollection'))">
<a-icon type="profile"/> <a-icon type="profile"/>
</div> </div>
<div class="Virtual-detail-left-text"
:title="$t('projectStatus')"
@click="textClick(5,$t('projectStatus'))">
<a-icon type="cluster" />
</div>
<a-icon @click="textIconClick" type="menu-unfold" class="text-icon-one"/> <a-icon @click="textIconClick" type="menu-unfold" class="text-icon-one"/>
</div> </div>
<div class="Virtual-detail-right" <div class="Virtual-detail-right"
:style="{'width':isDisplay?'calc(100% - 240px)':'calc(100% - 66px)'}"> :style="{'width':isDisplay?'calc(100% - 240px)':'calc(100% - 66px)'}">
<ProjectDetailsName @TaskListChange="TaskListChange" v-if="textTitle === $t('projectDetails')"/> <ProjectDetailsName v-if="textTitle === $t('projectDetails')"/>
<listOfRegulations v-else-if="textTitle === $t('listOfRegulations')" <listOfRegulations v-else-if="textTitle === $t('listOfRegulations')"
:areaOfResponsibilityList="areaOfResponsibilityList"/> :areaOfResponsibilityList="areaOfResponsibilityList"/>
<TaskList :isDisplayNum="isDisplayNum" :areaOfResponsibility="areaOfResponsibility" <TaskList :isDisplayNum="isDisplayNum" :areaOfResponsibility="areaOfResponsibility"
v-else-if="textTitle === $t('taskList')"/> v-else-if="textTitle === $t('taskList')"/>
<TaskParameterCollection v-else-if="textTitle === $t('TaskParameterCollection')"/> <TaskParameterCollection v-else-if="textTitle === $t('TaskParameterCollection')"/>
<nonConformance v-else-if="textTitle === $t('nonConformance')"/> <nonConformance v-else-if="textTitle === $t('nonConformance')"/>
<projectStatus @TaskListChange="TaskListChange"
v-else-if="textTitle === $t('projectStatus')"/>
</div> </div>
</div> </div>
</div> </div>
@@ -112,6 +125,7 @@
import ProjectDetailsName from '../components/ProjectDetails' import ProjectDetailsName from '../components/ProjectDetails'
import TaskParameterCollection from '../components/TaskParameterCollection' import TaskParameterCollection from '../components/TaskParameterCollection'
import nonConformance from '../components/nonConformance' import nonConformance from '../components/nonConformance'
import projectStatus from '../components/projectStatus'
import updateLog from '@/components/UpdateLog/index' import updateLog from '@/components/UpdateLog/index'
import historicalVersionList from '../components/historicalVersionList' import historicalVersionList from '../components/historicalVersionList'
import commentList from '../components/commentList' import commentList from '../components/commentList'
@@ -128,7 +142,8 @@
nonConformance, nonConformance,
updateLog, updateLog,
historicalVersionList, historicalVersionList,
commentList commentList,
projectStatus
}, },
data() { data() {
return { return {
@@ -138,7 +153,7 @@
isTrue: true, isTrue: true,
loading: false, loading: false,
isDisplay: true, isDisplay: true,
areaOfResponsibilityList:{}, areaOfResponsibilityList: {},
url: { url: {
logList: '/project/projectLawsInventoryLogEO/page', logList: '/project/projectLawsInventoryLogEO/page',
historicalVersionUrl: '', historicalVersionUrl: '',
@@ -150,7 +165,7 @@
}, },
created() { created() {
document.title = this.$route.query.projectName ? this.$t('projectDetails') + '-' + this.$route.query.projectName : this.$t('projectDetails') document.title = this.$route.query.projectName ? this.$t('projectDetails') + '-' + this.$route.query.projectName : this.$t('projectDetails')
this.title = this.$route.query.projectName && this.$route.query.targetMarket ? this.$route.query.projectName + '-' + this.$route.query.targetMarket : this.$t('projectDetails') this.title = this.$route.query.projectName
}, },
mounted() { mounted() {
this.getTaskId() this.getTaskId()
@@ -194,7 +209,6 @@
textColor[0].classList.remove('Virtual-detail-left-text-color') textColor[0].classList.remove('Virtual-detail-left-text-color')
} }
let text = document.getElementsByClassName('Virtual-detail-left-text') let text = document.getElementsByClassName('Virtual-detail-left-text')
console.log(text)
if (name == 0) { if (name == 0) {
text[name].classList.add('Virtual-detail-left-text-color') text[name].classList.add('Virtual-detail-left-text-color')
this.textTitle = text[name].title this.textTitle = text[name].title
@@ -289,10 +303,10 @@
}) })
}, },
TaskListChange(item) { TaskListChange(item) {
if (item.isListing && item.isListing == '1'){ if (item.isListing && item.isListing == '1') {
this.areaOfResponsibilityList = item this.areaOfResponsibilityList = item
this.textTitle = this.$t('listOfRegulations') this.textTitle = this.$t('listOfRegulations')
}else{ } else {
this.areaOfResponsibility = item this.areaOfResponsibility = item
this.textTitle = this.$t('taskList') this.textTitle = this.$t('taskList')
} }
@@ -47,6 +47,12 @@
components: { components: {
responsibilityList responsibilityList
}, },
props: {
idList: {
type: Array,
default: []
}
},
data() { data() {
return { return {
queryParam:{ queryParam:{
@@ -99,7 +105,13 @@
}) })
}, },
getoptions(){ getoptions(){
getAction('project/projectLibraryBase/getProjectDetailsStatisticsCollectManifestLabel', {id:this.$route.query.id}).then((res) => { let id = ''
if (this.idList && this.idList.length > 0) {
id = this.idList.join(',')
} else {
id = this.$route.query.id
}
getAction('project/projectLibraryBase/getProjectDetailsStatisticsCollectManifestLabel', {id:id}).then((res) => {
if (res.success) { if (res.success) {
this.options = res.result this.options = res.result
this.queryParam.ctype = this.options[0].value this.queryParam.ctype = this.options[0].value
@@ -23,13 +23,18 @@
<span class="text-field-right" :title="queryForm.targetMarket_dictText" <span class="text-field-right" :title="queryForm.targetMarket_dictText"
>{{queryForm.targetMarket_dictText}}</span> >{{queryForm.targetMarket_dictText}}</span>
</div> </div>
<div class="text-field">
<span class="text-field-left" :title="$t('projectVersion')">{{$t('projectVersion')}}</span>
<span class="text-field-right" :title="queryForm.projectVersion"
>{{queryForm.projectVersion}}</span>
</div>
</div>
<div class="content-text">
<div class="text-field"> <div class="text-field">
<span class="text-field-left" :title="$t('projectStatus')">{{$t('projectStatus')}}</span> <span class="text-field-left" :title="$t('projectStatus')">{{$t('projectStatus')}}</span>
<span class="text-field-right" :title="queryForm.projectStatus_dictText" <span class="text-field-right" :title="queryForm.projectStatus_dictText"
>{{queryForm.projectStatus_dictText}}</span> >{{queryForm.projectStatus_dictText}}</span>
</div> </div>
</div>
<div class="content-text">
<div class="text-field"> <div class="text-field">
<span class="text-field-left" :title="$t('DigitalPlatform')">{{$t('DigitalPlatform')}}</span> <span class="text-field-left" :title="$t('DigitalPlatform')">{{$t('DigitalPlatform')}}</span>
<span class="text-field-right" :title="queryForm.digitalPlatform" <span class="text-field-right" :title="queryForm.digitalPlatform"
@@ -43,17 +48,10 @@
</div> </div>
<div class="content-text"> <div class="content-text">
<div class="text-field"> <div class="text-field">
<span class="text-field-left" :title="$t('StudioEngineer')">{{$t('StudioEngineer')}}</span> <span class="text-field-left" :title="$t('softwareVersion')">{{$t('softwareVersion')}}</span>
<span class="text-field-right" :title="queryForm.studioEngineerName" <span class="text-field-right" :title="queryForm.softwareVersion"
>{{queryForm.studioEngineerName}}</span> >{{queryForm.softwareVersion}}</span>
</div> </div>
<div class="text-field">
<span class="text-field-left" :title="$t('certifiedEngineer')">{{$t('certifiedEngineer')}}</span>
<span class="text-field-right" :title="queryForm.certificationEngineerName"
>{{queryForm.certificationEngineerName}}</span>
</div>
</div>
<div class="content-text">
<div class="text-field"> <div class="text-field">
<span class="text-field-left" :title="$t('IPDInformation')">{{$t('IPDInformation')}}</span> <span class="text-field-left" :title="$t('IPDInformation')">{{$t('IPDInformation')}}</span>
<span class="text-field-right text-field-right-color" <span class="text-field-right text-field-right-color"
@@ -61,6 +59,8 @@
@click="urlClick(queryForm.ipdInfo)" @click="urlClick(queryForm.ipdInfo)"
>{{queryForm.ipdInfo}}</span> >{{queryForm.ipdInfo}}</span>
</div> </div>
</div>
<div class="content-text">
<div class="text-field"> <div class="text-field">
<span class="text-field-left" :title="$t('certificationProgram')">{{$t('certificationProgram')}}</span> <span class="text-field-left" :title="$t('certificationProgram')">{{$t('certificationProgram')}}</span>
<span class="text-field-right text-field-right-color" <span class="text-field-right text-field-right-color"
@@ -77,16 +77,38 @@
</div> </div>
</div> </div>
<div class="content-text"> <div class="content-text">
<div class="text-field" style="width: 50%"> <div class="text-field-content">
<span class="text-field-left" :title="$t('ListOfRelevantPersonnel')">{{$t('ListOfRelevantPersonnel')}}</span> <span class="text-field-left" :title="$t('explain')">{{$t('explain')}}</span>
<span class="text-field-right" :title="queryForm.explanation"
>{{queryForm.explanation}}</span>
</div>
</div>
<div class="content-text">
<div class="text-field">
<span class="text-field-left" :title="$t('StudioEngineer')">{{$t('StudioEngineer')}}</span>
<span class="text-field-right" :title="queryForm.studioEngineerName"
>{{queryForm.studioEngineerName}}</span>
</div>
<div class="text-field">
<span class="text-field-left" :title="$t('certifiedEngineer')">{{$t('certifiedEngineer')}}</span>
<span class="text-field-right" :title="queryForm.certificationEngineerName"
>{{queryForm.certificationEngineerName}}</span>
</div>
<div class="text-field">
<span class="text-field-left" style="float: left;margin-top: 3px" :title="$t('ListOfRelevantPersonnel')">{{$t('ListOfRelevantPersonnel')}}</span>
<span class="text-field-right" <span class="text-field-right"
> >
<a-button type="primary" v-has="'projectRelatedPersonnel:page'" class="button-text" <a-button type="primary" v-has="'projectRelatedPersonnel:page'"
:title="$t('ListOfRelevantPersonnel')"
class="button-text"
@click="ListOfRelevantPersonnelClick"> @click="ListOfRelevantPersonnelClick">
{{$t('ListOfRelevantPersonnel')}} {{$t('ListOfRelevantPersonnel')}}
</a-button> </a-button>
</span> </span>
</div> </div>
</div>
<div class="content-text">
</div> </div>
<div class="box-text"> <div class="box-text">
<div class="header-text"> <div class="header-text">
@@ -114,21 +136,21 @@
</div> </div>
<div class="process-content-right-xian"></div> <div class="process-content-right-xian"></div>
</div> </div>
<a-tabs style="margin-top: 20px" v-model="activeKey" class="ant-tabs"> <!-- <a-tabs style="margin-top: 20px" v-model="activeKey" class="ant-tabs">-->
<a-tab-pane :key="$t('CurrentStatusOfTheProject')" :tab="$t('CurrentStatusOfTheProject')"> <!-- <a-tab-pane :key="$t('CurrentStatusOfTheProject')" :tab="$t('CurrentStatusOfTheProject')">-->
<currentStatusOfTheProjectEcharts @currentStatus="currentStatus" <!-- <currentStatusOfTheProjectEcharts @currentStatus="currentStatus"-->
v-if="activeKey == $t('CurrentStatusOfTheProject')"/> <!-- v-if="activeKey == $t('CurrentStatusOfTheProject')"/>-->
</a-tab-pane> <!-- </a-tab-pane>-->
<a-tab-pane :key="$t('DeliverableStatus')" :tab="$t('DeliverableStatus')"> <!-- <a-tab-pane :key="$t('DeliverableStatus')" :tab="$t('DeliverableStatus')">-->
<deliverableStatusEchart @currentStatus="currentStatus" v-if="activeKey == $t('DeliverableStatus')"/> <!-- <deliverableStatusEchart @currentStatus="currentStatus" v-if="activeKey == $t('DeliverableStatus')"/>-->
</a-tab-pane> <!-- </a-tab-pane>-->
<a-tab-pane :key="$t('CertificationProgress')" :tab="$t('CertificationProgress')"> <!-- <a-tab-pane :key="$t('CertificationProgress')" :tab="$t('CertificationProgress')">-->
<certificationProgressEchart @currentStatus="currentStatus" v-if="activeKey == $t('CertificationProgress')"/> <!-- <certificationProgressEchart @currentStatus="currentStatus" v-if="activeKey == $t('CertificationProgress')"/>-->
</a-tab-pane> <!-- </a-tab-pane>-->
<a-tab-pane :key="$t('Parametercollection')" :tab="$t('Parametercollection')"> <!-- <a-tab-pane :key="$t('Parametercollection')" :tab="$t('Parametercollection')">-->
<ParameterCollectionEchart @currentStatus="currentStatus" v-if="activeKey == $t('Parametercollection')"/> <!-- <ParameterCollectionEchart @currentStatus="currentStatus" v-if="activeKey == $t('Parametercollection')"/>-->
</a-tab-pane> <!-- </a-tab-pane>-->
</a-tabs> <!-- </a-tabs>-->
<listOfRelevantPersonnel ref="listOfRelevantPersonnelRef"/> <listOfRelevantPersonnel ref="listOfRelevantPersonnelRef"/>
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/> <addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
<settingList :url="url" ref="settingListRef" @settingListForm="settingListForm"/> <settingList :url="url" ref="settingListRef" @settingListForm="settingListForm"/>
@@ -189,9 +211,9 @@
} }
}) })
}, },
currentStatus(item) { // currentStatus(item) {
this.$emit('TaskListChange', item) // this.$emit('TaskListChange', item)
}, // },
getSetting() { getSetting() {
getAction(this.url.queryByProjectId, { projectId: this.$route.query.id }).then((res) => { getAction(this.url.queryByProjectId, { projectId: this.$route.query.id }).then((res) => {
if (res.success) { if (res.success) {
@@ -273,6 +295,35 @@
font-weight: 400; font-weight: 400;
} }
} }
.text-field-content {
width: 100%;
margin-bottom: 8px;
.text-field-left {
width: 124px;
display: inline-block;
font-size: 14px;
font-weight: 400;
color: #6F7385;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
float: left;
margin-right: 24px;
margin-top: 3px;
}
.text-field-right {
width: calc(100% - 200px);
display: inline-block;
font-size: 16px;
float: left;
word-break: break-word;
color: #040B29;
font-weight: 400;
}
}
} }
.process-content { .process-content {
@@ -354,4 +405,8 @@
height: 80px; height: 80px;
line-height: 80px; line-height: 80px;
} }
.button-text {
padding: 0 13px;
}
</style> </style>
@@ -84,11 +84,21 @@
/> />
</div> </div>
<!-- 参数模板--> <!-- 参数模板-->
<a-modal v-model="areaVisible" :maskClosable="false" :title="$t('parameterTemplate')" width='750px' :footer="null"> <a-drawer
:visible="areaVisible"
:maskClosable="false"
@close="handleCancel"
:title="areaTitle"
width='850px'
style="height: 100%;overflow: auto;padding-bottom: 53px;"
placement="right"
:footer="null">
<parameter-template-add :url='url' ref='templateRef' v-if='areaVisible' @areaVisible='handleCancel' <parameter-template-add :url='url' ref='templateRef' v-if='areaVisible' @areaVisible='handleCancel'
:version='version' :version='version'
:projectId='this.$route.query.id'></parameter-template-add> :projectId='this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id'>
</a-modal>
</parameter-template-add>
</a-drawer>
<!-- 配置--> <!-- 配置-->
<configure ref="configureRef" :url='url' :itemId='itemId' :itemRow='itemRow'/> <configure ref="configureRef" :url='url' :itemId='itemId' :itemRow='itemRow'/>
<!-- 历史版本--> <!-- 历史版本-->
@@ -96,12 +106,23 @@
<historical-version v-if='historicalVisible' :historicalRow='historicalRow'></historical-version> <historical-version v-if='historicalVisible' :historicalRow='historicalRow'></historical-version>
</a-modal> </a-modal>
<!-- 复制参数模板--> <!-- 复制参数模板-->
<a-modal class="show-drawer" :title="$t('Copyparameterlist')" width="700px" v-model="drawerVisible" :footer="null"> <a-drawer
class="show-drawer"
:maskClosable="false"
:visible="drawerVisible"
style="height: 100%;overflow: auto;padding-bottom: 53px;"
placement="right"
@close="drawerhandleCancel"
:title="$t('Copyparameterlist')"
width="850px"
:footer="null">
<project-collection-parameters v-if='drawerVisible' @areaVisible='drawerhandleCancel' <project-collection-parameters v-if='drawerVisible' @areaVisible='drawerhandleCancel'
:templateTitle='templatetitle' @copysubmit='copysubmit' :templateTitle='templatetitle' @copysubmit='copysubmit'
:selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version' :url='url' :selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version' :url='url'
:projectId='this.$route.query.id'></project-collection-parameters> :projectId='this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id'>
</a-modal>
</project-collection-parameters>
</a-drawer>
</a-card> </a-card>
</template> </template>
@@ -151,6 +172,13 @@
ellipsis: true, ellipsis: true,
dataIndex: 'paramsTemplateName' dataIndex: 'paramsTemplateName'
}, },
{
title: this.$t('relatedProjectVersion'),
align: 'center',
width: 120,
ellipsis: true,
dataIndex: 'projectVersion'
},
{ {
title: this.$t('collectionCompletionTime'), title: this.$t('collectionCompletionTime'),
align: 'center', align: 'center',
@@ -214,6 +242,7 @@
selectedRowKeysArray: '', selectedRowKeysArray: '',
templatetitle: '', templatetitle: '',
templatetitleId: '', templatetitleId: '',
areaTitle:'',
rowId: '', rowId: '',
version: 0, version: 0,
itemId: '', // 配置id itemId: '', // 配置id
@@ -237,8 +266,8 @@
//处理接收到的消息 //处理接收到的消息
handler: function(res) { handler: function(res) {
let that = this let that = this
if (res.data == '1'){ if (res.data == '1') {
this.getlist() this.getlist()
} }
} }
} }
@@ -255,8 +284,8 @@
// localStorage.setItem('paramsManifest', JSON.stringify(item)) // localStorage.setItem('paramsManifest', JSON.stringify(item))
let newUrl = _this.$router.resolve({ let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection', path: '/ParameterItemCollection',
query: item query: item
// projectName:this.$route.query.projectName // projectName:this.$route.query.projectName
}) })
window.open(newUrl.href, '_blank') window.open(newUrl.href, '_blank')
} else { } else {
@@ -299,12 +328,12 @@
this.$refs.configureRef.addModel(item.id, item) this.$refs.configureRef.addModel(item.id, item)
}, },
handleCancel(val) { handleCancel(val) {
this.areaVisible = val this.areaVisible = false
this.getlist() this.getlist()
}, },
// 项目收集参数 // 项目收集参数
drawerhandleCancel(val) { drawerhandleCancel(val) {
this.drawerVisible = val this.drawerVisible = false
}, },
copysubmit() { copysubmit() {
this.drawerVisible = false this.drawerVisible = false
@@ -326,11 +355,13 @@
}, },
edit(edit) { edit(edit) {
this.areaVisible = true this.areaVisible = true
this.areaTitle = this.$t('editDetailList')
setTimeout(() => { setTimeout(() => {
this.$refs.templateRef.editData(edit) this.$refs.templateRef.editData(edit)
}, 50) }, 50)
}, },
handleAdd() { handleAdd() {
this.areaTitle = this.$t('addDetailList')
this.areaVisible = true this.areaVisible = true
}, },
// 变更扩展 // 变更扩展
@@ -402,7 +433,7 @@
}, },
getlist() { getlist() {
let query = { let query = {
projectId: this.$route.query.id, projectId: this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id,
pageSize: this.pageSize, pageSize: this.pageSize,
pageNo: this.pageNo, pageNo: this.pageNo,
...this.queryParam ...this.queryParam
@@ -561,13 +592,14 @@
text-justify: inter-ideograph; text-justify: inter-ideograph;
word-break: break-all word-break: break-all
} }
::v-deep .ant-table-row:first-child { ::v-deep .ant-table-row:first-child {
background: #fff!important; background: #fff !important;
opacity: 0.95; opacity: 0.95;
} }
::v-deep .ant-table-body { ::v-deep .ant-table-body {
background: transparent!important; background: transparent !important;
} }
</style> </style>
<style> <style>
@@ -69,6 +69,22 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('projectVersion')">{{$t('projectVersion')}}</span>
</div>
<a-form-model-item class="itemModel" prop="projectVersion">
<a-input class="box-input"
:disabled="true"
v-model="formInline.projectVersion"
:placeholder="$t('PleaseEnter')+$t('projectVersion')"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
@@ -85,8 +101,6 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
@@ -104,6 +118,8 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
@@ -120,8 +136,6 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
@@ -135,6 +149,8 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
@@ -148,8 +164,6 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
@@ -165,6 +179,8 @@
<!-- ^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?$ <!-- ^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?$
--> -->
</a-col> </a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
@@ -179,8 +195,6 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
@@ -195,6 +209,36 @@
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('softwareVersion')">{{$t('softwareVersion')}}</span>
</div>
<a-form-model-item class="itemModel" :prop="'softwareVersion'">
<a-input class="box-input"
:disabled="disabled"
v-model="formInline.softwareVersion"
:placeholder="$t('PleaseEnter')+$t('softwareVersion')"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('explain')">{{$t('explain')}}</span>
</div>
<a-form-model-item class="itemModel" prop="explanation">
<a-textarea :placeholder="$t('pleaseEnter')+$t('explain')"
v-model="formInline.explanation"
:rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model> </a-form-model>
</a-spin> </a-spin>
<div class="drawer-bootom-button"> <div class="drawer-bootom-button">
@@ -244,6 +288,13 @@
trigger: 'blur' trigger: 'blur'
} }
], ],
explanation: [
{
max: 500,
message: this.$t('explain') + this.$t('cannotExceed') + 500 + this.$t('Characters'),
trigger: 'blur'
}
],
attestationPlan: [ attestationPlan: [
{ {
pattern: /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%$#_]*)?/, pattern: /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%$#_]*)?/,
@@ -269,6 +320,13 @@
trigger: 'blur' trigger: 'blur'
} }
], ],
softwareVersion:[
{
max: 300,
message: this.$t('softwareVersion') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
projectNameId: [ projectNameId: [
{ {
required: true, required: true,
@@ -351,6 +409,7 @@
this.getNameList() this.getNameList()
this.formInline.studioEngineerName = this.userInfo().username this.formInline.studioEngineerName = this.userInfo().username
this.formInline.studioEngineer = this.userInfo().id this.formInline.studioEngineer = this.userInfo().id
this.formInline.projectVersion = '00'
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ruleForm.clearValidate() this.$refs.ruleForm.clearValidate()
@@ -33,6 +33,12 @@
components: { components: {
responsibilityList responsibilityList
}, },
props: {
idList: {
type: Array,
default: []
}
},
data() { data() {
return { return {
loading: false, loading: false,
@@ -79,7 +85,13 @@
this.$emit('currentStatus', item) this.$emit('currentStatus', item)
}, },
getData() { getData() {
getAction(this.url.getProjectDetailsStatistics, { id: this.$route.query.id }).then((res) => { let id = ''
if (this.idList && this.idList.length > 0) {
id = this.idList.join(',')
} else {
id = this.$route.query.id
}
getAction(this.url.getProjectDetailsStatistics, { id: id }).then((res) => {
if (res.success) { if (res.success) {
if (res.result) { if (res.result) {
let certificationProgressMap = res.result.certificationProgressMap ? res.result.certificationProgressMap.certificationProgressMapList : [] let certificationProgressMap = res.result.certificationProgressMap ? res.result.certificationProgressMap.certificationProgressMapList : []
@@ -40,6 +40,12 @@
components: { components: {
responsibilityList responsibilityList
}, },
props: {
idList: {
type: Array,
default: []
}
},
data() { data() {
return { return {
loading: false, loading: false,
@@ -77,7 +83,13 @@
}, },
methods: { methods: {
getData() { getData() {
getAction(this.url.getProjectDetailsStatistics, { id: this.$route.query.id }).then((res) => { let id = ''
if (this.idList && this.idList.length > 0) {
id = this.idList.join(',')
} else {
id = this.$route.query.id
}
getAction(this.url.getProjectDetailsStatistics, { id: id }).then((res) => {
if (res.success) { if (res.success) {
if (res.result) { if (res.result) {
let dataSource = res.result.currentProjectStatusMap ? res.result.currentProjectStatusMap.currentProjectStatusMapList : [] let dataSource = res.result.currentProjectStatusMap ? res.result.currentProjectStatusMap.currentProjectStatusMapList : []
@@ -36,6 +36,12 @@
components: { components: {
responsibilityList responsibilityList
}, },
props: {
idList: {
type: Array,
default: []
}
},
data() { data() {
return { return {
url: { url: {
@@ -52,10 +58,15 @@
}, },
methods: { methods: {
getData() { getData() {
getAction(this.url.getProjectDetailsStatistics, { id: this.$route.query.id }).then((res) => { let id = ''
if (this.idList && this.idList.length > 0) {
id = this.idList.join(',')
} else {
id = this.$route.query.id
}
getAction(this.url.getProjectDetailsStatistics, { id: id }).then((res) => {
if (res.success) { if (res.success) {
if (res.result) { if (res.result) {
let listingToConfirmMap = res.result.listingToConfirmMap ? res.result.listingToConfirmMap.listingToConfirmMapList : [] let listingToConfirmMap = res.result.listingToConfirmMap ? res.result.listingToConfirmMap.listingToConfirmMapList : []
let taskToConfirmMap = res.result.taskToConfirmMap ? res.result.taskToConfirmMap.taskToConfirmMapList : [] let taskToConfirmMap = res.result.taskToConfirmMap ? res.result.taskToConfirmMap.taskToConfirmMapList : []
let designComplianceMap = res.result.designComplianceMap ? res.result.designComplianceMap.designComplianceMapList : [] let designComplianceMap = res.result.designComplianceMap ? res.result.designComplianceMap.designComplianceMapList : []
@@ -67,7 +78,6 @@
this.dataEchartsOne(prehomoMap, 2) this.dataEchartsOne(prehomoMap, 2)
this.dataEchartsOne(verifyComplianceMap, 3) this.dataEchartsOne(verifyComplianceMap, 3)
} }
} }
}) })
}, },
@@ -0,0 +1,84 @@
<template>
<a-card :bordered="false">
<div class="table-operator" style="margin-bottom: 10px">
<div @click="versionStatisticsClick" v-if="!this.$route.query.parentId"
class="operator-text">
<a-icon type="plus"/>
{{$t('versionStatistics')}}
</div>
</div>
<a-tabs v-model="activeKey" class="ant-tabs">
<a-tab-pane :key="$t('CurrentStatusOfTheProject')" :tab="$t('CurrentStatusOfTheProject')">
<currentStatusOfTheProjectEcharts @currentStatus="currentStatus"
:idList="idList"
v-if="activeKey == $t('CurrentStatusOfTheProject')"/>
</a-tab-pane>
<a-tab-pane :key="$t('DeliverableStatus')" :tab="$t('DeliverableStatus')">
<deliverableStatusEchart @currentStatus="currentStatus" :idList="idList"
v-if="activeKey == $t('DeliverableStatus')"/>
</a-tab-pane>
<a-tab-pane :key="$t('CertificationProgress')" :tab="$t('CertificationProgress')">
<certificationProgressEchart @currentStatus="currentStatus" :idList="idList"
v-if="activeKey == $t('CertificationProgress')"/>
</a-tab-pane>
<a-tab-pane :key="$t('Parametercollection')" :tab="$t('Parametercollection')">
<ParameterCollectionEchart @currentStatus="currentStatus" :idList="idList"
v-if="activeKey == $t('Parametercollection')"/>
</a-tab-pane>
</a-tabs>
<versionStatistics ref="versionStatisticsRef" @versionStatisticsForm="versionStatisticsForm"/>
</a-card>
</template>
<script>
import currentStatusOfTheProjectEcharts from './currentStatusOfTheProjectEcharts'
import deliverableStatusEchart from './deliverableStatusEchart'
import ParameterCollectionEchart from './ParameterCollectionEchart'
import certificationProgressEchart from './certificationProgressEchart'
import versionStatistics from './versionStatistics'
import { getAction, postAction } from '@/api/manage'
export default {
name: 'projectStatus',
components: {
ParameterCollectionEchart,
currentStatusOfTheProjectEcharts,
deliverableStatusEchart,
certificationProgressEchart,
versionStatistics
},
data() {
return {
activeKey: this.$t('CurrentStatusOfTheProject'),
selectedRowKeys: [],
idList: []
}
},
methods: {
currentStatus(item) {
this.$emit('TaskListChange', item)
},
versionStatisticsClick() {
this.$refs.versionStatisticsRef.addModel(JSON.parse(JSON.stringify(this.selectedRowKeys)))
},
versionStatisticsForm(value) {
this.idList = []
let activeKey = JSON.parse(JSON.stringify(this.activeKey))
this.activeKey = ''
if (value && value.length > 0) {
value.forEach(res => {
this.idList.push(JSON.parse(res).id)
})
}
this.selectedRowKeys = JSON.parse(JSON.stringify(value))
this.$nextTick(() => {
this.activeKey = activeKey
})
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,212 @@
<template>
<a-drawer
:title="$t('versionStatistics')"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<div style="margin-bottom: 60px">
<!-- <div class="table-page-search-wrapper">-->
<!-- <a-form layout="inline" @keyup.enter.native="searchQuery">-->
<!-- <a-row :gutter="24">-->
<!-- <a-col :md="12" :sm="8">-->
<!-- <div class="box-title-text">-->
<!-- <div class="title-text" :title="$t('standard')">-->
<!-- <span>{{$t('standard')}}</span>-->
<!-- </div>-->
<!-- <a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"-->
<!-- v-model="queryParam.serial_number"></a-input>-->
<!-- </div>-->
<!-- </a-col>-->
<!-- <span style="float: right;overflow: hidden;" class="table-page-search-submitButtons">-->
<!-- <a-col :md="12" :sm="24">-->
<!-- <a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>-->
<!-- <a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>-->
<!-- </a-col>-->
<!-- </span>-->
<!-- </a-row>-->
<!-- </a-form>-->
<!-- </div>-->
<a-table
:columns="columns"
:rowKey="(record)=>JSON.stringify(record)"
:scroll="{x: '100%',y:500}"
:data-source="dataList"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:loading="loading">
</a-table>
<div class="page" v-if="dataList.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="onChange"
@showSizeChange="SizeChange"
/>
</div>
</div>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
export default {
name: 'versionStatistics',
data() {
return {
visible: false,
queryParam: {},
confirmLoading: false,
selectedRowKeys: [],
columns: [
{
title: this.$t('VersionNumber'),
dataIndex: 'projectVersion',
align: 'center',
ellipsis: true,
width: 200
},
{
title: this.$t('describe'),
dataIndex: 'explanation',
align: 'center',
ellipsis: true,
width: 500
}
],
dataList: [],
loading: false,
pageNo: 1,
pageSize: 10,
total: 0,
url: {
list: '/project/projectLibraryBase/versionStatistics'
}
}
},
mounted() {
},
methods: {
addModel(value) {
this.visible = true
this.queryParam = {}
this.selectedRowKeys = JSON.parse(JSON.stringify(value))
this.replacePage()
},
searchQuery() {
this.pageNo = 1
this.replacePage()
},
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.replacePage()
},
onChange(page, pageSize) {
this.pageNo = page
this.replacePage()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.replacePage()
},
replacePage() {
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
id:this.$route.query.id,
...this.queryParam
}
this.loading = true
postAction(this.url.list, query).then((res) => {
if (res.success) {
this.dataList = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.dataList = []
this.total = 0
this.loading = false
}
})
},
onSelectChange(value) {
this.selectedRowKeys = value
},
handleCancel() {
this.visible = false
},
handleSubmit() {
this.$emit('versionStatisticsForm', this.selectedRowKeys)
this.visible = false
}
}
}
</script>
<style scoped>
.page {
text-align: right;
margin-top: 20px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 33px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 100%;
height: 38px;
}
.box-button {
height: 38px;
}
</style>
@@ -10,19 +10,75 @@
:wrapper-col='wrapperCol' :wrapper-col='wrapperCol'
> >
<a-row :gutter='24'> <a-row :gutter='24'>
<a-col :span='9'> <a-col :span='11'>
<a-form-model-item class="itemAddAdmin" :label="$t('title')" prop='title'> <div class="box-title-text">
<a-input style='width: 420px' <div class="title-text">
class='box-input' <span class="Required">*</span>
:placeholder="$t('PleaseEnter')+$t('title')" <span class="title-text-text" :title="$t('title')">{{$t('title')}}</span>
v-model='formData.title'/> </div>
</a-form-model-item> <a-form-model-item class="itemModel" :prop='title'>
<!-- <a-input class="box-input"-->
<!-- :disabled="disabled"-->
<!-- v-model="formInline[item.db_field_name]"-->
<!-- :placeholder="$t('PleaseEnter')+item.db_field_txt"/>-->
<!-- <a-input-->
<!-- :placeholder="$t('PleaseEnter')+$t('parameterTemplate')"-->
<!-- v-model='form.paramsTemplateName'/>-->
<a-input class="box-input"
:placeholder="$t('PleaseEnter')+$t('title')"
v-model='formData.title'/>
</a-form-model-item>
</div>
<!-- <a-form-model-item class="itemAddAdmin" :label="$t('title')" prop='title'>-->
<!-- <a-input style='width: 420px'-->
<!-- :placeholder="$t('PleaseEnter')+$t('title')"-->
<!-- v-model='formData.title'/>-->
<!-- </a-form-model-item>-->
</a-col>
<a-col :span='11'>
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('relatedProjectVersion')">{{$t('relatedProjectVersion')}}</span>
</div>
<a-form-model-item class="itemModel" style="height: 40px">
<a-select mode="multiple"
class="box-input"
style="width: 100%"
v-model='formData.projectVersion'
:placeholder="$t('PleaseSelect')+$t('relatedProjectVersion')">
<!-- <a-select-option :value="null">{{$t('pleaseSelect')}}</a-select-option>-->
<a-select-option v-for="(item, key) in projectVersionList"
:key="key"
:label="item"
:value="item">
<span class="itemOption" :title=" item ">
{{ item }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</div>
</a-col> </a-col>
<!-- <a-col :span='9'>--> <!-- <a-col :span='9'>-->
<!-- </a-col>--> <!-- </a-col>-->
<!-- <a-col :span='6'>--> <!-- <a-col :span='6'>-->
<!-- </a-col>--> <!-- </a-col>-->
</a-row> </a-row>
<a-row :gutter="24" style="border-bottom: 1px #f5f5f5 solid;margin-bottom: 10px">
<a-col :span="22">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('explain')">{{$t('explain')}}</span>
</div>
<a-form-model-item class="itemModel" prop="explanation">
<a-textarea
:placeholder="$t('PleaseEnter')+$t('explain')"
v-model.trim="formData.explanation" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter='24'> <a-row :gutter='24'>
<a-col :span='9'> <a-col :span='9'>
<div class="box-title-text"> <div class="box-title-text">
@@ -94,11 +150,11 @@
:dataSource='areaTable' :dataSource='areaTable'
:pagination='false' :pagination='false'
:loading='loading' :loading='loading'
:scroll='{x: 600,y:300}' :scroll='{x: 600,y:400}'
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
@change='handleTableChange'> @change='handleTableChange'>
</a-table> </a-table>
<div class="page" style='display: flex;justify-content: flex-end; margin-bottom: 15px'> <div class="page" style='display: flex;justify-content: flex-end; margin-bottom: 42px'>
<a-pagination <a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')" :show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper show-quick-jumper
@@ -145,6 +201,7 @@
ellipsis: true ellipsis: true
} }
], ],
projectVersionList: [],
newVisible: false, newVisible: false,
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
@@ -164,6 +221,13 @@
message: this.$t('title') + this.$t('cannotExceed') + 200 + this.$t('Characters'), message: this.$t('title') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur' trigger: 'blur'
} }
],
explanation: [
{
max: 500,
message: this.$t('explain') + this.$t('cannotExceed') + 500 + this.$t('Characters'),
trigger: 'blur'
}
] ]
}, },
areaTable: [], areaTable: [],
@@ -195,8 +259,21 @@
}, },
mounted() { mounted() {
this.loadData() this.loadData()
this.getProjectVersion()
}, },
methods: { methods: {
getProjectVersion() {
let query = {
id: this.projectId
}
getAction('/project/projectLibraryBase/getVersionsInfo', query).then((res) => {
if (res.success) {
this.projectVersionList = res.result || []
} else {
this.projectVersionList = []
}
})
},
pageOnChange(page, pageSize) { pageOnChange(page, pageSize) {
this.pageNo = page this.pageNo = page
this.loadData() this.loadData()
@@ -246,9 +323,15 @@
}, },
editData(edit) { editData(edit) {
// 编辑一行的数据 // 编辑一行的数据
this.row = edit let query = JSON.parse(JSON.stringify(edit))
this.formData = { ...edit } if (query.projectVersion) {
this.selectedRowKeys = edit.paramsTemplateId.split(',') query.projectVersion = query.projectVersion.split(',')
}else{
query.projectVersion = []
}
this.row = query
this.formData = { ...query }
this.selectedRowKeys = query.paramsTemplateId.split(',')
}, },
//新增 //新增
handleSubmit() { handleSubmit() {
@@ -267,10 +350,17 @@
this.confirmLoading = true this.confirmLoading = true
let postDate = { let postDate = {
title: this.formData.title, title: this.formData.title,
projectVersion: this.formData.projectVersion,
explanation: this.formData.explanation,
paramsTemplateId: this.paramsTemplateId || this.selectedRowKeys[0], paramsTemplateId: this.paramsTemplateId || this.selectedRowKeys[0],
paramsTemplatePublishVersion: this.row.version || this.selectedRowKeysDate[0].version, paramsTemplatePublishVersion: this.row.version || this.selectedRowKeysDate[0].version,
projectId: this.projectId projectId: this.projectId
} }
Object.keys(postDate).forEach(res => {
if (postDate[res] && postDate[res] instanceof Array) {
postDate[res] = postDate[res].join(',')
}
})
if (this.formData.id) { if (this.formData.id) {
//编辑 //编辑
postDate = { postDate = {
@@ -377,8 +467,16 @@
} }
.drawer-bootom-button { .drawer-bootom-button {
display: flex; position: absolute;
justify-content: flex-end; bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
z-index: 100;
background: #fff;
border-radius: 0 0 2px 2px;
} }
.Required { .Required {
@@ -393,7 +491,7 @@
} }
.title-text { .title-text {
width: 85px; width: 84px;
text-align: right; text-align: right;
display: inline-block; display: inline-block;
font-weight: 500; font-weight: 500;
@@ -413,10 +511,10 @@
} }
.itemModel { .itemModel {
width: calc(100% - 101px); width: calc(100% - 100px);
display: inline-block; display: inline-block;
margin-top: 2px; margin-top: 2px;
height: 40px; /*height: 40px;*/
margin-bottom: 24px; margin-bottom: 24px;
} }
@@ -473,6 +571,15 @@
.box-button { .box-button {
height: 38px; height: 38px;
} }
.itemOption {
display: inline-block;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
</style> </style>
<style lang='less'> <style lang='less'>
.area-module { .area-module {
@@ -10,29 +10,80 @@
:wrapper-col='wrapperCol' :wrapper-col='wrapperCol'
> >
<a-row :gutter='24'> <a-row :gutter='24'>
<a-col :span='8'> <a-col :span='11'>
<a-form-model-item :label="$t('title')" prop='title'> <div class="box-title-text">
<a-input style='width: 420px' <div class="title-text">
:placeholder="$t('PleaseEnter')+$t('title')" <span class="Required">*</span>
v-model='formData.title' /> <span class="title-text-text" :title="$t('title')">{{$t('title')}}</span>
</a-form-model-item> </div>
<a-form-model-item class="itemModel" :prop='title'>
<a-input class="box-input"
:placeholder="$t('PleaseEnter')+$t('title')"
v-model='formData.title'/>
</a-form-model-item>
</div>
</a-col> </a-col>
<a-col :span='9'> <a-col :span='11'>
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('relatedProjectVersion')">{{$t('relatedProjectVersion')}}</span>
</div>
<a-form-model-item class="itemModel" style="height: 40px">
<a-select mode="multiple"
class="box-input"
style="width: 100%"
v-model='formData.projectVersion'
:placeholder="$t('PleaseSelect')+$t('relatedProjectVersion')">
<!-- <a-select-option :value="null">{{$t('pleaseSelect')}}</a-select-option>-->
<a-select-option v-for="(item, key) in projectVersionList"
:key="key"
:label="item"
:value="item">
<span class="itemOption" :title=" item ">
{{ item }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</div>
</a-col> </a-col>
<a-col :span='7'> </a-row>
<a-row :gutter="24" style="border-bottom: 1px #f5f5f5 solid;margin-bottom: 10px">
<a-col :span="22">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('explain')">{{$t('explain')}}</span>
</div>
<a-form-model-item class="itemModel" prop="explanation">
<a-textarea
:placeholder="$t('PleaseEnter')+$t('explain')"
v-model.trim="formData.explanation" :rows="4"/>
</a-form-model-item>
</div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter='24'> <a-row :gutter='24'>
<a-col :span='8'> <a-col :span='11'>
<a-form-model-item :label="$t('entryName')" prop='projectName'> <div class="box-title-text">
<a-input style='width: 420px' <div class="title-text">
:placeholder="$t('PleaseEnter')+$t('entryName')" <span class="title-text-text" :title="$t('entryName')">{{$t('entryName')}}</span>
v-model='formData.projectName' /> </div>
</a-form-model-item> <a-form-model-item class="itemModel">
<a-input class="box-input"
:placeholder="$t('PleaseEnter')+$t('entryName')"
v-model='formData.projectName'/>
</a-form-model-item>
</div>
</a-col> </a-col>
<a-col :span='9'> <!-- <a-col :span='8'>-->
</a-col> <!-- <a-form-model-item :label="$t('entryName')" prop='projectName'>-->
<a-col :span='7' style='margin-top: 4px;padding-left: 20px'> <!-- <a-input style='width: 420px'-->
<!-- :placeholder="$t('PleaseEnter')+$t('entryName')"-->
<!-- v-model='formData.projectName'/>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span='11' style="margin-top: 5px">
<a-button class='box-button' type='primary' @click='searchQuery'>{{ $t('query') }}</a-button> <a-button class='box-button' type='primary' @click='searchQuery'>{{ $t('query') }}</a-button>
<a-button class='box-button' style='margin-left: 8px' @click='searchReset'>{{ $t('reset') }}</a-button> <a-button class='box-button' style='margin-left: 8px' @click='searchReset'>{{ $t('reset') }}</a-button>
</a-col> </a-col>
@@ -48,7 +99,7 @@
:dataSource='areaTable' :dataSource='areaTable'
:pagination='false' :pagination='false'
:loading='loading' :loading='loading'
:scroll='{x: 600}' :scroll='{x: 600,y:400}'
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
@change='handleTableChange'> @change='handleTableChange'>
<span slot='click' slot-scope='text, record'> <span slot='click' slot-scope='text, record'>
@@ -60,7 +111,7 @@
</span> </span>
</a-table> </a-table>
<div class="page" style='display: flex;justify-content: flex-end;'> <div class="page" style='display: flex;justify-content: flex-end;margin-bottom: 43px'>
<a-pagination <a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')" :show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper show-quick-jumper
@@ -78,311 +129,405 @@
</div> </div>
<!-- 清单弹框 --> <!-- 清单弹框 -->
<a-modal v-model="listVisible" :title="$t('parameterTemplate')" width='700px' :footer="null"> <a-modal v-model="listVisible" :title="$t('parameterTemplate')" width='700px' :footer="null">
<parameter-template v-if='listVisible' @areaVisible='drawerhandleCancel' @listVisibleRow='listVisibleRow'></parameter-template> <parameter-template v-if='listVisible' @areaVisible='drawerhandleCancel'
@listVisibleRow='listVisibleRow'></parameter-template>
</a-modal> </a-modal>
</div> </div>
</template> </template>
<script> <script>
import { putAction, postAction, getAction, deleteAction } from '@/api/manage' import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
import axios from 'axios' import axios from 'axios'
import Vue from 'vue' import Vue from 'vue'
import ParameterTemplate from '../dialog/ParameterTemplate' import ParameterTemplate from '../dialog/ParameterTemplate'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
export default { export default {
name: 'ProjectCollectionParameters', name: 'ProjectCollectionParameters',
components: { components: {
ParameterTemplate ParameterTemplate
},
data() {
return {
token:Vue.ls.get(ACCESS_TOKEN),
title: this.$t('add'),
total: 0,
selectedRowKeysDate: {},
loading: false,
editId: '',
columns: [
{
title: this.$t('entryName'),
dataIndex: 'projectName',
key: 'showArea',
align: 'center',
ellipsis: true
},
{
title: this.$t('ListTitle'),
align: 'center',
dataIndex: 'title',
ellipsis: true
},
{
title: this.$t('parameterTemplate'),
align: 'center',
dataIndex: 'paramsTemplateName',
ellipsis: true,
scopedSlots: { customRender: 'parameterTemplateSlot' }
}
],
newVisible: false,
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
form: {},
formData: {},
rules: {
title: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('title'), trigger: 'blur' }
]
},
areaTable: [],
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false,
selectedRowKeys: [],
pageNo: 1,
pageSize: 10,
listVisible: false,
listVisibleRowDate: {}
}
},
props: {
version: {
type: Number,
default: '',
required: false
}, },
projectId: { data() {
type: String, return {
default: '', token: Vue.ls.get(ACCESS_TOKEN),
require: true title: this.$t('add'),
}, total: 0,
url: { selectedRowKeysDate: {},
type: Object, projectVersionList: [],
default: '', loading: false,
require: true editId: '',
} columns: [
}, {
mounted() { title: this.$t('entryName'),
this.loadData() dataIndex: 'projectName',
}, key: 'showArea',
methods: { align: 'center',
// 清单列表传出数据 ellipsis: true
listVisibleRow(val) { },
// this.selectedRowKeys = [] {
let newAreaTable=JSON.parse(JSON.stringify(this.areaTable)) title: this.$t('ListTitle'),
newAreaTable.forEach((item, index) => { align: 'center',
if( item.id == this.listVisibleRowDate.id ) { dataIndex: 'title',
let _obj = {...item} ellipsis: true
_obj.paramsTemplateId = val[0].id },
_obj.paramsTemplateName = val[0].paramsTemplateName {
this.areaTable.splice(index, 1,_obj) title: this.$t('parameterTemplate'),
align: 'center',
dataIndex: 'paramsTemplateName',
ellipsis: true,
scopedSlots: { customRender: 'parameterTemplateSlot' }
} }
}) ],
console.log(this.areaTable,'this.areaTable') newVisible: false,
this.listVisible = false labelCol: {
}, xs: { span: 24 },
parameterTemplateSlotHandler(val) { sm: { span: 7 }
this.listVisibleRowDate = val },
console.log(val) wrapperCol: {
this.listVisible = true xs: { span: 24 },
}, sm: { span: 14 }
pageOnChange(page, pageSize) { },
this.pageNo = page form: {},
this.loadData() formData: {},
}, rules: {
SizeChange(page, pageSize) { title: [
this.pageNo = 1 { required: true, message: this.$t('PleaseEnter') + this.$t('title'), trigger: 'blur' }
this.pageSize = pageSize ]
this.loadData() },
}, areaTable: [],
loadData() { flag: false, //表单提交标识
let _this = this spinLoading: false,
let params = { confirmLoading: false,
pageNo: this.pageNo, selectedRowKeys: [],
pageSize: this.pageSize, pageNo: 1,
...this.formData pageSize: 10,
listVisible: false,
listVisibleRowDate: {}
} }
this.loading = true },
axios({ props: {
url: `/jero-boot/params/manifest/getAllManifest`, version: {
method: 'post', type: Number,
data: params, default: '',
transformRequest: [function (data) { required: false
let ret = '' },
for (let it in data) { projectId: {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' type: String,
} default: '',
return ret require: true
}], },
headers: { url: {
'Content-Type': 'application/x-www-form-urlencoded', type: Object,
'X-Access-Token':_this.token default: '',
require: true
}
},
mounted() {
this.loadData()
this.getProjectVersion()
},
methods: {
getProjectVersion() {
let query = {
id: this.projectId
} }
}) getAction('/project/projectLibraryBase/getVersionsInfo', query).then((res) => {
.then( (res) =>{ if (res.success) {
if (res.data.success) { this.projectVersionList = res.result || []
console.log(res.data)
this.loading = false
this.areaTable = res.data.result.records || []
this.total = res.data.result.total
}else{
this.loading = false
}
})
.catch( (error) =>{
console.log(error);
});
},
searchQuery() {
this.loadData()
},
searchReset() {
this.formData = {}
this.loadData()
},
handleCancel() {
this.$emit('areaVisible', false)
},
drawerhandleCancel(val) {
this.listVisible = val
},
onSelectChange(selectedRowKeys, selectedRowKeysDate) {
this.selectedRowKeysDate = selectedRowKeysDate
this.selectedRowKeys = selectedRowKeys
},
handleTableChange(val) {
console.log(',,,')
},
showModal() {
this.title = this.$t('add')
this.newVisible = true
this.form = {}
},
//新增
handleSubmit() {
let _this = this
if (this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('pleaseSelectData'))
} else if (this.selectedRowKeys.length > 1) {
this.$message.warning(this.$t('OnlyOneSelected'))
} else {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag = true
this.spinLoading = true
this.confirmLoading = true
let _tt = {
paramsTemplateId: this.selectedRowKeysDate[0].paramsTemplateId,
projectId: this.projectId,
title: this.formData.title,
paramsTemplatePublishVersion: this.selectedRowKeysDate[0].paramsTemplatePublishVersion,
sourceManifestId: this.selectedRowKeysDate[0].id,
}
postAction('params/manifest/copy', _tt).then((res) => {
if (res.success) {
this.$emit('copysubmit')
this.$message.success(this.$t('Copysuccessful'))
this.flag = false
this.spinLoading = false
this.confirmLoading = false
} else {
this.$message.warning(this.$t('Copyfailed'))
this.flag = false
this.spinLoading = false
this.confirmLoading = false
}
})
// axios({
// url: `/jero-boot/params/manifest/copy`,
// method: 'post',
// data: _tt,
// transformRequest: [function (data) {
// let ret = ''
// for (let it in data) {
// ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
// }
// return ret
// }],
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// 'X-Access-Token':_this.token
// }
// })
// .then( (res) =>{
// if (res.data.success) {
// _this.$emit('copysubmit')
// _this.$message.success(res.data.message)
// _this.flag = false
// _this.spinLoading = false
// _this.confirmLoading = false
// }else{
// _this.$message.warning(res.data.message)
// _this.flag = false
// _this.spinLoading = false
// _this.confirmLoading = false
// }
// })
// .catch( (error) =>{
// console.log(error);
// });
} else { } else {
return false this.projectVersionList = []
} }
}) })
},
// 清单列表传出数据
listVisibleRow(val) {
// this.selectedRowKeys = []
let newAreaTable = JSON.parse(JSON.stringify(this.areaTable))
newAreaTable.forEach((item, index) => {
if (item.id == this.listVisibleRowDate.id) {
let _obj = { ...item }
_obj.paramsTemplateId = val[0].id
_obj.paramsTemplateName = val[0].paramsTemplateName
this.areaTable.splice(index, 1, _obj)
}
})
console.log(this.areaTable, 'this.areaTable')
this.listVisible = false
},
parameterTemplateSlotHandler(val) {
this.listVisibleRowDate = val
console.log(val)
this.listVisible = true
},
pageOnChange(page, pageSize) {
this.pageNo = page
this.loadData()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.loadData()
},
loadData() {
let _this = this
if (!this.formData.projectName){
this.formData.projectName = ''
}
let params = {
pageNo: this.pageNo,
pageSize: this.pageSize,
projectName:this.formData.projectName
}
this.loading = true
axios({
url: `/jero-boot/params/manifest/getAllManifest`,
method: 'post',
data: params,
transformRequest: [function(data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': _this.token
}
})
.then((res) => {
if (res.data.success) {
console.log(res.data)
this.loading = false
this.areaTable = res.data.result.records || []
this.total = res.data.result.total
} else {
this.loading = false
}
})
.catch((error) => {
console.log(error)
})
},
searchQuery() {
this.loadData()
},
searchReset() {
this.formData.projectName = ''
this.formData = {...this.formData}
this.loadData()
},
handleCancel() {
this.$emit('areaVisible', false)
},
drawerhandleCancel(val) {
this.listVisible = val
},
onSelectChange(selectedRowKeys, selectedRowKeysDate) {
this.selectedRowKeysDate = selectedRowKeysDate
this.selectedRowKeys = selectedRowKeys
},
handleTableChange(val) {
console.log(',,,')
},
showModal() {
this.title = this.$t('add')
this.newVisible = true
this.form = {}
},
//新增
handleSubmit() {
let _this = this
if (this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('pleaseSelectData'))
} else if (this.selectedRowKeys.length > 1) {
this.$message.warning(this.$t('OnlyOneSelected'))
} else {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag = true
this.spinLoading = true
this.confirmLoading = true
let formData = JSON.parse(JSON.stringify(this.formData))
Object.keys(formData).forEach(res => {
if (formData[res] && formData[res] instanceof Array) {
formData[res] = formData[res].join(',')
}
})
let _tt = {
paramsTemplateId: this.selectedRowKeysDate[0].paramsTemplateId,
projectId: this.projectId,
title: formData.title,
projectVersion: formData.projectVersion,
explanation: formData.explanation,
paramsTemplatePublishVersion: this.selectedRowKeysDate[0].paramsTemplatePublishVersion,
sourceManifestId: this.selectedRowKeysDate[0].id
}
postAction('params/manifest/copy', _tt).then((res) => {
if (res.success) {
this.$emit('copysubmit')
this.$message.success(this.$t('Copysuccessful'))
this.flag = false
this.spinLoading = false
this.confirmLoading = false
} else {
this.$message.warning(this.$t('Copyfailed'))
this.flag = false
this.spinLoading = false
this.confirmLoading = false
}
})
// axios({
// url: `/jero-boot/params/manifest/copy`,
// method: 'post',
// data: _tt,
// transformRequest: [function (data) {
// let ret = ''
// for (let it in data) {
// ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
// }
// return ret
// }],
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// 'X-Access-Token':_this.token
// }
// })
// .then( (res) =>{
// if (res.data.success) {
// _this.$emit('copysubmit')
// _this.$message.success(res.data.message)
// _this.flag = false
// _this.spinLoading = false
// _this.confirmLoading = false
// }else{
// _this.$message.warning(res.data.message)
// _this.flag = false
// _this.spinLoading = false
// _this.confirmLoading = false
// }
// })
// .catch( (error) =>{
// console.log(error);
// });
} else {
return false
}
})
}
} }
}, },
}, watch: {
watch: { selectedRowKeyS(val) {
selectedRowKeyS(val) { this.selectedRowKeys = val
this.selectedRowKeys = val }
} }
}
} }
</script> </script>
<style lang='less' scoped> <style lang='less' scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
.diolag-area { .diolag-area {
.table-area { .table-area {
margin: 20px 0; margin: 20px 0;
.action-edit { .action-edit {
margin-right: 10px; margin-right: 10px;
}
}
.table-del {
color: red;
} }
} }
.table-del { .drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
z-index: 100;
background: #fff;
border-radius: 0 0 2px 2px;
}
.Required {
color: red; color: red;
margin-right: 4px;
}
.Required {
color: red;
margin-right: 4px;
}
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 84px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 42px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 100px);
display: inline-block;
margin-top: 2px;
/*height: 40px;*/
margin-bottom: 24px;
}
.itemModel-text {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.box-button{
height: 38px;
} }
}
.drawer-bootom-button{
display: flex;
justify-content: center;
}
.Required {
color: red;
margin-right: 4px;
}
</style> </style>
<style lang='less'> <style lang='less'>
.area-module { .area-module {
.ant-modal-wrap { .ant-modal-wrap {
.ant-modal { .ant-modal {
.ant-modal-content { .ant-modal-content {
.ant-modal-footer { .ant-modal-footer {
text-align: center; text-align: center;
}
} }
} }
} }
} }
}
</style> </style>
@@ -0,0 +1,278 @@
<template>
<a-drawer
:title="$t('addSubproject')"
:maskClosable="false"
:width="600"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="confirmLoading">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('projectVersion')">{{$t('projectVersion')}}</span>
</div>
<a-form-model-item class="itemModel" prop="projectVersion">
<a-input class="box-input"
:disabled="true"
v-model="formInline.projectVersion"
:placeholder="$t('PleaseEnter')+$t('projectVersion')"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('explain')">{{$t('explain')}}</span>
</div>
<a-form-model-item class="itemModel" prop="explanation">
<a-textarea :placeholder="$t('pleaseEnter')+$t('explain')"
v-model="formInline.explanation
"
:rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-spin>
<div class="drawer-bootom-button">
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import { mapGetters } from 'vuex'
export default {
name: 'changeExtensionModel',
props: ['url'],
data() {
return {
formInline: {},
confirmLoading: false,
visible: false,
yearNameDataList: [],
rules: {
explanation: [
{
max: 500,
message: this.$t('explain') + this.$t('cannotExceed') + 500 + this.$t('Characters'),
trigger: 'blur'
}
],
projectVersion: [
{
required: true,
message: this.$t('projectVersion') + this.$t('cannotEmpty'),
trigger: 'blur'
}
]
},
disabled: false,
projectNameList: [],
title: ''
}
},
mounted() {
},
methods: {
...mapGetters(['userInfo']),
addModel(val) {
this.visible = true
this.formInline = {}
this.formInline = { ...this.formInline }
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
},
editModel(value) {
this.visible = true
this.formInline = {}
this.formInline.id = value.parentId || value.id
if (!value.versionLast) {
this.formInline.projectVersion = '01'
} else if (value.versionLast) {
if (value.versionLast.slice(0, 1) == '0') {
let num = value.versionLast.slice(1, 2)
let numIndex = parseInt(num) + 1
numIndex = numIndex + ''
if (numIndex.length == 1) {
this.formInline.projectVersion = '0' + numIndex
} else {
this.formInline.projectVersion = numIndex
}
} else {
let index = parseInt(value.versionLast) + 1
index = index + ''
if (index.length == 1) {
this.formInline.projectVersion = '0' + index
} else {
this.formInline.projectVersion = index
}
}
}
this.formInline = { ...this.formInline }
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
},
handleCancel() {
this.visible = false
},
handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let query = JSON.parse(JSON.stringify(this.formInline))
Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) {
query[res] = query[res].join(',')
}
})
this.confirmLoading = true
postAction('/project/projectLibraryBase/addChild', query).then((res) => {
if (res.success) {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.$emit('changeExtensionForm')
} else {
this.$message.warning(res.message)
this.confirmLoading = false
}
})
}
})
}
}
}
</script>
<style>
.formAdd .ant-form-item-label {
width: 130px;
}
.formAdd .ant-form-item-control-wrapper {
display: inline-block;
width: 100%;
}
/*.formAdd .ant-form-item {*/
/* margin-bottom: 20px;*/
/*}*/
.itemModel .ant-form-item-control-wrapper {
width: 100%;
}
.box-input .ant-select-selection--single {
height: 38px;
}
.box-input .ant-select-selection--multiple {
height: 38px;
}
.box-input .ant-select-selection__rendered {
line-height: 38px;
height: 38px;
}
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
margin-top: 6px;
}
.box-input .ant-calendar-picker {
line-height: 38px;
height: 38px;
}
.box-input .ant-calendar-picker-input {
height: 38px;
}
.box-input .ant-input-number-input-wrap {
line-height: 38px;
height: 38px;
}
</style>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 84px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 110px);
display: inline-block;
margin-top: 2px;
height: 40px;
margin-bottom: 24px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.formAdd {
margin-bottom: 40px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
z-index: 100;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
<style>
.ant-input-disabled {
color: rgba(0, 0, 0, 0.65) !important;
}
</style>
@@ -125,10 +125,18 @@
:columns="columns" :columns="columns"
> >
<span slot="projectName" slot-scope="text,record"> <span slot="projectName" slot-scope="text,record">
<a @click="entryNameClick(record)">{{text}}</a> <a @click="entryNameClick(record)" :title="text">{{text}}</a>
</span> </span>
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<!-- <a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>--> <!-- <a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>-->
<a class="text-operation"
v-if="!record.parentId"
@click="toppingClick(record)">
{{record.flag == '1'?$t('cancelTopping'):$t('Topping')}}
</a>
<a class="text-operation" @click="changeExtensionClick(record)">
{{$t('addSubproject')}}
</a>
<a class="text-operation" <a class="text-operation"
v-has="'projectLibraryBase:delete'" v-has="'projectLibraryBase:delete'"
v-if="record.createBy == userInfoQuery.username" v-if="record.createBy == userInfoQuery.username"
@@ -150,12 +158,14 @@
/> />
</div> </div>
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/> <addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
<changeExtensionModel ref="changeExtensionModelRef" @changeExtensionForm="changeExtensionForm"/>
</a-card> </a-card>
</template> </template>
<script> <script>
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage' import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import addModel from '../components/addModel' import addModel from '../components/addModel'
import changeExtensionModel from './components/changeExtensionModel'
import PersonnelSelection from '@/components/PersonnelSelection/index' import PersonnelSelection from '@/components/PersonnelSelection/index'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@@ -163,7 +173,8 @@
name: 'index', name: 'index',
components: { components: {
addModel, addModel,
PersonnelSelection PersonnelSelection,
changeExtensionModel
}, },
data() { data() {
return { return {
@@ -189,26 +200,26 @@
columns: [ columns: [
{ {
title: this.$t('entryName'), title: this.$t('entryName'),
align: 'center', align: 'left',
dataIndex: 'projectName', dataIndex: 'projectName',
width: 180, width: 180,
ellipsis: true, ellipsis: true,
scopedSlots: { customRender: 'projectName' } scopedSlots: { customRender: 'projectName' }
}, },
{ // {
title: this.$t('targetMarket'), // title: this.$t('targetMarket'),
width: 180, // width: 180,
ellipsis: true, // ellipsis: true,
align: 'center', // align: 'center',
dataIndex: 'targetMarket_dictText' // dataIndex: 'targetMarket_dictText'
}, // },
{ // {
title: this.$t('projectStatus'), // title: this.$t('projectStatus'),
align: 'center', // align: 'center',
width: 180, // width: 180,
ellipsis: true, // ellipsis: true,
dataIndex: 'projectStatus_dictText' // dataIndex: 'projectStatus_dictText'
}, // },
{ {
title: this.$t('StudioEngineer'), title: this.$t('StudioEngineer'),
align: 'center', align: 'center',
@@ -217,12 +228,19 @@
dataIndex: 'studioEngineerName' dataIndex: 'studioEngineerName'
}, },
{ {
title: this.$t('certifiedEngineer'), title: this.$t('explain'),
align: 'center', align: 'center',
width: 180, width: 280,
ellipsis: true, ellipsis: true,
dataIndex: 'certificationEngineerName' dataIndex: 'explanation'
}, },
// {
// title: this.$t('certifiedEngineer'),
// align: 'center',
// width: 180,
// ellipsis: true,
// dataIndex: 'certificationEngineerName'
// },
{ {
title: this.$t('ModelPlatform'), title: this.$t('ModelPlatform'),
align: 'center', align: 'center',
@@ -241,7 +259,7 @@
title: this.$t('operation'), title: this.$t('operation'),
align: 'center', align: 'center',
fixed: 'right', fixed: 'right',
width: 100, width: 302,
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
} }
], ],
@@ -258,6 +276,32 @@
handleToggleSearch() { handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus this.toggleSearchStatus = !this.toggleSearchStatus
}, },
toppingClick(row) {
let flag = ''
if (row.flag == '1') {
flag = '0'
} else {
flag = '1'
}
let query = {
flag: flag,
id: row.id
}
getAction('/project/projectLibraryBase/top', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.getList()
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
},
changeExtensionClick(val) {
this.$refs.changeExtensionModelRef.editModel(JSON.parse(JSON.stringify(val)))
},
changeExtensionForm() {
this.getList()
},
onSelectChange(value) { onSelectChange(value) {
this.selectedRowKeys = value this.selectedRowKeys = value
}, },