增加获取图片,图片进行拼接地址。
This commit is contained in:
parent
fce1c6817e
commit
3b23b530d9
24
packages/screen/api.config.js
Normal file
24
packages/screen/api.config.js
Normal file
@ -0,0 +1,24 @@
|
||||
// API 基础地址配置
|
||||
// 此文件用于共享 API 地址配置,供 vite.config.js 和前端代码共同使用
|
||||
|
||||
// 当前使用的 API 地址
|
||||
export const API_BASE_URL = 'http://8.137.54.85:8661/'
|
||||
|
||||
// 代理目标地址(用于 vite.config.js)
|
||||
export const PROXY_TARGET = API_BASE_URL
|
||||
|
||||
// 其他环境配置(备用)
|
||||
export const API_URLS = {
|
||||
// 测试环境
|
||||
test: 'http://8.137.54.85:8661/',
|
||||
// 张启生本地环境
|
||||
zhangqisheng: 'http://192.168.110.36:8661/',
|
||||
// 其他本地环境
|
||||
local: 'http://192.168.110.16:8661/',
|
||||
}
|
||||
|
||||
export default {
|
||||
API_BASE_URL,
|
||||
PROXY_TARGET,
|
||||
API_URLS,
|
||||
}
|
||||
@ -52,6 +52,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 照片 - 路段数据展示 -->
|
||||
<div v-if="isRoadData && hazardData.photos" class="info-block display">
|
||||
<div class="block-title mr_10">照片</div>
|
||||
<div class="photo-list">
|
||||
<img v-for="(photo, index) in hazardData.photos" :key="index" :src="photo" class="photo-item" @click="previewPhoto(photo)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 风险描述 -->
|
||||
<div class="info-block">
|
||||
<div class="block-title">风险描述</div>
|
||||
@ -188,14 +197,6 @@
|
||||
<div class="block-title">备注</div>
|
||||
<!-- <div class="block-content">{{ hazardData.remark }}</div> -->
|
||||
</div>
|
||||
|
||||
<!-- 照片 - 路段数据展示 -->
|
||||
<div v-if="isRoadData && hazardData.photos" class="info-block display jc_sb">
|
||||
<div class="block-title">照片</div>
|
||||
<div class="photo-list">
|
||||
<img v-for="(photo, index) in hazardData.photos" :key="index" :src="photo" class="photo-item" @click="previewPhoto(photo)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</base-dialog>
|
||||
@ -205,7 +206,7 @@
|
||||
import { ref, watch, computed } from 'vue'
|
||||
import { Location, VideoCamera, Microphone, Phone } from '@element-plus/icons-vue'
|
||||
import baseDialog from '../component/baseDialog.vue'
|
||||
import { openVideoConference } from '../component/index.js'
|
||||
import { openVideoConference, openVoiceConference, opencallConference, getImageUrlList } from '../component/index.js'
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
@ -322,19 +323,29 @@ const previewPhoto = (photo) => {
|
||||
// 视频通话
|
||||
const handleVideo = (item) => {
|
||||
console.log('视频通话:', item)
|
||||
emit('video', {
|
||||
let videoParams = {
|
||||
...item,
|
||||
id: hazardData.value.id,
|
||||
})
|
||||
}
|
||||
openVideoConference(videoParams)
|
||||
// emit('video', {
|
||||
// ...item,
|
||||
// id: hazardData.value.id,
|
||||
// })
|
||||
}
|
||||
|
||||
// 语音通话
|
||||
const handleVoice = (item) => {
|
||||
console.log('语音通话:', item)
|
||||
emit('voice', {
|
||||
let voiceParams = {
|
||||
...item,
|
||||
id: hazardData.value.id,
|
||||
})
|
||||
}
|
||||
openVoiceConference(voiceParams)
|
||||
// emit('voice', {
|
||||
// ...item,
|
||||
// id: hazardData.value.id,
|
||||
// })
|
||||
}
|
||||
|
||||
// 拨打电话
|
||||
@ -410,8 +421,8 @@ watch(
|
||||
longitude: data.GL1_LON || data.longitude || '',
|
||||
latitude: data.GL1_LAT || data.latitude || '',
|
||||
|
||||
// 照片信息(路段数据)
|
||||
photos: data.photos || [],
|
||||
// 照片信息(优先使用 GL1_TP 生成图片地址)
|
||||
photos: data.GL1_TP ? getImageUrlList(data.GL1_TP) : data.photos || [],
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -685,8 +685,8 @@ const processUnifiedData = (item, type) => {
|
||||
},
|
||||
// 一般人员(路长履职)
|
||||
generalStaff: {
|
||||
name: item.ROAD_SECTION_CHIEF_NAME || '-',
|
||||
phone: item.ROAD_SECTION_CHIEF_PHONE || '-',
|
||||
name: item.ROAD_CAPTAIN_NAME || '-',
|
||||
phone: item.ROAD_CAPTAIN_PHONE || '-',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,9 +90,10 @@ const props = defineProps({
|
||||
watch(
|
||||
() => props.roadItem,
|
||||
async (newVal, oldVal) => {
|
||||
console.log('newVal', newVal)
|
||||
getAffectedRoadSectionData(false);
|
||||
},
|
||||
{ immediate: false }
|
||||
{ immediate: true }
|
||||
);
|
||||
// 定义 emits
|
||||
const emit = defineEmits([
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
import { ref } from 'vue'
|
||||
import { request } from '@/utils/request'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { PROXY_TARGET } from '../../../../api.config.js'
|
||||
// 公路类型选项
|
||||
export const roadTypeOptions = ref([
|
||||
{ label: '全部', value: '' },
|
||||
@ -418,6 +419,56 @@ export const opencallConference = async (item) => {
|
||||
logUserOperation('phone-based-confirmation', JSON.stringify(jsobj))
|
||||
}
|
||||
|
||||
// 基础 API 地址配置(根据当前网址动态判断)存在bxztpc时,外网地址,否则内网地址
|
||||
const BASE_API_URL = window.location.href.includes('bxztpc')
|
||||
? 'http://58.144.223.132:30008/'
|
||||
: PROXY_TARGET
|
||||
|
||||
// 从本地存储获取 token
|
||||
const getTokenFromStorage = () => {
|
||||
try {
|
||||
// 尝试从 localStorage 获取
|
||||
const token = localStorage.getItem('token')
|
||||
if (token) return token
|
||||
|
||||
// 尝试从 sessionStorage 获取
|
||||
const sessionToken = sessionStorage.getItem('token')
|
||||
if (sessionToken) return sessionToken
|
||||
|
||||
return ''
|
||||
} catch (error) {
|
||||
console.error('获取 token 失败:', error)
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
// 获取图片地址数组
|
||||
export const getImageUrlList = (fileIdStr) => {
|
||||
if (!fileIdStr || typeof fileIdStr !== 'string') {
|
||||
console.warn('fileIdStr 为空或不是字符串')
|
||||
return []
|
||||
}
|
||||
|
||||
// 按逗号分割字符串
|
||||
const fileIdList = fileIdStr.split(',').map(id => id.trim()).filter(id => id)
|
||||
|
||||
if (fileIdList.length === 0) {
|
||||
console.warn('fileIdStr 分割后为空')
|
||||
return []
|
||||
}
|
||||
|
||||
// 获取 token
|
||||
const token = getTokenFromStorage()
|
||||
|
||||
// 构建图片地址数组
|
||||
const imageUrlList = fileIdList.map(fileId => {
|
||||
return `${BASE_API_URL}apis/file-api/private/preview?fileId=${fileId}&token=${token}`
|
||||
})
|
||||
|
||||
console.log('生成的图片地址数组:', imageUrlList)
|
||||
return imageUrlList
|
||||
}
|
||||
|
||||
// 默认导出所有选项
|
||||
export default {
|
||||
regionOptions,
|
||||
@ -437,4 +488,5 @@ export default {
|
||||
openVideoConference,
|
||||
openVoiceConference,
|
||||
opencallConference,
|
||||
getImageUrlList,
|
||||
}
|
||||
|
||||
@ -231,8 +231,6 @@
|
||||
:data="hazardPointData"
|
||||
:title="hazardPointDialogTitle"
|
||||
@close="closeDialog('hazardPointSituation')"
|
||||
@voice="openVoiceConference"
|
||||
@video="openVideoConference"
|
||||
@call="handleCallClick"
|
||||
/>
|
||||
|
||||
@ -375,8 +373,7 @@ const roadItem = ref({})
|
||||
const showRoadStats = ref(false)
|
||||
const roadItemClick = (item) => {
|
||||
console.log('点击路段:', item)
|
||||
roadItem.value = {}
|
||||
roadItem.value = item
|
||||
roadItem.value = {...item}
|
||||
showRoadStats.value = true
|
||||
}
|
||||
|
||||
|
||||
@ -5,12 +5,7 @@
|
||||
<template #left>
|
||||
<div class="filter-header">
|
||||
<span class="title">智能研判</span>
|
||||
<img
|
||||
class="filter-icon-ai"
|
||||
src="../../assets/RiskWarning_img/AI1@2x.png"
|
||||
alt=""
|
||||
@click="handleAIClick"
|
||||
/>
|
||||
<img class="filter-icon-ai" src="../../assets/RiskWarning_img/AI1@2x.png" alt="" @click="handleAIClick" />
|
||||
</div>
|
||||
</template>
|
||||
</SectionHeader>
|
||||
@ -19,13 +14,7 @@
|
||||
<div class="weather-warning-section">
|
||||
<div class="section-title">气象预警</div>
|
||||
<div class="warning-cards">
|
||||
<div
|
||||
v-for="(item, index) in weatherWarningData"
|
||||
:key="index"
|
||||
class="warning-card"
|
||||
:class="item.class"
|
||||
@click="handleWarningCardClick(item)"
|
||||
>
|
||||
<div v-for="(item, index) in weatherWarningData" :key="index" class="warning-card" :class="item.class" @click="handleWarningCardClick(item)">
|
||||
<img class="card-icon" src="../../assets/RiskWarning_img/气象预警图标@2x.png" alt="" />
|
||||
<div class="card-info">
|
||||
<div class="card-num mt_5">{{ item.value }}</div>
|
||||
@ -130,12 +119,7 @@
|
||||
|
||||
<!-- 3个调度清单卡片 -->
|
||||
<div class="dispatch-cards">
|
||||
<div
|
||||
v-for="(item, index) in dispatchList"
|
||||
:key="index"
|
||||
class="dispatch-card clickable"
|
||||
@click="handleDispatchCardClick(item)"
|
||||
>
|
||||
<div v-for="(item, index) in dispatchList" :key="index" class="dispatch-card clickable" @click="handleDispatchCardClick(item)">
|
||||
<div class="card-num">
|
||||
{{ item.value }}
|
||||
<span class="unit">人</span>
|
||||
@ -148,48 +132,48 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, watch, inject } from 'vue';
|
||||
import { request } from '@/utils/request';
|
||||
import SectionHeader from './component/sectionHeader.vue';
|
||||
import { ref, computed, onMounted, watch, inject } from 'vue'
|
||||
import { request } from '@/utils/request'
|
||||
import SectionHeader from './component/sectionHeader.vue'
|
||||
// 导入图片资源
|
||||
import imgCall from '../../assets/RiskWarning_img/回应icon@2x.png';
|
||||
import imgReply from '../../assets/RiskWarning_img/已回应icon@2x.png';
|
||||
import imgRate from '../../assets/RiskWarning_img/回应率icon@2x.png';
|
||||
import imgDistrict from '../../assets/RiskWarning_img/区县icon@2x.png';
|
||||
import imgHelp from '../../assets/RiskWarning_img/响应图标5@2x.png';
|
||||
import imgCheck from '../../assets/RiskWarning_img/抽查人数icon@2x.png';
|
||||
import imgCall from '../../assets/RiskWarning_img/回应icon@2x.png'
|
||||
import imgReply from '../../assets/RiskWarning_img/已回应icon@2x.png'
|
||||
import imgRate from '../../assets/RiskWarning_img/回应率icon@2x.png'
|
||||
import imgDistrict from '../../assets/RiskWarning_img/区县icon@2x.png'
|
||||
import imgHelp from '../../assets/RiskWarning_img/响应图标5@2x.png'
|
||||
import imgCheck from '../../assets/RiskWarning_img/抽查人数icon@2x.png'
|
||||
|
||||
// 注入兄弟组件通信机制
|
||||
const setRefreshLeftData = inject('setRefreshLeftData');
|
||||
const setRefreshLeftData = inject('setRefreshLeftData')
|
||||
// 注入日期范围
|
||||
const getdateRange = inject('getdateRange', ref([]));
|
||||
const getdateRange = inject('getdateRange', ref([]))
|
||||
|
||||
// 监听日期范围变化,当获取到数据时重新加载
|
||||
watch(
|
||||
() => getdateRange.value,
|
||||
newVal => {
|
||||
console.log('left.vue 日期范围变化:', newVal);
|
||||
// init();
|
||||
(newVal) => {
|
||||
console.log('left.vue 日期范围变化:', newVal)
|
||||
init()
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
{ deep: true },
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
init();
|
||||
init()
|
||||
|
||||
// 注册刷新函数给父组件
|
||||
if (setRefreshLeftData) {
|
||||
setRefreshLeftData(init);
|
||||
setRefreshLeftData(init)
|
||||
}
|
||||
});
|
||||
})
|
||||
const init = () => {
|
||||
roadTypeLoad();
|
||||
districtLoadLoad();
|
||||
dispatchLoadLoad();
|
||||
scheduleStatisticsByCountyLoad();
|
||||
loadData();
|
||||
loadBarChartData();
|
||||
};
|
||||
roadTypeLoad() // 加载路段类型
|
||||
districtLoadLoad() // 加载区县数据
|
||||
dispatchLoadLoad() // 加载调度清单
|
||||
scheduleStatisticsByCountyLoad() // 加载调度统计
|
||||
loadData() // 加载气象预警和影响点数据
|
||||
loadBarChartData() // 加载柱状图数据
|
||||
}
|
||||
|
||||
const emit = defineEmits([
|
||||
'openWarningInfo',
|
||||
@ -204,61 +188,61 @@ const emit = defineEmits([
|
||||
'openOfflineHelp',
|
||||
'openImageInspection',
|
||||
'closeImpactItem',
|
||||
]);
|
||||
])
|
||||
|
||||
// 点击统计项
|
||||
const handleStatClick = item => {
|
||||
const handleStatClick = (item) => {
|
||||
if (item.label === '叫应总数') {
|
||||
emit('openWarningInfo');
|
||||
emit('dispatchDateRange', dateRange.value);
|
||||
emit('openWarningInfo')
|
||||
emit('dispatchDateRange', dateRange.value)
|
||||
} else if (item.label === '已回应数') {
|
||||
emit('openResponseStatus');
|
||||
emit('dispatchDateRange', dateRange.value);
|
||||
emit('openResponseStatus')
|
||||
emit('dispatchDateRange', dateRange.value)
|
||||
} else if (item.label === '调度区县数') {
|
||||
emit('openDispatchDistrict');
|
||||
emit('openDispatchDistrict')
|
||||
} else if (item.label === '线下帮扶数') {
|
||||
emit('openOfflineHelp');
|
||||
emit('openOfflineHelp')
|
||||
} else if (item.label === '抽查人次') {
|
||||
emit('openImageInspection');
|
||||
emit('openImageInspection')
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 点击气象预警卡片
|
||||
const handleWarningCardClick = item => {
|
||||
console.log('item:', item);
|
||||
emit('openWarningSituation', item);
|
||||
const handleWarningCardClick = (item) => {
|
||||
console.log('item:', item)
|
||||
emit('openWarningSituation', item)
|
||||
// 传递日期范围
|
||||
emit('warningClick', item);
|
||||
};
|
||||
emit('warningClick', item)
|
||||
}
|
||||
|
||||
// 点击影响点明细
|
||||
const handleImpactDetailClick = () => {
|
||||
emit('openImpactDetail');
|
||||
emit('closeImpactItem', {});
|
||||
};
|
||||
emit('openImpactDetail')
|
||||
emit('closeImpactItem', {})
|
||||
}
|
||||
|
||||
// 点击调度清单卡片
|
||||
const handleDispatchCardClick = item => {
|
||||
const handleDispatchCardClick = (item) => {
|
||||
if (item.label === dispatchList.value[0].label) {
|
||||
emit('showCenterCard', {
|
||||
type: 'second',
|
||||
value: item.value,
|
||||
data: nationalarr.value,
|
||||
});
|
||||
})
|
||||
} else if (item.label === dispatchList.value[1].label) {
|
||||
emit('showCenterCard', {
|
||||
type: 'third',
|
||||
value: item.value,
|
||||
data: ruralarr.value,
|
||||
});
|
||||
})
|
||||
} else if (item.label === dispatchList.value[2].label) {
|
||||
emit('showCenterCard', {
|
||||
type: 'first',
|
||||
value: item.value,
|
||||
data: projectarr.value,
|
||||
});
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 气象预警数据
|
||||
const weatherWarningData = ref([
|
||||
@ -266,7 +250,7 @@ const weatherWarningData = ref([
|
||||
{ label: '橙色预警', value: '0', class: 'orange' },
|
||||
{ label: '黄色预警', value: '0', class: 'yellow' },
|
||||
{ label: '蓝色预警', value: '0', class: 'blue' },
|
||||
]);
|
||||
])
|
||||
|
||||
// 影响点数据
|
||||
const impactData = ref([
|
||||
@ -275,24 +259,24 @@ const impactData = ref([
|
||||
{ name: '隧道', count: 0 },
|
||||
{ name: '边坡', count: 0 },
|
||||
{ name: '项目', count: 0 },
|
||||
]);
|
||||
])
|
||||
|
||||
const dateRange = ref([]);
|
||||
const dateRange = ref([])
|
||||
// 点击日期范围器
|
||||
const handleDateRangeClick = val => {
|
||||
dateRange.value = val;
|
||||
dispatchLoadLoad();
|
||||
};
|
||||
const handleDateRangeClick = (val) => {
|
||||
dateRange.value = val
|
||||
dispatchLoadLoad()
|
||||
}
|
||||
// 调度清单数据
|
||||
const dispatchLoadLoad = async () => {
|
||||
try {
|
||||
// 处理日期参数,开始时间为当天00:00:00,结束时间为当天23:59:59
|
||||
let start = '';
|
||||
let end = '';
|
||||
let start = ''
|
||||
let end = ''
|
||||
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
start = formatDateTime(dateRange.value[0]);
|
||||
end = formatDateTime(dateRange.value[1]);
|
||||
start = formatDateTime(dateRange.value[0])
|
||||
end = formatDateTime(dateRange.value[1])
|
||||
}
|
||||
|
||||
const res = await request({
|
||||
@ -302,173 +286,163 @@ const dispatchLoadLoad = async () => {
|
||||
start: start,
|
||||
end: end,
|
||||
},
|
||||
});
|
||||
console.log(res);
|
||||
})
|
||||
console.log(res)
|
||||
if (res.code == '00000') {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
if (data) {
|
||||
responseStats.value.forEach(item => {
|
||||
responseStats.value.forEach((item) => {
|
||||
if (item.label == '叫应总数') {
|
||||
item.value = data['noticeCount'] || 0;
|
||||
item.value = data['noticeCount'] || 0
|
||||
} else if (item.label == '已回应数') {
|
||||
item.value = data['replyCount'] || 0;
|
||||
item.value = data['replyCount'] || 0
|
||||
} else if (item.label == '回应率') {
|
||||
item.value = data['replyPrecent'] >= 0 ? data['replyPrecent'] + '%' : 0;
|
||||
item.value = data['replyPrecent'] >= 0 ? data['replyPrecent'] + '%' : 0
|
||||
} else if (item.label == '调度区县数') {
|
||||
item.value = data['countyCount'] || 0;
|
||||
item.value = data['countyCount'] || 0
|
||||
} else if (item.label == '线下帮扶数') {
|
||||
item.value = data['supportCount'] || 0;
|
||||
item.value = data['supportCount'] || 0
|
||||
} else if (item.label == '抽查人次') {
|
||||
item.value = data['inspectionCount'] || 0;
|
||||
item.value = data['inspectionCount'] || 0
|
||||
}
|
||||
});
|
||||
dispatchList.value.forEach(item => {
|
||||
})
|
||||
dispatchList.value.forEach((item) => {
|
||||
if (item.label == '国省道调度') {
|
||||
item.value = data['nationalRoadCount'] || 0;
|
||||
item.value = data['nationalRoadCount'] || 0
|
||||
} else if (item.label == '农村公路调度') {
|
||||
item.value = data['ruralRoadCount'] || 0;
|
||||
item.value = data['ruralRoadCount'] || 0
|
||||
} else if (item.label == '建设工程调度') {
|
||||
item.value = data['projectCount'] || 0;
|
||||
item.value = data['projectCount'] || 0
|
||||
}
|
||||
});
|
||||
})
|
||||
// responseStats.value = data;
|
||||
// dispatchList.value = data;
|
||||
} else {
|
||||
responseStats.value.forEach(item => {
|
||||
item.value = 0;
|
||||
});
|
||||
dispatchList.value.forEach(item => {
|
||||
item.value = 0;
|
||||
});
|
||||
responseStats.value.forEach((item) => {
|
||||
item.value = 0
|
||||
})
|
||||
dispatchList.value.forEach((item) => {
|
||||
item.value = 0
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载数据失败:', error);
|
||||
console.error('加载数据失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
watch(
|
||||
() => dateRange.value,
|
||||
newVal => {
|
||||
console.log('left.vue 调度响应变化:', newVal);
|
||||
dispatchLoadLoad();
|
||||
(newVal) => {
|
||||
console.log('left.vue 调度响应变化:', newVal)
|
||||
dispatchLoadLoad()
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
{ deep: true },
|
||||
)
|
||||
// 格式化日期时间为接口所需格式
|
||||
const formatDateTime = date => {
|
||||
if (!date) return '';
|
||||
const d = new Date(date);
|
||||
const year = d.getFullYear();
|
||||
const month = String(d.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(d.getDate()).padStart(2, '0');
|
||||
const hours = String(d.getHours()).padStart(2, '0');
|
||||
const minutes = String(d.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(d.getSeconds()).padStart(2, '0');
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
};
|
||||
const formatDateTime = (date) => {
|
||||
if (!date) return ''
|
||||
const d = new Date(date)
|
||||
const year = d.getFullYear()
|
||||
const month = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
const hours = String(d.getHours()).padStart(2, '0')
|
||||
const minutes = String(d.getMinutes()).padStart(2, '0')
|
||||
const seconds = String(d.getSeconds()).padStart(2, '0')
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||
}
|
||||
const getdateRangeTime = () => {
|
||||
// 处理日期参数,开始时间为当天00:00:00,结束时间为当天23:59:59
|
||||
let start = '';
|
||||
let end = '';
|
||||
let start = ''
|
||||
let end = ''
|
||||
if (getdateRange.value && getdateRange.value.length === 2) {
|
||||
start = formatDateTime(getdateRange.value[0]);
|
||||
end = formatDateTime(getdateRange.value[1]);
|
||||
start = formatDateTime(getdateRange.value[0])
|
||||
end = formatDateTime(getdateRange.value[1])
|
||||
}
|
||||
return {
|
||||
start: start,
|
||||
end: end,
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
// 区县数据
|
||||
const districtLoadLoad = async () => {
|
||||
console.log('区县数据:', getdateRangeTime());
|
||||
console.log('区县数据:', getdateRangeTime())
|
||||
try {
|
||||
const res = await request({
|
||||
url: '/snow-ops-platform/weather-warning/affected-count/_by_county',
|
||||
method: 'GET',
|
||||
params: getdateRangeTime(),
|
||||
});
|
||||
console.log(res);
|
||||
})
|
||||
console.log(res)
|
||||
if (res.code == '00000') {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
if (data) {
|
||||
// 简化区县名称
|
||||
const simplifyDistrictName = name => {
|
||||
if (!name) return name;
|
||||
const simplifyDistrictName = (name) => {
|
||||
if (!name) return name
|
||||
return name
|
||||
.replace('彭水苗族土家族自治县', '彭水县')
|
||||
.replace('石柱土家族自治县', '石柱县')
|
||||
.replace('秀山土家族苗族自治县', '秀山县')
|
||||
.replace('酉阳土家族苗族自治县', '酉阳县');
|
||||
};
|
||||
.replace('酉阳土家族苗族自治县', '酉阳县')
|
||||
}
|
||||
|
||||
// 处理数据,简化区县名称
|
||||
const processedData = data.map(item => ({
|
||||
const processedData = data.map((item) => ({
|
||||
...item,
|
||||
name: simplifyDistrictName(item.name),
|
||||
}));
|
||||
}))
|
||||
|
||||
// 根据路段、桥梁、隧道、边坡、项目的总数进行排序(数值越大越靠前)
|
||||
const sortedData = processedData.sort((a, b) => {
|
||||
const totalA =
|
||||
(a.roadSectionCount || 0) +
|
||||
(a.bridgeCount || 0) +
|
||||
(a.tunnelCount || 0) +
|
||||
(a.slopeCount || 0) +
|
||||
(a.projectCount || 0);
|
||||
const totalB =
|
||||
(b.roadSectionCount || 0) +
|
||||
(b.bridgeCount || 0) +
|
||||
(b.tunnelCount || 0) +
|
||||
(b.slopeCount || 0) +
|
||||
(b.projectCount || 0);
|
||||
return totalB - totalA; // 降序排列,数值大的在前
|
||||
});
|
||||
districtData.value = sortedData;
|
||||
const totalA = (a.roadSectionCount || 0) + (a.bridgeCount || 0) + (a.tunnelCount || 0) + (a.slopeCount || 0) + (a.projectCount || 0)
|
||||
const totalB = (b.roadSectionCount || 0) + (b.bridgeCount || 0) + (b.tunnelCount || 0) + (b.slopeCount || 0) + (b.projectCount || 0)
|
||||
return totalB - totalA // 降序排列,数值大的在前
|
||||
})
|
||||
districtData.value = sortedData
|
||||
} else {
|
||||
districtData.value = [];
|
||||
districtData.value = []
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载数据失败:', error);
|
||||
console.error('加载数据失败:', error)
|
||||
}
|
||||
};
|
||||
const roadTypeData = ref([]);
|
||||
}
|
||||
const roadTypeData = ref([])
|
||||
|
||||
// 调度统计区县数据
|
||||
const projectarr = ref([]);
|
||||
const nationalarr = ref([]);
|
||||
const ruralarr = ref([]);
|
||||
const projectarr = ref([])
|
||||
const nationalarr = ref([])
|
||||
const ruralarr = ref([])
|
||||
const scheduleStatisticsByCountyLoad = async () => {
|
||||
try {
|
||||
const res = await request({
|
||||
url: '/snow-ops-platform/weather-warning/schedule-statistics/_by_county',
|
||||
method: 'GET',
|
||||
params: getdateRangeTime(),
|
||||
});
|
||||
console.log('调度统计区县数据:', res);
|
||||
})
|
||||
console.log('调度统计区县数据:', res)
|
||||
if (res.code == '00000') {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
if (data) {
|
||||
data.forEach(item => {
|
||||
data.forEach((item) => {
|
||||
if (item.countyName != '测试区县') {
|
||||
if (item.type == 'project') {
|
||||
projectarr.value.push(item);
|
||||
projectarr.value.push(item)
|
||||
} else if (item.roadType == 'national') {
|
||||
nationalarr.value.push(item);
|
||||
nationalarr.value.push(item)
|
||||
} else if (item.roadType == 'rural') {
|
||||
ruralarr.value.push(item);
|
||||
ruralarr.value.push(item)
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log(projectarr.value);
|
||||
console.log(nationalarr.value);
|
||||
console.log(ruralarr.value);
|
||||
})
|
||||
console.log(projectarr.value)
|
||||
console.log(nationalarr.value)
|
||||
console.log(ruralarr.value)
|
||||
|
||||
// 合并渝北区和江北区为两江新区
|
||||
const mergeLiangjiangNewArea = arr => {
|
||||
const yubeiItems = arr.filter(item => item.countyName === '渝北区');
|
||||
const jiangbeiItems = arr.filter(item => item.countyName === '江北区');
|
||||
const mergeLiangjiangNewArea = (arr) => {
|
||||
const yubeiItems = arr.filter((item) => item.countyName === '渝北区')
|
||||
const jiangbeiItems = arr.filter((item) => item.countyName === '江北区')
|
||||
|
||||
if (yubeiItems.length > 0 || jiangbeiItems.length > 0) {
|
||||
// 计算合并后的数据
|
||||
@ -482,39 +456,37 @@ const scheduleStatisticsByCountyLoad = async () => {
|
||||
replyCount: 0,
|
||||
population: 0,
|
||||
entityCount: 0,
|
||||
};
|
||||
|
||||
// 累加渝北区数据
|
||||
yubeiItems.forEach(item => {
|
||||
mergedItem.noticeCount += item.noticeCount || 0;
|
||||
mergedItem.replyCount += item.replyCount || 0;
|
||||
mergedItem.population += item.population || 0;
|
||||
mergedItem.entityCount += item.entityCount || 0;
|
||||
});
|
||||
|
||||
// 累加江北区数据
|
||||
jiangbeiItems.forEach(item => {
|
||||
mergedItem.noticeCount += item.noticeCount || 0;
|
||||
mergedItem.replyCount += item.replyCount || 0;
|
||||
mergedItem.population += item.population || 0;
|
||||
mergedItem.entityCount += item.entityCount || 0;
|
||||
});
|
||||
|
||||
// 移除渝北区和江北区的数据,添加合并后的两江新区数据
|
||||
const filteredArr = arr.filter(
|
||||
item => item.countyName !== '渝北区' && item.countyName !== '江北区'
|
||||
);
|
||||
filteredArr.push(mergedItem);
|
||||
return filteredArr;
|
||||
}
|
||||
|
||||
return arr;
|
||||
};
|
||||
// 累加渝北区数据
|
||||
yubeiItems.forEach((item) => {
|
||||
mergedItem.noticeCount += item.noticeCount || 0
|
||||
mergedItem.replyCount += item.replyCount || 0
|
||||
mergedItem.population += item.population || 0
|
||||
mergedItem.entityCount += item.entityCount || 0
|
||||
})
|
||||
|
||||
// 累加江北区数据
|
||||
jiangbeiItems.forEach((item) => {
|
||||
mergedItem.noticeCount += item.noticeCount || 0
|
||||
mergedItem.replyCount += item.replyCount || 0
|
||||
mergedItem.population += item.population || 0
|
||||
mergedItem.entityCount += item.entityCount || 0
|
||||
})
|
||||
|
||||
// 移除渝北区和江北区的数据,添加合并后的两江新区数据
|
||||
const filteredArr = arr.filter((item) => item.countyName !== '渝北区' && item.countyName !== '江北区')
|
||||
filteredArr.push(mergedItem)
|
||||
return filteredArr
|
||||
}
|
||||
|
||||
return arr
|
||||
}
|
||||
|
||||
// 对三个数组分别进行合并处理
|
||||
projectarr.value = mergeLiangjiangNewArea(projectarr.value);
|
||||
nationalarr.value = mergeLiangjiangNewArea(nationalarr.value);
|
||||
ruralarr.value = mergeLiangjiangNewArea(ruralarr.value);
|
||||
projectarr.value = mergeLiangjiangNewArea(projectarr.value)
|
||||
nationalarr.value = mergeLiangjiangNewArea(nationalarr.value)
|
||||
ruralarr.value = mergeLiangjiangNewArea(ruralarr.value)
|
||||
|
||||
// 过滤出前15个项目、10个全国、5个农村
|
||||
// projectarr.value = projectarr.value.filter((item, index) => index < 15);
|
||||
@ -523,15 +495,15 @@ const scheduleStatisticsByCountyLoad = async () => {
|
||||
// );
|
||||
// ruralarr.value = ruralarr.value.filter((item, index) => index < 5);
|
||||
} else {
|
||||
projectarr.value = [];
|
||||
nationalarr.value = [];
|
||||
ruralarr.value = [];
|
||||
projectarr.value = []
|
||||
nationalarr.value = []
|
||||
ruralarr.value = []
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载调度统计区县数据失败:', error);
|
||||
console.error('加载调度统计区县数据失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 公路类型数据
|
||||
const roadTypeLoad = async () => {
|
||||
@ -540,22 +512,22 @@ const roadTypeLoad = async () => {
|
||||
url: '/snow-ops-platform/weather-warning/affected-count/_by_road',
|
||||
method: 'GET',
|
||||
params: getdateRangeTime(),
|
||||
});
|
||||
console.log(res);
|
||||
})
|
||||
console.log(res)
|
||||
if (res.code == '00000') {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
if (data) {
|
||||
roadTypeData.value = data.reverse();
|
||||
roadTypeData.value = data.reverse()
|
||||
} else {
|
||||
roadTypeData.value.forEach(item => {
|
||||
item.count = 0;
|
||||
});
|
||||
roadTypeData.value.forEach((item) => {
|
||||
item.count = 0
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载数据失败:', error);
|
||||
console.error('加载数据失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
// 加载气象预警和影响点数据
|
||||
const loadData = async () => {
|
||||
try {
|
||||
@ -563,45 +535,45 @@ const loadData = async () => {
|
||||
url: '/snow-ops-platform/weather-warning/warning-count',
|
||||
method: 'GET',
|
||||
params: getdateRangeTime(),
|
||||
});
|
||||
})
|
||||
|
||||
if (res.code == '00000') {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
if (data) {
|
||||
let obj = {};
|
||||
data.forEach(item => {
|
||||
obj[item.name] = item.count || 0;
|
||||
});
|
||||
console.log(obj);
|
||||
weatherWarningData.value.forEach(item => {
|
||||
let obj = {}
|
||||
data.forEach((item) => {
|
||||
obj[item.name] = item.count || 0
|
||||
})
|
||||
console.log(obj)
|
||||
weatherWarningData.value.forEach((item) => {
|
||||
if (item.label == '红色预警') {
|
||||
item.value = obj['warning-red-count'] + '/' + obj['warning-red-total'] || '0/0';
|
||||
item.value = obj['warning-red-count'] + '/' + obj['warning-red-total'] || '0/0'
|
||||
} else if (item.label == '橙色预警') {
|
||||
item.value = obj['warning-orange-count'] + '/' + obj['warning-orange-total'] || '0/0';
|
||||
item.value = obj['warning-orange-count'] + '/' + obj['warning-orange-total'] || '0/0'
|
||||
} else if (item.label == '黄色预警') {
|
||||
item.value = obj['warning-yellow-count'] + '/' + obj['warning-yellow-total'] || '0/0';
|
||||
item.value = obj['warning-yellow-count'] + '/' + obj['warning-yellow-total'] || '0/0'
|
||||
} else if (item.label == '蓝色预警') {
|
||||
item.value = obj['warning-blue-count'] + '/' + obj['warning-blue-total'] || '0/0';
|
||||
item.value = obj['warning-blue-count'] + '/' + obj['warning-blue-total'] || '0/0'
|
||||
}
|
||||
});
|
||||
})
|
||||
} else {
|
||||
weatherWarningData.value.forEach(item => {
|
||||
weatherWarningData.value.forEach((item) => {
|
||||
if (item.label == '红色预警') {
|
||||
item.value = '0/0';
|
||||
item.value = '0/0'
|
||||
} else if (item.label == '橙色预警') {
|
||||
item.value = '0/0';
|
||||
item.value = '0/0'
|
||||
} else if (item.label == '黄色预警') {
|
||||
item.value = '0/0';
|
||||
item.value = '0/0'
|
||||
} else if (item.label == '蓝色预警') {
|
||||
item.value = '0/0';
|
||||
item.value = '0/0'
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载数据失败:', error);
|
||||
console.error('加载数据失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 加载柱状图数据
|
||||
const loadBarChartData = async () => {
|
||||
@ -610,10 +582,10 @@ const loadBarChartData = async () => {
|
||||
url: '/snow-ops-platform/weather-warning/affected-count',
|
||||
method: 'GET',
|
||||
params: getdateRangeTime(),
|
||||
});
|
||||
})
|
||||
|
||||
if (res.code == '00000') {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
if (data.length > 0) {
|
||||
// 英文转中文映射
|
||||
const nameMap = {
|
||||
@ -627,26 +599,26 @@ const loadBarChartData = async () => {
|
||||
Tunnel: '隧道',
|
||||
Slope: '边坡',
|
||||
Project: '项目',
|
||||
};
|
||||
}
|
||||
|
||||
// 转换英文name为中文
|
||||
const convertedData = data.map(item => {
|
||||
const name = nameMap[item.name] || item.name;
|
||||
return { ...item, name };
|
||||
});
|
||||
convertedData.forEach(item => {
|
||||
const convertedData = data.map((item) => {
|
||||
const name = nameMap[item.name] || item.name
|
||||
return { ...item, name }
|
||||
})
|
||||
convertedData.forEach((item) => {
|
||||
if (item.name == '路段') {
|
||||
impactData.value[0].count = item.count || 0;
|
||||
impactData.value[0].count = item.count || 0
|
||||
} else if (item.name == '桥梁') {
|
||||
impactData.value[1].count = item.count || 0;
|
||||
impactData.value[1].count = item.count || 0
|
||||
} else if (item.name == '隧道') {
|
||||
impactData.value[2].count = item.count || 0;
|
||||
impactData.value[2].count = item.count || 0
|
||||
} else if (item.name == '边坡') {
|
||||
impactData.value[3].count = item.count || 0;
|
||||
impactData.value[3].count = item.count || 0
|
||||
} else if (item.name == '项目') {
|
||||
impactData.value[4].count = item.count || 0;
|
||||
impactData.value[4].count = item.count || 0
|
||||
}
|
||||
});
|
||||
})
|
||||
} else {
|
||||
// 影响点数据
|
||||
|
||||
@ -657,52 +629,52 @@ const loadBarChartData = async () => {
|
||||
{ name: '隧道', count: 0 },
|
||||
{ name: '边坡', count: 0 },
|
||||
{ name: '项目', count: 0 },
|
||||
])
|
||||
);
|
||||
]),
|
||||
)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载柱状图数据失败:', error);
|
||||
console.error('加载柱状图数据失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 计算最大值用于动态计算高度
|
||||
// 计算所有影响点的总和
|
||||
const totalValue = computed(() => {
|
||||
let total = 0;
|
||||
impactData.value.forEach(item => {
|
||||
total += item.count || 0;
|
||||
});
|
||||
return total;
|
||||
});
|
||||
let total = 0
|
||||
impactData.value.forEach((item) => {
|
||||
total += item.count || 0
|
||||
})
|
||||
return total
|
||||
})
|
||||
|
||||
// 计算每个柱子的高度百分比
|
||||
const getBarHeight = value => {
|
||||
const actualValue = value.count || value.value;
|
||||
if (!actualValue || actualValue == 0) return '0';
|
||||
const getBarHeight = (value) => {
|
||||
const actualValue = value.count || value.value
|
||||
if (!actualValue || actualValue == 0) return '0'
|
||||
// 确保最小高度为10%,最大高度为100%
|
||||
const height = (actualValue / totalValue.value) * 300;
|
||||
const height = (actualValue / totalValue.value) * 300
|
||||
// 确保高度差异明显,至少有3%的最小差异
|
||||
// 最大高度为100% 最新高度为3%的最小差异
|
||||
console.log(height);
|
||||
return Math.min(100, Math.max(3, Math.round(height)));
|
||||
};
|
||||
console.log(height)
|
||||
return Math.min(100, Math.max(3, Math.round(height)))
|
||||
}
|
||||
const handleAIClick = () => {
|
||||
emit('openAIResult');
|
||||
};
|
||||
emit('openAIResult')
|
||||
}
|
||||
|
||||
// 响应式单位转换函数(基于1920px设计稿)
|
||||
const vw = px => {
|
||||
return Math.round((px / 1920) * window.innerWidth);
|
||||
};
|
||||
const vw = (px) => {
|
||||
return Math.round((px / 1920) * window.innerWidth)
|
||||
}
|
||||
|
||||
// 表格高度计算
|
||||
const tableHeight = computed(() => {
|
||||
return vw(100);
|
||||
});
|
||||
return vw(100)
|
||||
})
|
||||
|
||||
// 区县数据
|
||||
const districtData = ref([]);
|
||||
const districtData = ref([])
|
||||
|
||||
// 响应调度统计数据
|
||||
const responseStats = ref([
|
||||
@ -742,14 +714,14 @@ const responseStats = ref([
|
||||
iconClass: 'icon-check',
|
||||
img: imgCheck,
|
||||
},
|
||||
]);
|
||||
])
|
||||
|
||||
// 调度清单数据
|
||||
const dispatchList = ref([
|
||||
{ label: '国省道调度', value: '341' },
|
||||
{ label: '农村公路调度', value: '210' },
|
||||
{ label: '建设工程调度', value: '120' },
|
||||
]);
|
||||
])
|
||||
|
||||
const headerCellStyle = () => ({
|
||||
background: 'rgba(64, 169, 255, 0.1)',
|
||||
@ -760,7 +732,7 @@ const headerCellStyle = () => ({
|
||||
fontSize: '14px',
|
||||
textAlign: 'center',
|
||||
lineHeight: '1.2',
|
||||
});
|
||||
})
|
||||
|
||||
const cellStyle = () => ({
|
||||
background: 'transparent',
|
||||
@ -770,7 +742,7 @@ const cellStyle = () => ({
|
||||
padding: ' 2px',
|
||||
textAlign: 'center',
|
||||
lineHeight: '1.2',
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -991,8 +963,7 @@ const cellStyle = () => ({
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-image:
|
||||
linear-gradient(to right, transparent 0%, transparent 100%),
|
||||
linear-gradient(to bottom, rgba(64, 169, 255, 0.1) 1px, transparent 1px);
|
||||
linear-gradient(to right, transparent 0%, transparent 100%), linear-gradient(to bottom, rgba(64, 169, 255, 0.1) 1px, transparent 1px);
|
||||
background-size: 100% 25%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@ -8,12 +8,7 @@
|
||||
<div class="prevention-section">
|
||||
<!-- 第一行:队伍、人员、装备、物资 -->
|
||||
<div class="resource-grid">
|
||||
<div
|
||||
v-for="(item, index) in resourceData"
|
||||
:key="index"
|
||||
class="resource-item"
|
||||
@click="handleResourceClick(item)"
|
||||
>
|
||||
<div v-for="(item, index) in resourceData" :key="index" class="resource-item" @click="handleResourceClick(item)">
|
||||
<!-- <div class="resource-icon" :class="item.iconClass"></div> -->
|
||||
<img class="resource-icon" :src="item.img" alt="" />
|
||||
<div class="resource-info">
|
||||
@ -167,12 +162,7 @@
|
||||
<div class="damage-section">
|
||||
<div class="damage-title">灾害情况</div>
|
||||
<div class="damage-grid">
|
||||
<div
|
||||
v-for="(item, index) in damageData"
|
||||
:key="index"
|
||||
class="damage-item"
|
||||
:class="item.class"
|
||||
>
|
||||
<div v-for="(item, index) in damageData" :key="index" class="damage-item" :class="item.class">
|
||||
<div class="damage-value">
|
||||
{{ item.value }}
|
||||
<span class="unit">{{ item.unit }}</span>
|
||||
@ -192,29 +182,29 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, inject, watch } from 'vue';
|
||||
import { request } from '@/utils/request';
|
||||
import { ref, computed, onMounted, inject, watch } from 'vue'
|
||||
import { request } from '@/utils/request'
|
||||
|
||||
import SectionHeader from './component/sectionHeader.vue';
|
||||
import { Calendar } from '@element-plus/icons-vue';
|
||||
import SectionHeader from './component/sectionHeader.vue'
|
||||
import { Calendar } from '@element-plus/icons-vue'
|
||||
|
||||
import icon1 from '../../assets/RiskWarning_img/icon1@2x.png';
|
||||
import icon2 from '../../assets/RiskWarning_img/icon2@2x.png';
|
||||
import icon3 from '../../assets/RiskWarning_img/icon3@2x.png';
|
||||
import icon4 from '../../assets/RiskWarning_img/icon4@2x.png';
|
||||
import icon1 from '../../assets/RiskWarning_img/icon1@2x.png'
|
||||
import icon2 from '../../assets/RiskWarning_img/icon2@2x.png'
|
||||
import icon3 from '../../assets/RiskWarning_img/icon3@2x.png'
|
||||
import icon4 from '../../assets/RiskWarning_img/icon4@2x.png'
|
||||
|
||||
import icon11 from '../../assets/RiskWarning_img/icon-1@2x.png';
|
||||
import icon12 from '../../assets/RiskWarning_img/icon-2@2x.png';
|
||||
import icon13 from '../../assets/RiskWarning_img/icon-3@2x.png';
|
||||
import icon11 from '../../assets/RiskWarning_img/icon-1@2x.png'
|
||||
import icon12 from '../../assets/RiskWarning_img/icon-2@2x.png'
|
||||
import icon13 from '../../assets/RiskWarning_img/icon-3@2x.png'
|
||||
|
||||
import icon51 from '../../assets/RiskWarning_img/编组5@2x.png';
|
||||
import icon52 from '../../assets/RiskWarning_img/编组22@2x.png';
|
||||
import icon55 from '../../assets/RiskWarning_img/路径55@2x.png';
|
||||
import icon51 from '../../assets/RiskWarning_img/编组5@2x.png'
|
||||
import icon52 from '../../assets/RiskWarning_img/编组22@2x.png'
|
||||
import icon55 from '../../assets/RiskWarning_img/路径55@2x.png'
|
||||
|
||||
import icon62 from '../../assets/RiskWarning_img/路径62@2x.png';
|
||||
import icon621 from '../../assets/RiskWarning_img/路径62@2x (1).png';
|
||||
import icon622 from '../../assets/RiskWarning_img/路径62@2x (2).png';
|
||||
import { formatDateTime } from './component/index.js';
|
||||
import icon62 from '../../assets/RiskWarning_img/路径62@2x.png'
|
||||
import icon621 from '../../assets/RiskWarning_img/路径62@2x (1).png'
|
||||
import icon622 from '../../assets/RiskWarning_img/路径62@2x (2).png'
|
||||
import { formatDateTime } from './component/index.js'
|
||||
|
||||
const emit = defineEmits([
|
||||
'openClearanceSituation',
|
||||
@ -224,24 +214,24 @@ const emit = defineEmits([
|
||||
'openPatrolMileage',
|
||||
'openPatrolSituation',
|
||||
'update:filterForm',
|
||||
]);
|
||||
])
|
||||
|
||||
// 注入兄弟组件通信机制
|
||||
const setRefreshRightData = inject('setRefreshRightData');
|
||||
const getdateRange = inject('getdateRange', ref([]));
|
||||
const setRefreshRightData = inject('setRefreshRightData')
|
||||
const getdateRange = inject('getdateRange', ref([]))
|
||||
|
||||
const props = defineProps({});
|
||||
const props = defineProps({})
|
||||
|
||||
// 日期选择器变化事件
|
||||
const handleDateChange = val => {
|
||||
dateRange.value = val;
|
||||
getDisasterStats();
|
||||
};
|
||||
const handleDateChange = (val) => {
|
||||
dateRange.value = val
|
||||
getDisasterStats()
|
||||
}
|
||||
// 点击日期范围器
|
||||
const handleDateRangeClick = val => {
|
||||
dateRange.value = [];
|
||||
getDisasterStats();
|
||||
};
|
||||
const handleDateRangeClick = (val) => {
|
||||
dateRange.value = []
|
||||
getDisasterStats()
|
||||
}
|
||||
|
||||
// 获取应急力量列表数据
|
||||
const getYhYjllList = async () => {
|
||||
@ -254,41 +244,41 @@ const getYhYjllList = async () => {
|
||||
// latitude: 22.624722,
|
||||
// maxDistance: 10 // 1000km
|
||||
},
|
||||
});
|
||||
console.log(res);
|
||||
})
|
||||
console.log(res)
|
||||
if (res.code == '00000') {
|
||||
let gl1Rysls = 0; // 人员数
|
||||
let gl1Yjllmcs = 0; // 队伍数
|
||||
res.data.forEach(item => {
|
||||
let gl1Rysls = 0 // 人员数
|
||||
let gl1Yjllmcs = 0 // 队伍数
|
||||
res.data.forEach((item) => {
|
||||
if (item.gl1Lx == 1 || item.gl1Lx == 2) {
|
||||
gl1Yjllmcs = gl1Yjllmcs + 1;
|
||||
gl1Yjllmcs = gl1Yjllmcs + 1
|
||||
}
|
||||
gl1Rysls = Number(item.gl1Rysl) + gl1Rysls;
|
||||
});
|
||||
gl1Rysls = Number(item.gl1Rysl) + gl1Rysls
|
||||
})
|
||||
if (gl1Rysls > 10000) {
|
||||
gl1Rysls = (gl1Rysls / 10000).toFixed(2);
|
||||
resourceData.value[1].unit = '万人';
|
||||
gl1Rysls = (gl1Rysls / 10000).toFixed(2)
|
||||
resourceData.value[1].unit = '万人'
|
||||
} else {
|
||||
resourceData.value[1].value = gl1Rysls;
|
||||
resourceData.value[1].unit = '人';
|
||||
resourceData.value[1].value = gl1Rysls
|
||||
resourceData.value[1].unit = '人'
|
||||
}
|
||||
resourceData.value[0].value = gl1Yjllmcs;
|
||||
resourceData.value[0].value = gl1Yjllmcs
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取应急力量列表失败:', error);
|
||||
console.error('获取应急力量列表失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 根据类型获取图标
|
||||
const getIconByType = type => {
|
||||
const getIconByType = (type) => {
|
||||
const iconMap = {
|
||||
1: icon1, // 队伍
|
||||
2: icon2, // 人员
|
||||
3: icon3, // 装备
|
||||
4: icon4, // 物资
|
||||
};
|
||||
return iconMap[type] || icon1;
|
||||
};
|
||||
}
|
||||
return iconMap[type] || icon1
|
||||
}
|
||||
|
||||
// 获取物资列表数据
|
||||
const getYhYjllListMaterials = async () => {
|
||||
@ -297,35 +287,35 @@ const getYhYjllListMaterials = async () => {
|
||||
url: '/snow-ops-platform/yhYjll/listMaterials',
|
||||
method: 'GET',
|
||||
params: {},
|
||||
});
|
||||
console.log('物资列表:', res);
|
||||
})
|
||||
console.log('物资列表:', res)
|
||||
if (res.code == '00000' && res.data) {
|
||||
let equipment = 0; // 装备数
|
||||
let materials = 0; // 物资数
|
||||
let equipment = 0 // 装备数
|
||||
let materials = 0 // 物资数
|
||||
|
||||
res.data.forEach(item => {
|
||||
res.data.forEach((item) => {
|
||||
if (item.gl1Wzlx == 1) {
|
||||
equipment = equipment + extractAndSumNumbers(item.gl1Wzsl);
|
||||
equipment = equipment + extractAndSumNumbers(item.gl1Wzsl)
|
||||
} else if (item.gl1Wzlx == 2) {
|
||||
materials = materials + extractAndSumNumbers(item.gl1Wzsl);
|
||||
materials = materials + extractAndSumNumbers(item.gl1Wzsl)
|
||||
}
|
||||
});
|
||||
})
|
||||
if (materials > 10000) {
|
||||
resourceData.value[3].value = (materials / 10000).toFixed(2);
|
||||
resourceData.value[3].unit = '万件';
|
||||
resourceData.value[3].value = (materials / 10000).toFixed(2)
|
||||
resourceData.value[3].unit = '万件'
|
||||
} else {
|
||||
resourceData.value[3].value = materials;
|
||||
resourceData.value[3].unit = '件';
|
||||
resourceData.value[3].value = materials
|
||||
resourceData.value[3].unit = '件'
|
||||
}
|
||||
|
||||
console.log(equipment, materials);
|
||||
console.log(equipment, materials)
|
||||
// 更新物资数据
|
||||
resourceData.value[2].value = equipment || '0';
|
||||
resourceData.value[2].value = equipment || '0'
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取物资列表失败:', error);
|
||||
console.error('获取物资列表失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 获取管控统计数据
|
||||
const getControlStats = async () => {
|
||||
@ -333,36 +323,36 @@ const getControlStats = async () => {
|
||||
let params = {
|
||||
start: '',
|
||||
end: '',
|
||||
};
|
||||
}
|
||||
if (getdateRange.value && getdateRange.value.length === 2) {
|
||||
params.start = formatDateTime(getdateRange.value[0]);
|
||||
params.end = formatDateTime(getdateRange.value[1]);
|
||||
params.start = formatDateTime(getdateRange.value[0])
|
||||
params.end = formatDateTime(getdateRange.value[1])
|
||||
}
|
||||
const res = await request({
|
||||
url: '/snow-ops-platform/sm-event/dashboard/control-stats',
|
||||
method: 'GET',
|
||||
params: params,
|
||||
});
|
||||
console.log('管控统计数据:', res);
|
||||
})
|
||||
console.log('管控统计数据:', res)
|
||||
if (res.code == '00000' && res.data) {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
// 更新controlData1数组的value值
|
||||
controlData1.value.forEach(item => {
|
||||
controlData1.value.forEach((item) => {
|
||||
if (item.label === '封闭管控数') {
|
||||
item.value = data.fullClosureCount || '0';
|
||||
item.value = data.fullClosureCount || '0'
|
||||
} else if (item.label === '半幅通行数') {
|
||||
item.value = data.halfClosureCount || '0';
|
||||
item.value = data.halfClosureCount || '0'
|
||||
} else if (item.label === '限速(限车型)数') {
|
||||
item.value = data.speedLimitCount || '0';
|
||||
item.value = data.speedLimitCount || '0'
|
||||
} else if (item.label === '告警阻拦处数') {
|
||||
item.value = data.warningBlockCount || '0';
|
||||
item.value = data.warningBlockCount || '0'
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取管控统计数据失败:', error);
|
||||
console.error('获取管控统计数据失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 获取抢险投入统计数据
|
||||
const getRescueInputStats = async () => {
|
||||
@ -370,50 +360,50 @@ const getRescueInputStats = async () => {
|
||||
let params = {
|
||||
start: '',
|
||||
end: '',
|
||||
};
|
||||
}
|
||||
if (getdateRange.value && getdateRange.value.length === 2) {
|
||||
params.start = formatDateTime(getdateRange.value[0]);
|
||||
params.end = formatDateTime(getdateRange.value[1]);
|
||||
params.start = formatDateTime(getdateRange.value[0])
|
||||
params.end = formatDateTime(getdateRange.value[1])
|
||||
}
|
||||
const res = await request({
|
||||
url: '/snow-ops-platform/sm-event/dashboard/rescue-input-stats',
|
||||
method: 'GET',
|
||||
params: params,
|
||||
});
|
||||
console.log('抢险投入统计数据:', res);
|
||||
})
|
||||
console.log('抢险投入统计数据:', res)
|
||||
if (res.code == '00000' && res.data) {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
// 更新rescueData数组的value值
|
||||
rescueData.value.forEach(item => {
|
||||
rescueData.value.forEach((item) => {
|
||||
if (item.label === '本轮出动人次') {
|
||||
item.value = data.investedManpower || '0';
|
||||
item.unit = '人';
|
||||
item.value = data.investedManpower || '0'
|
||||
item.unit = '人'
|
||||
if (item.value > 10000) {
|
||||
item.value = (item.value / 10000).toFixed(2);
|
||||
item.unit = '万人';
|
||||
item.value = (item.value / 10000).toFixed(2)
|
||||
item.unit = '万人'
|
||||
}
|
||||
} else if (item.label === '本轮出动设备') {
|
||||
item.value = data.investedMachinery || '0';
|
||||
item.unit = '台';
|
||||
item.value = data.investedMachinery || '0'
|
||||
item.unit = '台'
|
||||
if (item.value > 10000) {
|
||||
item.value = (item.value / 10000).toFixed(2);
|
||||
item.unit = '万台';
|
||||
item.value = (item.value / 10000).toFixed(2)
|
||||
item.unit = '万台'
|
||||
}
|
||||
} else if (item.label === '清理塌方') {
|
||||
// 将立方米转换为万立方米
|
||||
item.value = data.clearedLandslide.toFixed(2) || 0;
|
||||
item.unit = '立方米';
|
||||
item.value = data.clearedLandslide.toFixed(2) || 0
|
||||
item.unit = '立方米'
|
||||
if (item.value > 10000) {
|
||||
item.value = (item.value / 10000).toFixed(2);
|
||||
item.unit = '万立方米';
|
||||
item.value = (item.value / 10000).toFixed(2)
|
||||
item.unit = '万立方米'
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取抢险投入统计数据失败:', error);
|
||||
console.error('获取抢险投入统计数据失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 获取灾害统计数据
|
||||
const getDisasterStats = async () => {
|
||||
@ -421,146 +411,141 @@ const getDisasterStats = async () => {
|
||||
let params = {
|
||||
start: '',
|
||||
end: '',
|
||||
};
|
||||
}
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
params.start = formatDateTime(dateRange.value[0]);
|
||||
params.end = formatDateTime(dateRange.value[1]);
|
||||
params.start = formatDateTime(dateRange.value[0])
|
||||
params.end = formatDateTime(dateRange.value[1])
|
||||
}
|
||||
const res = await request({
|
||||
url: '/snow-ops-platform/sm-event/dashboard/disaster-stats',
|
||||
method: 'GET',
|
||||
params: params,
|
||||
});
|
||||
console.log('灾害统计数据:', res);
|
||||
})
|
||||
console.log('灾害统计数据:', res)
|
||||
if (res.code == '00000' && res.data) {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
// 更新blockData数组的value值
|
||||
blockData.value.forEach(item => {
|
||||
blockData.value.forEach((item) => {
|
||||
if (item.label === '今日新增阻断数') {
|
||||
item.current = data.todayNormalCount || '0';
|
||||
item.total = data.todayTotalCount || '0';
|
||||
item.current = data.todayNormalCount || '0'
|
||||
item.total = data.todayTotalCount || '0'
|
||||
} else if (item.label === '本轮累计阻断数') {
|
||||
item.current = data.roundNormalCount || '0';
|
||||
item.total = data.roundTotalCount || '0';
|
||||
item.current = data.roundNormalCount || '0'
|
||||
item.total = data.roundTotalCount || '0'
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// 更新deathData的value值
|
||||
deathData.value.value = data.roundDeadCount || '0';
|
||||
deathData.value.value = data.roundDeadCount || '0'
|
||||
|
||||
// 更新damageData数组的value值
|
||||
damageData.value.forEach(item => {
|
||||
damageData.value.forEach((item) => {
|
||||
if (item.label === '本轮塌方量') {
|
||||
data.roundLandslideVolume = data.roundLandslideVolume.toFixed(2);
|
||||
data.roundLandslideVolume = data.roundLandslideVolume.toFixed(2)
|
||||
if (data.roundLandslideVolume > 10000) {
|
||||
item.value = (data.roundLandslideVolume / 10000).toFixed(2) || '0';
|
||||
item.unit = '万立方米';
|
||||
item.value = (data.roundLandslideVolume / 10000).toFixed(2) || '0'
|
||||
item.unit = '万立方米'
|
||||
} else {
|
||||
item.value = data.roundLandslideVolume || '0';
|
||||
item.unit = '立方米';
|
||||
item.value = data.roundLandslideVolume || '0'
|
||||
item.unit = '立方米'
|
||||
}
|
||||
} else if (item.label === '汛期塌方量') {
|
||||
data.floodSeasonLandslideVolume = data.floodSeasonLandslideVolume.toFixed(2);
|
||||
data.floodSeasonLandslideVolume = data.floodSeasonLandslideVolume.toFixed(2)
|
||||
if (data.floodSeasonLandslideVolume > 10000) {
|
||||
item.value = (data.floodSeasonLandslideVolume / 10000).toFixed(2) || '0';
|
||||
item.unit = '万立方米';
|
||||
item.value = (data.floodSeasonLandslideVolume / 10000).toFixed(2) || '0'
|
||||
item.unit = '万立方米'
|
||||
} else {
|
||||
item.value = data.floodSeasonLandslideVolume || '0';
|
||||
item.unit = '立方米';
|
||||
item.value = data.floodSeasonLandslideVolume || '0'
|
||||
item.unit = '立方米'
|
||||
}
|
||||
} else if (item.label === '当年塌方量') {
|
||||
data.yearLandslideVolume = data.yearLandslideVolume.toFixed(2);
|
||||
data.yearLandslideVolume = data.yearLandslideVolume.toFixed(2)
|
||||
if (data.yearLandslideVolume > 10000) {
|
||||
item.value = (data.yearLandslideVolume / 10000).toFixed(2) || '0';
|
||||
item.unit = '万立方米';
|
||||
item.value = (data.yearLandslideVolume / 10000).toFixed(2) || '0'
|
||||
item.unit = '万立方米'
|
||||
} else {
|
||||
item.value = data.yearLandslideVolume || '0';
|
||||
item.unit = '立方米';
|
||||
item.value = data.yearLandslideVolume || '0'
|
||||
item.unit = '立方米'
|
||||
}
|
||||
} else if (item.label === '本轮已损失') {
|
||||
data.roundTotalLossAmount = data.roundTotalLossAmount.toFixed(2);
|
||||
data.roundTotalLossAmount = data.roundTotalLossAmount.toFixed(2)
|
||||
if (data.roundTotalLossAmount > 10000) {
|
||||
item.value = (data.roundTotalLossAmount / 10000).toFixed(2) || '0';
|
||||
item.unit = '亿元';
|
||||
item.value = (data.roundTotalLossAmount / 10000).toFixed(2) || '0'
|
||||
item.unit = '亿元'
|
||||
} else {
|
||||
item.value = data.roundTotalLossAmount || '0';
|
||||
item.unit = '万元';
|
||||
item.value = data.roundTotalLossAmount || '0'
|
||||
item.unit = '万元'
|
||||
}
|
||||
} else if (item.label === '汛期已损失') {
|
||||
data.floodSeasonTotalLossAmount = data.floodSeasonTotalLossAmount.toFixed(2);
|
||||
data.floodSeasonTotalLossAmount = data.floodSeasonTotalLossAmount.toFixed(2)
|
||||
if (data.floodSeasonTotalLossAmount > 10000) {
|
||||
item.value = (data.floodSeasonTotalLossAmount / 10000).toFixed(2) || '0';
|
||||
item.unit = '亿元';
|
||||
item.value = (data.floodSeasonTotalLossAmount / 10000).toFixed(2) || '0'
|
||||
item.unit = '亿元'
|
||||
} else {
|
||||
item.value = data.floodSeasonTotalLossAmount || '0';
|
||||
item.unit = '万元';
|
||||
item.value = data.floodSeasonTotalLossAmount || '0'
|
||||
item.unit = '万元'
|
||||
}
|
||||
} else if (item.label === '当年已损失') {
|
||||
data.yearTotalLossAmount = data.yearTotalLossAmount.toFixed(2);
|
||||
data.yearTotalLossAmount = data.yearTotalLossAmount.toFixed(2)
|
||||
if (data.yearTotalLossAmount > 10000) {
|
||||
item.value = (data.yearTotalLossAmount / 10000).toFixed(2) || '0';
|
||||
item.unit = '亿元';
|
||||
item.value = (data.yearTotalLossAmount / 10000).toFixed(2) || '0'
|
||||
item.unit = '亿元'
|
||||
} else {
|
||||
item.value = data.yearTotalLossAmount || '0';
|
||||
item.unit = '万元';
|
||||
item.value = data.yearTotalLossAmount || '0'
|
||||
item.unit = '万元'
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取灾害统计数据失败:', error);
|
||||
console.error('获取灾害统计数据失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 从字符串中提取数字并相加
|
||||
const extractAndSumNumbers = value => {
|
||||
const extractAndSumNumbers = (value) => {
|
||||
// 如果是数字,直接返回
|
||||
if (typeof value === 'number') {
|
||||
return value;
|
||||
return value
|
||||
}
|
||||
// 如果不是字符串,返回 0
|
||||
if (!value || typeof value !== 'string') return 0;
|
||||
if (!value || typeof value !== 'string') return 0
|
||||
// 匹配所有数字(包括小数)
|
||||
const numbers = value.match(/\d+\.?\d*/g);
|
||||
if (!numbers) return 0;
|
||||
const numbers = value.match(/\d+\.?\d*/g)
|
||||
if (!numbers) return 0
|
||||
// 将提取的数字相加
|
||||
return numbers.reduce((sum, num) => sum + Number(num), 0);
|
||||
};
|
||||
return numbers.reduce((sum, num) => sum + Number(num), 0)
|
||||
}
|
||||
|
||||
// 点击管控项
|
||||
const handleControlClick = item => {
|
||||
if (
|
||||
item.label === '封闭管控数' ||
|
||||
item.label === '半幅通行数' ||
|
||||
item.label === '限速(限车型)数' ||
|
||||
item.label === '告警阻拦处数'
|
||||
) {
|
||||
emit('openClearanceSituation');
|
||||
emit('update:dateRange', getdateRange.value || []);
|
||||
emit('update:filterForm', item || {});
|
||||
const handleControlClick = (item) => {
|
||||
if (item.label === '封闭管控数' || item.label === '半幅通行数' || item.label === '限速(限车型)数' || item.label === '告警阻拦处数') {
|
||||
emit('openClearanceSituation')
|
||||
emit('update:dateRange', getdateRange.value || [])
|
||||
emit('update:filterForm', item || {})
|
||||
} else if (item.label === '停工项目数' || item.label === '关闭驻地数') {
|
||||
emit('openControlSituation');
|
||||
emit('openControlSituation')
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 点击阻断情况
|
||||
const handleBlockClick = () => {
|
||||
emit('openClearanceSituation');
|
||||
emit('update:filterForm', {});
|
||||
};
|
||||
emit('openClearanceSituation')
|
||||
emit('update:filterForm', {})
|
||||
}
|
||||
|
||||
// 点击巡查公路里程
|
||||
const handlePatrolClick = () => {
|
||||
emit('openPatrolMileage');
|
||||
};
|
||||
emit('openPatrolMileage')
|
||||
}
|
||||
|
||||
// 点击巡查情况
|
||||
const handlePatrolSituationClick = () => {
|
||||
emit('openPatrolSituation');
|
||||
};
|
||||
emit('openPatrolSituation')
|
||||
}
|
||||
|
||||
// 日期范围选择器
|
||||
const dateRange = ref([]);
|
||||
const dateRange = ref([])
|
||||
|
||||
// 资源数据(队伍、人员、装备、物资)
|
||||
const resourceData = ref([
|
||||
@ -592,12 +577,12 @@ const resourceData = ref([
|
||||
iconClass: 'icon-material',
|
||||
img: icon4,
|
||||
},
|
||||
]);
|
||||
])
|
||||
|
||||
// 点击资源项
|
||||
const handleResourceClick = item => {
|
||||
emit('openResourceDetail', item);
|
||||
};
|
||||
const handleResourceClick = (item) => {
|
||||
emit('openResourceDetail', item)
|
||||
}
|
||||
|
||||
// 管控路段数据
|
||||
const controlData1 = ref([
|
||||
@ -605,12 +590,12 @@ const controlData1 = ref([
|
||||
{ label: '半幅通行数', value: '40' },
|
||||
{ label: '限速(限车型)数', value: '24' },
|
||||
{ label: '告警阻拦处数', value: '32' },
|
||||
]);
|
||||
])
|
||||
const controlData2 = ref([
|
||||
{ label: '停工项目数', value: '0', key: 'stoped_project_count' },
|
||||
{ label: '关闭驻地数', value: '0', key: 'closed_site_count' },
|
||||
{ label: '转移撤离人员数', value: '0', key: 'displaced_population' },
|
||||
]);
|
||||
])
|
||||
|
||||
// 获取气象预警受影响统计(按项目)
|
||||
const getAffectedCountByProject = async () => {
|
||||
@ -618,31 +603,31 @@ const getAffectedCountByProject = async () => {
|
||||
let params = {
|
||||
start: '',
|
||||
end: '',
|
||||
};
|
||||
}
|
||||
if (getdateRange.value && getdateRange.value.length === 2) {
|
||||
params.start = formatDateTime(getdateRange.value[0]);
|
||||
params.end = formatDateTime(getdateRange.value[1]);
|
||||
params.start = formatDateTime(getdateRange.value[0])
|
||||
params.end = formatDateTime(getdateRange.value[1])
|
||||
}
|
||||
const res = await request({
|
||||
url: '/snow-ops-platform/weather-warning/affected-count/_by_project',
|
||||
method: 'GET',
|
||||
params: params,
|
||||
});
|
||||
console.log('气象预警受影响统计:', res);
|
||||
})
|
||||
console.log('气象预警受影响统计:', res)
|
||||
if (res.code === '00000' && res.data) {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
// 更新 controlData2 数组的值
|
||||
controlData2.value.forEach(item => {
|
||||
const matchedData = data.find(d => d.name === item.key);
|
||||
controlData2.value.forEach((item) => {
|
||||
const matchedData = data.find((d) => d.name === item.key)
|
||||
if (matchedData) {
|
||||
item.value = String(matchedData.count);
|
||||
item.value = String(matchedData.count)
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取气象预警受影响统计失败:', error);
|
||||
console.error('获取气象预警受影响统计失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 巡查数据
|
||||
const patrolData = ref([
|
||||
@ -651,10 +636,10 @@ const patrolData = ref([
|
||||
{ label: '巡查边坡数', value: '0', key: 'slopeInspectionCount' },
|
||||
{ label: '巡查隧道数', value: '0', key: 'tunnelInspectionCount' },
|
||||
{ label: '发现隐患数', value: '0', key: 'hiddenDangerCount' },
|
||||
]);
|
||||
])
|
||||
|
||||
// 巡查公路里程
|
||||
const roadInspectionMileage = ref('0');
|
||||
const roadInspectionMileage = ref('0')
|
||||
|
||||
// 获取巡查统计数据
|
||||
const getInspectionStats = async () => {
|
||||
@ -662,40 +647,40 @@ const getInspectionStats = async () => {
|
||||
let params = {
|
||||
start: '',
|
||||
end: '',
|
||||
};
|
||||
}
|
||||
if (getdateRange.value && getdateRange.value.length === 2) {
|
||||
params.start = formatDateTime(getdateRange.value[0]);
|
||||
params.end = formatDateTime(getdateRange.value[1]);
|
||||
params.start = formatDateTime(getdateRange.value[0])
|
||||
params.end = formatDateTime(getdateRange.value[1])
|
||||
}
|
||||
const res = await request({
|
||||
url: '/snow-ops-platform/yhWgxc/weather-warning/inspection-stats',
|
||||
method: 'GET',
|
||||
params: params,
|
||||
});
|
||||
console.log('巡查统计数据:', res);
|
||||
})
|
||||
console.log('巡查统计数据:', res)
|
||||
if (res.code == '00000' && res.data) {
|
||||
const data = res.data;
|
||||
const data = res.data
|
||||
// 更新巡查公路里程
|
||||
roadInspectionMileage.value = data.roadInspectionMileage || '0';
|
||||
roadInspectionMileage.value = data.roadInspectionMileage || '0'
|
||||
// 更新patrolData数组的value值
|
||||
patrolData.value.forEach(item => {
|
||||
patrolData.value.forEach((item) => {
|
||||
if (item.key === 'roadSectionInspectionCount') {
|
||||
item.value = data.roadSectionInspectionCount || '0';
|
||||
item.value = data.roadSectionInspectionCount || '0'
|
||||
} else if (item.key === 'bridgeInspectionCount') {
|
||||
item.value = data.bridgeInspectionCount || '0';
|
||||
item.value = data.bridgeInspectionCount || '0'
|
||||
} else if (item.key === 'slopeInspectionCount') {
|
||||
item.value = data.slopeInspectionCount || '0';
|
||||
item.value = data.slopeInspectionCount || '0'
|
||||
} else if (item.key === 'tunnelInspectionCount') {
|
||||
item.value = data.tunnelInspectionCount || '0';
|
||||
item.value = data.tunnelInspectionCount || '0'
|
||||
} else if (item.key === 'hiddenDangerCount') {
|
||||
item.value = data.hiddenDangerCount || '0';
|
||||
item.value = data.hiddenDangerCount || '0'
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取巡查统计数据失败:', error);
|
||||
console.error('获取巡查统计数据失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 抢险投入数据
|
||||
const rescueData = ref([
|
||||
@ -720,16 +705,16 @@ const rescueData = ref([
|
||||
iconClass: 'icon-rescue-clear',
|
||||
img: icon13,
|
||||
},
|
||||
]);
|
||||
])
|
||||
|
||||
// 受灾情况 - 阻断数据
|
||||
const blockData = ref([
|
||||
{ label: '今日新增阻断数', current: '19', total: '23' },
|
||||
{ label: '本轮累计阻断数', current: '10', total: '23' },
|
||||
]);
|
||||
])
|
||||
|
||||
// 伤亡人数
|
||||
const deathData = ref({ label: '本轮因灾伤亡人数', value: '5' });
|
||||
const deathData = ref({ label: '本轮因灾伤亡人数', value: '5' })
|
||||
|
||||
// 灾害情况数据
|
||||
const damageData = ref([
|
||||
@ -739,44 +724,42 @@ const damageData = ref([
|
||||
{ label: '本轮已损失', value: '80', unit: '万元', class: 'red' },
|
||||
{ label: '汛期已损失', value: '18', unit: '万元', class: 'red' },
|
||||
{ label: '当年已损失', value: '350', unit: '万元', class: 'red' },
|
||||
]);
|
||||
])
|
||||
|
||||
// 重大事件数
|
||||
const majorEvent = '0';
|
||||
const majorEvent = '0'
|
||||
|
||||
// 刷新数据的函数(提前定义,避免watch中调用时未初始化)
|
||||
const init = () => {
|
||||
console.log('right.vue 刷新数据');
|
||||
getYhYjllList(); // 获取应急力量列表数据
|
||||
getYhYjllListMaterials(); // 获取物资列表数据
|
||||
console.log('right.vue 刷新数据')
|
||||
getYhYjllList() // 获取应急力量列表数据
|
||||
getYhYjllListMaterials() // 获取物资列表数据
|
||||
|
||||
getControlStats(); // 获取管控统计数据
|
||||
getAffectedCountByProject(); // 获取气象预警受影响统计数据
|
||||
getRescueInputStats(); // 获取抢险投入统计数据
|
||||
getControlStats() // 获取管控统计数据
|
||||
getAffectedCountByProject() // 获取气象预警受影响统计数据
|
||||
getRescueInputStats() // 获取抢险投入统计数据
|
||||
|
||||
getDisasterStats(); // 获取灾害统计数据
|
||||
getInspectionStats(); // 获取巡查统计数据
|
||||
};
|
||||
getDisasterStats() // 获取灾害统计数据
|
||||
getInspectionStats() // 获取巡查统计数据
|
||||
}
|
||||
|
||||
// 组件挂载时获取数据并注册刷新函数
|
||||
onMounted(() => {
|
||||
init();
|
||||
init()
|
||||
// 注册刷新函数到父组件
|
||||
if (setRefreshRightData) {
|
||||
setRefreshRightData(init);
|
||||
setRefreshRightData(init)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
watch(
|
||||
() => getdateRange.value,
|
||||
newVal => {
|
||||
console.log('right.vue 日期范围变化:', newVal);
|
||||
if (newVal && newVal.length === 2) {
|
||||
init();
|
||||
}
|
||||
(newVal) => {
|
||||
console.log('right.vue 日期范围变化:', newVal)
|
||||
init()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
{ deep: true, immediate: true },
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -6,6 +6,7 @@ import vue from '@vitejs/plugin-vue'
|
||||
import { resolve } from 'path'
|
||||
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
||||
import cesium from 'vite-plugin-cesium'
|
||||
import { PROXY_TARGET } from './api.config.js'
|
||||
|
||||
const DEFAULT_BUILD_BASE = '/bxztpc/'
|
||||
|
||||
@ -93,9 +94,7 @@ export default defineConfig(({ command, mode }) => {
|
||||
cors: true,
|
||||
proxy: {
|
||||
'/snow-ops-platform': {
|
||||
// target: 'http://192.168.110.16:8661/',
|
||||
target: 'http://8.137.54.85:8661/', //测试环境
|
||||
// target: 'http://192.168.110.36:8661/', //张启生本地环境
|
||||
target: PROXY_TARGET,
|
||||
changeOrigin: true,
|
||||
},
|
||||
}
|
||||
|
||||
754
pnpm-lock.yaml
generated
754
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user