1.完成生产管理-电量分析静态界面
2.完成综合管理-人员排班管理交互 3.修改部分逻辑和样式
This commit is contained in:
@ -1,43 +1,45 @@
|
||||
<template>
|
||||
<div class="tongbifenxi-line-container">
|
||||
<div id="tongbifenxiLineChart" class="chart-container"></div>
|
||||
<div class="title">
|
||||
<TitleComponent title="发电量同比分析" :font-level="2" />
|
||||
<el-select placeholder="请选择线路" style="width: 150px;">
|
||||
<el-option label="A线路" value="all"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div ref="chartDomRef" class="chart-container"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onBeforeUnmount, ref } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import TitleComponent from '@/components/TitleComponent/index.vue';
|
||||
|
||||
const chartDomRef = ref<HTMLElement | null>(null);
|
||||
const chartInstance = ref<echarts.ECharts | null>(null);
|
||||
|
||||
const initChart = () => {
|
||||
const chartDom = document.getElementById('tongbifenxiLineChart');
|
||||
if (!chartDom) return;
|
||||
if (!chartDomRef.value) return;
|
||||
|
||||
chartInstance.value = echarts.init(chartDom);
|
||||
chartInstance.value = echarts.init(chartDomRef.value);
|
||||
|
||||
// 写死的数据
|
||||
const dates = ['1号', '2号', '3号', '4号', '5号', '6号', '7号'];
|
||||
const growthRates = ['1.50', '1.20', '0.50', '0.80', '0.90', '0.30', '-2.00'];
|
||||
const growthRates = [1.50, 1.20, 0.50, 0.80, 0.90, 0.30, -2.00];
|
||||
|
||||
const option: echarts.EChartsOption = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
||||
borderColor: '#409eff',
|
||||
trigger: 'item',
|
||||
backgroundColor: '#67c23a',
|
||||
borderWidth: 0,
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
color: '#fff',
|
||||
fontSize: 14
|
||||
},
|
||||
formatter: (params: any) => {
|
||||
const data = params[0];
|
||||
return `${data.name}:\n环比增长率: ${data.value}%`;
|
||||
return `${params.name}:\n环比增长率:${params.value}%`;
|
||||
},
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
padding: [10, 15]
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
@ -51,7 +53,7 @@ const initChart = () => {
|
||||
boundaryGap: false,
|
||||
data: dates,
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
@ -90,7 +92,6 @@ const initChart = () => {
|
||||
{
|
||||
name: '环比增长率',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
@ -103,9 +104,6 @@ const initChart = () => {
|
||||
}
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
lineStyle: {
|
||||
color: '#67c23a',
|
||||
width: 3
|
||||
@ -117,6 +115,17 @@ const initChart = () => {
|
||||
borderColor: '#fff',
|
||||
borderWidth: 2
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series',
|
||||
itemStyle: {
|
||||
color: '#67c23a',
|
||||
borderColor: '#fff',
|
||||
borderWidth: 3,
|
||||
shadowBlur: 10,
|
||||
shadowColor: 'rgba(103, 194, 58, 0.5)'
|
||||
},
|
||||
|
||||
},
|
||||
data: growthRates,
|
||||
smooth: true
|
||||
}
|
||||
@ -149,8 +158,14 @@ onBeforeUnmount(() => {
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.chart-container {
|
||||
|
||||
Reference in New Issue
Block a user