Commit c58312e5 authored by 晓彤's avatar 晓彤

pipeline功能提交

parent e2b61ff9
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div v-for="item in scope.row.pipelineList" :key="item.id"><b>{{ item.serviceName }}</b> -> {{ item.serviceBranch }}</div> <div v-for="item in scope.row.pipelineList" :key="item.id"><b>{{ item.serviceName }}</b> -> {{ item.serviceBranch }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="dingRobot.namespace" label="境" width="100px"></el-table-column> <el-table-column prop="dingRobot.namespace" label="测试环境" width="100px"></el-table-column>
<el-table-column prop="dingRobot.creator" label="创建人" width="100px"> <el-table-column prop="dingRobot.creator" label="创建人" width="100px">
</el-table-column> </el-table-column>
<el-table-column prop="dingRobot.createTime" label="创建时间" width="180px"></el-table-column> <el-table-column prop="dingRobot.createTime" label="创建时间" width="180px"></el-table-column>
...@@ -83,21 +83,21 @@ ...@@ -83,21 +83,21 @@
<el-row v-for="(item, index) in pipelineFrom.pipelineList" :key="index"> <el-row v-for="(item, index) in pipelineFrom.pipelineList" :key="index">
<el-col :span="6"> <el-col :span="6">
<div style="text-align: center;margin-top:5px"> <div style="text-align: center;margin-top:5px">
<el-select v-model="item.serviceName" placeholder="请选择服务" @change="selectServiceModel(item.serviceName)" clearable> <el-select v-model="item.serviceName" filterable placeholder="请选择服务" @change="selectServiceModel(item.serviceName)" clearable>
<el-option v-for="item2 in serviceList" :key="item2.name" :label="item2.name" :value="item2.name"></el-option> <el-option v-for="item2 in serviceList" :key="item2.name" :label="item2.name" :value="item2.name"></el-option>
</el-select> </el-select>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div style="text-align: center;margin-top:5px"> <div style="text-align: center;margin-top:5px">
<el-select v-model="item.serviceBranch" placeholder="请选择分支" clearable> <el-select v-model="item.serviceBranch" filterable placeholder="请选择分支" clearable @focus="focusevent(item.serviceName)">
<el-option v-for="item2 in serviceBranchList" :key="item2.name" :label="item2.name" :value="item2.name"></el-option> <el-option v-for="item2 in serviceBranchList" :key="item2.name" :label="item2.name" :value="item2.name"></el-option>
</el-select> </el-select>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div style="text-align: center;margin-top:5px"> <div style="text-align: center;margin-top:5px">
<el-switch v-model="item.enable" active-color="#13ce66" inactive-color="#A9A9A9" active-text="是" inactive-text="否" :active-value='1' :inactive-value='0'></el-switch> <el-switch v-model="item.enable" active-color="#13ce66" inactive-color="#A9A9A9" active-text="是" inactive-text="否" :active-value="1" :inactive-value="0"></el-switch>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-button size="mini" type="primary" icon="el-icon-circle-plus-outline" @click="AddPipelineListRow()" style="margin-top: 10px">添加</el-button> <el-button size="mini" type="primary" icon="el-icon-circle-plus-outline" @click="AddPipelineListRow()" class="btn-style">添加</el-button>
</el-row> </el-row>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -176,14 +176,14 @@ ...@@ -176,14 +176,14 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div style="text-align: center;margin-top:5px"> <div style="text-align: center;margin-top:5px">
<el-select v-model="item.serviceBranch" placeholder="请选择分支" clearable> <el-select v-model="item.serviceBranch" placeholder="请选择分支" clearable @focus="focusevent(item.serviceName)">
<el-option v-for="item2 in serviceBranchList" :key="item2.name" :label="item2.name" :value="item2.name"></el-option> <el-option v-for="item2 in serviceBranchList" :key="item2.name" :label="item2.name" :value="item2.name"></el-option>
</el-select> </el-select>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div style="text-align: center;margin-top:5px"> <div style="text-align: center;margin-top:5px">
<el-switch v-model="item.enable" active-color="#13ce66" inactive-color="#A9A9A9" active-text="是" inactive-text="否" active-value="1" inactive-value="0"></el-switch> <el-switch v-model="item.enable" active-color="#13ce66" inactive-color="#A9A9A9" active-text="是" inactive-text="否" :active-value="1" :inactive-value="0"></el-switch>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-button size="mini" plain @click="EditPipelineListRow()" icon="el-icon-circle-plus-outline">添加</el-button> <el-button size="mini" type="primary" @click="EditPipelineListRow()" icon="el-icon-circle-plus-outline" class="btn-style">添加</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -309,7 +309,7 @@ export default { ...@@ -309,7 +309,7 @@ export default {
serviceBranch: '', serviceBranch: '',
serviceType: '', serviceType: '',
namespace: '', namespace: '',
enable: '1' enable: 1
} }
] ]
}, },
...@@ -331,7 +331,7 @@ export default { ...@@ -331,7 +331,7 @@ export default {
serviceBranch: '', serviceBranch: '',
serviceType: '', serviceType: '',
namespace: '', namespace: '',
enable: '' enable: 1
} }
] ]
}, },
...@@ -421,10 +421,24 @@ export default { ...@@ -421,10 +421,24 @@ export default {
}, },
namespaceList: [], namespaceList: [],
projectName: '' projectName: '',
newBranchName: '',
newIndex: 0,
newList: []
} }
}, },
methods: { methods: {
focusevent(name) {
getGitBranchList({ projectName: name }).then((resp) => {
this.serviceBranchList = resp.data.data.data
})
},
// 选择服务下拉框触发事件
selectServiceModel(item) {
getGitBranchList({ projectName: item }).then((resp) => {
this.serviceBranchList = resp.data.data.data
})
},
// 获取ding_robot列表 // 获取ding_robot列表
getProjectRobotList() { getProjectRobotList() {
getPipelineList(this.queryInfo).then((resp) => { getPipelineList(this.queryInfo).then((resp) => {
...@@ -452,8 +466,10 @@ export default { ...@@ -452,8 +466,10 @@ export default {
} }
pipeline.namespace = this.pipelineFrom.dingRobot.namespace pipeline.namespace = this.pipelineFrom.dingRobot.namespace
}) })
if (pipeline.serviceName === '') {
this.pipelineFrom.pipelineList.pop()
}
}) })
console.log('5555', this.pipelineFrom)
addPipeline(this.pipelineFrom).then((resp) => { addPipeline(this.pipelineFrom).then((resp) => {
if (resp.data.data === true) { if (resp.data.data === true) {
this.addDialogVisible = false this.addDialogVisible = false
...@@ -461,7 +477,7 @@ export default { ...@@ -461,7 +477,7 @@ export default {
this.pipelineFrom.pipelineList.push({ this.pipelineFrom.pipelineList.push({
serviceName: '', serviceName: '',
serviceBranch: '', serviceBranch: '',
enable: '' enable: 1
}) })
this.getProjectRobotList() this.getProjectRobotList()
return this.$message.success('新增成功!') return this.$message.success('新增成功!')
...@@ -485,8 +501,10 @@ export default { ...@@ -485,8 +501,10 @@ export default {
} }
pipeline.namespace = this.editPipelineForm.dingRobot.namespace pipeline.namespace = this.editPipelineForm.dingRobot.namespace
}) })
if (pipeline.serviceName === '') {
this.editPipelineForm.pipelineList.pop()
}
}) })
editPipeline(this.editPipelineForm).then((resp) => { editPipeline(this.editPipelineForm).then((resp) => {
if (resp.data.data === true) { if (resp.data.data === true) {
this.editDialogVisible = false this.editDialogVisible = false
...@@ -581,6 +599,7 @@ export default { ...@@ -581,6 +599,7 @@ export default {
}, },
// 点击编辑按钮 // 点击编辑按钮
openEditDialog(projectRobot) { openEditDialog(projectRobot) {
// console.log('333', projectRobot)
this.editDialogVisible = true this.editDialogVisible = true
this.getServiceList() this.getServiceList()
this.getNamespaceList() this.getNamespaceList()
...@@ -617,7 +636,7 @@ export default { ...@@ -617,7 +636,7 @@ export default {
this.pipelineFrom.pipelineList.push({ this.pipelineFrom.pipelineList.push({
serviceName: '', serviceName: '',
serviceBranch: '', serviceBranch: '',
enable: '' enable: 1
}) })
}, },
closeEditDialog() { closeEditDialog() {
...@@ -631,18 +650,12 @@ export default { ...@@ -631,18 +650,12 @@ export default {
this.$refs.smokingFormRef.resetFields() this.$refs.smokingFormRef.resetFields()
}, },
// 选择服务下拉框触发事件
selectServiceModel(item) {
getGitBranchList({ projectName: item }).then((resp) => {
this.serviceBranchList = resp.data.data.data
})
},
// 添加行方法 // 添加行方法
AddPipelineListRow() { AddPipelineListRow() {
this.pipelineFrom.pipelineList.push({ this.pipelineFrom.pipelineList.push({
serviceName: '', serviceName: '',
serviceBranch: '', serviceBranch: '',
enable: '' enable: 1
}) })
}, },
// 删除行 // 删除行
...@@ -654,7 +667,7 @@ export default { ...@@ -654,7 +667,7 @@ export default {
this.editPipelineForm.pipelineList.push({ this.editPipelineForm.pipelineList.push({
serviceName: '', serviceName: '',
serviceBranch: '', serviceBranch: '',
enable: '' enable: 1
}) })
}, },
// 编辑删除pipeline按钮 // 编辑删除pipeline按钮
...@@ -696,4 +709,8 @@ export default { ...@@ -696,4 +709,8 @@ export default {
.top { .top {
margin-bottom: 20px; margin-bottom: 20px;
} }
.btn-style {
margin-top: 10px;
margin-left: 8px;
}
</style> </style>
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