fix(测试跟踪): 用例版本置新按钮显示条件优化
--bug=1023466 --user=陈建星 【测试跟踪】功能用例-编辑-版本-点击置新-提示信息后版本显示一直转圈 https://www.tapd.cn/55049933/s/1339220
This commit is contained in:
parent
9012507833
commit
2548c02c6b
|
@ -563,7 +563,8 @@ export default {
|
|||
// 2 表示式保存并创建
|
||||
// 3 表示
|
||||
saveType: 1,
|
||||
projectId: null
|
||||
projectId: null,
|
||||
createVersionId: null
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -1152,6 +1153,11 @@ export default {
|
|||
this.$emit("refresh", response.data);
|
||||
if (this.form.id) {
|
||||
this.$emit("caseEdit", param);
|
||||
if (this.createVersionId) {
|
||||
// 如果是创建版本,创建完跳转到对应的版本
|
||||
this.createVersionId = null;
|
||||
this.routerToEdit(response.data.id);
|
||||
}
|
||||
} else {
|
||||
param.id = response.data.id;
|
||||
this.close();
|
||||
|
@ -1162,9 +1168,11 @@ export default {
|
|||
this.routerToEdit(response.data.id);
|
||||
}
|
||||
}
|
||||
this.createVersionId = null;
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.createVersionId = null;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -1218,6 +1226,9 @@ export default {
|
|||
param.unRelateFileMetaIds = this.$refs.otherInfo.getUnRelateFiles();
|
||||
}
|
||||
}
|
||||
if (this.createVersionId) {
|
||||
param.versionId = this.createVersionId;
|
||||
}
|
||||
return param;
|
||||
},
|
||||
parseOldFields(param) {
|
||||
|
@ -1484,12 +1495,12 @@ export default {
|
|||
async createVersion(row) {
|
||||
if (this.validateForm()) {
|
||||
// 创建新版本
|
||||
this.form.versionId = row.id;
|
||||
let hasOtherInfo = await this.hasOtherInfo();
|
||||
if (hasOtherInfo) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
this.$refs.selectPropDialog.open();
|
||||
this.$refs.selectPropDialog.open(row.id);
|
||||
} else {
|
||||
this.createVersionId = row.id;
|
||||
this.saveCase(() => {
|
||||
if (this.$refs.versionHistory) {
|
||||
this.$refs.versionHistory.loading = false;
|
||||
|
@ -1547,6 +1558,7 @@ export default {
|
|||
},
|
||||
confirmOtherInfo(selectedOtherInfo) {
|
||||
this.selectedOtherInfo = selectedOtherInfo;
|
||||
this.createVersionId = selectedOtherInfo.versionId;
|
||||
this.saveCase();
|
||||
},
|
||||
copyRow() {
|
||||
|
|
|
@ -54,53 +54,6 @@
|
|||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<!-- origin -->
|
||||
<!-- <el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="form.remark">{{
|
||||
$t("commons.remark")
|
||||
}}</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="form.relateTest">{{
|
||||
$t("test_track.case.relate_test")
|
||||
}}</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="form.relateDemand">{{
|
||||
$t("test_track.related_requirements")
|
||||
}}</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="form.relateIssue">{{
|
||||
$t("test_track.case.relate_issue")
|
||||
}}</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="form.dependency">{{
|
||||
$t("commons.relationship.name")
|
||||
}}</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="form.archive">{{
|
||||
$t("test_track.case.attachment")
|
||||
}}</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ $t("commons.cancel") }}</el-button>
|
||||
|
@ -124,12 +77,14 @@ export default {
|
|||
relateIssue: false,
|
||||
archive: false,
|
||||
dependency: false,
|
||||
versionId: null
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
open(versionId) {
|
||||
this.visible = true;
|
||||
this.form.versionId = versionId;
|
||||
},
|
||||
close() {
|
||||
this.visible = false;
|
||||
|
|
|
@ -39,8 +39,7 @@
|
|||
<div
|
||||
class="updated opt-row"
|
||||
@click.stop="setLatest(item)"
|
||||
v-if="caseVersionMap.has(item.id)
|
||||
&& !(isRead || item.id === dataLatestId)"
|
||||
v-if="showSetNew(item)"
|
||||
>
|
||||
{{ $t("case.set_new") }}
|
||||
</div>
|
||||
|
@ -172,7 +171,8 @@ export default {
|
|||
versionCompareOptions: [],
|
||||
userData: {},
|
||||
currentVersion: {},
|
||||
dataLatestId: "",
|
||||
dataLatestId: null,
|
||||
latestVersionId: null,
|
||||
compareDialogVisible: false,
|
||||
// 版本对比相关
|
||||
versionLeftId: "",
|
||||
|
@ -271,9 +271,22 @@ export default {
|
|||
this.loading = true;
|
||||
this.$emit("setLatest", row);
|
||||
},
|
||||
showSetNew(item) {
|
||||
let hasVersionCase = this.caseVersionMap.has(item.id);
|
||||
let latestVersionCondition = this.caseVersionMap.has(this.latestVersionId) ? item.id === this.latestVersionId : true;
|
||||
let isNotDataLatestVersionCase = item.id === this.dataLatestId;
|
||||
return hasVersionCase // 有当前版本的用例
|
||||
&& latestVersionCondition // 有最新版本的用例,则非最新版本的其他版本不显示置新
|
||||
&& !this.isRead // 不是只读
|
||||
&& !isNotDataLatestVersionCase // 已经是最新版本,不显示置新
|
||||
},
|
||||
handleVersionOptions() {
|
||||
let latestData = {};
|
||||
this.versionOptions.forEach(v => {
|
||||
if (v.latest) {
|
||||
// 获取最新版本
|
||||
this.latestVersionId = v.id;
|
||||
}
|
||||
|
||||
// 获取当前版本
|
||||
if (v.id === this.currentVersionId) {
|
||||
|
@ -288,7 +301,7 @@ export default {
|
|||
// 设置版本的创建人
|
||||
v.createName = versionCase.createName;
|
||||
|
||||
// 获取最新版本
|
||||
// 获取当前用例最新版本
|
||||
if (versionCase.latest) {
|
||||
latestData = v;
|
||||
this.dataLatestId = v.id;
|
||||
|
|
Loading…
Reference in New Issue