diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue index 882d04750..463a32d3c 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.vue +++ b/nezha-fronted/src/components/charts/line-chart-block.vue @@ -236,7 +236,11 @@ export default { chartTitleShow: { type: Boolean, default: true - } + }, + fromTopo: { + type: Boolean, + default: false + }, }, computed: { getButtonCode () { @@ -937,6 +941,9 @@ export default { if (unit.type == 'Time') { delete option.yAxis.maxInterval } + if (this.fromTopo) { + option.minInterval = 20 * 60 * 1000 + } // params.series = dataArg; if (chartSite === 'local') { // 本地显示 if (legend) { @@ -962,7 +969,7 @@ export default { setTimeout(function () { const divHeight = self.$refs.legendArea.offsetHeight if (!chartInfo.height) { - getChart(self.chartIndex).resize({ height: (400 - divHeight - chartResizeTool.titleHeight - chartResizeTool.chartBlankHeight) }) + getChart(self.chartIndex).resize({ height: (250 - divHeight - chartResizeTool.titleHeight - chartResizeTool.chartBlankHeight) }) } else { getChart(self.chartIndex).resize({ height: (chartInfo.height * vm.stepWidth - divHeight - chartResizeTool.titleHeight - chartResizeTool.chartBlankHeight) }) } diff --git a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue index 6fd497755..0a0a779b5 100644 --- a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue +++ b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue @@ -438,7 +438,7 @@ export default { top: 0, left: 0, show: false, - height: 400 + height: 250 }, chartData: {}, chartGetData: [], @@ -523,7 +523,6 @@ export default { immediate: true, deep: true, handler (n) { - console.log(n) setTimeout(() => { this.init() }, 100) @@ -589,7 +588,7 @@ export default { }) } query += '&nullType=' + 'connected' - return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step) + return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + '10m') }) axiosArr.push({ item, arr }) promiseArr.push(pensPromise(item, arr, index)) @@ -1643,7 +1642,6 @@ export default { editTopology (val) { this.editTopologyFlag = true setTimeout(() => { - console.log(getTopology(this.topologyIndex)) getTopology(this.topologyIndex).lock(0) getTopology(this.topologyIndex).data.pens.forEach((item, index) => { // 停止动画 以及赋值默认data if (item.animatePlay) { diff --git a/nezha-fronted/src/components/common/project/L5/topoTooltip.vue b/nezha-fronted/src/components/common/project/L5/topoTooltip.vue index 700afc2ad..30028eec4 100644 --- a/nezha-fronted/src/components/common/project/L5/topoTooltip.vue +++ b/nezha-fronted/src/components/common/project/L5/topoTooltip.vue @@ -10,6 +10,7 @@ :panel-id="-1" :is-lock="true" :chart-index="0" + :fromTopo="true" :chartTitleShow="false" :chart-data="chartData"> @@ -61,8 +62,8 @@ export default { }, data () { return { - tempDom: { height: 400, width: '' }, - chartDataTemp: { id: 8832, prev: null, next: null, panelId: 0, title: '123', span: 12, height: 12, createAt: '2021-01-27 07:36:19', unit: 2, weight: 0, pid: null, buildIn: null, seq: null, param: { last: 0, legendValue: { total: 'off', min: 'off', avg: 'off', last: 'off', max: 'off' }, threshold: '', url: '', nullType: 'connected' }, sync: null, asset: null, isLoaded: true, from: '__vue_devtool_undefined__', draggable: true, resizable: true, editable: true }, + tempDom: { height: 250, width: '' }, + chartDataTemp: { id: 8832, prev: null, next: null, panelId: 0, title: '123', span: 12, height: 0, createAt: '2021-01-27 07:36:19', unit: 2, weight: 0, pid: null, buildIn: null, seq: null, param: { last: 0, legendValue: { total: 'off', min: 'off', avg: 'off', last: 'off', max: 'off' }, threshold: '', url: '', nullType: 'connected' }, sync: null, asset: null, isLoaded: true, from: '__vue_devtool_undefined__', draggable: true, resizable: true, editable: true }, chartData: {}, filter: { end_time: bus.timeFormate(bus.getOffsetTimezoneData(), 'yyyy-MM-dd hh:mm:ss'), @@ -77,7 +78,7 @@ export default { }, methods: { tempDomInit () { - this.tempDom.width = 400 + this.tempDom.width = 250 }, process (item) { const chartData = { ...this.chartDataTemp, ...item } @@ -332,13 +333,13 @@ export default { max-height: 400px; min-height: 200px; height: 100%; + box-sizing: border-box; .tooltip-box-chart{ border: 1px solid #E7EAED; - width: 400px; + width: 300px; max-height: 400px; min-height: 200px; height: 100%; - margin-right: 10px; } .tooltip-box-info{ border: 1px solid #E7EAED; diff --git a/nezha-fronted/src/components/common/project/topologyL5.vue b/nezha-fronted/src/components/common/project/topologyL5.vue index 9ef01f9fd..9eb2fe0f6 100644 --- a/nezha-fronted/src/components/common/project/topologyL5.vue +++ b/nezha-fronted/src/components/common/project/topologyL5.vue @@ -468,7 +468,7 @@ export default { top: 0, left: 0, show: false, - height: 400 + height: 250 }, chartData: {}, chartGetData: [],