This commit is contained in:
dhr
2025-09-16 21:23:38 +08:00
parent cdf5dfcdae
commit 0bc79fa151
4 changed files with 645 additions and 554 deletions

View File

@ -1,184 +1,209 @@
<template> <template>
<div class="container"> <div>
<!-- 导航栏 --> <div class="box-container">
<div class="navigation-tabs"> <!-- 导航栏 -->
<div class="nav-tab active" @click="handleInspection1">待办事项</div> <div class="navigation-tabs">
<div class="nav-tab" @click="handleInspection2">巡检管理</div> <div class="nav-tab active" @click="handleInspection1">待办事项</div>
<div class="nav-tab" @click="handleInspection3">试验管理</div> <div class="nav-tab" @click="handleInspection2">巡检管理</div>
<div class="nav-tab" @click="handleInspection4">报修管理</div> <div class="nav-tab" @click="handleInspection3">试验管理</div>
<div class="nav-tab" @click="handleInspection5">修管理</div> <div class="nav-tab" @click="handleInspection4">修管理</div>
<div class="nav-tab" @click="handleInspection6">工单管理</div> <div class="nav-tab" @click="handleInspection5">抢修管理</div>
<div class="nav-tab" @click="handleInspection7">运维组织</div> <div class="nav-tab" @click="handleInspection6">工单管理</div>
</div> <div class="nav-tab" @click="handleInspection7">运维组织</div>
</div>
<!-- 标题栏 --> <!-- 标题栏 -->
<div class="header"> <div class="header">
<TitleComponent title="运维待办事项" subtitle="管理每日、每周等的运维工作任务"></TitleComponent> <TitleComponent title="运维待办事项" subtitle="管理每日、每周等的运维工作任务"></TitleComponent>
</div> </div>
<div class="main-content"> <div class="main-content">
<!-- 左侧日历区域 --> <!-- 左侧日历区域 -->
<div class="calendar-container"> <div class="calendar-container">
<div class="calendar-header"> <div class="calendar-header">
<div class="calendar-title">待办月视图</div> <div class="calendar-title">待办月视图</div>
<div class="calendar-controls"> <div class="calendar-controls">
<!-- 年份月份选择 --> <!-- 月份选择 -->
<el-select v-model="selectedYear" placeholder="选择份" size="small" style="width: 80px; margin-right: 5px"> <el-date-picker v-model="currentDate" type="month" placeholder="选择份" style="width: 120px; margin-right: 15px" />
<el-option v-for="year in years" :key="year" :label="year.toString()" :value="year"></el-option>
</el-select> <el-button type="primary">添加</el-button>
<el-select v-model="selectedMonth" placeholder="选择月份" size="small" style="width: 80px; margin-right: 10px"> <el-button type="primary" @click="goToToday">今日</el-button>
<el-option v-for="month in 12" :key="month" :label="month.toString()" :value="month"></el-option> <el-button type="text" icon="el-icon-plus"></el-button>
</el-select> </div>
<!-- 月份切换按钮 -->
<el-button type="text" icon="el-icon-arrow-left" @click="decreaseMonth"></el-button>
<el-button type="text" icon="el-icon-arrow-right" @click="increaseMonth"></el-button>
<el-button type="primary" size="small">添加</el-button>
<el-button type="primary" size="small" @click="goToToday">今日</el-button>
<el-button type="text" icon="el-icon-plus"></el-button>
</div> </div>
</div> <!-- 使用 Element Plus 的日历组件 -->
<!-- 使用 Element Plus 的日历组件 --> <el-calendar v-model="currentDate">
<el-calendar v-model="currentDate"> <template #date-cell="{ date, data }">
<template #date-cell="{ date, data }"> <div class="custom-date-cell" :class="getCellClass(data.day)">
<div class="custom-date-cell" :class="getCellClass(data.day)"> <div class="date-day">{{ data.day.split('-').slice(2).join('-') }}</div>
<div class="date-day">{{ data.day.split('-').slice(2).join('-') }}</div> <div class="date-events">
<div class="date-events"> <div v-for="event in getDayEvents(data.day)" :key="event.id" class="event-item" :class="'event-' + event.type">
<div v-for="event in getDayEvents(data.day)" :key="event.id" class="event-item" :class="'event-' + event.type"> <div class="event-title">{{ event.title }}</div>
<div class="event-title">{{ event.title }}</div> <div class="event-description">{{ event.description }}</div>
<div class="event-description">{{ event.description }}</div> </div>
</div> </div>
</div> </div>
</div> </template>
</template> </el-calendar>
</el-calendar>
</div>
<!-- 右侧表单区域 -->
<div class="form-container">
<div class="form-header">
<h2>今日待办</h2>
<el-button type="primary" size="small" icon="el-icon-plus" @click="openAddTaskDialog">添加</el-button>
</div> </div>
<!-- 待办事项列表 --> <!-- 右侧表单区域 -->
<div class="todo-list"> <div class="form-container">
<!-- 待办项1 - 常规维护 --> <div class="form-header">
<div class="todo-item"> <h2>今日待办</h2>
<div class="todo-color-indicator normal"></div> <el-button type="primary" size="small" icon="el-icon-plus" @click="openAddTaskDialog">添加</el-button>
<el-checkbox class="todo-checkbox"></el-checkbox> </div>
<div class="todo-content">
<div class="todo-main"> <!-- 待办事项列表 -->
<div class="todo-title">服务器例行检查</div> <div class="todo-list">
<div class="todo-time">09:00-10:00 AM</div> <!-- 待办项1 - 常规维护 -->
<div class="todo-item">
<div class="todo-color-indicator normal"></div>
<el-checkbox class="todo-checkbox"></el-checkbox>
<div class="todo-content">
<div class="todo-main">
<div class="todo-title">服务器例行检查</div>
<div class="todo-time">09:00-10:00 AM</div>
</div>
<div class="todo-description">检查所有生产服务器的CPU内存磁盘使用率确保正常运行</div>
</div>
<div class="todo-actions">
<el-button type="primary" size="small" icon="el-icon-check">编辑</el-button>
<el-button type="danger" size="small" icon="el-icon-delete">删除</el-button>
</div>
</div>
<!-- 待办项2 - 重要 -->
<div class="todo-item important">
<div class="todo-color-indicator important"></div>
<el-checkbox class="todo-checkbox"></el-checkbox>
<div class="todo-content">
<div class="todo-main">
<div class="todo-title">数据库备份</div>
<div class="todo-time">14:00-15:00 PM</div>
</div>
<div class="todo-description">主要数据库全备份并验证备份文件完整性</div>
</div>
<div class="todo-actions">
<el-button type="primary" size="small" icon="el-icon-check">编辑</el-button>
<el-button type="danger" size="small" icon="el-icon-delete">删除</el-button>
</div>
</div>
<!-- 待办项3 - 紧急 -->
<div class="todo-item">
<div class="todo-color-indicator urgent"></div>
<el-checkbox class="todo-checkbox"></el-checkbox>
<div class="todo-content">
<div class="todo-main">
<div class="todo-title">网络设备固件更新</div>
<div class="todo-time">18:00-20:00 PM</div>
</div>
<div class="todo-description">更新核心交换机和防火墙固件需安排在业务低峰期</div>
</div>
<div class="todo-actions">
<el-button type="primary" size="small" icon="el-icon-check">编辑</el-button>
<el-button type="danger" size="small" icon="el-icon-delete">删除</el-button>
</div>
</div>
<!-- 待办项4 - 常规维护 -->
<div class="todo-item">
<div class="todo-color-indicator normal"></div>
<el-checkbox class="todo-checkbox"></el-checkbox>
<div class="todo-content">
<div class="todo-main">
<div class="todo-title">服务器例行检查</div>
<div class="todo-time">08:00-09:00 AM</div>
</div>
<div class="todo-description">检查所有生产服务器的CPU内存磁盘使用率确保正常运行</div>
</div>
<div class="todo-actions">
<el-button type="primary" size="small" icon="el-icon-check">编辑</el-button>
<el-button type="danger" size="small" icon="el-icon-delete">删除</el-button>
</div>
</div>
<div class="todo-item">
<div class="todo-color-indicator normal"></div>
<el-checkbox class="todo-checkbox"></el-checkbox>
<div class="todo-content">
<div class="todo-main">
<div class="todo-title">服务器例行检查</div>
<div class="todo-time">06:00-07:00 AM</div>
</div>
<div class="todo-description">检查所有生产服务器的CPU内存磁盘使用率确保正常运行</div>
</div>
<div class="todo-actions">
<el-button type="primary" size="small" icon="el-icon-check">编辑</el-button>
<el-button type="danger" size="small" icon="el-icon-delete">删除</el-button>
</div>
</div>
<div class="todo-item">
<div class="todo-color-indicator normal"></div>
<el-checkbox class="todo-checkbox"></el-checkbox>
<div class="todo-content">
<div class="todo-main">
<div class="todo-title">服务器例行检查</div>
<div class="todo-time">06:00-07:00 AM</div>
</div>
<div class="todo-description">检查所有生产服务器的CPU内存磁盘使用率确保正常运行</div>
</div>
<div class="todo-actions">
<el-button type="primary" size="small" icon="el-icon-check">编辑</el-button>
<el-button type="danger" size="small" icon="el-icon-delete">删除</el-button>
</div> </div>
<div class="todo-description">检查所有生产服务器的CPU内存磁盘使用率确保正常运行</div>
</div> </div>
</div> </div>
<!-- 待办项2 - 重要 --> <!-- 状态图例 - 标签形式 -->
<div class="todo-item important"> <!-- 状态图例 - 标签形式 -->
<div class="todo-color-indicator important"></div> <div class="status-legend">
<el-checkbox class="todo-checkbox"></el-checkbox> <span class="status-tag normal"><span class="color-block"></span>常规维护</span>
<div class="todo-content"> <span class="status-tag important"><span class="color-block"></span>重要</span>
<div class="todo-main"> <span class="status-tag urgent"><span class="color-block"></span>紧急</span>
<div class="todo-title">数据库备份</div>
<div class="todo-time">14:00-15:00 PM</div>
</div>
<div class="todo-description">主要数据库全备份并验证备份文件完整性</div>
</div>
<div class="todo-actions">
<el-button type="text" icon="el-icon-edit"></el-button>
<el-button type="text" icon="el-icon-delete"></el-button>
</div>
</div> </div>
<!-- 待办项3 - 紧急 -->
<div class="todo-item">
<div class="todo-color-indicator urgent"></div>
<el-checkbox class="todo-checkbox"></el-checkbox>
<div class="todo-content">
<div class="todo-main">
<div class="todo-title">网络设备固件更新</div>
<div class="todo-time">18:00-20:00 PM</div>
</div>
<div class="todo-description">更新核心交换机和防火墙固件需安排在业务低峰期</div>
</div>
</div>
<!-- 待办项4 - 常规维护 -->
<div class="todo-item">
<div class="todo-color-indicator normal"></div>
<el-checkbox class="todo-checkbox"></el-checkbox>
<div class="todo-content">
<div class="todo-main">
<div class="todo-title">服务器例行检查</div>
<div class="todo-time">08:00-09:00 AM</div>
</div>
<div class="todo-description">检查所有生产服务器的CPU内存磁盘使用率确保正常运行</div>
</div>
</div>
<!-- 待办项5 - 常规维护 -->
<div class="todo-item">
<div class="todo-color-indicator normal"></div>
<el-checkbox class="todo-checkbox"></el-checkbox>
<div class="todo-content">
<div class="todo-main">
<div class="todo-title">服务器例行检查</div>
<div class="todo-time">06:00-07:00 AM</div>
</div>
<div class="todo-description">检查所有生产服务器的CPU内存磁盘使用率确保正常运行</div>
</div>
</div>
</div>
<!-- 状态图例 - 标签形式 -->
<div class="status-legend">
<span class="status-tag normal">常规维护</span>
<span class="status-tag important">重要</span>
<span class="status-tag urgent">紧急</span>
</div> </div>
</div> </div>
<el-dialog v-model="dialogVisible" title="新增任务" width="480px" class="custom-dialog" :before-close="closeDialog">
<el-form :model="taskForm" label-width="80px" class="task-form">
<el-form-item label="任务名称" prop="name">
<el-input v-model="taskForm.name" placeholder="输入任务名称" class="form-input"></el-input>
</el-form-item>
<el-form-item label="任务描述" prop="description">
<el-input v-model="taskForm.description" placeholder="输入任务描述" class="form-input"></el-input>
</el-form-item>
<el-form-item label="时间" prop="timeRange">
<el-date-picker
v-model="taskForm.timeRange"
type="datetimerange"
start-placeholder="开始时间"
end-placeholder="结束时间"
class="form-input"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="优先级" prop="priority">
<el-select v-model="taskForm.priority" placeholder="选择优先级" class="form-input">
<el-option label="常规项" value="常规项"></el-option>
<el-option label="重要" value="重要"></el-option>
<el-option label="紧急" value="紧急"></el-option>
</el-select>
</el-form-item>
<el-form-item label="任务类型" prop="taskType">
<el-select v-model="taskForm.taskType" placeholder="选择任务类型" class="form-input">
<el-option label="常规维护" value="常规维护"></el-option>
<el-option label="安全巡检" value="安全巡检"></el-option>
<el-option label="系统升级" value="系统升级"></el-option>
<el-option label="数据备份" value="数据备份"></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="saveTask">保存任务</el-button>
</template>
</el-dialog>
</div> </div>
<el-dialog v-model="dialogVisible" title="新增任务" width="480px" class="custom-dialog" :before-close="closeDialog">
<el-form :model="taskForm" label-width="80px" class="task-form">
<el-form-item label="任务名称" prop="name">
<el-input v-model="taskForm.name" placeholder="输入任务名称" class="form-input"></el-input>
</el-form-item>
<el-form-item label="任务描述" prop="description">
<el-input v-model="taskForm.description" placeholder="输入任务描述" class="form-input"></el-input>
</el-form-item>
<el-form-item label="时间" prop="timeRange">
<el-date-picker
v-model="taskForm.timeRange"
type="datetimerange"
start-placeholder="开始时间"
end-placeholder="结束时间"
class="form-input"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="优先级" prop="priority">
<el-select v-model="taskForm.priority" placeholder="选择优先级" class="form-input">
<el-option label="常规项" value="常规项"></el-option>
<el-option label="重要" value="重要"></el-option>
<el-option label="紧急" value="紧急"></el-option>
</el-select>
</el-form-item>
<el-form-item label="任务类型" prop="taskType">
<el-select v-model="taskForm.taskType" placeholder="选择任务类型" class="form-input">
<el-option label="常规维护" value="常规维护"></el-option>
<el-option label="安全巡检" value="安全巡检"></el-option>
<el-option label="系统升级" value="系统升级"></el-option>
<el-option label="数据备份" value="数据备份"></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="saveTask">保存任务</el-button>
</template>
</el-dialog>
</div> </div>
</template> </template>
@ -187,14 +212,14 @@ import { ref, computed, watch } from 'vue';
import router from '@/router'; import router from '@/router';
import TitleComponent from '../demo/components/TitleComponent.vue'; import TitleComponent from '../demo/components/TitleComponent.vue';
// 生成年份选项生成2020-2029年的年份范围 // 默认显示当前月份
const targetYear = 2025; const currentDate = ref(new Date());
const years = ref(Array.from({ length: 10 }, (_, index) => 2020 + index));
const selectedYear = ref(targetYear);
const selectedMonth = ref(9);
// 默认显示2025年9月 // 为了保持兼容性,保留这些变量
const currentDate = ref(new Date(targetYear, 8, 1)); const targetYear = 2025;
const years = ref([]);
const selectedYear = ref(currentDate.value.getFullYear());
const selectedMonth = ref(currentDate.value.getMonth() + 1);
// 减少月份 // 减少月份
const decreaseMonth = () => { const decreaseMonth = () => {
@ -258,15 +283,13 @@ const updateYearAndMonth = () => {
selectedMonth.value = currentDate.value.getMonth() + 1; selectedMonth.value = currentDate.value.getMonth() + 1;
}; };
// 监听年份和月份变化,更新日历显示 // 监听日期变化,更新年份和月份
watch([selectedYear, selectedMonth], ([newYear, newMonth]) => { watch(currentDate, (newDate) => {
const date = new Date(currentDate.value); selectedYear.value = newDate.getFullYear();
date.setFullYear(newYear); selectedMonth.value = newDate.getMonth() + 1;
date.setMonth(newMonth - 1);
currentDate.value = date;
}); });
// 初始化年份和月份选择器 // 初始化年份和月份
updateYearAndMonth(); updateYearAndMonth();
// 弹窗相关状态管理 // 弹窗相关状态管理
@ -329,7 +352,8 @@ const handleInspection7 = () => {
</script> </script>
<style scoped> <style scoped>
.container { .box-container {
width: 100%;
padding: 20px; padding: 20px;
background-color: #f5f7fa; background-color: #f5f7fa;
min-height: 100vh; min-height: 100vh;
@ -397,15 +421,18 @@ const handleInspection7 = () => {
.main-content { .main-content {
display: flex; display: flex;
gap: 20px; gap: 20px;
width: 100%;
} }
/* 日历区域样式 */ /* 日历区域样式 */
.calendar-container { .calendar-container {
flex: 1; flex: 1;
min-width: 0;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
padding: 20px; padding: 20px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
height: 100%;
} }
/* 自定义弹窗样式 */ /* 自定义弹窗样式 */
@ -463,14 +490,13 @@ const handleInspection7 = () => {
.el-select { .el-select {
margin-right: 5px; margin-right: 5px;
} }
/* 表单区域样式 */
.form-container { .form-container {
width: 400px; flex: 0 0 360px; /* 调整宽度以匹配设计图,更贴合右侧区域宽度 */
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
padding: 20px; padding: 20px 20px 80px 20px; /* 增加底部内边距,为固定标签留出空间 */
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
position: relative; /* 设置为相对定位,使内部绝对定位元素相对于此容器定位 */
} }
.form-header { .form-header {
@ -494,7 +520,7 @@ const handleInspection7 = () => {
flex-direction: column; flex-direction: column;
gap: 10px; gap: 10px;
margin-bottom: 20px; margin-bottom: 20px;
max-height: 400px; max-height: 480px;
overflow-y: auto; overflow-y: auto;
} }
@ -507,6 +533,7 @@ const handleInspection7 = () => {
border-radius: 4px; border-radius: 4px;
position: relative; position: relative;
transition: all 0.3s ease; transition: all 0.3s ease;
overflow: hidden;
} }
/* 重要任务的背景色 */ /* 重要任务的背景色 */
@ -521,6 +548,8 @@ const handleInspection7 = () => {
.todo-content { .todo-content {
flex: 1; flex: 1;
position: relative;
transition: all 0.3s ease;
} }
.todo-main { .todo-main {
@ -549,42 +578,75 @@ const handleInspection7 = () => {
.todo-actions { .todo-actions {
position: absolute; position: absolute;
right: 10px; right: -120px;
bottom: 10px; top: 0;
bottom: 0;
display: flex; display: flex;
gap: 5px; opacity: 0;
transition: all 0.3s ease;
}
.todo-actions .el-button {
height: 100%;
border-radius: 0;
border-right: 1px solid #fff;
}
.todo-actions .el-button:last-child {
border-right: none;
}
.todo-item:hover .todo-content {
transform: translateX(-120px);
}
.todo-item:hover .todo-actions {
opacity: 1;
right: 0;
} }
.todo-actions .el-button { .todo-actions .el-button {
padding: 4px 8px; padding: 4px 8px;
min-width: auto; min-width: auto;
font-size: 12px;
} }
/* 状态图例 - 标签形式 */
.status-legend { .status-legend {
display: flex; display: flex;
gap: 10px; gap: 20px;
padding-top: 15px; padding: 15px 0;
border-top: 1px solid #ebeef5; border-top: 1px solid #ebeef5;
justify-content: center;
width: 100%;
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #fff;
} }
.status-tag { .status-tag {
display: inline-block; display: inline-flex;
padding: 4px 12px; align-items: center;
border-radius: 16px; gap: 5px;
font-size: 12px; font-size: 14px;
color: #fff; color: #303133;
} }
.status-tag.normal { .status-tag .color-block {
width: 12px;
height: 12px;
border-radius: 2px;
flex-shrink: 0;
}
.status-tag.normal .color-block {
background-color: #52c41a; background-color: #52c41a;
} }
.status-tag.important .color-block {
.status-tag.important {
background-color: #faad14; background-color: #faad14;
} }
.status-tag.urgent .color-block {
.status-tag.urgent {
background-color: #ff4d4f; background-color: #ff4d4f;
} }
@ -610,10 +672,12 @@ const handleInspection7 = () => {
background-color: #ff4d4f; background-color: #ff4d4f;
} }
/* 自定义日历单元格样式 */ ::v-deep .custom-date-cell {
.custom-date-cell { width: 100%;
height: 100%;
padding: 5px; padding: 5px;
text-align: center; text-align: center;
box-sizing: border-box; /* 确保内边距不撑大元素 */
} }
/* 系统升级事件样式 */ /* 系统升级事件样式 */
@ -648,15 +712,21 @@ const handleInspection7 = () => {
width: 100%; width: 100%;
} }
.el-calendar-table td { /* 穿透作用域,强制设置日历单元格为正方形 */
::v-deep .el-calendar-table td {
padding: 2px; padding: 2px;
vertical-align: top; vertical-align: top;
width: 120px; /* 强制宽度 */
height: 120px; /* 强制高度(与宽度一致) */
} }
::v-deep .el-calendar-day {
.el-calendar-day { padding: 0; /* 移除默认内边距 */
height: 120px; width: 100%;
height: 100%;
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
display: flex;
flex-direction: column;
} }
.date-day { .date-day {

View File

@ -16,7 +16,6 @@
<TitleComponent title="运维组织模块" subtitle="实时监控人员状态、车辆状态和班组状态"></TitleComponent> <TitleComponent title="运维组织模块" subtitle="实时监控人员状态、车辆状态和班组状态"></TitleComponent>
<!-- 选项卡 --> <!-- 选项卡 -->
<!-- 选项卡和按钮组合 -->
<div class="tabs-wrapper"> <div class="tabs-wrapper">
<div style="display: flex; align-items: center; gap: 10px"> <div style="display: flex; align-items: center; gap: 10px">
<el-button type="primary" @click="handleInspectionManagement1">人员状态</el-button> <el-button type="primary" @click="handleInspectionManagement1">人员状态</el-button>
@ -31,58 +30,9 @@
<div class="sidebar"> <div class="sidebar">
<div class="stats-card"> <div class="stats-card">
<h3 class="stats-title">人员数据总览</h3> <h3 class="stats-title">人员数据总览</h3>
<!-- 使用ECharts饼图替换原有的环形图 -->
<div class="chart-container"> <div class="chart-container">
<div class="gauge-chart"> <div ref="personnelChart" class="personnel-chart"></div>
<div class="doughnut-chart">
<!-- 动态镂空环形图 -->
<svg width="200" height="200" viewBox="0 0 200 200">
<!-- 环形背景 -->
<circle cx="100" cy="100" r="70" fill="none" stroke="#f0f2f5" stroke-width="12" class="background-circle" />
<!-- 在线可用部分 - 动态显示 -->
<circle
cx="100"
cy="100"
r="70"
fill="none"
stroke="#165dff"
stroke-width="12"
stroke-linecap="round"
:stroke-dasharray="circumference"
:stroke-dashoffset="onlineOffset"
transform="rotate(-90 100 100)"
class="progress-circle online-progress"
/>
<!-- 离线休息部分 - 动态显示 -->
<circle
cx="100"
cy="100"
r="70"
fill="none"
stroke="#40c9c6"
stroke-width="12"
stroke-linecap="round"
:stroke-dasharray="circumference"
:stroke-dashoffset="offlineOffset"
transform="rotate(-90 100 100)"
class="progress-circle offline-progress"
/>
</svg>
<div class="gauge-text">
<div class="gauge-percentage">{{ onlineRate }}%</div>
<div class="gauge-label">在线可用率</div>
</div>
</div>
</div>
<div class="chart-legend">
<div class="legend-item">
<span class="legend-color online"></span>
<span class="legend-text">在线可用人数 ({{ availablePersonnel }})</span>
</div>
<div class="legend-item">
<span class="legend-color offline"></span>
<span class="legend-text">离线休息人数 ({{ restingPersonnel }})</span>
</div>
</div>
</div> </div>
<div class="stats-grid"> <div class="stats-grid">
@ -112,30 +62,42 @@
<!-- 右侧人员列表区域带滚动条 --> <!-- 右侧人员列表区域带滚动条 -->
<div class="main-content"> <div class="main-content">
<div class="scrollable-content"> <div class="scroll-wrapper">
<div class="personnel-grid"> <!-- 固定的顶部空间不随内容滚动 -->
<div v-for="(person, index) in personnelList" :key="index" class="person-card"> <div class="fixed-top-space"></div>
<div class="person-header"> <!-- 可滚动的内容区域 -->
<div class="avatar"> <div class="scrollable-content">
<img :src="person.avatar" alt="头像" class="avatar-img" /> <div class="scrollable-inner">
<div class="status-indicator" :class="person.statusClass"></div> <div class="personnel-grid">
<div v-for="(person, index) in personnelList" :key="index" class="person-card">
<div class="person-header">
<div class="avatar">
<img src="@/assets/images/attendanceperson.png" class="avatar-img" />
<div class="status-indicator" :class="person.statusClass"></div>
</div>
<div class="person-info">
<div class="person-name">{{ person.name }}</div>
<div class="person-status">{{ person.statusText }}</div>
</div>
</div>
<div class="person-details">
<div class="detail-row">
<div class="detail-item">工号: {{ person.id }}</div>
<div class="detail-item">岗位: {{ person.position }}</div>
</div>
<div class="detail-row">
<div class="detail-item">班组: {{ person.team }}</div>
<div class="detail-item">今日完成: {{ person.completedTasks }}</div>
</div>
<div class="detail-row">
<div class="detail-item full-width">当前任务: {{ person.currentTask || '无' }}</div>
</div>
</div>
<div class="person-actions">
<el-button type="text" @click="viewDetails(person)" size="small" class="detail-btn">详情</el-button>
<el-button type="text" @click="assignTask(person)" size="small" class="assign-btn">指派</el-button>
</div>
</div> </div>
<div class="person-info">
<div class="person-name">{{ person.name }}</div>
<div class="person-status">{{ person.statusText }}</div>
</div>
</div>
<div class="person-details">
<div class="detail-item">工号: {{ person.id }}</div>
<div class="detail-item">岗位: {{ person.position }}</div>
<div class="detail-item">班组: {{ person.team }}</div>
<div class="detail-item">今日完成: {{ person.completedTasks }}</div>
<div class="detail-item" v-if="person.currentTask">当前任务: {{ person.currentTask }}</div>
<div class="detail-item" v-else>当前任务: </div>
</div>
<div class="person-actions">
<el-button type="text" @click="viewDetails(person)" size="small" class="detail-btn">详情</el-button>
<el-button type="text" @click="assignTask(person)" size="small" class="assign-btn">指派</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -147,33 +109,32 @@
</template> </template>
<script setup> <script setup>
import { ref, watch } from 'vue'; import { ref, watch, onMounted } from 'vue';
import router from '@/router'; import router from '@/router';
import TitleComponent from '@/views/demo/components/TitleComponent.vue'; import TitleComponent from '@/views/demo/components/TitleComponent.vue';
import * as echarts from 'echarts';
// 激活的选项卡 // 激活的选项卡
const activeTab = ref('personnel'); const activeTab = ref('personnel');
// 统计数据 // 统计数据(保持原有数据不变)
const totalPersonnel = ref(36); const totalPersonnel = ref(36);
const availablePersonnel = ref(18); const availablePersonnel = ref(18);
const workingPersonnel = ref(12); const workingPersonnel = ref(12);
const restingPersonnel = ref(6); const restingPersonnel = ref(6);
const onlineRate = ref(82); const onlineRate = ref(82);
// 环形图相关计算 // 人员状态数据 - 使用原有数据结构
const radius = 70; const personnelStatusData = {
const circumference = 2 * Math.PI * radius; '在线可用': availablePersonnel.value,
const onlineOffset = ref(circumference - (onlineRate.value / 100) * circumference); '离线休息': restingPersonnel.value
const offlineOffset = ref(circumference - ((100 - onlineRate.value) / 100) * circumference); };
// 监听onlineRate变化更新环形图 // 初始化图表
watch(onlineRate, (newRate) => { const personnelChart = ref(null);
onlineOffset.value = circumference - (newRate / 100) * circumference; let chartInstance = null;
offlineOffset.value = circumference - ((100 - newRate) / 100) * circumference;
});
// 人员列表数据 // 人员列表数据(保持不变)
const personnelList = ref([ const personnelList = ref([
{ {
id: 'EMP-2023-001', id: 'EMP-2023-001',
@ -276,10 +237,127 @@ const personnelList = ref([
} }
]); ]);
// 初始化饼图
const initChart = () => {
if (chartInstance) {
chartInstance.dispose();
}
chartInstance = echarts.init(personnelChart.value);
const names = Object.keys(personnelStatusData);
const values = Object.values(personnelStatusData).map((item) => Number(Number(item).toFixed(2)));
const sumValue = values.reduce((total, num) => total + num, 0);
// 设置图表配置 - 美化饼图样式,保持原有数据
const option = {
tooltip: {
trigger: 'item',
formatter: '{b}: {c}人 ({d}%)'
},
legend: {
show: true,
orient: 'horizontal',
bottom: 10,
itemWidth: 12,
itemHeight: 12,
textStyle: {
color: '#606266',
fontSize: 14
}
},
series: [
// 主饼图
{
name: '人员状态',
type: 'pie',
radius: ['40%', '70%'],
center: ['50%', '50%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 4,
borderColor: '#fff',
borderWidth: 2,
shadowBlur: 6,
shadowColor: 'rgba(0, 0, 0, 0.1)'
},
label: {
show: false,
position: 'outside',
formatter: '{d}%',
fontSize: 14,
fontWeight: 'bold',
color: '#303133',
lineHeight: 20
},
labelLine: {
show: true,
length: 15,
length2: 10,
lineStyle: {
width: 1
}
},
emphasis: {
scale: true,
scaleSize: 15
},
data: [
{
value: availablePersonnel.value,
name: '在线可用人数',
itemStyle: {
color: '#165dff'
}
},
{
value: restingPersonnel.value,
name: '离线休息人数',
itemStyle: {
color: '#40c9c6'
},
emphasis: {
itemStyle: {
shadowBlur: 15,
shadowColor: 'rgba(64, 201, 198, 0.4)'
}
}
}
]
}
]
};
chartInstance.setOption(option);
};
// 监听数据变化,更新图表
watch([availablePersonnel, workingPersonnel, restingPersonnel], () => {
// 更新人员状态数据
personnelStatusData['在线可用'] = availablePersonnel.value;
personnelStatusData['离线休息'] = restingPersonnel.value;
// 重新初始化图表
initChart();
});
// 页面加载完成后初始化图表
onMounted(() => {
initChart();
// 监听窗口大小变化,调整图表尺寸
window.addEventListener('resize', () => {
if (chartInstance) {
chartInstance.resize();
}
});
});
// 选项卡点击事件 // 选项卡点击事件
const handleTabClick = (tab) => { const handleTabClick = (tab) => {
console.log('切换到选项卡:', tab.name); console.log('切换到选项卡:', tab.name);
// 根据选择的选项卡加载不同数据
if (tab.name === 'vehicles') { if (tab.name === 'vehicles') {
// 加载车辆状态数据 // 加载车辆状态数据
} else if (tab.name === 'teams') { } else if (tab.name === 'teams') {
@ -419,96 +497,9 @@ const handleInspectionManagement3 = () => {
padding: 10px 0; padding: 10px 0;
} }
.gauge-chart { .personnel-chart {
width: 200px;
height: 200px;
position: relative;
}
.doughnut-chart {
width: 100%; width: 100%;
height: 100%; height: 300px;
position: relative;
}
.gauge-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.gauge-percentage {
font-size: 36px;
font-weight: 700;
color: #165dff;
line-height: 1;
}
.gauge-label {
font-size: 15px;
color: #606266;
margin-top: 6px;
font-weight: 500;
}
/* 环形图动画效果 */
.background-circle {
stroke: #f0f2f5;
}
.progress-circle {
transition: stroke-dashoffset 1s ease-in-out;
}
.online-progress {
stroke: #165dff;
filter: drop-shadow(0 0 6px rgba(22, 93, 255, 0.2));
}
.offline-progress {
stroke: #40c9c6;
filter: drop-shadow(0 0 6px rgba(64, 201, 198, 0.2));
}
/* 图例样式 */
.chart-legend {
margin-top: 16px;
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
}
.legend-item {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 0;
}
.legend-color {
width: 12px;
height: 12px;
border-radius: 4px;
flex-shrink: 0;
}
.legend-color.online {
background-color: #165dff;
box-shadow: 0 2px 4px rgba(22, 93, 255, 0.3);
}
.legend-color.offline {
background-color: #40c9c6;
box-shadow: 0 2px 4px rgba(64, 201, 198, 0.3);
}
.legend-text {
font-size: 13px;
color: #606266;
font-weight: 500;
} }
/* 统计网格 */ /* 统计网格 */
@ -574,12 +565,50 @@ const handleInspectionManagement3 = () => {
border-radius: 12px; border-radius: 12px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
overflow: hidden; overflow: hidden;
padding: 0 28px 28px 28px;
}
/* 滚动包装器 */
.scroll-wrapper {
height: 100%;
position: relative;
} }
/* 固定的顶部空间,不随内容滚动 */
.fixed-top-space {
height: 40px;
flex-shrink: 0;
}
/* 可滚动的内容区域 */
.scrollable-content { .scrollable-content {
max-height: calc(100vh - 340px); max-height: calc(120vh - 340px - 40px); /* 减去顶部固定空间的高度 */
overflow-y: auto; overflow: auto;
padding: 28px; scrollbar-width: thin;
scrollbar-color: rgba(150, 150, 150, 0.5) transparent;
}
/* 内容包装器 */
.content-wrapper {
padding: 0 28px 60px 28px;
}
/* Webkit浏览器自定义滚动条样式 */
.scrollable-content::-webkit-scrollbar {
width: 8px;
}
.scrollable-content::-webkit-scrollbar-track {
background: transparent;
border-radius: 4px;
}
.scrollable-content::-webkit-scrollbar-thumb {
background-color: rgba(150, 150, 150, 0.5);
border-radius: 4px;
border: 2px solid transparent;
background-clip: content-box;
}
.scrollable-content::-webkit-scrollbar-thumb:hover {
background-color: rgba(150, 150, 150, 0.8);
} }
/* 增强内容区域标题样式 */ /* 增强内容区域标题样式 */
@ -595,17 +624,18 @@ const handleInspectionManagement3 = () => {
/* 人员网格 */ /* 人员网格 */
.personnel-grid { .personnel-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-template-columns: repeat(3, 1fr);
gap: 20px; gap: 24px;
} }
.person-card { .person-card {
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
border-radius: 12px; border-radius: 8px;
padding: 20px; padding: 16px;
transition: all 0.3s ease; transition: all 0.3s ease;
background-color: #ffffff; background-color: #ffffff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
min-height: 220px;
} }
.person-card:hover { .person-card:hover {
@ -617,14 +647,14 @@ const handleInspectionManagement3 = () => {
.person-header { .person-header {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 20px; margin-bottom: 16px;
} }
.avatar { .avatar {
position: relative; position: relative;
width: 64px; width: 56px;
height: 64px; height: 56px;
margin-right: 16px; margin-right: 12px;
flex-shrink: 0; flex-shrink: 0;
} }
@ -640,8 +670,8 @@ const handleInspectionManagement3 = () => {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 0; right: 0;
width: 18px; width: 16px;
height: 18px; height: 16px;
border-radius: 50%; border-radius: 50%;
border: 3px solid #fff; border: 3px solid #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
@ -664,17 +694,17 @@ const handleInspectionManagement3 = () => {
} }
.person-name { .person-name {
font-size: 18px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #2c3e50; color: #2c3e50;
margin-bottom: 6px; margin-bottom: 4px;
line-height: 1.2; line-height: 1.2;
} }
.person-status { .person-status {
font-size: 13px; font-size: 12px;
padding: 3px 10px; padding: 2px 8px;
border-radius: 15px; border-radius: 12px;
display: inline-block; display: inline-block;
font-weight: 500; font-weight: 500;
} }
@ -695,28 +725,52 @@ const handleInspectionManagement3 = () => {
} }
.person-details { .person-details {
margin-bottom: 20px; margin-bottom: 16px;
border-top: 1px dashed #f0f0f0; border-top: none;
padding-top: 16px; padding-top: 0;
}
.detail-row {
display: flex;
margin-bottom: 8px;
border-bottom: 1px dotted #f0f0f0;
padding-bottom: 8px;
}
.detail-row:last-child {
margin-bottom: 0;
border-bottom: none;
padding-bottom: 0;
} }
.detail-item { .detail-item {
font-size: 13px; font-size: 13px;
color: #606266; color: #606266;
margin-bottom: 10px;
line-height: 1.6; line-height: 1.6;
flex: 1;
padding: 0 8px;
}
.detail-item:first-child {
padding-left: 0;
} }
.detail-item:last-child { .detail-item:last-child {
margin-bottom: 0; padding-right: 0;
}
.detail-item.full-width {
flex: 1 0 100%;
padding: 0;
} }
.person-actions { .person-actions {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: 12px; gap: 12px;
border-top: 1px dashed #f0f0f0; border-top: 1px solid #f0f0f0;
padding-top: 16px; padding-top: 16px;
margin-top: 16px;
} }
/* 美化按钮样式 */ /* 美化按钮样式 */
@ -862,5 +916,9 @@ const handleInspectionManagement3 = () => {
.personnel-grid { .personnel-grid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.personnel-chart {
height: 250px;
}
} }
</style> </style>

View File

@ -117,89 +117,10 @@
<!-- 图表区域 --> <!-- 图表区域 -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 py-4"> <div class="grid grid-cols-1 md:grid-cols-3 gap-6 py-4">
<!-- 饼图 - 进度条对比可视化 --> <!-- 饼图 - 使用指定的ECharts配置 -->
<div class="md:col-span-1"> <div class="md:col-span-1">
<p class="chart-title">进度指标对比</p> <p class="chart-title">进度指标对比</p>
<div class="relative w-40 h-40 mx-auto"> <div ref="pieChartRef" class="pie-chart-container"></div>
<!-- 饼图使用SVG绘制 - 显示三个进度条的占比对比 -->
<svg class="w-full h-full" viewBox="0 0 100 100">
<!-- 背景圆环 -->
<circle cx="50" cy="50" r="40" fill="none" stroke="#f3f4f6" stroke-width="12" />
<!-- 完成率部分 -->
<circle
cx="50"
cy="50"
r="40"
fill="none"
stroke="#f5222d"
stroke-width="12"
stroke-linecap="round"
:stroke-dasharray="completionLength"
:stroke-dashoffset="completionOffset"
transform="rotate(-90 50 50)"
style="transition: all 1.5s ease-in-out"
/>
<!-- 解决率部分 -->
<circle
cx="50"
cy="50"
r="40"
fill="none"
stroke="#10b981"
stroke-width="12"
stroke-linecap="round"
:stroke-dasharray="resolutionLength"
:stroke-dashoffset="resolutionOffset"
transform="rotate(-90 + completionRotation 50 50)"
style="transition: all 1.5s ease-in-out"
/>
<!-- 及时率部分 -->
<circle
cx="50"
cy="50"
r="40"
fill="none"
stroke="#6b7280"
stroke-width="12"
stroke-linecap="round"
:stroke-dasharray="timelinessLength"
:stroke-dashoffset="timelinessOffset"
transform="rotate(-90 + totalRotation 50 50)"
style="transition: all 1.5s ease-in-out"
/>
</svg>
<!-- 饼图中心显示 - 总完成度 -->
<div class="absolute inset-0 flex flex-col items-center justify-center">
<div class="w-24 h-24 rounded-full bg-white flex items-center justify-center shadow-lg">
<div class="text-center">
<p class="text-xs font-medium text-gray-500">平均完成度</p>
<p class="text-xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-blue-500 to-purple-500">
{{ averageRate.toFixed(1) }}%
</p>
</div>
</div>
</div>
</div>
<!-- 饼图图例 -->
<div class="mt-6 flex flex-col items-center space-y-3">
<div class="flex items-center">
<div class="w-4 h-4 rounded-full bg-red-500 mr-2 shadow-sm"></div>
<span class="text-sm text-gray-700">完成率 {{ completionRate }}%</span>
</div>
<div class="flex items-center">
<div class="w-4 h-4 rounded-full bg-green-500 mr-2 shadow-sm"></div>
<span class="text-sm text-gray-700">解决率 {{ resolutionRate }}%</span>
</div>
<div class="flex items-center">
<div class="w-4 h-4 rounded-full bg-gray-500 mr-2 shadow-sm"></div>
<span class="text-sm text-gray-700">及时率 {{ timelinessRate }}%</span>
</div>
</div>
</div> </div>
<!-- 进度条 --> <!-- 进度条 -->
@ -211,7 +132,7 @@
<span class="font-medium text-gray-800">{{ completionRate }}%</span> <span class="font-medium text-gray-800">{{ completionRate }}%</span>
</div> </div>
<div class="w-full bg-gray-200 rounded-full h-2 overflow-hidden"> <div class="w-full bg-gray-200 rounded-full h-2 overflow-hidden">
<div class="bg-red-500 h-2 rounded-full transition-all duration-1500 ease-out" :style="{ width: completionRate + '%' }"></div> <div class="bg-blue-500 h-2 rounded-full transition-all duration-1500 ease-out" :style="{ width: completionRate + '%' }"></div>
</div> </div>
</div> </div>
<div> <div>
@ -220,7 +141,7 @@
<span class="font-medium text-gray-800">{{ resolutionRate }}%</span> <span class="font-medium text-gray-800">{{ resolutionRate }}%</span>
</div> </div>
<div class="w-full bg-gray-200 rounded-full h-2 overflow-hidden"> <div class="w-full bg-gray-200 rounded-full h-2 overflow-hidden">
<div class="bg-green-500 h-2 rounded-full transition-all duration-1500 ease-out" :style="{ width: resolutionRate + '%' }"></div> <div class="bg-red-500 h-2 rounded-full transition-all duration-1500 ease-out" :style="{ width: resolutionRate + '%' }"></div>
</div> </div>
</div> </div>
<div> <div>
@ -229,7 +150,7 @@
<span class="font-medium text-gray-800">{{ timelinessRate }}%</span> <span class="font-medium text-gray-800">{{ timelinessRate }}%</span>
</div> </div>
<div class="w-full bg-gray-200 rounded-full h-2 overflow-hidden"> <div class="w-full bg-gray-200 rounded-full h-2 overflow-hidden">
<div class="bg-gray-500 h-2 rounded-full transition-all duration-1500 ease-out" :style="{ width: timelinessRate + '%' }"></div> <div class="bg-green-500 h-2 rounded-full transition-all duration-1500 ease-out" :style="{ width: timelinessRate + '%' }"></div>
</div> </div>
</div> </div>
</div> </div>
@ -441,9 +362,10 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted, computed } from 'vue'; import { ref, onMounted, computed, onUnmounted } from 'vue';
import router from '@/router'; import router from '@/router';
import TitleComponent from '@/views/demo/components/TitleComponent.vue'; import TitleComponent from '@/views/demo/components/TitleComponent.vue';
import * as echarts from 'echarts';
// 筛选条件 // 筛选条件
const filterStatus = ref('all'); const filterStatus = ref('all');
@ -473,26 +395,90 @@ const problemTypes = ref({
diskSpace: 15 // 磁盘空间状态 diskSpace: 15 // 磁盘空间状态
}); });
// 计算饼图相关参数 // ECharts 饼图相关
const totalCircumference = 2 * Math.PI * 40; // 圆环总周长r=40 const pieChartRef = ref(null);
let pieChart = null;
// 各进度条在饼图中的长度
const completionLength = computed(() => (completionRate.value / 100) * totalCircumference);
const resolutionLength = computed(() => (resolutionRate.value / 100) * totalCircumference);
const timelinessLength = computed(() => (timelinessRate.value / 100) * totalCircumference);
// 各进度条在饼图中的偏移量
const completionOffset = ref(0);
const resolutionOffset = ref(0);
const timelinessOffset = ref(0);
// 各进度条的旋转角度(用于连续显示)
const completionRotation = computed(() => (completionRate.value / 100) * 360);
const totalRotation = computed(() => completionRotation.value + (resolutionRate.value / 100) * 360);
// 计算平均完成度 // 计算平均完成度
const averageRate = computed(() => (completionRate.value + resolutionRate.value + timelinessRate.value) / 3); const averageRate = computed(() => (completionRate.value + resolutionRate.value + timelinessRate.value) / 3);
// 初始化饼图 - 使用指定的option配置
const initPieChart = () => {
// 确保DOM元素已存在
if (!pieChartRef.value) return;
// 销毁已存在的实例
if (pieChart) {
pieChart.dispose();
}
// 创建新实例
pieChart = echarts.init(pieChartRef.value);
// 设置图表配置 - 使用指定的option
const option = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: '进度指标',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
padAngle: 5,
itemStyle: {
borderRadius: 10
},
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold',
formatter: function (params) {
// 鼠标悬停时显示当前指标的百分比
return params.value + '%';
}
}
},
labelLine: {
show: false
},
data: [
{ value: completionRate.value, name: '完成率', itemStyle: { color: '#5470c6' } },
{ value: resolutionRate.value, name: '解决率', itemStyle: { color: '#f56c6c' } },
{ value: timelinessRate.value, name: '及时率', itemStyle: { color: '#67c23a' } }
]
}
]
};
// 设置配置项
pieChart.setOption(option);
// 响应窗口大小变化
const handleResize = () => {
if (pieChart) {
pieChart.resize();
}
};
window.addEventListener('resize', handleResize);
// 组件卸载时移除事件监听
onUnmounted(() => {
window.removeEventListener('resize', handleResize);
});
};
// 时间范围切换函数 // 时间范围切换函数
const handleTimeRangeChange = (range) => { const handleTimeRangeChange = (range) => {
timeRange.value = range; timeRange.value = range;
@ -580,6 +566,9 @@ const fetchDashboardData = () => {
solvedProblems.value = mockData.solvedProblems; solvedProblems.value = mockData.solvedProblems;
avgCompletionTime.value = mockData.avgCompletionTime; avgCompletionTime.value = mockData.avgCompletionTime;
problemTypes.value = mockData.problemTypes; problemTypes.value = mockData.problemTypes;
// 更新饼图
initPieChart();
}, 800); // 模拟网络延迟 }, 800); // 模拟网络延迟
}; };
@ -588,6 +577,14 @@ onMounted(() => {
fetchDashboardData(); fetchDashboardData();
}); });
// 组件卸载时销毁图表实例
onUnmounted(() => {
if (pieChart) {
pieChart.dispose();
pieChart = null;
}
});
// 导航方法 // 导航方法
const handleInspection1 = () => { const handleInspection1 = () => {
router.push('/rili/rili'); router.push('/rili/rili');
@ -651,12 +648,6 @@ const handleInspectionManagement3 = () => {
border-radius: 4px; border-radius: 4px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
padding: 2px; padding: 2px;
overflow-x: auto;
scrollbar-width: none;
}
.navigation-tabs::-webkit-scrollbar {
display: none;
} }
.nav-tab { .nav-tab {
@ -667,7 +658,8 @@ const handleInspectionManagement3 = () => {
font-size: 14px; font-size: 14px;
color: #606266; color: #606266;
border-right: 1px solid #f0f0f0; border-right: 1px solid #f0f0f0;
white-space: nowrap; flex: 1;
text-align: center;
} }
.nav-tab:last-child { .nav-tab:last-child {
@ -829,6 +821,13 @@ const handleInspectionManagement3 = () => {
text-align: center; text-align: center;
} }
/* 饼图容器 */
.pie-chart-container {
width: 100%;
height: 300px;
margin: 0 auto;
}
/* 区域标题 */ /* 区域标题 */
.section-title { .section-title {
font-size: 14px; font-size: 14px;
@ -837,30 +836,6 @@ const handleInspectionManagement3 = () => {
margin: 0 0 12px 0; margin: 0 0 12px 0;
} }
/* 记录列表样式 */
.record-list {
margin: 0;
padding: 0;
}
.record-item {
padding: 16px 0;
}
.record-title {
font-size: 14px;
font-weight: 500;
color: #303133;
margin: 0;
}
.record-time,
.record-type {
font-size: 12px;
color: #909399;
margin: 4px 0 0 0;
}
/* 状态标签 */ /* 状态标签 */
.status-tag { .status-tag {
font-size: 12px; font-size: 12px;
@ -886,18 +861,6 @@ const handleInspectionManagement3 = () => {
border: 1px solid #ffe3e0; border: 1px solid #ffe3e0;
} }
/* 操作按钮 */
.action-btn {
color: #409eff;
font-size: 12px;
padding: 4px 8px;
}
.action-btn:hover {
color: #66b1ff;
background-color: #ecf5ff;
}
/* 滚动条样式优化 */ /* 滚动条样式优化 */
.scrollbar-thin { .scrollbar-thin {
scrollbar-width: thin; scrollbar-width: thin;

View File

@ -25,7 +25,7 @@
<span>{{ <span>{{
detailInfo.rentSum && !isNaN(detailInfo.rentSum) detailInfo.rentSum && !isNaN(detailInfo.rentSum)
? detailInfo.rentSum >= 10000 ? detailInfo.rentSum >= 10000
? proxy.formatPrice((detailInfo.rentSum / 10000).toFixed(2)) + ' 万元' ? proxy.formatPrice(detailInfo.rentSum / 10000) + ' 万元'
: proxy.formatPrice(detailInfo.rentSum) + ' 元' : proxy.formatPrice(detailInfo.rentSum) + ' 元'
: '0.00 元' : '0.00 元'
}}</span> }}</span>