diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index d5c38a795..cc1d737ae 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -55,7 +55,7 @@ :multipleTime="multipleTime" :isFullscreen="isFullscreen" :showAllData="showAllData" - v-if="!isGroup(chartInfo.type) || !chartInfo.param.collapse" + v-if="(!isGroup(chartInfo.type) || !chartInfo.param.collapse) && snapshotShow" > @@ -118,7 +118,8 @@ export default { allDataLength: 0, severityData: this.$store.getters.severityData, // 告警级别的数据 severityDataWeight: this.$store.getters.severityDataWeight, - myVariables: [] // 添加当前使用的变量 用于判断是否需要重新加载 + myVariables: [], // 添加当前使用的变量 用于判断是否需要重新加载 + snapshotShow: true // isExportData: false } }, @@ -159,7 +160,7 @@ export default { if (!this.variablesInit) { // 变量未加载完成 不请求数据 return } - this.chartData = [] + this.chartData = window.dataJson ? this.chartData : [] this.myVariables = [] this.loading = true // TODO assetInfo、endpointInfo、echarts等进行不同的处理 @@ -758,6 +759,9 @@ export default { deep: true, handler (n) { // console.log(n) + if (window.dataJson && this.loading) { + this.loading = false + } } }, variablesArr: { @@ -778,8 +782,17 @@ export default { } } }, + created () { + if (window.dataJson) { + this.snapshotShow = false + this.getChartData() + } + }, mounted () { this.chartInfo.loaded && this.getChartData() + setTimeout(() => { + this.snapshotShow = true + }) this.showAllData = !this.showMultiple(this.chartInfo.type) } } diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js index a5ce470a4..a9da10084 100644 --- a/nezha-fronted/src/components/common/mixin/dataList.js +++ b/nezha-fronted/src/components/common/mixin/dataList.js @@ -232,8 +232,9 @@ export default { } }) }, - copy (u) { - this.object = { ...u, name: u.name + '-copy', id: '' } + copy (u, copyParams) { + const copyName = this.$loadsh.get(copyParams, 'copyName', '-copy') + this.object = { ...u, name: u.name + copyName, id: '' } if (this.object.name.length > 64) { const length = this.object.name.length - 64 this.object.name = u.name.substring(0, u.name.length - length) + '-copy' diff --git a/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue b/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue index 3e5812971..0a34700ef 100644 --- a/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue @@ -159,7 +159,7 @@ export default { rules: { name: [ { required: true, message: this.$t('validate.required'), trigger: 'change' }, - { pattern: /[a-zA-Z_:][a-zA-Z0-9_:]*/, message: this.$t('overall.ASCIIKey'), trigger: 'change' } + { pattern: /^[a-zA-Z_:][a-zA-Z0-9_:]*$/, message: this.$t('overall.ASCIIKey'), trigger: 'change' } ], type: [ { required: true, message: this.$t('validate.required'), trigger: 'change' } diff --git a/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue b/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue index 6d1d8e6a5..b8582ba1e 100644 --- a/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue +++ b/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue @@ -115,7 +115,7 @@ {{$t('overall.edit')}} - {{$t('overall.duplicate')}} + {{$t('overall.duplicate')}}