fix(接口测试): 环境中变量名称太长显示问题

This commit is contained in:
chenjianxing 2020-10-14 13:08:46 +08:00
parent ad0dcbaa74
commit 0c3b154433
3 changed files with 12 additions and 4 deletions

View File

@ -11,7 +11,7 @@
</el-col> </el-col>
<el-col> <el-col>
<ms-api-variable-input :show-variable="showVariable" :is-read-only="isReadOnly" v-model="item.name" size="small" maxlength="200" @change="change" <ms-api-variable-input :show-copy="showCopy" :show-variable="showVariable" :is-read-only="isReadOnly" v-model="item.name" size="small" maxlength="200" @change="change"
:placeholder="$t('api_test.variable_name')" show-word-limit/> :placeholder="$t('api_test.variable_name')" show-word-limit/>
</el-col> </el-col>
<el-col> <el-col>
@ -45,6 +45,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
showCopy: {
type: Boolean,
default: true
},
}, },
data() { data() {
return { return {

View File

@ -2,8 +2,8 @@
<div class="variable-input"> <div class="variable-input">
<el-input class="el-input__inner_pd" :disabled="isReadOnly" :value="value" v-bind="$attrs" :size="size" @change="change" @input="input"/> <el-input class="el-input__inner_pd" :disabled="isReadOnly" :value="value" v-bind="$attrs" :size="size" @change="change" @input="input"/>
<div :class="{'hidden': !showVariable}" class="variable-combine" v-if="value"> <div :class="{'hidden': !showVariable}" class="variable-combine" v-if="value">
<div class="variable">{{variable}}</div> <div v-if="showCopy" class="variable">{{variable}}</div>
<el-tooltip :content="$t('api_test.copied')" manual v-model="visible" placement="top" :visible-arrow="false"> <el-tooltip v-if="showCopy" :content="$t('api_test.copied')" manual v-model="visible" placement="top" :visible-arrow="false">
<i class="el-icon-copy-document copy" @click="copy"/> <i class="el-icon-copy-document copy" @click="copy"/>
</el-tooltip> </el-tooltip>
</div> </div>
@ -25,6 +25,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
showCopy: {
type: Boolean,
default: true
},
}, },
data() { data() {

View File

@ -3,7 +3,7 @@
<el-form :model="commonConfig" :rules="rules" ref="commonConfig"> <el-form :model="commonConfig" :rules="rules" ref="commonConfig">
<span>{{$t('api_test.environment.globalVariable')}}</span> <span>{{$t('api_test.environment.globalVariable')}}</span>
<ms-api-scenario-variables :items="commonConfig.variables"/> <ms-api-scenario-variables :show-copy="false" :items="commonConfig.variables"/>
<el-form-item> <el-form-item>
<el-switch v-model="commonConfig.enableHost" active-text="Hosts"/> <el-switch v-model="commonConfig.enableHost" active-text="Hosts"/>