Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
02280431
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,发现更多精彩内容 >>
提交
02280431
编写于
7月 09, 2020
作者:
S
shiziyuan9527
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试计划关联用例增加优先级和类型并支持筛选
上级
39121f0f
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
170 addition
and
114 deletion
+170
-114
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml
...java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml
+11
-1
frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue
...omponents/track/plan/view/comonents/TestCaseRelevance.vue
+159
-113
未找到文件。
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml
浏览文件 @
02280431
...
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"io.metersphere.base.mapper.ext.ExtTestCaseMapper"
>
<select
id=
"getTestCaseNames"
resultType=
"io.metersphere.base.domain.TestCase"
>
select test_case.id, test_case.name
select test_case.id, test_case.name
, test_case.priority, test_case.type
from test_case
<where>
<if
test=
"request.projectId != null"
>
...
...
@@ -16,6 +16,16 @@
</foreach>
</if>
<if
test=
"request.filters != null and request.filters.size() > 0"
>
<foreach
collection=
"request.filters.entrySet()"
index=
"key"
item=
"values"
>
<if
test=
"values != null and values.size() > 0"
>
and test_case.${key} in
<foreach
collection=
"values"
item=
"value"
separator=
","
open=
"("
close=
")"
>
#{value}
</foreach>
</if>
</foreach>
</if>
</where>
ORDER BY test_case.update_time DESC
</select>
...
...
frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue
浏览文件 @
02280431
...
...
@@ -21,6 +21,7 @@
<el-main
class=
"case-content"
v-loading=
"result.loading"
>
<el-table
:data=
"testCases"
@
filter-change=
"filter"
row-key=
"id"
@
select-all=
"handleSelectAll"
@
select=
"handleSelectionChange"
...
...
@@ -38,6 +39,26 @@
{{
scope
.
row
.
name
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"priority"
:filters=
"priorityFilters"
column-key=
"priority"
:label=
"$t('test_track.case.priority')"
show-overflow-tooltip
>
<
template
v-slot:default=
"scope"
>
<priority-table-item
:value=
"scope.row.priority"
/>
</
template
>
</el-table-column>
<el-table-column
prop=
"type"
:filters=
"typeFilters"
column-key=
"type"
:label=
"$t('test_track.case.type')"
show-overflow-tooltip
>
<
template
v-slot:default=
"scope"
>
<type-table-item
:value=
"scope.row.type"
/>
</
template
>
</el-table-column>
</el-table>
</el-main>
</el-container>
...
...
@@ -56,10 +77,13 @@
import
NodeTree
from
'
../../../common/NodeTree
'
;
import
MsDialogFooter
from
'
../../../../common/components/MsDialogFooter
'
import
PriorityTableItem
from
"
../../../common/tableItems/planview/PriorityTableItem
"
;
import
TypeTableItem
from
"
../../../common/tableItems/planview/TypeTableItem
"
;
import
{
_filter
}
from
"
../../../../../../common/js/utils
"
;
export
default
{
name
:
"
TestCaseRelevance
"
,
components
:
{
NodeTree
,
MsDialogFooter
},
components
:
{
NodeTree
,
MsDialogFooter
,
PriorityTableItem
,
TypeTableItem
},
data
()
{
return
{
result
:
{},
...
...
@@ -69,7 +93,19 @@
selectIds
:
new
Set
(),
treeNodes
:
[],
selectNodeIds
:
[],
selectNodeNames
:
[]
selectNodeNames
:
[],
condition
:
{},
priorityFilters
:
[
{
text
:
'
P0
'
,
value
:
'
P0
'
},
{
text
:
'
P1
'
,
value
:
'
P1
'
},
{
text
:
'
P2
'
,
value
:
'
P2
'
},
{
text
:
'
P3
'
,
value
:
'
P3
'
}
],
typeFilters
:
[
{
text
:
this
.
$t
(
'
commons.functional
'
),
value
:
'
functional
'
},
{
text
:
this
.
$t
(
'
commons.performance
'
),
value
:
'
performance
'
},
{
text
:
this
.
$t
(
'
commons.api
'
),
value
:
'
api
'
}
]
};
},
props
:
{
...
...
@@ -90,11 +126,11 @@
this
.
initData
();
this
.
dialogFormVisible
=
true
;
},
saveCaseRelevance
()
{
saveCaseRelevance
()
{
let
param
=
{};
param
.
planId
=
this
.
planId
;
param
.
testCaseIds
=
[...
this
.
selectIds
];
this
.
$post
(
'
/test/plan/relevance
'
,
param
,
()
=>
{
this
.
$post
(
'
/test/plan/relevance
'
,
param
,
()
=>
{
this
.
selectIds
.
clear
();
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
this
.
dialogFormVisible
=
false
;
...
...
@@ -104,12 +140,14 @@
getCaseNames
()
{
let
param
=
{};
if
(
this
.
planId
)
{
param
.
planId
=
this
.
planId
;
// param.planId = this.planId;
this
.
condition
.
planId
=
this
.
planId
;
}
if
(
this
.
selectNodeIds
&&
this
.
selectNodeIds
.
length
>
0
){
param
.
nodeIds
=
this
.
selectNodeIds
;
if
(
this
.
selectNodeIds
&&
this
.
selectNodeIds
.
length
>
0
)
{
// param.nodeIds = this.selectNodeIds;
this
.
condition
.
nodeIds
=
this
.
selectNodeIds
;
}
this
.
result
=
this
.
$post
(
'
/test/case/name
'
,
param
,
response
=>
{
this
.
result
=
this
.
$post
(
'
/test/case/name
'
,
this
.
condition
,
response
=>
{
this
.
testCases
=
response
.
data
;
this
.
testCases
.
forEach
(
item
=>
{
item
.
checked
=
false
;
...
...
@@ -117,7 +155,7 @@
});
},
handleSelectAll
(
selection
)
{
if
(
selection
.
length
>
0
)
{
if
(
selection
.
length
>
0
)
{
this
.
testCases
.
forEach
(
item
=>
{
this
.
selectIds
.
add
(
item
.
id
);
});
...
...
@@ -126,7 +164,7 @@
}
},
handleSelectionChange
(
selection
,
row
)
{
if
(
this
.
selectIds
.
has
(
row
.
id
))
{
if
(
this
.
selectIds
.
has
(
row
.
id
))
{
this
.
selectIds
.
delete
(
row
.
id
);
}
else
{
this
.
selectIds
.
add
(
row
.
id
);
...
...
@@ -154,7 +192,11 @@
this
.
selectIds
.
clear
();
this
.
selectNodeIds
=
[];
this
.
selectNodeNames
=
[];
}
},
filter
(
filters
)
{
_filter
(
filters
,
this
.
condition
);
this
.
initData
();
},
}
}
</
script
>
...
...
@@ -165,16 +207,18 @@
display
:
none
;
color
:
black
;
}
.tb-edit
.current-row
.el-input
{
display
:
block
;
}
.tb-edit
.current-row
.el-input
+
span
{
.tb-edit
.current-row
.el-input
+
span
{
display
:
none
;
}
.node-tree
{
.node-tree
{
margin-right
:
10px
;
}
...
...
@@ -189,10 +233,12 @@
height
:
100%
;
/*border: 1px solid #EBEEF5;*/
}
.tree-aside
{
min-height
:
300px
;
max-height
:
100%
;
}
.main-content
{
min-height
:
300px
;
height
:
100%
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录