diff --git a/nezha-fronted/package-lock.json b/nezha-fronted/package-lock.json index 86d088649..f63487b3c 100644 --- a/nezha-fronted/package-lock.json +++ b/nezha-fronted/package-lock.json @@ -14218,7 +14218,7 @@ }, "node-sass": { "version": "4.14.1", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", + "resolved": "https://registry.npmmirror.com/node-sass/-/node-sass-4.14.1.tgz", "integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", "dev": true, "requires": { @@ -17546,7 +17546,7 @@ }, "showdown": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/showdown/-/showdown-2.1.0.tgz", + "resolved": "https://registry.npmmirror.com/showdown/-/showdown-2.1.0.tgz", "integrity": "sha512-/6NVYu4U819R2pUIk79n67SYgJHWCce0a5xTP979WbNp0FL9MN1I1QK662IDU1b6JzKTvmhgI7T7JYIxBi3kMQ==", "requires": { "commander": "^9.0.0" @@ -17554,7 +17554,7 @@ "dependencies": { "commander": { "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "resolved": "https://registry.npmmirror.com/commander/-/commander-9.5.0.tgz", "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==" } } @@ -19255,7 +19255,7 @@ "tmp": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", - "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", + "integrity": "sha512-89PTqMWGDva+GqClOqBV9s3SMh7MA3Mq0pJUdAoHuF65YoE7O0LermaZkVfT5/Ngfo18H4eYiyG7zKOtnEbxsw==", "dev": true, "requires": { "os-tmpdir": "~1.0.1" @@ -20614,7 +20614,7 @@ }, "webpack-bundle-analyzer": { "version": "2.13.1", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz", + "resolved": "https://registry.npmmirror.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz", "integrity": "sha512-rwxyfecTAxoarCC9VlHlIpfQCmmJ/qWD5bpbjkof+7HrNhTNZIwZITxN6CdlYL2axGmwNUQ+tFgcSOiNXMf/sQ==", "dev": true, "requires": { diff --git a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue index 08d6cb408..2cb3c079e 100644 --- a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue +++ b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue @@ -97,6 +97,9 @@ export default { } }, computed: { + lineOption () { + return this.nzDefaultConfig.option + }, hasLegend () { try { return [chartLegendPlacement.bottom, chartLegendPlacement.left, chartLegendPlacement.right].indexOf(this.chartInfo.param.legend.placement) > -1 && this.chartInfo.param.enable.legend @@ -181,17 +184,19 @@ export default { this.legends = [] this.series = chartOption.series = this.handleTimeSeries(this.chartInfo, chartOption.series[0], this.chartData) // 生成series和legends - const styleOption = this.$lodash.get(this.chartInfo, 'param.option') - if (styleOption) { - chartOption.series.forEach(item => { - if (item.lineStyle && styleOption.lineWidth != undefined) { - item.lineStyle.width = styleOption.lineWidth - } - if (styleOption.pointSize != undefined) { - item.symbolSize = styleOption.pointSize - } - }) - } + const styleOption = this.$lodash.get(this.chartInfo, 'param.option', {}) + chartOption.series.forEach(item => { + if (item.lineStyle && styleOption.lineWidth != undefined) { + item.lineStyle.width = styleOption.lineWidth + } else { + item.lineStyle.width = this.lineOption.lineWidth + } + if (styleOption.pointSize != undefined) { + item.symbolSize = styleOption.pointSize + } else { + item.symbolSize = this.lineOption.pointSize + } + }) this.isGrey = this.legends.map(() => false) chartOption.color = this.colorList @@ -279,9 +284,9 @@ export default { this.cursorDefault = false }) } - if (this.chartInfo.type !== 'point') { - const option = myChart.getOption() - const series = this.$lodash.cloneDeep(option.series) + const option = myChart.getOption() + const series = this.$lodash.cloneDeep(option.series) + if (series[params.seriesIndex].type !== 'scatter') { series[params.seriesIndex].data[params.dataIndex] = { symbol: 'circle', itemStyle: { @@ -301,9 +306,9 @@ export default { this.tooltip.activeIndex = params.seriesIndex }) myChart.on('mouseout', (params) => { - if (this.chartInfo.type !== 'point') { - const option = myChart.getOption() - const series = this.$lodash.cloneDeep(option.series) + const option = myChart.getOption() + const series = this.$lodash.cloneDeep(option.series) + if (series[params.seriesIndex].type !== 'scatter') { series.forEach(s => { s.data.forEach((item, index) => { if (item.itemStyle) { diff --git a/nezha-fronted/src/components/chart/chart/legend.vue b/nezha-fronted/src/components/chart/chart/legend.vue index 6968fee1c..49c6eccfc 100644 --- a/nezha-fronted/src/components/chart/chart/legend.vue +++ b/nezha-fronted/src/components/chart/chart/legend.vue @@ -274,6 +274,17 @@ export default { if (this.chartInfo.type === 'pie' || this.chartInfo.type === 'doughnut' || this.chartInfo.type === 'rose') { this.$emit('hoverLegendD3', legendName, index, type) } else if (this.isTimeSeries) { + if (type == 'highlight' && getChart(this.chartId)) { + const option = getChart(this.chartId).getOption() + const series = this.$lodash.cloneDeep(option.series) + series[index].emphasis.focus = 'series' + getChart(this.chartId).setOption({ series }) + } else if (getChart(this.chartId)) { + const option = getChart(this.chartId).getOption() + const series = this.$lodash.cloneDeep(option.series) + series[index].emphasis.focus = 'none' + getChart(this.chartId).setOption({ series }) + } getChart(this.chartId) && getChart(this.chartId).dispatchAction({ type: type, seriesIndex: index, diff --git a/nezha-fronted/src/components/chart/chart/line-chart-block.vue b/nezha-fronted/src/components/chart/chart/line-chart-block.vue new file mode 100644 index 000000000..27c2eb92f --- /dev/null +++ b/nezha-fronted/src/components/chart/chart/line-chart-block.vue @@ -0,0 +1,2205 @@ + + + diff --git a/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js b/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js index 65b859d54..6435982da 100644 --- a/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js +++ b/nezha-fronted/src/components/chart/chart/options/chartTimeSeries.js @@ -152,16 +152,16 @@ export const chartTimeSeriesLineOption = { type: 'line', symbol: 'emptyCircle', // 去掉点 connectNulls: true, - symbolSize: 6, + symbolSize: 8, smooth: 0.2, // 曲线变平滑 showSymbol: false, data: [], lineStyle: { - width: 1, + width: 2, opacity: 0.9 }, emphasis: { - focus: 'series' + focus: 'none' }, blur: { lineStyle: { @@ -189,7 +189,7 @@ export const chartTimeSeriesScatterOption = { data: [], z: 9, emphasis: { - focus: 'series' + focus: 'none' } }] } diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue index caad524b9..b096181ad 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue @@ -443,7 +443,7 @@ export default { smooth: 0.2, // 曲线变平滑 name: '', lineStyle: { - width: 1, + width: 2, opacity: 0.9 } } diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue index 42a231d9c..051a04e18 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue @@ -872,12 +872,12 @@ export default { const seriesItem = { name: '', symbol: 'emptyCircle', // 去掉点 - symbolSize: [2, 2], + symbolSize: 8, showSymbol: false, smooth: 0.2, // 曲线变平滑 data: [], lineStyle: { - width: 1, + width: 2, opacity: 0.9 }, type: 'line' diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue index 57dfec4d4..ae8920b35 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue @@ -256,10 +256,7 @@ export default { mode: 'all', sort: 'none' }, - option: { - lineWidth: 1, - pointSize: 6 - } + option: undefined }, elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 }], panel: '', @@ -450,31 +447,6 @@ export default { if (this.chart.type === 'group' && !this.chart.param.collapse == undefined) { this.chart.param.collapse = false } - if (this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') { - if (!this.chart.param.rightYAxis) { - this.chart.param.rightYAxis = { - elementNames: [], - style: 'line', - unit: 2, - label: '', - min: undefined, - max: undefined - } - } - if (!this.chart.param.tooltip) { - this.chart.param.tooltip = { - mode: 'all', - sort: 'none' - } - this.chart.param.enable.tooltip = true - } - if (!this.chart.param.option) { - this.chart.param.option = { - lineWidth: 1, - pointSize: 6 - } - } - } if (this.chart.type === 'stat') { if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' } if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' } @@ -515,31 +487,6 @@ export default { if (this.chart.type === 'group' && !this.chart.param.collapse == undefined) { this.chart.param.collapse = false } - if (this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') { - if (!this.chart.param.rightYAxis) { - this.chart.param.rightYAxis = { - elementNames: [], - style: 'line', - unit: 2, - label: '', - min: undefined, - max: undefined - } - } - if (!this.chart.param.tooltip) { - this.chart.param.tooltip = { - mode: 'all', - sort: 'none' - } - this.chart.param.enable.tooltip = true - } - if (!this.chart.param.option) { - this.chart.param.option = { - lineWidth: 1, - pointSize: 6 - } - } - } if (this.chart.type === 'stat') { if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' } if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' } diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/endpointQueryTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/endpointQueryTab.vue deleted file mode 100644 index 7f7d9b8ff..000000000 --- a/nezha-fronted/src/components/common/bottomBox/tabs/endpointQueryTab.vue +++ /dev/null @@ -1,728 +0,0 @@ - - - - - diff --git a/nezha-fronted/src/components/common/project/L5/topoTooltip.vue b/nezha-fronted/src/components/common/project/L5/topoTooltip.vue new file mode 100644 index 000000000..161c2666f --- /dev/null +++ b/nezha-fronted/src/components/common/project/L5/topoTooltip.vue @@ -0,0 +1,446 @@ + + + diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue index 45af636cb..5d308b8e1 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue @@ -1407,6 +1407,9 @@ export default { computed: { minStep () { return this.nzDefaultConfig.minStep + }, + lineOption () { + return this.nzDefaultConfig.option } }, data () { @@ -1508,10 +1511,7 @@ export default { mode: 'all', sort: 'none' }, - option: { - lineWidth: 1, - pointSize: 6 - } + option: this.lineOption } this.$nextTick(() => { this.chartConfig.param.thresholds.push({ value: undefined, color: randomcolor() }) diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index c659a1fe7..cc3f7066e 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -173,6 +173,9 @@ export default { panelChart }, computed: { + lineOption () { + return this.nzDefaultConfig.option + }, chartLastPosition () { return this.$store.getters.getChartLastPosition }, @@ -381,7 +384,7 @@ export default { height: 4, unit: 2, type: 'line', - elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 , step: undefined}], + elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, step: undefined }], param: { stack: 0, nullType: 'null', @@ -413,10 +416,7 @@ export default { mode: 'all', sort: 'none' }, - option: { - lineWidth: 1, - pointSize: 6 - } + option: this.lineOption } } } @@ -427,7 +427,7 @@ export default { height: 4, unit: 2, type: 'log', - elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 , step: undefined}], + elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, step: undefined }], param: { enable: { thresholds: false, @@ -638,6 +638,21 @@ export default { delete item.chartId }) } + if ((obj.type === 'line' || obj.type === 'area' || obj.type === 'point')) { + if (!obj.param.rightYAxis) { + obj.param.rightYAxis = { + elementNames: [], + style: 'line', + unit: 2, + label: '', + min: undefined, + max: undefined + } + } + if (!obj.param.option) { + obj.param.option = this.lineOption + } + } this.editChart = this.$lodash.cloneDeep(obj) this.oldData = this.$lodash.cloneDeep(obj) if (this.stableTime) { diff --git a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue index 4207d84f4..e8b73b234 100644 --- a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue @@ -325,7 +325,7 @@ export default { smooth: 0.2, // 曲线变平滑 name: '', lineStyle: { - width: 1, + width: 2, opacity: 0.9 }, markLine: { diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index f220e1bfb..f7396f82b 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -720,12 +720,12 @@ export default { const seriesItem = { name: '', symbol: 'emptyCircle', // 去掉点 - symbolSize: [2, 2], + symbolSize: 8, showSymbol: false, smooth: 0.2, // 曲线变平滑 data: [], lineStyle: { - width: 1, + width: 2, opacity: 0.9 }, type: 'line' diff --git a/nezha-fronted/src/components/page/dashboard/dashboard.vue b/nezha-fronted/src/components/page/dashboard/dashboard.vue index 6bb9bb7c0..81d4b1fbf 100644 --- a/nezha-fronted/src/components/page/dashboard/dashboard.vue +++ b/nezha-fronted/src/components/page/dashboard/dashboard.vue @@ -272,12 +272,9 @@ export default { mode: 'all', sort: 'none' }, - option: { - lineWidth: 1, - pointSize: 6 - } + option: undefined }, - elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 , step: undefined}], + elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0, step: undefined }], panel: '', sync: 0, remark: '', @@ -624,31 +621,6 @@ export default { if (this.chart.type === 'group' && !this.chart.param.collapse == undefined) { this.chart.param.collapse = false } - if (this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') { - if (!this.chart.param.rightYAxis) { - this.chart.param.rightYAxis = { - elementNames: [], - style: 'line', - unit: 2, - label: '', - min: undefined, - max: undefined - } - } - if (!this.chart.param.tooltip) { - this.chart.param.tooltip = { - mode: 'all', - sort: 'none' - } - this.chart.param.enable.tooltip = true - } - if (!this.chart.param.option) { - this.chart.param.option = { - lineWidth: 1, - pointSize: 6 - } - } - } if (this.chart.type === 'stat') { if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' } if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' } @@ -689,31 +661,6 @@ export default { if (this.chart.type === 'group' && !this.chart.param.collapse == undefined) { this.chart.param.collapse = false } - if (this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') { - if (!this.chart.param.rightYAxis) { - this.chart.param.rightYAxis = { - elementNames: [], - style: 'line', - unit: 2, - label: '', - min: undefined, - max: undefined - } - } - if (!this.chart.param.tooltip) { - this.chart.param.tooltip = { - mode: 'all', - sort: 'none' - } - this.chart.param.enable.tooltip = true - } - if (!this.chart.param.option) { - this.chart.param.option = { - lineWidth: 1, - pointSize: 6 - } - } - } if (this.chart.type === 'stat') { if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' } if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' } diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index 049c383ef..1dde0825c 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -3848,16 +3848,16 @@ export default { type: 'line', name: '', symbol: 'emptyCircle', // 去掉点 - symbolSize: [6, 6], + symbolSize: 8, showSymbol: false, smooth: 0.2, // 曲线变平滑 data: [], lineStyle: { - width: 1, + width: 2, opacity: 0.9 }, emphasis: { - focus: 'series' + focus: 'none' }, blur: { lineStyle: { @@ -3941,16 +3941,16 @@ export default { type: 'line', name: '', symbol: 'emptyCircle', // 去掉点 - symbolSize: [6, 6], + symbolSize: 8, showSymbol: false, smooth: 0.2, // 曲线变平滑 data: [], lineStyle: { - width: 1, + width: 2, opacity: 0.9 }, emphasis: { - focus: 'series' + focus: 'none' }, blur: { lineStyle: { @@ -4435,10 +4435,7 @@ export default { mode: 'all', sort: 'none' }, - option: { - lineWidth: 1, - pointSize: 6 - } + option: undefined }, elements: [], panel: '', diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue index 4067f216b..003a952fe 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue @@ -438,16 +438,16 @@ export default { type: 'line', name: '', symbol: 'emptyCircle', // 去掉点 - symbolSize: [6, 6], + symbolSize: 8, showSymbol: false, smooth: 0.2, // 曲线变平滑 data: [], lineStyle: { - width: 1, + width: 2, opacity: 0.9 }, emphasis: { - focus: 'series' + focus: 'none' }, blur: { lineStyle: { @@ -655,16 +655,16 @@ export default { type: 'line', name: '', symbol: 'emptyCircle', // 去掉点 - symbolSize: [6, 6], + symbolSize: 8, showSymbol: false, smooth: 0.2, // 曲线变平滑 data: [], lineStyle: { - width: 1, + width: 2, opacity: 0.9 }, emphasis: { - focus: 'series' + focus: 'none' }, blur: { lineStyle: { diff --git a/nezha-fronted/src/components/page/dashboard/overview/chart.vue b/nezha-fronted/src/components/page/dashboard/overview/chart.vue index 81cf1fb4f..709989065 100644 --- a/nezha-fronted/src/components/page/dashboard/overview/chart.vue +++ b/nezha-fronted/src/components/page/dashboard/overview/chart.vue @@ -370,6 +370,17 @@ export default { if (this.legend[index].isGray) { return false } + if (type == 'highlight' && this.chart) { + const option = this.chart.getOption() + const series = this.$lodash.cloneDeep(option.series) + series[index].emphasis.focus = 'series' + this.chart.setOption({ series }) + } else if (this.chart) { + const option = this.chart.getOption() + const series = this.$lodash.cloneDeep(option.series) + series[index].emphasis.focus = 'none' + this.chart.setOption({ series }) + } this.chart && this.chart.dispatchAction({ type: type, seriesIndex: index, diff --git a/nezha-fronted/src/store/index.js b/nezha-fronted/src/store/index.js index 040b00670..0a77fa239 100644 --- a/nezha-fronted/src/store/index.js +++ b/nezha-fronted/src/store/index.js @@ -60,8 +60,12 @@ const store = new Vuex.Store({ configSync: {}, // 配置同步 showConfigSync: false, nzDefaultConfig: { - minStep: 60 - }, + minStep: 60, + option: { + lineWidth: 2, + pointSize: 8 + } + } }, getters: { getNzDefaultConfig (state) {