fix(测试跟踪): 部分列表搜索条件清空后,页码与当前显示数据对不上

--bug=1014352 --user=陈建星 【测试跟踪】测试计划/用例评审/缺陷管理相关页面在第二页搜索数据为空时,清空关键字后首页数据展示不正确 https://www.tapd.cn/55049933/s/1190765
This commit is contained in:
chenjianxing 2022-06-27 17:14:19 +08:00 committed by jianxing
parent 7fc3b24d3f
commit 53d179ff4f
11 changed files with 74 additions and 25 deletions

View File

@ -1,17 +1,18 @@
<template>
<span>
<slot name="header"></slot>
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable" class="search-input" size="small"
@keyup.enter.native="initTable" v-model="condition.name"/>
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="search" class="search-input" size="small"
@keyup.enter.native="search" v-model="condition.name"/>
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
v-if="condition.components !== undefined && condition.components.length > 0"
@search="initTable"/>
@search="search"/>
<ms-table :data="tableData" :select-node-ids="selectNodeIds" :condition="condition" :page-size="pageSize"
:total="total" enableSelection @selectCountChange="selectCountChange"
:screenHeight="screenHeight"
operator-width="170px"
@refresh="initTable"
@order="initTable"
@filter="search"
ref="apitable">
<ms-table-column
prop="num"
@ -234,6 +235,11 @@ export default {
getSelectIds() {
return this.$refs.apitable.selectIds;
},
search() {
//
this.currentPage = 1;
this.initTable();
},
initTable() {
this.$emit('refreshTable');
},

View File

@ -431,6 +431,7 @@ export default {
if (this.rememberOrder) {
saveLastTableSortField(this.fieldKey, JSON.stringify(this.condition.orders));
}
this.$emit('order');
this.handleRefresh();
},
handleBatchEdit() {

View File

@ -4,7 +4,7 @@
<el-card class="table-card">
<template v-slot:header>
<ms-table-header :create-permission="['PROJECT_TRACK_ISSUE:READ+CREATE']" :condition.sync="page.condition" @search="getIssues" @create="handleCreate"
<ms-table-header :create-permission="['PROJECT_TRACK_ISSUE:READ+CREATE']" :condition.sync="page.condition" @search="search" @create="handleCreate"
:create-tip="$t('test_track.issue.create_issue')"
:tip="$t('commons.search_by_name_or_id')">
<template v-slot:button>
@ -30,7 +30,8 @@
@handlePageChange="getIssues"
:fields.sync="fields"
:field-key="tableHeaderKey"
@refresh="getIssues"
@order="getIssues"
@filter="search"
:custom-fields="issueTemplate.customFields"
ref="table"
>
@ -303,6 +304,11 @@ export default {
}
if (this.$refs.table) this.$refs.table.reloadTable();
},
search() {
//
this.page.currentPage = 1;
this.getIssues();
},
getIssues() {
this.page.condition.projectId = this.projectId;
this.page.condition.workspaceId= this.workspaceId;

View File

@ -2,7 +2,7 @@
<el-card class="table-card" v-loading="cardResult.loading">
<template v-slot:header>
<ms-table-header :create-permission="['PROJECT_TRACK_PLAN:READ+CREATE']" :condition.sync="condition"
@search="initTableData" @create="testPlanCreate"
@search="search" @create="testPlanCreate"
:create-tip="$t('test_track.plan.create_plan')"/>
</template>
@ -22,8 +22,9 @@
:fields.sync="fields"
:field-key="tableHeaderKey"
@handlePageChange="intoPlan"
@refresh="initTableData"
@order="initTableData"
ref="testPlanLitTable"
@filter="search"
@handleRowClick="intoPlan">
<span v-for="item in fields" :key="item.key">
@ -502,6 +503,11 @@ export default {
const list = deepClone(this.tableLabel);
this.$refs.headerCustom.open(list);
},
search() {
//
this.currentPage = 1;
this.initTableData();
},
initTableData() {
if (this.planId) {
this.condition.planId = this.planId;

View File

@ -12,11 +12,11 @@
ref="envPopover" class="env-popover"/>
<el-input :placeholder="$t('api_test.definition.request.select_case')" @blur="search"
@keyup.enter.native="search" class="search-input" size="small" v-model="condition.name"/>
<el-input :placeholder="$t('api_test.definition.request.select_case')" @blur="filterSearch"
@keyup.enter.native="filterSearch" class="search-input" size="small" v-model="condition.name"/>
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
v-if="condition.components !== undefined && condition.components.length > 0"
@search="search"/>
@search="filterSearch"/>
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion" style="float: left;"
class="search-input"/>
@ -29,7 +29,8 @@
:remember-order="true"
row-key="id"
:row-order-group-id="projectId"
@refresh="search"
@order="search"
@filter="filterSearch"
:disable-header-config="true"
:show-select-all="false"
@selectCountChange="selectCountChange">
@ -187,6 +188,10 @@ export default {
this.getVersionOptions();
},
methods: {
filterSearch() {
this.currentPage = 1;
this.search();
},
search() {
this.projectEnvMap.clear();
this.projectIds.clear();

View File

@ -7,7 +7,7 @@
:condition="condition"
:plan-id="planId"
:plan-status="planStatus"
@refresh="initTable"
@refresh="search"
@relevanceCase="$emit('relevanceCase')"
@setEnvironment="setEnvironment"
v-if="isPlanModel"/>
@ -24,11 +24,12 @@
@handlePageChange="initTable"
:fields.sync="fields"
:field-key="tableHeaderKey"
@refresh="initTable"
@order="initTable"
:row-order-group-id="planId"
:row-order-func="editTestPlanApiCaseOrder"
:enable-order-drag="enableOrderDrag"
row-key="id"
@filter="search"
ref="table">
<span v-for="(item) in fields" :key="item.key">
<ms-table-column :field="item" prop="num"
@ -433,6 +434,7 @@ export default {
}
},
search() {
this.currentPage = 1;
this.initTable();
},
buildPagePath(path) {

View File

@ -6,7 +6,7 @@
:condition="condition"
:projectId="projectId"
:plan-status="planStatus"
@refresh="search"
@refresh="filterSearch"
@relevanceCase="$emit('relevanceCase', 'scenario')"/>
</template>
@ -25,7 +25,8 @@
row-key="id"
:row-order-func="editTestPlanScenarioCaseOrder"
:row-order-group-id="planId"
@refresh="search"
@order="search"
@filter="filterSearch"
ref="table">
<span v-for="(item) in fields" :key="item.key">
<ms-table-column
@ -341,6 +342,11 @@ export default {
}
},
methods: {
filterSearch() {
//
this.currentPage = 1;
this.search();
},
search() {
initCondition(this.condition,this.condition.selectAll);
this.loading = true;

View File

@ -19,7 +19,7 @@
ref="nodeTree"/>
</template>
<ms-table-header :condition.sync="page.condition" @search="getTestCases" title="" :show-create="false">
<ms-table-header :condition.sync="page.condition" @search="search" title="" :show-create="false">
<template v-slot:searchBarBefore>
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion" margin-right="20"/>
</template>
@ -34,7 +34,8 @@
:screen-height="screenHeight"
@handlePageChange="getTestCases"
@selectCountChange="setSelectCounts"
@refresh="getTestCases"
@order="getTestCases"
@filter="search"
ref="table">
<ms-table-column
@ -218,6 +219,11 @@ export default {
}
});
},
search() {
//
this.page.currentPage = 1;
this.getTestCases();
},
getTestCases() {
let condition = this.page.condition;
if (this.selectNodeIds && this.selectNodeIds.length > 0) {

View File

@ -16,11 +16,11 @@
</template>
<el-input :placeholder="$t('api_test.definition.request.select_case')" @blur="getTestCases"
@keyup.enter.native="getTestCases" class="search-input" size="small" v-model="condition.name"/>
<el-input :placeholder="$t('api_test.definition.request.select_case')" @blur="search"
@keyup.enter.native="search" class="search-input" size="small" v-model="condition.name"/>
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
v-if="condition.components !== undefined && condition.components.length > 0"
@search="getTestCases"/>
@search="search"/>
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion" style="float: left;"
class="search-input"/>
@ -33,7 +33,8 @@
:remember-order="true"
row-key="id"
:row-order-group-id="projectId"
@refresh="search"
@order="getTestCases"
@filter="search"
:disable-header-config="true"
@selectCountChange="setSelectCounts"
ref="table">

View File

@ -7,7 +7,7 @@
:plan-id="planId"
:plan-status="planStatus"
:isShowVersion="false"
@refresh="initTable"
@refresh="search"
@relevanceCase="$emit('relevanceCase')"/>
</template>
@ -27,7 +27,8 @@
row-key="id"
:row-order-group-id="planId"
:row-order-func="editTestPlanLoadCaseOrder"
@refresh="initTable"
@order="initTable"
@filter="search"
ref="table">
<span v-for="(item) in fields" :key="item.key">
<ms-table-column
@ -319,6 +320,10 @@ export default {
this.initTable();
this.refreshStatus();
},
search() {
this.currentPage = 1;
this.initTable();
},
initTable() {
this.autoCheckStatus();
this.condition.testPlanId = this.planId;

View File

@ -2,7 +2,7 @@
<el-card class="table-card" v-loading="result.loading">
<template v-slot:header>
<ms-table-header :create-permission="['PROJECT_TRACK_REVIEW:READ+CREATE']" :condition.sync="condition"
@search="initTableData" @create="testCaseReviewCreate"
@search="search" @create="testCaseReviewCreate"
:create-tip="$t('test_track.review.create_review')"/>
</template>
@ -289,6 +289,11 @@ export default {
},
filter(filters) {
_filter(filters, this.condition);
this.search();
},
search() {
//
this.currentPage = 1;
this.initTableData();
},
sort(column) {