fix(测试跟踪): 版本对比创建人显示错误
--bug=1025780 --user=陈建星 【测试跟踪】-测试计划-测试用例-进入编辑,新建版本-版本对比错误 https://www.tapd.cn/55049933/s/1366298
This commit is contained in:
parent
b8d37b7b77
commit
77f63fd49f
|
@ -315,7 +315,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- since v2.7 -->
|
<!-- since v2.7 -->
|
||||||
<case-diff-side-viewer ref="caseDiffViewerRef" ></case-diff-side-viewer>
|
<case-diff-side-viewer ref="caseDiffViewerRef"/>
|
||||||
<version-create-other-info-select
|
<version-create-other-info-select
|
||||||
@confirmOtherInfo="confirmOtherInfo"
|
@confirmOtherInfo="confirmOtherInfo"
|
||||||
ref="selectPropDialog"/>
|
ref="selectPropDialog"/>
|
||||||
|
@ -1490,11 +1490,16 @@ export default {
|
||||||
this.currentVersionName = versionName;
|
this.currentVersionName = versionName;
|
||||||
},
|
},
|
||||||
compareBranchWithVersionId(originId, targetId){
|
compareBranchWithVersionId(originId, targetId){
|
||||||
|
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(originId, targetId, this.currentTestCaseInfo.id)
|
this.$refs.caseDiffViewerRef.open(originVersion, targetVersion, this.currentTestCaseInfo.id)
|
||||||
},
|
},
|
||||||
compareBranch(t1, t2) {
|
compareBranch(t1, t2) {
|
||||||
this.compareBranchWithVersionId(t1.id, t2.id);
|
this.compareBranchWithVersionInfo(t1, t2);
|
||||||
},
|
},
|
||||||
compare(row) {
|
compare(row) {
|
||||||
testCaseGetByVersionId(row.id, this.currentTestCaseInfo.refId).then(
|
testCaseGetByVersionId(row.id, this.currentTestCaseInfo.refId).then(
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<case-diff-viewer
|
<case-diff-viewer
|
||||||
:versionLeftId="versionLeftId"
|
:left-version="leftVersion"
|
||||||
:versionRightId="versionRightId"
|
:right-version="rightVersion"
|
||||||
:caseId="caseId"
|
:caseId="caseId"
|
||||||
></case-diff-viewer>
|
></case-diff-viewer>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
@ -34,8 +34,8 @@ export default {
|
||||||
visible: false,
|
visible: false,
|
||||||
isFullScreen: false,
|
isFullScreen: false,
|
||||||
// props 数据
|
// props 数据
|
||||||
versionLeftId: "",
|
leftVersion: {},
|
||||||
versionRightId: "",
|
rightVersion: {},
|
||||||
caseId: "",
|
caseId: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -63,9 +63,9 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open(versionLeftId, versionRightId, caseId) {
|
open(leftVersion, rightVersion, caseId) {
|
||||||
this.versionLeftId = versionLeftId;
|
this.leftVersion = leftVersion;
|
||||||
this.versionRightId = versionRightId;
|
this.rightVersion = rightVersion;
|
||||||
this.caseId = caseId;
|
this.caseId = caseId;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="version-creator">
|
<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 class="static-label">{{$t('permission.project_custom_code.create')}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -304,13 +304,17 @@ export default {
|
||||||
CaseDiffIssueRelate,
|
CaseDiffIssueRelate,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
versionLeftId: {
|
leftVersion: {
|
||||||
type: String,
|
type: Object,
|
||||||
default: "",
|
default() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rightVersion: {
|
||||||
|
type: Object,
|
||||||
|
default() {
|
||||||
|
return {}
|
||||||
},
|
},
|
||||||
versionRightId: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
},
|
||||||
caseId: {
|
caseId: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -325,8 +329,6 @@ export default {
|
||||||
standardWith: 184,
|
standardWith: 184,
|
||||||
prevBtn: true,
|
prevBtn: true,
|
||||||
nextBtn: true,
|
nextBtn: true,
|
||||||
//手动切换版本id
|
|
||||||
appointVersionRightId: "",
|
|
||||||
/**
|
/**
|
||||||
* 正文
|
* 正文
|
||||||
*/
|
*/
|
||||||
|
@ -344,8 +346,6 @@ export default {
|
||||||
cacheVersionsMap: new Map(),
|
cacheVersionsMap: new Map(),
|
||||||
// 版本名称与版本id的对应关系
|
// 版本名称与版本id的对应关系
|
||||||
cacheVersionsNameMap: new Map(),
|
cacheVersionsNameMap: new Map(),
|
||||||
// 当前case 可用的版本id
|
|
||||||
caseVersionIds: new Set(),
|
|
||||||
// 版本列表
|
// 版本列表
|
||||||
versionOptions: [],
|
versionOptions: [],
|
||||||
versionList: [],
|
versionList: [],
|
||||||
|
@ -439,9 +439,6 @@ export default {
|
||||||
async refresh() {
|
async refresh() {
|
||||||
await this.fetchCaseVersions();
|
await this.fetchCaseVersions();
|
||||||
await this.fetchAllCaseVersion();
|
await this.fetchAllCaseVersion();
|
||||||
// 构造版本列表 根据顺序
|
|
||||||
// 这里构建的是全部的版本, 用来快速切换,
|
|
||||||
// this.formatVersionList();
|
|
||||||
this.formatCompareVersion();
|
this.formatCompareVersion();
|
||||||
this.checkoutVersionCase();
|
this.checkoutVersionCase();
|
||||||
this.calculate();
|
this.calculate();
|
||||||
|
@ -474,20 +471,6 @@ export default {
|
||||||
this.tagDiffData = this.defaultExecutor.tagDiffData || {};
|
this.tagDiffData = this.defaultExecutor.tagDiffData || {};
|
||||||
this.baseInfoDiffData = this.defaultExecutor.baseInfoDiffData || {};
|
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() {
|
async fetchAllCaseVersion() {
|
||||||
//首先获取所有版本,再去构造版本展示的数组
|
//首先获取所有版本,再去构造版本展示的数组
|
||||||
let res = await getProjectVersions(getCurrentProjectID());
|
let res = await getProjectVersions(getCurrentProjectID());
|
||||||
|
@ -499,7 +482,6 @@ export default {
|
||||||
data.forEach((e) => {
|
data.forEach((e) => {
|
||||||
this.cacheVersionsMap.set(e.versionId, e);
|
this.cacheVersionsMap.set(e.versionId, e);
|
||||||
this.cacheVersionsNameMap.set(e.versionName, e.versionId);
|
this.cacheVersionsNameMap.set(e.versionName, e.versionId);
|
||||||
this.caseVersionIds.add(e.versionId);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -521,17 +503,15 @@ export default {
|
||||||
},
|
},
|
||||||
formatCompareVersion() {
|
formatCompareVersion() {
|
||||||
// 只添加比对的版本
|
// 只添加比对的版本
|
||||||
let leftVersion = this.versionOptions.filter(version => version.id === this.versionLeftId);
|
this.versionList.push(this.leftVersion);
|
||||||
let rightVersion = this.versionOptions.filter(version => version.id === this.versionRightId);
|
this.versionList.push(this.rightVersion);
|
||||||
this.versionList.push(leftVersion[0]);
|
|
||||||
this.versionList.push(rightVersion[0]);
|
|
||||||
},
|
},
|
||||||
checkoutVersionCase() {
|
checkoutVersionCase() {
|
||||||
if (this.versionLeftId) {
|
if (this.leftVersion) {
|
||||||
this.originCase = this.cacheVersionsMap.get(this.versionLeftId);
|
this.originCase = this.cacheVersionsMap.get(this.leftVersion.id);
|
||||||
}
|
}
|
||||||
if (this.versionRightId) {
|
if (this.rightVersion) {
|
||||||
this.targetCase = this.cacheVersionsMap.get(this.versionRightId);
|
this.targetCase = this.cacheVersionsMap.get(this.rightVersion.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async diffAttachment() {
|
async diffAttachment() {
|
||||||
|
|
Loading…
Reference in New Issue