| | |
| | | //表单提交方法 |
| | | businessSubmit(){ |
| | | var obj = Object.assign({},this.addBusinessForm); |
| | | obj.notifyType = obj.notifyType; |
| | | obj.id = obj.notifyTemplateId; |
| | | obj.business = obj.businessKey; |
| | | obj.name = obj.notifyTemplateName; |
| | | obj.provider = obj.providerType; |
| | | obj.type = obj.notifyType; |
| | | var template = JSON.parse(obj.template); |
| | | for(var key in template) { |
| | | template[key] = obj[key]; |
| | | console.log(this.addBusinessForm); |
| | | var obj = { |
| | | configuration: {appKey: "3aa", appSecret: "4a"} |
| | | id: "1001" |
| | | name: "默认" |
| | | provider: "dingTalkMessage" |
| | | type: "dingTalk" |
| | | } |
| | | obj.template = JSON.stringify(template); |
| | | return; |
| | | this.$refs.dialogForm.validate(async (valid) => { |
| | | if (valid) { |
| | | this.isSaveing = true; |
| | | this.$HTTP.put("/api/blade-notify/business-notify/modify",obj).then(res=> { |
| | | this.$HTTP.put("/api/blade-notify/notifier/config",obj).then(res=> { |
| | | this.isSaveing = false; |
| | | if(res.code == 200) { |
| | | this.$emit('success', this.addBusinessForm, this.mode); |
| | |
| | | }) |
| | | }) |
| | | console.log(data.configuration,data) |
| | | // for(var key in res.data.configEntity.configuration) { |
| | | // res.data.configEntity.configuration['name'] = key; |
| | | // res.data.configEntity.configuration['value'] = res.data.configEntity.configuration[key]; |
| | | // res.data.configEntity.configuration['type'] = res.data.id; |
| | | // } |
| | | //可以和上面一样单个注入,也可以像下面一样直接合并进去 |
| | | Object.assign(this.addBusinessForm,data); |
| | | |
| | | // this.$nextTick(()=> { |
| | | // this.serviceproviders = this.addBusinessForm.providerInfos[0].id; |
| | | // }) |
| | | // console.log(this.addBusinessForm) |
| | | this.$nextTick(()=> { |
| | | this.serviceproviders = this.addBusinessForm.providerInfos[0].id; |
| | | }) |
| | | } |
| | | }, |
| | | components: { |