diff --git a/nezha-fronted/src/components/chart/chart-list-grid.vue b/nezha-fronted/src/components/chart/chart-list-grid.vue index b75cd7633..e48a667ed 100644 --- a/nezha-fronted/src/components/chart/chart-list-grid.vue +++ b/nezha-fronted/src/components/chart/chart-list-grid.vue @@ -305,7 +305,6 @@ export default { }, methods: { drag: function (e) { - console.log(e) const parentRect = document.getElementById('content').getBoundingClientRect() let mouseInGrid = false if (((mouseXY.x > parentRect.left) && (mouseXY.x < parentRect.right)) && ((mouseXY.y > parentRect.top) && (mouseXY.y < parentRect.bottom))) { @@ -367,17 +366,14 @@ export default { moveEvent: function (i, newX, newY) { const msg = 'MOVE i=' + i + ', X=' + newX + ', Y=' + newY this.eventLog.push(msg) - console.log(msg) }, movedEvent: function (i, newX, newY) { const msg = 'MOVED i=' + i + ', X=' + newX + ', Y=' + newY this.eventLog.push(msg) - console.log(msg) }, resizeEvent: function (i, newH, newW, newHPx, newWPx) { const msg = 'RESIZE i=' + i + ', H=' + newH + ', W=' + newW + ', H(px)=' + newHPx + ', W(px)=' + newWPx this.eventLog.push(msg) - console.log(msg, this.$refs['editChart' + i]) setTimeout(() => { this.$refs['editChart' + i][0].chartResize() }) @@ -385,7 +381,6 @@ export default { resizedEvent: function (i, newX, newY, newHPx, newWPx) { const msg = 'RESIZED i=' + i + ', X=' + newX + ', Y=' + newY + ', H(px)=' + newHPx + ', W(px)=' + newWPx this.eventLog.push(msg) - console.log(msg) setTimeout(() => { this.$refs['editChart' + i][0].chartResize() }, 50) @@ -393,27 +388,21 @@ export default { containerResizedEvent: function (i, newH, newW, newHPx, newWPx) { const msg = 'CONTAINER RESIZED i=' + i + ', H=' + newH + ', W=' + newW + ', H(px)=' + newHPx + ', W(px)=' + newWPx this.eventLog.push(msg) - console.log(msg) }, layoutCreatedEvent: function (newLayout) { this.eventLog.push('Created layout') - console.log('Created layout: ', newLayout) }, layoutBeforeMountEvent: function (newLayout) { this.eventLog.push('beforeMount layout') - console.log('beforeMount layout: ', newLayout) }, layoutMountedEvent: function (newLayout) { this.eventLog.push('Mounted layout') - console.log('Mounted layout: ', newLayout) }, layoutReadyEvent: function (newLayout) { this.eventLog.push('Ready layout') - console.log('Ready layout: ', newLayout) }, layoutUpdatedEvent: function (newLayout) { this.eventLog.push('Updated layout') - console.log('Updated layout: ', newLayout) }, dropmenuChange (id, show) { if (show) { diff --git a/nezha-fronted/src/components/chart/chart-list-group-grid.vue b/nezha-fronted/src/components/chart/chart-list-group-grid.vue index 56cbec328..ba41ba79c 100644 --- a/nezha-fronted/src/components/chart/chart-list-group-grid.vue +++ b/nezha-fronted/src/components/chart/chart-list-group-grid.vue @@ -408,47 +408,37 @@ export default { moveEvent: function (i, newX, newY) { const msg = 'MOVE i=' + i + ', X=' + newX + ', Y=' + newY this.eventLog.push(msg) - console.log(msg) }, movedEvent: function (i, newX, newY) { const msg = 'MOVED i=' + i + ', X=' + newX + ', Y=' + newY this.eventLog.push(msg) - console.log(msg) }, resizeEvent: function (i, newH, newW, newHPx, newWPx) { const msg = 'RESIZE i=' + i + ', H=' + newH + ', W=' + newW + ', H(px)=' + newHPx + ', W(px)=' + newWPx this.eventLog.push(msg) - console.log(msg) }, resizedEvent: function (i, newX, newY, newHPx, newWPx) { const msg = 'RESIZED i=' + i + ', X=' + newX + ', Y=' + newY + ', H(px)=' + newHPx + ', W(px)=' + newWPx this.eventLog.push(msg) - console.log(msg) }, containerResizedEvent: function (i, newH, newW, newHPx, newWPx) { const msg = 'CONTAINER RESIZED i=' + i + ', H=' + newH + ', W=' + newW + ', H(px)=' + newHPx + ', W(px)=' + newWPx this.eventLog.push(msg) - console.log(msg) }, layoutCreatedEvent: function (newLayout) { this.eventLog.push('Created layout') - console.log('Created layout: ', newLayout) }, layoutBeforeMountEvent: function (newLayout) { this.eventLog.push('beforeMount layout') - console.log('beforeMount layout: ', newLayout) }, layoutMountedEvent: function (newLayout) { this.eventLog.push('Mounted layout') - console.log('Mounted layout: ', newLayout) }, layoutReadyEvent: function (newLayout) { this.eventLog.push('Ready layout') - console.log('Ready layout: ', newLayout) }, layoutUpdatedEvent: function (newLayout) { this.eventLog.push('Updated layout') - console.log('Updated layout: ', newLayout) }, tempDomInit () { const span = document.querySelector('.temp-dom') diff --git a/nezha-fronted/src/components/chart/chart.vue b/nezha-fronted/src/components/chart/chart.vue index a00b77ba3..15961d59a 100644 --- a/nezha-fronted/src/components/chart/chart.vue +++ b/nezha-fronted/src/components/chart/chart.vue @@ -226,7 +226,6 @@ export default { isMap, isTable, resize () { - console.log(this.$refs['chart' + this.chartInfo.id]) this.$refs['chart' + this.chartInfo.id].resize() } }, diff --git a/nezha-fronted/src/components/chart/chart/chartGroup.vue b/nezha-fronted/src/components/chart/chart/chartGroup.vue index f803437bc..dc8f0e4f4 100644 --- a/nezha-fronted/src/components/chart/chart/chartGroup.vue +++ b/nezha-fronted/src/components/chart/chart/chartGroup.vue @@ -53,9 +53,7 @@ export default { chartData: { immediate: true, handler (n) { - console.log(n) this.$nextTick(() => { - console.log(this.from) this.dataList = JSON.parse(JSON.stringify(n)) }) } diff --git a/nezha-fronted/src/components/chart/chart/chartMap.vue b/nezha-fronted/src/components/chart/chart/chartMap.vue index 48efcc57b..70f3bdf89 100644 --- a/nezha-fronted/src/components/chart/chart/chartMap.vue +++ b/nezha-fronted/src/components/chart/chart/chartMap.vue @@ -151,7 +151,6 @@ export default { } shadowMarker.bindTooltip(this.mapTooltipFormatter(dcStat), { sticky: false, pane: 'myPane', direction: 'left', data: dcStat }) shadowMarker.on('mouseover', (param) => { - console.log(param) const point = param.containerPoint const event = param.originalEvent const boxWidth = window.innerWidth / 2 diff --git a/nezha-fronted/src/components/chart/chart/chartStat.vue b/nezha-fronted/src/components/chart/chart/chartStat.vue index 6d1bce840..407aa3399 100644 --- a/nezha-fronted/src/components/chart/chart/chartStat.vue +++ b/nezha-fronted/src/components/chart/chart/chartStat.vue @@ -74,7 +74,6 @@ export default { stat.showValue = chartDataFormat.getUnit(chartInfo.unit ? chartInfo.unit : 2).compute(stat.value, null, -1, 2) stat.mapping = this.selectMapping(stat.value, chartInfo.param.valueMapping, chartInfo.param.enable && this.chartInfo.param.enable.valueMapping) this.statData.push(stat) - console.log(this.statData) colorIndex++ }) }) diff --git a/nezha-fronted/src/components/chart/chart/chartTable.vue b/nezha-fronted/src/components/chart/chart/chartTable.vue index c128b2135..9a53d5768 100644 --- a/nezha-fronted/src/components/chart/chart/chartTable.vue +++ b/nezha-fronted/src/components/chart/chart/chartTable.vue @@ -57,7 +57,6 @@ export default { }, methods: { initChart () { - console.log(this.chartInfo, this.chartData) this.columns = this.chartInfo.param.columns this.chartInfo.param.valueMapping.forEach((item) => { if (this.valueMapping[item.column]) { @@ -68,7 +67,6 @@ export default { }) const data = this.initTableData(this.chartInfo, this.chartData) const arr = [] - console.log(data) Object.keys(data).forEach(key => { arr.push(data[key]) }) @@ -80,18 +78,22 @@ export default { }) this.tableData = arr this.$refs.dataTable.doLayout() - console.log(data) }, initTableData (chartInfo, originalDatas) { let colorIndex = 0 const returnData = {} const arr = chartInfo.param.indexs.split(',') - console.log(returnData) originalDatas.forEach((originalData, expressionIndex) => { - const key = chartInfo.elements[expressionIndex].name || expressionIndex + let key = expressionIndex + if (chartInfo.elements && chartInfo.elements[expressionIndex].name) { + key = chartInfo.elements[expressionIndex].name + } + if (chartInfo.datasource == 'system' && chartInfo.param.datasource[0].name) { + key = chartInfo.param.datasource[0].name + } originalData.forEach((data, dataIndex) => { data.$labels = data.metric - const value = getMetricTypeValue(data.values, chartInfo.param.statistics) + const value = getMetricTypeValue(data.values, chartInfo.param.statistics || 'last') const showValue = chartDataFormat.getUnit(chartInfo.unit ? chartInfo.unit : 2).compute(value, null, -1, 2) // const mapping = this.selectTableMapping(value, chartInfo.param.valueMapping) data.$value = value @@ -128,7 +130,7 @@ export default { this.columns.forEach((column) => { if (valueMapping[column.title]) { obj[column.title + 'mapping'] = '' - if (chartInfo.param.enable && this.chartInfo.param.enable.valueMapping) { + if (this.chartInfo.param.enable && this.chartInfo.param.enable.valueMapping) { valueMapping[column.title].forEach(item => { const rowValue = row.display[column.title + 'display'] if (item.type === 'value') { diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index 9a82f572a..382b126f4 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -204,7 +204,6 @@ export default { // console.log(height,copyList, group, flag) // console.log(this.$refs.layout) const groupFind = this.copyDataList.find(item => item.id == group.id) - console.log(groupFind) if (group && groupFind) { groupFind.height = groupFind.h = height + this.headerHPadding groupFind.children = copyList @@ -272,7 +271,6 @@ export default { }, mounted () { this.init() - console.log(this.from,'chartList') if (!this.isGroup) { bus.$on('groupMove', this.changeGroupHeight) this.$store.commit('setChartListId', `chartList${this.timestamp}`) diff --git a/nezha-fronted/src/components/chart/chartMixin.js b/nezha-fronted/src/components/chart/chartMixin.js index d29c4b6df..2f40b6b0b 100644 --- a/nezha-fronted/src/components/chart/chartMixin.js +++ b/nezha-fronted/src/components/chart/chartMixin.js @@ -45,7 +45,6 @@ export default { if (chartInfo.param.stack) { // 堆叠 s.stack = 'Total' } - console.log(lodash.isEmpty(chartInfo.param.thresholds)) if (chartInfo.param.enable && chartInfo.param.enable.legend && !lodash.isEmpty(chartInfo.param.thresholds)) { // 阈值 s.markLine = { symbol: 'circle', diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index 0ab8bc25d..3c406e277 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -95,7 +95,6 @@ export default { this.query(elements, startTime, endTime, step) }, query (elements, startTime, endTime, step) { - console.log(this.from, this.chartInfo.datasource,this.chartInfo.type, elements, startTime, endTime, step) try { switch (this.chartInfo.datasource) { case 'metrics': @@ -157,8 +156,6 @@ export default { break } case 'system': { - console.log(this.chartInfo.param.datasource[0]) - const q = { type: this.chartInfo.param.datasource[0].type, group: this.chartInfo.param.datasource[0].group, @@ -167,7 +164,6 @@ export default { sort: this.chartInfo.param.datasource[0].sort } const chartData = [] - console.log(this.chartInfo.type) const params = { q: encodeURIComponent(JSON.stringify(q)), stat: startTime, @@ -202,7 +198,6 @@ export default { } } if (this.chartInfo.type === 'group') { - console.log(this.chartInfo.children) this.chartData = [...this.chartInfo.children] this.groupInit() } @@ -271,7 +266,6 @@ export default { this.chartInfo.height = height + this.headerHPadding this.chartInfo.h = height + this.headerHPadding } else { - console.log(this.headerH) this.chartInfo.height = this.headerH + height this.chartInfo.h = this.headerH + height } @@ -296,7 +290,6 @@ export default { }, mounted () { this.getChartData() - console.log(this.from,this.chartInfo.type) } } diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue index 2d7fd4cde..95d2c2ce4 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue @@ -405,7 +405,6 @@ export default { params.end_time = endTimeTmp params.from = this.from } - console.log(this.from) if (this.from !== 'chartTemp') { this.$get('visual/panel/chart?panelId=' + params.panelId + '&groupId=0' + '&pageSize=-1').then(response => { if (response.code === 200) { diff --git a/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue b/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue index 730ef55cc..39894e060 100644 --- a/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue +++ b/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue @@ -244,7 +244,6 @@ export default { setTimeout(() => { this.hexagonData = JSON.parse(JSON.stringify(this.hexData)) const box = `#${this.hexagonSvgID}` - console.log(box,document.getElementById(this.hexagonSvgID)) if (!document.getElementById(this.hexagonSvgID)) { return } diff --git a/nezha-fronted/src/components/common/js/tools.js b/nezha-fronted/src/components/common/js/tools.js index 14ef68f14..a8cd74bf7 100644 --- a/nezha-fronted/src/components/common/js/tools.js +++ b/nezha-fronted/src/components/common/js/tools.js @@ -819,7 +819,6 @@ export function getMetricTypeValue (queryItem, type) { } case 'last': { const last = copy.sort((x, y) => { return parseFloat(y[0]) - parseFloat(x[0]) })[0][1] - console.log(last) return last } case 'first': { diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index d4a6498a7..1ae55f8ac 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -171,7 +171,6 @@ export default { } delete params.panel if (params.type === 'table') { - console.log(params.param.tags) delete params.param.tags } if (params.id) { // 修改 @@ -290,7 +289,7 @@ export default { valueMapping: true }, datasource: [{ - name: 'A', + name: 'System', type: 'asset', systemGroup: '', systemSelect: '', diff --git a/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js b/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js index 35a8ab499..c8b08d00b 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js +++ b/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js @@ -396,7 +396,6 @@ export default { this.chartConfig.param.columns[index].show = !this.chartConfig.param.columns[index].show }, tagsChange (newTags) { - console.log(newTags, newTags) this.chartConfig.param.tags = newTags this.chartConfig.param.indexs = newTags.map(item => item.text).join(',') this.change() diff --git a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue index 049ebf6d2..60f59da07 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue @@ -7,7 +7,9 @@ label-position= "top" label-width="120px" > - +