diff --git a/src/views/statistics/Statistics/statistics/index.vue b/src/views/statistics/Statistics/statistics/index.vue index 9cbf2e7..7ba690a 100644 --- a/src/views/statistics/Statistics/statistics/index.vue +++ b/src/views/statistics/Statistics/statistics/index.vue @@ -3,10 +3,10 @@
- - Type + + Type - + Stations - - Nuclide + + Nuclide - - Data Source + + Data Source - - Time - + + Time + - + to - +
@@ -113,11 +113,12 @@ import BoxTitle from '@/views/abnormalAlarm/components/boxTitle.vue' import { getAction, getFileAction } from '../../../../api/manage' import { saveAs } from 'file-saver' import moment from 'moment' +let xDataLength = 0 const commonOptions = { grid: { top: 30, left: 20, - right: 18, + right: 30, bottom: 35, containLabel: true, }, @@ -125,7 +126,7 @@ const commonOptions = { trigger: 'axis', }, legend: { - inactiveColor: '#333', + inactiveColor: '#5f5f5f', lineStyle: { inactiveColor: '#333', }, @@ -135,8 +136,14 @@ const commonOptions = { data: [], }, toolbox: { + // showTitle: false, feature: { - saveAsImage: {}, + saveAsImage: { + title: 'Save The Image', + iconStyle: { + borderColor: '#ade6ee', + }, + }, }, }, xAxis: { @@ -164,8 +171,21 @@ const commonOptions = { }, }, axisLabel: { - fontSize: 12, - color: '#ade6ee', + color: '#5b9cba', + formatter: (value, index) => { + let val = value.split(' ').join('\n') + // if (index === 0) { + // return ' ' + val + // } + if (index === xDataLength - 1) { + let arr = value.split(' ') + arr[0] = arr[0] + ' ' + arr[1] = arr[1] + ' ' + let str = arr.join('\n') + return str + } + return val + }, }, data: [], }, @@ -232,7 +252,7 @@ export default { systemType: undefined, nuclideNames: undefined, dbName: undefined, - startDate: moment().format('YYYY-MM-DD'), + startDate: moment().subtract(6, 'days').format('YYYY-MM-DD'), endDate: moment().format('YYYY-MM-DD'), }, menuName: '', @@ -254,9 +274,9 @@ export default { moment, typeChange(val) { this.queryParams.systemType = val - if ('Particulate') this.menuName = 'Particulate' - if ('gamma') this.menuName = 'Noble Gas HPGe' - if ('beta') this.menuName = 'Noble Gas Beta-Gamma' + if (val == 'Particulate') this.menuName = 'Particulate' + if (val == 'gamma') this.menuName = 'Noble Gas HPGe' + if (val == 'beta') this.menuName = 'Noble Gas Beta-Gamma' this.getStations() this.getNuclide() }, @@ -358,10 +378,11 @@ export default { if (type === 'right') this.titleRight = `${result.STATION_NAME}:Nuclide History` legend.data = Object.keys(result).filter((item) => item !== 'CollectStart') xAxis.data = result.CollectStart + xDataLength = result.CollectStart.length toolbox.feature.saveAsImage.name = `${result.STATION_NAME}:Nuclide History` for (const key in result) { let param = null - if (Object.hasOwnProperty.call(result, key) && key !== 'CollectStart') { + if (Object.hasOwnProperty.call(result, key) && key !== 'CollectStart' && key !== 'STATION_NAME') { const element = result[key] param = { type: 'line',