Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
44e1cf16
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,发现更多精彩内容 >>
提交
44e1cf16
编写于
3月 26, 2021
作者:
C
Captain.B
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/v1.8' into v1.8
上级
4214e63b
ae3d1adf
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
710 addition
and
458 deletion
+710
-458
backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java
...o/metersphere/api/controller/ApiAutomationController.java
+10
-0
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
...java/io/metersphere/api/service/ApiAutomationService.java
+14
-0
frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
...ss/components/api/automation/scenario/ApiScenarioList.vue
+60
-17
frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue
...ents/api/definition/components/list/ApiCaseSimpleList.vue
+477
-433
frontend/src/business/components/api/definition/components/list/ApiList.vue
...ess/components/api/definition/components/list/ApiList.vue
+31
-2
frontend/src/business/components/settings/organization/OrganizationMember.vue
...s/components/settings/organization/OrganizationMember.vue
+28
-0
frontend/src/business/components/settings/system/User.vue
frontend/src/business/components/settings/system/User.vue
+31
-1
frontend/src/business/components/settings/workspace/WorkspaceMember.vue
...usiness/components/settings/workspace/WorkspaceMember.vue
+25
-0
frontend/src/business/components/track/case/components/TestCaseList.vue
...usiness/components/track/case/components/TestCaseList.vue
+29
-1
frontend/src/common/js/tableUtils.js
frontend/src/common/js/tableUtils.js
+5
-4
未找到文件。
backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java
浏览文件 @
44e1cf16
...
...
@@ -74,11 +74,21 @@ public class ApiAutomationController {
apiAutomationService
.
deleteBatch
(
ids
);
}
@PostMapping
(
"/deleteBatchByCondition"
)
public
void
deleteBatchByCondition
(
@RequestBody
ApiScenarioBatchRequest
request
)
{
apiAutomationService
.
deleteBatchByCondition
(
request
);
}
@PostMapping
(
"/removeToGc"
)
public
void
removeToGc
(
@RequestBody
List
<
String
>
ids
)
{
apiAutomationService
.
removeToGc
(
ids
);
}
@PostMapping
(
"/removeToGcByBatch"
)
public
void
removeToGcByBatch
(
@RequestBody
ApiScenarioBatchRequest
request
)
{
apiAutomationService
.
removeToGcByBatch
(
request
);
}
@PostMapping
(
"/reduction"
)
public
void
reduction
(
@RequestBody
List
<
String
>
ids
)
{
apiAutomationService
.
reduction
(
ids
);
...
...
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
浏览文件 @
44e1cf16
...
...
@@ -1001,4 +1001,18 @@ public class ApiAutomationService {
}
});
}
public
void
removeToGcByBatch
(
ApiScenarioBatchRequest
request
)
{
ServiceUtils
.
getSelectAllIds
(
request
,
request
.
getCondition
(),
(
query
)
->
extApiScenarioMapper
.
selectIdsByQuery
((
ApiScenarioRequest
)
query
));
this
.
removeToGc
(
request
.
getIds
());
}
public
void
deleteBatchByCondition
(
ApiScenarioBatchRequest
request
)
{
ServiceUtils
.
getSelectAllIds
(
request
,
request
.
getCondition
(),
(
query
)
->
extApiScenarioMapper
.
selectIdsByQuery
((
ApiScenarioRequest
)
query
));
this
.
deleteBatch
(
request
.
getIds
());
}
}
frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
浏览文件 @
44e1cf16
...
...
@@ -348,6 +348,9 @@
},
watch
:
{
selectNodeIds
()
{
this
.
condition
.
selectAll
=
false
;
this
.
condition
.
unSelectIds
=
[];
this
.
selectDataCounts
=
0
;
this
.
selectProjectId
?
this
.
search
(
this
.
selectProjectId
)
:
this
.
search
();
},
trashEnable
()
{
...
...
@@ -357,6 +360,10 @@
}
else
{
this
.
condition
.
filters
=
{
status
:
[
"
Prepare
"
,
"
Underway
"
,
"
Completed
"
]};
}
this
.
condition
.
selectAll
=
false
;
this
.
condition
.
unSelectIds
=
[];
this
.
selectDataCounts
=
0
;
this
.
search
();
},
batchReportId
()
{
...
...
@@ -414,9 +421,13 @@
break
;
}
this
.
selection
=
[];
this
.
selectAll
=
false
;
this
.
unSelection
=
[];
this
.
selectDataCounts
=
0
;
if
(
!
this
.
condition
.
selectAll
){
this
.
condition
.
selectAll
=
false
;
this
.
condition
.
unSelectIds
=
[];
this
.
selectDataCounts
=
0
;
}
let
url
=
"
/api/automation/list/
"
+
this
.
currentPage
+
"
/
"
+
this
.
pageSize
;
if
(
this
.
condition
.
projectId
)
{
this
.
result
.
loading
=
true
;
...
...
@@ -430,23 +441,53 @@
}
});
this
.
result
.
loading
=
false
;
this
.
unSelection
=
data
.
listObject
.
map
(
s
=>
s
.
id
);
if
(
this
.
$refs
.
scenarioTable
)
{
setTimeout
(
this
.
$refs
.
scenarioTable
.
doLayout
,
200
)
}
if
(
!
this
.
condition
.
selectAll
){
this
.
condition
.
unSelectIds
=
response
.
data
.
listObject
.
map
(
s
=>
s
.
id
);
}
this
.
$nextTick
(
function
(){
this
.
checkTableRowIsSelect
();
})
});
}
getLabel
(
this
,
API_SCENARIO_LIST
);
},
checkTableRowIsSelect
(){
//如果默认全选的话,则选中应该选中的行
if
(
this
.
condition
.
selectAll
){
let
unSelectIds
=
this
.
condition
.
unSelectIds
;
this
.
tableData
.
forEach
(
row
=>
{
if
(
unSelectIds
.
indexOf
(
row
.
id
)
<
0
){
this
.
$refs
.
scenarioTable
.
toggleRowSelection
(
row
,
true
);
//默认全选,需要把选中对行添加到selectRows中。不然会影响到勾选函数统计
if
(
!
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
true
);
this
.
selectRows
.
add
(
row
);
}
}
else
{
//不勾选的行,也要判断是否被加入了selectRow中。加入了的话就去除。
if
(
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
false
);
this
.
selectRows
.
delete
(
row
);
}
}
})
}
},
handleCommand
(
cmd
)
{
let
table
=
this
.
$refs
.
scenarioTable
;
switch
(
cmd
)
{
case
"
table
"
:
this
.
selectAll
=
false
;
this
.
condition
.
selectAll
=
false
;
table
.
toggleAllSelection
();
break
;
case
"
all
"
:
this
.
selectAll
=
true
;
this
.
condition
.
selectAll
=
true
;
break
}
},
...
...
@@ -520,11 +561,6 @@
addTestPlan
(
params
)
{
let
obj
=
{
planIds
:
params
[
0
],
scenarioIds
:
this
.
selection
};
// obj.projectId = getCurrentProjectID();
// obj.selectAllDate = this.isSelectAllDate;
// obj.unSelectIds = this.unSelection;
// obj = Object.assign(obj, this.condition);
// todo 选取全部数据
if
(
this
.
isSelectAllDate
)
{
this
.
$warning
(
"
暂不支持批量添加所有场景到测试计划!
"
);
...
...
@@ -619,8 +655,10 @@
},
handleDeleteBatch
(
row
)
{
if
(
this
.
trashEnable
)
{
let
ids
=
Array
.
from
(
this
.
selectRows
).
map
(
row
=>
row
.
id
);
this
.
$post
(
'
/api/automation/deleteBatch/
'
,
ids
,
()
=>
{
//let ids = Array.from(this.selectRows).map(row => row.id);
let
param
=
{};
this
.
buildBatchParam
(
param
);
this
.
$post
(
'
/api/automation/deleteBatchByCondition/
'
,
param
,
()
=>
{
this
.
$success
(
this
.
$t
(
'
commons.delete_success
'
));
this
.
search
();
});
...
...
@@ -630,8 +668,10 @@
confirmButtonText
:
this
.
$t
(
'
commons.confirm
'
),
callback
:
(
action
)
=>
{
if
(
action
===
'
confirm
'
)
{
let
ids
=
Array
.
from
(
this
.
selectRows
).
map
(
row
=>
row
.
id
);
this
.
$post
(
'
/api/automation/removeToGc/
'
,
ids
,
()
=>
{
//let ids = Array.from(this.selectRows).map(row => row.id);
let
param
=
{};
this
.
buildBatchParam
(
param
);
this
.
$post
(
'
/api/automation/removeToGcByBatch/
'
,
param
,
()
=>
{
this
.
$success
(
this
.
$t
(
'
commons.delete_success
'
));
this
.
search
();
});
...
...
@@ -686,8 +726,11 @@
confirmButtonText
:
this
.
$t
(
'
commons.confirm
'
),
callback
:
(
action
)
=>
{
if
(
action
===
'
confirm
'
)
{
let
ids
=
[
row
.
id
];
this
.
$post
(
'
/api/automation/removeToGc/
'
,
ids
,
()
=>
{
// let ids = [row.id];
let
param
=
{};
this
.
buildBatchParam
(
param
);
this
.
$post
(
'
/api/automation/removeToGcByBatch/
'
,
param
,
()
=>
{
// this.$post('/api/automation/removeToGc/', ids, () => {
this
.
$success
(
this
.
$t
(
'
commons.delete_success
'
));
this
.
search
();
});
...
...
frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue
浏览文件 @
44e1cf16
此差异已折叠。
点击以展开。
frontend/src/business/components/api/definition/components/list/ApiList.vue
浏览文件 @
44e1cf16
...
...
@@ -386,9 +386,11 @@
},
watch
:
{
selectNodeIds
()
{
initCondition
(
this
.
condition
,
false
);
this
.
initTable
();
},
currentProtocol
()
{
initCondition
(
this
.
condition
,
false
);
this
.
initTable
();
},
trashEnable
()
{
...
...
@@ -398,6 +400,7 @@
}
else
{
this
.
condition
.
filters
=
{
status
:
[
"
Prepare
"
,
"
Underway
"
,
"
Completed
"
]};
}
initCondition
(
this
.
condition
,
false
);
this
.
initTable
();
}
},
...
...
@@ -419,7 +422,7 @@
},
initTable
()
{
this
.
selectRows
=
new
Set
();
initCondition
(
this
.
condition
);
initCondition
(
this
.
condition
,
this
.
condition
.
selectAll
);
this
.
selectDataCounts
=
0
;
this
.
condition
.
moduleIds
=
this
.
selectNodeIds
;
this
.
condition
.
projectId
=
this
.
projectId
;
...
...
@@ -464,11 +467,37 @@
if
(
this
.
$refs
.
apiDefinitionTable
)
{
setTimeout
(
this
.
$refs
.
apiDefinitionTable
.
doLayout
,
200
)
}
// nexttick:表格加载完成之后触发。判断是否需要勾选行
this
.
$nextTick
(
function
(){
this
.
checkTableRowIsSelect
();
})
});
}
getLabel
(
this
,
API_LIST
);
},
checkTableRowIsSelect
(){
//如果默认全选的话,则选中应该选中的行
if
(
this
.
condition
.
selectAll
){
let
unSelectIds
=
this
.
condition
.
unSelectIds
;
this
.
tableData
.
forEach
(
row
=>
{
if
(
unSelectIds
.
indexOf
(
row
.
id
)
<
0
){
this
.
$refs
.
apiDefinitionTable
.
toggleRowSelection
(
row
,
true
);
//默认全选,需要把选中对行添加到selectRows中。不然会影响到勾选函数统计
if
(
!
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
true
);
this
.
selectRows
.
add
(
row
);
}
}
else
{
//不勾选的行,也要判断是否被加入了selectRow中。加入了的话就去除。
if
(
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
false
);
this
.
selectRows
.
delete
(
row
);
}
}
})
}
},
genProtocalFilter
(
protocalType
)
{
if
(
protocalType
===
"
HTTP
"
)
{
this
.
methodFilters
=
[
...
...
frontend/src/business/components/settings/organization/OrganizationMember.vue
浏览文件 @
44e1cf16
...
...
@@ -216,8 +216,36 @@
})
}
this
.
total
=
data
.
itemCount
;
this
.
$nextTick
(
function
(){
this
.
checkTableRowIsSelect
();
});
})
},
checkTableRowIsSelect
(){
//如果默认全选的话,则选中应该选中的行
if
(
this
.
condition
.
selectAll
){
let
unSelectIds
=
this
.
condition
.
unSelectIds
;
this
.
tableData
.
forEach
(
row
=>
{
if
(
unSelectIds
.
indexOf
(
row
.
id
)
<
0
){
this
.
$refs
.
userTable
.
toggleRowSelection
(
row
,
true
);
//默认全选,需要把选中对行添加到selectRows中。不然会影响到勾选函数统计
if
(
!
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
true
);
this
.
selectRows
.
add
(
row
);
}
}
else
{
//不勾选的行,也要判断是否被加入了selectRow中。加入了的话就去除。
if
(
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
false
);
this
.
selectRows
.
delete
(
row
);
}
}
})
}
},
buildPagePath
(
path
)
{
return
path
+
"
/
"
+
this
.
currentPage
+
"
/
"
+
this
.
pageSize
;
},
...
...
frontend/src/business/components/settings/system/User.vue
浏览文件 @
44e1cf16
...
...
@@ -598,7 +598,7 @@ export default {
return
;
}
this
.
selectRows
=
new
Set
();
this
.
condition
.
selectAll
=
false
;
//
this.condition.selectAll = false;
this
.
result
=
this
.
$post
(
this
.
buildPagePath
(
this
.
queryPath
),
this
.
condition
,
response
=>
{
let
data
=
response
.
data
;
this
.
total
=
data
.
itemCount
;
...
...
@@ -615,8 +615,38 @@ export default {
});
}
}
this
.
$nextTick
(
function
(){
this
.
checkTableRowIsSelect
();
});
})
},
checkTableRowIsSelect
(){
//如果默认全选的话,则选中应该选中的行
if
(
this
.
condition
.
selectAll
){
let
unSelectIds
=
this
.
condition
.
unSelectIds
;
this
.
tableData
.
forEach
(
row
=>
{
if
(
unSelectIds
.
indexOf
(
row
.
id
)
<
0
){
this
.
$refs
.
userTable
.
toggleRowSelection
(
row
,
true
);
//默认全选,需要把选中对行添加到selectRows中。不然会影响到勾选函数统计
if
(
!
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
true
);
this
.
selectRows
.
add
(
row
);
}
}
else
{
//不勾选的行,也要判断是否被加入了selectRow中。加入了的话就去除。
if
(
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
false
);
this
.
selectRows
.
delete
(
row
);
}
}
})
}
},
handleClose
()
{
this
.
form
=
{
roles
:
[{
id
:
''
}]};
this
.
btnAddRole
=
false
;
...
...
frontend/src/business/components/settings/workspace/WorkspaceMember.vue
浏览文件 @
44e1cf16
...
...
@@ -208,8 +208,33 @@
})
}
this
.
total
=
data
.
itemCount
;
this
.
$nextTick
(
function
(){
this
.
checkTableRowIsSelect
();
});
})
},
checkTableRowIsSelect
(){
//如果默认全选的话,则选中应该选中的行
if
(
this
.
condition
.
selectAll
){
let
unSelectIds
=
this
.
condition
.
unSelectIds
;
this
.
tableData
.
forEach
(
row
=>
{
if
(
unSelectIds
.
indexOf
(
row
.
id
)
<
0
){
this
.
$refs
.
userTable
.
toggleRowSelection
(
row
,
true
);
//默认全选,需要把选中对行添加到selectRows中。不然会影响到勾选函数统计
if
(
!
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
true
);
this
.
selectRows
.
add
(
row
);
}
}
else
{
//不勾选的行,也要判断是否被加入了selectRow中。加入了的话就去除。
if
(
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
false
);
this
.
selectRows
.
delete
(
row
);
}
}
})
}
},
buildPagePath
(
path
)
{
return
path
+
"
/
"
+
this
.
currentPage
+
"
/
"
+
this
.
pageSize
;
...
...
frontend/src/business/components/track/case/components/TestCaseList.vue
浏览文件 @
44e1cf16
...
...
@@ -314,6 +314,7 @@ export default {
watch
:
{
selectNodeIds
()
{
this
.
currentPage
=
1
;
initCondition
(
this
.
condition
,
false
);
this
.
initTableData
();
},
condition
()
{
...
...
@@ -332,7 +333,8 @@ export default {
initTableData
()
{
this
.
condition
.
planId
=
""
;
this
.
condition
.
nodeIds
=
[];
initCondition
(
this
.
condition
);
//initCondition(this.condition);
initCondition
(
this
.
condition
,
this
.
condition
.
selectAll
);
this
.
selectDataCounts
=
0
;
if
(
this
.
planId
)
{
// param.planId = this.planId;
...
...
@@ -394,9 +396,35 @@ export default {
setTimeout
(
this
.
$refs
.
table
.
doLayout
,
200
)
}
this
.
$nextTick
(
function
(){
this
.
checkTableRowIsSelect
();
})
});
}
},
checkTableRowIsSelect
(){
//如果默认全选的话,则选中应该选中的行
if
(
this
.
condition
.
selectAll
){
let
unSelectIds
=
this
.
condition
.
unSelectIds
;
this
.
tableData
.
forEach
(
row
=>
{
if
(
unSelectIds
.
indexOf
(
row
.
id
)
<
0
){
this
.
$refs
.
table
.
toggleRowSelection
(
row
,
true
);
//默认全选,需要把选中对行添加到selectRows中。不然会影响到勾选函数统计
if
(
!
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
true
);
this
.
selectRows
.
add
(
row
);
}
}
else
{
//不勾选的行,也要判断是否被加入了selectRow中。加入了的话就去除。
if
(
this
.
selectRows
.
has
(
row
))
{
this
.
$set
(
row
,
"
showMore
"
,
false
);
this
.
selectRows
.
delete
(
row
);
}
}
})
}
},
search
()
{
this
.
initTableData
();
},
...
...
frontend/src/common/js/tableUtils.js
浏览文件 @
44e1cf16
...
...
@@ -43,7 +43,6 @@ export function setUnSelectIds(tableData, condition, selectRows) {
condition
.
unSelectIds
=
allIDs
.
filter
(
function
(
val
)
{
return
ids
.
indexOf
(
val
)
===
-
1
});
}
export
function
getSelectDataCounts
(
condition
,
total
,
selectRows
)
{
...
...
@@ -102,9 +101,11 @@ export function _sort(column, condition) {
}
}
export
function
initCondition
(
condition
)
{
condition
.
selectAll
=
false
;
condition
.
unSelectIds
=
[];
export
function
initCondition
(
condition
,
isSelectAll
)
{
if
(
!
isSelectAll
){
condition
.
selectAll
=
false
;
condition
.
unSelectIds
=
[];
}
}
export
function
getLabel
(
vueObj
,
type
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录