refactor(测试跟踪): 导入用例时,选中数量显示在表格上边

This commit is contained in:
CaptainB 2022-04-11 15:40:52 +08:00 committed by 刘瑞斌
parent 54fc921bd5
commit 7997f1dcf6
8 changed files with 34 additions and 16 deletions

View File

@ -8,7 +8,7 @@
<slot name="other"></slot> <slot name="other"></slot>
</div> </div>
<div class="ms_btn"> <div class="ms_btn">
<el-button @click="cancel" :size="btnSize">{{ $t('commons.cancel') }}</el-button> <el-button v-if="enableCancel" @click="cancel" :size="btnSize">{{ $t('commons.cancel') }}</el-button>
<el-button type="primary" @click="confirm" @keydown.enter.native.prevent :size="btnSize"> <el-button type="primary" @click="confirm" @keydown.enter.native.prevent :size="btnSize">
{{ $t('commons.confirm') }} {{ $t('commons.confirm') }}
</el-button> </el-button>
@ -29,7 +29,8 @@ export default {
default() { default() {
return 'small'; return 'small';
} }
} },
enableCancel: Boolean
}, },
methods: { methods: {
cancel() { cancel() {

View File

@ -22,6 +22,7 @@
:project-id="projectId" :project-id="projectId"
:not-in-ids="notInIds" :not-in-ids="notInIds"
:versionEnable="versionEnable" :versionEnable="versionEnable"
@selectCountChange="setSelectCounts"
ref="apiCaseList"/> ref="apiCaseList"/>
</test-case-relevance-base> </test-case-relevance-base>
@ -103,6 +104,9 @@ export default {
this.$refs.baseRelevance.close(); this.$refs.baseRelevance.close();
}); });
}, },
setSelectCounts(data) {
this.$refs.baseRelevance.selectCounts = data;
}
} }
} }
</script> </script>

View File

@ -9,6 +9,7 @@
:project-id="projectId" :project-id="projectId"
:not-in-ids="notInIds" :not-in-ids="notInIds"
:versionEnable="versionEnable" :versionEnable="versionEnable"
@selectCountChange="setSelectCounts"
ref="apiCaseList"/> ref="apiCaseList"/>
</test-case-relevance-base> </test-case-relevance-base>
@ -80,6 +81,9 @@ export default {
this.$refs.baseRelevance.close(); this.$refs.baseRelevance.close();
}); });
}, },
setSelectCounts(data) {
this.$refs.baseRelevance.selectCounts = data;
}
} }
} }
</script> </script>

View File

