gaoshp
2024-06-13 fd7586c8d91473d2850af1e48b12f1a289e6b8d1
src/views/notification/configuration.vue
@@ -9,13 +9,13 @@
<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,19 +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){
         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,9 +95,19 @@
                  this.dialog.save = true;
                  this.$nextTick(() => {
                     var obj = Object.assign(res.data,row);
                     this.$refs.saveDialog.open('edit').setData(obj);
                     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() {
@@ -100,7 +125,10 @@
            })
         },
         addconfigSuccess() {
            this.getbusiness();
            this.getConfiguration();
         },
         adddebugSuccess() {
         }
      }
   }