提交 ab90c2e8 编写于 作者: C chenjianxing

优化前端显示

上级 968af661
......@@ -7,6 +7,8 @@ public class TestCase implements Serializable {
private Integer nodeId;
private String nodePath;
private String projectId;
private String name;
......@@ -43,6 +45,14 @@ public class TestCase implements Serializable {
this.nodeId = nodeId;
}
public String getNodePath() {
return nodePath;
}
public void setNodePath(String nodePath) {
this.nodePath = nodePath == null ? null : nodePath.trim();
}
public String getProjectId() {
return projectId;
}
......
......@@ -234,6 +234,76 @@ public class TestCaseExample {
return (Criteria) this;
}
public Criteria andNodePathIsNull() {
addCriterion("node_path is null");
return (Criteria) this;
}
public Criteria andNodePathIsNotNull() {
addCriterion("node_path is not null");
return (Criteria) this;
}
public Criteria andNodePathEqualTo(String value) {
addCriterion("node_path =", value, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathNotEqualTo(String value) {
addCriterion("node_path <>", value, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathGreaterThan(String value) {
addCriterion("node_path >", value, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathGreaterThanOrEqualTo(String value) {
addCriterion("node_path >=", value, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathLessThan(String value) {
addCriterion("node_path <", value, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathLessThanOrEqualTo(String value) {
addCriterion("node_path <=", value, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathLike(String value) {
addCriterion("node_path like", value, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathNotLike(String value) {
addCriterion("node_path not like", value, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathIn(List<String> values) {
addCriterion("node_path in", values, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathNotIn(List<String> values) {
addCriterion("node_path not in", values, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathBetween(String value1, String value2) {
addCriterion("node_path between", value1, value2, "nodePath");
return (Criteria) this;
}
public Criteria andNodePathNotBetween(String value1, String value2) {
addCriterion("node_path not between", value1, value2, "nodePath");
return (Criteria) this;
}
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
......
......@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCase">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="node_id" jdbcType="INTEGER" property="nodeId" />
<result column="node_path" jdbcType="VARCHAR" property="nodePath" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="type" jdbcType="VARCHAR" property="type" />
......@@ -77,7 +78,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, node_id, project_id, name, type, maintainer, priority, method, prerequisite,
id, node_id, node_path, project_id, name, type, maintainer, priority, method, prerequisite,
create_time, update_time
</sql>
<sql id="Blob_Column_List">
......@@ -132,16 +133,16 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
insert into test_case (id, node_id, project_id,
name, type, maintainer,
priority, method, prerequisite,
create_time, update_time, remark,
steps)
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=INTEGER}, #{projectId,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{maintainer,jdbcType=VARCHAR},
#{priority,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{prerequisite,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{remark,jdbcType=LONGVARCHAR},
#{steps,jdbcType=LONGVARCHAR})
insert into test_case (id, node_id, node_path,
project_id, name, type,
maintainer, priority, method,
prerequisite, create_time, update_time,
remark, steps)
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=INTEGER}, #{nodePath,jdbcType=VARCHAR},
#{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{maintainer,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR},
#{prerequisite,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{remark,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
insert into test_case
......@@ -152,6 +153,9 @@
<if test="nodeId != null">
node_id,
</if>
<if test="nodePath != null">
node_path,
</if>
<if test="projectId != null">
project_id,
</if>
......@@ -193,6 +197,9 @@
<if test="nodeId != null">
#{nodeId,jdbcType=INTEGER},
</if>
<if test="nodePath != null">
#{nodePath,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
......@@ -243,6 +250,9 @@
<if test="record.nodeId != null">
node_id = #{record.nodeId,jdbcType=INTEGER},
</if>
<if test="record.nodePath != null">
node_path = #{record.nodePath,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
......@@ -285,6 +295,7 @@
update test_case
set id = #{record.id,jdbcType=VARCHAR},
node_id = #{record.nodeId,jdbcType=INTEGER},
node_path = #{record.nodePath,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
......@@ -304,6 +315,7 @@
update test_case
set id = #{record.id,jdbcType=VARCHAR},
node_id = #{record.nodeId,jdbcType=INTEGER},
node_path = #{record.nodePath,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
......@@ -323,6 +335,9 @@
<if test="nodeId != null">
node_id = #{nodeId,jdbcType=INTEGER},
</if>
<if test="nodePath != null">
node_path = #{nodePath,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
......@@ -362,6 +377,7 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
update test_case
set node_id = #{nodeId,jdbcType=INTEGER},
node_path = #{nodePath,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
......@@ -378,6 +394,7 @@
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCase">
update test_case
set node_id = #{nodeId,jdbcType=INTEGER},
node_path = #{nodePath,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
......
......@@ -265,6 +265,7 @@ CREATE TABLE IF NOT EXISTS `test_case_node` (
CREATE TABLE IF NOT EXISTS `test_case` (
`id` varchar(50) NOT NULL COMMENT 'Test case ID',
`node_id` int(13) NOT NULL COMMENT 'Node ID this case belongs to',
`node_path` varchar(50) NOT NULL COMMENT 'Node path this case belongs to',
`project_id` varchar(50) NOT NULL COMMENT 'Project ID this test belongs to',
`name` varchar(64) NOT NULL COMMENT 'Case name',
`type` varchar(25) NOT NULL COMMENT 'Test case type',
......
......@@ -25,10 +25,14 @@
ref="nodeTree"></node-tree>
</el-aside>
<test-case-list
@openTestCaseEditDialog="openTestCaseEditDialog"
@testCaseEdit="openTestCaseEditDialog"
ref="testCaseList"></test-case-list>
<el-main class="main-content">
<test-case-list
@openTestCaseEditDialog="openTestCaseEditDialog"
@testCaseEdit="openTestCaseEditDialog"
ref="testCaseList"></test-case-list>
</el-main>
</el-container>
......@@ -130,7 +134,7 @@
moduleOptions.push(option);
if(node.children){
for (let i = 0; i < node.children.length; i++){
this.buildNodePath(node.children[i], { path: '/' + node.name }, moduleOptions);
this.buildNodePath(node.children[i], { path: option.path }, moduleOptions);
}
}
},
......@@ -145,10 +149,12 @@
</script>
<style scoped>
.testplan-container {
.case_container {
padding: 15px;
width: 100%;
height: 100%;
background: white;
height: 1000px;
box-sizing: border-box;
}
......@@ -158,21 +164,6 @@
max-width: 1200px;
}
.test-content {
width: 100%;
}
.table-page {
padding-top: 20px;
margin-right: -9px;
float: right;
}
.case_container {
background: white;
height: 600px;
}
.node_tree {
margin: 10%;
}
......
......@@ -256,6 +256,11 @@
Object.assign(param, this.form);
param.steps = JSON.stringify(this.form.steps);
param.nodeId = this.form.module;
this.moduleOptions.forEach(item => {
if(this.form.module === item.id){
param.nodePath = item.path;
}
});
if(localStorage.getItem('currentProject')){
param.projectId = JSON.parse(localStorage.getItem('currentProject')).id;
}
......
......@@ -36,19 +36,19 @@
<el-table-column
prop="name"
:label="$t('commons.name')"
width="130"
width="120"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="priority"
:label="$t('test_track.priority')"
width="130"
width="120"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="type"
:label="$t('test_track.type')"
width="130"
width="120"
show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.type == 'functional'">{{$t('commons.functional')}}</span>
......@@ -59,7 +59,7 @@
<el-table-column
prop="method"
:label="$t('test_track.method')"
width="130"
width="120"
show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.method == 'manual'">{{$t('test_track.manual')}}</span>
......@@ -67,8 +67,8 @@
</template>
</el-table-column>
<el-table-column
prop="remark"
:label="$t('commons.remark')"
prop="nodePath"
:label="$t('test_track.module')"
width="160"
show-overflow-tooltip>
</el-table-column>
......@@ -87,7 +87,7 @@
</template>
</el-table-column>
<el-table-column
width="160"
width="100"
:label="$t('commons.operating')">
<template slot-scope="scope">
<el-button @click="handleEdit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
......@@ -96,7 +96,6 @@
</el-table-column>
</el-table>
<div>
<el-row>
<el-col :span="22" :offset="1">
......@@ -204,4 +203,10 @@
<style scoped>
.table-page {
padding-top: 20px;
margin-right: -9px;
float: right;
}
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册