diff --git a/nezha-fronted/package-lock.json b/nezha-fronted/package-lock.json index fb1a56f22..ffd9489ac 100644 --- a/nezha-fronted/package-lock.json +++ b/nezha-fronted/package-lock.json @@ -1583,9 +1583,9 @@ } }, "tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "version": "6.1.12", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", + "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -4103,12 +4103,12 @@ "integrity": "sha512-+TeEIee1gS5bYOiuf+PS/kp2mrXic37Hl66VY6EAfxasIk5fELTktK2oOezYed12H8w7jt3s512PpulQidPjwA==" }, "canvas": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.10.1.tgz", - "integrity": "sha512-29pIjn9uwTUsIgJUNd7GXxKk8sg4iyJwLm1wIilNIqX1mVzXSc2nUij9exW1LqNpis1d2ebMYfMqTWcokZ4pdA==", + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.10.2.tgz", + "integrity": "sha512-FSmlsip0nZ0U4Zcfht0qBJqDhlfGuevTZKE8h+dBOYrJjGvY3iqMGSzzbvkaFhvMXiVxfcMaPHS/kge++T5SKg==", "requires": { "@mapbox/node-pre-gyp": "^1.0.0", - "nan": "^2.15.0", + "nan": "^2.17.0", "simple-get": "^3.0.3" }, "dependencies": { diff --git a/nezha-fronted/src/components/chart/ChartScreenHeader.vue b/nezha-fronted/src/components/chart/ChartScreenHeader.vue index 1d4c78ed8..d7f31ae0c 100644 --- a/nezha-fronted/src/components/chart/ChartScreenHeader.vue +++ b/nezha-fronted/src/components/chart/ChartScreenHeader.vue @@ -27,9 +27,9 @@ -
+
- {{nameFormate()}} + {{nameFormate}}
diff --git a/nezha-fronted/src/components/chart/chartHeader.vue b/nezha-fronted/src/components/chart/chartHeader.vue index b9223c7b1..ce0bcebef 100644 --- a/nezha-fronted/src/components/chart/chartHeader.vue +++ b/nezha-fronted/src/components/chart/chartHeader.vue @@ -40,10 +40,10 @@ -
{{nameFormate()}}
+
{{nameFormate}}
- {{nameFormate()}} + {{nameFormate}} ({{chartData ? chartData.length : 0}} charts)
diff --git a/nezha-fronted/src/components/chart/chartHeaderMixin.js b/nezha-fronted/src/components/chart/chartHeaderMixin.js index cde2737f0..09a5e7574 100644 --- a/nezha-fronted/src/components/chart/chartHeaderMixin.js +++ b/nezha-fronted/src/components/chart/chartHeaderMixin.js @@ -84,6 +84,11 @@ export default { }, unitChange (val) { this.$emit('unitChange', val) + } + }, + computed: { + variablesArr () { + return this.$store.getters.getVariablesArr }, // 所有类型 chart name 支持变量替换 nameFormate () { @@ -114,11 +119,6 @@ export default { return str } }, - computed: { - variablesArr () { - return this.$store.getters.getVariablesArr - } - }, watch: { isError: { immediate: true, @@ -127,14 +127,6 @@ export default { this.errorText = this.chartData.filter(item => item.error).map(item => item.error).join('\n') } } - }, - 'chartInfo.repeatVariable': { - immediate: true, - handler (n) { - if (n) { - this.nameFormate() - } - } } } } diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index 545ef4234..bcd07a470 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -591,9 +591,9 @@ export default { if (item.type === 'group' && variables.name === repeatVariable) { if (!variables.checked.length) { item.children.forEach(children => { - delete children.repeatIndex - delete children.repeatVariable - delete children.repeatValue + this.$delete(children, 'repeatIndex') + this.$delete(children, 'repeatVariable') + this.$delete(children, 'repeatValue') }) return } @@ -616,13 +616,13 @@ export default { // 复制数据 this.copyDataList.splice(index, 0, repeatItem) } else { - item.repeatIndex = 0 - item.repeatVariable = repeatVariable - item.repeatValue = subItem + this.$set(item, 'repeatIndex', 0) + this.$set(item, 'repeatVariable', repeatVariable) + this.$set(item, 'repeatValue', subItem) item.children.forEach(children => { - children.repeatIndex = 0 - children.repeatVariable = repeatVariable - children.repeatValue = subItem + this.$set(children, 'repeatIndex', 0) + this.$set(children, 'repeatVariable', repeatVariable) + this.$set(children, 'repeatValue', subItem) }) this.$refs['chart' + item.id] && this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].getChartData() }