|
@@ -136,7 +136,7 @@
|
|
<span class="text-base font-medium text-gray-600">故障上报状态统计</span>
|
|
<span class="text-base font-medium text-gray-600">故障上报状态统计</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
- <el-row class="h-[240px]">
|
|
|
|
|
|
+ <el-row class="h-[220px]">
|
|
<el-col :span="6" class="flex flex-col items-center">
|
|
<el-col :span="6" class="flex flex-col items-center">
|
|
<div ref="reportingChartRef" class="h-[160px] w-full"></div>
|
|
<div ref="reportingChartRef" class="h-[160px] w-full"></div>
|
|
<div class="text-center mt-2">
|
|
<div class="text-center mt-2">
|
|
@@ -171,7 +171,7 @@
|
|
<span class="text-base font-medium text-gray-600">维修工单状态统计</span>
|
|
<span class="text-base font-medium text-gray-600">维修工单状态统计</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
- <el-row class="h-[240px]">
|
|
|
|
|
|
+ <el-row class="h-[220px]">
|
|
<el-col :span="12" class="flex flex-col items-center">
|
|
<el-col :span="12" class="flex flex-col items-center">
|
|
<div ref="writeChartRef" class="h-[160px] w-full"></div>
|
|
<div ref="writeChartRef" class="h-[160px] w-full"></div>
|
|
<div class="text-center mt-2">
|
|
<div class="text-center mt-2">
|
|
@@ -193,7 +193,12 @@
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<el-card class="chart-card" shadow="never">
|
|
<el-card class="chart-card" shadow="never">
|
|
- <div ref="chartContainer" class="chart-container"></div>
|
|
|
|
|
|
+ <template #header>
|
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
|
+ <span class="text-base font-medium text-gray-600">近一年数量统计</span>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <div ref="chartContainer" class="h-[300px]"></div>
|
|
</el-card>
|
|
</el-card>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -203,6 +208,8 @@
|
|
|
|
|
|
<script setup lang="ts" name="Index">
|
|
<script setup lang="ts" name="Index">
|
|
import * as echarts from 'echarts/core'
|
|
import * as echarts from 'echarts/core'
|
|
|
|
+import { BarChart } from 'echarts/charts'; // 显式导入柱状图模块
|
|
|
|
+
|
|
import {
|
|
import {
|
|
GridComponent,
|
|
GridComponent,
|
|
LegendComponent,
|
|
LegendComponent,
|
|
@@ -237,7 +244,8 @@ echarts.use([
|
|
GridComponent,
|
|
GridComponent,
|
|
LineChart,
|
|
LineChart,
|
|
UniversalTransition,
|
|
UniversalTransition,
|
|
- GaugeChart
|
|
|
|
|
|
+ GaugeChart,
|
|
|
|
+ BarChart
|
|
])
|
|
])
|
|
|
|
|
|
const timeRange = ref('7d') // 修改默认选择为近一周
|
|
const timeRange = ref('7d') // 修改默认选择为近一周
|
|
@@ -507,7 +515,7 @@ const initGaugeChart = (el: any, value: number, color: string) => {
|
|
color: color,
|
|
color: color,
|
|
offsetCenter: [0, '0'],
|
|
offsetCenter: [0, '0'],
|
|
formatter: (value: number) => {
|
|
formatter: (value: number) => {
|
|
- return `${value} 个`
|
|
|
|
|
|
+ return `${value} `
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data: [{ value: value }]
|
|
data: [{ value: value }]
|
|
@@ -716,8 +724,7 @@ const initChart = async () => {
|
|
barGap: 0,
|
|
barGap: 0,
|
|
itemStyle: {
|
|
itemStyle: {
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
- { offset: 0, color: '#83bff6' },
|
|
|
|
- { offset: 0.5, color: '#188df0' },
|
|
|
|
|
|
+ { offset: 0, color: '#188df0' },
|
|
{ offset: 1, color: '#188df0' }
|
|
{ offset: 1, color: '#188df0' }
|
|
])
|
|
])
|
|
},
|
|
},
|
|
@@ -731,9 +738,9 @@ const initChart = async () => {
|
|
type: 'bar',
|
|
type: 'bar',
|
|
itemStyle: {
|
|
itemStyle: {
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
- { offset: 0, color: '#37a2da' },
|
|
|
|
- { offset: 0.5, color: '#37a2da' },
|
|
|
|
- { offset: 1, color: '#67e0e3' }
|
|
|
|
|
|
+ { offset: 0, color: '#d3a137' },
|
|
|
|
+
|
|
|
|
+ { offset: 1, color: '#d3a137' }
|
|
])
|
|
])
|
|
},
|
|
},
|
|
emphasis: {
|
|
emphasis: {
|
|
@@ -769,20 +776,4 @@ onUnmounted(() => {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
-.chart-container {
|
|
|
|
- width: 100%;
|
|
|
|
- height: 600px;
|
|
|
|
- margin: 20px auto;
|
|
|
|
- background: #fff;
|
|
|
|
- border-radius: 8px;
|
|
|
|
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
|
|
- padding: 20px;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-@media (max-width: 768px) {
|
|
|
|
- .chart-container {
|
|
|
|
- height: 400px;
|
|
|
|
- padding: 10px;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
</style>
|
|
</style>
|