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