diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss index 834265944..95cc402c4 100644 --- a/nezha-fronted/src/assets/stylus/main.scss +++ b/nezha-fronted/src/assets/stylus/main.scss @@ -306,13 +306,13 @@ li{ background: $btn-normal-background-color-hover-new; color: $btn-normal-txt-color-new; //box-shadow: $btn-normal-shadow; - border: 0px; + border: 1px solid $btn-normal-background-color-hover-new; } .nz-btn.nz-btn-style-error-new:hover:not(.nz-btn-disabled) { /* 新版红色按钮hover */ background: $btn-error-background-color-hover-new; color: $btn-error-txt-color-new; //box-shadow: $btn-normal-shadow; - border: 0px; + border: 1px solid $btn-error-background-color-hover-new; } .nz-btn.nz-btn-style-light-new:hover:not(.nz-btn-disabled) { /* 新版浅色按钮hover */ border: 1px solid $btn-light-border-color-hover-new; @@ -324,13 +324,13 @@ li{ background: $btn-normal-background-color-active-new; color: $btn-normal-txt-color-new; //box-shadow: $btn-normal-shadow; - border: 0px; + border-color: $btn-normal-background-color-active-new; } .nz-btn.nz-btn-style-error-new:active:not(.nz-btn-disabled) { /* 新版红色按钮active' */ background: $btn-error-background-color-active-new; color: $btn-error-txt-color-new; //box-shadow: $btn-normal-shadow; - border: 0px; + border-color: $btn-error-background-color-active-new; } .nz-btn.nz-btn-style-light-new:active:not(.nz-btn-disabled) { /* 新版浅色按钮active*/ border: 1px solid $btn-light-border-color-active-new; diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue index 8d9de3c8b..a5286dc55 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.vue +++ b/nezha-fronted/src/components/charts/line-chart-block.vue @@ -1307,7 +1307,7 @@ this.seriesItemScreen = this.seriesItem; this.screenModal = true; */ - //this.dateChange(); + // this.dateChange(); }, duplicate(){ this.dropdownMenuShow=false; diff --git a/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue b/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue index 3774bec57..211bc189a 100644 --- a/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue +++ b/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue @@ -470,7 +470,8 @@ hover.hide(); } }, - hexagonSvgClearScale(){ + hexagonSvgClearScale(e){ + window.event? window.event.cancelBubble = true:e.stopPropagation(); if(this.firstInit){return} if(this.group){ this.group.off('dblclick',this.hexagonSvgClearScale); diff --git a/nezha-fronted/src/components/common/project/topology.vue b/nezha-fronted/src/components/common/project/topology.vue index fc5561c5f..21c36b488 100644 --- a/nezha-fronted/src/components/common/project/topology.vue +++ b/nezha-fronted/src/components/common/project/topology.vue @@ -12,7 +12,7 @@ - + {{$t('project.topology.selTwoNode')}} {{$t('project.topology.cancel')}} @@ -300,10 +300,13 @@ }, methods:{// 保存拓扑图数据 saveTopology(){ + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$emit('topologyLoad'); let nodes=this.formatNodes([...this.nodesArray]); let edges=this.formatEdges([...this.edgesArray]); this.$put('/project/topo',{topo:JSON.stringify({nodes:nodes,lines:edges,viewsCenter:this.viewsCenter,zoom:(this.zoom*1920/this.screenX)}),projectId:this.allModuleInfo.basic.id}).then(res=>{ + this.prevent_opt.save=false; if(res.code===200){ this.$message({ message: this.$t("tip.saveSuccess"), @@ -312,6 +315,7 @@ this.$emit('reload'); } }).catch(res=>{ + this.prevent_opt.save=false; this.$message({ message: res.msg, type: 'error' diff --git a/nezha-fronted/src/components/common/rightBox/accountBox.vue b/nezha-fronted/src/components/common/rightBox/accountBox.vue index e19d99b5f..f50624bbb 100644 --- a/nezha-fronted/src/components/common/rightBox/accountBox.vue +++ b/nezha-fronted/src/components/common/rightBox/accountBox.vue @@ -75,7 +75,9 @@ {{$t('overall.cancel')}} @@ -121,12 +123,12 @@ editUser: {}, scripts: [], selectableScripts: [], - roles:[], } }, methods: { /*关闭弹框*/ esc(refresh) { + this.prevent_opt.save=false; this.$emit("close", refresh); }, clickOutside() { @@ -134,11 +136,14 @@ }, /*保存*/ save() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$refs.accountForm.validate(valid => { if (valid) { let editUser = JSON.parse(JSON.stringify(this.editUser)) editUser.roleIds = [editUser.roleIds] if (this.editUser.userId) { + this.prevent_opt.save=false; this.$put('sys/user/update',editUser).then(response => { if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); @@ -149,6 +154,7 @@ }); } else { this.$post('sys/user/save', editUser).then(response => { + this.prevent_opt.save=false; if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -158,12 +164,15 @@ }); } } else { + this.prevent_opt.save=false; return false; } }) }, /*删除*/ del() { + if(this.prevent_opt.save){ return } + this.prevent_opt.save=true; this.$confirm(this.$t("tip.confirmDelete"), { confirmButtonText: this.$t("tip.yes"), cancelButtonText: this.$t("tip.no"), @@ -177,6 +186,9 @@ this.$message.error(response.msg); } }); + this.prevent_opt.save=false; + }).catch(()=>{ + this.prevent_opt.save=false; }); }, diff --git a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue index be52a5742..fb43364c6 100644 --- a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue @@ -414,7 +414,7 @@ assetListHalf:false, typeList: [], dcList: [], - modelList: [] + modelList: [], } }, methods: { @@ -514,6 +514,7 @@ /*关闭弹框*/ esc(refresh) { + this.prevent_opt.save=false; this.$emit("close", refresh); }, @@ -848,6 +849,8 @@ //保存endpoint save() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.endpoint.projectId = this.currentProjectCopy.id; this.endpoint.moduleId = this.currentModuleCopy.id; if (this.endpointList.length == 0) { @@ -864,6 +867,7 @@ this.$refs.addEndpoint.validate((valid) => { if (valid) { this.$post('endpoint', endpointList).then(response => { + this.prevent_opt.save=false; if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -872,6 +876,7 @@ } }); } else { + this.prevent_opt.save=false; return false; } }) @@ -894,12 +899,15 @@ //删除endpoint del() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$confirm(this.$t("tip.confirmDelete"), { confirmButtonText: this.$t("tip.yes"), cancelButtonText: this.$t("tip.no"), type: 'warning' }).then(() => { this.$delete("endpoint?ids=" + this.endpoint.id).then(response => { + this.prevent_opt.save=false; if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.deleteSuccess")}); this.esc(true); @@ -907,6 +915,8 @@ this.$message.error(response.msg); } }); + }).catch(()=>{ + this.prevent_opt.save=false; }); }, // endpoint弹框的asset子弹框顶部搜索条件选中事件 diff --git a/nezha-fronted/src/components/common/rightBox/alertConfigBox.vue b/nezha-fronted/src/components/common/rightBox/alertConfigBox.vue index bfe9fa32e..d682b3b7d 100644 --- a/nezha-fronted/src/components/common/rightBox/alertConfigBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertConfigBox.vue @@ -111,7 +111,7 @@ - @@ -202,15 +202,19 @@ this.esc(false); }, esc(refresh) { + this.prevent_opt.save=false; this.$emit("close", refresh); }, save() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.editAlertRule.expr = this.expressions[0]; this.$refs.alertRuleForm.validate((valid) => { if (valid) { this.editAlertRule.receiver = this.editAlertRule.receiverShow.join(","); if (this.editAlertRule.id) { this.$put('alert/rule', this.editAlertRule).then(response => { + this.prevent_opt.save=false; if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -219,6 +223,7 @@ } }); } else { + this.prevent_opt.save=false; this.$post('alert/rule', this.editAlertRule).then(response => { if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); @@ -229,17 +234,21 @@ }); } } else { + this.prevent_opt.save=false; return false; } }) }, del() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$confirm(this.$t("tip.confirmDelete"), { confirmButtonText: this.$t("tip.yes"), cancelButtonText: this.$t("tip.no"), type: 'warning' }).then(() => { this.$delete("alert/rule?ids=" + this.editAlertRule.id).then(response => { + this.prevent_opt.save=false; if (response.code === 200) { this.$message({type: 'success', message: this.$t("tip.deleteSuccess")}); this.esc(true); @@ -247,6 +256,8 @@ this.$message.error(response.msg); } }) + }).catch(()=>{ + this.prevent_opt.save=false; }); }, getUserList() { diff --git a/nezha-fronted/src/components/common/rightBox/assetBox.vue b/nezha-fronted/src/components/common/rightBox/assetBox.vue index ea833b94f..71cd2dcc4 100644 --- a/nezha-fronted/src/components/common/rightBox/assetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/assetBox.vue @@ -154,7 +154,7 @@ - @@ -304,6 +304,7 @@ }, /*关闭弹框*/ esc(refresh) { + this.prevent_opt.save=false; this.$emit("close", refresh); }, modelReload() { @@ -527,6 +528,7 @@ }, setAccountValidResult(result, protocol) { this.accountValidResult = result; + this.prevent_opt.save=false; let index = this.errorProtocol.indexOf(protocol); if (result) { index != -1 ? this.errorProtocol.splice(index, 1) : ""; @@ -535,11 +537,14 @@ } }, del() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$confirm(this.$t("tip.confirmDelete"), { confirmButtonText: this.$t("tip.yes"), cancelButtonText: this.$t("tip.no"), type: 'warning' }).then(() => { + this.prevent_opt.save=false; this.$delete("asset?ids=" + this.editAsset.id).then(response => { if (response.code === 200) { this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")}); @@ -548,12 +553,16 @@ this.$message.error(response.msg); } }) + }).catch(()=>{ + this.prevent_opt.save=false; }); }, changeProtocolType(type) { this.accountType = type; }, save() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; if(this.locationInfo) { if(this.locationInfo.idc){ this.editAsset.idcId = this.locationInfo.idc.id; @@ -581,6 +590,7 @@ if (valid && this.accountValidResult) { if (this.editAsset.id) { this.$put('asset', this.editAsset).then(res => { + this.prevent_opt.save=false; if (res.code === 200) { this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -593,6 +603,7 @@ this.$refs.accountConfigBox[0].validateAccount(); } this.$post('asset', this.editAsset).then(res => { + this.prevent_opt.save=false; if (res.code === 200) { this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -602,6 +613,7 @@ }); } } else { + this.prevent_opt.save=false; return false; } }); diff --git a/nezha-fronted/src/components/common/rightBox/batchEditAsset.vue b/nezha-fronted/src/components/common/rightBox/batchEditAsset.vue index 600a6ab45..72da7d4cd 100644 --- a/nezha-fronted/src/components/common/rightBox/batchEditAsset.vue +++ b/nezha-fronted/src/components/common/rightBox/batchEditAsset.vue @@ -250,7 +250,7 @@ - @@ -410,6 +410,7 @@ }, /*关闭弹框*/ esc(refresh){ + this.prevent_opt.save=false; this.$emit("close",refresh); }, modelReload(){ @@ -630,6 +631,8 @@ }); }, save(){ + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; if(this.locationInfo){ if(this.locationInfo.idc){ this.editAsset.idcId=this.locationInfo.idc.id; @@ -662,6 +665,7 @@ this.editAsset.assetIds.push(item.id); }); this.$put('/asset/batch',this.editAsset).then(res=>{ + this.prevent_opt.save=false; if(res.code===200){ this.$message({duration:2000,type:'success',message:this.$t("tip.saveSuccess")}); this.esc(true); @@ -670,6 +674,7 @@ } }); }else{ + this.prevent_opt.save=false; return false; } }); diff --git a/nezha-fronted/src/components/common/rightBox/cabinetBox.vue b/nezha-fronted/src/components/common/rightBox/cabinetBox.vue index 3f2247641..1e864d6a0 100644 --- a/nezha-fronted/src/components/common/rightBox/cabinetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/cabinetBox.vue @@ -36,7 +36,7 @@ - @@ -69,14 +69,18 @@ this.esc(false); }, esc(refresh) { + this.prevent_opt.save=false; this.$emit("close", refresh); }, save() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$refs.cabinetForm.validate((valid => { if(valid){ this.editCabinet.idcId = this.currentDc.id; if (this.editCabinet.id) { this.$put('cabinet', this.editCabinet).then(res => { + this.prevent_opt.save=false; if (res.code === 200) { this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -86,6 +90,7 @@ }) } else { this.$post('cabinet', this.editCabinet).then(res => { + this.prevent_opt.save=false; if (res.code === 200) { this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -95,17 +100,21 @@ }) } }else{ + this.prevent_opt.save=false; return false; } })) }, del() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$confirm(this.$t("tip.confirmDelete"), { confirmButtonText: this.$t("tip.yes"), cancelButtonText: this.$t("tip.no"), type: 'warning' }).then(() => { this.$delete('/cabinet?ids=' + this.editCabinet.id).then(response=>{ + this.prevent_opt.save=false; if(response.code == 200){ this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -113,6 +122,8 @@ this.$message.error(response.msg); } }) + }).catch(()=>{ + this.prevent_opt.save=false; }) } }, diff --git a/nezha-fronted/src/components/common/rightBox/dcBox.vue b/nezha-fronted/src/components/common/rightBox/dcBox.vue index cf32e7a6c..c6c930eaf 100644 --- a/nezha-fronted/src/components/common/rightBox/dcBox.vue +++ b/nezha-fronted/src/components/common/rightBox/dcBox.vue @@ -82,7 +82,7 @@ - @@ -120,6 +120,7 @@ methods: { /*关闭弹框*/ esc(refresh) { + this.prevent_opt.save=false; this.$emit("close", refresh); }, clickOutside() { @@ -132,6 +133,8 @@ /*保存*/ save() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$refs.dcForm.validate((valid) => { if (valid) { if (this.editDc.id) { @@ -147,6 +150,7 @@ } this.$put('idc', param).then(response => { + this.prevent_opt.save=false; if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -166,6 +170,7 @@ param.latitude=null; } this.$post('idc', param).then(response => { + this.prevent_opt.save=false; if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -175,18 +180,22 @@ }); } } else { + this.prevent_opt.save=false; return false; } }); }, /*删除*/ del() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$confirm(this.$t("tip.confirmDelete"), { confirmButtonText: this.$t("tip.yes"), cancelButtonText: this.$t("tip.no"), type: 'warning' }).then(() => { this.$delete("idc?ids=" + this.editDc.id).then(response => { + this.prevent_opt.save=false; if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.deleteSuccess")}); this.esc(true); @@ -194,6 +203,8 @@ this.$message.error(response.msg); } }); + }).catch(()=>{ + this.prevent_opt.save=false; }); }, // getAreaData() { diff --git a/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue index df059dacd..9456afe93 100644 --- a/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue @@ -127,7 +127,7 @@ - @@ -344,6 +344,8 @@ }, //保存endpoint save() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$refs.endpointForm.validate((valide=>{ if(valide){ this.editEndpoint.param = this.paramToJson(this.editEndpoint.paramObj); @@ -351,6 +353,7 @@ let requestData = []; requestData.push(this.editEndpoint); this.$put('endpoint', requestData).then(response => { + this.prevent_opt.save=false; if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); this.esc(true); @@ -359,6 +362,7 @@ } }); }else{ + this.prevent_opt.save=false; return false; } })) @@ -366,12 +370,15 @@ //删除endpoint del() { + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$confirm(this.$t("tip.confirmDelete"), { confirmButtonText: this.$t("tip.yes"), cancelButtonText: this.$t("tip.no"), type: 'warning' }).then(() => { this.$delete("endpoint?ids=" + this.editEndpoint.id).then(response => { + this.prevent_opt.save=false; if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.deleteSuccess")}); this.esc(true); @@ -379,6 +386,8 @@ this.$message.error(response.msg); } }); + }).catch(()=>{ + this.prevent_opt.save=false; }); }, // endpoint弹框的asset子弹框顶部搜索条件选中事件 diff --git a/nezha-fronted/src/components/page/config/system.vue b/nezha-fronted/src/components/page/config/system.vue index f85a3bcf2..2126c8166 100644 --- a/nezha-fronted/src/components/page/config/system.vue +++ b/nezha-fronted/src/components/page/config/system.vue @@ -39,8 +39,11 @@ - - + + @@ -86,8 +89,8 @@ - - + + @@ -99,7 +102,7 @@ - + @@ -130,8 +133,8 @@ - - + + @@ -325,7 +328,7 @@ - + @@ -561,6 +564,8 @@ }) }, saveSetInfo:function(type,formName){ + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$refs[formName].validate((valid) => { if (valid) { let param={}; @@ -571,6 +576,7 @@ postParam[type][key]=postParam[type][key]+''; } this.$put('/sysConfig',postParam).then(response=>{ + this.prevent_opt.save=false; if(response.code == 200){ this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")}); // this.resetForm(formName); @@ -581,10 +587,15 @@ this.$message.error(response.msg); } }) + }else{ + this.prevent_opt.save=true; + return false } }); }, testSetInfo:function(type,formName){ + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$refs[formName].validate((valid) => { if (valid) { let param={}; @@ -595,16 +606,22 @@ postParam[type][key]=postParam[type][key]+''; } this.$put('/sysConfig',postParam).then(response=>{ + this.prevent_opt.save=false; if(response.code == 200){ this.$message({duration: 2000, type: 'success', message: this.$t("tip.testSuccess")}); }else{ this.$message.error(response.msg); } }) + }else{ + this.prevent_opt.save=false; + return false } }); }, resetSys:function(){ + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; let $temp=this; this.$prompt(this.$t('config.system.reset.pwdTip'), this.$t('config.system.reset.promptTitle'), { confirmButtonText: this.$t('config.system.reset.yes'), @@ -615,12 +632,15 @@ $temp.$refs['resetForm'].validate(valid=>{ if(valid){ $temp.$put('/sysConfig/reset',$temp.reset).then(response=>{ + $temp.prevent_opt.save=false; if(response.code == 200){ $temp.$message({duration: 2000, type: 'success', message: this.$t("tip.resetSuccess")}); }else{ $temp.$message.error(response.msg); } }) + }else{ + $temp.prevent_opt.save=false; } }) }).catch(() => { @@ -721,9 +741,12 @@ }, // link add linkAdd(){ + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$refs['linkTempForm'].validate((valid) => { if (valid) { this.$post('/link',this.linkTemp).then(response=>{//新增link + this.prevent_opt.save=false; if(response.code == 200){ this.linkTemp={name:'',url:''}; this.linkAddCallBack(); @@ -733,6 +756,7 @@ } }) } else { + this.prevent_opt.save=false; return false; } }); @@ -751,6 +775,8 @@ }, // link update linkUpdate(item){ + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$refs['linkForm'+item.id][0].validate((valid) => { if (valid) { let params={ @@ -759,6 +785,7 @@ url:item.url, }; this.$put('/link',params).then(response=>{ + this.prevent_opt.save=false; if(response.code == 200){ let index=this.link.findIndex((item1)=>item.id==item1.id); this.$set(this.link,index,{...this.link[index],isEdit:false}); @@ -770,6 +797,7 @@ } }) } else { + this.prevent_opt.save=false; return false; } }); @@ -782,7 +810,10 @@ }, // link del linkDel(item){ + if(this.prevent_opt.query){ return } ; + this.prevent_opt.query=true; this.$delete('/link?ids='+item.id).then((response)=>{ + this.prevent_opt.query=false; if(response.code == 200){ this.link=this.link.filter((item1)=>item.id!==item1.id); this.linkReserved=this.linkReserved.filter((item1)=>item.id!==item1.id); @@ -804,9 +835,12 @@ }, // link add notificationAdd(){ + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$refs['notificationTempForm'].validate((valid) => { if (valid) { - this.$post('/alert/script',this.notificationTemp).then(response=>{//新增link + this.$post('/alert/script',this.notificationTemp).then(response=>{//新增notification + this.prevent_opt.save=false; if(response.code == 200){ this.notificationTemp={name:'',filePath:''}; this.notificationAddCallBack(); @@ -816,6 +850,7 @@ } }) } else { + this.prevent_opt.save=false; return false; } }); @@ -834,6 +869,8 @@ }, // link update notificationUpdate(item){ + if(this.prevent_opt.save){ return } ; + this.prevent_opt.save=true; this.$refs['notificationForm'+item.id][0].validate((valid) => { if (valid) { let params={ @@ -842,6 +879,7 @@ filePath:item.filePath, }; this.$put('/alert/script',params).then(response=>{ + this.prevent_opt.save=false; if(response.code == 200){ let index=this.notification.findIndex((item1)=>item.id==item1.id); this.$set(this.notification,index,{...this.notification[index],isEdit:false}); @@ -853,6 +891,7 @@ } }) } else { + this.prevent_opt.save=false; return false; } }); @@ -865,7 +904,10 @@ }, // link del notificationDel(item){ + if(this.prevent_opt.query){ return } ; + this.prevent_opt.query=true; this.$delete('/alert/script?ids='+item.id).then((response)=>{ + this.prevent_opt.query=false; if(response.code == 200){ this.notification=this.notification.filter((item1)=>item.id!==item1.id); this.notificationReserved=this.notificationReserved.filter((item1)=>item.id!==item1.id);