From 77f7281ff7cee541aaa51339512e6443b7d89e42 Mon Sep 17 00:00:00 2001 From: YANGDL <114714267@qq.com> Date: 星期二, 05 一月 2021 12:04:25 +0800 Subject: [PATCH] 修改eslint配置增加mock配置 --- src/components/mapmodules/SafetyIndexLine.js | 188 +++++++++++++++++++++++----------------------- 1 files changed, 95 insertions(+), 93 deletions(-) diff --git a/src/components/mapmodules/SafetyIndexLine.js b/src/components/mapmodules/SafetyIndexLine.js index 9706043..1c0c912 100644 --- a/src/components/mapmodules/SafetyIndexLine.js +++ b/src/components/mapmodules/SafetyIndexLine.js @@ -1,107 +1,109 @@ import echarts from 'echarts' import dayjs from 'dayjs' -function drawSafetyLine() { - let myChart = echarts.init(document.getElementById('safetyIndex')) - let yyyy = dayjs().format('YYYY') + '-' - let resDate = ['07-10', '07-11', '07-12', '07-13', '07-14', '07-15', '07-16'] - let resValue = [35, 20, 10, 20, 40, 30, 10] - let safetyStandardValue = 20 - myChart.setOption({ - tooltip: { - trigger: 'axis', - formatter: '<span style="text-align: center;display:block; color: #33FF90">' + yyyy + '{b0}</span>' + +function drawSafetyLine () { + const myChart = echarts.init(document.getElementById('safetyIndex')) + const yyyy = dayjs().format('YYYY') + '-' + const resDate = ['07-10', '07-11', '07-12', '07-13', '07-14', '07-15', '07-16'] + const resValue = [35, 20, 10, 20, 40, 30, 10] + const safetyStandardValue = 20 + myChart.setOption({ + tooltip: { + trigger: 'axis', + formatter: '<span style="text-align: center;display:block; color: #33FF90">' + yyyy + '{b0}</span>' + '<span style="color: #33FF90">{a0}锛歿c0}</span><br/>' + '<span style="color: #33FF90">瀹夊叏鏍囧噯鎸囨暟锛�' + safetyStandardValue + '</span>', // 鑷畾涔塼ip鏍煎紡 - backgroundColor: 'rgba(73,177,231, 0.1)', - axisPointer: { - lineStyle: { - color: 'rgba(73,177,231, 0.5)', - type: 'dashed' - } + backgroundColor: 'rgba(73,177,231, 0.1)', + axisPointer: { + lineStyle: { + color: 'rgba(73,177,231, 0.5)', + type: 'dashed' + } + } + }, + grid: { + left: '4%', + right: '10%', + bottom: '3%', + containLabel: true + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: resDate, + axisLine: { + show: false, + lineStyle: { + color: '#33FFF8' + } + }, + axisTick: { // x杞村埢搴︾嚎 + show: false + } + }, + yAxis: { + type: 'value', + splitLine: { + lineStyle: { + type: 'dotted', // 璁剧疆缃戞牸绾跨被鍨� dotted:铏氱嚎 solid:瀹炵嚎 + color: 'rgb(73,177,231, 0.3)' + }, + show: true + }, + axisLine: { + show: false, + lineStyle: { + color: '#33FFF8' + } + }, + axisTick: { // y杞村埢搴︾嚎 + show: false + }, + nameTextStyle: { + lineHeight: 20 + } + }, + series: [ + { + name: '瀹夊叏鎸囨暟', + type: 'line', + data: resValue, + itemStyle: { + normal: { + lineStyle: { + color: 'rgb(233,209,74)', + width: 2 // 璁剧疆绾挎潯绮楃粏 } + } }, - grid: { - left: '4%', - right: '10%', - bottom: '3%', - containLabel: true - }, - xAxis: { - type: 'category', - boundaryGap: false, - data: resDate, - axisLine: { - show: false, - lineStyle: { - color: '#33FFF8' - } - }, - axisTick: { // x杞村埢搴︾嚎 - show: false - } - }, - yAxis: { - type: 'value', - splitLine: { - lineStyle: { - type: 'dotted', // 璁剧疆缃戞牸绾跨被鍨� dotted:铏氱嚎 solid:瀹炵嚎 - color: 'rgb(73,177,231, 0.3)' - }, - show: true - }, - axisLine: { - show: false, - lineStyle: { - color: '#33FFF8' - } - }, - axisTick: { // y杞村埢搴︾嚎 - show: false - }, - nameTextStyle: { - lineHeight: 20 - } - }, - series: [ + markLine: { + symbol: 'none', // 鍘绘帀鏍囧噯绾跨澶� + data: [ { - name: '瀹夊叏鎸囨暟', - type: 'line', - data: resValue, - itemStyle: { - normal: { - lineStyle: { - color: 'rgb(233,209,74)', - width: 2 // 璁剧疆绾挎潯绮楃粏 - } - } - }, - markLine: { - symbol: 'none', // 鍘绘帀鏍囧噯绾跨澶� - data: [ - { - label: { - normal: { - position: 'end', - formatter: '' - } - }, - name: '鏍囧噯鍊�', - yAxis: 20, - lineStyle: { - type: 'solid', - color: '#33FFF8', - width: 1 - } - } - ] + label: { + normal: { + position: 'end', + formatter: '' } + }, + name: '鏍囧噯鍊�', + yAxis: 20, + lineStyle: { + type: 'solid', + color: '#33FFF8', + width: 1 + } } - ] - }) - window.addEventListener('resize', () => { myChart.resize() }) + ] + } + } + ] + }) + window.addEventListener('resize', () => { + myChart.resize() + }) } export default { - drawSafetyLine + drawSafetyLine } -- Gitblit v1.8.0