fix(测试跟踪): 版本对比创建人显示错误

--bug=1025780 --user=陈建星 【测试跟踪】-测试计划-测试用例-进入编辑,新建版本-版本对比错误 https://www.tapd.cn/55049933/s/1366298
This commit is contained in:
chenjianxing 2023-04-25 11:51:17 +08:00 committed by jianxing
parent b8d37b7b77
commit 77f63fd49f
3 changed files with 33 additions and 48 deletions

View File

@ -315,7 +315,7 @@
</div>
</div>
<!-- since v2.7 -->
<case-diff-side-viewer ref="caseDiffViewerRef" ></case-diff-side-viewer>
<case-diff-side-viewer ref="caseDiffViewerRef"/>
<version-create-other-info-select
@confirmOtherInfo="confirmOtherInfo"
ref="selectPropDialog"/>
@ -1490,11 +1490,16 @@ export default {
this.currentVersionName = versionName;
},
compareBranchWithVersionId(originId, targetId){
//
this.$refs.caseDiffViewerRef.open(originId, targetId, this.currentTestCaseInfo.id)
let originVersion = this.$refs.versionHistory.findVersionById(originId);
let targetVersion = this.$refs.versionHistory.findVersionById(targetId);
this.compareBranchWithVersionInfo(originVersion, targetVersion, this.currentTestCaseInfo.id);
},
compareBranchWithVersionInfo(originVersion, targetVersion){
//
this.$refs.caseDiffViewerRef.open(originVersion, targetVersion, this.currentTestCaseInfo.id)
},
compareBranch(t1, t2) {
this.compareBranchWithVersionId(t1.id, t2.id);
this.compareBranchWithVersionInfo(t1, t2);
},
compare(row) {
testCaseGetByVersionId(row.id, this.currentTestCaseInfo.refId).then(

View File

@ -17,8 +17,8 @@
</div>
</template>
<case-diff-viewer
:versionLeftId="versionLeftId"
:versionRightId="versionRightId"
:left-version="leftVersion"
:right-version="rightVersion"
:caseId="caseId"
></case-diff-viewer>
</el-drawer>
@ -34,8 +34,8 @@ export default {
visible: false,
isFullScreen: false,
// props
versionLeftId: "",
versionRightId: "",
leftVersion: {},
rightVersion: {},
caseId: "",
};
},
@ -63,9 +63,9 @@ export default {
},
},
methods: {
open(versionLeftId, versionRightId, caseId) {
this.versionLeftId = versionLeftId;
this.versionRightId = versionRightId;
open(leftVersion, rightVersion, caseId) {
this.leftVersion = leftVersion;
this.rightVersion = rightVersion;
this.caseId = caseId;
this.visible = true;
},

View File

@ -24,7 +24,7 @@
</div>
</div>
<div class="version-creator">
<div class="username">{{ item.createUserName }}</div>
<div class="username">{{ item.createName }}</div>
<div class="static-label">{{$t('permission.project_custom_code.create')}}</div>
</div>
</div>
@ -304,13 +304,17 @@ export default {
CaseDiffIssueRelate,
},
props: {
versionLeftId: {
type: String,
default: "",
leftVersion: {
type: Object,
default() {
return {}
},
},
versionRightId: {
type: String,
default: "",
rightVersion: {
type: Object,
default() {
return {}
},
},
caseId: {
type: String,
@ -325,8 +329,6 @@ export default {
standardWith: 184,
prevBtn: true,
nextBtn: true,
//id
appointVersionRightId: "",
/**
* 正文
*/
@ -344,8 +346,6 @@ export default {
cacheVersionsMap: new Map(),
// id
cacheVersionsNameMap: new Map(),
// case id
caseVersionIds: new Set(),
//
versionOptions: [],
versionList: [],
@ -439,9 +439,6 @@ export default {
async refresh() {
await this.fetchCaseVersions();
await this.fetchAllCaseVersion();
//
// , ,
// this.formatVersionList();
this.formatCompareVersion();
this.checkoutVersionCase();
this.calculate();
@ -474,20 +471,6 @@ export default {
this.tagDiffData = this.defaultExecutor.tagDiffData || {};
this.baseInfoDiffData = this.defaultExecutor.baseInfoDiffData || {};
},
formatVersionList() {
let map = new Map();
this.caseVersionIds.forEach((v) => {
map.set(v, v);
});
//
for (let i = this.versionOptions.length - 1; i >= 0; i--) {
let v = this.versionOptions[i];
if (map.get(v.id)) {
this.versionList.push(v);
}
}
},
async fetchAllCaseVersion() {
//
let res = await getProjectVersions(getCurrentProjectID());
@ -499,7 +482,6 @@ export default {
data.forEach((e) => {
this.cacheVersionsMap.set(e.versionId, e);
this.cacheVersionsNameMap.set(e.versionName, e.versionId);
this.caseVersionIds.add(e.versionId);
});
},
@ -521,17 +503,15 @@ export default {
},
formatCompareVersion() {
//
let leftVersion = this.versionOptions.filter(version => version.id === this.versionLeftId);
let rightVersion = this.versionOptions.filter(version => version.id === this.versionRightId);
this.versionList.push(leftVersion[0]);
this.versionList.push(rightVersion[0]);
this.versionList.push(this.leftVersion);
this.versionList.push(this.rightVersion);
},
checkoutVersionCase() {
if (this.versionLeftId) {
this.originCase = this.cacheVersionsMap.get(this.versionLeftId);
if (this.leftVersion) {
this.originCase = this.cacheVersionsMap.get(this.leftVersion.id);
}
if (this.versionRightId) {
this.targetCase = this.cacheVersionsMap.get(this.versionRightId);
if (this.rightVersion) {
this.targetCase = this.cacheVersionsMap.get(this.rightVersion.id);
}
},
async diffAttachment() {