Merge branch 'dev' of github.com:fit2cloudrd/metersphere-server into dev

 Conflicts:
	frontend/src/i18n/zh-CN.js
This commit is contained in:
Captain.B 2020-05-08 18:03:34 +08:00
commit 841019d4a7
4 changed files with 112 additions and 72 deletions

View File

@ -1,28 +1,35 @@
<template> <template>
<div> <div>
<el-row type="flex" justify="start"> <el-row type="flex" justify="start">
<el-col :span="8"> <el-col :span="8">
<h3>{{$t('load_test.domain_bind')}}</h3> <h3>{{$t('load_test.domain_bind')}}</h3>
</el-col> <el-button type="el-icon-circle-plus-outline" plain size="mini" @click="add('domains')">{{$t('commons.add')}}</el-button>
<el-col :span="8">
<el-button type="primary" plain size="mini" @click="add('domains')">{{$t('commons.add')}}</el-button>
</el-col> </el-col>
</el-row> </el-row>
<!-- --> <!-- -->
<el-row> <el-row>
<el-table :data="domains"> <el-col :span="20">
<el-table :data="domains" size="mini" class="tb-edit" align="center" border highlight-current-row>
<el-table-column <el-table-column
align="center"
:label="$t('load_test.domain')" :label="$t('load_test.domain')"
show-overflow-tooltip> show-overflow-tooltip>
<template v-slot:default="{row}"> <template v-slot:default="{row}">
<template v-if="row.edit"> <el-input
<el-input v-model="row.domain" class="edit-input" size="mini"/> size="mini"
</template> v-if="readOnly"
<span v-else>{{ row.domain }}</span> type="textarea"
:rows="1"
class="edit-input"
v-model="row.domain"
:placeholder="$t('load_test.domain')"
clearable>
</el-input>
<span >{{row.domain}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center"
:label="$t('load_test.enable')" :label="$t('load_test.enable')"
show-overflow-tooltip> show-overflow-tooltip>
<template v-slot:default="{row}"> <template v-slot:default="{row}">
@ -31,46 +38,36 @@
size="mini" size="mini"
v-model="row.enable" v-model="row.enable"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949"> inactive-color="#ff4949"
@click="confirmEdit(row)"
>
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center"
:label="$t('load_test.ip')" :label="$t('load_test.ip')"
show-overflow-tooltip> show-overflow-tooltip>
<template v-slot:default="{row}"> <template v-slot:default="{row}">
<template v-if="row.edit"> <el-input
<el-input v-model="row.ip" class="edit-input" size="mini"/> size="mini"
</template> v-if="readOnly"
<span v-else>{{ row.ip }}</span> type="textarea"
class="edit-input"
:rows="1"
v-model="row.ip"
:placeholder="$t('load_test.ip')"
clearable></el-input>
<span>{{row.ip}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center"> <el-table-column align="center" :label="$t('load_test.operating')">
<template v-slot:default="{row, $index}"> <template v-slot:default="{row, $index}">
<template v-if="row.edit">
<el-button <el-button
class="cancel-btn"
size="mini"
icon="el-icon-refresh"
type="warning"
circle
@click="cancelEdit(row)">
</el-button>
<el-button
type="success"
size="mini"
icon="el-icon-circle-check"
circle
@click="confirmEdit(row)">
</el-button>
</template>
<el-button
v-else
type="primary" type="primary"
size="mini" icon="el-icon-plus"
icon="el-icon-edit" circle size="mini"
circle @click="add('domains')">
@click="edit(row)">
</el-button> </el-button>
<el-button <el-button
type="danger" type="danger"
@ -82,31 +79,39 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<h3>{{$t('load_test.params')}}</h3> <h3>{{$t('load_test.params')}}</h3>
</el-col> <el-button type="el-icon-circle-plus-outline" plain size="mini" @click="add('params')">{{$t('commons.add')}}</el-button>
<el-col :span="8">
<el-button type="primary" plain size="mini" @click="add('params')">{{$t('commons.add')}}</el-button>
</el-col> </el-col>
</el-row> </el-row>
<!-- --> <!-- -->
<el-row> <el-row>
<el-table :data="params"> <el-col :span="20">
<el-table :data="params" size="mini" class="tb-edit" align="center" border highlight-current-row>
<el-table-column <el-table-column
align="center"
:label="$t('load_test.param_name')" :label="$t('load_test.param_name')"
show-overflow-tooltip> show-overflow-tooltip>
<template v-slot:default="{row}"> <template v-slot:default="{row}">
<template v-if="row.edit"> <el-input
<el-input v-model="row.name" class="edit-input" size="mini"/> size="mini"
</template> v-if="readOnly"
<span v-else>{{ row.name }}</span> type="textarea"
:rows="1"
class="edit-input"
v-model="row.name"
:placeholder="$t('load_test.param_name')"
clearable>
</el-input>
<span >{{row.name}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center"
:label="$t('load_test.enable')" :label="$t('load_test.enable')"
show-overflow-tooltip> show-overflow-tooltip>
<template v-slot:default="{row}"> <template v-slot:default="{row}">
@ -121,40 +126,32 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:label="$t('load_test.param_value')" :label="$t('load_test.param_value')"
show-overflow-tooltip> show-overflow-tooltip align="center">
<template v-slot:default="{row}"> <template v-slot:default="{row}">
<template v-if="row.edit"> <!-- <template v-if="row.edit">
<el-input v-model="row.value" class="edit-input" size="mini"/> <el-input v-model="row.value" class="edit-input" size="mini"/>
</template> </template>
<span v-else>{{ row.value }}</span> <span v-else>{{ row.value }}</span>-->
<el-input
size="mini"
v-if="readOnly"
type="textarea"
class="edit-input"
:rows="1"
v-model="row.value"
:placeholder="$t('load_test.param_value')"
clearable></el-input>
<span>{{row.value}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center"> <el-table-column align="center" :label="$t('load_test.operating')">
<template v-slot:default="{row, $index}"> <template v-slot:default="{row, $index}">
<template v-if="row.edit">
<el-button <el-button
class="cancel-btn"
size="mini"
icon="el-icon-refresh"
type="warning"
circle
@click="cancelEdit(row)">
</el-button>
<el-button
type="success"
size="mini"
icon="el-icon-circle-check"
circle
@click="confirmEdit(row)">
</el-button>
</template>
<el-button
v-else
type="primary" type="primary"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-plus"
circle circle
@click="edit(row)"> @click="add(row)">
</el-button> </el-button>
<el-button <el-button
type="danger" type="danger"
@ -166,6 +163,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
@ -211,6 +209,12 @@
statusCodeStr: '', statusCodeStr: '',
} }
}, },
props: {
readOnly: {
type: Boolean,
default: true
},
},
mounted() { mounted() {
let testId = this.$route.path.split('/')[4]; let testId = this.$route.path.split('/')[4];
if (testId) { if (testId) {
@ -253,6 +257,7 @@
this.statusCodeStr = this.statusCode.join(','); this.statusCodeStr = this.statusCode.join(',');
this.domains = data.domains || []; this.domains = data.domains || [];
this.params = data.params || []; this.params = data.params || [];
this.add('domains');
this.domains.forEach(d => d.edit = false); this.domains.forEach(d => d.edit = false);
this.params.forEach(d => d.edit = false); this.params.forEach(d => d.edit = false);
} }
@ -262,7 +267,7 @@
if (dataName === 'domains') { if (dataName === 'domains') {
this[dataName].push({ this[dataName].push({
domain: 'fit2cloud.com', domain: 'fit2cloud.com',
enable: true, enable: false,
ip: '127.0.0.1', ip: '127.0.0.1',
edit: true, edit: true,
}); });
@ -290,6 +295,7 @@
}, },
confirmEdit(row) { confirmEdit(row) {
row.edit = false; row.edit = false;
row.enable=true,
this.saveOriginObject(row); this.saveOriginObject(row);
}, },
groupBy(data, key) { groupBy(data, key) {
@ -360,7 +366,22 @@
} }
.edit-input { .edit-input {
padding-right: 100px; padding-right: 0px;
}
.tb-edit .el-textarea {
display: none;
}
.tb-edit .current-row .el-textarea {
display: block;
}
.tb-edit .current-row .el-textarea+span {
display: none;
}
.el-col{
text-align: left;
}
.el-col .el-table{
align:center;
} }
</style> </style>

View File

@ -90,6 +90,7 @@
</el-form> </el-form>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<div class="title">{{$t('load_test.pressure_prediction_chart')}}</div>
<chart class="chart-container" ref="chart1" :options="orgOptions" :autoresize="true"></chart> <chart class="chart-container" ref="chart1" :options="orgOptions" :autoresize="true"></chart>
</el-col> </el-col>
</el-row> </el-row>
@ -306,9 +307,11 @@
} }
</script> </script>
<style scoped> <style scoped>
.pressure-config-container .el-input { .pressure-config-container .el-input {
width: 130px; width: 130px;
} }
.pressure-config-container .config-form-label { .pressure-config-container .config-form-label {
@ -323,4 +326,15 @@
.chart-container { .chart-container {
width: 100%; width: 100%;
} }
.el-col .el-form{
margin-top: 15px;
text-align: left;
}
.el-col {
margin-top: 15px;
text-align: left;
}
.title {
margin-left: 60px;
}
</style> </style>

View File

@ -129,6 +129,8 @@ export default {
'being_generated': 'Report is being generated...', 'being_generated': 'Report is being generated...',
}, },
load_test: { load_test: {
'operating':'Operating',
'pressure_prediction_chart':'Pressure Prediction Chart',
'recent': 'Recent Tests', 'recent': 'Recent Tests',
'search_by_name': 'Search by name', 'search_by_name': 'Search by name',
'project_name': 'Project', 'project_name': 'Project',

View File

@ -131,6 +131,7 @@ export default {
'being_generated': '报告正在生成中...', 'being_generated': '报告正在生成中...',
}, },
load_test: { load_test: {
'operating':'操作',
'recent': '最近的测试', 'recent': '最近的测试',
'search_by_name': '根据名称搜索', 'search_by_name': '根据名称搜索',
'project_name': '所属项目', 'project_name': '所属项目',
@ -184,6 +185,8 @@ export default {
'select_resource_pool': '请选择资源池', 'select_resource_pool': '请选择资源池',
'resource_pool_is_null': '资源池为空', 'resource_pool_is_null': '资源池为空',
'download_log_file': '下载完整日志文件', 'download_log_file': '下载完整日志文件',
'pressure_prediction_chart':'压力预估图',
}, },
api_test: { api_test: {
save_and_run: "保存并执行", save_and_run: "保存并执行",