| | |
| | | AppLayout: typeof import('./src/components/layout/AppLayout.vue')['default'] |
| | | ElAside: typeof import('element-plus/es')['ElAside'] |
| | | ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete'] |
| | | ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer'] |
| | | ElAvatar: typeof import('element-plus/es')['ElAvatar'] |
| | | ElButton: typeof import('element-plus/es')['ElButton'] |
| | | ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] |
| | | ElCard: typeof import('element-plus/es')['ElCard'] |
| | | ElCascader: typeof import('element-plus/es')['ElCascader'] |
| | | ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] |
| | | ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] |
| | | ElCion: typeof import('element-plus/es')['ElCion'] |
| | | ElCol: typeof import('element-plus/es')['ElCol'] |
| | | ElCollapse: typeof import('element-plus/es')['ElCollapse'] |
| | | ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] |
| | | ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] |
| | | ElContainer: typeof import('element-plus/es')['ElContainer'] |
| | | ElCountdown: typeof import('element-plus/es')['ElCountdown'] |
| | | ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] |
| | | ElDialog: typeof import('element-plus/es')['ElDialog'] |
| | | ElDivided: typeof import('element-plus/es')['ElDivided'] |
| | | ElDivider: typeof import('element-plus/es')['ElDivider'] |
| | | ElDivItem: typeof import('element-plus/es')['ElDivItem'] |
| | | ElDrawer: typeof import('element-plus/es')['ElDrawer'] |
| | | ElDropdown: typeof import('element-plus/es')['ElDropdown'] |
| | | ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] |
| | | ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] |
| | |
| | | ElMain: typeof import('element-plus/es')['ElMain'] |
| | | ElMenu: typeof import('element-plus/es')['ElMenu'] |
| | | ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] |
| | | ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup'] |
| | | ElOption: typeof import('element-plus/es')['ElOption'] |
| | | ElPagination: typeof import('element-plus/es')['ElPagination'] |
| | | ElPanel: typeof import('element-plus/es')['ElPanel'] |
| | | ElProgress: typeof import('element-plus/es')['ElProgress'] |
| | | ElRadio: typeof import('element-plus/es')['ElRadio'] |
| | | ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] |
| | | ElRow: typeof import('element-plus/es')['ElRow'] |
| | | ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] |
| | | ElSelect: typeof import('element-plus/es')['ElSelect'] |
| | | ElSpace: typeof import('element-plus/es')['ElSpace'] |
| | | ElStatistic: typeof import('element-plus/es')['ElStatistic'] |
| | | ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] |
| | | ElSubMenuItem: typeof import('element-plus/es')['ElSubMenuItem'] |
| | | ElSwitch: typeof import('element-plus/es')['ElSwitch'] |
| | | ElTable: typeof import('element-plus/es')['ElTable'] |
| | | ElTableColum: typeof import('element-plus/es')['ElTableColum'] |
| | | ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] |
| | | ElTableColumns: typeof import('element-plus/es')['ElTableColumns'] |
| | | ElTableV2: typeof import('element-plus/es')['ElTableV2'] |
| | | ElTag: typeof import('element-plus/es')['ElTag'] |
| | | ElText: typeof import('element-plus/es')['ElText'] |
| | | ElTimeline: typeof import('element-plus/es')['ElTimeline'] |
| | | ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] |
| | | ElTimePicker: typeof import('element-plus/es')['ElTimePicker'] |
| | | ElTon: typeof import('element-plus/es')['ElTon'] |
| | | ElTooltip: typeof import('element-plus/es')['ElTooltip'] |
| | | HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] |
| | | IconCommunity: typeof import('./src/components/icons/IconCommunity.vue')['default'] |
| | | IconDocumentation: typeof import('./src/components/icons/IconDocumentation.vue')['default'] |
| | | IconEcosystem: typeof import('./src/components/icons/IconEcosystem.vue')['default'] |
| | |
| | | IEpArrowDown: typeof import('~icons/ep/arrow-down')['default'] |
| | | IEpBell: typeof import('~icons/ep/bell')['default'] |
| | | IEpDataLine: typeof import('~icons/ep/data-line')['default'] |
| | | IEpDownload: typeof import('~icons/ep/download')['default'] |
| | | IEpExpand: typeof import('~icons/ep/expand')['default'] |
| | | IEpFold: typeof import('~icons/ep/fold')['default'] |
| | | IEpGrid: typeof import('~icons/ep/grid')['default'] |
| | | IEpHistogram: typeof import('~icons/ep/histogram')['default'] |
| | | IEpInfoFilled: typeof import('~icons/ep/info-filled')['default'] |
| | | IEpList: typeof import('~icons/ep/list')['default'] |
| | | IEpLock: typeof import('~icons/ep/lock')['default'] |
| | | IEpMonitor: typeof import('~icons/ep/monitor')['default'] |
| | | IEpNotebook: typeof import('~icons/ep/notebook')['default'] |
| | | IEpSearch: typeof import('~icons/ep/search')['default'] |
| | | IEpSeting: typeof import('~icons/ep/seting')['default'] |
| | | IEpSetting: typeof import('~icons/ep/setting')['default'] |
| | | IEpShop: typeof import('~icons/ep/shop')['default'] |
| | | IEpStopwatch: typeof import('~icons/ep/stopwatch')['default'] |
| | | IEpSunrise: typeof import('~icons/ep/sunrise')['default'] |
| | | IEpSunset: typeof import('~icons/ep/sunset')['default'] |
| | | IEpTrendCharts: typeof import('~icons/ep/trend-charts')['default'] |
| | | IEpUser: typeof import('~icons/ep/user')['default'] |
| | | RouterLink: typeof import('vue-router')['RouterLink'] |
| | | RouterView: typeof import('vue-router')['RouterView'] |
| | | TheWelcome: typeof import('./src/components/TheWelcome.vue')['default'] |
| | | WelcomeItem: typeof import('./src/components/WelcomeItem.vue')['default'] |
| | | } |
| | | export interface ComponentCustomProperties { |
| | | vLoading: typeof import('element-plus/es')['ElLoadingDirective'] |
| | |
| | | <script setup lang="ts"> |
| | | import { RouterView } from 'vue-router' |
| | | <script setup> |
| | | import zhCn from 'element-plus/dist/locale/zh-cn.mjs'; |
| | | |
| | | |
| | | const locale = ref(zhCn); |
| | | </script> |
| | | |
| | | <template> |
| | | <el-config-provider :locale="zhCn"> |
| | | <RouterView /> |
| | | <el-config-provider :locale="locale"> |
| | | <router-view /> |
| | | </el-config-provider> |
| | | </template> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | /** |
| | | * 设置ç½è·¯è¯·æ±çå¬ |
| | | */ |
| | | function setInterceptors(...instance) { |
| | | instance.forEach((i) => { |
| | | // æ·»å è¯·æ±æ¦æªå¨ |
| | | i.interceptors.request.use( |
| | | function (config) { |
| | | // å¨åé请æ±ä¹å, æ·»å 请æ±å¤´ |
| | | // config.headers = addHeaders(config.headers); |
| | | |
| | | console.log('==>请æ±å¼å§'); |
| | | console.log(`${config.baseURL}${config.url}`); |
| | | if (config.data) { |
| | | console.log('==>è¯·æ±æ°æ®', config.data); |
| | | } |
| | | return config; |
| | | }, |
| | | function (error) { |
| | | // 对请æ±é误åäºä»ä¹ |
| | | console.log('==>请æ±å¼å§'); |
| | | console.log(error); |
| | | ElMessage({ |
| | | message: error, |
| | | type: 'error' |
| | | }); |
| | | return Promise.reject(error); |
| | | } |
| | | ); |
| | | |
| | | // æ·»å ååºæ¦æªå¨ |
| | | i.interceptors.response.use( |
| | | function (response) { |
| | | // 2xx èå´å
çç¶æç é½ä¼è§¦åè¯¥å½æ°ã |
| | | // 对ååºæ°æ®åç¹ä»ä¹ |
| | | console.log(response); |
| | | console.log('==>请æ±ç»æ'); |
| | | if (response.status == 200) { |
| | | if ( |
| | | response.data.success != undefined && |
| | | response.data.success != null |
| | | ) { |
| | | if (response.data.success == true) { |
| | | // if (response.data.message && response.data.message != '') { |
| | | // ElMessage({ |
| | | // message: response.data.message, |
| | | // type: 'success' |
| | | // }); |
| | | // } |
| | | return response.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | message: response.data.message, |
| | | type: 'error' |
| | | }); |
| | | return Promise.reject(response.data.message); |
| | | } |
| | | } else { |
| | | return response; |
| | | } |
| | | } else { |
| | | return Promise.reject(response); |
| | | } |
| | | }, |
| | | function (error) { |
| | | // è¶
åº 2xx èå´çç¶æç é½ä¼è§¦åè¯¥å½æ°ã |
| | | // 对ååºé误åç¹ä»ä¹ |
| | | console.log(error); |
| | | console.log('==>请æ±ç»æ'); |
| | | ElMessage({ |
| | | message: error, |
| | | type: 'error' |
| | | }); |
| | | return Promise.reject(error); |
| | | } |
| | | ); |
| | | }); |
| | | } |
| | | |
| | | export { setInterceptors }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { $http } from './index'; |
| | | |
| | | export default { |
| | | /** |
| | | * |
| | | * @param {*} siteName |
| | | * @param {*} beginTime |
| | | * @param {*} endTime |
| | | * @returns |
| | | */ |
| | | analysisdata(siteName, beginTime, endTime) { |
| | | return $http.get('/dust/analysisdata', { |
| | | params: { |
| | | siteName: siteName, |
| | | beginTime: beginTime, |
| | | endTime: endTime |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * |
| | | * @param {*} siteName |
| | | * @param {*} exceptionType |
| | | * @param {*} beginTime |
| | | * @param {*} endTime |
| | | * @returns |
| | | */ |
| | | exceptiondata1({ siteName, exceptionType, beginTime, endTime }) { |
| | | const _params = { |
| | | siteName: siteName, |
| | | beginTime: beginTime, |
| | | endTime: endTime |
| | | }; |
| | | if (exceptionType) { |
| | | _params.exceptionType = exceptionType; |
| | | } |
| | | return $http.get('/dust/exceptiondata1', { params: _params }); |
| | | } |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { $http } from './index'; |
| | | |
| | | export default { |
| | | |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import axios from 'axios'; |
| | | import { setInterceptors } from './config'; |
| | | |
| | | // const url = 'http://47.100.191.150:9031/'; |
| | | const url = 'http://192.168.1.4:8081/'; |
| | | |
| | | //é£ç¾½ç管 |
| | | const $http = axios.create({ |
| | | baseURL: url, |
| | | timeout: 10000 |
| | | }); |
| | | |
| | | //æ·»å æ¦æªå¨ |
| | | setInterceptors($http); |
| | | |
| | | export { $http }; |
| | |
| | | .el-main { |
| | | background-color: #f4f4f5; |
| | | padding: 0; |
| | | overflow-y: hidden; |
| | | // overflow-y: hidden; |
| | | } |
| | | |
| | | </style> |
| | |
| | | |
| | | const app = createApp(App) |
| | | |
| | | axios.defaults.baseURL = 'http://localhost:8081' |
| | | axios.defaults.baseURL = 'http://192.168.1.4:8081' |
| | | app.config.globalProperties.$http = axios |
| | | |
| | | app.use(createPinia()) |
| | |
| | | å°è¯¥ç«ç¹ææ¶æ®µçå¼å¸¸æ°æ®è¿åç»ç¶ç»ä»¶ï¼ç¶ç»ä»¶åè¿åç»ç¥å
ç»ä»¶ |
| | | --> |
| | | <script> |
| | | import exceptionApi from '@/api/exceptionApi.js'; |
| | | export default { |
| | | props: { |
| | | siteName:String, |
| | | exceptionType:String, |
| | | beginTime:String, |
| | | endTime:String, |
| | | siteName: String, |
| | | exceptionType: String, |
| | | beginTime: String, |
| | | endTime: String |
| | | }, |
| | | emits: ['submitExceptionData'], |
| | | data() { |
| | |
| | | methods: { |
| | | requestExceptionData() { |
| | | // ä¸å页 |
| | | this.$http |
| | | .get('/dust/exceptiondata1', { |
| | | params: { |
| | | siteName: this.siteName, |
| | | exceptionType: this.exceptionType, |
| | | beginTime: this.beginTime, |
| | | endTime: this.endTime |
| | | } |
| | | }) |
| | | exceptionApi |
| | | .exceptiondata1( |
| | | this.siteName, |
| | | this.exceptionType, |
| | | this.beginTime, |
| | | this.endTime |
| | | ) |
| | | .then((result) => { |
| | | //å°è¿åçç»æä¼ éç»ç¶ç»ä»¶ |
| | | this.$emit( |
| | | 'submitExceptionData', |
| | | result.data.data |
| | | ); |
| | | this.$emit('submitExceptionData', result.data.data); |
| | | }); |
| | | } |
| | | } |
| | |
| | | åç»ä»¶æåºæ¬çæ ·å¼ |
| | | 使ç¨åä¸ä¸ªå¾å½¢å®ä¾ï¼æ¥åç¶ç»ä»¶ä¼ å
¥çæçº¿å¾option |
| | | --> |
| | | <template> |
| | | <div ref="chart" class="line-chart"></div> |
| | | <template> |
| | | <div ref="chart" class="line-chart"></div> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | |
| | | export default { |
| | | props: { |
| | | chartData: { |
| | | type: Object, |
| | | required: true, |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | chart: null |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.renderChart(); |
| | | // this.chart.setOption(this.chartData) |
| | | window.addEventListener('resize',this.resizeChart) |
| | | }, |
| | | watch: { |
| | | chartData() { |
| | | // optionååæ¶ï¼å¾å½¢å次åå§å |
| | | // this.renderChart(); |
| | | this.chart.dispose(); |
| | | this.renderChart(); |
| | | this.chart.setOption(this.chartData) |
| | | } |
| | | |
| | | }, |
| | | beforeUnmount() { |
| | | if (this.chart) { |
| | | this.chart.dispose(); |
| | | } |
| | | }, |
| | | methods: { |
| | | renderChart() { |
| | | // å建echartså®ä¾ |
| | | this.chart = echarts.init(this.$refs.chart); |
| | | |
| | | // å®ä¹å¾è¡¨çé
ç½®é¡¹åæ°æ® |
| | | const option = { |
| | | title: { |
| | | // text: '弿¥æ°æ®å 载示ä¾' |
| | | }, |
| | | tooltip: {}, |
| | | |
| | | toolbox: { |
| | | // å·¥å
·æ |
| | | feature: { |
| | | dataZoom: { |
| | | // åºåç¼©æ¾ |
| | | yAxisIndex: 'none' |
| | | }, |
| | | |
| | | // ä¿å为å¾ç |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | name: 'æ¶é´', |
| | | data: [] |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | show: true, |
| | | interval: 'auto' |
| | | }, |
| | | name: 'ç¾åæ¯' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'fume', |
| | | type: 'line', |
| | | data: [] |
| | | } |
| | | ] |
| | | import * as _echarts from 'echarts'; |
| | | |
| | | export default { |
| | | props: { |
| | | chartData: { |
| | | type: Object, |
| | | required: true, |
| | | default: () => { |
| | | return { |
| | | x: [], |
| | | y: [] |
| | | }; |
| | | |
| | | // 使ç¨åæå®çé
ç½®é¡¹åæ°æ®æ¾ç¤ºå¾è¡¨ |
| | | this.chart.setOption(option, true); |
| | | }, |
| | | |
| | | // è·é¡µé¢ååºå¼åå |
| | | resizeChart(){ |
| | | this.chart.resize() |
| | | } |
| | | }, |
| | | title: { |
| | | type: String |
| | | }, |
| | | xName: { |
| | | type: String, |
| | | default: 'æ¶é´' |
| | | }, |
| | | yName: { |
| | | type: String, |
| | | default: 'ç¾åæ¯' |
| | | }, |
| | | seriesName: { |
| | | type: String, |
| | | default: 'ç³»åä¸' |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .line-chart { |
| | | width: 100%; |
| | | height: 500px; |
| | | margin-top: 25px; |
| | | }, |
| | | data() { |
| | | return { |
| | | chart: null |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.intiChart(); |
| | | // this.chart.setOption(this.chartData) |
| | | window.addEventListener('resize', this.resizeChart); |
| | | }, |
| | | watch: { |
| | | chartData() { |
| | | // optionååæ¶ï¼å¾å½¢å次åå§å |
| | | this.setOption(); |
| | | } |
| | | }, |
| | | beforeUnmount() { |
| | | if (this.chart) { |
| | | this.chart.dispose(); |
| | | } |
| | | }, |
| | | methods: { |
| | | intiChart() { |
| | | // å建echartså®ä¾ |
| | | this.chart = _echarts.init(this.$refs.chart); |
| | | |
| | | // 使ç¨åæå®çé
ç½®é¡¹åæ°æ®æ¾ç¤ºå¾è¡¨ |
| | | // this.chart.setOption(option, true); |
| | | }, |
| | | |
| | | setOption() { |
| | | // å®ä¹å¾è¡¨çé
ç½®é¡¹åæ°æ® |
| | | const option = { |
| | | title: { |
| | | text: this.title |
| | | }, |
| | | tooltip: {}, |
| | | |
| | | toolbox: { |
| | | // å·¥å
·æ |
| | | feature: { |
| | | dataZoom: { |
| | | // åºåç¼©æ¾ |
| | | yAxisIndex: 'none' |
| | | }, |
| | | |
| | | // ä¿å为å¾ç |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | name: this.xName, |
| | | data: this.chartData.x |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | show: true, |
| | | interval: 'auto' |
| | | }, |
| | | name: this.yName |
| | | }, |
| | | series: [ |
| | | { |
| | | name: this.seriesName, |
| | | type: 'line', |
| | | data: this.chartData.y |
| | | } |
| | | ] |
| | | }; |
| | | this.chart.setOption(option); |
| | | }, |
| | | |
| | | // è·é¡µé¢ååºå¼åå |
| | | resizeChart() { |
| | | this.chart.resize(); |
| | | } |
| | | } |
| | | |
| | | </style> |
| | | |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .line-chart { |
| | | width: 100%; |
| | | height: 500px; |
| | | margin-top: 25px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div>HomePage</div> |
| | | </template> |
| | | |
| | | <script> |
| | | // å¼å¸¸å¤ç°ç |
| | | export default { |
| | | |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-radio-group v-model="radio" @change="setChart"> |
| | | <!-- å¼å¸¸ç±»å --> |
| | | </el-radio-group> |
| | | <el-table></el-table> |
| | | </template> |
| | | |
| | | <script> |
| | | // åæ¶æ®µåç±»å¼å¸¸å¤ç°æ
åµ |
| | | export default {}; |
| | | </script> |
| | |
| | | <!-- æ¥åå¼ --> |
| | | <script> |
| | | import TimeSelectWithShortCuts from '../../sfc/TimeSelectWithShortCuts.vue'; |
| | | import InputSearch from '../../sfc/InputSearch.vue' |
| | | import AreaAndmonitorType from '../../sfc/AreaAndmonitorType.vue' |
| | | import InputSearch from '../../sfc/InputSearch.vue'; |
| | | import AreaAndmonitorType from '../../sfc/AreaAndmonitorType.vue'; |
| | | import DustRadarChart from '../../sfc/DustRadarChart.vue'; |
| | | // 弿¥ç»ä»¶ |
| | | const LineChart = defineAsyncComponent(() => |
| | | import('../../sfc/LineChart.vue') |
| | | ) |
| | | import exceptionApi from '@/api/exceptionApi.js'; |
| | | |
| | | import dayjs from 'dayjs' |
| | | // 弿¥ç»ä»¶ |
| | | const LineChart = defineAsyncComponent(() => import('../../sfc/LineChart.vue')); |
| | | |
| | | import dayjs from 'dayjs'; |
| | | export default { |
| | | components :{ |
| | | components: { |
| | | LineChart, |
| | | TimeSelectWithShortCuts, |
| | | InputSearch, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | isNoData:false, |
| | | loading:false, |
| | | chartData: [], //ä¿åæ¥è¯¢çç»æ |
| | | isNoData: false, |
| | | loading: false, |
| | | chartData: [], |
| | | chartData1: {}, //ä¿åæ¥è¯¢çç»æ |
| | | chartData2: {}, |
| | | chartData3: {}, |
| | | chartData4: {}, |
| | | //devId:'', //设å¤ç¼å· |
| | | begin:'2023-05-01', //å¼å§æ¶é´ |
| | | end:'2023-05-15', //ç»ææ¶é´ |
| | | begin: '2023-05-01', //å¼å§æ¶é´ |
| | | end: '2023-05-15', //ç»ææ¶é´ |
| | | |
| | | form: { |
| | | // ç«ç¹åç§° |
| | |
| | | endTime: '' |
| | | }, |
| | | // æçº¿å¾é
置项 |
| | | option:{}, |
| | | option: {}, |
| | | |
| | | // å¤éæ¡ç» |
| | | radio:1 |
| | | } |
| | | radio: 1 |
| | | }; |
| | | }, |
| | | mounted(){ |
| | | |
| | | this.fetchData() |
| | | mounted() { |
| | | this.fetch(); |
| | | }, |
| | | methods: { |
| | | giveTime(val) { |
| | |
| | | this.form.endTime = dayjs(val[1]).format('YYYY-MM-DD HH:mm:ss'); |
| | | }, |
| | | |
| | | fetch() { |
| | | this.fetchData(); |
| | | this.exceptiondataCount(); |
| | | }, |
| | | |
| | | // ç¹å»å±ç¤ºæé® |
| | | fetchData() { |
| | | if ( |
| | | this.form.beginTime >= this.form.endTime && |
| | | (this.form.beginTime != null || this.form.endTime != null) && |
| | | (this.form.beginTime != '' || tthis.form.endTime != '') |
| | | ) |
| | | { |
| | | alert('请è¾å
¥ææçæ¶é´æ®µ'); |
| | | return; |
| | | } |
| | | let params = {} |
| | | this.form.beginTime >= this.form.endTime && |
| | | (this.form.beginTime != null || this.form.endTime != null) && |
| | | (this.form.beginTime != '' || tthis.form.endTime != '') |
| | | ) { |
| | | alert('请è¾å
¥ææçæ¶é´æ®µ'); |
| | | return; |
| | | } |
| | | let params = {}; |
| | | if (this.form.name) { |
| | | params['siteName'] = this.form.name; |
| | | } |
| | | if(this.form.beginTime){ |
| | | params['beginTime'] = this.form.beginTime |
| | | if (this.form.beginTime) { |
| | | params['beginTime'] = this.form.beginTime; |
| | | } |
| | | if(this.form.endTime){ |
| | | params['endTime'] = this.form.endTime |
| | | if (this.form.endTime) { |
| | | params['endTime'] = this.form.endTime; |
| | | } |
| | | this.loading=true |
| | | this.$http.get('/dust/analysisdata',{params:params}) |
| | | .then(response => { |
| | | this.chartData = response.data.data |
| | | console.log('åææ°æ®ä¸ºï¼',this.chartData); |
| | | this.loading=false |
| | | if(response.data.data.length==0){ |
| | | alert('è¯¥æ¶æ®µæ æ°æ®') |
| | | this.isNoData = true |
| | | return |
| | | } |
| | | // ç§»é¤ç©ºæ°æ®ç¶æ |
| | | this.isNoData = false |
| | | this.drawChart() |
| | | }) |
| | | }, |
| | | // æçº¿å¾é
置项 |
| | | drawChart() { |
| | | if(this.chartData.length!=0){ |
| | | let xdate=[] |
| | | let ydata=[] |
| | | this.chartData.map(item=>{ |
| | | xdate.push(item['lst']) |
| | | ydata.push(item['dayAvg']) |
| | | }) |
| | | console.log('é
置项为ï¼',xdate,ydata); |
| | | this.option ={ |
| | | xAxis: { |
| | | name: 'æ¶é´', |
| | | data: xdate |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | show: true, |
| | | interval: 'auto' |
| | | }, |
| | | name: 'é¢ç²ç©æµåº¦' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'fume', |
| | | type: 'line', |
| | | data: ydata |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | this.loading = true; |
| | | exceptionApi |
| | | .analysisdata(this.form.name, this.form.beginTime, this.form.endTime) |
| | | .then((response) => { |
| | | this.chartData = response.data.data; |
| | | this.loading = false; |
| | | if (response.data.data.length == 0) { |
| | | this.isNoData = true; |
| | | return; |
| | | } |
| | | // ç§»é¤ç©ºæ°æ®ç¶æ |
| | | this.isNoData = false; |
| | | this.setChart(); |
| | | }); |
| | | }, |
| | | |
| | | // éæ©å
¶ä»å¼ç±»åæ¶ |
| | | setChart(){ |
| | | if(this.chartData.length){ |
| | | if (this.radio == 1) { |
| | | setChart() { |
| | | if (this.chartData.length) { |
| | | // xè½´æ¥ææ¶é´ |
| | | let dateList = []; |
| | | //é¢ç²ç©å¹³åæµåº¦ |
| | | let dayAvg = []; |
| | | this.chartData.forEach(item => { |
| | | let dataOnline = []; |
| | | let dataValid = []; |
| | | let dataExceed = []; |
| | | this.chartData.forEach((item) => { |
| | | //xè½´æ¥æ |
| | | dateList.push(item.lst); |
| | | // å岿²¹çæµåº¦ |
| | | dayAvg.push(item.dayAvg); |
| | | }) |
| | | this.option={} |
| | | this.option = { |
| | | xAxis: { |
| | | name: 'æ¶é´', |
| | | data: dateList, |
| | | }, |
| | | dataOnline.push(item.dayOnline.slice(0, -1)); |
| | | dataValid.push(item.dayValid.slice(0, -1)); |
| | | dataExceed.push(item.dayExceeding.slice(0, -1)); |
| | | }); |
| | | |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | show: true, |
| | | interval: 'auto' |
| | | }, |
| | | name: 'mg/m³' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'é¢ç²ç©æµåº¦', |
| | | type: 'line', |
| | | data: dayAvg |
| | | } |
| | | ] |
| | | } |
| | | this.chartData1 = { |
| | | x: dateList, |
| | | y: dayAvg |
| | | }; |
| | | this.chartData2 = { |
| | | x: dateList, |
| | | y: dataOnline |
| | | }; |
| | | this.chartData3 = { |
| | | x: dateList, |
| | | y: dataValid |
| | | }; |
| | | this.chartData4 = { |
| | | x: dateList, |
| | | y: dataExceed |
| | | }; |
| | | } |
| | | else if (this.radio == 2) { |
| | | // xè½´æ¥ææ¶é´ |
| | | let dateList = []; |
| | | // åå²é£æºçµ |
| | | let dataOnline = []; |
| | | let dataValid = []; |
| | | let dataExceed = []; |
| | | this.chartData.forEach(item => { |
| | | //xè½´æ¥æ |
| | | dateList.push(item.lst); |
| | | // åå²é£æºçµ |
| | | dataOnline.push(item.dayOnline.slice(0,-1)); |
| | | dataValid.push(item.dayValid.slice(0,-1)); |
| | | dataExceed.push(item.dayExceeding.slice(0,-1)); |
| | | }) |
| | | this.option={} |
| | | this.option = { |
| | | legend: { |
| | | data: ['æ¥æ°æ®å¨çº¿ç','æ¥æ°æ®ææç','æ¥æ°æ®è¶
æ ç'] |
| | | }, |
| | | xAxis: { |
| | | data: dateList, |
| | | name: 'æ¶é´' |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | show: true, |
| | | interval: 'auto' |
| | | }, |
| | | name: '%' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'æ¥æ°æ®å¨çº¿ç', |
| | | type: 'line', |
| | | data: dataOnline |
| | | }, |
| | | { |
| | | name: 'æ¥æ°æ®ææç', |
| | | type: 'line', |
| | | data: dataValid |
| | | }, |
| | | { |
| | | name: 'æ¥æ°æ®è¶
æ ç', |
| | | type: 'line', |
| | | data: dataExceed |
| | | }, |
| | | }, |
| | | |
| | | ] |
| | | } |
| | | } |
| | | // ä¼ä¸å¼å¸¸è¯¦æ
|
| | | exceptiondataCount() { |
| | | exceptionApi |
| | | .exceptiondata1({ |
| | | siteName: this.form.name, |
| | | beginTime: this.form.beginTime, |
| | | endTime: this.form.endTime |
| | | }) |
| | | .then((res) => { |
| | | // ææå¼å¸¸ |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <template> |
| | | <div class="search-container"> |
| | | <el-container> |
| | | <el-main> |
| | | |
| | | <el-form :inline="true" :model="form" class="demo-form-inline"> |
| | | <el-form :inline="true" :model="form"> |
| | | <el-form-item> |
| | | <AreaAndmonitorType ></AreaAndmonitorType> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <InputSearch :isNeedDefaultSite="1" @submit-value="(n) => (form.name = n)"></InputSearch> |
| | | <AreaAndmonitorType></AreaAndmonitorType> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <TimeSelectWithShortCuts @submit-time="giveTime"></TimeSelectWithShortCuts> |
| | | <InputSearch |
| | | :isNeedDefaultSite="1" |
| | | @submit-value="(n) => (form.name = n)" |
| | | ></InputSearch> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <TimeSelectWithShortCuts |
| | | @submit-time="giveTime" |
| | | ></TimeSelectWithShortCuts> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button type="primary" @click="fetchData">å±ç¤ºæçº¿å¾</el-button> |
| | | <el-button type="primary" @click="fetch">å±ç¤ºæçº¿å¾</el-button> |
| | | </el-form-item> |
| | | |
| | | <div> |
| | | <el-form-item> |
| | | <el-radio-group v-model="radio" @change="setChart"> |
| | | <el-radio :label="1">é¢ç²ç©æµåº¦å¹³åå¼</el-radio> |
| | | <el-radio :label="2">æ°æ®å¨çº¿/ææ/è¶
æ ç</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </div> |
| | | <!-- <div> |
| | | <el-form-item> |
| | | <el-radio-group v-model="radio" @change="setChart"> |
| | | <el-radio :label="1">é¢ç²ç©æµåº¦å¹³åå¼</el-radio> |
| | | <el-radio :label="2">æ°æ®å¨çº¿/ææ/è¶
æ ç</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </div> --> |
| | | </el-form> |
| | | |
| | | <div>æ°æ®ç»è®¡æ¶æ®µï¼å®é
è·åæ°æ®çæ¶æ®µ</div> |
| | | <el-card> å¼å¸¸æ°éç»è®¡ </el-card> |
| | | <el-card> è¶
æ å¤ç°ç </el-card> |
| | | <el-card> |
| | | <el-empty v-show="isNoData" :image-size="200" /> |
| | | <LineChart :chartData="option"> </LineChart> |
| | | <LineChart |
| | | title="æ¥åå¼" |
| | | :chartData="chartData1" |
| | | yName="æµåº¦" |
| | | seriesName="æ¥åå¼" |
| | | > |
| | | </LineChart> |
| | | <LineChart |
| | | title="æ¥å¨çº¿ç" |
| | | :chartData="chartData2" |
| | | yName="ç¾åæ¯" |
| | | seriesName="æ¥å¨çº¿ç" |
| | | > |
| | | </LineChart> |
| | | <LineChart |
| | | title="æ¥ææç" |
| | | :chartData="chartData3" |
| | | yName="ç¾åæ¯" |
| | | seriesName="æ¥ææç" |
| | | > |
| | | </LineChart> |
| | | <LineChart |
| | | title="æ¥è¶
æ ç" |
| | | :chartData="chartData4" |
| | | yName="ç¾åæ¯" |
| | | seriesName="æ¥è¶
æ ç" |
| | | > |
| | | </LineChart> |
| | | <DustRadarChart></DustRadarChart> |
| | | </el-card> |
| | | |
| | | |
| | | </el-main> |
| | | </el-container> |
| | | </div> |
| | |
| | | color: #333; |
| | | line-height: 60px; |
| | | } |
| | | |
| | | </style> |