优化用例名称重复的限制,只限制在同项目下不能重复

增加生产事故数据迁移脚本
This commit is contained in:
seagull 2019-10-08 16:10:19 +08:00
parent 981d8d273b
commit b8feaefe86
7 changed files with 445 additions and 399 deletions

View File

@ -0,0 +1,27 @@
/*
* LuckyFrame SQL脚本从V2.7.2V3.1
* Version 3.1
* Author Seagull
* Date 2019-08-27
************ WARNING ************
V2.7.2V3.1
V2.7.2
*/
-- ----------------------------
-- 质量管理-生产事故登记数据迁移
-- ----------------------------
insert into qa_accident (accident_id,project_id,accident_status,accident_time,report_time,accident_description,accident_level,accident_analysis,accident_type,accident_consequence,corrective_action,resolution_time,resolutioner,preventive_action,preventiver,preventive_plan_date,preventive_over_date,duration_time,impact_time,accident_file_name,create_by)
select id,projectid,accstatus,eventtime,reporttime,accdescription,acclevel,causalanalysis,causaltype,consequenceanalysis,correctiveaction,resolutiontime,resolutioner,preventiveaction,preventiver,preventiveplandate,preventiveaccdate,trouble_duration,impact_time,filename,reporter from luckyframedb.qa_accident qa
where 1=1 and NOT EXISTS(select 1 from qa_accident where accident_id = qa.id);
/*修改NULL字符串为空*/
update qa_accident t set t.resolution_time='' where t.resolution_time='NULL';
update qa_accident t set t.resolutioner='' where t.resolutioner='NULL';
update qa_accident t set t.preventive_plan_date='' where t.preventive_plan_date='NULL';
update qa_accident t set t.preventive_over_date='' where t.preventive_over_date='NULL';
update qa_accident t set t.preventiver='' where t.preventiver='NULL';
update qa_accident t set t.report_time='' where t.report_time='NULL';
/*不是跟踪处理完成状态的记录把解决时间跟解决人员修改成NULL*/
update qa_accident t set t.resolution_time=null,t.resolutioner=null where t.accident_status!='跟踪处理完成'

View File

