|
@@ -1,7 +1,7 @@
|
|
/*
|
|
/*
|
|
* @Author: Badguy
|
|
* @Author: Badguy
|
|
* @Date: 2022-04-29 09:17:55
|
|
* @Date: 2022-04-29 09:17:55
|
|
- * @LastEditTime: 2022-04-29 14:21:27
|
|
|
|
|
|
+ * @LastEditTime: 2022-04-29 16:00:18
|
|
* @LastEditors: your name
|
|
* @LastEditors: your name
|
|
* @Description: 服务相关操作
|
|
* @Description: 服务相关操作
|
|
* have a nice day!
|
|
* have a nice day!
|
|
@@ -40,8 +40,15 @@ export default {
|
|
async updateServiceNode(operate, deployNodeID) {
|
|
async updateServiceNode(operate, deployNodeID) {
|
|
const params = {
|
|
const params = {
|
|
operate: operateMap[operate],
|
|
operate: operateMap[operate],
|
|
- serviceID: this.serviceID,
|
|
|
|
- deployNodeID
|
|
|
|
|
|
+ serviceID: this.serviceID
|
|
|
|
+ }
|
|
|
|
+ if (['update', 'delete'].includes(operate)) {
|
|
|
|
+ const { DeployID } = this.serviceAndNodeList.find(
|
|
|
|
+ element => element.serviceID === this.serviceID && element.deployNodeID === deployNodeID
|
|
|
|
+ )
|
|
|
|
+ params.DeployID = DeployID
|
|
|
|
+ } else {
|
|
|
|
+ params.deployNodeID = deployNodeID
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
const result = await GeneralDataReception({
|
|
const result = await GeneralDataReception({
|
|
@@ -49,7 +56,7 @@ export default {
|
|
dataContent: JSON.stringify(params)
|
|
dataContent: JSON.stringify(params)
|
|
})
|
|
})
|
|
if (Number(result.code) === 0) {
|
|
if (Number(result.code) === 0) {
|
|
- return result.returnData
|
|
|
|
|
|
+ return result.message
|
|
} else {
|
|
} else {
|
|
return Promise.reject(result.message)
|
|
return Promise.reject(result.message)
|
|
}
|
|
}
|
|
@@ -60,8 +67,15 @@ export default {
|
|
async updateServiceSource(operate, sourceDataID) {
|
|
async updateServiceSource(operate, sourceDataID) {
|
|
const params = {
|
|
const params = {
|
|
operate: operateMap[operate],
|
|
operate: operateMap[operate],
|
|
- serviceID: this.serviceID,
|
|
|
|
- sourceDataID
|
|
|
|
|
|
+ serviceID: this.serviceID
|
|
|
|
+ }
|
|
|
|
+ if (['update', 'delete'].includes(operate)) {
|
|
|
|
+ const { serviceInputSourceDataID } = this.serviceAndSourceList.find(
|
|
|
|
+ element => element.serviceID === this.serviceID && element.sourceDataID === sourceDataID
|
|
|
|
+ )
|
|
|
|
+ params.serviceInputSourceDataID = serviceInputSourceDataID
|
|
|
|
+ } else {
|
|
|
|
+ params.sourceDataID = sourceDataID
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
const result = await GeneralDataReception({
|
|
const result = await GeneralDataReception({
|
|
@@ -69,7 +83,7 @@ export default {
|
|
dataContent: JSON.stringify(params)
|
|
dataContent: JSON.stringify(params)
|
|
})
|
|
})
|
|
if (Number(result.code) === 0) {
|
|
if (Number(result.code) === 0) {
|
|
- return result.returnData
|
|
|
|
|
|
+ return result.message
|
|
} else {
|
|
} else {
|
|
return Promise.reject(result.message)
|
|
return Promise.reject(result.message)
|
|
}
|
|
}
|
|
@@ -77,11 +91,11 @@ export default {
|
|
console.log('错误', error)
|
|
console.log('错误', error)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- async updateServiceOutput(operate, outputTarget) {
|
|
|
|
|
|
+ async updateServiceOutput(operate, serviceOutputID) {
|
|
const params = {
|
|
const params = {
|
|
operate: operateMap[operate],
|
|
operate: operateMap[operate],
|
|
serviceID: this.serviceID,
|
|
serviceID: this.serviceID,
|
|
- ...outputTarget
|
|
|
|
|
|
+ serviceOutputID
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
const result = await GeneralDataReception({
|
|
const result = await GeneralDataReception({
|