Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
aeee3749
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,体验更适合开发者的 AI 搜索 >>
提交
aeee3749
编写于
5月 12, 2021
作者:
S
song-tianyang
提交者:
BugKing
5月 13, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 修复测试场景批量修改环境的问题
修复测试场景批量修改环境的问题
上级
a71780e3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
60 addition
and
8 deletion
+60
-8
backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java
...o/metersphere/api/controller/ApiAutomationController.java
+8
-0
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
...java/io/metersphere/api/service/ApiAutomationService.java
+7
-0
backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.java
.../io/metersphere/base/mapper/ext/ExtApiScenarioMapper.java
+2
-0
backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml
...a/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml
+7
-0
frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
...ss/components/api/automation/scenario/ApiScenarioList.vue
+14
-1
frontend/src/business/components/track/case/components/BatchEdit.vue
...c/business/components/track/case/components/BatchEdit.vue
+22
-7
未找到文件。
backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java
浏览文件 @
aeee3749
...
...
@@ -51,6 +51,14 @@ public class ApiAutomationController {
return
apiAutomationService
.
listAll
(
request
);
}
@PostMapping
(
"/listWithIds/all"
)
@RequiresRoles
(
value
=
{
RoleConstants
.
TEST_MANAGER
,
RoleConstants
.
TEST_USER
,
RoleConstants
.
TEST_VIEWER
},
logical
=
Logical
.
OR
)
public
List
<
ApiScenarioWithBLOBs
>
listWithIds
(
@RequestBody
ApiScenarioBatchRequest
request
)
{
return
apiAutomationService
.
listWithIds
(
request
);
}
@PostMapping
(
"/id/all"
)
@RequiresRoles
(
value
=
{
RoleConstants
.
TEST_MANAGER
,
RoleConstants
.
TEST_USER
,
RoleConstants
.
TEST_VIEWER
},
logical
=
Logical
.
OR
)
public
List
<
String
>
idAll
(
@RequestBody
ApiScenarioBatchRequest
request
)
{
...
...
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
浏览文件 @
aeee3749
...
...
@@ -1767,4 +1767,11 @@ public class ApiAutomationService {
public
void
updateCustomNumByProjectId
(
String
id
)
{
extApiScenarioMapper
.
updateCustomNumByProjectId
(
id
);
}
public
List
<
ApiScenarioWithBLOBs
>
listWithIds
(
ApiScenarioBatchRequest
request
)
{
ServiceUtils
.
getSelectAllIds
(
request
,
request
.
getCondition
(),
(
query
)
->
extApiScenarioMapper
.
selectIdsByQuery
((
ApiScenarioRequest
)
query
));
List
<
ApiScenarioWithBLOBs
>
list
=
extApiScenarioMapper
.
listWithIds
(
request
.
getIds
());
return
list
;
}
}
backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.java
浏览文件 @
aeee3749
...
...
@@ -43,4 +43,6 @@ public interface ExtApiScenarioMapper {
List
<
String
>
selectIdsByQuery
(
@Param
(
"request"
)
ApiScenarioRequest
request
);
void
updateCustomNumByProjectId
(
@Param
(
"projectId"
)
String
projectId
);
List
<
ApiScenarioWithBLOBs
>
listWithIds
(
@Param
(
"ids"
)
List
<
String
>
ids
);
}
backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml
浏览文件 @
aeee3749
...
...
@@ -257,6 +257,13 @@
</foreach>
</select>
<select
id=
"listWithIds"
resultType=
"io.metersphere.base.domain.ApiScenarioWithBLOBs"
>
select id from api_scenario where id in
<foreach
collection=
"ids"
item=
"v"
separator=
","
open=
"("
close=
")"
>
#{v}
</foreach>
</select>
<select
id=
"selectByIds"
resultType=
"io.metersphere.base.domain.ApiScenarioWithBLOBs"
>
select * from api_scenario where id in (${ids}) ORDER BY FIND_IN_SET(id,${oderId})
</select>
...
...
frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
浏览文件 @
aeee3749
...
...
@@ -520,8 +520,21 @@
this
.
planVisible
=
true
;
},
handleBatchEdit
()
{
this
.
$refs
.
batchEdit
.
open
(
this
.
selectDataCounts
);
this
.
$refs
.
batchEdit
.
setScenarioSelectRows
(
this
.
selectRows
,
"
scenario
"
);
if
(
this
.
condition
.
selectAll
){
this
.
condition
.
ids
=
[];
let
param
=
{};
this
.
buildBatchParam
(
param
);
this
.
$post
(
'
/api/automation/listWithIds/all
'
,
param
,
response
=>
{
let
dataRows
=
response
.
data
;
this
.
$refs
.
batchEdit
.
open
(
dataRows
.
size
);
this
.
$refs
.
batchEdit
.
setAllDataRows
(
dataRows
);
this
.
$refs
.
batchEdit
.
open
(
this
.
selectDataCounts
);
});
}
else
{
this
.
$refs
.
batchEdit
.
setAllDataRows
(
new
Set
());
this
.
$refs
.
batchEdit
.
open
(
this
.
selectDataCounts
);
}
},
handleBatchMove
()
{
this
.
$refs
.
testBatchMove
.
open
(
this
.
moduleTree
,
[],
this
.
moduleOptions
);
...
...
frontend/src/business/components/track/case/components/BatchEdit.vue
浏览文件 @
aeee3749
...
...
@@ -72,6 +72,7 @@
projectList
:
[],
projectIds
:
new
Set
(),
selectRows
:
new
Set
(),
allDataRows
:
new
Set
(),
projectEnvMap
:
new
Map
(),
map
:
new
Map
(),
isScenario
:
''
,
...
...
@@ -121,6 +122,9 @@
this
.
selectRows
=
rows
;
this
.
isScenario
=
sign
;
},
setAllDataRows
(
rows
){
this
.
allDataRows
=
rows
;
},
handleClose
()
{
this
.
form
=
{};
this
.
options
=
[];
...
...
@@ -131,14 +135,25 @@
if
(
val
===
'
projectEnv
'
&&
this
.
isScenario
!==
''
)
{
this
.
projectIds
.
clear
();
this
.
map
.
clear
();
this
.
selectRows
.
forEach
(
row
=>
{
let
id
=
this
.
isScenario
===
'
scenario
'
?
row
.
id
:
row
.
caseId
;
this
.
result
=
this
.
$get
(
'
/api/automation/getApiScenarioProjectId/
'
+
id
,
res
=>
{
let
data
=
res
.
data
;
data
.
projectIds
.
forEach
(
d
=>
this
.
projectIds
.
add
(
d
));
this
.
map
.
set
(
row
.
id
,
data
.
projectIds
);
if
(
this
.
allDataRows
!=
null
&&
this
.
allDataRows
.
length
>
0
){
this
.
allDataRows
.
forEach
(
row
=>
{
let
id
=
this
.
isScenario
===
'
scenario
'
?
row
.
id
:
row
.
caseId
;
this
.
result
=
this
.
$get
(
'
/api/automation/getApiScenarioProjectId/
'
+
id
,
res
=>
{
let
data
=
res
.
data
;
data
.
projectIds
.
forEach
(
d
=>
this
.
projectIds
.
add
(
d
));
this
.
map
.
set
(
row
.
id
,
data
.
projectIds
);
})
})
}
else
{
this
.
selectRows
.
forEach
(
row
=>
{
let
id
=
this
.
isScenario
===
'
scenario
'
?
row
.
id
:
row
.
caseId
;
this
.
result
=
this
.
$get
(
'
/api/automation/getApiScenarioProjectId/
'
+
id
,
res
=>
{
let
data
=
res
.
data
;
data
.
projectIds
.
forEach
(
d
=>
this
.
projectIds
.
add
(
d
));
this
.
map
.
set
(
row
.
id
,
data
.
projectIds
);
})
})
}
)
}
}
this
.
filterable
=
val
===
"
maintainer
"
||
val
===
"
executor
"
;
this
.
options
=
this
.
valueArr
[
val
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录