From 811fb2fd8fc81107903637cfbe03de9da9d50ede Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期三, 11 九月 2024 19:29:16 +0800
Subject: [PATCH] update
---
src/views/notification/editconfiguration.vue | 57 +++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/src/views/notification/editconfiguration.vue b/src/views/notification/editconfiguration.vue
index 6adc22e..cb6daff 100644
--- a/src/views/notification/editconfiguration.vue
+++ b/src/views/notification/editconfiguration.vue
@@ -4,7 +4,7 @@
<span>閫氱煡绫诲瀷 {{addBusinessForm.name}}</span>
<span>
鏈嶅姟鍟�
- <el-select style="width: 80%" v-model="serviceproviders" disabled>
+ <el-select style="width: 80%" v-model="serviceproviders" :disabled="mode != 'add'">
<el-option v-for="item in addBusinessForm.providerInfos" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</span>
@@ -12,7 +12,7 @@
<el-form :model="addBusinessForm" :rules="addBusinessRules" :disabled="mode=='show'" ref="dialogForm" label-width="140px" label-position="center">
<el-row>
<el-col :span="24">
- <el-form-item label="璇疯緭鍏ラ厤缃悕绉�" prop="notifyTemplateName">
+ <el-form-item label="璇疯緭鍏ラ厤缃悕绉�" prop="pname">
<el-input v-model="addBusinessForm.pname" placeholder="妯$増鍚嶇О" clearable></el-input>
</el-form-item>
</el-col>
@@ -57,7 +57,7 @@
serviceproviders: "",
mode: "add",
titleMap: {
- add: '鏂板',
+ add: '鏂板閰嶇疆',
edit: '缂栬緫閰嶇疆',
show: '鏌ョ湅'
},
@@ -73,7 +73,7 @@
},
//楠岃瘉瑙勫垯
addBusinessRules: {
- notifyTemplateName:[{required: true, message: '璇疯緭鍏ユā鐗堝悕绉�'}]
+ pname:[{required: true, message: '璇疯緭鍏ユā鐗堝悕绉�'}]
},
}
},
@@ -91,23 +91,53 @@
this.addBusinessForm.configuration[index].value.splice(index1,1);
},
//鏄剧ず
- open(mode='add'){
+ open(mode='add',obj){
+ if(mode == 'add') {
+ this.addBusinessForm = obj;
+ this.$nextTick(()=> {
+ this.serviceproviders = this.addBusinessForm.providerInfos[0].id;
+ })
+ var setArr = [];
+ obj.properties.forEach(item=> {
+ setArr.push({pname:item.name,value: "",name: item.name})
+ })
+ this.addBusinessForm.configuration = setArr;
+ }
this.mode = mode;
this.visible = true;
return this
},
//琛ㄥ崟鎻愪氦鏂规硶
businessSubmit(){
- var obj = Object.assign({},this.addBusinessForm);
- console.log(this.addBusinessForm);
+ var configuration = {};
+ this.addBusinessForm.configuration.forEach(item=> {
+ configuration[item.name] = item.value;
+ })
var obj = {
- configuration: {appKey: "3aa", appSecret: "4a"},
- id: "1001",
- name: "榛樿",
- provider: "dingTalkMessage",
- type: "dingTalk"
+ configuration: configuration,
}
- return;
+ if(this.mode == 'edit') {
+ obj.id = this.addBusinessForm.configEntity.id;
+ obj.name = this.addBusinessForm.configEntity.name;
+ obj.provider = this.addBusinessForm.configEntity.provider;
+ obj.type = this.addBusinessForm.configEntity.type;
+ if(this.addBusinessForm.configEntity.type == "email") { //閭欢
+ var newArr = [];
+ configuration.properties.forEach(item=> {
+ var formattedObject = {};
+ item.forEach(item => {
+ formattedObject[item.name] = item.value;
+ });
+ newArr.push(formattedObject);
+ })
+ configuration.properties = newArr;
+ }
+ }
+ if(this.mode == 'add') { //鏂板
+ obj.name = this.addBusinessForm.pname;
+ obj.provider = this.serviceproviders;
+ obj.type = this.addBusinessForm.id;
+ }
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
@@ -163,7 +193,6 @@
}
})
})
- console.log(data.configuration,data)
//鍙互鍜屼笂闈竴鏍峰崟涓敞鍏ワ紝涔熷彲浠ュ儚涓嬮潰涓�鏍风洿鎺ュ悎骞惰繘鍘�
Object.assign(this.addBusinessForm,data);
this.$nextTick(()=> {
--
Gitblit v1.9.3