fix(测试跟踪): 关联评审用例高级搜索未添加自定义字段&评审截止时间校验有误

--bug=1029672 --user=宋昌昌 【测试跟踪】github#26471,关联评审用例时的过滤器不能选择自定义字段 https://www.tapd.cn/55049933/s/1413784
This commit is contained in:
song-cc-rock 2023-09-07 18:14:12 +08:00 committed by fit2-zhao
parent 44aeb43baf
commit ab2578d8a1
11 changed files with 290 additions and 286 deletions

View File

@ -1,56 +1,56 @@
<template>
<span class="adv-search-bar">
<el-link type="primary" @click="open" v-if="showLink">{{
$t("commons.adv_search.title")
}}</el-link>
$t("commons.adv_search.title")
}}</el-link>
<el-dialog
:title="$t('commons.adv_search.title')"
:visible.sync="visible"
custom-class="adv-dialog"
:append-to-body="true"
:title="$t('commons.adv_search.title')"
:visible.sync="visible"
custom-class="adv-dialog"
:append-to-body="true"
>
<div class="search-items">
<div
class="search-item"
v-for="component in optional.components"
:key="component.key"
class="search-item"
v-for="component in optional.components"
:key="component.key"
>
<el-row>
<el-col :span="22">
<component
:is="component.name"
:component="component"
:components.sync="config.components"
@updateKey="changeSearchItemKey"
:custom="condition.custom"
:is="component.name"
:component="component"
:components.sync="config.components"
@updateKey="changeSearchItemKey"
:custom="condition.custom"
/>
</el-col>
<el-col :span="2">
<i
class="el-icon-close delete-icon"
@click="remove(component)"
v-if="optional.components.length !== 1"
class="el-icon-close delete-icon"
@click="remove(component)"
v-if="optional.components.length !== 1"
></i>
</el-col>
</el-row>
</div>
<el-link
type="primary"
icon="el-icon-plus"
v-if="showAddFilterLink"
class="add-filter-link"
@click="addFilter"
>{{ $t("commons.adv_search.add_filter_link") }}</el-link
type="primary"
icon="el-icon-plus"
v-if="showAddFilterLink"
class="add-filter-link"
@click="addFilter"
>{{ $t("commons.adv_search.add_filter_link") }}</el-link
>
</div>
<template v-slot:footer>
<div class="dialog-footer">
<el-button @click="reset">{{
$t("commons.adv_search.reset")
}}</el-button>
$t("commons.adv_search.reset")
}}</el-button>
<el-button type="primary" @click="search">{{
$t("commons.adv_search.search")
}}</el-button>
$t("commons.adv_search.search")
}}</el-button>
</div>
</template>
</el-dialog>
@ -59,11 +59,11 @@
<script>
import components from "./search-components";
import { cloneDeep, concat, slice } from "lodash-es";
import { _findByKey, _findIndexByKey } from "./custom-component";
import {cloneDeep, concat, slice} from "lodash-es";
import {_findByKey, _findIndexByKey} from "./custom-component";
export default {
components: { ...components },
components: {...components},
name: "MsTableAdvSearchBar",
props: {
condition: Object,
@ -98,9 +98,9 @@ export default {
config.components.forEach((component) => {
let operator = component.operator.value;
component.operator.value =
operator === undefined
? component.operator.options[0].value
: operator;
operator === undefined
? component.operator.options[0].value
: operator;
});
if (!handleCustom) {
return config;
@ -108,7 +108,7 @@ export default {
if (this.condition.custom) {
let components = [];
this.systemFiled = config.components.filter(
(co) => co.custom === undefined || co.custom === false
(co) => co.custom === undefined || co.custom === false
);
this.customFiled = config.components.filter((co) => co.custom === true);
//
@ -151,15 +151,15 @@ export default {
// custom false
//
if (
component.custom ||
[
"严重程度",
"处理人",
"状态",
"用例状态",
"责任人",
"用例等级",
].indexOf(component.label) > -1
component.custom ||
[
"严重程度",
"处理人",
"状态",
"用例状态",
"责任人",
"用例等级",
].indexOf(component.label) > -1
) {
this.handleCustomField(condition, component);
return;
@ -175,16 +175,16 @@ export default {
}
let value = component.value;
if (
component.label === "用例状态" &&
value.length === 1 &&
value.indexOf("Trash") > -1
component.label === "用例状态" &&
value.length === 1 &&
value.indexOf("Trash") > -1
) {
return;
}
if (
component.type === "multipleMember" ||
component.type === "checkbox" ||
component.type === "multipleSelect"
component.type === "multipleMember" ||
component.type === "checkbox" ||
component.type === "multipleSelect"
) {
try {
value = JSON.stringify(component.value);
@ -205,9 +205,9 @@ export default {
if (component.operator.value !== undefined) {
let operator = _findByKey(source, component.key).operator.value;
component.operator.value =
operator === undefined
? component.operator.options[0].value
: operator;
operator === undefined
? component.operator.options[0].value
: operator;
}
if (component.value !== undefined) {
component.value = source[index].value;
@ -224,28 +224,28 @@ export default {
this.config = this.doInit(true);
this.optional = this.doInit();
if (
this.optional.components.length &&
this.optional.components.length <= this.showItemSize
this.optional.components.length &&
this.optional.components.length <= this.showItemSize
) {
this.showAddFilterLink = false;
}
//
this.optional.components = slice(
this.optional.components,
0,
this.showItemSize
this.optional.components,
0,
this.showItemSize
);
let allComponent = this.condition.custom
? concat(
this.config.components[0].child,
this.config.components[1].child
? concat(
this.config.components[0].child,
this.config.components[1].child
)
: this.config.components;
: this.config.components;
for (let component of allComponent) {
let co = _findByKey(this.optional.components, component.key);
co
? this.$set(co, "disable", true)
: this.$set(component, "disable", false);
? this.$set(co, "disable", true)
: this.$set(component, "disable", false);
}
},
open() {
@ -262,17 +262,17 @@ export default {
refreshComponentOption() {
//
let comps = this.optional.components.filter(
(cp) => cp.init && cp.init instanceof Function
(cp) => cp.init && cp.init instanceof Function
);
comps.forEach((comp) => comp.init());
},
setModulesParam() {
let comps = this.optional.components.filter(
(c) => c.key === "moduleIds" && c.options.type === "POST"
(c) => c.key === "moduleIds" && c.options.type === "POST"
);
comps.forEach(
(comp) =>
(comp.options.params = { projectId: this.condition.projectId })
(comp) =>
(comp.options.params = {projectId: this.condition.projectId})
);
},
handleCustomComponent() {
@ -280,16 +280,16 @@ export default {
newConfig.components.forEach((component) => {
let operator = component.operator.value;
component.operator.value =
operator === undefined
? component.operator.options[0].value
: operator;
operator === undefined
? component.operator.options[0].value
: operator;
});
this.newCustomFiled = newConfig.components.filter((co) => co.custom);
for (let customField of this.newCustomFiled) {
let co = _findByKey(this.optional.components, customField.key);
co
? this.$set(co, "disable", true)
: this.$set(customField, "disable", false);
? this.$set(co, "disable", true)
: this.$set(customField, "disable", false);
}
this.config.components[1] = {
label: this.$t("custom_field.name"),
@ -298,8 +298,8 @@ export default {
},
addFilter() {
const index = _findIndexByKey(
this.optional.components,
this.nullFilterKey
this.optional.components,
this.nullFilterKey
);
if (index > -1) {
this.$warning(this.$t("commons.adv_search.add_filter_link_tip"));
@ -323,8 +323,8 @@ export default {
} else {
//
const components = concat(
this.config.components[0].child,
this.config.components[1].child
this.config.components[0].child,
this.config.components[1].child
);
this.enableOptional(component, components);
}
@ -350,8 +350,8 @@ export default {
components = this.config.components;
} else {
components = concat(
this.config.components[0].child,
this.config.components[1].child
this.config.components[0].child,
this.config.components[1].child
);
}
for (let op of components) {

View File

@ -363,9 +363,9 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
public List<TestCaseNodeDTO> getRelateReviewNodes(QueryTestCaseRequest request) {
request.setNodeIds(null);
ServiceUtils.buildCombineTagsToSupportMultiple(request);
ServiceUtils.setBaseQueryRequestCustomMultipleFields(request);
List<TestCaseNodeDTO> countMNodes = extTestCaseMapper.getTestReviewRelateCountNodes(request);
List<TestCaseNodeDTO> testCaseNodes = extTestCaseNodeMapper.getNodeTreeByProjectId(request.getProjectId());
ServiceUtils.setBaseQueryRequestCustomMultipleFields(request);
return getNodeTreeWithPruningTreeByCaseCount(testCaseNodes, getCountMap(countMNodes));
}

View File

@ -154,6 +154,7 @@ public class TestCaseReviewService {
/**
* 计算评审的通过率和用例总数
*
* @param list
*/
private void calcReviewRate(List<TestCaseReviewDTO> list) {
@ -303,12 +304,11 @@ public class TestCaseReviewService {
}
public TestCaseReview editCaseReview(SaveTestCaseReviewRequest testCaseReview) {
TestCaseReview originReview = testCaseReviewMapper.selectByPrimaryKey(testCaseReview.getId());
editCaseReviewer(testCaseReview);
editCaseRevieweFollow(testCaseReview);
testCaseReview.setUpdateTime(System.currentTimeMillis());
checkCaseReviewExist(testCaseReview);
TestCaseReview originReview = testCaseReviewMapper.selectByPrimaryKey(testCaseReview.getId());
testCaseReviewMapper.updateByPrimaryKeySelective(testCaseReview);
if (!StringUtils.equals(testCaseReview.getReviewPassRule(), originReview.getReviewPassRule())) {
@ -369,7 +369,7 @@ public class TestCaseReviewService {
});
}
for (TestCaseReviewTestCase reviewTestCase : testCaseReviewTestCases) {
for (TestCaseReviewTestCase reviewTestCase : testCaseReviewTestCases) {
if (StringUtils.equalsAny(reviewTestCase.getStatus(),
TestReviewCaseStatus.Pass.name(), TestReviewCaseStatus.UnPass.name(), TestReviewCaseStatus.Underway.name())) {
// 重新计算评审状态
@ -555,7 +555,7 @@ public class TestCaseReviewService {
public void editTestReviewStatus(String reviewId) {
String status = extTestCaseReviewMapper.selectStatusById(reviewId);
if (StringUtils.equalsAnyIgnoreCase(status, TestCaseReviewStatus.Completed.name(), TestCaseReviewStatus.Finished.name())){
if (StringUtils.equalsAnyIgnoreCase(status, TestCaseReviewStatus.Completed.name(), TestCaseReviewStatus.Finished.name())) {
return;
}
@ -563,7 +563,7 @@ public class TestCaseReviewService {
TestCaseReview testCaseReview = new TestCaseReview();
testCaseReview.setId(reviewId);
if (statusList.contains(TestReviewCaseStatus.Underway.name()) || statusList.contains(TestReviewCaseStatus.Again.name()) ) {
if (statusList.contains(TestReviewCaseStatus.Underway.name()) || statusList.contains(TestReviewCaseStatus.Again.name())) {
return;
}

View File

@ -1058,6 +1058,7 @@ public class TestCaseService {
public List<TestCaseDTO> getReviewCase(QueryTestCaseRequest request) {
setDefaultOrder(request);
ServiceUtils.buildCombineTagsToSupportMultiple(request);
ServiceUtils.setBaseQueryRequestCustomMultipleFields(request);
request.getOrders().forEach(order -> {
order.setPrefix("test_case");
});

View File

@ -849,15 +849,17 @@ public class TestReviewTestCaseService {
/**
* 检查执行结果自动更新计划状态
*
* @param testCaseReviewDTO
*/
public void checkStatus(TestCaseReviewDTO testCaseReviewDTO) {
if (testCaseReviewDTO.getEndTime() != null && testCaseReviewDTO.getEndTime() < System.currentTimeMillis() && !testCaseReviewDTO.getStatus().equals(TestPlanStatus.Finished.name())) {
if (testCaseReviewDTO.getEndTime() != null && testCaseReviewDTO.getEndTime() < System.currentTimeMillis()
&& StringUtils.equalsAny(testCaseReviewDTO.getStatus(), TestPlanStatus.Underway.name(), TestPlanStatus.Prepare.name(), TestPlanStatus.Completed.name())) {
TestCaseReviewExample example = new TestCaseReviewExample();
example.createCriteria().andIdEqualTo(testCaseReviewDTO.getId());
TestCaseReview review = new TestCaseReview();
review.setStatus(TestPlanStatus.Finished.name());
testCaseReviewMapper.updateByExampleSelective(review,example);
testCaseReviewMapper.updateByExampleSelective(review, example);
testCaseReviewDTO.setStatus(TestPlanStatus.Finished.name());
}
}

View File

@ -247,3 +247,4 @@ case_export_text_validate_tip=Contains extremely long text, currently supported
case_import_table_header_missing=Header information is missing!
relate_resource=relate
test_plan_run_message=The current test plan is running, please try again later
test_review_end_time_early=Deadline cannot be earlier than current time

View File

@ -218,3 +218,4 @@ case_export_text_validate_tip=包含超长文本,目前支持最大长度为 %
case_import_table_header_not_exist=缺少表头信息!
relate_resource=关联
test_plan_run_message=当前测试计划正在执行中,请稍后再试!
test_review_end_time_early=截止时间不能早于当前时间!

View File

@ -218,3 +218,4 @@ case_export_text_validate_tip=包含超長文本,目前支持最大長度為 %
case_import_table_header_not_exist=缺少表頭信息!
relate_resource=關聯
test_plan_run_message=當前測試計劃正在執行中,請稍後再試!
test_review_end_time_early=截止時間不能早於當前時間!

View File

@ -1,14 +1,14 @@
<template>
<test-case-relevance-base
@setProject="setProject"
@save="saveCaseRelevance"
:enable-full-screen="false"
@close="close"
:flag="isTestPlan"
:multiple-project="multipleProject"
:is-saving="isSaving"
ref="baseRelevance">
@setProject="setProject"
@save="saveCaseRelevance"
:enable-full-screen="false"
@close="close"
:flag="isTestPlan"
:multiple-project="multipleProject"
:is-saving="isSaving"
ref="baseRelevance">
<template v-slot:aside>
<node-tree class="node-tree"
@ -28,61 +28,61 @@
</ms-table-header>
<ms-table
v-loading="page.loading"
:data="page.data"
:condition="page.condition"
:total="page.total"
:page-size.sync="page.pageSize"
:screen-height="screenHeight"
row-key="id"
:reserve-option="true"
:page-refresh="pageRefresh"
@handlePageChange="getTestCases"
@selectCountChange="setSelectCounts"
@order="getTestCases"
@filter="search"
ref="table">
v-loading="page.loading"
:data="page.data"
:condition="page.condition"
:total="page.total"
:page-size.sync="page.pageSize"
:screen-height="screenHeight"
row-key="id"
:reserve-option="true"
:page-refresh="pageRefresh"
@handlePageChange="getTestCases"
@selectCountChange="setSelectCounts"
@order="getTestCases"
@filter="search"
ref="table">
<ms-table-column
v-if="!customNum"
prop="num"
sortable
:label="$t('commons.id')">
v-if="!customNum"
prop="num"
sortable
:label="$t('commons.id')">
</ms-table-column>
<ms-table-column
v-if="customNum"
prop="customNum"
sortable
:label="$t('commons.id')">
v-if="customNum"
prop="customNum"
sortable
:label="$t('commons.id')">
</ms-table-column>
<ms-table-column prop="name" :label="$t('commons.name')"/>
<ms-table-column
v-if="versionEnable && versionFilters"
prop="versionId"
:filters="versionFilters"
:label="$t('commons.version')"
show-overflow-tooltip>
v-if="versionEnable && versionFilters"
prop="versionId"
:filters="versionFilters"
:label="$t('commons.version')"
show-overflow-tooltip>
<template v-slot:default="scope">
<span>{{ scope.row.versionName }}</span>
</template>
</ms-table-column>
<ms-table-column
prop="priority"
:filters="priorityOptions"
sortable
:label="$t('test_track.case.priority')"
width="120px">
prop="priority"
:filters="priorityOptions"
sortable
:label="$t('test_track.case.priority')"
width="120px">
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority" :priority-options="priorityOptions"/>
</template>
</ms-table-column>
<test-plan-case-status-table-item
sortable
prop="lastExecuteResult"/>
sortable
prop="lastExecuteResult"/>
<test-case-review-status-table-item sortable/>
@ -92,13 +92,13 @@
<div v-html="getTagToolTips(scope.row.tags)" slot="content"></div>
<div class="oneLine">
<ms-tag
v-for="(itemName, index) in scope.row.tags"
:key="index"
type="success"
effect="plain"
:show-tooltip="scope.row.tags.length === 1 && itemName.length * 12 <= 100"
:content="itemName"
style="margin-left: 0px; margin-right: 2px" />
v-for="(itemName, index) in scope.row.tags"
:key="index"
type="success"
effect="plain"
:show-tooltip="scope.row.tags.length === 1 && itemName.length * 12 <= 100"
:content="itemName"
style="margin-left: 0px; margin-right: 2px"/>
</div>
</el-tooltip>
</template>
@ -257,14 +257,14 @@ export default {
},
getCustomNum() {
getProjectApplicationConfig('CASE_CUSTOM_NUM')
.then(result => {
let data = result.data;
if (data && data.typeValue === 'true') {
this.customNum = true;
} else {
this.customNum = false;
}
});
.then(result => {
let data = result.data;
if (data && data.typeValue === 'true') {
this.customNum = true;
} else {
this.customNum = false;
}
});
},
search() {
//
@ -327,7 +327,7 @@ export default {
},
getVersionOptions() {
getVersionFilters(this.projectId)
.then(r => this.versionFilters = r.data);
.then(r => this.versionFilters = r.data);
},
changeVersion(currentVersion) {
this.page.condition.versionId = currentVersion || null;

View File

@ -13,10 +13,10 @@
<el-row>
<el-col :span="10">
<el-form-item
:placeholder="$t('test_track.review.input_review_name')"
:label="$t('test_track.review.review_name')"
:label-width="formLabelWidth"
prop="name">
:placeholder="$t('test_track.review.input_review_name')"
:label="$t('test_track.review.review_name')"
:label-width="formLabelWidth"
prop="name">
<el-input v-model="form.name"/>
</el-form-item>
</el-col>
@ -31,16 +31,16 @@
<el-col :span="10">
<el-form-item :label="$t('test_track.review.reviewer')" :label-width="formLabelWidth" prop="userIds">
<el-select
v-model="form.userIds"
:placeholder="$t('test_track.review.input_reviewer')"
filterable multiple
style="width: 100%"
v-model="form.userIds"
:placeholder="$t('test_track.review.input_reviewer')"
filterable multiple
style="width: 100%"
>
<el-option
v-for="item in reviewerOptions"
:key="item.id"
:label="item.name"
:value="item.id">
v-for="item in reviewerOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<div v-if="isEdit" class="item-tip">
@ -63,13 +63,13 @@
<el-form-item :label="$t('review.review_pass_rule')" :label-width="formLabelWidth" prop="reviewPassRule">
<el-select v-model="form.reviewPassRule" default-first-option>
<el-option
v-for="item in [
v-for="item in [
{text: 'review.review_pass_rule_single', value: 'SINGLE'},
{text: 'review.review_pass_rule_all', value: 'ALL'}
]"
:key="item.value"
:label="$t(item.text)"
:value="item.value">
:key="item.value"
:label="$t(item.text)"
:value="item.value">
</el-option>
</el-select>
<ms-instructions-icon :content="$t('review.review_rule_tip')" effect="light"/>
@ -199,65 +199,60 @@ export default {
this.reload();
},
reviewInfo() {
this.$refs['reviewForm'].validate((valid) => {
if (valid) {
if (this.form.status !== 'Finished' && this.form.status !== 'Archived' && !this.compareTime(new Date().getTime(), this.form.endTime)) {
return false;
}
let param = {};
Object.assign(param, this.form);
param.name = param.name.trim();
if (this.form.tags instanceof Array) {
this.form.tags = JSON.stringify(this.form.tags);
}
param.tags = this.form.tags;
if (param.name === '') {
this.$warning(this.$t('test_track.plan.input_plan_name'));
return;
}
if (!this.compareTime(new Date().getTime(), this.form.endTime)) {
return false;
if (this.form.tags instanceof Array) {
this.form.tags = JSON.stringify(this.form.tags);
}
param.tags = this.form.tags;
param.projectId = this.projectId;
if (this.projectId) {
saveOrUpdateTestCaseReview(this.operationType, param)
.then((response) => {
this.dialogFormVisible = false;
this.$router.push('/track/review/view/' + response.data.id);
});
.then((response) => {
this.dialogFormVisible = false;
this.$router.push('/track/review/view/' + response.data.id);
});
}
} else {
return false;
}
});
},
saveReview() {
this.$refs['reviewForm'].validate((valid) => {
if (valid) {
if (this.form.status !== 'Finished' && this.form.status !== 'Archived' && !this.compareTime(new Date().getTime(), this.form.endTime)) {
return false;
}
let param = {};
Object.assign(param, this.form);
param.name = param.name.trim();
if (this.form.tags instanceof Array) {
this.form.tags = JSON.stringify(this.form.tags);
}
param.tags = this.form.tags;
if (param.name === '') {
this.$warning(this.$t('test_track.plan.input_plan_name'));
return;
}
if (!this.compareTime(new Date().getTime(), this.form.endTime)) {
return false;
if (this.form.tags instanceof Array) {
this.form.tags = JSON.stringify(this.form.tags);
}
param.tags = this.form.tags;
param.projectId = this.projectId;
if (this.projectId) {
saveOrUpdateTestCaseReview(this.operationType, param)
.then(() => {
this.$success(this.$t('commons.save_success'));
this.dialogFormVisible = false;
this.$emit("refresh");
});
.then(() => {
this.$success(this.$t('commons.save_success'));
this.dialogFormVisible = false;
this.$emit("refresh");
});
}
} else {
return false;
@ -266,9 +261,9 @@ export default {
},
setReviewerOptions() {
getMaintainer()
.then((response) => {
this.reviewerOptions = response.data;
})
.then((response) => {
this.reviewerOptions = response.data;
})
},
statusChange(status) {
this.form.status = status;
@ -298,6 +293,10 @@ export default {
endTimeChange(value) {
if (value) {
this.form.endTime = this.form.endTime.getTime();
if (this.form.status === 'Finished' || this.form.status === 'Archived') {
// ,
return;
}
this.compareTime(new Date().getTime(), value.getTime());
}
},

View File

@ -21,18 +21,18 @@
<el-container class="main-content">
<ms-aside-container
:min-width="'350'"
:max-width="'600'"
:enable-aside-hidden="false"
:default-hidden-bottom-top="200"
:enable-auto-height="true"
:min-width="'350'"
:max-width="'600'"
:enable-aside-hidden="false"
:default-hidden-bottom-top="200"
:enable-auto-height="true"
>
<select-menu
:data="projects"
width="173px"
:current-data="currentProject"
:title="$t('test_track.switch_project')"
@dataChange="changeProject"/>
:data="projects"
width="173px"
:current-data="currentProject"
:title="$t('test_track.switch_project')"
@dataChange="changeProject"/>
<node-tree class="node-tree"
:all-label="$t('commons.all_label.review')"
v-loading="result.loading"
@ -45,7 +45,8 @@
<el-container>
<el-main class="case-content">
<ms-table-header :tip="$t('commons.search_by_name_or_id')" :condition.sync="condition" @search="search" title="" :show-create="false">
<ms-table-header :tip="$t('commons.search_by_name_or_id')" :condition.sync="condition" @search="search"
title="" :show-create="false">
<template v-slot:searchBarBefore>
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion" margin-right="20"/>
</template>
@ -63,61 +64,61 @@
ref="table">
<el-table-column
v-if="!customNum"
prop="num"
min-width="120"
sortable
:label="$t('commons.id')">
v-if="!customNum"
prop="num"
min-width="120"
sortable
:label="$t('commons.id')">
</el-table-column>
<el-table-column
v-if="customNum"
prop="customNum"
min-width="120"
sortable
:label="$t('commons.id')">
v-if="customNum"
prop="customNum"
min-width="120"
sortable
:label="$t('commons.id')">
</el-table-column>
<el-table-column
prop="name"
:label="$t('test_track.case.name')"
min-width="120"
show-overflow-tooltip>
prop="name"
:label="$t('test_track.case.name')"
min-width="120"
show-overflow-tooltip>
<template v-slot:default="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column
v-if="versionEnable"
prop="versionName"
:label="$t('test_track.case.version')"
column-key="versionId"
:filters="versionFilters"
style="width: 100%">
v-if="versionEnable"
prop="versionName"
:label="$t('test_track.case.version')"
column-key="versionId"
:filters="versionFilters"
style="width: 100%">
<template v-slot:default="scope">
{{ scope.row.versionName }}
</template>
</el-table-column>
<el-table-column
prop="priority"
:filters="priorityFilters"
column-key="priority"
:label="$t('test_track.case.priority')"
min-width="120"
show-overflow-tooltip>
prop="priority"
:filters="priorityFilters"
column-key="priority"
:label="$t('test_track.case.priority')"
min-width="120"
show-overflow-tooltip>
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority" :priority-options="priorityFilters"/>
</template>
</el-table-column>
<el-table-column
:filters="statusFilters"
column-key="reviewStatus"
:label="$t('test_track.case.status')"
min-width="120"
show-overflow-tooltip>
:filters="statusFilters"
column-key="reviewStatus"
:label="$t('test_track.case.status')"
min-width="120"
show-overflow-tooltip>
<template v-slot:default="scope">
<review-status :value="scope.row.reviewStatus"/>
</template>
@ -270,9 +271,6 @@ export default {
this.getVersionOptions();
}
},
activated() {
this.loadConditionComponents();
},
updated() {
this.toggleSelection(this.testReviews);
},
@ -290,9 +288,9 @@ export default {
}
})
},
fullScreen(){
fullScreen() {
this.isFullScreen = !this.isFullScreen;
this.screenHeight = this.isFullScreen ?'calc(100vh - 180px)' :'calc(100vh - 420px)'
this.screenHeight = this.isFullScreen ? 'calc(100vh - 180px)' : 'calc(100vh - 420px)'
},
setConditionModuleIdParam() {
this.condition.components.forEach(component => {
@ -302,13 +300,14 @@ export default {
});
},
async openTestReviewRelevanceDialog() {
this.condition = {
components: TEST_REVIEW_RELEVANCE_CASE_CONFIGS
};
//
this.condition = {components: TEST_REVIEW_RELEVANCE_CASE_CONFIGS};
this.getProject();
this.dialogFormVisible = true;
await this.getProjectNode(this.projectId);
this.getReviews();
//
this.loadConditionComponents();
},
saveReviewRelevance() {
let param = {};
@ -323,13 +322,13 @@ export default {
param.testCaseIds = ['all'];
}
getTestCaseReviewRelevance(param)
.then(() => {
this.selectIds.clear();
this.selectCounts = 0;
this.$success(this.$t('commons.save_success'));
this.dialogFormVisible = false;
this.$emit('refresh');
});
.then(() => {
this.selectIds.clear();
this.selectCounts = 0;
this.$success(this.$t('commons.save_success'));
this.dialogFormVisible = false;
this.$emit('refresh');
});
},
buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize;
@ -347,12 +346,12 @@ export default {
initCondition(this.condition, this.condition.selectAll);
this.condition.projectId = this.projectId || getCurrentProjectID();
getTestCaseReviewsCasePage(this.currentPage, this.pageSize, this.condition)
.then((response) => {
let data = response.data;
this.total = data.itemCount;
this.testReviews = data.listObject;
this.result.loading = false;
});
.then((response) => {
let data = response.data;
this.total = data.itemCount;
this.testReviews = data.listObject;
this.result.loading = false;
});
},
setSelectCounts(data) {
this.selectCounts = data;
@ -374,10 +373,10 @@ export default {
this.dialogFormVisible = false;
this.condition.filters = {};
this.condition.combine = {};
if(this.condition.projectId) {
if (this.condition.projectId) {
delete this.condition.projectId;
}
this.projectId= '';
this.projectId = '';
},
filter(filters) {
_filter(filters, this.condition);
@ -396,22 +395,22 @@ export default {
getProject() {
if (this.reviewId) {
projectRelated({userId: getCurrentUserId(), workspaceId: getCurrentWorkspaceId()})
.then((res) => {
let data = res.data;
if (data) {
this.projects = data;
const index = data.findIndex(d => d.id === getCurrentProjectID());
if (index !== -1) {
this.projectId = data[index].id;
this.projectName = data[index].name;
this.currentProject = data[index];
} else {
this.projectId = data[0].id;
this.projectName = data[0].name;
this.currentProject = data[0];
.then((res) => {
let data = res.data;
if (data) {
this.projects = data;
const index = data.findIndex(d => d.id === getCurrentProjectID());
if (index !== -1) {
this.projectId = data[index].id;
this.projectName = data[index].name;
this.currentProject = data[index];
} else {
this.projectId = data[0].id;
this.projectName = data[0].name;
this.currentProject = data[0];
}
}
}
});
});
}
},
switchProject() {
@ -438,16 +437,16 @@ export default {
this.projectId = projectId;
}
testCaseNodeListReviewRelate({reviewId: this.reviewId, projectId: this.projectId, ...condition})
.then((response) => {
this.treeNodes = response.data;
resolve();
});
.then((response) => {
this.treeNodes = response.data;
resolve();
});
this.selectNodeIds = [];
});
},
getVersionOptions() {
getVersionFilters(this.projectId)
.then(r => this.versionFilters = r.data);
.then(r => this.versionFilters = r.data);
},
changeVersion(version) {
this.condition.versionId = version || null;
@ -455,14 +454,14 @@ export default {
},
getCustomNum() {
getProjectApplicationConfig('CASE_CUSTOM_NUM')
.then(result => {
let data = result.data;
if (data && data.typeValue === 'true') {
this.customNum = true;
} else {
this.customNum = false;
}
});
.then(result => {
let data = result.data;
if (data && data.typeValue === 'true') {
this.customNum = true;
} else {
this.customNum = false;
}
});
},
}
}