Commit 28c7f231 authored by 黎博's avatar 黎博

优化

parent e14a9a96
......@@ -62,7 +62,7 @@
</el-select>
</el-form-item>
<!-- 添加 Pipeline -->
<el-form-item label="Pipeline">
<el-form-item label="Pipeline" prop="pipelineFrom.piplineList">
<el-row>
<el-col :span="6">
<div style="text-align: center">
......@@ -88,21 +88,21 @@
<el-row v-for="(item, index) in pipelineFrom.pipelineList" :key="index">
<el-col :span="6">
<div style="text-align: center;margin-top:5px">
<el-select v-model="item.serviceModel" placeholder="请选择服务" @change="selectServiceModel(item.serviceModel)" clearable>
<el-option v-for="item in serviceList" :key="item.index" :label="item.name" :value="item"></el-option>
<el-select v-model="item.serviceName" 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-select>
</div>
</el-col>
<el-col :span="6">
<div style="text-align: center;margin-top:5px">
<el-select v-model="item.serviceBranch" placeholder="请选择分支" clearable>
<el-option v-for="item in serviceBranchList" :key="item" :label="item.name" :value="item.name"></el-option>
<el-option v-for="item2 in serviceBranchList" :key="item2.name" :label="item2.name" :value="item2.name"></el-option>
</el-select>
</div>
</el-col>
<el-col :span="6">
<div style="text-align: center;margin-top:5px">
<el-switch v-model="item.enable" active-color="#13ce66" inactive-color="#A9A9A9" active-text="是" inactive-text="否" @change="changeState($event, '3')"></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>
</el-col>
<el-col :span="6">
......@@ -186,7 +186,7 @@
</el-col>
<el-col :span="6">
<div style="text-align: center;margin-top:5px">
<el-switch v-model="item.enable" active-color="#13ce66" inactive-color="#A9A9A9" active-text="是" inactive-text="否" @change="changeState($event, '3')"></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>
</el-col>
<el-col :span="6">
......@@ -273,7 +273,7 @@
import {
getJiraProjectList,
getPipelineList,
addProjectRobot,
addPipeline,
modifyProjectRobot,
delProjectRobot,
sendScheduleReport,
......@@ -442,13 +442,21 @@ export default {
return false
} else {
// 循环数组
for (var i = 0; i < this.pipelineFrom.pipelineList.length; i++) {
this.pipelineFrom.pipelineList[i].serviceName = this.serviceName
this.pipelineFrom.pipelineList[i].serviceType = this.serviceType
this.pipelineFrom.pipelineList[i].namespace =
this.pipelineFrom.dingRobot.namespace
}
addProjectRobot(this.pipelineFrom).then((resp) => {
// for (var i = 0; i < this.pipelineFrom.pipelineList.length; i++) {
// // this.pipelineFrom.pipelineList[i].serviceName = this.serviceName
// // this.pipelineFrom.pipelineList[i].serviceType = this.serviceType
// this.pipelineFrom.pipelineList[i].namespace =
// this.pipelineFrom.dingRobot.namespace
// }
this.pipelineFrom.pipelineList.forEach(pipeline => {
this.serviceList.forEach(service => {
if (service.name === pipeline.serviceName) {
pipeline.serviceType = service.type
}
pipeline.namespace = this.pipelineFrom.dingRobot.namespace
})
})
addPipeline(this.pipelineFrom).then((resp) => {
console.log('新增信息', this.pipelineFrom)
if (resp.data.data === true) {
this.addDialogVisible = false
......@@ -613,11 +621,11 @@ export default {
changeState() {},
// 选择服务下拉框触发事件
selectServiceModel(item) {
this.serviceName = item.name
this.serviceType = item.type
// this.serviceName = item.name
// this.serviceType = item.type
console.log('3333', item)
getGitBranchList({ projectName: item.name }).then((resp) => {
this.serviceBranchList = resp.data.data
getGitBranchList({ projectName: item }).then((resp) => {
this.serviceBranchList = resp.data.data.data
console.log('55', this.serviceBranchList)
})
},
......
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