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

优化

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