|
@@ -1,7 +1,8 @@
|
|
<template>
|
|
<template>
|
|
|
|
+ <div class="page-container">
|
|
<el-row :gutter="16" class="summary">
|
|
<el-row :gutter="16" class="summary">
|
|
<!-- 原有的统计卡片部分保持不变 -->
|
|
<!-- 原有的统计卡片部分保持不变 -->
|
|
- <el-col v-loading="loading" :sm="3" :xs="12">
|
|
|
|
|
|
+ <el-col :sm="3" :xs="12">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
:value="device.total || 0"
|
|
:value="device.total || 0"
|
|
icon="fa-solid:project-diagram"
|
|
icon="fa-solid:project-diagram"
|
|
@@ -10,7 +11,7 @@
|
|
title="设备数"
|
|
title="设备数"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col v-loading="loading" :sm="3" :xs="12">
|
|
|
|
|
|
+ <el-col :sm="3" :xs="12">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
:value="maintain.total || 0"
|
|
:value="maintain.total || 0"
|
|
icon="fa-solid:list"
|
|
icon="fa-solid:list"
|
|
@@ -19,7 +20,7 @@
|
|
title="维修工单"
|
|
title="维修工单"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col v-loading="loading" :sm="3" :xs="12">
|
|
|
|
|
|
+ <el-col :sm="3" :xs="12">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
:value="fill.unfilledCount || 0"
|
|
:value="fill.unfilledCount || 0"
|
|
icon="fa-solid:times-circle"
|
|
icon="fa-solid:times-circle"
|
|
@@ -28,7 +29,7 @@
|
|
title="运行未填写"
|
|
title="运行未填写"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col v-loading="loading" :sm="3" :xs="12">
|
|
|
|
|
|
+ <el-col :sm="3" :xs="12">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
:value="fill.filledCount || 0"
|
|
:value="fill.filledCount || 0"
|
|
icon="fa-solid:award"
|
|
icon="fa-solid:award"
|
|
@@ -37,7 +38,7 @@
|
|
title="运行已填写"
|
|
title="运行已填写"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col v-loading="loading" :sm="3" :xs="12">
|
|
|
|
|
|
+ <el-col :sm="3" :xs="12">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
:value="by.todo || 0"
|
|
:value="by.todo || 0"
|
|
icon="fa-solid:times-circle"
|
|
icon="fa-solid:times-circle"
|
|
@@ -46,7 +47,7 @@
|
|
title="未执行保养"
|
|
title="未执行保养"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col v-loading="loading" :sm="3" :xs="12">
|
|
|
|
|
|
+ <el-col :sm="3" :xs="12">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
:value="by.finished || 0"
|
|
:value="by.finished || 0"
|
|
icon="fa-solid:award"
|
|
icon="fa-solid:award"
|
|
@@ -55,7 +56,7 @@
|
|
title="已执行保养"
|
|
title="已执行保养"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col v-loading="loading" :sm="3" :xs="12">
|
|
|
|
|
|
+ <el-col :sm="3" :xs="12">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
:value="inspectt.todo || 0"
|
|
:value="inspectt.todo || 0"
|
|
icon="fa-solid:times-circle"
|
|
icon="fa-solid:times-circle"
|
|
@@ -64,7 +65,7 @@
|
|
title="待填写巡检"
|
|
title="待填写巡检"
|
|
/>
|
|
/>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col v-loading="loading" :sm="3" :xs="12">
|
|
|
|
|
|
+ <el-col :sm="3" :xs="12">
|
|
<SummaryCard
|
|
<SummaryCard
|
|
:value="inspectt.finished || 0"
|
|
:value="inspectt.finished || 0"
|
|
icon="fa-solid:award"
|
|
icon="fa-solid:award"
|
|
@@ -81,7 +82,7 @@
|
|
<el-card class="chart-card" shadow="never">
|
|
<el-card class="chart-card" shadow="never">
|
|
<template #header>
|
|
<template #header>
|
|
<div class="flex items-center">
|
|
<div class="flex items-center">
|
|
- <span class="text-base font-medium text-gray-600">设备状态统计</span>
|
|
|
|
|
|
+ <span class="text-base font-medium " style="color: #b6c8da">设备状态统计</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<div ref="statusChartRef" class="h-[290px]"></div>
|
|
<div ref="statusChartRef" class="h-[290px]"></div>
|
|
@@ -91,7 +92,7 @@
|
|
<el-card class="chart-card" shadow="never" >
|
|
<el-card class="chart-card" shadow="never" >
|
|
<template #header>
|
|
<template #header>
|
|
<div class="flex items-center">
|
|
<div class="flex items-center">
|
|
- <span class="text-base font-medium text-gray-600">设备类别TOP数量</span>
|
|
|
|
|
|
+ <span class="text-base font-medium " style="color: #b6c8da">设备类别TOP数量</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<div ref="topContainer" class="h-[290px]"></div>
|
|
<div ref="topContainer" class="h-[290px]"></div>
|
|
@@ -101,7 +102,7 @@
|
|
<el-card class="chart-card" shadow="never">
|
|
<el-card class="chart-card" shadow="never">
|
|
<template #header>
|
|
<template #header>
|
|
<div class="flex items-center justify-between">
|
|
<div class="flex items-center justify-between">
|
|
- <span class="text-base font-medium text-gray-600">当日运维成本</span>
|
|
|
|
|
|
+ <span class="text-base font-medium " style="color: #b6c8da">当日运维成本</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<div ref="chartContainer" class="h-[290px]"></div>
|
|
<div ref="chartContainer" class="h-[290px]"></div>
|
|
@@ -115,7 +116,7 @@
|
|
<el-card class="chart-card" shadow="never">
|
|
<el-card class="chart-card" shadow="never">
|
|
<template #header>
|
|
<template #header>
|
|
<div class="flex items-center">
|
|
<div class="flex items-center">
|
|
- <span class="text-base font-medium text-gray-600">近7天物料消耗TOP5</span>
|
|
|
|
|
|
+ <span class="text-base font-medium " style="color: #b6c8da">近7天物料消耗TOP5</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<div ref="materialChartRef" class="h-[320px]"></div>
|
|
<div ref="materialChartRef" class="h-[320px]"></div>
|
|
@@ -125,7 +126,7 @@
|
|
<el-card class="chart-card" shadow="never">
|
|
<el-card class="chart-card" shadow="never">
|
|
<template #header>
|
|
<template #header>
|
|
<div class="flex items-center justify-between">
|
|
<div class="flex items-center justify-between">
|
|
- <span class="text-base font-medium text-gray-600">工单数量情况</span>
|
|
|
|
|
|
+ <span class="text-base font-medium " style="color: #b6c8da">工单数量情况</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<div ref="qxRef" class="h-[320px]"></div>
|
|
<div ref="qxRef" class="h-[320px]"></div>
|
|
@@ -137,7 +138,7 @@
|
|
<el-card class="chart-card" shadow="never">
|
|
<el-card class="chart-card" shadow="never">
|
|
<template #header>
|
|
<template #header>
|
|
<div class="flex items-center justify-between">
|
|
<div class="flex items-center justify-between">
|
|
- <span class="text-base font-medium text-gray-600">累计注气量统计(m³)</span>
|
|
|
|
|
|
+ <span class="text-base font-medium " style="color: #b6c8da">累计注气量统计(m³)</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<div ref="zqlChartRef" class="h-[300px]"></div>
|
|
<div ref="zqlChartRef" class="h-[300px]"></div>
|
|
@@ -147,14 +148,14 @@
|
|
<el-card class="chart-card" shadow="never">
|
|
<el-card class="chart-card" shadow="never">
|
|
<template #header>
|
|
<template #header>
|
|
<div class="flex items-center justify-between">
|
|
<div class="flex items-center justify-between">
|
|
- <span class="text-base font-medium text-gray-600">当日注气量统计(m³)</span>
|
|
|
|
|
|
+ <span class="text-base font-medium " style="color: #b6c8da">当日注气量统计(m³)</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<div ref="todayZqlRef" class="h-[300px]"></div>
|
|
<div ref="todayZqlRef" class="h-[300px]"></div>
|
|
</el-card>
|
|
</el-card>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- <!-- TODO 第四行:地图 -->
|
|
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="Index">
|
|
<script setup lang="ts" name="Index">
|
|
@@ -191,7 +192,6 @@ echarts.use([
|
|
BarChart
|
|
BarChart
|
|
])
|
|
])
|
|
|
|
|
|
-const dateRange = ref<[Date, Date] | null>(null)
|
|
|
|
|
|
|
|
const by = ref({
|
|
const by = ref({
|
|
todo: undefined,
|
|
todo: undefined,
|
|
@@ -205,10 +205,6 @@ const inspectt = ref({
|
|
finished: 0,
|
|
finished: 0,
|
|
todo: 0
|
|
todo: 0
|
|
})
|
|
})
|
|
-const queryParams = reactive({
|
|
|
|
- startTime: Date.now() - 7 * 24 * 60 * 60 * 1000, // 设置默认开始时间为 7 天前
|
|
|
|
- endTime: Date.now() // 设置默认结束时间为当前时间
|
|
|
|
-})
|
|
|
|
const backendData = ref([])
|
|
const backendData = ref([])
|
|
const statusChartRef = ref() // 设备数量统计的图表
|
|
const statusChartRef = ref() // 设备数量统计的图表
|
|
const materialChartRef = ref() // 设备数量统计的图表
|
|
const materialChartRef = ref() // 设备数量统计的图表
|
|
@@ -245,7 +241,6 @@ const materialData = ref({})
|
|
const orderSevenData = ref({})
|
|
const orderSevenData = ref({})
|
|
const zqlData = ref({})
|
|
const zqlData = ref({})
|
|
const zqlTodayData = ref({})
|
|
const zqlTodayData = ref({})
|
|
-const safe = ref()
|
|
|
|
/** 获取统计数据 */
|
|
/** 获取统计数据 */
|
|
const getStats = () => {
|
|
const getStats = () => {
|
|
initYwcbChart()
|
|
initYwcbChart()
|
|
@@ -256,17 +251,17 @@ const getStats = () => {
|
|
IotStatApi.getMaintainCount('rh').then((res) => {
|
|
IotStatApi.getMaintainCount('rh').then((res) => {
|
|
maintain.value = res
|
|
maintain.value = res
|
|
})
|
|
})
|
|
- IotStatApi.getMainWorkCount().then((res) => {
|
|
|
|
|
|
+ IotStatApi.getMainWorkCount("").then((res) => {
|
|
work.value = res
|
|
work.value = res
|
|
})
|
|
})
|
|
- IotStatApi.getInspectCount().then((res) => {
|
|
|
|
|
|
+ IotStatApi.getInspectCount("").then((res) => {
|
|
inspect.value = res
|
|
inspect.value = res
|
|
})
|
|
})
|
|
- IotStatApi.getMaintenanceStatus().then((res) => {
|
|
|
|
- status.value = res
|
|
|
|
- // initCharts()
|
|
|
|
- })
|
|
|
|
- IotStatApi.getMaintenanceTodayStatus().then((res) => {
|
|
|
|
|
|
+ // IotStatApi.getMaintenanceStatus("").then((res) => {
|
|
|
|
+ // status.value = res
|
|
|
|
+ // // initCharts()
|
|
|
|
+ // })
|
|
|
|
+ IotStatApi.getMaintenanceTodayStatus("").then((res) => {
|
|
todayStatus.value = res
|
|
todayStatus.value = res
|
|
initTopChart()
|
|
initTopChart()
|
|
})
|
|
})
|
|
@@ -302,7 +297,7 @@ const getStats = () => {
|
|
startTime: Date.now() - 7 * 24 * 60 * 60 * 1000, // 设置默认开始时间为 7 天前
|
|
startTime: Date.now() - 7 * 24 * 60 * 60 * 1000, // 设置默认开始时间为 7 天前
|
|
endTime: Date.now(), // 设置默认结束时间为当前时间
|
|
endTime: Date.now(), // 设置默认结束时间为当前时间
|
|
createTime: [],
|
|
createTime: [],
|
|
- deptId: null, // 选中的部门ID
|
|
|
|
|
|
+ deptId: '', // 选中的部门ID
|
|
status: null // 填写状态
|
|
status: null // 填写状态
|
|
})
|
|
})
|
|
IotStatApi.getInspectStatuss(fillQueryParams, 'rh').then((res) => {
|
|
IotStatApi.getInspectStatuss(fillQueryParams, 'rh').then((res) => {
|
|
@@ -313,7 +308,7 @@ const getStats = () => {
|
|
fill.value = res.totalList[0] || []
|
|
fill.value = res.totalList[0] || []
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-let materialInstance = null
|
|
|
|
|
|
+let materialInstance;
|
|
const initMaterials = () => {
|
|
const initMaterials = () => {
|
|
if (!materialChartRef.value) return
|
|
if (!materialChartRef.value) return
|
|
const option = {
|
|
const option = {
|
|
@@ -321,14 +316,12 @@ const initMaterials = () => {
|
|
trigger: 'item'
|
|
trigger: 'item'
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
- // top: '5%',
|
|
|
|
- // right: '10%',
|
|
|
|
- // align: 'left',
|
|
|
|
- // orient: 'vertical',
|
|
|
|
- // icon: 'circle'
|
|
|
|
orient: 'horizontal', // 水平排列图例项
|
|
orient: 'horizontal', // 水平排列图例项
|
|
bottom: '0%', // 放置在底部
|
|
bottom: '0%', // 放置在底部
|
|
- icon: 'circle'
|
|
|
|
|
|
+ icon: 'circle',
|
|
|
|
+ textStyle: {
|
|
|
|
+ color:'#B6C8DA'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
@@ -339,7 +332,8 @@ const initMaterials = () => {
|
|
center: ['50%', '44%'],
|
|
center: ['50%', '44%'],
|
|
label: {
|
|
label: {
|
|
show: false,
|
|
show: false,
|
|
- position: 'outside'
|
|
|
|
|
|
+ position: 'outside',
|
|
|
|
+ color:'#B6C8DA'
|
|
},
|
|
},
|
|
emphasis: {
|
|
emphasis: {
|
|
label: {
|
|
label: {
|
|
@@ -366,23 +360,23 @@ const initMaterials = () => {
|
|
let zqlTodayInstance = null
|
|
let zqlTodayInstance = null
|
|
const initTodayZqlChart = async () => {
|
|
const initTodayZqlChart = async () => {
|
|
if (!todayZqlRef.value) return
|
|
if (!todayZqlRef.value) return
|
|
-
|
|
|
|
- // 获取数据
|
|
|
|
- // ECharts配置
|
|
|
|
|
|
+ zqlTodayInstance = echarts.init(todayZqlRef.value)
|
|
const option = {
|
|
const option = {
|
|
tooltip: {
|
|
tooltip: {
|
|
trigger: 'axis',
|
|
trigger: 'axis',
|
|
axisPointer: {
|
|
axisPointer: {
|
|
- type: 'shadow'
|
|
|
|
- },
|
|
|
|
- formatter: (params) => {
|
|
|
|
- return `${params[0].axisValue}<br/>
|
|
|
|
- ${params[0].marker} ${params[0].seriesName}: ${params[0].value}`
|
|
|
|
|
|
+ type: 'cross',
|
|
|
|
+ label: {
|
|
|
|
+ backgroundColor: '#6a7985'
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
- data: ['当日注气量'],
|
|
|
|
- top: 25
|
|
|
|
|
|
+ data: zqlTodayData.value.series.map((item) => item.name),
|
|
|
|
+ top: 30,
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
grid: {
|
|
grid: {
|
|
left: '3%',
|
|
left: '3%',
|
|
@@ -392,28 +386,79 @@ const initTodayZqlChart = async () => {
|
|
},
|
|
},
|
|
xAxis: {
|
|
xAxis: {
|
|
type: 'category',
|
|
type: 'category',
|
|
|
|
+ boundaryGap: false,
|
|
data: zqlTodayData.value.xAxis,
|
|
data: zqlTodayData.value.xAxis,
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA' // X轴线白色半透明
|
|
|
|
+ }
|
|
|
|
+ },
|
|
axisLabel: {
|
|
axisLabel: {
|
|
|
|
+ color: '#B6C8DA',
|
|
formatter: (value) => value.split('-').join('/') // 显示为 2023/01
|
|
formatter: (value) => value.split('-').join('/') // 显示为 2023/01
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- yAxis: {
|
|
|
|
- type: 'value',
|
|
|
|
- axisLabel: {
|
|
|
|
- formatter: (value) => Math.floor(value).toString()
|
|
|
|
|
|
+ yAxis: [
|
|
|
|
+ {
|
|
|
|
+ type: 'value',
|
|
|
|
+ axisLabel: {
|
|
|
|
+ color: '#B6C8DA',
|
|
|
|
+ formatter: '{value}'
|
|
|
|
+ },
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: true, // 显示水平网格线(默认显示)
|
|
|
|
+ lineStyle: {
|
|
|
|
+ // 水平网格线颜色(可设置为纯色或带透明度的颜色)
|
|
|
|
+ color: '#457794', // 浅灰色半透明
|
|
|
|
+ // 可选:设置线条类型(实线/虚线/点线)
|
|
|
|
+ type: 'dashed'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ position: 'left' // 左侧 Y 轴
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: 'value',
|
|
|
|
+ axisLabel: {
|
|
|
|
+ color: '#B6C8DA',
|
|
|
|
+ formatter: '{value}'
|
|
|
|
+ },
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: true, // 显示水平网格线(默认显示)
|
|
|
|
+ lineStyle: {
|
|
|
|
+ // 水平网格线颜色(可设置为纯色或带透明度的颜色)
|
|
|
|
+ color: '#457794', // 浅灰色半透明
|
|
|
|
+ // 可选:设置线条类型(实线/虚线/点线)
|
|
|
|
+ type: 'dashed'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ position: 'right', // 右侧 Y 轴
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: false // 隐藏右侧 Y 轴的分割线
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ ],
|
|
|
|
+
|
|
series: zqlTodayData.value.series.map((item, index) => {
|
|
series: zqlTodayData.value.series.map((item, index) => {
|
|
// 假设前两条曲线使用左侧 Y 轴,后两条曲线使用右侧 Y 轴
|
|
// 假设前两条曲线使用左侧 Y 轴,后两条曲线使用右侧 Y 轴
|
|
- const yAxisIndex = index < 2 ? 0 : 1
|
|
|
|
|
|
+ const yAxisIndex = index < 1 ? 0 : 1
|
|
return {
|
|
return {
|
|
name: item.name,
|
|
name: item.name,
|
|
- type: 'bar',
|
|
|
|
|
|
+ type: 'line',
|
|
smooth: true,
|
|
smooth: true,
|
|
symbol: 'circle',
|
|
symbol: 'circle',
|
|
symbolSize: 8,
|
|
symbolSize: 8,
|
|
itemStyle: {
|
|
itemStyle: {
|
|
- color: [ '#91cc75'][index]
|
|
|
|
|
|
+ color: ['#5470c6', '#f1d209'][index]
|
|
},
|
|
},
|
|
areaStyle: {
|
|
areaStyle: {
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
@@ -427,10 +472,7 @@ const initTodayZqlChart = async () => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
- // 初始化图表
|
|
|
|
- zqlTodayInstance = echarts.init(todayZqlRef.value)
|
|
|
|
zqlTodayInstance.setOption(option)
|
|
zqlTodayInstance.setOption(option)
|
|
-
|
|
|
|
// 窗口缩放监听
|
|
// 窗口缩放监听
|
|
window.addEventListener('resize', handleZqlTodayResize)
|
|
window.addEventListener('resize', handleZqlTodayResize)
|
|
handleZqlTodayResize()
|
|
handleZqlTodayResize()
|
|
@@ -446,7 +488,10 @@ const initDeviceStatusCharts = () => {
|
|
legend: {
|
|
legend: {
|
|
orient: 'horizontal', // 水平排列图例项
|
|
orient: 'horizontal', // 水平排列图例项
|
|
bottom: '0%', // 放置在底部
|
|
bottom: '0%', // 放置在底部
|
|
- icon: 'circle'
|
|
|
|
|
|
+ icon: 'circle',
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
@@ -457,7 +502,8 @@ const initDeviceStatusCharts = () => {
|
|
center: ['50%', '44%'],
|
|
center: ['50%', '44%'],
|
|
label: {
|
|
label: {
|
|
show: false,
|
|
show: false,
|
|
- position: 'outside'
|
|
|
|
|
|
+ position: 'outside',
|
|
|
|
+ color: 'white'
|
|
},
|
|
},
|
|
emphasis: {
|
|
emphasis: {
|
|
label: {
|
|
label: {
|
|
@@ -477,7 +523,7 @@ const initDeviceStatusCharts = () => {
|
|
|
|
|
|
/** 初始化消息统计图表 */
|
|
/** 初始化消息统计图表 */
|
|
const chartContainer = ref(null)
|
|
const chartContainer = ref(null)
|
|
-let chartInstance = null
|
|
|
|
|
|
+let chartInstance;
|
|
|
|
|
|
// 模拟数据获取
|
|
// 模拟数据获取
|
|
const fetchChartData = async () => {
|
|
const fetchChartData = async () => {
|
|
@@ -513,7 +559,10 @@ const initYwcbChart = async () => {
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
data: ['当日运维成本'],
|
|
data: ['当日运维成本'],
|
|
- top: 1
|
|
|
|
|
|
+ top: 1,
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
grid: {
|
|
grid: {
|
|
left: '3%',
|
|
left: '3%',
|
|
@@ -526,14 +575,36 @@ const initYwcbChart = async () => {
|
|
data: zqlTodayData.value.xAxis,
|
|
data: zqlTodayData.value.xAxis,
|
|
axisLabel: {
|
|
axisLabel: {
|
|
rotate: 45,
|
|
rotate: 45,
|
|
- margin: 15
|
|
|
|
- }
|
|
|
|
|
|
+ margin: 15,
|
|
|
|
+ color: '#B6C8DA',
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA' // X轴线白色半透明
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
yAxis: {
|
|
yAxis: {
|
|
type: 'value',
|
|
type: 'value',
|
|
axisLabel: {
|
|
axisLabel: {
|
|
|
|
+ color: '#B6C8DA',
|
|
formatter: (value) => Math.floor(value).toString()
|
|
formatter: (value) => Math.floor(value).toString()
|
|
|
|
+ },
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: true, // 显示水平网格线(默认显示)
|
|
|
|
+ lineStyle: {
|
|
|
|
+ // 水平网格线颜色(可设置为纯色或带透明度的颜色)
|
|
|
|
+ color: '#457794', // 浅灰色半透明
|
|
|
|
+ // 可选:设置线条类型(实线/虚线/点线)
|
|
|
|
+ type: 'dashed'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
@@ -565,9 +636,6 @@ const handleResize = () => {
|
|
}
|
|
}
|
|
|
|
|
|
// 自适应调整
|
|
// 自适应调整
|
|
-const handleTopResize = () => {
|
|
|
|
- topInstance?.resize()
|
|
|
|
-}
|
|
|
|
const handleQxResize = () => {
|
|
const handleQxResize = () => {
|
|
qxInstance?.resize()
|
|
qxInstance?.resize()
|
|
}
|
|
}
|
|
@@ -581,7 +649,7 @@ const handleMaterialResize = () => {
|
|
materialInstance?.resize()
|
|
materialInstance?.resize()
|
|
}
|
|
}
|
|
const topContainer = ref(null)
|
|
const topContainer = ref(null)
|
|
-let topInstance = null
|
|
|
|
|
|
+let topInstance;
|
|
// 响应式容器尺寸
|
|
// 响应式容器尺寸
|
|
const { width, height } = useElementSize(topContainer)
|
|
const { width, height } = useElementSize(topContainer)
|
|
|
|
|
|
@@ -608,17 +676,37 @@ const getTopOption = () => {
|
|
xAxis: {
|
|
xAxis: {
|
|
type: 'value',
|
|
type: 'value',
|
|
axisLabel: {
|
|
axisLabel: {
|
|
|
|
+ color: '#B6C8DA',
|
|
formatter: (value) => {
|
|
formatter: (value) => {
|
|
if (value >= 10000) return `${(value / 10000).toFixed(1)}万`
|
|
if (value >= 10000) return `${(value / 10000).toFixed(1)}万`
|
|
return value.toLocaleString()
|
|
return value.toLocaleString()
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA' // X轴线白色半透明
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: true, // 显示水平网格线(默认显示)
|
|
|
|
+ lineStyle: {
|
|
|
|
+ // 水平网格线颜色(可设置为纯色或带透明度的颜色)
|
|
|
|
+ color: '#457794', // 浅灰色半透明
|
|
|
|
+ // 可选:设置线条类型(实线/虚线/点线)
|
|
|
|
+ type: 'dashed'
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
yAxis: {
|
|
yAxis: {
|
|
type: 'category',
|
|
type: 'category',
|
|
data: data.map((item) => item.category),
|
|
data: data.map((item) => item.category),
|
|
axisTick: { show: false },
|
|
axisTick: { show: false },
|
|
- axisLabel: {}
|
|
|
|
|
|
+ axisLabel: { color: '#B6C8DA' },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA' // X轴线白色半透明
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
@@ -636,7 +724,7 @@ const getTopOption = () => {
|
|
show: true,
|
|
show: true,
|
|
position: 'right',
|
|
position: 'right',
|
|
formatter: '{@value}',
|
|
formatter: '{@value}',
|
|
- color: '#333',
|
|
|
|
|
|
+ color: '#B6C8DA',
|
|
fontWeight: 'bold'
|
|
fontWeight: 'bold'
|
|
},
|
|
},
|
|
emphasis: {
|
|
emphasis: {
|
|
@@ -681,26 +769,38 @@ watch(
|
|
)
|
|
)
|
|
|
|
|
|
const qxRef = ref(null)
|
|
const qxRef = ref(null)
|
|
-let qxInstance = null
|
|
|
|
-let zqlInstance = null
|
|
|
|
|
|
+let qxInstance;
|
|
|
|
+let zqlInstance;
|
|
|
|
|
|
const initZqlChart = () => {
|
|
const initZqlChart = () => {
|
|
if (!zqlChartRef.value) return
|
|
if (!zqlChartRef.value) return
|
|
- zqlInstance = echarts.init(zqlChartRef.value)
|
|
|
|
- debugger
|
|
|
|
|
|
+
|
|
|
|
+ // 获取数据
|
|
|
|
+ // ECharts配置
|
|
const option = {
|
|
const option = {
|
|
tooltip: {
|
|
tooltip: {
|
|
trigger: 'axis',
|
|
trigger: 'axis',
|
|
axisPointer: {
|
|
axisPointer: {
|
|
- type: 'cross',
|
|
|
|
|
|
+ type: 'shadow',
|
|
label: {
|
|
label: {
|
|
backgroundColor: '#6a7985'
|
|
backgroundColor: '#6a7985'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // trigger: 'axis',
|
|
|
|
+ // axisPointer: {
|
|
|
|
+ // type: 'shadow'
|
|
|
|
+ // },
|
|
|
|
+ // formatter: (params) => {
|
|
|
|
+ // return `${params[0].axisValue}<br/>
|
|
|
|
+ // ${params[0].marker} ${params[0].seriesName}: ${params[0].value}`
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
data: zqlData.value.series.map((item) => item.name),
|
|
data: zqlData.value.series.map((item) => item.name),
|
|
- top: 30
|
|
|
|
|
|
+ top: 30,
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
grid: {
|
|
grid: {
|
|
left: '3%',
|
|
left: '3%',
|
|
@@ -710,43 +810,77 @@ const initZqlChart = () => {
|
|
},
|
|
},
|
|
xAxis: {
|
|
xAxis: {
|
|
type: 'category',
|
|
type: 'category',
|
|
- boundaryGap: false,
|
|
|
|
data: zqlData.value.xAxis,
|
|
data: zqlData.value.xAxis,
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA' // X轴线白色半透明
|
|
|
|
+ }
|
|
|
|
+ },
|
|
axisLabel: {
|
|
axisLabel: {
|
|
- formatter: (value) => value.split('-').join('/') // 显示为 2023/01
|
|
|
|
|
|
+ color: '#B6C8DA',
|
|
|
|
+ formatter: (value) => value.split('-').join('/')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
yAxis: [
|
|
yAxis: [
|
|
{
|
|
{
|
|
type: 'value',
|
|
type: 'value',
|
|
axisLabel: {
|
|
axisLabel: {
|
|
|
|
+ color: '#B6C8DA',
|
|
formatter: '{value}'
|
|
formatter: '{value}'
|
|
},
|
|
},
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: true, // 显示水平网格线(默认显示)
|
|
|
|
+ lineStyle: {
|
|
|
|
+ // 水平网格线颜色(可设置为纯色或带透明度的颜色)
|
|
|
|
+ color: '#457794', // 浅灰色半透明
|
|
|
|
+ // 可选:设置线条类型(实线/虚线/点线)
|
|
|
|
+ type: 'dashed'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
position: 'left' // 左侧 Y 轴
|
|
position: 'left' // 左侧 Y 轴
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'value',
|
|
type: 'value',
|
|
axisLabel: {
|
|
axisLabel: {
|
|
|
|
+ color: '#B6C8DA',
|
|
formatter: '{value}'
|
|
formatter: '{value}'
|
|
},
|
|
},
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: true, // 显示水平网格线(默认显示)
|
|
|
|
+ lineStyle: {
|
|
|
|
+ // 水平网格线颜色(可设置为纯色或带透明度的颜色)
|
|
|
|
+ color: '#457794', // 浅灰色半透明
|
|
|
|
+ // 可选:设置线条类型(实线/虚线/点线)
|
|
|
|
+ type: 'dashed'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
position: 'right', // 右侧 Y 轴
|
|
position: 'right', // 右侧 Y 轴
|
|
splitLine: {
|
|
splitLine: {
|
|
show: false // 隐藏右侧 Y 轴的分割线
|
|
show: false // 隐藏右侧 Y 轴的分割线
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
],
|
|
-
|
|
|
|
series: zqlData.value.series.map((item, index) => {
|
|
series: zqlData.value.series.map((item, index) => {
|
|
// 假设前两条曲线使用左侧 Y 轴,后两条曲线使用右侧 Y 轴
|
|
// 假设前两条曲线使用左侧 Y 轴,后两条曲线使用右侧 Y 轴
|
|
- const yAxisIndex = index < 2 ? 0 : 1
|
|
|
|
|
|
+ const yAxisIndex = index < 1 ? 0 : 1
|
|
return {
|
|
return {
|
|
name: item.name,
|
|
name: item.name,
|
|
- type: 'line',
|
|
|
|
|
|
+ type: 'bar',
|
|
smooth: true,
|
|
smooth: true,
|
|
symbol: 'circle',
|
|
symbol: 'circle',
|
|
symbolSize: 8,
|
|
symbolSize: 8,
|
|
itemStyle: {
|
|
itemStyle: {
|
|
- color: ['#5470c6', '#f1d209', '#e14f0f', '#91cc75'][index]
|
|
|
|
|
|
+ color: [ '#91cc75','#f1d209'][index]
|
|
},
|
|
},
|
|
areaStyle: {
|
|
areaStyle: {
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
@@ -760,10 +894,14 @@ const initZqlChart = () => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 初始化图表
|
|
|
|
+ zqlInstance = echarts.init(zqlChartRef.value)
|
|
zqlInstance.setOption(option)
|
|
zqlInstance.setOption(option)
|
|
|
|
+
|
|
// 窗口缩放监听
|
|
// 窗口缩放监听
|
|
window.addEventListener('resize', handleZqlResize)
|
|
window.addEventListener('resize', handleZqlResize)
|
|
handleZqlResize()
|
|
handleZqlResize()
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
const initQxChart = () => {
|
|
const initQxChart = () => {
|
|
@@ -782,7 +920,10 @@ const initQxChart = () => {
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
data: orderSevenData.value.series.map((item) => item.name),
|
|
data: orderSevenData.value.series.map((item) => item.name),
|
|
- top: 30
|
|
|
|
|
|
+ top: 30,
|
|
|
|
+ textStyle: {
|
|
|
|
+ color:'#B6C8DA'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
grid: {
|
|
grid: {
|
|
left: '3%',
|
|
left: '3%',
|
|
@@ -795,22 +936,58 @@ const initQxChart = () => {
|
|
boundaryGap: false,
|
|
boundaryGap: false,
|
|
data: orderSevenData.value.xAxis,
|
|
data: orderSevenData.value.xAxis,
|
|
axisLabel: {
|
|
axisLabel: {
|
|
- formatter: (value) => value.split('-').join('/') // 显示为 2023/01
|
|
|
|
- }
|
|
|
|
|
|
+ color: '#B6C8DA',
|
|
|
|
+ formatter: (value) => value.split('-').join('/')
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA' // X轴线白色半透明
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
yAxis: [
|
|
yAxis: [
|
|
{
|
|
{
|
|
type: 'value',
|
|
type: 'value',
|
|
axisLabel: {
|
|
axisLabel: {
|
|
|
|
+ color: '#B6C8DA',
|
|
formatter: '{value}'
|
|
formatter: '{value}'
|
|
},
|
|
},
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: true, // 显示水平网格线(默认显示)
|
|
|
|
+ lineStyle: {
|
|
|
|
+ // 水平网格线颜色(可设置为纯色或带透明度的颜色)
|
|
|
|
+ color: '#457794', // 浅灰色半透明
|
|
|
|
+ // 可选:设置线条类型(实线/虚线/点线)
|
|
|
|
+ type: 'dashed'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
position: 'left' // 左侧 Y 轴
|
|
position: 'left' // 左侧 Y 轴
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'value',
|
|
type: 'value',
|
|
axisLabel: {
|
|
axisLabel: {
|
|
|
|
+ color: '#B6C8DA',
|
|
formatter: '{value}'
|
|
formatter: '{value}'
|
|
},
|
|
},
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: true, // 显示水平网格线(默认显示)
|
|
|
|
+ lineStyle: {
|
|
|
|
+ // 水平网格线颜色(可设置为纯色或带透明度的颜色)
|
|
|
|
+ color: '#457794', // 浅灰色半透明
|
|
|
|
+ // 可选:设置线条类型(实线/虚线/点线)
|
|
|
|
+ type: 'dashed'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: '#B6C8DA'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
position: 'right', // 右侧 Y 轴
|
|
position: 'right', // 右侧 Y 轴
|
|
splitLine: {
|
|
splitLine: {
|
|
show: false // 隐藏右侧 Y 轴的分割线
|
|
show: false // 隐藏右侧 Y 轴的分割线
|
|
@@ -880,4 +1057,79 @@ onBeforeUnmount(() => {
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.page-container {
|
|
|
|
+ background-color: #3a6fa3;
|
|
|
|
+ min-height: 100vh;
|
|
|
|
+ padding: 20px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 统计卡片区域样式
|
|
|
|
+.summary {
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 图表卡片样式优化,增强与背景的对比
|
|
|
|
+::v-deep .chart-card {
|
|
|
|
+ background-color: rgba(0, 0, 0, 0.3); // 半透明白色卡片
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2); // 轻微阴影增强层次感
|
|
|
|
+ transition: all 0.3s ease;
|
|
|
|
+ border: none;
|
|
|
|
+
|
|
|
|
+ &:hover {
|
|
|
|
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); // 悬停时增强阴影
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 安全生产天数卡片样式
|
|
|
|
+.safety-days-card {
|
|
|
|
+ .safety-days-content {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ height: 150px;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ .days-number {
|
|
|
|
+ font-size: 58px;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ color: darkorange;
|
|
|
|
+ line-height: 1;
|
|
|
|
+ transition: all 0.3s ease;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .days-number:hover {
|
|
|
|
+ transform: scale(1.05);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .days-label {
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ color: white;
|
|
|
|
+ margin-top: 8px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .safety-desc {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ color: #999;
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: 10px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ width: 90%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 响应式调整
|
|
|
|
+@media (max-width: 768px) {
|
|
|
|
+ .page-container {
|
|
|
|
+ padding: 10px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+// 去除卡片头部的下边框
|
|
|
|
+::v-deep .el-card__header {
|
|
|
|
+ border-bottom: none !important;
|
|
|
|
+ padding-bottom: 0; // 可选:调整底部内边距
|
|
|
|
+}
|
|
|
|
+</style>
|