@ -14,6 +14,7 @@
:total="total" :total="total"
:showSelectAll="false" :showSelectAll="false"
:screenHeight="screenHeight" :screenHeight="screenHeight"
@selectCountChange="selectCountChange"
@refresh="initTable" @refresh="initTable"
ref="table"> ref="table">
@ -59,8 +60,6 @@
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize" <ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/> :total="total"/>
<table-select-count-bar :count="selectRows.size"/>
</div> </div>
</template> </template>
@ -72,7 +71,6 @@ import MsTableColumn from "@/business/components/common/components/table/MsTable
import {API_METHOD_COLOUR} from "@/business/components/api/definition/model/JsonData"; import {API_METHOD_COLOUR} from "@/business/components/api/definition/model/JsonData";
import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem"; import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem";
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import TableSelectCountBar from "@/business/components/api/automation/scenario/api/TableSelectCountBar";
import {TEST_CASE_RELEVANCE_API_CASE_CONFIGS} from "@/business/components/common/components/search/search-components"; import {TEST_CASE_RELEVANCE_API_CASE_CONFIGS} from "@/business/components/common/components/search/search-components";
import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar"; import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar";
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
@ -83,7 +81,6 @@ const VersionSelect = requireComponent.keys().length > 0 ? requireComponent("./v
export default { export default {
name: "TestCaseRelateApiList", name: "TestCaseRelateApiList",
components: { components: {
TableSelectCountBar,
MsTablePagination, MsTablePagination,
PriorityTableItem, PriorityTableItem,
MsTable, MsTable,
@ -152,6 +149,9 @@ export default {
} }
}, },
methods: { methods: {
selectCountChange(data) {
this.$emit("selectCountChange", data);
},
initTable(projectId) { initTable(projectId) {
this.condition.status = ""; this.condition.status = "";
this.condition.moduleIds = this.selectNodeIds; this.condition.moduleIds = this.selectNodeIds;

View File

@ -14,6 +14,7 @@
:total="total" :total="total"
:showSelectAll="false" :showSelectAll="false"
:screenHeight="screenHeight" :screenHeight="screenHeight"
@selectCountChange="selectCountChange"
@refresh="initTable" @refresh="initTable"
ref="table"> ref="table">
@ -67,8 +68,6 @@
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize" <ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/> :total="total"/>
<table-select-count-bar :count="selectRows.size"/>
</div> </div>
</template> </template>
@ -78,7 +77,6 @@
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import TableSelectCountBar from "@/business/components/api/automation/scenario/api/TableSelectCountBar";
import MsPerformanceTestStatus from "@/business/components/performance/test/PerformanceTestStatus"; import MsPerformanceTestStatus from "@/business/components/performance/test/PerformanceTestStatus";
import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar"; import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar";
import {TEST_CASE_RELEVANCE_LOAD_CASE} from "@/business/components/common/components/search/search-components"; import {TEST_CASE_RELEVANCE_LOAD_CASE} from "@/business/components/common/components/search/search-components";
@ -90,7 +88,6 @@ export default {
name: "TestCaseRelateLoadList", name: "TestCaseRelateLoadList",
components: { components: {
MsPerformanceTestStatus, MsPerformanceTestStatus,
TableSelectCountBar,
MsTablePagination, MsTablePagination,
MsTable, MsTable,
MsTableColumn, MsTableColumn,
@ -138,6 +135,9 @@ export default {
} }
}, },
methods: { methods: {
selectCountChange(data) {
this.$emit("selectCountChange", data);
},
initTable(projectId) { initTable(projectId) {
this.condition.status = ""; this.condition.status = "";
if (projectId != null && typeof projectId === 'string') { if (projectId != null && typeof projectId === 'string') {

View File

@ -14,6 +14,7 @@
:total="total" :total="total"
:showSelectAll="false" :showSelectAll="false"
:screenHeight="screenHeight" :screenHeight="screenHeight"
@selectCountChange="selectCountChange"
@refresh="initTable" @refresh="initTable"
ref="table"> ref="table">
@ -70,8 +71,6 @@
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize" <ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/> :total="total"/>
<table-select-count-bar :count="selectRows.size"/>
</div> </div>
</template> </template>
@ -82,7 +81,6 @@ import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem"; import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem";
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import TableSelectCountBar from "@/business/components/api/automation/scenario/api/TableSelectCountBar";
import PlanStatusTableItem from "@/business/components/track/common/tableItems/plan/PlanStatusTableItem"; import PlanStatusTableItem from "@/business/components/track/common/tableItems/plan/PlanStatusTableItem";
import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar"; import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar";
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
@ -95,7 +93,6 @@ export default {
name: "TestCaseRelateScenarioList", name: "TestCaseRelateScenarioList",
components: { components: {
PlanStatusTableItem, PlanStatusTableItem,
TableSelectCountBar,
MsTablePagination, MsTablePagination,
PriorityTableItem, PriorityTableItem,
MsTable, MsTable,
@ -155,6 +152,9 @@ export default {
} }
}, },
methods: { methods: {
selectCountChange(data) {
this.$emit("selectCountChange", data);
},
initTable(projectId) { initTable(projectId) {
this.condition.status = ""; this.condition.status = "";
this.condition.moduleIds = this.selectNodeIds; this.condition.moduleIds = this.selectNodeIds;

View File

@ -21,6 +21,7 @@
:project-id="projectId" :project-id="projectId"
:not-in-ids="notInIds" :not-in-ids="notInIds"
:versionEnable="versionEnable" :versionEnable="versionEnable"
@selectCountChange="setSelectCounts"
ref="apiCaseList"/> ref="apiCaseList"/>
</test-case-relevance-base> </test-case-relevance-base>
@ -101,6 +102,9 @@ export default {
this.$refs.baseRelevance.close(); this.$refs.baseRelevance.close();
}); });
}, },
setSelectCounts(data) {
this.$refs.baseRelevance.selectCounts = data;
}
} }
} }
</script> </script>

View File

@ -7,8 +7,10 @@
</div> </div>
</template> </template>
<template slot="title" slot-scope="{title}" v-if="!$slots.headerBtn"> <template slot="title" slot-scope="{title}" v-if="!$slots.headerBtn">
<ms-dialog-header :title="title" @cancel="close" @confirm="save"> <ms-dialog-header :title="title" :enable-cancel="false" @confirm="save">
<template #other> <template #other>
<table-select-count-bar :count="selectCounts" style="float: left; margin: 5px;"/>
<div v-if="flag" style="margin-top: 5px;"> <div v-if="flag" style="margin-top: 5px;">
<el-checkbox v-model="checked" class="el-checkbox__label">{{ $t('test_track.sync_add_api_load') }}</el-checkbox> <el-checkbox v-model="checked" class="el-checkbox__label">{{ $t('test_track.sync_add_api_load') }}</el-checkbox>
</div> </div>
@ -44,10 +46,12 @@ import MsDialogHeader from '../../../../../common/components/MsDialogHeader'
import SelectMenu from "../../../../common/SelectMenu"; import SelectMenu from "../../../../common/SelectMenu";
import RelevanceDialog from "./RelevanceDialog"; import RelevanceDialog from "./RelevanceDialog";
import {getCurrentProjectID, getCurrentUserId, getCurrentWorkspaceId} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentUserId, getCurrentWorkspaceId} from "@/common/js/utils";
import TableSelectCountBar from "@/business/components/api/automation/scenario/api/TableSelectCountBar";
export default { export default {
name: "TestCaseRelevanceBase", name: "TestCaseRelevanceBase",
components: { components: {
TableSelectCountBar,
RelevanceDialog, RelevanceDialog,
SelectMenu, SelectMenu,
MsDialogHeader, MsDialogHeader,
@ -62,7 +66,8 @@ export default {
projects: [], projects: [],
workspaceId: '', workspaceId: '',
workspaceList: [], workspaceList: [],
currentWorkSpaceId: '' currentWorkSpaceId: '',
selectCounts: null,
}; };
}, },
props: { props: {