refactor(接口测试): 增加复制的查看引用关系

--story=1010958 --user=郭雨琦
https://www.tapd.cn/55049933/prong/stories/view/1155049933001010958
This commit is contained in:
guoyuqi 2023-01-30 14:47:01 +08:00 committed by xiaomeinvG
parent bfc45a1dd7
commit 5d20b59db4
1 changed files with 20 additions and 20 deletions

View File

@ -6,10 +6,11 @@
name="scenario"> name="scenario">
<ms-table <ms-table
v-if="!isHasRef" v-if="!isHasRef"
:data="scenarioCopyData" :data="scenarioData"
style="width: 100%" style="width: 100%"
:screen-height="screenHeight" :screen-height="screenHeight"
:total="total" :total="total"
:table-is-loading="result"
:page-size="pageSize" :page-size="pageSize"
:enable-selection="false" :enable-selection="false"
@refresh="search" @refresh="search"
@ -51,11 +52,12 @@
:middle-button-enable="false"> :middle-button-enable="false">
<ms-table <ms-table
v-if="activeDom === 'right'" v-if="activeDom === 'right'"
:data="scenarioRefData" :data="scenarioData"
style="width: 100%" style="width: 100%"
:screen-height="screenHeight" :screen-height="screenHeight"
:total="total" :total="total"
:page-size="pageSize" :page-size="pageSize"
:table-is-loading="result"
:enable-selection="false" :enable-selection="false"
@refresh="search" @refresh="search"
:condition="condition"> :condition="condition">
@ -89,11 +91,12 @@
</ms-table> </ms-table>
<ms-table <ms-table
v-if="activeDom === 'left'" v-if="activeDom === 'left'"
:data="scenarioCopyData" :data="scenarioData"
style="width: 100%" style="width: 100%"
:screen-height="screenHeight" :screen-height="screenHeight"
:total="total" :total="total"
:page-size="pageSize" :page-size="pageSize"
:table-is-loading="result"
:enable-selection="false" :enable-selection="false"
@refresh="search" @refresh="search"
:condition="condition"> :condition="condition">
@ -182,8 +185,7 @@ export default {
isCopy: true, isCopy: true,
showTextColor: "showTextColor", showTextColor: "showTextColor",
unShowTextColor: "unShowTextColor", unShowTextColor: "unShowTextColor",
scenarioRefData: [], scenarioData: [],
scenarioCopyData: [],
planData: [], planData: [],
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
@ -200,6 +202,7 @@ export default {
type: '', type: '',
projectPlanFilters: [], projectPlanFilters: [],
activeDom: 'left', activeDom: 'left',
result: false
}; };
}, },
props: { props: {
@ -269,8 +272,8 @@ export default {
this.pageSize = 10; this.pageSize = 10;
this.total = 0; this.total = 0;
this.condition = {}; this.condition = {};
this.scenarioRefData = []; this.scenarioData = [];
this.scenarioCopyData = [];
this.planData = []; this.planData = [];
}, },
open(row, type) { open(row, type) {
@ -288,7 +291,7 @@ export default {
this.isVisible = false; this.isVisible = false;
}, },
getReferenceData(condition) { getReferenceData(condition) {
getDefinitionReference(this.currentPage, this.pageSize, condition).then((res) => { this.result = getDefinitionReference(this.currentPage, this.pageSize, condition).then((res) => {
let data = res.data || []; let data = res.data || [];
this.total = data.itemCount || 0; this.total = data.itemCount || 0;
if (this.workspaceList) { if (this.workspaceList) {
@ -328,12 +331,7 @@ export default {
}); });
}); });
} }
if (this.activeDom === 'left') { this.scenarioData = data.listObject || [];
this.scenarioCopyData = data.listObject || [];
} else {
this.scenarioRefData = data.listObject || [];
}
}); });
}, },
search(row) { search(row) {
@ -346,12 +344,14 @@ export default {
this.condition.workspaceId = getCurrentWorkspaceId(); this.condition.workspaceId = getCurrentWorkspaceId();
this.condition.scenarioType = this.type; this.condition.scenarioType = this.type;
if (this.activeName === 'scenario') { if (this.activeName === 'scenario') {
if (!this.isHasRef) { if (!this.condition.refType) {
this.condition.refType = "Copy" if (!this.isHasRef) {
this.activeDom = 'left' this.condition.refType = "Copy"
} else { this.activeDom = 'left'
this.condition.refType = "REF" } else {
this.activeDom = 'right' this.condition.refType = "REF"
this.activeDom = 'right'
}
} }
this.getReferenceData(this.condition); this.getReferenceData(this.condition);
} else { } else {