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,75 +1,78 @@
|
||||||
<template>
|
<template>
|
||||||
<api-list-container
|
<div>
|
||||||
:is-api-list-enable="isApiListEnable"
|
<api-list-container
|
||||||
@isApiListEnableChange="isApiListEnableChange">
|
:is-api-list-enable="isApiListEnable"
|
||||||
|
@isApiListEnableChange="isApiListEnableChange">
|
||||||
|
|
||||||
<ms-environment-select :project-id="projectId" v-if="isTestPlan" :is-read-only="isReadOnly" @setEnvironment="setEnvironment"/>
|
<ms-environment-select :project-id="projectId" v-if="isTestPlan" :is-read-only="isReadOnly" @setEnvironment="setEnvironment"/>
|
||||||
|
|
||||||
<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"
|
||||||
|
border
|
||||||
|
:data="tableData" row-key="id" class="test-content adjust-table"
|
||||||
|
@select-all="handleSelectAll"
|
||||||
|
@select="handleSelect" ref="table">
|
||||||
|
<el-table-column reserve-selection type="selection"/>
|
||||||
|
|
||||||
<el-table v-loading="result.loading"
|
<el-table-column prop="name" :label="$t('api_test.definition.api_name')" show-overflow-tooltip/>
|
||||||
border
|
|
||||||
:data="tableData" row-key="id" class="test-content adjust-table"
|
|
||||||
@select-all="handleSelectAll"
|
|
||||||
@select="handleSelect">
|
|
||||||
<el-table-column type="selection"/>
|
|
||||||
|
|
||||||
<el-table-column prop="name" :label="$t('api_test.definition.api_name')" show-overflow-tooltip/>
|
<el-table-column
|
||||||
|
prop="status"
|
||||||
|
column-key="api_status"
|
||||||
|
:label="$t('api_test.definition.api_status')"
|
||||||
|
show-overflow-tooltip>
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<ms-tag v-if="scope.row.status == 'Prepare'" type="info" effect="plain" :content="$t('test_track.plan.plan_status_prepare')"/>
|
||||||
|
<ms-tag v-if="scope.row.status == 'Underway'" type="warning" effect="plain" :content="$t('test_track.plan.plan_status_running')"/>
|
||||||
|
<ms-tag v-if="scope.row.status == 'Completed'" type="success" effect="plain" :content="$t('test_track.plan.plan_status_completed')"/>
|
||||||
|
<ms-tag v-if="scope.row.status == 'Trash'" type="danger" effect="plain" content="废弃"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="status"
|
prop="method"
|
||||||
column-key="api_status"
|
:label="$t('api_test.definition.api_type')"
|
||||||
:label="$t('api_test.definition.api_status')"
|
show-overflow-tooltip>
|
||||||
show-overflow-tooltip>
|
<template v-slot:default="scope" class="request-method">
|
||||||
<template v-slot:default="scope">
|
<el-tag size="mini" :style="{'background-color': getColor(scope.row.method), border: getColor(true, scope.row.method)}" class="api-el-tag">
|
||||||
<ms-tag v-if="scope.row.status == 'Prepare'" type="info" effect="plain" :content="$t('test_track.plan.plan_status_prepare')"/>
|
{{ scope.row.method }}
|
||||||
<ms-tag v-if="scope.row.status == 'Underway'" type="warning" effect="plain" :content="$t('test_track.plan.plan_status_running')"/>
|
</el-tag>
|
||||||
<ms-tag v-if="scope.row.status == 'Completed'" type="success" effect="plain" :content="$t('test_track.plan.plan_status_completed')"/>
|
</template>
|
||||||
<ms-tag v-if="scope.row.status == 'Trash'" type="danger" effect="plain" content="废弃"/>
|
</el-table-column>
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="method"
|
prop="path"
|
||||||
:label="$t('api_test.definition.api_type')"
|
:label="$t('api_test.definition.api_path')"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip/>
|
||||||
<template v-slot:default="scope" class="request-method">
|
|
||||||
<el-tag size="mini" :style="{'background-color': getColor(scope.row.method), border: getColor(true, scope.row.method)}" class="api-el-tag">
|
|
||||||
{{ scope.row.method }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column width="160" :label="$t('api_test.definition.api_last_time')" prop="updateTime">
|
||||||
prop="path"
|
<template v-slot:default="scope">
|
||||||
:label="$t('api_test.definition.api_path')"
|
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||||
show-overflow-tooltip/>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column width="160" :label="$t('api_test.definition.api_last_time')" prop="updateTime">
|
<el-table-column
|
||||||
<template v-slot:default="scope">
|
prop="caseTotal"
|
||||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
:label="$t('api_test.definition.api_case_number')"
|
||||||
</template>
|
show-overflow-tooltip/>
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="caseTotal"
|
prop="caseStatus"
|
||||||
:label="$t('api_test.definition.api_case_number')"
|
:label="$t('api_test.definition.api_case_status')"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="caseStatus"
|
prop="casePassingRate"
|
||||||
:label="$t('api_test.definition.api_case_status')"
|
:label="$t('api_test.definition.api_case_passing_rate')"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
|
</el-table>
|
||||||
|
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||||
|
:total="total"/>
|
||||||
|
</api-list-container>
|
||||||
|
<table-select-count-bar :count="selectRows.size"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-table-column
|
|
||||||
prop="casePassingRate"
|
|
||||||
:label="$t('api_test.definition.api_case_passing_rate')"
|
|
||||||
show-overflow-tooltip/>
|
|
||||||
</el-table>
|
|
||||||
<ms-table-pagination :change="initTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
|
||||||
:total="total"/>
|
|
||||||
</api-list-container>
|
|
||||||
</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