Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
ab90c2e8
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 大约 3 年
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ab90c2e8
编写于
4月 01, 2020
作者:
C
chenjianxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化前端显示
上级
968af661
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
139 addition
and
40 deletion
+139
-40
backend/src/main/java/io/metersphere/base/domain/TestCase.java
...nd/src/main/java/io/metersphere/base/domain/TestCase.java
+10
-0
backend/src/main/java/io/metersphere/base/domain/TestCaseExample.java
...main/java/io/metersphere/base/domain/TestCaseExample.java
+70
-0
backend/src/main/java/io/metersphere/base/mapper/TestCaseMapper.xml
...c/main/java/io/metersphere/base/mapper/TestCaseMapper.xml
+28
-11
backend/src/main/resources/db/migration/V2__metersphere_ddl.sql
...d/src/main/resources/db/migration/V2__metersphere_ddl.sql
+1
-0
frontend/src/business/components/track/case/TestCase.vue
frontend/src/business/components/track/case/TestCase.vue
+12
-21
frontend/src/business/components/track/case/components/TestCaseEdit.vue
...usiness/components/track/case/components/TestCaseEdit.vue
+5
-0
frontend/src/business/components/track/case/components/TestCaseList.vue
...usiness/components/track/case/components/TestCaseList.vue
+13
-8
未找到文件。
backend/src/main/java/io/metersphere/base/domain/TestCase.java
浏览文件 @
ab90c2e8
...
...
@@ -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
;
}
...
...
backend/src/main/java/io/metersphere/base/domain/TestCaseExample.java
浏览文件 @
ab90c2e8
...
...
@@ -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
;
...
...
backend/src/main/java/io/metersphere/base/mapper/TestCaseMapper.xml
浏览文件 @
ab90c2e8
...
...
@@ -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},
...
...
backend/src/main/resources/db/migration/V2__metersphere_ddl.sql
浏览文件 @
ab90c2e8
...
...
@@ -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'
,
...
...
frontend/src/business/components/track/case/TestCase.vue
浏览文件 @
ab90c2e8
...
...
@@ -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%
;
}
...
...
frontend/src/business/components/track/case/components/TestCaseEdit.vue
浏览文件 @
ab90c2e8
...
...
@@ -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
;
}
...
...
frontend/src/business/components/track/case/components/TestCaseList.vue
浏览文件 @
ab90c2e8
...
...
@@ -36,19 +36,19 @@
<el-table-column
prop=
"name"
:label=
"$t('commons.name')"
width=
"1
3
0"
width=
"1
2
0"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"priority"
:label=
"$t('test_track.priority')"
width=
"1
3
0"
width=
"1
2
0"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"type"
:label=
"$t('test_track.type')"
width=
"1
3
0"
width=
"1
2
0"
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=
"1
3
0"
width=
"1
2
0"
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=
"1
6
0"
width=
"1
0
0"
: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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录