update build page

This commit is contained in:
idiotalex@163.com 2021-01-06 18:02:24 +08:00
parent 5049d3ea54
commit fe2ac8d4df
2 changed files with 35 additions and 4 deletions

View File

@ -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
})
}

View File

@ -116,7 +116,7 @@
</a-radio-group>
</a-form-model-item>
<a-form-model-item v-if="temp.releaseMethod === 2" label="发布项目" prop="releaseMethodDataId">
<a-cascader :options="cascaderList" placeholder="Please select" @change="onChangeProject" />
<a-cascader v-model="temp.releaseMethodDataIdList" :options="cascaderList" placeholder="Please select" @change="onChangeProject" />
</a-form-model-item>
</a-form-model>
</a-modal>
@ -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) {