fix(系统设置): 修复默认模版title编辑状态的问题

--bug=1008102 --user=刘瑞斌 【系统设置】默认缺陷模板的名字可以修改 https://www.tapd.cn/55049933/s/1071026
This commit is contained in:
CaptainB 2021-11-20 16:34:34 +08:00 committed by 刘瑞斌
parent 7f8733e0ca
commit e4d1c0c4de
1 changed files with 59 additions and 67 deletions

View File

@ -1,91 +1,83 @@
<template>
<el-row type="flex" class="head-bar">
<el-col :span="12">
<div v-if="showEdit" class="name-edit">
<el-input :placeholder="$t('test_track.plan_view.input_template_name')" v-model="template[prop]"/>
<span v-if="template[prop]" class="title">{{template[prop]}}</span>
<span class="name-tip" v-else>{{$t('test_track.plan_view.input_template_name')}}</span>
</div>
<span class="title">{{ template[prop] }}</span>
</el-col>
<el-col :span="12" class="head-right">
<el-button plain size="mini" @click="handleCancel">{{$t('test_track.return')}}</el-button>
<el-button type="primary" size="mini" @click="handleSave">{{$t('test_track.save')}}</el-button>
<el-button plain size="mini" @click="handleCancel">{{ $t('test_track.return') }}</el-button>
<el-button type="primary" size="mini" @click="handleSave">{{ $t('test_track.save') }}</el-button>
</el-col>
</el-row>
</template>
<script>
export default {
name: "TemplateComponentEditHeader",
data() {
return {
}
},
props: {
template: {
type: Object,
default() {
return {}
}
},
prop: {
type: String,
default() {
return 'name';
}
},
showEdit: {
type: Boolean,
default() {
return true;
}
},
},
methods: {
handleCancel() {
this.$emit('cancel');
},
handleSave() {
this.$emit('save');
}
export default {
name: "TemplateComponentEditHeader",
data() {
return {};
},
props: {
template: {
type: Object,
default() {
return {};
}
},
prop: {
type: String,
default() {
return 'name';
}
},
showEdit: {
type: Boolean,
default() {
return true;
}
},
},
methods: {
handleCancel() {
this.$emit('cancel');
},
handleSave() {
this.$emit('save');
}
}
};
</script>
<style scoped>
.head-right {
text-align: right;
}
.head-right {
text-align: right;
}
.head-bar {
background: white;
height: 45px;
line-height: 45px;
padding: 0 10px;
border: 1px solid #EBEEF5;
box-shadow: 0 0 2px 0 rgba(31,31,31,0.15), 0 1px 2px 0 rgba(31,31,31,0.15);
}
.head-bar {
background: white;
height: 45px;
line-height: 45px;
padding: 0 10px;
border: 1px solid #EBEEF5;
box-shadow: 0 0 2px 0 rgba(31, 31, 31, 0.15), 0 1px 2px 0 rgba(31, 31, 31, 0.15);
}
.name-edit:hover span {
display: none;
}
.name-edit:hover span {
display: none;
}
.name-edit .el-input {
display: none;
width: 200px;
}
.name-edit .el-input {
display: none;
width: 200px;
}
.name-edit:hover .el-input{
display: inline-block;
}
.name-edit:hover .el-input {
display: inline-block;
}
.name-tip {
color: #909399;
}
.name-tip {
color: #909399;
}
</style>