| | |
| | | // 定义接口来定义对象的类型 |
| | | interface stateType { |
| | | tableData: [], |
| | | departmentList: [], |
| | | hotCount: [], |
| | | confinedSpaceCount: [], |
| | | liftingCount: [], |
| | | groundBreakingCount: [], |
| | | openCircuitCout: [], |
| | | heightCount: [], |
| | | temporaryPowerCount: [], |
| | | blindPlatePluggingCount: [], |
| | | departmentList: Array<any>, |
| | | hotCount: Array<any>, |
| | | confinedSpaceCount: Array<any>, |
| | | liftingCount: Array<any>, |
| | | groundBreakingCount: Array<any>, |
| | | openCircuitCout: Array<any>, |
| | | heightCount: Array<any>, |
| | | temporaryPowerCount: Array<any>, |
| | | blindPlatePluggingCount: Array<any>, |
| | | searchDates: Array<any>, |
| | | startTime: String, |
| | | endTime: String |
| | |
| | | heightCount: [], |
| | | temporaryPowerCount: [], |
| | | blindPlatePluggingCount: [], |
| | | searchDates: '', |
| | | searchDates: [], |
| | | startTime: '', |
| | | endTime: '' |
| | | }); |
| | |
| | | }, |
| | | }, |
| | | ] |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getListByPage() |
| | |
| | | |
| | | // 获取列表 |
| | | const getListByPage = async () => { |
| | | console.log(state.searchDates) |
| | | const data = { startTime: state.searchDates[0], endTime: state.searchDates[1] }; |
| | | let res = await workAppointApi().getAllRecords(data); |
| | | if (res.data.code === '200') { |
| | |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '暂无数据' |
| | | message: '该时段暂无数据' |
| | | }); |
| | | } |
| | | } else { |
| | |
| | | let dom = document.getElementById(chartName.value); |
| | | let myChart = echarts.init(dom); |
| | | |
| | | type EChartsOption = echarts.EChartsOption |
| | | let option: EChartsOption; |
| | | |
| | | option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | // axisPointer: { |
| | | // type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow' |
| | | // }, |
| | | axisPointer: { |
| | | type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow' |
| | | } |
| | | type: "cross", |
| | | label: { |
| | | formatter: function (params) { |
| | | if (params.seriesData.length === 0) { |
| | | window.mouseCurValue = params.value; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | formatter: function (params) { |
| | | let res = "", sum = 0; |
| | | for (let i = 0; i < params.length; i++) { |
| | | let series = params[i]; |
| | | sum += Number(series.data); |
| | | if (sum >= window.mouseCurValue) { |
| | | res = series.axisValue + "<br/>" + series.marker + series.seriesName + ":" + series.data + "<br/>"; |
| | | break; |
| | | } |
| | | } |
| | | return res; |
| | | }, |
| | | }, |
| | | legend: {}, |
| | | grid: { |