2026-04-03 18:08:42 +08:00
|
|
|
<template>
|
|
|
|
|
<base-dialog
|
|
|
|
|
v-model:visible="props.visible"
|
2026-04-22 18:05:38 +08:00
|
|
|
title="管控情况"
|
2026-04-03 18:08:42 +08:00
|
|
|
:table-data="tableData"
|
|
|
|
|
:table-columns="tableColumns"
|
|
|
|
|
:table-height="tableHeight"
|
|
|
|
|
:total="total"
|
|
|
|
|
:current-page="currentPage"
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
@close="handleClose"
|
|
|
|
|
>
|
|
|
|
|
<!-- 筛选区域 -->
|
|
|
|
|
<template #filter>
|
|
|
|
|
<div class="filter-row">
|
|
|
|
|
<div class="filter-item">
|
2026-04-20 10:22:34 +08:00
|
|
|
<span class="filter-label">影响区域</span>
|
2026-04-13 11:38:11 +08:00
|
|
|
<el-select
|
|
|
|
|
:teleported="false"
|
|
|
|
|
v-model="filterForm.district"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
class="filter-select"
|
|
|
|
|
clearable
|
2026-04-21 15:34:43 +08:00
|
|
|
@change="handleFilterChange"
|
2026-04-13 11:38:11 +08:00
|
|
|
>
|
2026-04-03 18:08:42 +08:00
|
|
|
<el-option
|
|
|
|
|
v-for="item in regionOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="filter-item">
|
|
|
|
|
<span class="filter-label">类型</span>
|
2026-04-13 11:38:11 +08:00
|
|
|
<el-select
|
|
|
|
|
:teleported="false"
|
|
|
|
|
v-model="filterForm.type"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
class="filter-select"
|
|
|
|
|
clearable
|
2026-04-21 15:34:43 +08:00
|
|
|
@change="handleFilterChange"
|
2026-04-13 11:38:11 +08:00
|
|
|
>
|
2026-04-03 18:08:42 +08:00
|
|
|
<el-option
|
|
|
|
|
v-for="item in typeOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="filter-item">
|
|
|
|
|
<span class="filter-label">管控措施</span>
|
2026-04-13 11:38:11 +08:00
|
|
|
<el-select
|
|
|
|
|
:teleported="false"
|
|
|
|
|
v-model="filterForm.roadConditionType"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
class="filter-select"
|
|
|
|
|
clearable
|
|
|
|
|
@change="handleFilterChange"
|
|
|
|
|
>
|
2026-04-03 18:08:42 +08:00
|
|
|
<el-option
|
|
|
|
|
v-for="item in controlMeasureOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 起止桩号列插槽 -->
|
|
|
|
|
<template #stakeNo="{ row }">
|
|
|
|
|
<el-tooltip :content="row.stakeNo" placement="top" :show-after="500">
|
|
|
|
|
<span class="ellipsis-text">{{ row.stakeNo }}</span>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 路况位置列插槽 -->
|
|
|
|
|
<template #location="{ row }">
|
|
|
|
|
<el-tooltip :content="row.location" placement="top" :show-after="500">
|
|
|
|
|
<span class="ellipsis-text">{{ row.location }}</span>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 管控措施列插槽 -->
|
2026-04-13 11:38:11 +08:00
|
|
|
<template #roadConditionType="{ row }">
|
2026-04-17 14:50:25 +08:00
|
|
|
<span :class="['control-tag', getControlClass(row.roadConditionType)]">
|
|
|
|
|
{{ row.roadConditionType }}
|
|
|
|
|
</span>
|
2026-04-03 18:08:42 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 操作列插槽 -->
|
|
|
|
|
<template #operation="{ row }">
|
|
|
|
|
<span class="detail-link" @click="handleDetail(row)">详情</span>
|
|
|
|
|
</template>
|
|
|
|
|
</base-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-04-21 15:34:43 +08:00
|
|
|
import { ref, computed, watch, inject } from 'vue';
|
2026-04-17 14:50:25 +08:00
|
|
|
import { Close } from '@element-plus/icons-vue';
|
|
|
|
|
import { regionOptions, typeOptions, controlMeasureOptions } from '../component/index.js';
|
|
|
|
|
import BaseDialog from '../component/baseDialog.vue';
|
|
|
|
|
import { request } from '@/utils/request';
|
2026-04-21 15:34:43 +08:00
|
|
|
import { formatDateTime } from '../component/index.js';
|
|
|
|
|
0;
|
|
|
|
|
// 注入日期范围
|
|
|
|
|
// const dateRange = inject('dateRange', ref([]));
|
2026-04-03 18:08:42 +08:00
|
|
|
const props = defineProps({
|
|
|
|
|
visible: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
2026-04-21 15:34:43 +08:00
|
|
|
dateRange: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => [],
|
|
|
|
|
},
|
2026-04-23 17:54:16 +08:00
|
|
|
itemFilterForm: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: () => {},
|
|
|
|
|
},
|
2026-04-03 18:08:42 +08:00
|
|
|
});
|
|
|
|
|
|
2026-04-20 10:22:34 +08:00
|
|
|
const emit = defineEmits(['update:visible', 'close', 'detail', 'itemdata']);
|
2026-04-03 18:08:42 +08:00
|
|
|
|
|
|
|
|
// 筛选表单
|
|
|
|
|
const filterForm = ref({
|
2026-04-17 14:50:25 +08:00
|
|
|
district: '',
|
|
|
|
|
type: '',
|
|
|
|
|
roadConditionType: '',
|
2026-04-03 18:08:42 +08:00
|
|
|
});
|
2026-04-23 17:54:16 +08:00
|
|
|
watch(
|
|
|
|
|
() => props.itemFilterForm,
|
|
|
|
|
newVal => {
|
|
|
|
|
console.log('newVal', newVal);
|
|
|
|
|
filterForm.value.roadConditionType = newVal.label.substring(0, newVal.label.length - 1) || '';
|
|
|
|
|
currentPage.value = 1;
|
|
|
|
|
fetchData();
|
|
|
|
|
}
|
|
|
|
|
);
|
2026-04-03 18:08:42 +08:00
|
|
|
|
|
|
|
|
// 影响区域选项
|
|
|
|
|
// 已从 index.js 导入
|
|
|
|
|
|
|
|
|
|
// 类型选项
|
|
|
|
|
// 已从 index.js 导入
|
|
|
|
|
|
|
|
|
|
// 管控措施选项
|
|
|
|
|
// 已从 index.js 导入
|
|
|
|
|
|
|
|
|
|
// 表格高度
|
|
|
|
|
const tableHeight = ref(300);
|
|
|
|
|
|
|
|
|
|
// 表格列配置
|
|
|
|
|
const tableColumns = ref([
|
2026-04-17 14:50:25 +08:00
|
|
|
{ prop: 'id', label: '序号', width: '' },
|
2026-04-20 10:22:34 +08:00
|
|
|
{ prop: 'district', label: '影响区域', width: '' },
|
2026-04-17 14:50:25 +08:00
|
|
|
{ prop: 'routeNo', label: '线路编号', width: '' },
|
|
|
|
|
{ prop: 'stakeNo', label: '起止桩号', width: '', slot: 'stakeNo' },
|
|
|
|
|
{ prop: 'location', label: '路况位置', width: '', slot: 'location' },
|
|
|
|
|
{ prop: 'occurrenceTime', label: '发生时间', width: '' },
|
2026-04-13 16:38:07 +08:00
|
|
|
// { prop: "routeNo2", label: "线路编号", width: "" },
|
2026-04-17 14:50:25 +08:00
|
|
|
{ prop: 'type', label: '类型', width: '' },
|
2026-04-03 18:08:42 +08:00
|
|
|
{
|
2026-04-17 14:50:25 +08:00
|
|
|
prop: 'roadConditionType',
|
|
|
|
|
label: '管控措施',
|
|
|
|
|
width: '',
|
|
|
|
|
slot: 'roadConditionType',
|
2026-04-03 18:08:42 +08:00
|
|
|
},
|
2026-04-17 14:50:25 +08:00
|
|
|
{ prop: 'operation', label: '操作', width: '', slot: 'operation' },
|
2026-04-03 18:08:42 +08:00
|
|
|
]);
|
|
|
|
|
|
2026-04-13 11:38:11 +08:00
|
|
|
// 表格数据
|
|
|
|
|
const tableData = ref([]);
|
|
|
|
|
|
2026-04-03 18:08:42 +08:00
|
|
|
// 分页
|
|
|
|
|
const currentPage = ref(1);
|
|
|
|
|
const pageSize = ref(10);
|
|
|
|
|
const total = ref(36);
|
|
|
|
|
|
|
|
|
|
const totalPages = computed(() => Math.ceil(total.value / pageSize.value));
|
|
|
|
|
|
|
|
|
|
const visiblePages = computed(() => {
|
|
|
|
|
const pages = [];
|
|
|
|
|
const maxVisible = 5;
|
|
|
|
|
let start = Math.max(1, currentPage.value - Math.floor(maxVisible / 2));
|
|
|
|
|
let end = Math.min(totalPages.value, start + maxVisible - 1);
|
|
|
|
|
|
|
|
|
|
if (end - start + 1 < maxVisible) {
|
|
|
|
|
start = Math.max(1, end - maxVisible + 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (let i = start; i <= end; i++) {
|
|
|
|
|
pages.push(i);
|
|
|
|
|
}
|
|
|
|
|
return pages;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 获取管控措施样式类
|
2026-04-17 14:50:25 +08:00
|
|
|
const getControlClass = measure => {
|
2026-04-03 18:08:42 +08:00
|
|
|
const classMap = {
|
2026-04-17 14:50:25 +08:00
|
|
|
全幅封闭: 'control-close',
|
|
|
|
|
半幅封闭: 'control-half',
|
|
|
|
|
正常通行: 'control-normal',
|
|
|
|
|
限制通行: 'control-limit',
|
2026-04-21 15:34:43 +08:00
|
|
|
限速限车: 'control-limit',
|
|
|
|
|
告警阻拦: 'control-limit',
|
|
|
|
|
半幅通行: 'control-half',
|
|
|
|
|
限速: 'control-limit',
|
|
|
|
|
告警阻拦: 'control-limit',
|
2026-04-03 18:08:42 +08:00
|
|
|
};
|
2026-04-17 14:50:25 +08:00
|
|
|
return classMap[measure] || '';
|
2026-04-03 18:08:42 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 关闭对话框
|
|
|
|
|
const handleClose = () => {
|
2026-04-17 14:50:25 +08:00
|
|
|
emit('update:visible', false);
|
|
|
|
|
emit('close');
|
2026-04-03 18:08:42 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 查看详情
|
2026-04-17 14:50:25 +08:00
|
|
|
const handleDetail = item => {
|
|
|
|
|
emit('detail', item);
|
2026-04-20 10:22:34 +08:00
|
|
|
emit('itemdata', item);
|
2026-04-03 18:08:42 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 分页操作
|
2026-04-17 14:50:25 +08:00
|
|
|
const handleSizeChange = val => {
|
2026-04-03 18:08:42 +08:00
|
|
|
pageSize.value = val;
|
|
|
|
|
fetchData();
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-17 14:50:25 +08:00
|
|
|
const handleCurrentChange = val => {
|
2026-04-03 18:08:42 +08:00
|
|
|
currentPage.value = val;
|
|
|
|
|
fetchData();
|
|
|
|
|
};
|
2026-04-13 11:38:11 +08:00
|
|
|
// 筛选条件改变时触发
|
|
|
|
|
const handleFilterChange = () => {
|
|
|
|
|
currentPage.value = 1;
|
|
|
|
|
fetchData();
|
|
|
|
|
};
|
2026-04-03 18:08:42 +08:00
|
|
|
// 获取数据
|
2026-04-13 11:38:11 +08:00
|
|
|
const fetchData = async () => {
|
|
|
|
|
try {
|
2026-04-21 15:34:43 +08:00
|
|
|
let params = {
|
|
|
|
|
start: '',
|
|
|
|
|
end: '',
|
|
|
|
|
};
|
|
|
|
|
if (props.dateRange && props.dateRange.length === 2) {
|
|
|
|
|
params.start = formatDateTime(props.dateRange[0]);
|
|
|
|
|
params.end = formatDateTime(props.dateRange[1]);
|
2026-04-13 11:38:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const res = await request({
|
2026-04-17 14:50:25 +08:00
|
|
|
url: '/snow-ops-platform/sm-event/dashboard/control-list',
|
|
|
|
|
method: 'GET',
|
2026-04-13 11:38:11 +08:00
|
|
|
params: {
|
2026-04-21 15:34:43 +08:00
|
|
|
start: params.start,
|
|
|
|
|
end: params.end,
|
2026-04-13 11:38:11 +08:00
|
|
|
pageNum: currentPage.value,
|
|
|
|
|
pageSize: pageSize.value,
|
2026-04-21 15:34:43 +08:00
|
|
|
// measureType: measureType,
|
|
|
|
|
districtCode: filterForm.value.district, // 影响区域
|
|
|
|
|
roadConditionType: filterForm.value.type, // 类型
|
|
|
|
|
processingMeasure: filterForm.value.roadConditionType, // 管控措施
|
2026-04-13 11:38:11 +08:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-17 14:50:25 +08:00
|
|
|
if (res.code === '00000' && res.data) {
|
2026-04-13 11:38:11 +08:00
|
|
|
const data = res.data;
|
|
|
|
|
// 转换数据格式
|
2026-04-17 14:50:25 +08:00
|
|
|
tableData.value = data.records.map((item, index) => {
|
2026-04-13 11:38:11 +08:00
|
|
|
return {
|
2026-04-21 15:34:43 +08:00
|
|
|
gl1SjId: item.sjId || '-',
|
2026-04-17 14:50:25 +08:00
|
|
|
id: currentPage.value * pageSize.value - (pageSize.value - index - 1),
|
|
|
|
|
district: item.affectedArea || '-',
|
|
|
|
|
routeNo: item.routeNo || '-',
|
|
|
|
|
stakeNo: `${item.startStakeNo}-${item.endStakeNo}` || '-',
|
|
|
|
|
location: item.occurLocation || '-',
|
|
|
|
|
occurrenceTime: item.occurTime || '-',
|
2026-04-13 16:38:07 +08:00
|
|
|
// routeNo2: item.routeNo || "-",
|
2026-04-17 14:50:25 +08:00
|
|
|
type: item.roadConditionType || '-',
|
|
|
|
|
roadConditionType: item.processingMeasure || '-',
|
|
|
|
|
expectRecoverTime: item.expectRecoverTime || '-',
|
|
|
|
|
eventStatus: item.eventStatus || '-',
|
2026-04-13 11:38:11 +08:00
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
total.value = data.total;
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
2026-04-22 18:05:38 +08:00
|
|
|
console.error('获取管控情况数据失败:', error);
|
2026-04-13 11:38:11 +08:00
|
|
|
}
|
2026-04-03 18:08:42 +08:00
|
|
|
};
|
|
|
|
|
|
2026-04-21 15:34:43 +08:00
|
|
|
watch(
|
|
|
|
|
() => filterForm.value,
|
|
|
|
|
newVal => {
|
|
|
|
|
console.log('filterForm.value变化:', newVal);
|
|
|
|
|
if (newVal) {
|
|
|
|
|
currentPage.value = 1;
|
|
|
|
|
fetchData();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
2026-04-03 18:08:42 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
// 筛选区域
|
|
|
|
|
.filter-section {
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
|
|
|
|
.filter-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
|
|
|
|
.filter-label {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: rgba(255, 255, 255, 0.8);
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-select {
|
|
|
|
|
width: 120px;
|
|
|
|
|
|
|
|
|
|
: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.4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-input__suffix {
|
|
|
|
|
.el-icon {
|
|
|
|
|
color: rgba(255, 255, 255, 0.6);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 省略号文本
|
|
|
|
|
.ellipsis-text {
|
|
|
|
|
display: block;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 管控措施标签
|
|
|
|
|
.control-tag {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
padding: 2px 10px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
|
|
|
|
&.control-close {
|
|
|
|
|
background-color: rgba(255, 77, 79, 0.2);
|
|
|
|
|
color: #ff4d4f;
|
|
|
|
|
border: 1px solid rgba(255, 77, 79, 0.4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.control-half {
|
|
|
|
|
background-color: rgba(255, 122, 0, 0.2);
|
|
|
|
|
color: #ff7a00;
|
|
|
|
|
border: 1px solid rgba(255, 122, 0, 0.4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.control-normal {
|
|
|
|
|
background-color: rgba(82, 196, 26, 0.2);
|
|
|
|
|
color: #52c41a;
|
|
|
|
|
border: 1px solid rgba(82, 196, 26, 0.4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.control-limit {
|
|
|
|
|
background-color: rgba(250, 219, 20, 0.2);
|
|
|
|
|
color: #fadb14;
|
|
|
|
|
border: 1px solid rgba(250, 219, 20, 0.4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 详情链接
|
|
|
|
|
.detail-link {
|
|
|
|
|
color: #40a9ff;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
transition: color 0.3s;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
color: #69c0ff;
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|