feat:endpoint 全屏 添加比较差值
This commit is contained in:
@@ -181,17 +181,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import bus from '../../libs/bus'
|
import bus from '../../libs/bus'
|
||||||
import loading from '../common/loading'
|
import loading from '../common/loading'
|
||||||
import chartDataFormat from './chartDataFormat'
|
import chartDataFormat from './chartDataFormat'
|
||||||
import { randomcolor } from '../common/js/radomcolor/randomcolor.js'
|
import { randomcolor } from '../common/js/radomcolor/randomcolor.js'
|
||||||
import chartConfig from '../page/dashboard/overview/chartConfig'
|
import chartConfig from '../page/dashboard/overview/chartConfig'
|
||||||
import { getChart, setChart, lineChartMove, getMousePoint } from '../common/js/common'
|
import { getChart, setChart, lineChartMove, getMousePoint } from '../common/js/common'
|
||||||
import { getMetricTypeValue } from '../common/js/tools'
|
import { getMetricTypeValue } from '../common/js/tools'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'lineChartBlock',
|
name: 'lineChartBlock',
|
||||||
components: {
|
components: {
|
||||||
loading: loading
|
loading: loading
|
||||||
@@ -1971,6 +1971,6 @@
|
|||||||
setChart(this.chartIndex, null)
|
setChart(this.chartIndex, null)
|
||||||
window.removeEventListener('resize', this.chartResize)
|
window.removeEventListener('resize', this.chartResize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -17,16 +17,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import chartDataFormat from '../../../charts/chartDataFormat'
|
import chartDataFormat from '../../../charts/chartDataFormat'
|
||||||
import loading from '../../../common/loading'
|
import loading from '../../../common/loading'
|
||||||
import chartConfig from './chartConfig'
|
import chartConfig from './chartConfig'
|
||||||
import bus from '../../../../libs/bus'
|
import bus from '../../../../libs/bus'
|
||||||
import EleResize from '../../../common/js/divResize'
|
import EleResize from '../../../common/js/divResize'
|
||||||
import { randomcolor } from '../../../common/js/radomcolor/randomcolor'
|
import { randomcolor } from '../../../common/js/radomcolor/randomcolor'
|
||||||
// import * as mapGeoJson from "../../../common/js/world";
|
// import * as mapGeoJson from "../../../common/js/world";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'chart',
|
name: 'chart',
|
||||||
components: {
|
components: {
|
||||||
loading: loading
|
loading: loading
|
||||||
@@ -422,6 +422,9 @@ export default {
|
|||||||
str += '<br/>'
|
str += '<br/>'
|
||||||
}
|
}
|
||||||
if (alias.indexOf('Previous ') !== -1 && minusFlag) {
|
if (alias.indexOf('Previous ') !== -1 && minusFlag) {
|
||||||
|
if (i !== 0) {
|
||||||
|
str += '<div style="border:1px dashed #333;width:100%;margin-top: 5px"></div>'
|
||||||
|
}
|
||||||
const value = item.data[0] - this.minusTime
|
const value = item.data[0] - this.minusTime
|
||||||
const tData = new Date(value)
|
const tData = new Date(value)
|
||||||
str += [tData.getFullYear(), tData.getMonth() + 1, tData.getDate()].join('-') + ' ' +
|
str += [tData.getFullYear(), tData.getMonth() + 1, tData.getDate()].join('-') + ' ' +
|
||||||
@@ -435,6 +438,26 @@ export default {
|
|||||||
str += '<div style="padding-left: 10px;">'
|
str += '<div style="padding-left: 10px;">'
|
||||||
str += chartDataFormat.getUnit(this.unit).compute(val, null, 2)
|
str += chartDataFormat.getUnit(this.unit).compute(val, null, 2)
|
||||||
str += '</div>'
|
str += '</div>'
|
||||||
|
|
||||||
|
const previousItem = params.find((series) => ('Previous ' + item.seriesName) === series.seriesName)
|
||||||
|
if (previousItem) {
|
||||||
|
str += '<div style="padding-left: 10px;">'
|
||||||
|
let previousval = parseFloat(Number(previousItem.data[1]).toFixed(2))
|
||||||
|
if (previousval === 0) {
|
||||||
|
previousval = Number(item.data[1]).toExponential(2)
|
||||||
|
}
|
||||||
|
let minusVal = 0
|
||||||
|
if (previousval <= val) {
|
||||||
|
minusVal = val - previousval
|
||||||
|
str += '+'
|
||||||
|
} else {
|
||||||
|
minusVal = previousval - val
|
||||||
|
str += '-'
|
||||||
|
}
|
||||||
|
|
||||||
|
str += chartDataFormat.getUnit(this.unit).compute(minusVal, null, 2)
|
||||||
|
str += '</div>'
|
||||||
|
}
|
||||||
str += '</div>'
|
str += '</div>'
|
||||||
})
|
})
|
||||||
str += '</div>'
|
str += '</div>'
|
||||||
@@ -571,7 +594,7 @@ export default {
|
|||||||
EleResize.off(this.$el, this.resize, this.chartType); */
|
EleResize.off(this.$el, this.resize, this.chartType); */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<!--<style>
|
<!--<style>
|
||||||
@import "../../../charts/chart.scss";
|
@import "../../../charts/chart.scss";
|
||||||
|
|||||||
Reference in New Issue
Block a user