From 0dac7ba33f77342d2a9a1392c820d10d3b72d76c Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期三, 28 九月 2022 16:02:47 +0800 Subject: [PATCH] '修改' --- src/views/specialWorkSystem/workPlan/reserveSum/index.vue | 53 ++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 38 insertions(+), 15 deletions(-) diff --git a/src/views/specialWorkSystem/workPlan/reserveSum/index.vue b/src/views/specialWorkSystem/workPlan/reserveSum/index.vue index 8002cd6..32f8d2b 100644 --- a/src/views/specialWorkSystem/workPlan/reserveSum/index.vue +++ b/src/views/specialWorkSystem/workPlan/reserveSum/index.vue @@ -42,15 +42,15 @@ // 定义接口来定义对象的类型 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 @@ -73,7 +73,7 @@ heightCount: [], temporaryPowerCount: [], blindPlatePluggingCount: [], - searchDates: '', + searchDates: [], startTime: '', endTime: '' }); @@ -107,6 +107,7 @@ }, }, ] + // 页面载入时执行方法 onMounted(() => { getListByPage() @@ -115,7 +116,6 @@ // 获取列表 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') { @@ -134,7 +134,7 @@ }else{ ElMessage({ type: 'warning', - message: '暂无数据' + message: '该时段暂无数据' }); } } else { @@ -149,19 +149,42 @@ 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: { left: '3%', - right: '4%', + right: '3%', bottom: '3%', containLabel: true }, -- Gitblit v1.9.2