diff --git a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue index 934b82adc..53918b308 100644 --- a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue +++ b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue @@ -332,6 +332,7 @@ export default { { name: 'JSON', value: 3 } ], suffix: '.xlsx', + faildSuffix: '.xlsx', panel: {}, rightBox: { // 面板弹出框相关 panel: { show: false }, @@ -358,6 +359,8 @@ export default { this.importFileList = [fileList[fileList.length - 1]] } this.importFile = this.importFileList[0] + const arr = this.importFile.name.split('.') + this.faildSuffix = '.' + arr[arr.length - 1] // 获取文件后缀名 this.validateFile() }, validateFile () { @@ -691,7 +694,7 @@ export default { const blob = new Blob([uInt8Array]) link.style.display = 'none' link.href = URL.createObjectURL(blob) - link.setAttribute('download', 'failed_records' + '-' + this.getTimeString() + '.json') + link.setAttribute('download', 'failed_records' + '-' + this.getTimeString() + this.faildSuffix) document.body.appendChild(link) link.click() document.body.removeChild(link) diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 8379eb3a5..be97724cf 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -471,6 +471,9 @@ export default { if (add) { if (add === 'alertRule') { this.add() + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.add + this.$router.replace({ query: newQuery }) } } } diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 68283556d..20f6f36fd 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -1007,11 +1007,17 @@ export default { if (add) { if (add === 'asset') { this.add() + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.add + this.$router.replace({ query: newQuery }) } } if (importAsset) { this.$nextTick(() => { this.$refs.export.showImportBox(1) + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.importAsset + this.$router.replace({ query: newQuery }) }) } } diff --git a/nezha-fronted/src/components/page/config/agent.vue b/nezha-fronted/src/components/page/config/agent.vue index bb6cd1f30..521b7473d 100644 --- a/nezha-fronted/src/components/page/config/agent.vue +++ b/nezha-fronted/src/components/page/config/agent.vue @@ -312,10 +312,16 @@ export default { if (add) { if (add === 'agent') { this.add() + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.add + this.$router.replace({ query: newQuery }) } } if (download) { this.toDownloadAgent() + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.download + this.$router.replace({ query: newQuery }) } } } diff --git a/nezha-fronted/src/components/page/config/dc.vue b/nezha-fronted/src/components/page/config/dc.vue index e31895c50..9046fccf9 100644 --- a/nezha-fronted/src/components/page/config/dc.vue +++ b/nezha-fronted/src/components/page/config/dc.vue @@ -312,6 +312,9 @@ export default { if (add === 'cabinet') { this.addCabinet() } + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.add + this.$router.replace({ query: newQuery }) } } }, diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index f787e8037..ef5da4436 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -1187,8 +1187,10 @@ export default { this.addChartBefore() } if (add === 'panel') { - this.toAdd() } + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.add + this.$router.replace({ query: newQuery }) } }) } diff --git a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue index 9134e551d..82ff67a31 100644 --- a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue +++ b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue @@ -985,10 +985,16 @@ export default { if (add === 'endpoint') { this.add() } + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.add + this.$router.replace({ query: newQuery }) } if (importEndpoint) { this.$nextTick(() => { this.$refs.export.showImportBox(1) + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.importEndpoint + this.$router.replace({ query: newQuery }) }) } } diff --git a/nezha-fronted/src/components/page/monitor/module/moduleList.vue b/nezha-fronted/src/components/page/monitor/module/moduleList.vue index f8a07515f..7b37f79d6 100644 --- a/nezha-fronted/src/components/page/monitor/module/moduleList.vue +++ b/nezha-fronted/src/components/page/monitor/module/moduleList.vue @@ -597,6 +597,9 @@ export default { if (add === 'module') { this.add() } + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.add + this.$router.replace({ query: newQuery }) } } } diff --git a/nezha-fronted/src/components/page/monitor/project/index.vue b/nezha-fronted/src/components/page/monitor/project/index.vue index 75a2025c6..3b2b05745 100644 --- a/nezha-fronted/src/components/page/monitor/project/index.vue +++ b/nezha-fronted/src/components/page/monitor/project/index.vue @@ -35,6 +35,9 @@ export default { this.$refs.dataList.add() }) } + const newQuery = JSON.parse(JSON.stringify(this.$route.query)) // 深拷贝 + delete newQuery.add + this.$router.replace({ query: newQuery }) } } }