refactor(测试跟踪): jira缺陷管理部分问题优化
--bug=1013370 --user=陈建星 【测试跟踪】项目集成jira 缺陷管理 部分问题优化 https://www.tapd.cn/55049933/s/1169845
This commit is contained in:
parent
e6f3b8c55f
commit
18dee6b5b9
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<div v-loading="result.loading">
|
||||
<div>
|
||||
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="createVisible" destroy-on-close
|
||||
@close="handleClose">
|
||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="80px" size="small">
|
||||
<el-form v-loading="result.loading" :model="form" :rules="rules" ref="form" label-position="right" label-width="80px" size="small">
|
||||
<el-form-item :label-width="labelWidth" :label="$t('commons.name')" prop="name">
|
||||
<el-input v-model="form.name" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<el-button @click="check" type="primary" class="checkButton">{{ $t('test_track.issue.check_id_exist') }}</el-button>
|
||||
</el-form-item>
|
||||
|
||||
<project-jira-config v-if="jira" :label-width="labelWidth" :form="form">
|
||||
<project-jira-config :result="result" v-if="jira" :label-width="labelWidth" :form="form" ref="jiraConfig">
|
||||
<template #checkBtn>
|
||||
<el-button @click="check" type="primary" class="checkButton">{{ $t('test_track.issue.check_id_exist') }}</el-button>
|
||||
</template>
|
||||
|
@ -225,9 +225,12 @@ export default {
|
|||
} else {
|
||||
this.form = {issueConfigObj: {}};
|
||||
}
|
||||
if (this.$refs.jiraConfig) {
|
||||
this.$refs.jiraConfig.getIssueTypeOption(this.form);
|
||||
}
|
||||
this.platformOptions = [];
|
||||
this.platformOptions.push(...ISSUE_PLATFORM_OPTION);
|
||||
this.$get("/service/integration/all/" + getCurrentUser().lastWorkspaceId, response => {
|
||||
this.result = this.$get("/service/integration/all/" + getCurrentUser().lastWorkspaceId, response => {
|
||||
let data = response.data;
|
||||
let platforms = data.map(d => d.platform);
|
||||
this.filterPlatformOptions(platforms, TAPD);
|
||||
|
|
|
@ -31,7 +31,7 @@ import {getCurrentWorkspaceId} from "@/common/js/utils";
|
|||
export default {
|
||||
name: "ProjectJiraConfig",
|
||||
components: {MsInstructionsIcon},
|
||||
props: ['labelWidth', 'form'],
|
||||
props: ['labelWidth', 'form', 'result'],
|
||||
data() {
|
||||
return {
|
||||
issueTypes: []
|
||||
|
@ -43,12 +43,31 @@ export default {
|
|||
methods: {
|
||||
getIssueTypeOption() {
|
||||
this.issueTypes = [];
|
||||
this.result.loading = true;
|
||||
getJiraIssueType({
|
||||
projectId: this.form.id,
|
||||
workspaceId: getCurrentWorkspaceId(),
|
||||
jiraKey: this.form.jiraKey
|
||||
}, (data) => {
|
||||
this.issueTypes = data;
|
||||
let hasJiraIssueType = false;
|
||||
let hasJiraStoryType = false;
|
||||
if (data) {
|
||||
data.forEach(item => {
|
||||
if (this.form.issueConfigObj.jiraIssueTypeId === item.id) {
|
||||
hasJiraIssueType = true;
|
||||
} else if (this.form.issueConfigObj.jiraStoryTypeId === item.id) {
|
||||
hasJiraStoryType = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!hasJiraIssueType) {
|
||||
this.form.issueConfigObj.jiraIssueTypeId = null;
|
||||
}
|
||||
if (!hasJiraStoryType) {
|
||||
this.form.issueConfigObj.jiraStoryTypeId = null;
|
||||
}
|
||||
this.result.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,14 +32,16 @@ export default {
|
|||
open(data, type) {
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.issueEditDetail.open(data, type);
|
||||
})
|
||||
this.$refs.issueEditDetail.open(data, type);
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.visible = false;
|
||||
this.$refs.issueEditDetail.resetForm();
|
||||
},
|
||||
save() {
|
||||
this.$refs.issueEditDetail.save();
|
||||
this.$refs.issueEditDetail.resetForm();
|
||||
},
|
||||
refresh(data) {
|
||||
this.$emit('refresh', data);
|
||||
|
|
|
@ -258,6 +258,23 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
resetForm() {
|
||||
this.form = {
|
||||
title: '',
|
||||
description: '',
|
||||
creator: null,
|
||||
remark: null,
|
||||
tapdUsers:[],
|
||||
zentaoBuilds:[],
|
||||
zentaoAssigned: '',
|
||||
platformStatus: null
|
||||
};
|
||||
this.customFieldForm = null;
|
||||
this.issueTemplate = {};
|
||||
if (this.$refs.testCaseIssueList) {
|
||||
this.$refs.testCaseIssueList.tableData = [];
|
||||
}
|
||||
},
|
||||
open(data, type) {
|
||||
this.result.loading = true;
|
||||
this.type = type;
|
||||
|
@ -277,7 +294,7 @@ export default {
|
|||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
getIssuesById(data.id, (data) => {
|
||||
this.form.tapdUsers = data.tapdUsers;
|
||||
this.form.zentaoBuilds = data.zentaoBuilds;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</el-col>
|
||||
<el-col :span="12" class="head-right">
|
||||
<el-button plain size="mini" @click="handleCancel">{{ $t('test_track.return') }}</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleSave">{{ $t('test_track.save') }}</el-button>
|
||||
<el-button v-prevent-re-click type="primary" size="mini" @click="handleSave">{{ $t('test_track.save') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import {post, get} from "@/common/js/ajax";
|
||||
import {getPageDate, parseCustomFilesForList} from "@/common/js/tableUtils";
|
||||
import {getCurrentProjectID, hasLicense} from "@/common/js/utils";
|
||||
import {getPageDate} from "@/common/js/tableUtils";
|
||||
import {getCurrentProjectID, getCurrentWorkspaceId, hasLicense} from "@/common/js/utils";
|
||||
import {baseGet, basePost} from "@/network/base-network";
|
||||
import {getCurrentProject} from "@/network/project";
|
||||
|
|
Loading…
Reference in New Issue