Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
b32a6f13
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,发现更多精彩内容 >>
提交
b32a6f13
编写于
4月 21, 2020
作者:
C
chenjianxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试用例面包屑
上级
68c7c8f9
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
158 addition
and
47 deletion
+158
-47
frontend/src/business/components/common/components/MsTableSearchBar.vue
...usiness/components/common/components/MsTableSearchBar.vue
+34
-0
frontend/src/business/components/common/components/MsTipButton.vue
...src/business/components/common/components/MsTipButton.vue
+0
-2
frontend/src/business/components/track/case/TestCase.vue
frontend/src/business/components/track/case/TestCase.vue
+5
-1
frontend/src/business/components/track/case/components/NodeTree.vue
...rc/business/components/track/case/components/NodeTree.vue
+10
-2
frontend/src/business/components/track/case/components/TestCaseList.vue
...usiness/components/track/case/components/TestCaseList.vue
+17
-18
frontend/src/business/components/track/common/NodeBreadcrumb.vue
...d/src/business/components/track/common/NodeBreadcrumb.vue
+50
-0
frontend/src/business/components/track/plan/TestPlanView.vue
frontend/src/business/components/track/plan/TestPlanView.vue
+6
-2
frontend/src/business/components/track/plan/components/PlanNodeTree.vue
...usiness/components/track/plan/components/PlanNodeTree.vue
+9
-2
frontend/src/business/components/track/plan/components/TestPlanTestCaseList.vue
...components/track/plan/components/TestPlanTestCaseList.vue
+24
-19
frontend/src/i18n/en-US.js
frontend/src/i18n/en-US.js
+2
-1
frontend/src/i18n/zh-CN.js
frontend/src/i18n/zh-CN.js
+1
-0
未找到文件。
frontend/src/business/components/common/components/MsTableSearchBar.vue
0 → 100644
浏览文件 @
b32a6f13
<
template
>
<el-input
class=
"search"
type=
"text"
size=
"small"
:placeholder=
"$t('commons.search_by_name')"
prefix-icon=
"el-icon-search"
@
change=
"search"
maxlength=
"60"
v-model=
"condition.name"
clearable
/>
</
template
>
<
script
>
export
default
{
name
:
"
MsTableSearchBar
"
,
props
:
{
condition
:
{
type
:
Object
}
},
methods
:
{
search
()
{
this
.
$emit
(
'
update:condition
'
,
this
.
condition
);
this
.
$emit
(
'
change
'
);
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/business/components/common/components/MsTipButton.vue
浏览文件 @
b32a6f13
<
template
>
<el-tooltip
:disabled=
"disabled"
:content=
"tip"
placement=
"bottom"
:effect=
"effect"
>
<el-button
@
click=
"exec()"
circle
:type=
"type"
...
...
frontend/src/business/components/track/case/TestCase.vue
浏览文件 @
b32a6f13
...
...
@@ -10,7 +10,7 @@
</select-menu>
<node-tree
class=
"node-tree"
:current-project=
"currentProject"
@
nodeSelectEvent=
"
refreshTabl
e"
@
nodeSelectEvent=
"
nodeChang
e"
@
refresh=
"refreshTable"
ref=
"nodeTree"
>
</node-tree>
...
...
@@ -122,6 +122,10 @@
changeProject
(
project
)
{
this
.
setCurrentProject
(
project
);
},
nodeChange
(
nodeIds
,
nodeNames
)
{
this
.
$refs
.
testCaseList
.
selectNodeNames
=
nodeNames
;
this
.
$refs
.
testCaseList
.
initTableData
(
nodeIds
);
},
refreshTable
(
data
)
{
this
.
$refs
.
testCaseList
.
initTableData
(
data
);
},
...
...
frontend/src/business/components/track/case/components/NodeTree.vue
浏览文件 @
b32a6f13
...
...
@@ -148,8 +148,11 @@
},
selectNode
(
node
)
{
let
nodeIds
=
[];
let
nodeNames
=
[];
this
.
getChildNodeId
(
node
,
nodeIds
);
this
.
$emit
(
"
nodeSelectEvent
"
,
nodeIds
);
this
.
getParentNodeName
(
node
,
nodeNames
);
this
.
$emit
(
"
nodeSelectEvent
"
,
nodeIds
,
nodeNames
);
},
getChildNodeId
(
rootNode
,
nodeIds
)
{
//递归获取所有子节点ID
...
...
@@ -157,7 +160,12 @@
for
(
let
i
=
0
;
i
<
rootNode
.
childNodes
.
length
;
i
++
)
{
this
.
getChildNodeId
(
rootNode
.
childNodes
[
i
],
nodeIds
);
}
return
nodeIds
;
},
getParentNodeName
(
rootNode
,
nodeNames
)
{
if
(
rootNode
.
parent
&&
rootNode
.
parent
.
id
!=
0
)
{
this
.
getParentNodeName
(
rootNode
.
parent
,
nodeNames
)
}
nodeNames
.
push
(
rootNode
.
data
.
name
);
},
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
...
...
frontend/src/business/components/track/case/components/TestCaseList.vue
浏览文件 @
b32a6f13
...
...
@@ -5,20 +5,18 @@
<template
v-slot:header
>
<div>
<el-row
type=
"flex"
justify=
"space-between"
align=
"middle"
>
<span
class=
"title"
>
{{
$t
(
'
test_track.case.test_case
'
)
}}
<ms-create-box
:tips=
"$t('test_track.case.create')"
:exec=
"testCaseCreate"
/></span>
<node-breadcrumb
:node-names=
"selectNodeNames"
@
refresh=
"refresh"
/>
<span
class=
"operate-button"
>
<ms-create-box
:tips=
"$t('test_track.case.create')"
:exec=
"testCaseCreate"
/>
<test-case-import
:projectId=
"currentProject == null? null : currentProject.id"
@
refresh=
"refresh"
/>
<test-case-export/>
<el-input
type=
"text"
size=
"small"
class=
"search"
:placeholder=
"$t('load_test.search_by_name')"
prefix-icon=
"el-icon-search"
maxlength=
"60"
v-model=
"condition"
@
change=
"search"
clearable
/></span>
<ms-table-search-bar
:condition.sync=
"condition"
@
change=
"initTableData"
/>
</span>
</el-row>
</div>
</
template
>
...
...
@@ -94,17 +92,19 @@
import
TestCaseImport
from
'
../components/TestCaseImport
'
;
import
TestCaseExport
from
'
../components/TestCaseExport
'
;
import
MsTablePagination
from
'
../../../../components/common/pagination/TablePagination
'
;
import
MsTableSearchBar
from
'
../../../../components/common/components/MsTableSearchBar
'
;
import
NodeBreadcrumb
from
'
../../common/NodeBreadcrumb
'
;
export
default
{
name
:
"
TestCaseList
"
,
components
:
{
MsCreateBox
,
TestCaseImport
,
TestCaseExport
,
MsTablePagination
},
components
:
{
MsCreateBox
,
TestCaseImport
,
TestCaseExport
,
MsTablePagination
,
NodeBreadcrumb
,
MsTableSearchBar
},
data
()
{
return
{
result
:
{},
deletePath
:
"
/test/case/delete
"
,
condition
:
""
,
condition
:
{}
,
tableData
:
[],
selectNodeNames
:
[],
currentPage
:
1
,
pageSize
:
5
,
total
:
0
,
...
...
@@ -125,14 +125,11 @@
},
methods
:
{
initTableData
(
nodeIds
)
{
let
param
=
{
name
:
this
.
condition
,
};
param
.
nodeIds
=
nodeIds
;
this
.
condition
.
nodeIds
=
nodeIds
;
if
(
this
.
currentProject
)
{
param
.
projectId
=
this
.
currentProject
.
id
;
this
.
result
=
this
.
$post
(
this
.
buildPagePath
(
'
/test/case/list
'
),
param
,
response
=>
{
this
.
condition
.
projectId
=
this
.
currentProject
.
id
;
this
.
result
=
this
.
$post
(
this
.
buildPagePath
(
'
/test/case/list
'
),
this
.
condition
,
response
=>
{
let
data
=
response
.
data
;
this
.
total
=
data
.
itemCount
;
this
.
tableData
=
data
.
listObject
;
...
...
@@ -172,6 +169,8 @@
});
},
refresh
()
{
this
.
selectNodeNames
=
[];
this
.
condition
=
{};
this
.
$emit
(
'
refresh
'
);
}
}
...
...
frontend/src/business/components/track/common/NodeBreadcrumb.vue
0 → 100644
浏览文件 @
b32a6f13
<
template
>
<el-breadcrumb
separator-class=
"el-icon-arrow-right"
>
<el-breadcrumb-item>
<a
@
click=
"showAll"
>
<i
class=
"el-icon-s-home"
></i>
{{
$t
(
'
test_track.plan_view.all_case
'
)
}}
</a>
</el-breadcrumb-item>
<el-breadcrumb-item
v-for=
"nodeName in data"
:key=
"nodeName"
>
{{
nodeName
}}
</el-breadcrumb-item>
</el-breadcrumb>
</
template
>
<
script
>
export
default
{
name
:
"
NodeBreadcrumb
"
,
data
()
{
return
{
data
:
[]
}
},
props
:
{
nodeNames
:
{
type
:
Array
}
},
watch
:
{
nodeNames
()
{
this
.
filterData
();
}
},
methods
:
{
showAll
()
{
this
.
$emit
(
'
refresh
'
);
},
filterData
()
{
this
.
data
=
this
.
nodeNames
;
if
(
this
.
data
.
length
>
4
)
{
let
lastData
=
this
.
data
[
this
.
data
.
length
-
1
];
this
.
data
.
splice
(
1
,
this
.
data
.
length
);
this
.
data
.
push
(
'
...
'
);
this
.
data
.
push
(
lastData
);
}
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/business/components/track/plan/TestPlanView.vue
浏览文件 @
b32a6f13
...
...
@@ -24,6 +24,7 @@
@
refresh=
"refresh"
:plan-id=
"planId"
:select-node-ids=
"selectNodeIds"
:select-node-names=
"selectNodeNames"
ref=
"testCasePlanList"
></test-plan-test-case-list>
</el-main>
</el-container>
...
...
@@ -51,7 +52,8 @@
return
{
testPlans
:
[],
currentPlan
:
{},
selectNodeIds
:
[]
selectNodeIds
:
[],
selectNodeNames
:
[]
}
},
computed
:
{
...
...
@@ -70,9 +72,11 @@
methods
:
{
refresh
()
{
this
.
selectNodeIds
=
[];
this
.
selectNodeNames
=
[];
this
.
$refs
.
tree
.
initTree
();
},
selectNodeIdsChange
(
nodeIds
)
{
selectNodeIdsChange
(
nodeIds
,
nodeNames
)
{
this
.
selectNodeNames
=
nodeNames
;
this
.
selectNodeIds
=
nodeIds
;
},
openTestCaseRelevanceDialog
()
{
...
...
frontend/src/business/components/track/plan/components/PlanNodeTree.vue
浏览文件 @
b32a6f13
...
...
@@ -105,8 +105,10 @@
},
selectNode
(
node
)
{
let
nodeIds
=
[];
let
nodeNames
=
[];
this
.
getChildNodeId
(
node
,
nodeIds
);
this
.
$emit
(
"
nodeSelectEvent
"
,
nodeIds
);
this
.
getParentNodeName
(
node
,
nodeNames
);
this
.
$emit
(
"
nodeSelectEvent
"
,
nodeIds
,
nodeNames
);
},
getChildNodeId
(
rootNode
,
nodeIds
)
{
//递归获取所有子节点ID
...
...
@@ -114,7 +116,12 @@
for
(
let
i
=
0
;
i
<
rootNode
.
childNodes
.
length
;
i
++
){
this
.
getChildNodeId
(
rootNode
.
childNodes
[
i
],
nodeIds
);
}
return
nodeIds
;
},
getParentNodeName
(
rootNode
,
nodeNames
)
{
if
(
rootNode
.
parent
&&
rootNode
.
parent
.
id
!=
0
)
{
this
.
getParentNodeName
(
rootNode
.
parent
,
nodeNames
)
}
nodeNames
.
push
(
rootNode
.
data
.
name
);
},
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
...
...
frontend/src/business/components/track/plan/components/TestPlanTestCaseList.vue
浏览文件 @
b32a6f13
...
...
@@ -5,13 +5,18 @@
<template
v-slot:header
>
<div>
<el-row
type=
"flex"
justify=
"space-between"
align=
"middle"
>
<span
class=
"title"
>
{{
$t
(
'
test_track.case.test_case
'
)
}}
<span
class=
"title"
>
<node-breadcrumb
:node-names=
"selectNodeNames"
@
refresh=
"refresh"
/>
<ms-tip-button
v-if=
"!showMyTestCase"
:tip=
"$t('test_track.plan_view.my_case')"
icon=
"el-icon-s-custom"
@
click=
"searchMyTestCase"
/>
<ms-tip-button
v-if=
"showMyTestCase"
:tip=
"$t('test_track.plan_view.all_case')"
icon=
"el-icon-files"
@
click=
"searchMyTestCase"
/></span>
icon=
"el-icon-files"
@
click=
"searchMyTestCase"
/>
</span>
<span
class=
"operate-button"
>
<el-button
icon=
"el-icon-connection"
size=
"small"
round
...
...
@@ -23,23 +28,12 @@
<el-button
icon=
"el-icon-user"
size=
"small"
round
@
click=
"handleBatch('executor')"
>
{{
$t
(
'
test_track.plan_view.change_executor
'
)
}}
</el-button>
<el-input
type=
"text"
size=
"small"
class=
"search"
:placeholder=
"$t('load_test.search_by_name')"
prefix-icon=
"el-icon-search"
maxlength=
"60"
v-model=
"condition.name"
@
change=
"search"
clearable
/>
<ms-table-search-bar
:condition.sync=
"condition"
@
change=
"initTableData"
/>
</span>
</el-row>
<executor-edit
ref=
"executorEdit"
:select-ids=
"selectIds"
@
refresh=
"refresh"
/>
<status-edit
ref=
"statusEdit"
:select-ids=
"selectIds"
@
refresh=
"refresh"
/>
<executor-edit
ref=
"executorEdit"
:select-ids=
"selectIds"
@
refresh=
"refresh"
/>
<status-edit
ref=
"statusEdit"
:select-ids=
"selectIds"
@
refresh=
"refresh"
/>
</div>
</
template
>
...
...
@@ -168,11 +162,15 @@
import
TestPlanTestCaseEdit
from
"
../components/TestPlanTestCaseEdit
"
;
import
MsTipButton
from
'
../../../../components/common/components/MsTipButton
'
;
import
MsTablePagination
from
'
../../../../components/common/pagination/TablePagination
'
;
import
MsTableSearchBar
from
'
../../../../components/common/components/MsTableSearchBar
'
;
import
NodeBreadcrumb
from
'
../../common/NodeBreadcrumb
'
;
import
{
TokenKey
}
from
'
../../../../../common/js/constants
'
;
export
default
{
name
:
"
TestPlanTestCaseList
"
,
components
:
{
PlanNodeTree
,
StatusEdit
,
ExecutorEdit
,
MsTipButton
,
MsTablePagination
,
TestPlanTestCaseEdit
},
components
:
{
PlanNodeTree
,
StatusEdit
,
ExecutorEdit
,
MsTipButton
,
MsTablePagination
,
TestPlanTestCaseEdit
,
MsTableSearchBar
,
NodeBreadcrumb
},
data
()
{
return
{
result
:
{},
...
...
@@ -192,6 +190,9 @@
},
selectNodeIds
:
{
type
:
Array
},
selectNodeNames
:
{
type
:
Array
}
},
watch
:
{
...
...
@@ -199,7 +200,7 @@
this
.
initTableData
();
},
selectNodeIds
()
{
this
.
refres
h
();
this
.
searc
h
();
}
},
created
:
function
()
{
...
...
@@ -219,7 +220,7 @@
},
refresh
()
{
this
.
condition
=
{};
this
.
initTableData
(
);
this
.
$emit
(
'
refresh
'
);
},
search
()
{
this
.
initTableData
();
...
...
@@ -303,4 +304,8 @@
}
.el-breadcrumb
{
display
:
inline-block
;
}
</
style
>
frontend/src/i18n/en-US.js
浏览文件 @
b32a6f13
...
...
@@ -46,7 +46,8 @@ export default {
'
refresh
'
:
'
Refresh
'
,
'
remark
'
:
'
Remark
'
,
'
delete
'
:
'
Delete
'
,
'
not_filled
'
:
'
Not filled
'
'
not_filled
'
:
'
Not filled
'
,
'
search_by_name
'
:
'
Search by name
'
,
},
workspace
:
{
'
create
'
:
'
Create Workspace
'
,
...
...
frontend/src/i18n/zh-CN.js
浏览文件 @
b32a6f13
...
...
@@ -48,6 +48,7 @@ export default {
'
delete
'
:
'
删除
'
,
'
not_filled
'
:
'
未填写
'
,
'
please_select
'
:
'
请选择
'
,
'
search_by_name
'
:
'
根据名称搜索
'
,
},
workspace
:
{
'
create
'
:
'
创建工作空间
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录