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>
</div>
<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">
{{ $t('commons.confirm') }}
</el-button>
@ -29,7 +29,8 @@ export default {
default() {
return 'small';
}
}
},
enableCancel: Boolean
},
methods: {
cancel() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,8 +7,10 @@
</div>
</template>
<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>
<table-select-count-bar :count="selectCounts" style="float: left; margin: 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>
</div>
@ -44,10 +46,12 @@ import MsDialogHeader from '../../../../../common/components/MsDialogHeader'
import SelectMenu from "../../../../common/SelectMenu";
import RelevanceDialog from "./RelevanceDialog";
import {getCurrentProjectID, getCurrentUserId, getCurrentWorkspaceId} from "@/common/js/utils";
import TableSelectCountBar from "@/business/components/api/automation/scenario/api/TableSelectCountBar";
export default {
name: "TestCaseRelevanceBase",
components: {
TableSelectCountBar,
RelevanceDialog,
SelectMenu,
MsDialogHeader,
@ -62,7 +66,8 @@ export default {
projects: [],
workspaceId: '',
workspaceList: [],
currentWorkSpaceId: ''
currentWorkSpaceId: '',
selectCounts: null,
};
},
props: {