fix(测试跟踪): 功能用例列表页批量操作问题

--bug=1022779 --user=宋昌昌 【测试跟踪】功能用例批量复制、批量移动功能没有生效 https://www.tapd.cn/55049933/s/1335738
This commit is contained in:
song-cc-rock 2023-02-15 15:56:56 +08:00 committed by 刘瑞斌
parent 0cf34d4f25
commit 151ab0a3d1
14 changed files with 62 additions and 14 deletions

View File

@ -63,6 +63,8 @@ export default {
i.el-icon-delete {
margin-top: 10px;
margin-left: 24px;
min-width: 200px;
display: flex;
}
.el-icon-delete:before {

View File

@ -24,7 +24,7 @@
</el-dropdown-menu>
</el-dropdown>
<i class="delimiter">|</i>
<el-button size="mini" icon="el-icon-close" @click="close" style="float: right; margin: 5px 19px;"></el-button>
<el-button size="mini" icon="el-icon-close" @click="close" style="margin: 0 30px 0 20px"></el-button>
</div>
</el-col>
</el-row>
@ -57,12 +57,14 @@ export default {
</script>
<style scoped>
.name-edit {
padding-left: 10px;
}
.head-bar {
background: white;
height: 45px;
line-height: 45px;
padding: 0 10px;
border: 1px solid #EBEEF5;
box-shadow: 0 0 2px 0 rgba(31, 31, 31, 0.15), 0 1px 2px 0 rgba(31, 31, 31, 0.15);
}
@ -135,4 +137,13 @@ i.delimiter {
top: -2px;
left: 15px;
}
.ms-export {
float: right;
}
:deep(.el-icon-close:before) {
position: relative;
top: 2px;
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<div class="recycle" v-if="this.isXpack" @click="exe">
<div style="padding: 9px 13px 9px 13px;" class="to-public">
<svg-icon icon-class="icon_folder-share" style="width: 1.3em;height: 1.3em;position: relative;top: 4px;left: 1px;margin-right: 9px;"/>
<svg-icon icon-class="icon_folder-share" style="width: 1.3em;height: 1.3em;position: relative;top: 2px;left: 1px;margin-right: 9px;"/>
<span style="margin-right: 12px;">{{ $t('project.case_public') }}</span>
<span style="color: #8F959E">{{ '(' + publicTotal + ')' }}</span>
</div>
@ -73,6 +73,7 @@ export default {
width: auto;
border-radius: 4px;
display: flex;
overflow-x: hidden;
}
.to-public:hover {

View File

@ -700,7 +700,7 @@ export default {
:deep(.node-icon .svg-icon) {
width: 1.2em;
height: 1.2em;
margin-top: 4px;
margin-top: 2px;
}
.node-title {

View File

@ -373,8 +373,15 @@ export default {
}
},
handleSelectAll(selection) {
if (this.condition.selectAll) {
return;
}
_handleSelectAll(this, selection, this.data, this.selectRows, this.condition);
setUnSelectIds(this.data, this.condition, this.selectRows);
if (this.condition.selectAll) {
this.condition.unSelectIds = [];
} else {
setUnSelectIds(this.data, this.condition, this.selectRows);
}
this.selectDataCounts = getSelectDataCounts(this.condition, this.total, this.selectRows);
this.selectIds = Array.from(this.selectRows).map(o => o.id);
//
@ -422,7 +429,7 @@ export default {
//
this.selectDataCounts = getSelectDataCounts(this.condition, this.total, this.selectRows);
this.selectIds = Array.from(this.selectRows).map(o => o.id);
this.$emit('callBackSelect');
this.$emit(data ? 'callBackSelectAll' : 'callBackSelect');
},
headerDragend(newWidth, oldWidth, column, event) {
if (column) {

View File

@ -352,6 +352,7 @@ export default {
.search-item {
display: block;
width: 100%;
margin-left: -15px;
}
.delete-icon {
@ -370,6 +371,7 @@ export default {
height: 26px;
width: 112px;
border-radius: 4px;
float: left;
}
:deep(span.el-select__tags-text) {
@ -431,7 +433,7 @@ span.condition-num {
:deep(button.el-button.el-button--default.el-button--mini svg) {
position: relative;
right: 7px;
top: 1px;
top: -1px;
width: 14px;
height: 14px;
}

View File

@ -14,7 +14,6 @@
@change="changeTreeTag"
class="search-select"
size="small"
collapse-tags
multiple>
<div class="search-div">
<el-option

View File

@ -1412,7 +1412,7 @@
inner join project p on p.id = test_case.project_id
<include refid="queryWhereCondition"/>
and p.workspace_id = #{request.workspaceId}
group by tcn.id;
group by tcn.id, test_case.project_id;
</select>
<update id="updateNoModuleTrashNodeToDefault">

View File

@ -80,6 +80,7 @@ import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
@Transactional(rollbackFor = Exception.class)
@ -1894,6 +1895,12 @@ public class TestCaseService {
batchEditTag(request);
} else {
// 批量移动
if (request.getCondition().isSelectAll()) {
// 全选则重新设置MoveIds
List<TestCaseDTO> testCaseDTOS = listTestCase(request.getCondition());
List<String> ids = testCaseDTOS.stream().map(TestCaseDTO::getId).collect(Collectors.toList());
request.setIds(ids);
}
TestCaseWithBLOBs batchEdit = new TestCaseWithBLOBs();
BeanUtils.copyBean(batchEdit, request);
batchEdit.setUpdateTime(System.currentTimeMillis());

View File

@ -248,5 +248,24 @@ button.el-button.el-button--default.el-button--small.el-button--danger {
.el-icon-warning:before, .el-icon-success:before {
font-size: 17px;
}
/**
* el-icon-close
*/
i.el-tag__close.el-icon-close {
height: 0;
}
.el-select .el-tag__close.el-icon-close::before {
font-size: 26px;
position: relative;
top: -7px;
left: -6px;
}
.el-tag.el-tag--info .el-tag__close:hover {
color: #1F2329;
background-color: #909399;
}
</style>

View File

@ -143,7 +143,6 @@
:tree-nodes="treeNodes"
:version-enable="versionEnable"
@refreshTable="refresh"
@testCaseCopy="copyTestCase"
@refresh="refresh"
@refreshAll="refreshAll"
@refreshPublic="refreshPublic"

View File

@ -77,12 +77,13 @@ export default {
}
},
methods: {
open(isMoveBatch, caseTitle, treeNodes, selectNum, moduleOptions) {
open(isMoveBatch, caseTitle, treeNodes, selectNum, selectIds, moduleOptions) {
this.isMoveBatch = isMoveBatch;
this.moveCaseTitle = caseTitle;
this.dialogVisible = true;
this.treeNodes = treeNodes;
this.selectNum = selectNum;
this.selectIds = selectIds;
this.moduleOptions = moduleOptions;
},
save() {

View File

@ -1151,12 +1151,12 @@ export default {
handleBatchMove() {
this.isMoveBatch = true;
let firstSelectRow = this.$refs.table.selectRows.values().next().value;
this.$refs.testBatchMove.open(this.isMoveBatch, firstSelectRow.name, this.treeNodes, this.selectCounts, this.moduleOptions);
this.$refs.testBatchMove.open(this.isMoveBatch, firstSelectRow.name, this.treeNodes, this.selectCounts, this.$refs.table.selectIds, this.moduleOptions);
},
handleBatchCopy() {
this.isMoveBatch = false;
let firstSelectRow = this.$refs.table.selectRows.values().next().value;
this.$refs.testBatchMove.open(this.isMoveBatch, firstSelectRow.name, this.treeNodes, this.selectCounts, this.moduleOptions);
this.$refs.testBatchMove.open(this.isMoveBatch, firstSelectRow.name, this.treeNodes, this.selectCounts, this.$refs.table.selectIds, this.moduleOptions);
},
_handleDeleteVersion(testCase, deleteCurrentVersion) {
//

View File

@ -352,7 +352,7 @@
or test_case.tags like CONCAT('%', #{request.name},'%')
or test_case.custom_num like CONCAT('%', #{request.name},'%'))
</if>
<if test="request.ids != null">
<if test="request.ids != null and request.ids.size() > 0">
and test_case.id in
<foreach collection="request.ids" item="id" separator="," open="(" close=")">
#{id}