fix(测试跟踪): 创建缺陷自定义字段过多是会重复显示
--bug=1024987 --user=陈建星 【测试跟踪】功能用例编辑-关联缺陷-多次点击创建缺陷-创建缺陷页面数据显示重复-创建失败 https://www.tapd.cn/55049933/s/1357764
This commit is contained in:
parent
773a66557b
commit
26bb8a8156
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="add-issue-box">
|
||||
<div class="add-issue-box" v-loading="this.result.loading">
|
||||
<el-form
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
|
@ -9,6 +9,7 @@
|
|||
ref="form"
|
||||
>
|
||||
<!-- 标题 -->
|
||||
<div v-if="!enableThirdPartTemplate">
|
||||
<div class="title-row" v-if="!(this.issueTemplate.platform === 'Local')">
|
||||
<el-form-item :label="$t('commons.title')" prop="title">
|
||||
<div slot="label" class="required-item">
|
||||
|
@ -40,6 +41,8 @@
|
|||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 自定义字段 -->
|
||||
<div class="custom-field-wrap">
|
||||
<el-form
|
||||
|
@ -351,15 +354,16 @@ export default {
|
|||
this.$refs.testCaseIssueList.clear();
|
||||
this.$refs.testCaseIssueList.isXpack = hasLicense();
|
||||
}
|
||||
|
||||
enableThirdPartTemplate(this.projectId).then((r) => {
|
||||
this.enableThirdPartTemplate = r.data;
|
||||
});
|
||||
|
||||
this.$nextTick(() => {
|
||||
getIssuePartTemplateWithProject((template, project) => {
|
||||
this.currentProject = project;
|
||||
this.init(template, data);
|
||||
this.getDataInfoAsync(data);
|
||||
|
||||
enableThirdPartTemplate(this.currentProject.id).then((r) => {
|
||||
this.enableThirdPartTemplate = r.data;
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="field-item-wrap">
|
||||
<div v-for="i in customFieldRowNums" :key="i" class="field-item-iterator">
|
||||
<div class="field-item-iterator">
|
||||
<div
|
||||
class="custom-field-item"
|
||||
v-for="item in sortCustomFields"
|
||||
|
@ -48,34 +48,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <el-row v-for="(i) in (customFieldRowNums)" :key="i">
|
||||
<span class="custom-item" v-for="(item, j) in sortCustomFields" :key="j">
|
||||
<span v-if="j >= (i - 1)*3 && j < (i - 1)*3+3">
|
||||
<el-col :span="8" v-if="item.type !== 'richText'">
|
||||
<el-form-item :label="item.system ? $t(systemNameMap[item.name]) : item.name" :prop="item.name"
|
||||
:label-width="formLabelWidth">
|
||||
<custom-filed-component
|
||||
prop="defaultValue"
|
||||
:data="item"
|
||||
:form="form"
|
||||
:default-open="defaultOpen"
|
||||
:disabled="isPublic"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<div v-else>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
:label="item.system ? $t(systemNameMap[item.name]) : item.name"
|
||||
:prop="item.name"
|
||||
:default-open="defaultOpen"
|
||||
:label-width="formLabelWidth">
|
||||
<custom-filed-component :data="item" :form="form" prop="defaultValue"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
</el-row> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -119,19 +91,15 @@ export default {
|
|||
},
|
||||
},
|
||||
computed: {
|
||||
customFieldRowNums() {
|
||||
let size = this.issueTemplate.customFields
|
||||
? this.issueTemplate.customFields.length
|
||||
: 0;
|
||||
let val = parseInt(size / 3);
|
||||
return size % 3 == 0 ? val : val + 1;
|
||||
},
|
||||
systemNameMap() {
|
||||
return SYSTEM_FIELD_NAME_MAP;
|
||||
},
|
||||
sortCustomFields() {
|
||||
let total = 0; //定义total用于控制循环结束
|
||||
let customFields = this.issueTemplate.customFields;
|
||||
if (!customFields) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; total < customFields.length; total++) {
|
||||
if (customFields[i].type === "richText") {
|
||||
//循环到是0的位置就删除该元素0并且在arr末尾push进这个元素0,由于splice删除了该位置元素,所以i不用+1,下次循环仍然检查i位置的元素
|
||||
|
@ -159,7 +127,7 @@ export default {
|
|||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.custom-field-item:not(:first-child) {
|
||||
.custom-field-item {
|
||||
:deep(.el-form-item) {
|
||||
margin-left: 26px !important;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<el-drawer
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible"
|
||||
:size="1100"
|
||||
:size="size"
|
||||
@close="close"
|
||||
destroy-on-close
|
||||
ref="editFile"
|
||||
|
@ -108,6 +108,10 @@ export default {
|
|||
components: {},
|
||||
props: {
|
||||
title: String,
|
||||
size: {
|
||||
type: Number,
|
||||
default: 1100,
|
||||
},
|
||||
enablePagination: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
|
|
Loading…
Reference in New Issue