feat(测试跟踪): 测试计划关联用例列表支持记住跨页选择的记录
--story=1010820 --user=郭雨琦 https://www.tapd.cn/55049933/prong/stories/view/1155049933001010820=worktable_title
This commit is contained in:
parent
0f64b74e7b
commit
ba0395075d
|
@ -9,6 +9,9 @@
|
||||||
<ms-table :data="tableData" :select-node-ids="selectNodeIds" :condition="condition" :page-size="pageSize"
|
<ms-table :data="tableData" :select-node-ids="selectNodeIds" :condition="condition" :page-size="pageSize"
|
||||||
:total="total" enableSelection @selectCountChange="selectCountChange"
|
:total="total" enableSelection @selectCountChange="selectCountChange"
|
||||||
:screenHeight="screenHeight"
|
:screenHeight="screenHeight"
|
||||||
|
row-key="id"
|
||||||
|
:reserve-option="true"
|
||||||
|
:page-refresh="pageRefresh"
|
||||||
operator-width="170px"
|
operator-width="170px"
|
||||||
@order="initTable"
|
@order="initTable"
|
||||||
@filter="search"
|
@filter="search"
|
||||||
|
@ -103,7 +106,7 @@
|
||||||
:label="$t('api_test.definition.api_case_number')"/>
|
:label="$t('api_test.definition.api_case_number')"/>
|
||||||
|
|
||||||
</ms-table>
|
</ms-table>
|
||||||
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
<ms-table-pagination :change="pageChange" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||||
:total="total"/>
|
:total="total"/>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
@ -165,6 +168,7 @@ export default {
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
versionEnable: false,
|
versionEnable: false,
|
||||||
|
pageRefresh: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -190,12 +194,17 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
currentProtocol() {
|
currentProtocol() {
|
||||||
|
this.pageRefresh = false;
|
||||||
this.getProtocolFilter();
|
this.getProtocolFilter();
|
||||||
},
|
},
|
||||||
projectId() {
|
projectId() {
|
||||||
|
this.pageRefresh = false;
|
||||||
this.checkVersionEnable();
|
this.checkVersionEnable();
|
||||||
this.getUserFilter();
|
this.getUserFilter();
|
||||||
}
|
},
|
||||||
|
selectNodeIds() {
|
||||||
|
this.pageRefresh = false;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.$refs.apitable) {
|
if (this.$refs.apitable) {
|
||||||
|
@ -235,7 +244,11 @@ export default {
|
||||||
this.currentPage = 1;
|
this.currentPage = 1;
|
||||||
this.initTable();
|
this.initTable();
|
||||||
},
|
},
|
||||||
initTable() {
|
pageChange() {
|
||||||
|
this.initTable("page");
|
||||||
|
},
|
||||||
|
initTable(data) {
|
||||||
|
this.pageRefresh = data === "page";
|
||||||
this.$emit('refreshTable');
|
this.$emit('refreshTable');
|
||||||
},
|
},
|
||||||
clear() {
|
clear() {
|
||||||
|
|
|
@ -27,7 +27,9 @@
|
||||||
@row-click="handleRowClick"
|
@row-click="handleRowClick"
|
||||||
ref="table"
|
ref="table"
|
||||||
>
|
>
|
||||||
<el-table-column v-if="enableSelection" width="50" type="selection" />
|
<el-table-column v-if="enableSelection && !reserveOption" width="50" type="selection"/>
|
||||||
|
|
||||||
|
<el-table-column v-if="enableSelection && reserveOption" width="50" type="selection" reserve-selection/>
|
||||||
|
|
||||||
<ms-table-header-select-popover
|
<ms-table-header-select-popover
|
||||||
v-if="enableSelection && showSelectAll && !hidePopover"
|
v-if="enableSelection && showSelectAll && !hidePopover"
|
||||||
|
@ -254,7 +256,22 @@ export default {
|
||||||
default() {
|
default() {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
}, //开启全选
|
},
|
||||||
|
//开启保留前一页的选项的功能,注意需要与row-key搭配使用,否则不生效
|
||||||
|
reserveOption: {
|
||||||
|
type: Boolean,
|
||||||
|
default() {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//是否是翻页的刷新,当reserveOption为true时,引用列表页需要在翻页的时候使该属性为true,用以避免clear
|
||||||
|
pageRefresh: {
|
||||||
|
type: Boolean,
|
||||||
|
default() {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//开启全选
|
||||||
showSelectAll: {
|
showSelectAll: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default() {
|
default() {
|
||||||
|
@ -306,7 +323,9 @@ export default {
|
||||||
if (newVar !== oldVar) {
|
if (newVar !== oldVar) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.setDefaultOrders();
|
this.setDefaultOrders();
|
||||||
this.clear();
|
if (!this.pageRefresh) {
|
||||||
|
this.clear();
|
||||||
|
}
|
||||||
this.doLayout();
|
this.doLayout();
|
||||||
this.checkTableRowIsSelect();
|
this.checkTableRowIsSelect();
|
||||||
this.listenRowDrop();
|
this.listenRowDrop();
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
:total="total"
|
:total="total"
|
||||||
:remember-order="true"
|
:remember-order="true"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
|
:reserve-option="true"
|
||||||
|
:page-refresh="pageRefresh"
|
||||||
:row-order-group-id="projectId"
|
:row-order-group-id="projectId"
|
||||||
@order="search"
|
@order="search"
|
||||||
@filter="filterSearch"
|
@filter="filterSearch"
|
||||||
|
@ -145,7 +147,7 @@
|
||||||
/>
|
/>
|
||||||
</ms-table>
|
</ms-table>
|
||||||
<ms-table-pagination
|
<ms-table-pagination
|
||||||
:change="search"
|
:change="pageChange"
|
||||||
:current-page.sync="currentPage"
|
:current-page.sync="currentPage"
|
||||||
:page-size.sync="pageSize"
|
:page-size.sync="pageSize"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
@ -228,6 +230,7 @@ export default {
|
||||||
environmentType: ENV_TYPE.JSON,
|
environmentType: ENV_TYPE.JSON,
|
||||||
envGroupId: "",
|
envGroupId: "",
|
||||||
versionFilters: [],
|
versionFilters: [],
|
||||||
|
pageRefresh: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -257,7 +260,11 @@ export default {
|
||||||
this.currentPage = 1;
|
this.currentPage = 1;
|
||||||
this.search();
|
this.search();
|
||||||
},
|
},
|
||||||
search() {
|
pageChange() {
|
||||||
|
this.search("page");
|
||||||
|
},
|
||||||
|
search(data) {
|
||||||
|
this.pageRefresh = data === "page";
|
||||||
this.projectEnvMap.clear();
|
this.projectEnvMap.clear();
|
||||||
this.projectIds.clear();
|
this.projectIds.clear();
|
||||||
if (!this.projectId) {
|
if (!this.projectId) {
|
||||||
|
@ -358,7 +365,7 @@ export default {
|
||||||
this.selectRows = this.$refs.scenarioTable.selectRows;
|
this.selectRows = this.$refs.scenarioTable.selectRows;
|
||||||
this.initProjectIds();
|
this.initProjectIds();
|
||||||
this.$emit("selectCountChange", data);
|
this.$emit("selectCountChange", data);
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -32,6 +32,9 @@
|
||||||
:total="page.total"
|
:total="page.total"
|
||||||
:page-size.sync="page.pageSize"
|
:page-size.sync="page.pageSize"
|
||||||
:screen-height="screenHeight"
|
:screen-height="screenHeight"
|
||||||
|
row-key="id"
|
||||||
|
:reserve-option="true"
|
||||||
|
:page-refresh="pageRefresh"
|
||||||
@handlePageChange="getTestCases"
|
@handlePageChange="getTestCases"
|
||||||
@selectCountChange="setSelectCounts"
|
@selectCountChange="setSelectCounts"
|
||||||
@order="getTestCases"
|
@order="getTestCases"
|
||||||
|
@ -94,7 +97,7 @@
|
||||||
|
|
||||||
</ms-table>
|
</ms-table>
|
||||||
|
|
||||||
<ms-table-pagination :change="getTestCases" :current-page.sync="page.currentPage" :page-size.sync="page.pageSize"
|
<ms-table-pagination :change="pageChange" :current-page.sync="page.currentPage" :page-size.sync="page.pageSize"
|
||||||
:total="page.total"/>
|
:total="page.total"/>
|
||||||
</test-case-relevance-base>
|
</test-case-relevance-base>
|
||||||
|
|
||||||
|
@ -172,6 +175,7 @@ export default {
|
||||||
],
|
],
|
||||||
versionFilters: null,
|
versionFilters: null,
|
||||||
testCaseTemplate: {},
|
testCaseTemplate: {},
|
||||||
|
pageRefresh: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -253,7 +257,8 @@ export default {
|
||||||
this.getTestCases();
|
this.getTestCases();
|
||||||
this.getProjectNode(this.projectId, this.page.condition);
|
this.getProjectNode(this.projectId, this.page.condition);
|
||||||
},
|
},
|
||||||
getTestCases() {
|
getTestCases(data) {
|
||||||
|
this.pageRefresh = data === "page";
|
||||||
let condition = this.page.condition;
|
let condition = this.page.condition;
|
||||||
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
|
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
|
||||||
condition.nodeIds = this.selectNodeIds;
|
condition.nodeIds = this.selectNodeIds;
|
||||||
|
@ -265,6 +270,9 @@ export default {
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
pageChange() {
|
||||||
|
this.getTestCases("page")
|
||||||
|
},
|
||||||
saveCaseRelevance(item) {
|
saveCaseRelevance(item) {
|
||||||
this.isSaving = true;
|
this.isSaving = true;
|
||||||
let param = {};
|
let param = {};
|
||||||
|
@ -311,7 +319,7 @@ export default {
|
||||||
this.testCaseTemplate = data;
|
this.testCaseTemplate = data;
|
||||||
this.page.condition.components = initTestCaseConditionComponents(this.page.condition, this.testCaseTemplate.customFields);
|
this.page.condition.components = initTestCaseConditionComponents(this.page.condition, this.testCaseTemplate.customFields);
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
:total="total"
|
:total="total"
|
||||||
:remember-order="true"
|
:remember-order="true"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
|
:reserve-option="true"
|
||||||
|
:page-refresh="pageRefresh"
|
||||||
:row-order-group-id="projectId"
|
:row-order-group-id="projectId"
|
||||||
@order="getTestCases"
|
@order="getTestCases"
|
||||||
@filter="search"
|
@filter="search"
|
||||||
|
@ -81,7 +83,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ms-table>
|
</ms-table>
|
||||||
<ms-table-pagination :change="getTestCases" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
<ms-table-pagination :change="pageChange" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||||
:total="total"/>
|
:total="total"/>
|
||||||
|
|
||||||
</test-case-relevance-base>
|
</test-case-relevance-base>
|
||||||
|
@ -147,6 +149,7 @@ export default {
|
||||||
{text: 'Error', value: 'Error'}
|
{text: 'Error', value: 'Error'}
|
||||||
],
|
],
|
||||||
versionFilters: null,
|
versionFilters: null,
|
||||||
|
pageRefresh: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -218,7 +221,11 @@ export default {
|
||||||
this.testCases = [];
|
this.testCases = [];
|
||||||
this.getTestCases(true);
|
this.getTestCases(true);
|
||||||
},
|
},
|
||||||
getTestCases() {
|
pageChange() {
|
||||||
|
this.getTestCases("page");
|
||||||
|
},
|
||||||
|
getTestCases(data) {
|
||||||
|
this.pageRefresh = data === "page";
|
||||||
if (this.planId) {
|
if (this.planId) {
|
||||||
this.condition.testPlanId = this.planId;
|
this.condition.testPlanId = this.planId;
|
||||||
this.condition.projectId = this.projectId;
|
this.condition.projectId = this.projectId;
|
||||||
|
@ -231,9 +238,6 @@ export default {
|
||||||
this.testCases = data.listObject;
|
this.testCases = data.listObject;
|
||||||
|
|
||||||
this.selectIds.clear();
|
this.selectIds.clear();
|
||||||
if (this.$refs.table) {
|
|
||||||
this.$refs.table.clearSelection();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
:total="total"
|
:total="total"
|
||||||
:remember-order="true"
|
:remember-order="true"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
|
:reserve-option="true"
|
||||||
|
:page-refresh="pageRefresh"
|
||||||
:row-order-group-id="projectId"
|
:row-order-group-id="projectId"
|
||||||
@order="search"
|
@order="search"
|
||||||
@filter="filterSearch"
|
@filter="filterSearch"
|
||||||
|
@ -76,7 +78,7 @@
|
||||||
<ms-table-column prop="passRate" :label="$t('api_test.automation.passing_rate')"
|
<ms-table-column prop="passRate" :label="$t('api_test.automation.passing_rate')"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
</ms-table>
|
</ms-table>
|
||||||
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
<ms-table-pagination :change="pageChange" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||||
:total="total"/>
|
:total="total"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -147,6 +149,7 @@ export default {
|
||||||
envGroupId: "",
|
envGroupId: "",
|
||||||
versionFilters: [],
|
versionFilters: [],
|
||||||
fieldsWidth: getCustomTableWidth('TEST_PLAN_UI_SCENARIO_CASE'),
|
fieldsWidth: getCustomTableWidth('TEST_PLAN_UI_SCENARIO_CASE'),
|
||||||
|
pageRefresh: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -176,7 +179,11 @@ export default {
|
||||||
this.currentPage = 1;
|
this.currentPage = 1;
|
||||||
this.search();
|
this.search();
|
||||||
},
|
},
|
||||||
search() {
|
pageChange() {
|
||||||
|
this.search("page");
|
||||||
|
},
|
||||||
|
search(data) {
|
||||||
|
this.pageRefresh = data === "page";
|
||||||
this.projectEnvMap.clear();
|
this.projectEnvMap.clear();
|
||||||
if (!this.projectId) {
|
if (!this.projectId) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue