{"ast":null,"code":"import \"core-js/modules/es.iterator.constructor.js\";\nimport \"core-js/modules/es.iterator.map.js\";\nimport * as echarts from 'echarts';\nimport { getPersonStats } from '@/api';\nexport default {\n name: 'PersonStats',\n data() {\n return {\n todayTotal: [0, 0, 0, 0, 0],\n currentLab: [0, 0, 0, 0],\n chart: null\n };\n },\n async mounted() {\n const res = await getPersonStats();\n this.todayTotal = res.data.todayTotal;\n this.currentLab = res.data.currentLab;\n this.$nextTick(() => this.initChart(res.data.hourlyData));\n },\n beforeDestroy() {\n if (this.chart) this.chart.dispose();\n },\n methods: {\n initChart(data) {\n this.chart = echarts.init(this.$refs.chart);\n const option = {\n tooltip: {\n trigger: 'axis',\n backgroundColor: 'rgba(13,34,71,0.9)',\n borderColor: '#1a3a6a',\n textStyle: {\n color: '#fff',\n fontSize: 12\n }\n },\n legend: {\n top: 0,\n right: 0,\n textStyle: {\n color: '#8cb8e6',\n fontSize: 11\n },\n itemWidth: 16,\n itemHeight: 2,\n itemGap: 16\n },\n grid: {\n left: 36,\n right: 12,\n top: 28,\n bottom: 22\n },\n xAxis: {\n type: 'category',\n data: data.map(d => d.hour),\n boundaryGap: false,\n axisLine: {\n lineStyle: {\n color: '#1a3a6a'\n }\n },\n axisLabel: {\n color: '#5a7da8',\n fontSize: 10\n },\n axisTick: {\n show: false\n }\n },\n yAxis: {\n type: 'value',\n max: 150,\n interval: 30,\n splitLine: {\n lineStyle: {\n color: 'rgba(26,58,106,0.3)',\n type: 'dashed'\n }\n },\n axisLine: {\n show: false\n },\n axisLabel: {\n color: '#5a7da8',\n fontSize: 11\n },\n axisTick: {\n show: false\n }\n },\n series: [{\n name: '进入人数',\n type: 'line',\n smooth: true,\n symbol: 'none',\n lineStyle: {\n color: '#2196f3',\n width: 2\n },\n areaStyle: {\n color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{\n offset: 0,\n color: 'rgba(33,150,243,0.25)'\n }, {\n offset: 1,\n color: 'rgba(33,150,243,0.02)'\n }])\n },\n data: data.map(d => d.enter)\n }, {\n name: '实验人数',\n type: 'line',\n smooth: true,\n symbol: 'none',\n lineStyle: {\n color: '#00e5ff',\n width: 2\n },\n areaStyle: {\n color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{\n offset: 0,\n color: 'rgba(0,229,255,0.15)'\n }, {\n offset: 1,\n color: 'rgba(0,229,255,0.02)'\n }])\n },\n data: data.map(d => d.lab)\n }]\n };\n this.chart.setOption(option);\n }\n }\n};","map":{"version":3,"names":["echarts","getPersonStats","name","data","todayTotal","currentLab","chart","mounted","res","$nextTick","initChart","hourlyData","beforeDestroy","dispose","methods","init","$refs","option","tooltip","trigger","backgroundColor","borderColor","textStyle","color","fontSize","legend","top","right","itemWidth","itemHeight","itemGap","grid","left","bottom","xAxis","type","map","d","hour","boundaryGap","axisLine","lineStyle","axisLabel","axisTick","show","yAxis","max","interval","splitLine","series","smooth","symbol","width","areaStyle","graphic","LinearGradient","offset","enter","lab","setOption"],"sources":["src/components/LabStats/PersonStats.vue"],"sourcesContent":["\n \n\n\n\n\n\n"],"mappings":";;AA4BA,YAAAA,OAAA;AACA,SAAAC,cAAA;AAEA;EACAC,IAAA;EACAC,KAAA;IACA;MACAC,UAAA;MACAC,UAAA;MACAC,KAAA;IACA;EACA;EACA,MAAAC,QAAA;IACA,MAAAC,GAAA,SAAAP,cAAA;IACA,KAAAG,UAAA,GAAAI,GAAA,CAAAL,IAAA,CAAAC,UAAA;IACA,KAAAC,UAAA,GAAAG,GAAA,CAAAL,IAAA,CAAAE,UAAA;IACA,KAAAI,SAAA,YAAAC,SAAA,CAAAF,GAAA,CAAAL,IAAA,CAAAQ,UAAA;EACA;EACAC,cAAA;IACA,SAAAN,KAAA,OAAAA,KAAA,CAAAO,OAAA;EACA;EACAC,OAAA;IACAJ,UAAAP,IAAA;MACA,KAAAG,KAAA,GAAAN,OAAA,CAAAe,IAAA,MAAAC,KAAA,CAAAV,KAAA;MACA,MAAAW,MAAA;QACAC,OAAA;UACAC,OAAA;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