Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
64c46ea7
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,发现更多精彩内容 >>
提交
64c46ea7
编写于
4月 09, 2020
作者:
C
Captain.B
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/dev' into dev
上级
bade858c
f735d4c9
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
77 addition
and
74 deletion
+77
-74
backend/src/main/java/io/metersphere/service/TestPlanService.java
...src/main/java/io/metersphere/service/TestPlanService.java
+5
-0
frontend/src/business/components/track/case/TestCase.vue
frontend/src/business/components/track/case/TestCase.vue
+1
-5
frontend/src/business/components/track/case/components/NodeTree.vue
...rc/business/components/track/case/components/NodeTree.vue
+3
-2
frontend/src/business/components/track/case/components/TestCaseList.vue
...usiness/components/track/case/components/TestCaseList.vue
+3
-9
frontend/src/business/components/track/plan/TestPlanView.vue
frontend/src/business/components/track/plan/TestPlanView.vue
+3
-19
frontend/src/business/components/track/plan/components/PlanNodeTree.vue
...usiness/components/track/plan/components/PlanNodeTree.vue
+34
-6
frontend/src/business/components/track/plan/components/TestCasePlanList.vue
...ess/components/track/plan/components/TestCasePlanList.vue
+3
-9
frontend/src/business/components/track/plan/components/TestCaseRelevance.vue
...ss/components/track/plan/components/TestCaseRelevance.vue
+22
-16
frontend/src/business/components/track/plan/components/TestPlanList.vue
...usiness/components/track/plan/components/TestPlanList.vue
+3
-8
未找到文件。
backend/src/main/java/io/metersphere/service/TestPlanService.java
浏览文件 @
64c46ea7
...
...
@@ -73,6 +73,11 @@ public class TestPlanService {
public
void
testPlanRelevance
(
PlanCaseRelevanceRequest
request
)
{
List
<
String
>
testCaseIds
=
request
.
getTestCaseIds
();
if
(
testCaseIds
.
isEmpty
())
{
return
;
}
TestCaseExample
testCaseExample
=
new
TestCaseExample
();
testCaseExample
.
createCriteria
().
andIdIn
(
testCaseIds
);
...
...
frontend/src/business/components/track/case/TestCase.vue
浏览文件 @
64c46ea7
<
template
>
<div
class=
"case_container"
v-loading=
"loadingRequire.project && loadingRequire.testCase"
>
<div
class=
"case_container"
>
<el-container>
<el-aside
width=
"250px"
>
...
...
@@ -67,7 +67,6 @@
currentPage
:
1
,
pageSize
:
5
,
total
:
0
,
loadingRequire
:
{
project
:
true
,
testCase
:
true
},
projects
:
[],
currentProject
:
null
,
treeNodes
:
[]
...
...
@@ -120,7 +119,6 @@
localStorage
.
setItem
(
CURRENT_PROJECT
,
JSON
.
stringify
(
this
.
projects
[
0
]));
}
}
this
.
loadingRequire
.
project
=
false
;
// this.checkProject();
});
},
...
...
@@ -137,8 +135,6 @@
changeProject
(
project
)
{
this
.
currentProject
=
project
;
localStorage
.
setItem
(
CURRENT_PROJECT
,
JSON
.
stringify
(
project
));
this
.
$refs
.
testCaseList
.
initTableData
();
this
.
$refs
.
nodeTree
.
getNodeTree
();
},
refreshTable
(
data
)
{
this
.
$refs
.
testCaseList
.
initTableData
(
data
);
...
...
frontend/src/business/components/track/case/components/NodeTree.vue
浏览文件 @
64c46ea7
<
template
>
<div>
<div
v-loading=
"result.loading"
>
<el-input
:placeholder=
"$t('test_track.search_module')"
v-model=
"filterText"
size=
"small"
>
<template
v-slot:append
>
...
...
@@ -74,6 +74,7 @@
name
:
"
NodeTree
"
,
data
()
{
return
{
result
:
{},
filterText
:
''
,
defaultProps
:
{
children
:
'
children
'
,
...
...
@@ -173,7 +174,7 @@
getNodeTree
()
{
if
(
this
.
currentProject
)
{
let
projectId
=
this
.
currentProject
.
id
;
this
.
$get
(
"
/case/node/list/
"
+
projectId
,
response
=>
{
this
.
result
=
this
.
$get
(
"
/case/node/list/
"
+
projectId
,
response
=>
{
this
.
treeNodes
=
response
.
data
;
});
}
...
...
frontend/src/business/components/track/case/components/TestCaseList.vue
浏览文件 @
64c46ea7
<
template
>
<el-main>
<el-card>
<el-card
v-loading=
"result.loading"
>
<template
v-slot:header
>
<div>
<el-row
type=
"flex"
justify=
"space-between"
align=
"middle"
>
...
...
@@ -9,17 +9,11 @@
<span
class=
"title"
>
{{
$t
(
'
test_track.test_case
'
)
}}
</span>
</el-col>
<el-col
:span=
"
1"
:offset=
"8
"
>
<el-col
:span=
"
2"
:offset=
"10
"
>
<el-button
icon=
"el-icon-circle-plus-outline"
size=
"small"
round
@
click=
"$emit('openTestCaseEditDialog')"
>
{{
$t
(
'
commons.create
'
)
}}
</el-button>
</el-col>
<el-col
:span=
"1"
>
<el-button
icon=
"el-icon-refresh"
size=
"small"
round
@
click=
"initTableData()"
>
{{
$t
(
'
commons.refresh
'
)
}}
</el-button>
</el-col>
<el-col
:span=
"5"
>
<span
class=
"search"
>
<el-input
type=
"text"
size=
"small"
:placeholder=
"$t('load_test.search_by_name')"
...
...
@@ -161,7 +155,7 @@
if
(
this
.
currentProject
)
{
param
.
projectId
=
this
.
currentProject
.
id
;
this
.
$post
(
this
.
buildPagePath
(
'
/test/case/list
'
),
param
,
response
=>
{
this
.
result
=
this
.
$post
(
this
.
buildPagePath
(
'
/test/case/list
'
),
param
,
response
=>
{
this
.
loadingRequire
.
testCase
=
false
;
let
data
=
response
.
data
;
this
.
total
=
data
.
itemCount
;
...
...
frontend/src/business/components/track/plan/TestPlanView.vue
浏览文件 @
64c46ea7
...
...
@@ -5,6 +5,7 @@
<el-aside
class=
"node-tree"
width=
"250px"
>
<plan-node-tree
:tree-nodes=
"treeNodes"
:plan-id=
"planId"
@
nodeSelectEvent=
"getPlanCases"
ref=
"tree"
></plan-node-tree>
</el-aside>
...
...
@@ -49,16 +50,6 @@
treeNodes
:
[]
}
},
created
()
{
this
.
getNodeTreeByPlanId
();
},
watch
:
{
'
$route
'
(
to
,
from
)
{
if
(
to
.
path
.
indexOf
(
"
/track/plan/view/
"
)
>=
0
){
this
.
getNodeTreeByPlanId
();
}
}
},
computed
:
{
planId
:
function
()
{
return
this
.
$route
.
params
.
planId
;
...
...
@@ -67,20 +58,13 @@
methods
:
{
refresh
()
{
this
.
getPlanCases
();
this
.
getNodeTreeByPlanId
();
this
.
$refs
.
tree
.
initTree
();
},
getPlanCases
(
nodeIds
)
{
this
.
$refs
.
testCasePlanList
.
initTableData
(
nodeIds
);
},
openTestCaseRelevanceDialog
()
{
this
.
$refs
.
testCaseRelevance
.
openTestCaseRelevanceDialog
(
this
.
planId
);
},
getNodeTreeByPlanId
()
{
if
(
this
.
planId
){
this
.
$get
(
"
/case/node/list/plan/
"
+
this
.
planId
,
response
=>
{
this
.
treeNodes
=
response
.
data
;
});
}
this
.
$refs
.
testCaseRelevance
.
openTestCaseRelevanceDialog
();
},
editTestPlanTestCase
(
testCase
)
{
let
item
=
{};
...
...
frontend/src/business/components/track/plan/components/PlanNodeTree.vue
浏览文件 @
64c46ea7
...
...
@@ -4,6 +4,7 @@
<el-input
:placeholder=
"$t('test_track.search_module')"
v-model=
"filterText"
size=
"small"
></el-input>
<el-tree
v-loading=
"result.loading"
class=
"filter-tree node-tree"
:data=
"treeNodes"
node-key=
"id"
...
...
@@ -28,26 +29,39 @@
name
:
"
PlanNodeTree
"
,
data
()
{
return
{
result
:
{},
filterText
:
''
,
defaultProps
:
{
children
:
'
children
'
,
label
:
'
label
'
},
dialogTableVisible
:
false
,
defaultKeys
:
[]
defaultKeys
:
[],
treeNodes
:
[]
};
},
props
:
{
planId
:
{
type
:
String
},
treeNodes
:
{
Array
},
showAll
:
{
type
:
Boolean
}
},
created
()
{
this
.
initTree
();
},
watch
:
{
filterText
(
val
)
{
this
.
$refs
.
tree
.
filter
(
val
);
},
planId
()
{
this
.
initTree
();
},
'
$route
'
(
to
,
from
)
{
if
(
to
.
path
.
indexOf
(
"
/track/plan/view/
"
)
>=
0
){
this
.
initTree
();
}
}
},
selectNode
(
node
)
{
...
...
@@ -64,6 +78,13 @@
return
nodeIds
;
},
methods
:
{
initTree
()
{
if
(
this
.
showAll
)
{
this
.
getAllNodeTreeByPlanId
();
}
else
{
this
.
getNodeTreeByPlanId
();
}
},
handleDragEnd
(
draggingNode
,
dropNode
,
dropType
,
ev
)
{
let
param
=
{};
param
.
id
=
draggingNode
.
data
.
id
;
...
...
@@ -98,9 +119,16 @@
if
(
!
value
)
return
true
;
return
data
.
label
.
indexOf
(
value
)
!==
-
1
;
},
getNodeTreeBy
NodeIds
()
{
getNodeTreeBy
PlanId
()
{
if
(
this
.
planId
){
this
.
$get
(
"
/case/node/list/plan/
"
+
this
.
planId
,
response
=>
{
this
.
result
=
this
.
$get
(
"
/case/node/list/plan/
"
+
this
.
planId
,
response
=>
{
this
.
treeNodes
=
response
.
data
;
});
}
},
getAllNodeTreeByPlanId
()
{
if
(
this
.
planId
)
{
this
.
result
=
this
.
$get
(
"
/case/node/list/all/plan/
"
+
this
.
planId
,
response
=>
{
this
.
treeNodes
=
response
.
data
;
});
}
...
...
frontend/src/business/components/track/plan/components/TestCasePlanList.vue
浏览文件 @
64c46ea7
<
template
>
<el-main
class=
"main-content"
>
<el-card>
<el-card
v-loading=
"result.loading"
>
<template
v-slot:header
>
<div>
<el-row
type=
"flex"
justify=
"space-between"
align=
"middle"
>
...
...
@@ -9,17 +9,11 @@
<span
class=
"title"
>
{{
$t
(
'
test_track.test_case
'
)
}}
</span>
</el-col>
<el-col
:span=
"
1"
:offset=
"4
"
>
<el-col
:span=
"
2"
:offset=
"8
"
>
<el-button
icon=
"el-icon-circle-plus-outline"
size=
"small"
round
@
click=
"$emit('openTestCaseRelevanceDialog')"
>
{{
$t
(
'
test_track.relevance_test_case
'
)
}}
</el-button>
</el-col>
<el-col
:span=
"1"
:offset=
"1"
>
<el-button
icon=
"el-icon-refresh"
size=
"small"
round
@
click=
"initTableData()"
>
{{
$t
(
'
commons.refresh
'
)
}}
</el-button>
</el-col>
<el-col
:span=
"5"
>
<span
class=
"search"
>
<el-input
type=
"text"
size=
"small"
:placeholder=
"$t('load_test.search_by_name')"
...
...
@@ -169,7 +163,7 @@
};
param
.
nodeIds
=
nodeIds
;
param
.
planId
=
this
.
planId
;
this
.
$post
(
this
.
buildPagePath
(
'
/test/plan/case/list
'
),
param
,
response
=>
{
this
.
result
=
this
.
$post
(
this
.
buildPagePath
(
'
/test/plan/case/list
'
),
param
,
response
=>
{
this
.
loadingRequire
.
testCase
=
false
;
let
data
=
response
.
data
;
this
.
total
=
data
.
itemCount
;
...
...
frontend/src/business/components/track/plan/components/TestCaseRelevance.vue
浏览文件 @
64c46ea7
...
...
@@ -4,18 +4,21 @@
<el-dialog
:title=
"$t('test_track.relevance_test_case')"
:visible.sync=
"dialogFormVisible"
@
close=
"close"
width=
"50%"
>
<el-container
class=
"main-content"
>
<el-aside
class=
"node-tree"
width=
"250px"
>
<plan-node-tree
:tree-nodes=
"treeNodes"
:plan-id=
"planId"
:showAll=
true
@
nodeSelectEvent=
"getCaseNameByNodeIds"
ref=
"tree"
></plan-node-tree>
</el-aside>
<el-container>
<el-main
class=
"case-content"
>
<el-main
class=
"case-content"
v-loading=
"result.loading"
>
<el-scrollbar
style=
"height:100%"
>
<el-table
:data=
"testCases"
...
...
@@ -70,6 +73,7 @@
components
:
{
PlanNodeTree
},
data
()
{
return
{
result
:
{},
dialogFormVisible
:
false
,
isCheckAll
:
false
,
testCases
:
[],
...
...
@@ -82,10 +86,14 @@
type
:
String
}
},
watch
:
{
planId
()
{
this
.
getCaseNames
();
}
},
methods
:
{
openTestCaseRelevanceDialog
(
planId
)
{
this
.
getAllNodeTreeByPlanId
(
planId
);
this
.
getCaseNames
(
planId
);
openTestCaseRelevanceDialog
()
{
this
.
getCaseNames
();
this
.
dialogFormVisible
=
true
;
},
saveCaseRelevance
(){
...
...
@@ -93,20 +101,21 @@
param
.
planId
=
this
.
planId
;
param
.
testCaseIds
=
[...
this
.
selectIds
];
this
.
$post
(
'
/test/plan/relevance
'
,
param
,
()
=>
{
this
.
dialogFormVisible
=
false
;
this
.
selectIds
.
clear
()
;
this
.
$message
.
success
(
"
保存成功
"
);
this
.
dialogFormVisible
=
false
;
this
.
$emit
(
'
refresh
'
);
});
},
getCaseNames
(
planId
,
nodeIds
)
{
getCaseNames
(
nodeIds
)
{
let
param
=
{};
if
(
planId
)
{
param
.
planId
=
planId
;
if
(
this
.
planId
)
{
param
.
planId
=
this
.
planId
;
}
if
(
nodeIds
&&
nodeIds
.
length
>
0
){
param
.
nodeIds
=
nodeIds
;
}
this
.
$post
(
'
/test/case/name
'
,
param
,
response
=>
{
this
.
result
=
this
.
$post
(
'
/test/case/name
'
,
param
,
response
=>
{
this
.
testCases
=
response
.
data
;
this
.
testCases
.
forEach
(
item
=>
{
item
.
checked
=
false
;
...
...
@@ -115,7 +124,7 @@
},
getCaseNameByNodeIds
(
nodeIds
)
{
this
.
dialogFormVisible
=
true
;
this
.
getCaseNames
(
this
.
planId
,
nodeIds
);
this
.
getCaseNames
(
nodeIds
);
},
handleSelectAll
(
selection
)
{
if
(
selection
.
length
>
0
){
...
...
@@ -133,12 +142,9 @@
this
.
selectIds
.
add
(
row
.
id
);
}
},
getAllNodeTreeByPlanId
(
planId
)
{
if
(
planId
)
{
this
.
$get
(
"
/case/node/list/all/plan/
"
+
planId
,
response
=>
{
this
.
treeNodes
=
response
.
data
;
});
}
close
()
{
console
.
log
(
"
clear
"
);
this
.
selectIds
.
clear
();
}
}
}
...
...
frontend/src/business/components/track/plan/components/TestPlanList.vue
浏览文件 @
64c46ea7
...
...
@@ -2,7 +2,7 @@
<div
class=
"testplan-container"
>
<el-main
class=
"main-content"
>
<el-card>
<el-card
v-loading=
"result.loading"
>
<template
v-slot:header
>
<div>
<el-row
type=
"flex"
justify=
"space-between"
align=
"middle"
>
...
...
@@ -10,16 +10,11 @@
<span
class=
"title"
>
{{
$t
(
'
test_track.test_plan
'
)
}}
</span>
</el-col>
<el-col
:span=
"
1"
:offset=
"8
"
>
<el-col
:span=
"
2"
:offset=
"10
"
>
<el-button
icon=
"el-icon-circle-plus-outline"
size=
"small"
round
@
click=
"$emit('openTestPlanEditDialog')"
>
{{
$t
(
'
commons.create
'
)
}}
</el-button>
</el-col>
<el-col
:span=
"1"
>
<el-button
icon=
"el-icon-refresh"
size=
"small"
round
@
click=
"initTableData()"
>
{{
$t
(
'
commons.refresh
'
)
}}
</el-button>
</el-col>
<el-col
:span=
"5"
>
<span
class=
"search"
>
...
...
@@ -159,7 +154,7 @@
};
param
.
nodeIds
=
nodeIds
;
this
.
$post
(
this
.
buildPagePath
(
this
.
queryPath
),
param
,
response
=>
{
this
.
result
=
this
.
$post
(
this
.
buildPagePath
(
this
.
queryPath
),
param
,
response
=>
{
this
.
loadingRequire
.
testCase
=
false
;
let
data
=
response
.
data
;
this
.
total
=
data
.
itemCount
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录