bxztApp/packages/screen/src/views/RiskWarning/Dialog/responseStatusDialog.vue

449 lines
11 KiB
Vue
Raw Normal View History

2026-04-03 18:08:42 +08:00
<template>
<base-dialog
v-model:visible="props.visible"
title="响应情况"
:table-data="tableData"
:table-columns="tableColumns"
:table-height="200"
:total="total"
:current-page="currentPage"
:page-size="pageSize"
:z-index="1000"
:max-width="1150"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
@close="handleClose"
>
<!-- 标题栏下方自定义插槽 -->
<template #header>
<!-- 统计卡片 -->
<div class="stats-cards">
<div class="stat-card">
<div class="stat-label">影响桥梁</div>
<div class="stat-value">2933</div>
</div>
<div class="stat-card">
<div class="stat-label">影响边坡</div>
<div class="stat-value">2933</div>
</div>
<div class="stat-card">
<div class="stat-label">影响隧道</div>
<div class="stat-value">2933</div>
</div>
<div class="stat-card">
<div class="stat-label">影响项目</div>
<div class="stat-value">2933</div>
</div>
<div class="stat-card">
<div class="stat-label">影响路段</div>
<div class="stat-value">2432</div>
</div>
</div>
</template>
<!-- 筛选区域 -->
<template #filter>
<div class="filter-row">
<div class="filter-item">
<el-select
v-model="filterForm.pointType"
placeholder="影响点类型"
class="filter-select"
>
<el-option
v-for="option in pointTypeOptions"
:key="option.value"
:label="option.label"
:value="option.value"
/>
</el-select>
</div>
<div class="filter-item">
<el-select
v-model="filterForm.pointLevel"
placeholder="影响点等级"
class="filter-select"
>
<el-option
v-for="option in pointLevelOptions"
:key="option.value"
:label="option.label"
:value="option.value"
/>
</el-select>
</div>
<div class="filter-item">
<el-select
v-model="filterForm.isResponded"
placeholder="是否回应"
class="filter-select"
>
<el-option
v-for="option in isRespondedOptions"
:key="option.value"
:label="option.label"
:value="option.value"
/>
</el-select>
</div>
</div>
</template>
<!-- 影响点等级列插槽 -->
<template #pointLevel="{ row }">
<span class="level-tag" :class="row.levelClass">{{ row.pointLevel }}</span>
</template>
<!-- 交通主管部门负责人列插槽 -->
<template #trafficDept="{ row }">
<div class="person-info">
<span class="person-name">{{ row.trafficDept.name }}</span>
<span class="person-phone">{{ row.trafficDept.phone }}</span>
</div>
</template>
<!-- 公路机构责任人列插槽 -->
<template #roadOrg="{ row }">
<div class="person-info">
<span class="person-name">{{ row.roadOrg.name }}</span>
<span class="person-phone">{{ row.roadOrg.phone }}</span>
</div>
</template>
<!-- 养护站负责人列插槽 -->
<template #maintenance="{ row }">
<div class="person-info">
<span class="person-name">{{ row.maintenance.name }}</span>
<span class="person-phone">{{ row.maintenance.phone }}</span>
</div>
</template>
<!-- 护路员列插槽 -->
<template #roadKeeper="{ row }">
<div class="person-info">
<span class="person-name">{{ row.roadKeeper.name }}</span>
<span class="person-phone">{{ row.roadKeeper.phone }}</span>
</div>
</template>
<!-- 回应状态列插槽 -->
<template #responseStatus="{ row }">
<span class="response-status" :class="row.responseClass">{{ row.responseStatus }}</span>
</template>
<!-- 最新催告时间列插槽 -->
<template #urgeTime="{ row }">
<div class="time-info">
<span class="time-date">{{ row.urgeTime.date }}</span>
<span class="time-clock">{{ row.urgeTime.time }}</span>
</div>
</template>
<!-- 操作列插槽 -->
<template #operation="{ row }">
<span class="detail-link" @click="handleDetail(row)">详情</span>
</template>
</base-dialog>
</template>
<script setup>
import { ref, computed, watch } from "vue";
import { Close, ArrowLeft, ArrowRight } from "@element-plus/icons-vue";
import { pointTypeOptions, pointLevelOptions, isRespondedOptions } from "../component/index.js";
import baseDialog from "../component/baseDialog.vue";
const props = defineProps({
visible: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(["update:visible", "close", "detail"]);
// 筛选表单
const filterForm = ref({
pointType: "",
pointLevel: "",
isResponded: "",
});
// 表格列配置
const tableColumns = ref([
{ prop: "id", label: "序号", width: "50px" },
{ prop: "pointType", label: "影响点类型", width: "80px" },
{ prop: "pointLocation", label: "影响点位置", width: "150px" },
{ prop: "pointLevel", label: "影响点等级", width: "90px", slot: "pointLevel" },
{ prop: "checkCount", label: "查次数", width: "60px" },
{ prop: "trafficDept", label: "交通主管部门负责人", width: "120px", slot: "trafficDept" },
{ prop: "roadOrg", label: "公路机构责任人", width: "110px", slot: "roadOrg" },
{ prop: "maintenance", label: "养护站负责人", width: "110px", slot: "maintenance" },
{ prop: "roadKeeper", label: "护路员", width: "80px", slot: "roadKeeper" },
{ prop: "responseStatus", label: "回应状态", width: "70px", slot: "responseStatus" },
{ prop: "urgeTime", label: "最新催告时间", width: "110px", slot: "urgeTime" },
{ prop: "operation", label: "操作", width: "50px", slot: "operation" },
]);
// 表格数据
const tableData = ref([
{
id: 1,
pointType: "边坡",
pointLocation: "武汉-大理(K1452+951至K1462+209)",
pointLevel: "一般隐患",
levelClass: "level-normal",
checkCount: 2,
trafficDept: { name: "罗宸", phone: "17623865172" },
roadOrg: { name: "李海平", phone: "1372386532" },
maintenance: { name: "苏祖兵", phone: "13594331090" },
roadKeeper: { name: "凌承礼", phone: "1592393704" },
responseStatus: "已回应",
responseClass: "status-responded",
urgeTime: { date: "2026-03-28", time: "12:30:00" },
},
{
id: 12,
pointType: "边坡",
pointLocation: "武汉-大理(K1452+951至K1462+209)",
pointLevel: "一般隐患",
levelClass: "level-normal",
checkCount: 2,
trafficDept: { name: "罗宸", phone: "17623865172" },
roadOrg: { name: "李海平", phone: "1372386532" },
maintenance: { name: "苏祖兵", phone: "13594331090" },
roadKeeper: { name: "凌承礼", phone: "1592393704" },
responseStatus: "已回应",
responseClass: "status-responded",
urgeTime: { date: "2026-03-28", time: "12:30:00" },
},
]);
tableData.value.push(...tableData.value);
tableData.value.push(...tableData.value);
// 分页
const currentPage = ref(1);
const pageSize = ref(10);
const total = ref(36);
// 关闭对话框
const handleClose = () => {
emit("update:visible", false);
emit("close");
};
// 点击遮罩关闭已由base-dialog组件处理
// 查看详情
const handleDetail = (item) => {
emit("detail", item);
};
// 分页操作
const handleSizeChange = (val) => {
pageSize.value = val;
fetchData();
};
const handleCurrentChange = (val) => {
currentPage.value = val;
fetchData();
};
// 获取数据
const fetchData = () => {
console.log("获取第", currentPage.value, "页数据");
// 实际项目中调用API获取数据
};
// 监听visible变化
watch(
() => props.visible,
(newVal) => {
if (newVal) {
currentPage.value = 1;
fetchData();
}
},
);
</script>
<style lang="scss" scoped>
// 筛选区域
.filter-section {
margin-bottom: 20px;
.filter-row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 12px;
}
.filter-item {
.filter-select {
width: 150px;
:deep(.el-input__wrapper) {
background-color: rgba(30, 70, 120, 0.4);
border: 1px solid rgba(64, 169, 255, 0.3);
box-shadow: none;
border-radius: 4px;
.el-input__inner {
color: #fff;
font-size: 13px;
&::placeholder {
color: rgba(255, 255, 255, 0.5);
}
}
.el-input__suffix {
.el-icon {
color: rgba(255, 255, 255, 0.6);
}
}
}
}
}
}
// 表格单元格样式
.level-tag {
display: inline-block;
padding: 2px 8px;
border-radius: 4px;
font-size: 11px;
&.level-normal {
background-color: rgba(250, 219, 95, 0.2);
color: #fadb5f;
border: 1px solid rgba(250, 219, 95, 0.4);
}
&.level-serious {
background-color: rgba(255, 77, 79, 0.2);
color: #ff4d4f;
border: 1px solid rgba(255, 77, 79, 0.4);
}
}
.person-info {
display: flex;
flex-direction: column;
gap: 2px;
.person-name {
font-size: 12px;
color: rgba(255, 255, 255, 0.9);
}
.person-phone {
font-size: 11px;
color: rgba(255, 255, 255, 0.6);
}
}
.response-status {
font-size: 12px;
&.status-responded {
color: #52c41a;
}
&.status-unresponded {
color: #ff7a45;
}
}
.time-info {
display: flex;
flex-direction: column;
gap: 2px;
.time-date {
font-size: 12px;
color: rgba(255, 255, 255, 0.9);
}
.time-clock {
font-size: 11px;
color: rgba(255, 255, 255, 0.6);
}
}
.detail-link {
color: #40a9ff;
cursor: pointer;
font-size: 12px;
&:hover {
color: #69c0ff;
text-decoration: underline;
}
}
// 下拉菜单样式
:deep(.el-select-dropdown) {
background-color: rgba(20, 50, 90, 0.98);
border: 1px solid rgba(64, 169, 255, 0.3);
.el-select-dropdown__item {
color: rgba(255, 255, 255, 0.85);
&:hover {
background-color: rgba(64, 169, 255, 0.2);
}
&.selected {
background-color: rgba(64, 169, 255, 0.3);
color: #40a9ff;
}
}
}
// 统计卡片
.stats-cards {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 20px;
margin-bottom: 20px;
.stat-card {
background: linear-gradient(
135deg,
rgba(30, 70, 120, 0.6) 0%,
rgba(20, 50, 90, 0.8) 100%
);
border: 2px solid rgba(64, 169, 255, 0.4);
border-radius: 8px;
padding: 8px 20px;
text-align: center;
transition: all 0.3s;
cursor: pointer;
&:hover {
border-color: rgba(64, 169, 255, 0.8);
box-shadow: 0 0 20px rgba(64, 169, 255, 0.3);
transform: translateY(-2px);
}
.stat-label {
font-size: 14px;
color: rgba(255, 255, 255, 0.8);
margin-bottom: 8px;
font-weight: 500;
}
.stat-value {
font-size: 28px;
font-weight: bold;
color: #40a9ff;
text-shadow: 0 0 10px rgba(64, 169, 255, 0.5);
}
}
}
</style>