From d33f6ff5982997089d875395f06cc94b508b4c2e Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Mon, 5 Jul 2021 14:43:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?NEZ-807=20fix:=20=20=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=85=B3=E9=97=AD=20=E6=8F=90=E7=A4=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/mixin/editRigthBox.js | 17 +++++++++++++++++ .../rightBox/administration/assetTypeBox.vue | 6 ++++++ .../common/rightBox/administration/modelBox.vue | 6 ++++++ .../common/rightBox/administration/roleBox.vue | 5 +++++ .../common/rightBox/administration/userBox.vue | 5 +++++ .../src/components/common/rightBox/agentBox.vue | 5 +++++ .../components/common/rightBox/alertRuleBox.vue | 5 +++++ .../common/rightBox/alertSilenceBox.vue | 6 +++++- .../common/rightBox/asset/assetBatchEditBox.vue | 5 +++++ .../common/rightBox/asset/assetBox.vue | 6 ++++++ .../components/common/rightBox/assetMetaBox.vue | 5 +++++ .../common/rightBox/assetMetaGroup.vue | 5 +++++ .../common/rightBox/assetStateBox.vue | 5 +++++ .../components/common/rightBox/cabinetBox.vue | 5 +++++ .../components/common/rightBox/chartTempBox.vue | 6 ++++++ .../src/components/common/rightBox/dcBox.vue | 6 ++++++ .../common/rightBox/editEndpointBoxNew.vue | 5 +++++ .../components/common/rightBox/exprTmplBox.vue | 6 ++++++ .../common/rightBox/locationCascader.vue | 5 +++++ .../src/components/common/rightBox/menuBox.vue | 6 ++++++ .../src/components/common/rightBox/mibBox.vue | 6 ++++++ .../components/common/rightBox/moduleBox.vue | 5 +++++ .../src/components/common/rightBox/panelBox.vue | 5 +++++ .../components/common/rightBox/projectBox.vue | 5 +++++ .../common/rightBox/setting/cabinetBox.vue | 5 +++++ .../common/rightBox/snmpCredentialBox.vue | 6 +++++- .../common/rightBox/trafficSetting/subBox.vue | 2 ++ .../trafficSetting/trafficSettingBox.vue | 7 ++++++- .../src/components/page/dashboard/chartBox.vue | 7 ++++++- 29 files changed, 164 insertions(+), 4 deletions(-) create mode 100644 nezha-fronted/src/components/common/mixin/editRigthBox.js diff --git a/nezha-fronted/src/components/common/mixin/editRigthBox.js b/nezha-fronted/src/components/common/mixin/editRigthBox.js new file mode 100644 index 000000000..324de784f --- /dev/null +++ b/nezha-fronted/src/components/common/mixin/editRigthBox.js @@ -0,0 +1,17 @@ +export default { + data () { + return { + isEdit: false + } + }, + mounted () { + if( this.isEdit ) { + window.onbeforeunload = () => { + return window.confirm("确认操作吗?") + } + } + }, + destroyed () { + window.onbeforeunload = null + } +} diff --git a/nezha-fronted/src/components/common/rightBox/administration/assetTypeBox.vue b/nezha-fronted/src/components/common/rightBox/administration/assetTypeBox.vue index 3ab7293a0..f26653311 100644 --- a/nezha-fronted/src/components/common/rightBox/administration/assetTypeBox.vue +++ b/nezha-fronted/src/components/common/rightBox/administration/assetTypeBox.vue @@ -100,6 +100,8 @@