|
@@ -634,15 +634,31 @@ export default {
|
|
|
delete this.dataFrom.expression2
|
|
|
delete this.dataFrom.judgeType
|
|
|
delete this.dataFrom.judgeValue
|
|
|
- updateRule(this.dataFrom).then(() => {
|
|
|
- this.getList()
|
|
|
- this.dialogFormVisible = false
|
|
|
- this.$notify({ title: 'Success', message: 'Update Successfully', type: 'success', duration: 2000 })
|
|
|
- })
|
|
|
+ if (this.headerList.length > 0) {
|
|
|
+ this.dataFrom.callbackInfo.header = JSON.stringify(this.headerList)
|
|
|
+ }
|
|
|
+ if (this.paramsList.length > 0) {
|
|
|
+ this.dataFrom.callbackInfo.params = JSON.stringify(this.paramsList)
|
|
|
+ }
|
|
|
+ if (this.bodyObj !== null && this.bodyObj !== '') {
|
|
|
+ this.dataFrom.callbackInfo.body = this.bodyObj
|
|
|
+ }
|
|
|
+ if (!this.ruleForm.isCallback) {
|
|
|
+ this.dataFrom.callbackInfo = null
|
|
|
+ }
|
|
|
+ this.updateRule()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ async updateRule() {
|
|
|
+ const res = await updateRule(this.dataFrom)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.getList()
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.$notify({ title: 'Success', message: 'Update Successfully', type: 'success', duration: 2000 })
|
|
|
+ }
|
|
|
+ },
|
|
|
formatJson(filterVal, jsonData) {
|
|
|
return jsonData.map(v => filterVal.map(j => {
|
|
|
if (j === 'timestamp') {
|