Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
f797c8cf
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,发现更多精彩内容 >>
提交
f797c8cf
编写于
4月 07, 2020
作者:
C
chenjianxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
track recent
上级
c24dd94e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
116 addition
and
15 deletion
+116
-15
backend/src/main/java/io/metersphere/controller/TestCaseController.java
...in/java/io/metersphere/controller/TestCaseController.java
+1
-1
backend/src/main/java/io/metersphere/controller/TestPlanController.java
...in/java/io/metersphere/controller/TestPlanController.java
+10
-0
backend/src/main/java/io/metersphere/service/TestCaseService.java
...src/main/java/io/metersphere/service/TestCaseService.java
+19
-1
backend/src/main/java/io/metersphere/service/TestPlanService.java
...src/main/java/io/metersphere/service/TestPlanService.java
+10
-0
frontend/src/business/components/common/router/router.js
frontend/src/business/components/common/router/router.js
+6
-1
frontend/src/business/components/track/case/TestCase.vue
frontend/src/business/components/track/case/TestCase.vue
+20
-7
frontend/src/business/components/track/case/components/RecentTestCase.vue
...iness/components/track/case/components/RecentTestCase.vue
+5
-4
frontend/src/business/components/track/head/HeaderMenus.vue
frontend/src/business/components/track/head/HeaderMenus.vue
+3
-1
frontend/src/business/components/track/plan/components/RecentTestPlan.vue
...iness/components/track/plan/components/RecentTestPlan.vue
+42
-0
未找到文件。
backend/src/main/java/io/metersphere/controller/TestCaseController.java
浏览文件 @
f797c8cf
...
...
@@ -53,7 +53,7 @@ public class TestCaseController {
return
testCaseService
.
getTestCaseNames
(
request
);
}
@
Pos
tMapping
(
"/get/{testCaseId}"
)
@
Ge
tMapping
(
"/get/{testCaseId}"
)
public
List
<
TestCaseWithBLOBs
>
getTestCase
(
@PathVariable
String
testCaseId
){
return
testCaseService
.
getTestCase
(
testCaseId
);
}
...
...
backend/src/main/java/io/metersphere/controller/TestPlanController.java
浏览文件 @
f797c8cf
...
...
@@ -8,10 +8,12 @@ import io.metersphere.base.domain.TestPlan;
import
io.metersphere.commons.utils.PageUtils
;
import
io.metersphere.commons.utils.Pager
;
import
io.metersphere.controller.request.testcase.PlanCaseRelevanceRequest
;
import
io.metersphere.controller.request.testcase.QueryTestCaseRequest
;
import
io.metersphere.controller.request.testcase.QueryTestPlanRequest
;
import
io.metersphere.dto.TestPlanDTO
;
import
io.metersphere.service.TestCaseService
;
import
io.metersphere.service.TestPlanService
;
import
io.metersphere.user.SessionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
...
...
@@ -30,6 +32,14 @@ public class TestPlanController {
return
PageUtils
.
setPageInfo
(
page
,
testPlanService
.
listTestPlan
(
request
));
}
@GetMapping
(
"recent/{count}"
)
public
List
<
TestPlan
>
recentTestPlans
(
@PathVariable
int
count
)
{
String
currentWorkspaceId
=
SessionUtils
.
getCurrentWorkspaceId
();
PageHelper
.
startPage
(
1
,
count
,
true
);
return
testPlanService
.
recentTestPlans
(
currentWorkspaceId
);
}
@PostMapping
(
"/get/{testPlanId}"
)
public
List
<
TestPlan
>
getTestPlan
(
@PathVariable
String
testPlanId
){
return
testPlanService
.
getTestPlan
(
testPlanId
);
...
...
backend/src/main/java/io/metersphere/service/TestCaseService.java
浏览文件 @
f797c8cf
...
...
@@ -2,6 +2,7 @@ package io.metersphere.service;
import
io.metersphere.base.domain.*
;
import
io.metersphere.base.mapper.ProjectMapper
;
import
io.metersphere.base.mapper.TestCaseMapper
;
import
io.metersphere.base.mapper.TestPlanMapper
;
import
io.metersphere.base.mapper.TestPlanTestCaseMapper
;
...
...
@@ -36,6 +37,9 @@ public class TestCaseService {
@Resource
TestPlanTestCaseMapper
testPlanTestCaseMapper
;
@Resource
ProjectMapper
projectMapper
;
public
void
addTestCase
(
TestCaseWithBLOBs
testCase
)
{
testCase
.
setId
(
UUID
.
randomUUID
().
toString
());
testCase
.
setCreateTime
(
System
.
currentTimeMillis
());
...
...
@@ -111,6 +115,20 @@ public class TestCaseService {
public
List
<
TestCase
>
recentTestPlans
(
QueryTestCaseRequest
request
)
{
return
null
;
if
(
StringUtils
.
isBlank
(
request
.
getWorkspaceId
()))
{
return
null
;
}
ProjectExample
projectExample
=
new
ProjectExample
();
projectExample
.
createCriteria
().
andWorkspaceIdEqualTo
(
request
.
getWorkspaceId
());
List
<
String
>
projectIds
=
projectMapper
.
selectByExample
(
projectExample
).
stream
()
.
map
(
Project:
:
getId
).
collect
(
Collectors
.
toList
());
TestCaseExample
testCaseExample
=
new
TestCaseExample
();
testCaseExample
.
createCriteria
().
andProjectIdIn
(
projectIds
);
testCaseExample
.
setOrderByClause
(
"update_time desc"
);
return
testCaseMapper
.
selectByExample
(
testCaseExample
);
}
}
backend/src/main/java/io/metersphere/service/TestPlanService.java
浏览文件 @
f797c8cf
...
...
@@ -101,4 +101,14 @@ public class TestPlanService {
sqlSession
.
flushStatements
();
}
public
List
<
TestPlan
>
recentTestPlans
(
String
currentWorkspaceId
)
{
if
(
StringUtils
.
isBlank
(
currentWorkspaceId
))
{
return
null
;
}
TestPlanExample
testPlanTestCaseExample
=
new
TestPlanExample
();
testPlanTestCaseExample
.
createCriteria
().
andWorkspaceIdEqualTo
(
currentWorkspaceId
);
testPlanTestCaseExample
.
setOrderByClause
(
"update_time desc"
);
return
testPlanMapper
.
selectByExample
(
testPlanTestCaseExample
);
}
}
frontend/src/business/components/common/router/router.js
浏览文件 @
f797c8cf
...
...
@@ -204,10 +204,15 @@ const router = new VueRouter({
component
:
TrackHome
,
},
{
path
:
'
case/:
case
Id
'
,
path
:
'
case/:
project
Id
'
,
name
:
'
testCase
'
,
component
:
TestCase
,
},
{
path
:
'
case/edit/:caseId
'
,
name
:
'
testCaseEdit
'
,
component
:
TestCase
,
},
{
path
:
"
plan/:projectId
"
,
name
:
"
testPlan
"
,
...
...
frontend/src/business/components/track/case/TestCase.vue
浏览文件 @
f797c8cf
...
...
@@ -22,8 +22,8 @@
</el-submenu>
</el-menu>
<node-tree
class=
"node_tree"
@
nodeSelectEvent=
"
getCaseByNodeIds
"
@
refresh=
"
getCaseByNodeIds
"
@
nodeSelectEvent=
"
refreshTable
"
@
refresh=
"
refreshTable
"
ref=
"nodeTree"
></node-tree>
</el-aside>
...
...
@@ -39,7 +39,7 @@
</el-container>
<test-case-edit
@
refresh=
"
getCaseByNodeIds
"
@
refresh=
"
refreshTable
"
ref=
"testCaseEditDialog"
></test-case-edit>
</div>
...
...
@@ -73,13 +73,22 @@
}
},
created
:
function
()
{
this
.
projectId
=
this
.
$route
.
params
.
project
Id
;
this
.
caseId
=
this
.
$route
.
params
.
case
Id
;
this
.
getProjects
();
},
watch
:
{
'
$route
'
(
to
,
from
)
{
if
(
from
.
name
.
indexOf
(
"
Project
"
)
>=
0
){
let
path
=
to
.
path
;
if
(
path
.
indexOf
(
"
/track/case/all
"
)
>=
0
){
this
.
getProjects
();
this
.
refresh
();
}
if
(
path
.
indexOf
(
"
/track/case/edit
"
)
>=
0
){
let
caseId
=
this
.
$route
.
params
.
caseId
;
this
.
$get
(
'
/test/case/get/
'
+
caseId
,
response
=>
{
console
.
log
(
response
.
data
);
this
.
openTestCaseEditDialog
(
response
.
data
[
0
]);
});
}
}
},
...
...
@@ -120,10 +129,10 @@
changeProject
(
project
)
{
this
.
currentProject
=
project
;
localStorage
.
setItem
(
CURRENT_PROJECT
,
JSON
.
stringify
(
project
));
this
.
$refs
.
testCaseList
.
initTableData
()
this
.
$refs
.
testCaseList
.
initTableData
()
;
this
.
$refs
.
nodeTree
.
getNodeTree
();
},
getCaseByNodeIds
(
data
)
{
refreshTable
(
data
)
{
this
.
$refs
.
testCaseList
.
initTableData
(
data
);
},
openTestCaseEditDialog
(
data
)
{
...
...
@@ -154,6 +163,10 @@
this
.
$post
(
'
/user/ws/member/list/all
'
,
{
workspaceId
:
workspaceId
},
response
=>
{
this
.
$refs
.
testCaseEditDialog
.
maintainerOptions
=
response
.
data
;
});
},
refresh
()
{
this
.
$refs
.
testCaseList
.
initTableData
();
this
.
$refs
.
nodeTree
.
getNodeTree
();
}
}
}
...
...
frontend/src/business/components/track/case/components/RecentTestCase.vue
浏览文件 @
f797c8cf
...
...
@@ -4,7 +4,8 @@
<i
class=
"el-icon-time"
/>
{{
$t
(
'
load_test.recent
'
)
}}
</div>
<el-menu-item
:key=
"t.id"
v-for=
"t in recentTestPlans"
:index=
"'/performance/test/edit/' + t.id"
>
<el-menu-item
:key=
"t.id"
v-for=
"t in recentTestCases"
:index=
"'/track/case/edit/' + t.id"
>
{{
t
.
name
}}
</el-menu-item>
</el-menu>
...
...
@@ -20,14 +21,14 @@
const
roles
=
rolesString
.
split
(
'
,
'
);
if
(
roles
.
indexOf
(
ROLE_TEST_MANAGER
)
>
-
1
||
roles
.
indexOf
(
ROLE_TEST_USER
)
>
-
1
||
roles
.
indexOf
(
ROLE_TEST_VIEWER
)
>
-
1
)
{
this
.
$get
(
'
/
performanc
e/recent/5
'
,
(
response
)
=>
{
this
.
recentTest
Plan
s
=
response
.
data
;
this
.
$get
(
'
/
test/cas
e/recent/5
'
,
(
response
)
=>
{
this
.
recentTest
Case
s
=
response
.
data
;
});
}
},
data
()
{
return
{
recentTest
Plan
s
:
[]
recentTest
Case
s
:
[]
}
}
}
...
...
frontend/src/business/components/track/head/HeaderMenus.vue
浏览文件 @
f797c8cf
...
...
@@ -38,6 +38,7 @@
<el-submenu
v-if=
"isCurrentWorkspaceUser"
index=
"7"
popper-class=
"submenu"
v-permission=
"['test_manager', 'test_user', 'test_viewer']"
>
<
template
v-slot:title
>
{{
$t
(
'
test_track.test_plan
'
)
}}
</
template
>
<recent-test-plan/>
<el-divider/>
<el-menu-item
:index=
"'/track/plan/all'"
>
<font-awesome-icon
:icon=
"['fa', 'list-ul']"
/>
...
...
@@ -58,10 +59,11 @@
import
{
checkoutCurrentWorkspace
}
from
"
../../../../common/utils
"
;
import
TrackRecentProject
from
"
../../track/project/TrackRecentProject
"
;
import
RecentTestCase
from
"
../case/components/RecentTestCase
"
;
import
RecentTestPlan
from
"
../plan/components/RecentTestPlan
"
;
export
default
{
name
:
"
MsMenus
"
,
components
:
{
RecentTestCase
,
TrackRecentProject
},
components
:
{
RecentTestCase
,
TrackRecentProject
,
RecentTestPlan
},
data
()
{
return
{
isCurrentWorkspaceUser
:
false
,
...
...
frontend/src/business/components/track/plan/components/RecentTestPlan.vue
0 → 100644
浏览文件 @
f797c8cf
<
template
>
<el-menu
router
menu-trigger=
"click"
:default-active=
"$route.path"
>
<div
class=
"recent-text"
>
<i
class=
"el-icon-time"
/>
{{
$t
(
'
load_test.recent
'
)
}}
</div>
<el-menu-item
:key=
"t.id"
v-for=
"t in recentTestPlans"
:index=
"'/track/plan/view/' + t.id"
>
{{
t
.
name
}}
</el-menu-item>
</el-menu>
</
template
>
<
script
>
import
{
ROLE_TEST_MANAGER
,
ROLE_TEST_USER
,
ROLE_TEST_VIEWER
}
from
"
../../../../../common/constants
"
;
export
default
{
name
:
"
RecentTestPlan
"
,
mounted
()
{
const
rolesString
=
localStorage
.
getItem
(
"
roles
"
);
const
roles
=
rolesString
.
split
(
'
,
'
);
if
(
roles
.
indexOf
(
ROLE_TEST_MANAGER
)
>
-
1
||
roles
.
indexOf
(
ROLE_TEST_USER
)
>
-
1
||
roles
.
indexOf
(
ROLE_TEST_VIEWER
)
>
-
1
)
{
this
.
$get
(
'
/test/plan/recent/5
'
,
(
response
)
=>
{
this
.
recentTestPlans
=
response
.
data
;
});
}
},
data
()
{
return
{
recentTestPlans
:
[]
}
}
}
</
script
>
<
style
scoped
>
.recent-text
{
padding-left
:
10%
;
color
:
#777777
;
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录