@ -1,132 +1,132 @@
package com.luckyframe.project.testmanagmt.projectCase.mapper; package com.luckyframe.project.testmanagmt.projectCase.mapper;
import java.util.List; import java.util.List;
import com.luckyframe.project.testmanagmt.projectCase.domain.ProjectCase; import com.luckyframe.project.testmanagmt.projectCase.domain.ProjectCase;
/** /**
* 项目测试用例管理 数据层 * 项目测试用例管理 数据层
* *
* @author luckyframe * @author luckyframe
* @date 2019-02-26 * @date 2019-02-26
*/ */
public interface ProjectCaseMapper public interface ProjectCaseMapper
{ {
/** /**
* 查询项目测试用例管理信息 * 查询项目测试用例管理信息
* *
* @param caseId 项目测试用例管理ID * @param caseId 项目测试用例管理ID
* @return 项目测试用例管理信息 * @return 项目测试用例管理信息
*/ */
public ProjectCase selectProjectCaseById(Integer caseId); public ProjectCase selectProjectCaseById(Integer caseId);
/** /**
* 通过用例编号查询项目测试用例管理信息 * 通过用例编号查询项目测试用例管理信息
* *
* @param caseId 项目测试用例管理ID * @param caseId 项目测试用例管理ID
* @return 项目测试用例管理信息 * @return 项目测试用例管理信息
*/ */
public ProjectCase selectProjectCaseByCaseSign(String caseSign); public ProjectCase selectProjectCaseByCaseSign(String caseSign);
/** /**
* 查询项目测试用例管理列表 * 查询项目测试用例管理列表
* *
* @param projectCase 项目测试用例管理信息 * @param projectCase 项目测试用例管理信息
* @return 项目测试用例管理集合 * @return 项目测试用例管理集合
*/ */
public List<ProjectCase> selectProjectCaseList(ProjectCase projectCase); public List<ProjectCase> selectProjectCaseList(ProjectCase projectCase);
/** /**
* 查询计划中的用例列表 * 查询计划中的用例列表
* @param projectCase * @param projectCase
* @return * @return
* @author Seagull * @author Seagull
* @date 2019年4月10日 * @date 2019年4月10日
*/ */
public List<ProjectCase> selectProjectCaseListForPlan(ProjectCase projectCase); public List<ProjectCase> selectProjectCaseListForPlan(ProjectCase projectCase);
/** /**
* 新增项目测试用例管理 * 新增项目测试用例管理
* *
* @param projectCase 项目测试用例管理信息 * @param projectCase 项目测试用例管理信息
* @return 结果 * @return 结果
*/ */
public int insertProjectCase(ProjectCase projectCase); public int insertProjectCase(ProjectCase projectCase);
/** /**
* 修改项目测试用例管理 * 修改项目测试用例管理
* *
* @param projectCase 项目测试用例管理信息 * @param projectCase 项目测试用例管理信息
* @return 结果 * @return 结果
*/ */
public int updateProjectCase(ProjectCase projectCase); public int updateProjectCase(ProjectCase projectCase);
/** /**
* 删除项目测试用例管理 * 删除项目测试用例管理
* *
* @param caseId 项目测试用例管理ID * @param caseId 项目测试用例管理ID
* @return 结果 * @return 结果
*/ */
public int deleteProjectCaseById(Integer caseId); public int deleteProjectCaseById(Integer caseId);
/** /**
* 批量删除项目测试用例管理 * 批量删除项目测试用例管理
* *
* @param caseIds 需要删除的数据ID * @param caseIds 需要删除的数据ID
* @return 结果 * @return 结果
*/ */
public int deleteProjectCaseByIds(String[] caseIds); public int deleteProjectCaseByIds(String[] caseIds);
/** /**
* 检查测试用例名称唯一性 * 检查测试用例名称唯一性
* @param caseName * @param projectCase
* @return * @return
* @author Seagull * @author Seagull
* @date 2019年2月28日 * @date 2019年10月8日
*/ */
public ProjectCase checkProjectCaseNameUnique(String caseName); public List<ProjectCase> checkProjectCaseNameUnique(ProjectCase projectCase);
/** /**
* 查询测试用例项目序号 * 查询测试用例项目序号
* @param projectId * @param projectId
* @return * @return
* @author Seagull * @author Seagull
* @date 2019年3月1日 * @date 2019年3月1日
*/ */
public int selectMaxCaseSerialNumberByProjectId(Integer projectId); public int selectMaxCaseSerialNumberByProjectId(Integer projectId);
/** /**
* 查询项目下有没有测试用例 * 查询项目下有没有测试用例
* @param projectId * @param projectId
* @return * @return
* @author Seagull * @author Seagull
* @date 2019年3月4日 * @date 2019年3月4日
*/ */
public int selectProjectCaseCountByProjectId(Integer projectId); public int selectProjectCaseCountByProjectId(Integer projectId);
/** /**
* 查询用例模块下有没有测试用例 * 查询用例模块下有没有测试用例
* @param projectId * @param projectId
* @return * @return
* @author Seagull * @author Seagull
* @date 2019年3月4日 * @date 2019年3月4日
*/ */
public int selectProjectCaseCountByModuleId(Integer moduleId); public int selectProjectCaseCountByModuleId(Integer moduleId);
/** /**
* 查询总用例数 * 查询总用例数
* @return * @return
* @author Seagull * @author Seagull
* @date 2019年4月28日 * @date 2019年4月28日
*/ */
public int selectProjectCaseCount(); public int selectProjectCaseCount();
/** /**
* 查询指定天数内更新的用例 * 查询指定天数内更新的用例
* @param projectCase * @param projectCase
* @return * @return
* @author Seagull * @author Seagull
* @date 2019年4月28日 * @date 2019年4月28日
*/ */
public int selectProjectCaseCountForThirtyDays(String updateTime); public int selectProjectCaseCountForThirtyDays(String updateTime);
} }

View File

