fix(测试跟踪): 版本对比问题汇总

--bug=1023474 --user=宋昌昌 【测试跟踪】功能用例-编辑-版本对比-问题汇总 https://www.tapd.cn/55049933/s/1356366
This commit is contained in:
song-cc-rock 2023-03-28 14:16:32 +08:00 committed by jianxing
parent 7f838bf895
commit e217d1e9e5
6 changed files with 204 additions and 191 deletions

View File

@ -277,8 +277,9 @@ export default {
} }
.container { .container {
padding: 0px !important; padding: 0!important;
height: calc(100vh); height: calc(100vh);
background-color: #F5F6F7;
} }
.ms-aside-left { .ms-aside-left {

View File

@ -1802,7 +1802,7 @@ export default {
color: #646a73; color: #646a73;
align-items: center; align-items: center;
margin-left: px2rem(8); margin-left: px2rem(8);
padding: -1px 0.2rem; padding: 0.1rem 0.4rem;
.version-icon { .version-icon {
width: 20.17px; width: 20.17px;
@ -1897,7 +1897,7 @@ export default {
.label-row { .label-row {
} }
margin-right: px2rem(20.67); margin-right: px2rem(20.67);
padding: 0.2rem 0.5rem 0.2rem 0; padding: 0.1rem 0.4rem 0.1rem 0;
} }
.next-public-row.head-opt { .next-public-row.head-opt {
@ -1909,7 +1909,7 @@ export default {
.label-row { .label-row {
} }
margin-right: px2rem(20.67); margin-right: px2rem(20.67);
padding: 0.2rem 0 0.2rem 0.5rem; padding: 0.1rem 0 0.1rem 0.4rem;
} }
.follow-row.head-opt { .follow-row.head-opt {
@ -1921,7 +1921,7 @@ export default {
.label-row { .label-row {
} }
margin-right: px2rem(10); margin-right: px2rem(10);
padding: 0.2rem 0.5rem; padding: 0.1rem 0.4rem;
} }
.edit-public-row.head-opt { .edit-public-row.head-opt {
@ -1933,7 +1933,7 @@ export default {
.label-row { .label-row {
} }
margin-right: px2rem(20.67); margin-right: px2rem(20.67);
padding: 0.2rem 0.5rem; padding: 0.1rem 0.4rem;
} }
.copy-public-row.head-opt { .copy-public-row.head-opt {
@ -1945,10 +1945,10 @@ export default {
.label-row { .label-row {
} }
margin-right: px2rem(20.67); margin-right: px2rem(20.67);
padding: 0.2rem 0.5rem; padding: 0.1rem 0.4rem;
} }
.close-row.head-opt { .close-row.head-opt {
padding: 0.2rem; padding: 0.15rem;
} }
.add-public-row.head-opt { .add-public-row.head-opt {
.icon-row { .icon-row {
@ -1971,7 +1971,7 @@ export default {
.label-row { .label-row {
} }
margin-right: px2rem(24); margin-right: px2rem(24);
padding: 0.2rem 0.5rem; padding: 0.1rem 0.4rem;
} }
} }
} }
@ -2012,6 +2012,7 @@ export default {
font-size: 14px; font-size: 14px;
color: #783887; color: #783887;
cursor: pointer; cursor: pointer;
padding: 0.3rem;
} }
.diff-latest:hover{ .diff-latest:hover{
background: rgba(120, 56, 135, 0.1); background: rgba(120, 56, 135, 0.1);
@ -2027,6 +2028,7 @@ export default {
font-size: 14px; font-size: 14px;
color: #783887; color: #783887;
cursor: pointer; cursor: pointer;
padding: 0.3rem;
} }
} }
} }

View File

@ -42,7 +42,7 @@ export default {
props: { props: {
width: { width: {
type: Number, type: Number,
default: 1200, default: 1152,
}, },
dialogTitle: { dialogTitle: {
type: String, type: String,
@ -56,7 +56,7 @@ export default {
if (!isNaN(this.width)) { if (!isNaN(this.width)) {
//rem //rem
let remW = (this.width / 1440) * 100; let remW = (this.width / 1440) * 100;
let standW = (1200 / 1440) * 100; let standW = (1152 / 1440) * 100;
return remW > standW ? remW : standW + "%"; return remW > standW ? remW : standW + "%";
} }
return this.width; return this.width;

View File

@ -38,218 +38,232 @@
<div class="tab-pane-wrap"> <div class="tab-pane-wrap">
<el-tabs v-model="caseActiveName" @tab-click="tabClick"> <el-tabs v-model="caseActiveName" @tab-click="tabClick">
<el-tab-pane :label="$t('case.use_case_detail')" name="detail"> <el-tab-pane :label="$t('case.use_case_detail')" name="detail">
<div class="content-conatiner"> <el-scrollbar>
<div class="case-name-row"> <div class="content-container">
<div class="case-name case-title-wrap case-content-wrap"> <div class="case-name-row">
<div class="name title-wrap">{{ $t("case.case_name") }}</div> <div class="case-name case-title-wrap case-content-wrap">
<div class="required required-item"></div> <div class="name title-wrap">{{ $t("case.case_name") }}</div>
</div> <div class="required required-item"></div>
<div class="content-wrap"> </div>
<div class="opt-row"> <div class="content-wrap">
<case-diff-text <div class="opt-row">
:diffInfo="contentDiffData.caseName" <case-diff-text
></case-diff-text> :diffInfo="contentDiffData.caseName"
></case-diff-text>
</div>
</div> </div>
</div> </div>
</div> <!-- pre condition -->
<!-- pre condition --> <div class="pre-condition-row">
<div class="pre-condition-row"> <div class="condition-name case-title-wrap case-content-wrap">
<div class="condition-name case-title-wrap case-content-wrap"> <div class="name title-wrap">
<div class="name title-wrap"> {{ $t("case.preconditions") }}
{{ $t("case.preconditions") }} </div>
</div>
<div class="content-wrap">
<div class="opt-row">
<case-diff-text
:diffInfo="contentDiffData.prerequisite"
></case-diff-text>
</div>
</div> </div>
</div> </div>
<div class="content-wrap">
<div class="opt-row">
<case-diff-text
:diffInfo="contentDiffData.prerequisite"
></case-diff-text>
</div>
</div>
</div>
<!-- step description --> <!-- step description -->
<div class="step-desc-row"> <div class="step-desc-row">
<!-- 类型切换 --> <!-- 类型切换 -->
<div class="step-desc-name case-title-wrap case-content-wrap"> <div class="step-desc-name case-title-wrap case-content-wrap">
<div class="name title-wrap"> <div class="name title-wrap">
{{ {{
contentDiffData.stepModel === "TEXT" contentDiffData.stepModel === "TEXT"
? $t("test_track.case.text_describe") ? $t("test_track.case.text_describe")
: $t("test_track.case.step_describe") : $t("test_track.case.step_describe")
}} }}
</div>
<div class="update-type-row title-wrap"></div>
</div> </div>
<div class="update-type-row title-wrap"></div> <!-- 文本描述 -->
</div> <div class="content-wrap">
<!-- 文本描述 --> <div class="opt-row">
<div class="content-wrap"> <case-diff-text
<div class="opt-row"> :diffInfo="contentDiffData.stepDescription"
<case-diff-text ></case-diff-text>
:diffInfo="contentDiffData.stepDescription" </div>
></case-diff-text>
</div> </div>
</div> </div>
</div>
<!-- expect --> <!-- expect -->
<div <div
class="expect-row" class="expect-row"
v-if="contentDiffData.stepModel === 'TEXT'" v-if="contentDiffData.stepModel === 'TEXT'"
> >
<div class="expect-name case-title-wrap case-content-wrap"> <div class="expect-name case-title-wrap case-content-wrap">
<div class="name title-wrap"> <div class="name title-wrap">
{{ $t("test_track.case.expected_results") }} {{ $t("test_track.case.expected_results") }}
</div>
</div>
<div class="content-wrap">
<div class="opt-row">
<case-diff-text
:diffInfo="contentDiffData.expectedResult"
></case-diff-text>
</div>
</div> </div>
</div> </div>
<div class="content-wrap">
<div class="opt-row">
<case-diff-text
:diffInfo="contentDiffData.expectedResult"
></case-diff-text>
</div>
</div>
</div>
<!-- remark --> <!-- remark -->
<div class="remark-row"> <div class="remark-row">
<div class="remark-name case-title-wrap case-content-wrap"> <div class="remark-name case-title-wrap case-content-wrap">
<div class="name title-wrap">{{ $t("commons.remark") }}</div> <div class="name title-wrap">{{ $t("commons.remark") }}</div>
</div> </div>
<div class="content-wrap"> <div class="content-wrap">
<div class="opt-row"> <div class="opt-row">
<case-diff-text <case-diff-text
:diffInfo="contentDiffData.remark" :diffInfo="contentDiffData.remark"
></case-diff-text> ></case-diff-text>
</div>
</div> </div>
</div> </div>
</div>
<!-- 附件 --> <!-- 附件 -->
<div class="attachment-row"> <div class="attachment-row">
<div class="attachment-name case-title-wrap case-content-wrap"> <div class="attachment-name case-title-wrap case-content-wrap">
<div class="name title-wrap">{{ $t("case.attachment") }}</div> <div class="name title-wrap">{{ $t("case.attachment") }}</div>
</div> </div>
<div class="content-wrap"> <div class="content-wrap">
<!-- 添加附件 --> <!-- 添加附件 -->
<!-- tip --> <!-- tip -->
<div class="opt-btn"> <div class="opt-btn">
<div class="attachment-preview" v-if="showAttachment"> <div class="attachment-preview" v-if="showAttachment">
<case-attachment-viewer <case-attachment-viewer
:tableData="attachmentDiffData" :tableData="attachmentDiffData"
:isCopy="false" :isCopy="false"
:readOnly="true" :readOnly="true"
:is-delete="false" :is-delete="false"
></case-attachment-viewer> ></case-attachment-viewer>
<div v-if="!showAttachment">{{ $t("case.none") }}</div> <div v-if="!showAttachment">{{ $t("case.none") }}</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </el-scrollbar>
</el-tab-pane> </el-tab-pane>
<!-- 关联测试用例 --> <!-- 关联测试用例 -->
<el-tab-pane <el-tab-pane
:label="$t('case.associate_test_cases')" :label="$t('case.associate_test_cases')"
name="associateTestCases" name="associateTestCases"
> >
<div class="content-conatiner"> <el-scrollbar>
<case-diff-test-relate <div class="content-container">
:tableData="testCaseRelateData" <case-diff-test-relate
></case-diff-test-relate> :tableData="testCaseRelateData"
</div> ></case-diff-test-relate>
</div>
</el-scrollbar>
</el-tab-pane> </el-tab-pane>
<!-- 关联缺陷 --> <!-- 关联缺陷 -->
<el-tab-pane <el-tab-pane
:label="$t('test_track.case.relate_issue')" :label="$t('test_track.case.relate_issue')"
name="associatedDefects" name="associatedDefects"
> >
<div class="content-conatiner"> <el-scrollbar>
<case-diff-issue-relate <div class="content-container">
:tableData="issuesData" <case-diff-issue-relate
></case-diff-issue-relate> :tableData="issuesData"
</div> ></case-diff-issue-relate>
</div>
</el-scrollbar>
</el-tab-pane> </el-tab-pane>
<!-- 依赖关系 --> <!-- 依赖关系 -->
<el-tab-pane :label="$t('case.dependencies')" name="dependencies"> <el-tab-pane :label="$t('case.dependencies')" name="dependencies">
<div class="content-conatiner"> <el-scrollbar>
<case-diff-relationship <div class="content-container">
:resourceId="caseId" <case-diff-relationship
:preTableData="preTableData" :resourceId="caseId"
:postTableData="postTableData" :preTableData="preTableData"
></case-diff-relationship> :postTableData="postTableData"
</div> ></case-diff-relationship>
</div>
</el-scrollbar>
</el-tab-pane> </el-tab-pane>
<!-- 评论 --> <!-- 评论 -->
<el-tab-pane :label="$t('case.comment')" name="comment"> <el-tab-pane :label="$t('case.comment')" name="comment">
<div class="content-conatiner"> <el-scrollbar>
<case-comment-viewer <div class="content-container">
:readOnly="true" <case-comment-viewer
:comments="diffCommentsData" :readOnly="true"
></case-comment-viewer> :comments="diffCommentsData"
</div> ></case-comment-viewer>
</div>
</el-scrollbar>
</el-tab-pane> </el-tab-pane>
<!-- 变更记录 --> <!-- 变更记录 -->
<!-- <el-tab-pane :label="$t('case.change_record')" name="changeRecord"> <!-- <el-tab-pane :label="$t('case.change_record')" name="changeRecord">
<div class="content-conatiner"></div> <div class="content-container"></div>
</el-tab-pane> --> </el-tab-pane> -->
</el-tabs> </el-tabs>
</div> </div>
<div class="base-info-wrap"> <div class="content-base-info-wrap">
<!-- 所属模块 --> <el-scrollbar>
<div class="module-row"> <div class="base-info-wrap">
<div class="case-title-wrap"> <!-- 所属模块 -->
<div class="name title-wrap"> <div class="module-row">
{{ $t("test_track.case.module") }} <div class="case-title-wrap">
<div class="name title-wrap">
{{ $t("test_track.case.module") }}
</div>
<div class="required required-item"></div>
</div>
<case-diff-text :diffInfo="baseInfoDiffData.modules"></case-diff-text>
</div> </div>
<div class="required required-item"></div> <!-- 自定义字段 -->
</div> <div
<case-diff-text :diffInfo="baseInfoDiffData.modules"></case-diff-text> class="module-row item-row"
</div> v-for="(item, index) in customDiffData"
<!-- 自定义字段 --> :key="index"
<div >
class="module-row item-row" <div class="case-title-wrap">
v-for="(item, index) in customDiffData" <div class="name title-wrap">
:key="index" {{ item.key }}
> </div>
<div class="case-title-wrap"> <div class="required required-item" v-if="item.required"></div>
<div class="name title-wrap"> </div>
{{ item.key }} <case-diff-text
:diffInfo="[{ diffArr: item.value }]"
></case-diff-text>
</div> </div>
<div class="required required-item" v-if="item.required"></div> <!-- 关联需求 -->
</div> <div class="module-row item-row">
<case-diff-text <div class="case-title-wrap">
:diffInfo="[{ diffArr: item.value }]" <div class="name title-wrap">
></case-diff-text> {{ $t("test_track.related_requirements") }}
</div> </div>
<!-- 关联需求 --> <div class="required required-item"></div>
<div class="module-row item-row"> </div>
<div class="case-title-wrap"> <case-diff-text :diffInfo="baseInfoDiffData.story"></case-diff-text>
<div class="name title-wrap">
{{ $t("test_track.related_requirements") }}
</div> </div>
<div class="required required-item"></div> <!-- 需求ID/名称 -->
</div> <div class="module-row item-row">
<case-diff-text :diffInfo="baseInfoDiffData.story"></case-diff-text> <div class="case-title-wrap">
</div> <div class="name title-wrap">
<!-- 需求ID/名称 --> {{ $t("test_track.case.demand_name_id") }}
<div class="module-row item-row"> </div>
<div class="case-title-wrap"> <div class="required required-item"></div>
<div class="name title-wrap"> </div>
{{ $t("test_track.case.demand_name_id") }} <case-diff-text :diffInfo="baseInfoDiffData.storyId"></case-diff-text>
</div> </div>
<div class="required required-item"></div> <!-- 标签 -->
</div> <div class="module-row item-row">
<case-diff-text :diffInfo="baseInfoDiffData.storyId"></case-diff-text> <div class="case-title-wrap">
</div> <div class="name title-wrap">
<!-- 标签 --> {{ $t("commons.tag") }}
<div class="module-row item-row"> </div>
<div class="case-title-wrap"> </div>
<div class="name title-wrap"> <case-diff-text :diffInfo="tagDiffData.tags"></case-diff-text>
{{ $t("commons.tag") }}
</div> </div>
</div> </div>
<case-diff-text :diffInfo="tagDiffData.tags"></case-diff-text> </el-scrollbar>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -914,6 +928,10 @@ export default {
text-align: center; text-align: center;
line-height: 16px; line-height: 16px;
} }
.content-base-info-wrap {
height: calc(100vh - 110px);
}
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
// //
@ -934,22 +952,21 @@ export default {
} }
:deep(.el-tabs__content) { :deep(.el-tabs__content) {
overflow: auto; overflow: hidden;
} }
} }
.base-info-wrap { .base-info-wrap {
width: px2rem(304); width: px2rem(304);
height: calc(100vh - 130px); max-height: calc(70vh);
overflow-y: scroll;
padding: 24px; padding: 24px;
.item-row { .item-row {
margin-top: 21px; margin-top: 21px;
} }
} }
.content-conatiner { .content-container {
padding-left: px2rem(24); padding-left: px2rem(24);
padding-right: px2rem(24); padding-right: px2rem(24);
height: calc(100vh - 130px); max-height: calc(70vh);
} }
} }
.case-content-wrap { .case-content-wrap {
@ -978,9 +995,6 @@ export default {
.attachment-preview :deep(.atta-box) { .attachment-preview :deep(.atta-box) {
width: 25rem !important; width: 25rem !important;
} }
:deep(.atta-box .atta-container) {
width: 100% !important;
}
:deep(.atta-box .atta-container .icon) { :deep(.atta-box .atta-container .icon) {
// width: 100% !important; // width: 100% !important;
} }

View File

@ -152,8 +152,7 @@ export default class DefaultDiffExecutor extends AbstractVersionDiffExecutor {
{ {
diffArr: DiffUtil.diffText( diffArr: DiffUtil.diffText(
this.origin.prerequisite, this.origin.prerequisite,
this.target.prerequisite, this.target.prerequisite
true
), ),
}, },
]; ];
@ -162,8 +161,7 @@ export default class DefaultDiffExecutor extends AbstractVersionDiffExecutor {
{ {
diffArr: DiffUtil.diffText( diffArr: DiffUtil.diffText(
this.origin.stepDescription, this.origin.stepDescription,
this.target.stepDescription, this.target.stepDescription
true
), ),
}, },
]; ];
@ -172,8 +170,7 @@ export default class DefaultDiffExecutor extends AbstractVersionDiffExecutor {
{ {
diffArr: DiffUtil.diffText( diffArr: DiffUtil.diffText(
this.origin.expectedResult, this.origin.expectedResult,
this.target.expectedResult, this.target.expectedResult
true
), ),
}, },
]; ];
@ -182,8 +179,7 @@ export default class DefaultDiffExecutor extends AbstractVersionDiffExecutor {
{ {
diffArr: DiffUtil.diffText( diffArr: DiffUtil.diffText(
this.origin.remark, this.origin.remark,
this.target.remark, this.target.remark
true
), ),
}, },
]; ];

View File

@ -94,7 +94,7 @@ export default {
.name-text { .name-text {
width: auto; width: auto;
padding: 0.2rem; padding: 0.1rem 0.4rem;
} }
.input-error :deep(.el-input__inner) { .input-error :deep(.el-input__inner) {