fix:表格错位问题,添加逐条评审

This commit is contained in:
wenyann 2021-03-23 10:23:31 +08:00
parent bfff069b6e
commit 56b58ce9cd
9 changed files with 143 additions and 40 deletions

View File

@ -1,16 +1,16 @@
package io.metersphere.track.service;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.TestCaseMapper;
import io.metersphere.base.mapper.TestCaseReviewMapper;
import io.metersphere.base.mapper.TestCaseReviewTestCaseMapper;
import io.metersphere.base.mapper.TestCaseReviewUsersMapper;
import io.metersphere.base.mapper.*;
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
import io.metersphere.base.mapper.ext.ExtTestReviewCaseMapper;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.ServiceUtils;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.controller.request.member.QueryMemberRequest;
import io.metersphere.service.UserService;
import io.metersphere.track.dto.TestCaseTestDTO;
import io.metersphere.track.dto.TestPlanCaseDTO;
import io.metersphere.track.dto.TestReviewCaseDTO;
import io.metersphere.track.request.testplancase.TestReviewCaseBatchRequest;
import io.metersphere.track.request.testreview.DeleteRelevanceRequest;
@ -29,7 +29,14 @@ import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
public class TestReviewTestCaseService {
@Resource
private TestCaseTestMapper testCaseTestMapper;
@Resource
private LoadTestMapper loadTestMapper;
@Resource
private ApiTestCaseMapper apiTestCaseMapper;
@Resource
private ApiScenarioMapper apiScenarioMapper;
@Resource
ExtTestReviewCaseMapper extTestReviewCaseMapper;
@Resource
@ -44,6 +51,8 @@ public class TestReviewTestCaseService {
TestCaseReviewService testCaseReviewService;
@Resource
TestCaseMapper testCaseMapper;
@Resource
ExtTestPlanTestCaseMapper extTestPlanTestCaseMapper;
public List<TestReviewCaseDTO> list(QueryCaseReviewRequest request) {
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
@ -128,7 +137,40 @@ public class TestReviewTestCaseService {
}
public TestReviewCaseDTO get(String reviewId) {
return extTestReviewCaseMapper.get(reviewId);
TestReviewCaseDTO testReviewCaseDTO=extTestReviewCaseMapper.get(reviewId);
List<TestCaseTestDTO> testCaseTestDTOS = extTestPlanTestCaseMapper.listTestCaseTest(testReviewCaseDTO.getCaseId());
testCaseTestDTOS.forEach(dto -> {
setTestName(dto);
});
testReviewCaseDTO.setList(testCaseTestDTOS);
return testReviewCaseDTO;
}
private void setTestName(TestCaseTestDTO dto) {
String type = dto.getTestType();
String id = dto.getTestId();
switch (type) {
case "performance":
LoadTest loadTest = loadTestMapper.selectByPrimaryKey(id);
if (loadTest != null) {
dto.setTestName(loadTest.getName());
}
break;
case "testcase":
ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = apiTestCaseMapper.selectByPrimaryKey(id);
if (apiTestCaseWithBLOBs != null) {
dto.setTestName(apiTestCaseWithBLOBs.getName());
}
break;
case "automation":
ApiScenarioWithBLOBs apiScenarioWithBLOBs = apiScenarioMapper.selectByPrimaryKey(id);
if (apiScenarioWithBLOBs != null) {
dto.setTestName(apiScenarioWithBLOBs.getName());
}
break;
default:
break;
}
}
public void editTestCaseBatchStatus(TestReviewCaseBatchRequest request) {

View File

@ -419,6 +419,9 @@
});
this.loading = false;
this.unSelection = data.listObject.map(s => s.id);
if (this.$refs.scenarioTable) {
this.$refs.scenarioTable.doLayout()
}
});
}
getLabel(this, API_SCENARIO_LIST);

View File

@ -260,6 +260,10 @@ export default {
},
created: function () {
this.initTable();
this.$nextTick(() => {
this.$refs.caseTable.bodyWrapper.scrollTop = 5
})
},
watch: {
selectNodeIds() {
@ -331,9 +335,13 @@ export default {
item.tags = JSON.parse(item.tags);
}
})
if (this.$refs.caseTable) {
this.$refs.caseTable.doLayout()
}
});
}
getLabel(this, API_CASE_LIST);
},
open() {
this.$refs.searchBar.open();
@ -636,4 +644,7 @@ export default {
top: -2px;
}
/deep/ .el-table__fixed {
height: 100% !important;
}
</style>

View File

@ -442,6 +442,10 @@
item.tags = JSON.parse(item.tags);
}
})
if (this.$refs.apiDefinitionTable) {
this.$refs.apiDefinitionTable.doLayout()
}
});
}
getLabel(this, API_LIST);

View File