@ -212,8 +212,8 @@ public class ProjectCaseServiceImpl implements IProjectCaseService
public String checkProjectCaseNameUnique(ProjectCase projectCase) public String checkProjectCaseNameUnique(ProjectCase projectCase)
{ {
Long caseId = StringUtils.isNull(projectCase.getCaseId()) ? -1L : projectCase.getCaseId(); Long caseId = StringUtils.isNull(projectCase.getCaseId()) ? -1L : projectCase.getCaseId();
ProjectCase info = projectCaseMapper.checkProjectCaseNameUnique(projectCase.getCaseName()); List<ProjectCase> info = projectCaseMapper.checkProjectCaseNameUnique(projectCase);
if (StringUtils.isNotNull(info) && info.getCaseId().longValue() != caseId.longValue()) if (info.size()>0 && (info.get(0).getCaseId().longValue() != caseId.longValue() || projectCase.getPriority()==99999999))
{ {
return ProjectCaseConstants.PROJECTCASE_NAME_NOT_UNIQUE; return ProjectCaseConstants.PROJECTCASE_NAME_NOT_UNIQUE;
} }

View File

@ -112,9 +112,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select IFNULL(MAX(case_serial_number),0) from project_case where project_id=#{project_id} select IFNULL(MAX(case_serial_number),0) from project_case where project_id=#{project_id}
</select> </select>
<select id="checkProjectCaseNameUnique" parameterType="String" resultMap="ProjectCaseResult"> <select id="checkProjectCaseNameUnique" parameterType="ProjectCase" resultMap="ProjectCaseResult">
<include refid="selectProjectCaseVo"/> <include refid="selectProjectCaseVo"/>
where pc.case_name=#{case_name} <where>
<if test="caseName != null and caseName != '' "> and pc.case_name = #{caseName}</if>
<if test="projectId != null and projectId != 0"> and pc.project_id = #{projectId}</if>
</where>
</select> </select>
<insert id="insertProjectCase" parameterType="ProjectCase" useGeneratedKeys="true" keyProperty="caseId"> <insert id="insertProjectCase" parameterType="ProjectCase" useGeneratedKeys="true" keyProperty="caseId">

View File

@ -65,7 +65,7 @@
} }
}); });
$("#form-projectCase-add").validate({ myEditValidate = $("#form-projectCase-add").validate({
rules:{ rules:{
projectId:{ projectId:{
required:true, required:true,
@ -79,6 +79,9 @@
type: "post", type: "post",
dataType: "json", dataType: "json",
data: { data: {
"projectId": function() {
return $("#projectId").val();
},
name: function () { name: function () {
return $.common.trim($("#caseName").val()); return $.common.trim($("#caseName").val());
} }
@ -125,6 +128,8 @@
/*选择项目初始化模块树*/ /*选择项目初始化模块树*/
function initializeModuleTree() { function initializeModuleTree() {
$.validate.resetForm();
$.validate.form();
var projectId=$("#projectId").val(); var projectId=$("#projectId").val();
$.ajax({ $.ajax({
cache : true, cache : true,

View File

@ -1,142 +1,150 @@
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"> <html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8"> <meta charset="utf-8">
<head th:include="include :: header"></head> <head th:include="include :: header"></head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-projectCase-edit" th:object="${projectCase}"> <form class="form-horizontal m" id="form-projectCase-edit" th:object="${projectCase}">
<input id="caseId" name="caseId" th:field="*{caseId}" type="hidden"> <input id="caseId" name="caseId" th:field="*{caseId}" type="hidden">
<input id="caseSerialNumber" name="caseSerialNumber" th:field="*{caseSerialNumber}" type="hidden"> <input id="caseSerialNumber" name="caseSerialNumber" th:field="*{caseSerialNumber}" type="hidden">
<input id="caseSign" name="caseSign" th:field="*{caseSign}" type="hidden"> <input id="caseSign" name="caseSign" th:field="*{caseSign}" type="hidden">
<input id="treeId" name="moduleId" type="hidden" th:value="${projectCaseModule.moduleId}"/> <input id="treeId" name="moduleId" type="hidden" th:value="${projectCaseModule.moduleId}"/>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">项目名称:</label> <label class="col-sm-3 control-label">项目名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" id="projectId" name="projectId" onchange="initializeModuleTree()"> <select class="form-control" id="projectId" name="projectId" onchange="initializeModuleTree()">
<option th:each="project:${projects}" th:value="${project.projectId}" <option th:each="project:${projects}" th:value="${project.projectId}"
th:text="${project.projectName}" th:selected="${project.flag}"></option> th:text="${project.projectName}" th:selected="${project.flag}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">用例模块:</label> <label class="col-sm-3 control-label">用例模块:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" type="text" onclick="selectModuleTree()" id="treeName" readonly="true" th:value="${projectCaseModule.moduleName}"/> <input class="form-control" type="text" onclick="selectModuleTree()" id="treeName" readonly="true" th:value="${projectCaseModule.moduleName}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">用例名称:</label> <label class="col-sm-3 control-label">用例名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input id="caseName" name="caseName" th:field="*{caseName}" class="form-control" type="text"> <input id="caseName" name="caseName" th:field="*{caseName}" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">用例类型:</label> <label class="col-sm-3 control-label">用例类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control m-b" th:field="*{caseType}" id="caseType" name="caseType" th:with="type=${@dict.getType('testmanagmt_case_type')}"> <select class="form-control m-b" th:field="*{caseType}" id="caseType" name="caseType" th:with="type=${@dict.getType('testmanagmt_case_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">步骤失败:</label> <label class="col-sm-3 control-label">步骤失败:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<label>当前用例后续步骤 &nbsp;&nbsp;</label> <label>当前用例后续步骤 &nbsp;&nbsp;</label>
<div class="radio-box" th:each="dict : ${@dict.getType('testmanagmt_case_stepfailcontinue')}"> <div class="radio-box" th:each="dict : ${@dict.getType('testmanagmt_case_stepfailcontinue')}">
<input type="radio" th:field="*{failcontinue}" th:id="${dict.dictCode}" name="failcontinue" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}"> <input type="radio" th:field="*{failcontinue}" th:id="${dict.dictCode}" name="failcontinue" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">备注:</label> <label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea id="remark" name="remark" th:field="*{remark}" class="form-control"></textarea> <textarea id="remark" name="remark" th:field="*{remark}" class="form-control"></textarea>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div th:include="include::footer"></div> <div th:include="include::footer"></div>
<script type="text/javascript"> <script type="text/javascript">
var prefix = ctx + "testmanagmt/projectCase"; var prefix = ctx + "testmanagmt/projectCase";
var modulePrefix = ctx + "testmanagmt/projectCaseModule" var modulePrefix = ctx + "testmanagmt/projectCaseModule"
$("#form-projectCase-edit").validate({ $("#form-projectCase-edit").validate({
rules:{ rules:{
caseName:{ caseName:{
required:true, required:true,
minlength: 1, minlength: 1,
maxlength: 200, maxlength: 200,
remote: { remote: {
url: prefix + "/checkProjectCaseNameUnique", url: prefix + "/checkProjectCaseNameUnique",
type: "post", type: "post",
dataType: "json", dataType: "json",
data: { data: {
"caseId": function() { "caseId": function() {
return $("#caseId").val(); return $("#caseId").val();
}, },
name: function () { "projectId": function() {
return $.common.trim($("#caseName").val()); return $("#projectId").val();
} },
}, name: function () {
dataFilter: function (data, type) { return $.common.trim($("#caseName").val());
return $.validate.unique(data); },
} priority: function () {
} return 99999999;
}, }
remark:{ },
maxlength:200 dataFilter: function (data, type) {
} return $.validate.unique(data);
}, }
messages: { }
"caseName": { },
remote: "用例名称已经存在" remark:{
} maxlength:200
} }
}); },
messages: {
function submitHandler() { "caseName": {
if ($.validate.form()) { remote: "用例名称已经存在"
$.operate.save(prefix + "/copy", $('#form-projectCase-edit').serialize()); }
} }
} });
/*模块管理-新增-选择父模块树*/ function submitHandler() {
function selectModuleTree() { if ($.validate.form()) {
var options = { $.operate.save(prefix + "/copy", $('#form-projectCase-edit').serialize());
title: '模块选择', }
width: "380", }
url: modulePrefix + "/selectProjectCaseModuleTree/" + $("#treeId").val(),
callBack: doSubmit /*模块管理-新增-选择父模块树*/
}; function selectModuleTree() {
$.modal.openOptions(options); var options = {
} title: '模块选择',
width: "380",
function doSubmit(index, layero){ url: modulePrefix + "/selectProjectCaseModuleTree/" + $("#treeId").val(),
var body = layer.getChildFrame('body', index); callBack: doSubmit
$("#treeId").val(body.find('#treeId').val()); };
$("#treeName").val(body.find('#treeName').val()); $.modal.openOptions(options);
layer.close(index); }
}
function doSubmit(index, layero){
/*选择项目初始化模块树*/ var body = layer.getChildFrame('body', index);
function initializeModuleTree() { $("#treeId").val(body.find('#treeId').val());
var projectId=$("#projectId").val(); $("#treeName").val(body.find('#treeName').val());
$.ajax({ layer.close(index);
cache : true, }
type : "GET",
url : modulePrefix + "/getModuleByProjectId/" + projectId, /*选择项目初始化模块树*/
data : {}, function initializeModuleTree() {
async : false, $.validate.resetForm();
error : function(request) { $.validate.form();
$.modal.alertError("系统错误"); var projectId=$("#projectId").val();
}, $.ajax({
success : function(data) { cache : true,
$("#treeId").val(data.moduleId); type : "GET",
$("#treeName").val(data.moduleName); url : modulePrefix + "/getModuleByProjectId/" + projectId,
} data : {},
}); async : false,
} error : function(request) {
</script> $.modal.alertError("系统错误");
</body> },
</html> success : function(data) {
$("#treeId").val(data.moduleId);
$("#treeName").val(data.moduleName);
}
});
}
</script>
</body>
</html>

View File

@ -1,121 +1,124 @@
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"> <html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8"> <meta charset="utf-8">
<head th:include="include :: header"></head> <head th:include="include :: header"></head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-projectCase-edit" th:object="${projectCase}"> <form class="form-horizontal m" id="form-projectCase-edit" th:object="${projectCase}">
<input id="caseId" name="caseId" th:field="*{caseId}" type="hidden"> <input id="caseId" name="caseId" th:field="*{caseId}" type="hidden">
<input id="caseSerialNumber" name="caseSerialNumber" th:field="*{caseSerialNumber}" type="hidden"> <input id="caseSerialNumber" name="caseSerialNumber" th:field="*{caseSerialNumber}" type="hidden">
<input id="caseSign" name="caseSign" th:field="*{caseSign}" type="hidden"> <input id="caseSign" name="caseSign" th:field="*{caseSign}" type="hidden">
<input id="projectId" name="projectId" th:field="*{projectId}" type="hidden"> <input id="projectId" name="projectId" th:field="*{projectId}" type="hidden">
<input id="treeId" name="moduleId" type="hidden" th:value="${projectCaseModule.moduleId}"/> <input id="treeId" name="moduleId" type="hidden" th:value="${projectCaseModule.moduleId}"/>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">项目名称:</label> <label class="col-sm-3 control-label">项目名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<strong class="form-control" th:text="*{project.projectName}"></strong> <strong class="form-control" th:text="*{project.projectName}"></strong>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">用例模块:</label> <label class="col-sm-3 control-label">用例模块:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" type="text" onclick="selectModuleTree()" id="treeName" readonly="true" th:value="${projectCaseModule.moduleName}"/> <input class="form-control" type="text" onclick="selectModuleTree()" id="treeName" readonly="true" th:value="${projectCaseModule.moduleName}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">用例名称:</label> <label class="col-sm-3 control-label">用例名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input id="caseName" name="caseName" th:field="*{caseName}" class="form-control" type="text"> <input id="caseName" name="caseName" th:field="*{caseName}" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">用例类型:</label> <label class="col-sm-3 control-label">用例类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control m-b" th:field="*{caseType}" id="caseType" name="caseType" th:with="type=${@dict.getType('testmanagmt_case_type')}"> <select class="form-control m-b" th:field="*{caseType}" id="caseType" name="caseType" th:with="type=${@dict.getType('testmanagmt_case_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">步骤失败:</label> <label class="col-sm-3 control-label">步骤失败:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<label>当前用例后续步骤 &nbsp;&nbsp;</label> <label>当前用例后续步骤 &nbsp;&nbsp;</label>
<div class="radio-box" th:each="dict : ${@dict.getType('testmanagmt_case_stepfailcontinue')}"> <div class="radio-box" th:each="dict : ${@dict.getType('testmanagmt_case_stepfailcontinue')}">
<input type="radio" th:field="*{failcontinue}" th:id="${dict.dictCode}" name="failcontinue" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}"> <input type="radio" th:field="*{failcontinue}" th:id="${dict.dictCode}" name="failcontinue" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">备注:</label> <label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea id="remark" name="remark" th:field="*{remark}" class="form-control"></textarea> <textarea id="remark" name="remark" th:field="*{remark}" class="form-control"></textarea>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div th:include="include::footer"></div> <div th:include="include::footer"></div>
<script type="text/javascript"> <script type="text/javascript">
var prefix = ctx + "testmanagmt/projectCase"; var prefix = ctx + "testmanagmt/projectCase";
var modulePrefix = ctx + "testmanagmt/projectCaseModule"; var modulePrefix = ctx + "testmanagmt/projectCaseModule";
$("#form-projectCase-edit").validate({ $("#form-projectCase-edit").validate({
rules:{ rules:{
caseName:{ caseName:{
required:true, required:true,
minlength: 1, minlength: 1,
maxlength: 200, maxlength: 200,
remote: { remote: {
url: prefix + "/checkProjectCaseNameUnique", url: prefix + "/checkProjectCaseNameUnique",
type: "post", type: "post",
dataType: "json", dataType: "json",
data: { data: {
"caseId": function() { "caseId": function() {
return $("#caseId").val(); return $("#caseId").val();
}, },
name: function () { "projectId": function() {
return $.common.trim($("#caseName").val()); return $("#projectId").val();
} },
}, name: function () {
dataFilter: function (data, type) { return $.common.trim($("#caseName").val());
return $.validate.unique(data); }
} },
} dataFilter: function (data, type) {
}, return $.validate.unique(data);
remark:{ }
maxlength:200 }
} },
}, remark:{
messages: { maxlength:200
"caseName": { }
remote: "用例名称已经存在" },
} messages: {
} "caseName": {
}); remote: "用例名称已经存在"
}
function submitHandler() { }
if ($.validate.form()) { });
$.operate.save(prefix + "/edit", $('#form-projectCase-edit').serialize());
} function submitHandler() {
} if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-projectCase-edit').serialize());
/*模块管理-新增-选择父模块树*/ }
function selectModuleTree() { }
var options = {
title: '模块选择', /*模块管理-新增-选择父模块树*/
width: "380", function selectModuleTree() {
url: modulePrefix + "/selectProjectCaseModuleTree/" + $("#treeId").val(), var options = {
callBack: doSubmit title: '模块选择',
}; width: "380",
$.modal.openOptions(options); url: modulePrefix + "/selectProjectCaseModuleTree/" + $("#treeId").val(),
} callBack: doSubmit
};
function doSubmit(index, layero){ $.modal.openOptions(options);
var body = layer.getChildFrame('body', index); }
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val()); function doSubmit(index, layero){
layer.close(index); var body = layer.getChildFrame('body', index);
} $("#treeId").val(body.find('#treeId').val());
</script> $("#treeName").val(body.find('#treeName').val());
</body> layer.close(index);
</html> }
</script>
</body>
</html>