From a786409d7f6769f43c107159dd84faf4a2927a9a Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期一, 03 六月 2024 17:07:59 +0800
Subject: [PATCH] 1

---
 src/views/notification/configuration.vue |   64 ++++++++++++++++++++++---------
 1 files changed, 45 insertions(+), 19 deletions(-)

diff --git a/src/views/notification/configuration.vue b/src/views/notification/configuration.vue
index 5d450ad..c2b5b45 100644
--- a/src/views/notification/configuration.vue
+++ b/src/views/notification/configuration.vue
@@ -2,20 +2,20 @@
  * @Author: lzhe lzhe@example.com
  * @Date: 2024-03-26 10:28:33
  * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-05-10 17:39:49
+ * @LastEditTime: 2024-05-11 11:31:56
  * @FilePath: /smart-web/src/views/master/person/main/index.vue
  * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
 <template>
 	<div class="aposcope-main">
 		<div class="debugging">
-			<el-button type="primary" plain style="width: 80px;">璋冭瘯</el-button>
+			<el-button type="primary" plain style="width: 80px;" @click="debugerBtn">璋冭瘯</el-button>
 		</div>
 		<div class="conList" v-for="item in tableData">
 			<div class="conTop">
 				<span class="titile">{{item.name}}</span>
 			</div>
-			<div class="conBottom" v-if="item.isBindBusiness">
+			<div class="conBottom" v-if="item.configEntity != null">
 				<div class="first">
 					<div>{{item.id == "internalMessage"?"绔欏唴淇¢厤缃�":"閰嶇疆鍚嶇О"}}</div>
 				</div> 
@@ -23,16 +23,17 @@
 					<div>{{item.pname}}</div>
 				</div>
 				<div class="thrid" v-if="item.id != 'internalMessage'">
-					<span @click="table_edit(item, index)"><el-icon><EditPen /></el-icon>缂栬緫</span>
-					<span><el-icon><Delete /></el-icon>鍒犻櫎</span>
+					<span @click="table_edit(item, index ,2)"><el-icon><EditPen /></el-icon>缂栬緫</span>
+					<span @click="table_del(item,index)"><el-icon><Delete /></el-icon>鍒犻櫎</span>
 				</div>
 			</div>
-			<div class="conBottom" v-if="!item.isBindBusiness">
-				<el-button type="primary" plain style="margin-left: 20px;" @click="addallocation">鏂板閰嶇疆</el-button>
+			<div class="conBottom" v-if="item.configEntity == null">
+				<el-button type="primary" plain style="margin-left: 20px;" @click="table_edit(item, index ,1)">鏂板閰嶇疆</el-button>
 			</div>
 		</div>
 	</div>
 	<save-dialog v-if="dialog.save" ref="saveDialog" @success="addconfigSuccess" @closed="dialog.save=false"></save-dialog>
+	<save-debug v-if="dialog.debugging" ref="saveDebugging" @success="adddebugSuccess" @closed="dialog.debugging=false"></save-debug>
 </template>
 <script>
 	import * as ElementPlusIconsVue from '@element-plus/icons-vue'
@@ -41,12 +42,14 @@
 	    icons.push(key)
 	}
 	import saveDialog from './editconfiguration'
+	import saveDebug from './sendDebug'
 	export default {
 		name: "configuration",
 		data(){
 			return {
 				dialog: {
-					save: false
+					save: false,
+					debugging: false
 				},
 				tableData: []
 			}
@@ -58,20 +61,31 @@
 			this.getConfiguration();
 		},
 		components: {
-			...ElementPlusIconsVue,saveDialog
+			...ElementPlusIconsVue,saveDialog,saveDebug
 	    },
 		methods: {
-			addallocation() {
-				///api/blade-notify/notifier/config/sms/aliyunSms/metadata
+			table_del(item,index) {
+				this.$confirm(`纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?`, '', {
+					type: 'warning'
+				}).then(() => {
+					this.$HTTP.delete(`/api/blade-notify/notifier/config/${item.configEntity.id}`).then(res=> {
+						if(res.code == 200) {
+							this.getConfiguration();
+						}else {
+							this.$message.error(res.msg);
+						}
+					})
+				}).catch(() => {
+
+				})
 			},
-			table_edit(row){
-				console.log(row)
+			table_edit(row,index,type){
 				if(row.name == "閽夐拤") {
 					var url = `/api/blade-notify/notifier/config/dingTalk/dingTalkMessage/metadata`;
 				}else if(row.name == "浼佷笟寰俊") {
 					var url = `/api/blade-notify/notifier/config/weiXinQY/qyTextMessage/metadata`;
-				}else if(row.name == "绔欏唴淇�") {
-					//var url = `/api/blade-notify/notifier/template/internalMessage/systemDefault/config/metadata`;
+				}else if(row.name == "鐭俊") {
+					var url = `/api/blade-notify/notifier/config/sms/aliyunSms/metadata`;
 				}else if(row.name == "閭欢") {
 					var url = `/api/blade-notify/notifier/config/email/embedded/metadata`;
 				}
@@ -80,11 +94,20 @@
 					if(res.code == 200) {
 						this.dialog.save = true;
 						this.$nextTick(() => {
-							console.log(row,res.data)
-							var obj = Object.assign(row,res.data);
-							this.$refs.saveDialog.open('edit').setData(obj);
+							var obj = Object.assign(res.data,row);
+							if(type == 1) {
+								this.$refs.saveDialog.open('add',obj);
+							}else if(type == 2) {  //缂栬緫
+								this.$refs.saveDialog.open('edit',{}).setData(obj);
+							}
 						})
 					}
+				})
+			},
+			debugerBtn() {
+				this.dialog.debugging = true;
+				this.$nextTick(() => {
+					this.$refs.saveDebugging.open(this.tableData);
 				})
 			},
 			getConfiguration() {
@@ -102,7 +125,10 @@
 				})
 			},
 			addconfigSuccess() {
-				this.getbusiness();
+				this.getConfiguration();
+			},
+			adddebugSuccess() {
+
 			}
 		}
 	}

--
Gitblit v1.9.3