fix(测试跟踪): 功能用例编辑自定义ID校验的问题及MsInputTag展示问题

--story=1011313 --user=宋昌昌 【测试跟踪】github #22395用例详情保存操作优化 https://www.tapd.cn/55049933/s/1346059
This commit is contained in:
song-cc-rock 2023-03-07 14:28:15 +08:00 committed by fit2-zhao
parent a7266b07bb
commit 35364998a3
6 changed files with 81 additions and 40 deletions

View File

@ -271,12 +271,6 @@ export default {
height: 32px;
}
:deep(.ms-select-tag.el-select .el-tag__close.el-icon-close::before) {
position: relative;
top: -17px;
left: -6px;
}
:deep(.ms-select-tag.el-select span.el-select__tags-text) {
max-width: 240px!important;
}

View File

@ -234,11 +234,9 @@ span.ms-top.el-tag.el-tag--info.el-tag--small.el-tag--light span{
color: rgb(31, 35, 41);
}
:deep(.el-tag .el-icon-close::before) {
display: block;
font-size: 26px;
:deep(.ms-top.el-tag .el-icon-close::before) {
font-size: 24px;
position: relative;
top: -15px;
left: -6px;
top: -3px;
}
</style>

View File

@ -296,23 +296,63 @@ span.el-tag.el-tag--info.el-tag--mini.el-tag--light span{
color: rgb(31, 35, 41);
}
/**
* el-tag-icon-close
*/
i.el-tag__close.el-icon-close {
height: 0;
position: relative;
top: -11px!important;
left: 1px!important;
}
.el-select .el-tag__close.el-icon-close::before {
.el-tag__close.el-icon-close::before {
font-size: 28px;
position: relative;
top: -7px;
left: -6px;
}
.el-tag.el-tag--info .el-tag__close:hover {
color: #1F2329;
background-color: #909399;
}
/**
* 统一测试跟踪MsInputTag样式, 交互改造后去掉
*/
span.ms-top.el-tag.el-tag--info.el-tag--small.el-tag--light {
flex-direction: row;
align-items: center;
padding: 1px 6px;
gap: 4px;
height: 24px;
background: rgba(31, 35, 41, 0.1);
border-radius: 2px;
flex: none;
flex-grow: 0;
font-family: 'PingFang SC';
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 22px;
position: relative;
top: 6px;
}
span.ms-top.el-tag.el-tag--info.el-tag--small.el-tag--light span{
display: inline-block;
max-width: 500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: rgb(31, 35, 41);
}
.ms-top.el-tag .el-tag__close.el-icon-close::before {
font-size: 24px;
position: relative;
top: -3px;
}
</style>

View File

@ -1558,7 +1558,7 @@ export default {
});
}
let detailForm = this.$refs.otherInfo.validateForm();
let baseInfoValidate = this.$refs.testCaseBaseInfo.validateForm();
let baseInfoValidate = this.$refs.testCaseBaseInfo.validateForm() && this.$refs.testCaseBaseInfo.validateCaseFrom();
let customValidate = this.$refs.testCaseBaseInfo.validateCustomForm();
if (!detailForm || !baseInfoValidate) {
return false;

View File

@ -390,14 +390,6 @@ export default {
trigger: "blur",
},
],
customNum: [
{ required: true, message: "ID必填", trigger: "blur" },
{
max: 50,
message: this.$t("test_track.length_less_than") + "50",
trigger: "blur",
},
],
demandName: [
{
required: true,
@ -428,6 +420,14 @@ export default {
],
},
headerRules: {
customNum: [
{ required: true, message: "ID必填", trigger: "blur" },
{
max: 50,
message: this.$t("test_track.length_less_than") + "50",
trigger: "blur",
},
],
module: [
{
required: true,
@ -613,6 +613,15 @@ export default {
});
return isValidate;
},
validateCaseFrom() {
let isValidate = true;
this.$refs["caseFrom"].validate((valid) => {
if (!valid) {
isValidate = false;
}
});
return isValidate;
},
getCustomFields() {
let caseFromFields = this.$refs["caseFrom"].fields;
let customFields = this.$refs["customFieldForm"].fields;

View File

@ -1,24 +1,24 @@
<template>
<div class="case-name" :class="isNameEdit ? 'name-input' : 'name-text'">
<div class="case-name">
<div v-if="isAdd || editableState" :class="'case-name'">
{{ editableState ? $t('test_track.case.edit_case') : $t('test_track.case.create_case') }}
</div>
<div v-else>
<span v-if="isNameEdit">
<el-input
:class="{ 'input-error' : showInputError}"
size="small"
:placeholder="$t('case.please_enter_the_case_name')"
v-model="form.name"
@blur="handleNameEdit"
:maxlength="255"
show-word-limit
/>
</span>
<div :class="isNameEdit ? 'name-input' : 'name-text'" v-else>
<span v-if="isNameEdit">
<el-input
:class="{ 'input-error' : showInputError}"
size="small"
:placeholder="$t('case.please_enter_the_case_name')"
v-model="form.name"
@blur="handleNameEdit"
:maxlength="255"
show-word-limit
/>
</span>
<span v-else @click="handleNameClick">
{{ titleNum }}
{{ form.name }}
</span>
{{ titleNum }}
{{ form.name }}
</span>
</div>
</div>
</template>