diff --git a/web-vue/src/api/build.js b/web-vue/src/api/build.js index 535b21b60..85610626a 100644 --- a/web-vue/src/api/build.js +++ b/web-vue/src/api/build.js @@ -56,10 +56,26 @@ export function getBranchList(params) { * } params */ export function editBuild(params) { + const data = { + id: params.id, + name: params.name, + gitUrl: params.gitUrl, + userName: params.userName, + password: params.password, + resultDirFile: params.resultDirFile, + script: params.script, + releaseMethod: params.releaseMethod, + branchName: params.branchName, + group: params.group, + repoType: params.repoType, + // 其他参数 + releaseMethodDataId_2_node: params.releaseMethodDataId_2_node, + releaseMethodDataId_2_project: params.releaseMethodDataId_2_project, + } return axios({ url: '/build/updateBuild', method: 'post', - data: params + data }) } diff --git a/web-vue/src/pages/build/list.vue b/web-vue/src/pages/build/list.vue index dca0e89e2..94f5294c2 100644 --- a/web-vue/src/pages/build/list.vue +++ b/web-vue/src/pages/build/list.vue @@ -116,7 +116,7 @@ - + @@ -253,6 +253,9 @@ export default { handleEdit(record) { this.temp = Object.assign(record); this.temp.tempGroup = ''; + if (record.releaseMethodDataId) { + this.temp.releaseMethodDataIdList = record.releaseMethodDataId.split(':'); + } this.loadBranchList(); this.loadNodeProjectList(); this.editBuildVisible = true; @@ -285,8 +288,8 @@ export default { }) }, // 选择节点项目 - onChangeProject() { - + onChangeProject(value) { + console.log(value) }, // 提交节点数据 handleEditBuildOk() { @@ -295,6 +298,18 @@ export default { if (!valid) { return false; } + // 设置参数 + if (this.temp.releaseMethod === 2) { + if (this.temp.releaseMethodDataIdList.length < 2) { + this.$notification.warn({ + message: '请选择节点项目', + duration: 2 + }); + return false; + } + this.temp.releaseMethodDataId_2_node = this.temp.releaseMethodDataIdList[0]; + this.temp.releaseMethodDataId_2_project = this.temp.releaseMethodDataIdList[1]; + } // 提交数据 editBuild(this.temp).then(res => { if (res.code === 200) {