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

--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
parent 3442559e00
commit f4fcbbd700
6 changed files with 81 additions and 40 deletions

View File

@ -271,12 +271,6 @@ export default {
height: 32px; 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) { :deep(.ms-select-tag.el-select span.el-select__tags-text) {
max-width: 240px!important; 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); color: rgb(31, 35, 41);
} }
:deep(.el-tag .el-icon-close::before) { :deep(.ms-top.el-tag .el-icon-close::before) {
display: block; font-size: 24px;
font-size: 26px;
position: relative; position: relative;
top: -15px; top: -3px;
left: -6px;
} }
</style> </style>

View File

@ -288,23 +288,63 @@ span.el-tag.el-tag--info.el-tag--mini.el-tag--light span{
color: rgb(31, 35, 41); color: rgb(31, 35, 41);
} }
/** /**
* el-tag-icon-close * el-tag-icon-close
*/ */
i.el-tag__close.el-icon-close { i.el-tag__close.el-icon-close {
height: 0; 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; font-size: 28px;
position: relative;
top: -7px;
left: -6px;
} }
.el-tag.el-tag--info .el-tag__close:hover { .el-tag.el-tag--info .el-tag__close:hover {
color: #1F2329; color: #1F2329;
background-color: #909399; 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> </style>

View File

@ -1560,7 +1560,7 @@ export default {
}); });
} }
let detailForm = this.$refs.otherInfo.validateForm(); 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(); let customValidate = this.$refs.testCaseBaseInfo.validateCustomForm();
if (!detailForm || !baseInfoValidate) { if (!detailForm || !baseInfoValidate) {
return false; return false;

View File

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

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="case-name" :class="isNameEdit ? 'name-input' : 'name-text'"> <div class="case-name">
<div v-if="isAdd || editableState" :class="'case-name'"> <div v-if="isAdd || editableState" :class="'case-name'">
{{ editableState ? $t('test_track.case.edit_case') : $t('test_track.case.create_case') }} {{ editableState ? $t('test_track.case.edit_case') : $t('test_track.case.create_case') }}
</div> </div>
<div v-else> <div :class="isNameEdit ? 'name-input' : 'name-text'" v-else>
<span v-if="isNameEdit"> <span v-if="isNameEdit">
<el-input <el-input
:class="{ 'input-error' : showInputError}" :class="{ 'input-error' : showInputError}"