@ -97,17 +97,12 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item :label="$t('test_track.case.relate_test')" :label-width="formLabelWidth" prop="testId">
<el-cascader show-all-levels v-model="form.selected" :props="props" ></el-cascader>
<el-col :span="14">
<el-form-item :label="$t('test_track.case.relate_test')" :label-width="formLabelWidth">
<el-cascader filterable placeholder="请选择要关联的测试" show-all-levels v-model="form.selected" :props="props"
class="ms-case"></el-cascader>
</el-form-item>
</el-col>
<!-- <el-col :span="7" v-if="form.testId=='other'">
<el-form-item :label="$t('test_track.case.test_name')" :label-width="formLabelWidth" prop="testId">
<el-input v-model="form.otherTestName" :placeholder="$t('test_track.case.input_test_case')"></el-input>
</el-form-item>
</el-col>-->
</el-row>
<el-row>
@ -125,8 +120,9 @@
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="需求名称" :label-width="formLabelWidth" prop="demandName" v-if="form.demandId=='other'">
<el-col :span="10" :offset="1">
<el-form-item label="需求ID/名称" :label-width="formLabelWidth" prop="demandName"
v-if="form.demandId=='other'">
<el-input v-model="form.demandName"></el-input>
</el-form-item>
</el-col>
@ -340,7 +336,6 @@ export default {
}
if (this.projectId && this.form.type != '' && this.form.type != 'undefined') {
this.$get(url, response => {
response.data.unshift({id: 'other', name: this.$t('test_track.case.other')})
const nodes = response.data
.map(item => ({
value: item.id,
@ -581,8 +576,10 @@ export default {
}
Object.assign(this.form, tmp);
this.form.module = testCase.nodeId;
/*
this.form.testId=testCase.selected
console.log(this.form.testId)
*/
console.log(this.form.selected)
this.getFileMetaData(testCase);
},
setTestCaseExtInfo(testCase) {
@ -778,7 +775,6 @@ export default {
});
},
getTestOptions(val) {
console.log(val)
this.projectId = getCurrentProjectID()
this.testOptions = [];
let url = '';
@ -998,6 +994,10 @@ export default {
width: 100%;
}
.ms-case {
width: 100%;
}
/deep/ .el-button-group > .el-button:first-child {
border-top-right-radius: 0;
border-bottom-right-radius: 0;

View File

@ -29,6 +29,7 @@ export default {
},
methods: {
open(file) {
console.log(file)
this.file = file;
this.dialogVisible = true;
},

View File

@ -443,6 +443,10 @@ export default {
item.tags = JSON.parse(item.tags);
}
})
if (this.$refs.table) {
this.$refs.table.doLayout()
}
});
}
},

View File

@ -33,6 +33,7 @@
:select-ids="new Set(Array.from(this.selectRows).map(row => row.id))" @refresh="initTableData"/>
<el-table
ref="table"
class="adjust-table"
border
@select-all="handleSelectAll"
@ -479,6 +480,9 @@ export default {
}
}
this.selectRows.clear();
if (this.$refs.table) {
this.$refs.table.doLayout()
}
});
}
getLabel(this, TEST_PLAN_FUNCTION_TEST_CASE);

View File

@ -74,8 +74,12 @@
</el-row>
<el-row>
<el-col :offset="1">
<span class="cast_label">{{ $t('test_track.plan_view.relevance_test_case') }}</span>
<span class="cast_item">{{ testCase.prerequisite }}</span>
<span class="cast_label">关联测试</span>
<span v-for="(item,index) in testCase.list" :key="index">
<el-button @click="openTest(item)" type="text" style="margin-left: 7px;">{{
item.testName
}}</el-button>
</span>
</el-col>
</el-row>
<el-row>
@ -241,7 +245,7 @@ import PerformanceTestDetail from "../../../plan/view/comonents/test/Performance
import ApiTestResult from "../../../plan/view/comonents/test/ApiTestResult";
import ApiTestDetail from "../../../plan/view/comonents/test/ApiTestDetail";
import TestPlanTestCaseStatusButton from "../../../plan/common/TestPlanTestCaseStatusButton";
import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {getCurrentProjectID, getUUID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import ReviewComment from "../../commom/ReviewComment";
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
import ApiCaseItem from "@/business/components/api/definition/components/case/ApiCaseItem";
@ -295,6 +299,35 @@ export default {
}
},
methods: {
openTest(item) {
const type = item.testType;
const id = item.testId;
switch (type) {
case "performance": {
let performanceData = this.$router.resolve({
path: '/performance/test/edit/' + id,
})
window.open(performanceData.href, '_blank');
break;
}
case "testcase": {
let caseData = this.$router.resolve({
name: 'ApiDefinition',
params: {redirectID: getUUID(), dataType: "apiTestCase", dataSelectRange: 'single:' + id}
});
window.open(caseData.href, '_blank');
break;
}
case "automation": {
let automationData = this.$router.resolve({
name: 'ApiAutomation',
params: {redirectID: getUUID(), dataType: "scenario", dataSelectRange: 'edit:' + id}
});
window.open(automationData.href, '_blank');
break;
}
}
},
handleClose() {
removeGoBackListener(this.handleClose);
this.showDialog = false;
@ -354,6 +387,7 @@ export default {
item.steptResults.push(item.steps[i]);
}
this.testCase = item;
console.log(this.testCase)
this.getRelatedTest();
this.getComments(item);
/* this.initTest();*/