| | |
| | | <template> |
| | | <CommonTitle title="事件概况" /> |
| | | <CommonTitle title="事件概况" @Details="details"/> |
| | | <div :style="{ marginLeft: pxToRem(14) }"> |
| | | <div class="eventOverview"> |
| | | <div class="overviewData"> |
| | |
| | | import { getJobEventBrokerLine, getJobEventByStatus, getJobEventTotal } from '@/api/home'; |
| | | import dayjs from 'dayjs'; |
| | | import { selectDevicePage } from '@/api/home/machineNest'; |
| | | import { useStore } from 'vuex' |
| | | |
| | | const echartsOption = { |
| | | tooltip: { |
| | |
| | | start_date: undefined, |
| | | }); |
| | | |
| | | const store = useStore() |
| | | const details = () =>{ |
| | | store.commit('setIsEventOverviewDetail',true) |
| | | } |
| | | |
| | | // 远程查询 |
| | | const remoteMethod = nickname => { |
| | | devicePageParams.value.nickname = nickname; |
| | |
| | | getJobEventBrokerLine(params.value).then(res => { |
| | | const list = res?.data?.data || []; |
| | | echartsOption.xAxis.data = list.map(item => item.name); |
| | | // 赋值前清空数据 |
| | | Object.keys(seriesObj).forEach(key => {seriesObj[key].data = []}) |
| | | list.forEach(item => { |
| | | item.data.forEach((item1, index) => { |
| | | seriesObj[item1.status].data.push(item1.value); |
| | |
| | | |
| | | onMounted(() => { |
| | | chart = echarts.init(echartsRef.value); |
| | | window.addEventListener('resize', () => { |
| | | chart.resize(); |
| | | }); |
| | | window.addEventListener('resize', chart.resize); |
| | | getJobEventTotal().then(res => { |
| | | eventTotal.value = res?.data?.data || 0; |
| | | }); |