This commit is contained in:
fanjia 2026-05-09 18:16:49 +08:00
commit 68660700ed
3 changed files with 708 additions and 140 deletions

View File

@ -50,7 +50,7 @@ import tunnelLineIcon from '../../../assets/MaMap_img/线路icon定位@2x.png'
import mapInfoDialog from '../Dialog/mapInfoDialog.vue'
import centerInfoCard from '../Dialog/centerInfoCard.vue'
import hazardPointSituationDialog from '../Dialog/hazardPointSituationDialog.vue'
import I from '../../../../dist/cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain'
// import I from '../../../../dist/cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain'
const mapContainer = ref(null)
const loading = ref(false)

View File

@ -1,159 +1,715 @@
<template>
<div class="detail-container">
<el-card class="basic-card">
<template #header>
<div class="card-header">
<span>基本信息</span>
</div>
</template>
<el-descriptions column="3">
<el-descriptions-item label="预警标题">{{ detailData.headline }}</el-descriptions-item>
<el-descriptions-item label="预警类型">{{ '大雾预警' }}</el-descriptions-item>
<el-descriptions-item label="发送时间">{{ detailData.createTime }}</el-descriptions-item>
<el-descriptions-item label="生效时间">{{ detailData.onset }}</el-descriptions-item>
<el-descriptions-item label="接收时间">{{ detailData.receiveTime }}</el-descriptions-item>
<el-descriptions-item label="预警转发时间">{{ detailData.forwardTime }}</el-descriptions-item>
<el-descriptions-item span="3" label="预警结束时间">{{ detailData.expires }}</el-descriptions-item>
<el-descriptions-item span="3" label="预警描述">{{ detailData.description }}</el-descriptions-item>
<el-descriptions-item span="3" label="响应措施">{{ }}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="sites-card">
<template #header>
<div class="card-header">
<span>影响情况</span>
</div>
</template>
<DynamicTable :dataSource="sitesList" :columns="columns" :autoHeight="true"></DynamicTable>
</el-card>
</div>
<div class="detail-container">
<el-card class="basic-card">
<template #header>
<div class="card-header">
<span>基本信息</span>
</div>
</template>
<el-descriptions column="3">
<el-descriptions-item label="预警标题">{{ detailData.headline || '-' }}</el-descriptions-item>
<el-descriptions-item label="预警类型">{{ detailData.weatherWarningType || '-' }}</el-descriptions-item>
<el-descriptions-item label="发送时间">{{ detailData.createTime || '-' }}</el-descriptions-item>
<el-descriptions-item label="生效时间">{{ detailData.onset || '-' }}</el-descriptions-item>
<el-descriptions-item label="接收时间">{{ detailData.receiveTime || '-' }}</el-descriptions-item>
<el-descriptions-item label="预警转发时间">{{ detailData.forwardTime || '-' }}</el-descriptions-item>
<el-descriptions-item span="3" label="预警结束时间">{{ detailData.expires || '-' }}</el-descriptions-item>
<el-descriptions-item span="3" label="预警描述">{{ detailData.description || '-' }}</el-descriptions-item>
<el-descriptions-item span="3" label="响应措施">{{}}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="sites-card">
<template #header>
<div class="card-header">
<span>影响情况</span>
</div>
</template>
<div class="table">
<div class="stats-cards">
<el-radio-group size="large" v-model="cardType" @change="handleTypeChange">
<el-radio-button
v-for="(item, index) in impactData"
:key="index"
:value="index"
>
{{ item.name }} ({{ item.count }})
</el-radio-button>
</el-radio-group>
</div>
<div class="search-form">
<el-select
class="search-item"
:teleported="false"
v-model="filterForm.pointLevel"
size="small"
placeholder="影响点等级"
clearable
@change="handleFilterChange"
>
<el-option v-for="option in pointLevelOptions" :key="option.value" :label="option.label" :value="option.value" />
</el-select>
<el-select
:teleported="false"
v-model="filterForm.region"
size="small"
placeholder="影响区域"
class="search-item"
clearable
@change="handleFilterChange"
placement="bottom-start"
>
<el-option v-for="option in regionOptions" :key="option.value" :label="option.label" :value="option.value" />
</el-select>
<el-select
:teleported="false"
v-model="filterForm.roadType"
size="small"
placeholder="公路类型"
class="search-item"
clearable
@change="handleFilterChange"
>
<el-option v-for="option in roadTypeOptions" :key="option.value" :label="option.label" :value="option.value" />
</el-select>
</div>
<DynamicTable :dataSource="tableData" :columns="columns" :autoHeight="true" :pagination="pagination"></DynamicTable>
</div>
</el-card>
</div>
</template>
<script setup>
import { ref, onMounted, watch, computed, h } from "vue";
import { request } from "@/utils/request";
import DynamicTable from "../../../component/DynamicTable/index.js";
import { ref, onMounted, watch, computed, h, reactive } from 'vue'
import { request } from '@/utils/request'
import DynamicTable from '../../../component/DynamicTable/index.js'
const props = defineProps({
id: {
type: String,
default: "",
},
});
row: {
type: Object,
default: {},
},
})
const detailData = ref({})
const sitesList = ref([])
const tableData = ref([])
const cardType = ref(0)
const cardTypeVal = ref('路段')
const filterForm = reactive({})
//
const formatDateTime = (dateStr) => {
if (!dateStr) return '-'
const date = new Date(dateStr)
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
}
//
const pagination = reactive({
current: 1,
pageSize: 10,
total: 0,
pageSizes: [10, 20, 50],
layout: 'prev, pager, next, jumper',
onChange: (page, pageSize) => {
pagination.current = page
pagination.pageSize = pageSize
getAffectedSites()
},
})
// ID
const getDetailData = async (id) => {
try {
const res = await request({
url: '/snow-ops-platform/weatherWarning/getById',
method: 'GET',
params: {
id: id
}
})
if (res.code === '00000') {
detailData.value = res.data
} else {
throw new Error(res.message)
}
} catch (error) {
ElMessage.error(error.message)
console.log(error)
try {
const res = await request({
url: '/snow-ops-platform/weatherWarning/getById',
method: 'GET',
params: {
id: id,
},
})
if (res.code === '00000') {
detailData.value = res.data
} else {
throw new Error(res.message)
}
} catch (error) {
ElMessage.error(error.message)
console.log(error)
}
}
// ID
const getAffectedSites = async (id) => {
try {
const res = await request({
url: '/snow-ops-platform/weatherWarning/affected-sites',
method: 'GET',
params: {
warningId: id
}
})
if (res.code === '00000') {
sitesList.value = res.data
} else {
throw new Error(res.message)
}
} catch (error) {
ElMessage.error(error.message)
console.log(error)
}
// cardType API
const getApiUrlByType = (type) => {
const urlMap = {
桥梁: '/snow-ops-platform/weather-warning/affected-object/bridge',
边坡: '/snow-ops-platform/weather-warning/affected-object/slope',
隧道: '/snow-ops-platform/weather-warning/affected-object/tunnel',
驻地: '/snow-ops-platform/weather-warning/affected-object/project',
路段: '/snow-ops-platform/weather-warning/affected-object/road-section',
}
return urlMap[type] || '/snow-ops-platform/weather-warning/affected-object/bridge'
}
const columns = [
{
prop: "county",
label: "所属区县",
},
{
prop: "siteName",
label: "驻地名称",
},
{
prop: "siteAddress",
label: "驻地地址",
},
{
prop: "sitePopulation",
label: "驻地人数",
},
{
prop: "xxx",
label: "首次响应时间",
},
{
prop: "xxx",
label: "最新响应时间",
},
{
prop: "xxx",
label: "最近催告时间",
},
{
prop: "xxx",
label: "响应情况",
},
{
label: "操作",
fixed: "right",
width: 80,
render: (row) => () =>
h("div", { class: "action-btns" }, [
h(
ElButton,
{
type: "primary",
link: true,
onClick: async () => {
},
},
() => "巡查记录"
),
]),
},
//
const processDataByType = (item, type) => {
return processUnifiedData(item, cardTypeVal.value)
}
//
const processUnifiedData = (item, type) => {
//
const getLevelClass = (level) => {
const levelMap = {
红色预警: 'level-red',
橙色预警: 'level-orange',
黄色预警: 'level-yellow',
蓝色预警: 'level-blue',
高风险: 'level-red',
中风险: 'level-orange',
低风险: 'level-blue',
}
return levelMap[level] || ''
}
//
const pointLevel = item.riskLevel || item.warningLevel || item.level || item.GL1_PDDJ || item.GL1_JSDJ || '-'
//
const baseData = {
item,
id: item.id,
//
region: item.GL1_QXMC || item.COUNTY || item.county || item.region || item.ADMINISTRATIVE_REGION || item.COUNTY_NAME || '-',
//
pointType: cardTypeVal.value || '-',
//
pointLocation: item.GL1_QLMC || item.NAME || item.GL1_SDMC || item.PROJECT_NAME || item.GL1_LXBH || item.name || '-',
//
pointLevel: pointLevel,
levelClass: getLevelClass(pointLevel),
//
trafficDept: {
// name: item.trafficDeptName || item.trafficManager || "-",
phone: item.trafficDeptPhone || item.trafficManagerPhone || '-',
name: '-',
phone: '-',
},
//
roadOrg: {
// name: item.roadOrgName || item.roadManager || "-",
// phone: item.roadOrgPhone || item.roadManagerPhone || "-",
name: '-',
phone: '-',
},
//
maintenance: {
// name: item.maintenanceName || item.maintenanceManager || "-",
// phone: item.maintenancePhone || item.maintenanceManagerPhone || "-",
name: '-',
phone: '-',
},
//
roadKeeper: {
// name: item.roadKeeperName || item.roadKeeper || "-",
// phone: item.roadKeeperPhone || item.roadKeeperPhone || "-",
name: '-',
phone: '-',
},
//
generalStaff: {
// name: item.generalStaffName || item.roadChief || "-",
// phone: item.generalStaffPhone || item.roadChiefPhone || "-",
name: '-',
phone: '-',
},
// 使
rawData: item,
}
// BASE_GLQL
if (cardTypeVal.value === '桥梁') {
return {
...baseData,
// - 使
region: item.GL1_QXMC || '-',
// - 使
pointLocation: item.GL1_QLMC || '-',
// - 使
pointLevel: item.GL1_JSZKPJDJ || item.GL1_PDDJ || item.GL1_CSFXDJ || '-',
levelClass: getLevelClass(item.GL1_JSZKPJDJ || item.GL1_PDDJ || item.GL1_CSFXDJ),
// // - GL1_DWFZR
// trafficDept: {
// name: item.GL1_DWFZR || "-",
// phone: item.GL1_GLDWDH || "-",
// },
// // - GL1_TJFZR
// roadOrg: {
// name: item.GL1_TJFZR || "-",
// phone: item.GL1_TJFZRDH || "-",
// },
// // - GL1_YHDWDH
// maintenance: {
// name: item.GL1_GLDWMC || "-",
// phone: item.GL1_YHDWDH || "-",
// },
// // -
// roadKeeper: {
// name: item.GL1_TBRXM || "-",
// phone: item.GL1_TBRDH || "-",
// },
// // - GL1_QLGCS
// generalStaff: {
// name: item.GL1_QLGCS || "-",
// phone: item.GL1_QLGCSDH || "-",
// },
}
}
// BASE_GLSD
if (cardTypeVal.value === '隧道') {
return {
...baseData,
// - 使
region: item.GL1_QXMC || item.GL1_QXBM || '-',
// - 使
pointLocation: item.GL1_SDMC || '-',
// - 使
pointLevel: item.GL1_PDDJ || item.GL1_TJJGPDDJ || item.GL1_SDYHDJ || '-',
levelClass: getLevelClass(item.GL1_PDDJ || item.GL1_TJJGPDDJ || item.GL1_SDYHDJ),
// // - GL1_GYDWXZLD
// trafficDept: {
// name: item.GL1_GYDWXZLD || "-",
// phone: item.GL1_GYDWXZLDDH || "-",
// },
// // - GL1_SDLZY
// roadOrg: {
// name: item.GL1_SDLZY || "-",
// phone: item.GL1_SDLZYDH || "-",
// },
// // - GL1_SDYHG
// maintenance: {
// name: item.GL1_SDYHG || "-",
// phone: item.GL1_SDYHGDH || "-",
// },
// // - GL1_SDXXTBR
// roadKeeper: {
// name: item.GL1_SDXXTBR || "-",
// phone: item.GL1_SDXXTBRDH || "-",
// },
// // - GL1_GYDWYHGCS
// generalStaff: {
// name: item.GL1_GYDWYHGCS || "-",
// phone: item.GL1_GYDWYHGSCSDH || "-",
// },
}
}
// BASE_XJLD线
if (cardTypeVal.value === '路段') {
return {
...baseData,
// - 使
region: item.COUNTY_NAME || '-',
// - 使线+
pointLocation:
item.GL1_QDZH && item.GL1_ZDZH
? item.GL1_LXMC + '(k' + (item.GL1_QDZH + '').replace('.', '+') + '至k' + (item.GL1_ZDZH + '').replace('.', '+') + ')'
: item.GL1_LXMC,
// - 使
pointLevel: item.GL1_FXDJ || '',
levelClass: getLevelClass(item.GL1_FXDJ),
// - 使GL1_JTXMGL1_JTDH
trafficDept: {
name: item.GL1_JTXM || '-',
phone: item.GL1_JTDH || '-',
},
// - 使GL1_JGXMGL1_JGDH
roadOrg: {
name: item.GL1_JGXM || '-',
phone: item.GL1_JGDH || '-',
},
// - 使GL1_YHXMGL1_YHDH
maintenance: {
name: item.GL1_YHXM || '-',
phone: item.GL1_YHDH || '-',
},
// - 使GL1_HLXMGL1_HLDH
roadKeeper: {
name: item.GL1_HLXM || item.ROAD_PATROL_WORKER_NAME || '-',
phone: item.GL1_HLDH || item.ROAD_PATROL_WORKER_PHONE || '-',
},
//
generalStaff: {
name: item.ROAD_CAPTAIN_NAME || '-',
phone: item.ROAD_CAPTAIN_PHONE || '-',
},
}
}
// SQL
if (cardTypeVal.value === '驻地') {
return {
...baseData,
// - 使COUNTY
region: item.COUNTY || item.county || item.county_name || '-',
// - 使
pointLocation: item.PROJECT_NAME || item.projectName || item.name || '-',
//
siteName: item.SITE_NAME || item.siteName || item.PROJECT_NAME || item.projectName || '-',
// - WHISTLEBLOWER_NAME / WHISTLEBLOWER_PHONE
whistleblower: {
name: item.WHISTLEBLOWER_NAME || item.whistleblowerName || '-',
phone: item.WHISTLEBLOWER_PHONE || item.whistleblowerPhone || '-',
},
// - OWNER_RESPONSIBLE_PERSON / OWNER_RESPONSIBLE_PHONE
constructionUnit: {
name: item.OWNER_RESPONSIBLE_PERSON || item.ownerResponsiblePerson || '-',
phone: item.OWNER_RESPONSIBLE_PHONE || item.ownerResponsiblePhone || '-',
},
// - CONSTRUCTOR_RESPONSIBLE_PERSON / CONSTRUCTOR_RESPONSIBLE_PHONE
constructionDept: {
name: item.CONSTRUCTOR_RESPONSIBLE_PERSON || item.constructorResponsiblePerson || '-',
phone: item.CONSTRUCTOR_RESPONSIBLE_PHONE || item.constructorResponsiblePhone || '-',
},
// - SITE_RESPONSIBLE_PERSON / SITE_RESPONSIBLE_PHONE
siteResponsible: {
name: item.SITE_RESPONSIBLE_PERSON || item.siteResponsiblePerson || '-',
phone: item.SITE_RESPONSIBLE_PHONE || item.siteResponsiblePhone || '-',
},
// - DISTRICT_RESPONSIBLE_PERSON / DISTRICT_RESPONSIBLE_PHONE
countyResponsible: {
name: item.DISTRICT_RESPONSIBLE_PERSON || item.districtResponsiblePerson || '-',
phone: item.DISTRICT_RESPONSIBLE_PHONE || item.districtResponsiblePhone || '-',
},
// - CITY_RESPONSIBLE_PERSON / CITY_RESPONSIBLE_PHONE
cityResponsible: {
name: item.CITY_RESPONSIBLE_PERSON || item.cityResponsiblePerson || '-',
phone: item.CITY_RESPONSIBLE_PHONE || item.cityResponsiblePhone || '-',
},
}
}
return baseData
}
// ID
const getAffectedSites = async () => {
try {
const res = await request({
url: getApiUrlByType(cardTypeVal.value),
method: 'GET',
params: {
start: formatDateTime(props.row.onset),
end: formatDateTime(props.row.expires),
limit: pagination.pageSize,
offset: (pagination.current - 1) * pagination.pageSize,
countyId: props.row.areaCode,
...filterForm,
},
})
//
if (cardTypeVal.value == '路段') {
if (res.data) {
tableData.value = res.data.map((item, index) => ({
...processDataByType(item),
id: index + 1,
}))
pagination.total = res.total || 0
}
} else if (cardTypeVal.value == '驻地') {
if (res.data) {
tableData.value = res.data.map((item, index) => ({
...processDataByType(item),
id: index + 1,
}))
pagination.total = res.total || 0
}
} else if (cardTypeVal.value == '桥梁') {
if (res.data) {
tableData.value = res.data.map((item, index) => ({
...processDataByType(item),
id: index + 1,
}))
pagination.total = res.total || 0
}
} else {
if (res.code === '00000' && res.data) {
//
const allData = res.data
pagination.total = allData.length || 0
//
const startIndex = (pagination.current - 1) * pagination.pageSize
const endIndex = startIndex + pagination.pageSize
const currentPageData = allData.slice(startIndex, endIndex)
tableData.value = currentPageData.map((item, index) => ({
...processDataByType(item),
id: startIndex + index + 1,
}))
} else {
tableData.value = []
pagination.total = 0
}
}
} catch (error) {
console.error('获取影响点数据失败:', error)
tableData.value = []
pagination.total = 0
}
}
//
const pointLevelOptions = [
{ label: '全部', value: '' },
{ label: '低风险', value: '低风险' },
{ label: '中风险', value: '中风险' },
{ label: '较高风险', value: '较高风险' },
{ label: '高风险', value: '高风险' },
]
//
const regionOptions = ref([])
const fetchDistrictOptions = async () => {
try {
const res = await request({
url: '/snow-ops-platform/sm-event/dashboard/district-options',
method: 'GET',
})
if (res && res.code === '00000' && Array.isArray(res.data)) {
//
const options = res.data.map((item) => ({
label: item.qxmc,
value: item.xzdm,
}))
// ""
regionOptions.value = [{ label: '全部', value: '' }, ...options]
return options
}
} catch (error) {
console.error('获取影响区域选项失败:', error)
}
return regionOptions.value
}
//
const roadTypeOptions = ref([
{ label: '全部', value: '' },
{ label: '国省道', value: 'G,S' },
{ label: '农村公路', value: ' X, Y, C' },
])
//
const handleFilterChange = () => {
pagination.current = 1
getAffectedSites()
}
//
const impactData = ref([
{ name: '影响路段', count: 0, type: '路段' },
{ name: '影响桥梁', count: 0, type: '桥梁' },
{ name: '影响隧道', count: 0, type: '隧道' },
{ name: '影响边坡', count: 0, type: '边坡' },
{ name: '影响驻地', count: 0, type: '驻地' },
])
//
const loadBarChartData = async () => {
try {
const res = await request({
url: '/snow-ops-platform/weather-warning/affected-count',
method: 'GET',
params: {
start: formatDateTime(props.row.onset),
end: formatDateTime(props.row.expires),
},
})
if (res.code == '00000') {
const data = res.data
if (data && Array.isArray(data)) {
//
const nameMap = {
'road-section': '路段',
bridge: '桥梁',
tunnel: '隧道',
slope: '边坡',
project: '驻地',
Road: '路段',
Bridge: '桥梁',
Tunnel: '隧道',
Slope: '边坡',
Project: '驻地',
}
// name
const convertedData = data.map((item) => {
if (item.extension == '项目') {
item.extension = '驻地'
}
const name = nameMap[item.name] || item.name
return { ...item, name }
})
convertedData.forEach((item) => {
impactData.value.forEach((stat) => {
if (stat.name.includes(item.extension)) {
stat.count = item.count || 0
}
})
})
}
}
} catch (error) {
console.error('加载数据失败:', error)
}
}
//
const handleTypeChange = (index) => {
const item = impactData.value[index]
tableData.value = []
cardTypeVal.value = item.type
columns.value = getColumnsByType(item.type)
pagination.current = 1
getAffectedSites()
}
// 使
const unifiedColumns = [
{ prop: 'id', label: '序号', width: '' },
{ prop: 'region', label: '影响区域', width: '' },
{ prop: 'pointType', label: '影响点类型', width: '' },
{ prop: 'pointLocation', label: '影响点位置', width: '' },
{ prop: 'pointLevel', label: '影响点等级', width: '', slot: 'pointLevel' },
{
prop: 'trafficDept',
label: '交通主管部门负责人',
width: '',
slot: 'trafficDept',
},
{ prop: 'roadOrg', label: '公路机构责任人', width: '', slot: 'roadOrg' },
{
prop: 'maintenance',
label: '养护站负责人',
width: '',
slot: 'maintenance',
},
{ prop: 'roadKeeper', label: '护路员', width: '', slot: 'roadKeeper' },
{
prop: 'generalStaff',
label: '一般人员(路长履职)',
width: '',
slot: 'generalStaff',
},
{
prop: 'operation',
label: '操作',
width: '80',
slot: 'operation',
fixed: 'right',
},
]
//
const projectColumns = [
{ prop: 'id', label: '序号', width: '60' },
{ prop: 'region', label: '影响区域', width: '' },
{ prop: 'pointType', label: '影响点类型', width: '' },
{ prop: 'siteName', label: '驻地名称', width: '' },
{
prop: 'whistleblower',
label: '吹哨人',
width: '',
slot: 'whistleblower',
},
{
prop: 'constructionUnit',
label: '建设单位包保责任人',
width: '',
slot: 'constructionUnit',
},
{
prop: 'constructionDept',
label: '施工单位包保责任人',
width: '',
slot: 'constructionDept',
},
{
prop: 'siteResponsible',
label: '驻地包保责任人',
width: '',
slot: 'siteResponsible',
},
{
prop: 'countyResponsible',
label: '区县级包保责任人',
width: '',
slot: 'countyResponsible',
},
{
prop: 'cityResponsible',
label: '市级包保责任人',
width: '',
slot: 'cityResponsible',
},
]
const columns = ref(unifiedColumns)
// cardType
const getColumnsByType = (type) => {
const typeMap = {
路段: unifiedColumns,
桥梁: unifiedColumns,
隧道: unifiedColumns,
边坡: unifiedColumns,
驻地: projectColumns,
}
return typeMap[type] || unifiedColumns
}
onMounted(async () => {
await getDetailData(props.id);
await getAffectedSites(props.id)
await loadBarChartData()
await fetchDistrictOptions()
await getDetailData(props.row.id)
await getAffectedSites()
})
</script>
<style scoped>
<style scoped lang="scss">
.detail-container {
display: flex;
flex-direction: column;
gap: 20px;
display: flex;
flex-direction: column;
gap: 20px;
}
</style>
.table {
display: flex;
flex-direction: column;
gap: 10px;
}
//
.stats-cards {
}
.search-form {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
gap: 12px;
.search-item {
width: 150px;
}
}
</style>

View File

@ -5,6 +5,19 @@ import AddDialog from "./addDialog.vue";
import ScheduleDiaog from "../law/dutyManagement/addDialog.vue"
import DetailDrawer from "./detailDrawer.vue";
// 格式化时间函数
const formatDateTime = (dateStr) => {
if (!dateStr) return '-';
const date = new Date(dateStr);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
};
const tableData = ref([]); // 表格数据
const modelVisible = ref(false); // 弹窗状态
const drawerVisible = ref(false); // 抽屉状态
@ -54,11 +67,8 @@ const columns = [
label: "预警标题",
},
{
// prop: "xxx",
prop: "weatherWarningType",
label: "预警类型",
formatter: (row) => {
return h(ElText, { style: {} }, '大雾预警');
}
},
{
prop: "createTime",
@ -67,6 +77,7 @@ const columns = [
{
prop: "onset",
label: "生效时间",
render: (row) => () => h('span', formatDateTime(row.onset))
},
{
prop: "receiveTime",
@ -79,6 +90,7 @@ const columns = [
{
prop: "expires",
label: "预警结束时间",
render: (row) => () => h('span', formatDateTime(row.expires))
},
{
prop: "affectedRoadSectionCount",
@ -258,7 +270,7 @@ const publishWarning = async (data) => {
const openDetailDrawer = (row) => {
drawer.title = '预警详情';
drawer.props = {
id: row.id,
row: row
};
drawer.content = DetailDrawer;
drawerVisible.value = true;