Commit 3f033b95 authored by 薛智杰's avatar 薛智杰

Merge branch 'wei' into 'master'

pipeline 功能修改 增加机器人和显示创建者



See merge request !23
parents 5d62a2d8 44d71725
...@@ -29,8 +29,8 @@ export function deleteApplication(data) { ...@@ -29,8 +29,8 @@ export function deleteApplication(data) {
} }
export function updateApplication(data) { export function updateApplication(data) {
return request({ return request({
url: '/manage/application', url: '/pipeline/save',
method: 'put', method: 'post',
data data
}) })
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="new_user" label="创建者" align="center"/> <el-table-column prop="new_user" label="创建者" align="center"/>
<el-table-column prop="update_user" label="更新者" align="center"/>
<el-table-column prop="create_time" label="创建时间" align="center"/> <el-table-column prop="create_time" label="创建时间" align="center"/>
<el-table-column :label="$t('table.actions')" align="center" width="180" class-name="small-padding fixed-width"> <el-table-column :label="$t('table.actions')" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -212,11 +213,18 @@ export default { ...@@ -212,11 +213,18 @@ export default {
} }
}) })
} }
getMaster({ name: repo }).then(res => { // 拿出gitlab地址信息
const gitlabAddress = this.screen(repo, this.repos)
getMaster({ name: repo, gitlabAddress }).then(res => {
if (res.data.code === '0001') { if (res.data.code === '0001') {
console.log('无法获取分支') this.$notify({
title: 'error',
message: '因权限问题,获取分支失败',
type: 'error',
duration: 2000
})
} else { } else {
this.$set(this.refs, repo, res.data.data.map(item => { this.$set(this.refs, repo, res.data.map(item => {
return { return {
id: item.commit.id, id: item.commit.id,
name: item.name name: item.name
...@@ -227,7 +235,14 @@ export default { ...@@ -227,7 +235,14 @@ export default {
} }
}) })
}, },
screen(name, list) {
const data = list.filter(item => {
if (name === item.project_name) {
return item
}
})
return data[0].git_lab
},
createData() { createData() {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
...@@ -270,7 +285,6 @@ export default { ...@@ -270,7 +285,6 @@ export default {
}, },
handleUpdate(row) { handleUpdate(row) {
console.log(row)
this.temp = Object.assign({}, row) // copy obj this.temp = Object.assign({}, row) // copy obj
this.dialogStatus = '编辑' this.dialogStatus = '编辑'
this.dialogFormVisible = true this.dialogFormVisible = true
...@@ -280,13 +294,12 @@ export default { ...@@ -280,13 +294,12 @@ export default {
return s1.project_name.localeCompare(s2.project_name) return s1.project_name.localeCompare(s2.project_name)
}) })
this.listLoading = false this.listLoading = false
}) row.repos.forEach(item => {
row.repos.forEach(item => { this.getRefs(item.repository)
this.getRefs(item.repository) })
}) })
}, },
handleDelete(row) { handleDelete(row) {
console.log(row)
this.temp = row this.temp = row
this.dialogDeleteVisible = true this.dialogDeleteVisible = true
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment