Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
e2356c1849
|
@ -86,6 +86,12 @@
|
||||||
this.$refs.relevanceDialog.close();
|
this.$refs.relevanceDialog.close();
|
||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
|
if (this.$refs.apiList) {
|
||||||
|
this.$refs.apiList.clearSelection();
|
||||||
|
}
|
||||||
|
if (this.$refs.apiCaseList) {
|
||||||
|
this.$refs.apiCaseList.clearSelection();
|
||||||
|
}
|
||||||
this.$refs.relevanceDialog.open();
|
this.$refs.relevanceDialog.open();
|
||||||
},
|
},
|
||||||
isApiListEnableChange(data) {
|
isApiListEnableChange(data) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
<api-list-container
|
<api-list-container
|
||||||
:is-api-list-enable="isApiListEnable"
|
:is-api-list-enable="isApiListEnable"
|
||||||
@isApiListEnableChange="isApiListEnableChange">
|
@isApiListEnableChange="isApiListEnableChange">
|
||||||
|
@ -7,13 +8,12 @@
|
||||||
|
|
||||||
<el-input placeholder="搜索" @blur="initTable" class="search-input" size="small" @keyup.enter.native="initTable" v-model="condition.name"/>
|
<el-input placeholder="搜索" @blur="initTable" class="search-input" size="small" @keyup.enter.native="initTable" v-model="condition.name"/>
|
||||||
|
|
||||||
|
|
||||||
<el-table v-loading="result.loading"
|
<el-table v-loading="result.loading"
|
||||||
border
|
border
|
||||||
:data="tableData" row-key="id" class="test-content adjust-table"
|
:data="tableData" row-key="id" class="test-content adjust-table"
|
||||||
@select-all="handleSelectAll"
|
@select-all="handleSelectAll"
|
||||||
@select="handleSelect">
|
@select="handleSelect" ref="table">
|
||||||
<el-table-column type="selection"/>
|
<el-table-column reserve-selection type="selection"/>
|
||||||
|
|
||||||
<el-table-column prop="name" :label="$t('api_test.definition.api_name')" show-overflow-tooltip/>
|
<el-table-column prop="name" :label="$t('api_test.definition.api_name')" show-overflow-tooltip/>
|
||||||
|
|
||||||
|
@ -70,6 +70,9 @@
|
||||||
<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"/>
|
||||||
</api-list-container>
|
</api-list-container>
|
||||||
|
<table-select-count-bar :count="selectRows.size"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -88,10 +91,12 @@ import PriorityTableItem from "../../../../track/common/tableItems/planview/Prio
|
||||||
import {_filter, _sort} from "../../../../../../common/js/utils";
|
import {_filter, _sort} from "../../../../../../common/js/utils";
|
||||||
import {_handleSelect, _handleSelectAll} from "../../../../../../common/js/tableUtils";
|
import {_handleSelect, _handleSelectAll} from "../../../../../../common/js/tableUtils";
|
||||||
import MsEnvironmentSelect from "../../../definition/components/case/MsEnvironmentSelect";
|
import MsEnvironmentSelect from "../../../definition/components/case/MsEnvironmentSelect";
|
||||||
|
import TableSelectCountBar from "./TableSelectCountBar";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RelevanceApiList",
|
name: "RelevanceApiList",
|
||||||
components: {
|
components: {
|
||||||
|
TableSelectCountBar,
|
||||||
MsEnvironmentSelect,
|
MsEnvironmentSelect,
|
||||||
PriorityTableItem,
|
PriorityTableItem,
|
||||||
ApiListContainer,
|
ApiListContainer,
|
||||||
|
@ -155,6 +160,7 @@ export default {
|
||||||
isTestPlan: Boolean
|
isTestPlan: Boolean
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
|
this.selectRows = new Set();
|
||||||
this.initTable();
|
this.initTable();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -174,7 +180,6 @@ export default {
|
||||||
this.$emit('isApiListEnableChange', data);
|
this.$emit('isApiListEnableChange', data);
|
||||||
},
|
},
|
||||||
initTable() {
|
initTable() {
|
||||||
this.selectRows = new Set();
|
|
||||||
this.condition.filters = {status: ["Prepare", "Underway", "Completed"]};
|
this.condition.filters = {status: ["Prepare", "Underway", "Completed"]};
|
||||||
this.condition.moduleIds = this.selectNodeIds;
|
this.condition.moduleIds = this.selectNodeIds;
|
||||||
if (this.trashEnable) {
|
if (this.trashEnable) {
|
||||||
|
@ -230,6 +235,12 @@ export default {
|
||||||
},
|
},
|
||||||
setEnvironment(data) {
|
setEnvironment(data) {
|
||||||
this.environmentId = data.id;
|
this.environmentId = data.id;
|
||||||
|
},
|
||||||
|
clearSelection() {
|
||||||
|
this.selectRows = new Set();
|
||||||
|
if (this.$refs.table) {
|
||||||
|
this.$refs.table.clearSelection();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,14 @@
|
||||||
|
|
||||||
<el-table v-loading="result.loading"
|
<el-table v-loading="result.loading"
|
||||||
border
|
border
|
||||||
:data="tableData" row-key="id" class="test-content adjust-table"
|
:data="tableData"
|
||||||
|
row-key="id"
|
||||||
|
class="test-content adjust-table"
|
||||||
@select-all="handleSelectAll"
|
@select-all="handleSelectAll"
|
||||||
@filter-change="filter"
|
@filter-change="filter"
|
||||||
@sort-change="sort"
|
@sort-change="sort"
|
||||||
@select="handleSelect">
|
@select="handleSelect" ref="table">
|
||||||
<el-table-column type="selection"/>
|
<el-table-column reserve-selection type="selection"/>
|
||||||
|
|
||||||
<el-table-column prop="name" :label="$t('api_test.definition.api_name')" show-overflow-tooltip/>
|
<el-table-column prop="name" :label="$t('api_test.definition.api_name')" show-overflow-tooltip/>
|
||||||
|
|
||||||
|
@ -55,6 +57,8 @@
|
||||||
:total="total"/>
|
:total="total"/>
|
||||||
</api-list-container>
|
</api-list-container>
|
||||||
|
|
||||||
|
<table-select-count-bar :count="selectRows.size"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
@ -76,10 +80,12 @@
|
||||||
import {_filter, _sort} from "../../../../../../common/js/utils";
|
import {_filter, _sort} from "../../../../../../common/js/utils";
|
||||||
import {_handleSelect, _handleSelectAll} from "../../../../../../common/js/tableUtils";
|
import {_handleSelect, _handleSelectAll} from "../../../../../../common/js/tableUtils";
|
||||||
import MsEnvironmentSelect from "../../../definition/components/case/MsEnvironmentSelect";
|
import MsEnvironmentSelect from "../../../definition/components/case/MsEnvironmentSelect";
|
||||||
|
import TableSelectCountBar from "./TableSelectCountBar";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RelevanceCaseList",
|
name: "RelevanceCaseList",
|
||||||
components: {
|
components: {
|
||||||
|
TableSelectCountBar,
|
||||||
MsEnvironmentSelect,
|
MsEnvironmentSelect,
|
||||||
PriorityTableItem,
|
PriorityTableItem,
|
||||||
ApiListContainer,
|
ApiListContainer,
|
||||||
|
@ -154,16 +160,12 @@
|
||||||
projectId() {
|
projectId() {
|
||||||
this.initTable();
|
this.initTable();
|
||||||
}
|
}
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isApiListEnableChange(data) {
|
isApiListEnableChange(data) {
|
||||||
this.$emit('isApiListEnableChange', data);
|
this.$emit('isApiListEnableChange', data);
|
||||||
},
|
},
|
||||||
initTable() {
|
initTable() {
|
||||||
this.selectRows = new Set();
|
|
||||||
this.condition.status = "";
|
this.condition.status = "";
|
||||||
this.condition.moduleIds = this.selectNodeIds;
|
this.condition.moduleIds = this.selectNodeIds;
|
||||||
if (this.projectId != null) {
|
if (this.projectId != null) {
|
||||||
|
@ -231,6 +233,12 @@
|
||||||
},
|
},
|
||||||
setEnvironment(data) {
|
setEnvironment(data) {
|
||||||
this.environmentId = data.id;
|
this.environmentId = data.id;
|
||||||
|
},
|
||||||
|
clearSelection() {
|
||||||
|
this.selectRows = new Set();
|
||||||
|
if (this.$refs.table) {
|
||||||
|
this.$refs.table.clearSelection();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<template>
|
||||||
|
<div v-if="count && count > 0" class="content">
|
||||||
|
{{$t('commons.table.select_tip', [this.count])}}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "TableSelectCountBar",
|
||||||
|
props: ['count']
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
.content {
|
||||||
|
text-align: center;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -127,6 +127,9 @@ export default {
|
||||||
validate: "Validate",
|
validate: "Validate",
|
||||||
batch_add: "Batch add",
|
batch_add: "Batch add",
|
||||||
check_project_tip: "Create or select the project first",
|
check_project_tip: "Create or select the project first",
|
||||||
|
table: {
|
||||||
|
select_tip: "Item {0} data is selected"
|
||||||
|
},
|
||||||
date: {
|
date: {
|
||||||
select_date: 'Select date',
|
select_date: 'Select date',
|
||||||
start_date: 'Start date',
|
start_date: 'Start date',
|
||||||
|
|
|
@ -127,6 +127,9 @@ export default {
|
||||||
validate: "校验",
|
validate: "校验",
|
||||||
batch_add: "批量添加",
|
batch_add: "批量添加",
|
||||||
check_project_tip: "请先创建或选择项目",
|
check_project_tip: "请先创建或选择项目",
|
||||||
|
table: {
|
||||||
|
select_tip: "已选中 {0} 条数据"
|
||||||
|
},
|
||||||
date: {
|
date: {
|
||||||
select_date: '选择日期',
|
select_date: '选择日期',
|
||||||
start_date: '开始日期',
|
start_date: '开始日期',
|
||||||
|
|
|
@ -127,6 +127,9 @@ export default {
|
||||||
validate: "校驗",
|
validate: "校驗",
|
||||||
batch_add: "批量添加",
|
batch_add: "批量添加",
|
||||||
check_project_tip: "請先創建或選擇項目",
|
check_project_tip: "請先創建或選擇項目",
|
||||||
|
table: {
|
||||||
|
select_tip: "已选中 {0} 条数据"
|
||||||
|
},
|
||||||
date: {
|
date: {
|
||||||
select_date: '選擇日期',
|
select_date: '選擇日期',
|
||||||
start_date: '開始日期',
|
start_date: '開始日期',
|
||||||
|
|
Loading…
Reference in New Issue