处理影响点详情数据回填,处理大屏重复调用接口问题,修复弹窗数据缓存问题,修复文档bug。
This commit is contained in:
parent
4ab5bb0abd
commit
037cd50871
@ -21,7 +21,11 @@
|
||||
<div class="panel left-panel">
|
||||
<div class="panel-title">气象预警信息</div>
|
||||
<div class="panel-content">
|
||||
<div class="warning-content-container">{{ warningData.warningContent }}</div>
|
||||
<div class="warning-content-container">
|
||||
<div>{{ warningData.warningContent }}</div>
|
||||
<div>生效时间:2025-11-13 00:31:30.0</div>
|
||||
<div>失效时间:2025-11-14 06:00:00.0</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -266,6 +266,7 @@ const fetchEventDetail = async () => {
|
||||
contactPhone: item.gl1Lxdh || '-',
|
||||
// disposeDesc: 处置情况描述
|
||||
sceneDesc: item.gl1Xcqkms || '-',
|
||||
images: item.gl1Zjtp ? [item.gl1Zjtp] : [],
|
||||
}))
|
||||
} else {
|
||||
feedbackList.value = []
|
||||
|
||||
@ -65,18 +65,13 @@
|
||||
</div>
|
||||
|
||||
<!-- 照片 -->
|
||||
<div class="section" v-if="photoList.length > 0">
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<span class="title-icon">▍</span>
|
||||
照片
|
||||
</div>
|
||||
<div class="photo-list">
|
||||
<div
|
||||
v-for="(photo, index) in photoList"
|
||||
:key="index"
|
||||
class="photo-item"
|
||||
@click="previewImage(photo)"
|
||||
>
|
||||
<div v-for="(photo, index) in photoList" :key="index" class="photo-item" @click="previewImage(photo)">
|
||||
<img :src="photo" alt="照片" />
|
||||
</div>
|
||||
</div>
|
||||
@ -117,10 +112,7 @@
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">是否发现问题:</span>
|
||||
<span
|
||||
class="detail-value"
|
||||
:class="record.hasProblem ? 'status-yes' : 'status-no'"
|
||||
>
|
||||
<span class="detail-value" :class="record.hasProblem ? 'status-yes' : 'status-no'">
|
||||
{{ record.hasProblem ? '是' : '否' }}
|
||||
</span>
|
||||
</div>
|
||||
@ -145,10 +137,11 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { Close } from '@element-plus/icons-vue';
|
||||
import baseDialog from '../component/baseDialog.vue';
|
||||
import { request } from '@/utils/request';
|
||||
import { ref, watch } from 'vue'
|
||||
import { Close } from '@element-plus/icons-vue'
|
||||
import baseDialog from '../component/baseDialog.vue'
|
||||
import { request } from '@/utils/request'
|
||||
import { getImageUrlList } from '../component/index.js'
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
@ -163,9 +156,9 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:visible', 'close']);
|
||||
const emit = defineEmits(['update:visible', 'close'])
|
||||
|
||||
// 基本信息
|
||||
const basicInfo = ref({
|
||||
@ -176,18 +169,18 @@ const basicInfo = ref({
|
||||
location: '',
|
||||
riskDesc: '',
|
||||
discoverTime: '',
|
||||
});
|
||||
})
|
||||
watch(
|
||||
() => props.item,
|
||||
newVal => {
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
// 当弹窗打开时获取数据
|
||||
getAffectedObjectTypeId(props.item);
|
||||
getAffectedObjectTypeId(props.item)
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
)
|
||||
// 照片列表
|
||||
const photoList = ref([]);
|
||||
const photoList = ref([])
|
||||
|
||||
// 动态记录
|
||||
const dynamicRecords = ref([
|
||||
@ -207,82 +200,79 @@ const dynamicRecords = ref([
|
||||
// hasProblem: false,
|
||||
// image: null,
|
||||
// },
|
||||
]);
|
||||
])
|
||||
|
||||
// 状态样式
|
||||
const getStatusClass = status => {
|
||||
if (status === '未回应') return 'status-unresponse';
|
||||
if (status === '已回应') return 'status-response';
|
||||
return '';
|
||||
};
|
||||
const getStatusClass = (status) => {
|
||||
if (status === '未回应') return 'status-unresponse'
|
||||
if (status === '已回应') return 'status-response'
|
||||
return ''
|
||||
}
|
||||
|
||||
// 图片预览
|
||||
const previewVisible = ref(false);
|
||||
const previewImageUrl = ref('');
|
||||
const previewVisible = ref(false)
|
||||
const previewImageUrl = ref('')
|
||||
|
||||
const previewImage = url => {
|
||||
previewImageUrl.value = url;
|
||||
previewVisible.value = true;
|
||||
};
|
||||
const previewImage = (url) => {
|
||||
previewImageUrl.value = url
|
||||
previewVisible.value = true
|
||||
}
|
||||
|
||||
const closePreview = () => {
|
||||
previewVisible.value = false;
|
||||
previewImageUrl.value = '';
|
||||
};
|
||||
previewVisible.value = false
|
||||
previewImageUrl.value = ''
|
||||
}
|
||||
|
||||
// 关闭对话框
|
||||
const handleClose = () => {
|
||||
emit('update:visible', false);
|
||||
emit('close');
|
||||
};
|
||||
const leveltext = level => {
|
||||
if (level.includes('一') || level.includes('1')) return '一类';
|
||||
if (level.includes('二') || level.includes('2')) return '二类';
|
||||
if (level.includes('三') || level.includes('3')) return '三类';
|
||||
if (level.includes('四') || level.includes('4')) return '四类';
|
||||
if (level.includes('五') || level.includes('5')) return '五类';
|
||||
if (level.includes('9')) return '未评定';
|
||||
return '未评定';
|
||||
};
|
||||
emit('update:visible', false)
|
||||
emit('close')
|
||||
}
|
||||
const leveltext = (level) => {
|
||||
if (level.includes('一') || level.includes('1')) return '一类'
|
||||
if (level.includes('二') || level.includes('2')) return '二类'
|
||||
if (level.includes('三') || level.includes('3')) return '三类'
|
||||
if (level.includes('四') || level.includes('4')) return '四类'
|
||||
if (level.includes('五') || level.includes('5')) return '五类'
|
||||
if (level.includes('9')) return '未评定'
|
||||
return '未评定'
|
||||
}
|
||||
// 点击遮罩关闭已由base-dialog组件处理
|
||||
// 处理影响点类型数据
|
||||
const getAffectedObjectTypeId = data => {
|
||||
let pointType = props.item.pointType;
|
||||
const getAffectedObjectTypeId = (data) => {
|
||||
let pointType = props.item.pointType
|
||||
basicInfo.value = {}
|
||||
photoList.value = []
|
||||
dynamicRecords.value = []
|
||||
if (!data) {
|
||||
basicInfo.value = {};
|
||||
photoList.value = [];
|
||||
dynamicRecords.value = [];
|
||||
return;
|
||||
return
|
||||
}
|
||||
if (pointType === '桥梁') {
|
||||
// 更新基本信息 - 根据数据库字段映射
|
||||
basicInfo.value = {
|
||||
district: data.GL1_QXMC || '-', // 区县名称
|
||||
level: leveltext(data.GL1_JSZKPJDJ) || '未评定', // 技术状况评级等级
|
||||
levelClass:
|
||||
data.GL1_JSZKPJDJ === '一类' || data.GL1_JSZKPJDJ === '二类'
|
||||
? 'level-normal'
|
||||
: 'level-serious', // 一二类为一般,三四五类为重大
|
||||
levelClass: data.GL1_JSZKPJDJ === '一类' || data.GL1_JSZKPJDJ === '二类' ? 'level-normal' : 'level-serious', // 一二类为一般,三四五类为重大
|
||||
roadCode: data.GL1_LXBH || '-', // 路线编号
|
||||
location: data.GL1_QLMC || '-', // 桥梁名称作为位置
|
||||
riskDesc: data.GL1_DQBH || '-', // 当前病害
|
||||
discoverTime: data.GL1_JSZKPDRQ || '-', // 技术状况评定日期
|
||||
};
|
||||
}
|
||||
// 更新照片列表 - 使用桥梁照片字段
|
||||
const photos = [];
|
||||
const photos = []
|
||||
if (data.GL1_QLZMZFJ) {
|
||||
photos.push(data.GL1_QLZMZFJ); // 桥梁正面照附件
|
||||
photos.push(data.GL1_QLZMZFJ) // 桥梁正面照附件
|
||||
}
|
||||
if (data.GL1_QLLMZFJ) {
|
||||
photos.push(data.GL1_QLLMZFJ); // 桥梁立面照附件
|
||||
photos.push(data.GL1_QLLMZFJ) // 桥梁立面照附件
|
||||
}
|
||||
if (data.GL1_QLDXZFJ) {
|
||||
photos.push(data.GL1_QLDXZFJ); // 桥梁典型照附件
|
||||
photos.push(data.GL1_QLDXZFJ) // 桥梁典型照附件
|
||||
}
|
||||
if (data.GL1_QLZP) {
|
||||
photos.push(data.GL1_QLZP); // 桥梁照片
|
||||
photos.push(data.GL1_QLZP) // 桥梁照片
|
||||
}
|
||||
photoList.value = photos.length > 0 ? photos : [];
|
||||
photoList.value = photos.length > 0 ? photos : []
|
||||
|
||||
// 更新动态记录 - 桥梁信息没有巡查记录,使用基础信息展示
|
||||
// dynamicRecords.value = [
|
||||
@ -300,22 +290,19 @@ const getAffectedObjectTypeId = data => {
|
||||
basicInfo.value = {
|
||||
district: data.GL1_QXMC || '-', // 区县名称
|
||||
level: leveltext(data.GL1_FXDJ) || '未评定', // 风险等级
|
||||
levelClass:
|
||||
data.GL1_FXDJ?.includes('一级') || data.GL1_FXDJ?.includes('二级')
|
||||
? 'level-normal'
|
||||
: 'level-serious', // 一二级为一般,三四五级为重大
|
||||
levelClass: data.GL1_FXDJ?.includes('一级') || data.GL1_FXDJ?.includes('二级') ? 'level-normal' : 'level-serious', // 一二级为一般,三四五级为重大
|
||||
roadCode: data.GL1_LXBM || '-', // 路线编码
|
||||
location: data.GL1_BPGC || '-', // 边坡概况
|
||||
riskDesc: data.GL1_JCSSSZ || '-', // 监测设施设置
|
||||
discoverTime: data.GL1_ZRRXM || '-', // 责任人姓名
|
||||
};
|
||||
}
|
||||
|
||||
// 更新照片列表 - 边坡照片字段
|
||||
const photos = [];
|
||||
const photos = []
|
||||
if (data.GL1_ZRLXFS) {
|
||||
photos.push(data.GL1_ZRLXFS); // 责任人联系方式(可能包含图片URL)
|
||||
photos.push(data.GL1_ZRLXFS) // 责任人联系方式(可能包含图片URL)
|
||||
}
|
||||
photoList.value = photos.length > 0 ? photos : [];
|
||||
photoList.value = photos.length > 0 ? photos : []
|
||||
|
||||
// 更新动态记录 - 边坡信息展示
|
||||
// dynamicRecords.value = [
|
||||
@ -333,29 +320,28 @@ const getAffectedObjectTypeId = data => {
|
||||
basicInfo.value = {
|
||||
district: data.GL1_QXMC || '-', // 区县名称
|
||||
level: leveltext(data.GL1_PDDJ) || '未评定', // 评定等级
|
||||
levelClass:
|
||||
data.GL1_PDDJ === '一级' || data.GL1_PDDJ === '二级' ? 'level-normal' : 'level-serious', // 一二级为一般,三四五级为重大
|
||||
levelClass: data.GL1_PDDJ === '一级' || data.GL1_PDDJ === '二级' ? 'level-normal' : 'level-serious', // 一二级为一般,三四五级为重大
|
||||
roadCode: data.GL1_LXBH || '-', // 路线编号
|
||||
location: data.GL1_SDMC || '-', // 隧道名称作为位置
|
||||
riskDesc: data.GL1_BHMS || '-', // 病害描述
|
||||
discoverTime: data.GL1_PDRQ || '-', // 评定日期
|
||||
};
|
||||
}
|
||||
|
||||
// 更新照片列表 - 使用隧道照片字段
|
||||
const photos = [];
|
||||
const photos = []
|
||||
if (data.GL1_SDJDKFJS) {
|
||||
photos.push(data.GL1_SDJDKFJS); // 隧道进洞口照片
|
||||
photos.push(data.GL1_SDJDKFJS) // 隧道进洞口照片
|
||||
}
|
||||
if (data.GL1_SDCDKFJS) {
|
||||
photos.push(data.GL1_SDCDKFJS); // 隧道出洞口照片
|
||||
photos.push(data.GL1_SDCDKFJS) // 隧道出洞口照片
|
||||
}
|
||||
if (data.GL1_SDDXZP) {
|
||||
photos.push(data.GL1_SDDXZP); // 隧道典型照片
|
||||
photos.push(data.GL1_SDDXZP) // 隧道典型照片
|
||||
}
|
||||
if (data.GL1_TP) {
|
||||
photos.push(data.GL1_TP); // 图片
|
||||
photos.push(data.GL1_TP) // 图片
|
||||
}
|
||||
photoList.value = photos.length > 0 ? photos : [];
|
||||
photoList.value = photos.length > 0 ? photos : []
|
||||
|
||||
// 更新动态记录 - 隧道信息展示
|
||||
// dynamicRecords.value = [
|
||||
@ -378,11 +364,15 @@ const getAffectedObjectTypeId = data => {
|
||||
location: data.pointLocation, // 起点到终点
|
||||
riskDesc: data.rawData.GL1_FXMS || '-', // 风险点
|
||||
discoverTime: data.rawData.GL1_SBSJ || '-', // 发现时间
|
||||
};
|
||||
|
||||
}
|
||||
const photos = []
|
||||
// 更新照片列表 - 路段一般没有照片
|
||||
photoList.value = [];
|
||||
if (getImageUrlList(data.item?.RISK_POINT?.GL1_TP).length > 0) {
|
||||
photos.push(...getImageUrlList(data.item?.RISK_POINT?.GL1_TP || '')) // 图片
|
||||
}
|
||||
photoList.value = photos.length > 0 ? photos : []
|
||||
|
||||
console.log('照片列表:', photos)
|
||||
// 更新动态记录 - 路段信息展示
|
||||
// dynamicRecords.value = [
|
||||
// {
|
||||
@ -395,58 +385,58 @@ const getAffectedObjectTypeId = data => {
|
||||
// },
|
||||
// ];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 获取影响点详情数据
|
||||
const getAffectedObjectDetail = async () => {
|
||||
try {
|
||||
let id = '';
|
||||
let apiUrl = '';
|
||||
const pointType = props.item?.pointType;
|
||||
let id = ''
|
||||
let apiUrl = ''
|
||||
const pointType = props.item?.pointType
|
||||
|
||||
if (pointType === '桥梁') {
|
||||
id = props.item?.rawData?.GL1_ZJ || '';
|
||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/bridge/${id}`;
|
||||
id = props.item?.rawData?.GL1_ZJ || ''
|
||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/bridge/${id}`
|
||||
} else if (pointType === '边坡') {
|
||||
id = props.item?.rawData?.GL1_ID || '';
|
||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/slope/${id}`;
|
||||
id = props.item?.rawData?.GL1_ID || ''
|
||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/slope/${id}`
|
||||
} else if (pointType === '隧道') {
|
||||
id = props.item?.rawData?.GL1_ZJ || '';
|
||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/tunnel/${id}`;
|
||||
id = props.item?.rawData?.GL1_ZJ || ''
|
||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/tunnel/${id}`
|
||||
} else if (pointType === '路段') {
|
||||
id = props.item?.rawData?.GL1ZJ || '';
|
||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/road-section/${id}`;
|
||||
id = props.item?.rawData?.GL1ZJ || ''
|
||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/road-section/${id}`
|
||||
}
|
||||
|
||||
if (!id || !apiUrl) {
|
||||
console.warn('未找到影响点ID或API地址');
|
||||
return;
|
||||
console.warn('未找到影响点ID或API地址')
|
||||
return
|
||||
}
|
||||
|
||||
const res = await request({
|
||||
url: apiUrl,
|
||||
method: 'GET',
|
||||
});
|
||||
})
|
||||
|
||||
console.log('影响点详情数据:', res);
|
||||
console.log('影响点详情数据:', res)
|
||||
if (res.code === '00000') {
|
||||
getAffectedObjectTypeId(res.data || {});
|
||||
getAffectedObjectTypeId(res.data || {})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取影响点详情数据失败:', error);
|
||||
console.error('获取影响点详情数据失败:', error)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 监听visible变化
|
||||
watch(
|
||||
() => props.visible,
|
||||
newVal => {
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
// 当弹窗打开时获取数据
|
||||
// getAffectedObjectDetail();
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -209,7 +209,6 @@ import Icon3 from '../../../assets/xiangying/未选中3@2x.png'
|
||||
import Icon4 from '../../../assets/xiangying/未选中4@2x.png'
|
||||
|
||||
import { formatDateTime } from '../component/index.js'
|
||||
onMounted(() => {})
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
@ -367,6 +366,9 @@ const loadBarChartData = async () => {
|
||||
|
||||
// 转换英文name为中文
|
||||
const convertedData = data.map((item) => {
|
||||
if (item.extension == '项目') {
|
||||
item.extension = '驻地'
|
||||
}
|
||||
const name = nameMap[item.name] || item.name
|
||||
return { ...item, name }
|
||||
})
|
||||
@ -463,8 +465,8 @@ const handleSearch = () => {
|
||||
|
||||
// 查看详情
|
||||
const handleDetail = (item) => {
|
||||
emit('detail', item)
|
||||
emit('itemClick', item)
|
||||
emit('detail', { ...item, warningId: props.handleImpactItem.warningId })
|
||||
emit('itemClick', { ...item, warningId: props.handleImpactItem.warningId })
|
||||
}
|
||||
|
||||
// 分页操作
|
||||
@ -484,7 +486,7 @@ const handleFilterChange = () => {
|
||||
}
|
||||
// 获取时间参数
|
||||
|
||||
const getTimeParams = () => {
|
||||
const getTimeParams = (type) => {
|
||||
console.log('原始时间范围:', props.handleImpactItem)
|
||||
let countyId = ''
|
||||
console.log('区域:', filterForm.value)
|
||||
@ -493,10 +495,7 @@ const getTimeParams = () => {
|
||||
countyId = item.value || ''
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
// start: `${year}-${month}-01 00:00:00`,
|
||||
// end: `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`,
|
||||
let obj = {
|
||||
start: formatDateTime(props.getdateRange[0] ? props.getdateRange[0] : props.handleImpactItem.dateRange?.[0] || ''),
|
||||
end: formatDateTime(props.getdateRange[1] ? props.getdateRange[1] : props.handleImpactItem.dateRange?.[1] || ''),
|
||||
limit: pageSize.value,
|
||||
@ -505,6 +504,15 @@ const getTimeParams = () => {
|
||||
riskLevel: filterForm.value.pointLevel || '',
|
||||
roadTypes: filterForm.value.roadType || '',
|
||||
}
|
||||
if (type === '路段' || type === '驻地') {
|
||||
obj.warningId = props.handleImpactItem.warningId || ''
|
||||
}
|
||||
|
||||
return obj
|
||||
// {
|
||||
// // start: `${year}-${month}-01 00:00:00`,
|
||||
// // end: `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`,
|
||||
// }
|
||||
}
|
||||
// 处理数据为统一格式
|
||||
const processUnifiedData = (item, type) => {
|
||||
@ -752,7 +760,7 @@ const processDataByType = (item, type) => {
|
||||
const fetchData = async () => {
|
||||
console.log('获取第', currentPage.value, '页数据, 类型:', cardType.value)
|
||||
try {
|
||||
const timeParams = getTimeParams()
|
||||
const timeParams = getTimeParams(cardTypeVal.value)
|
||||
|
||||
// 根据 cardType 获取对应的 API URL
|
||||
const apiUrl = getApiUrlByType(cardTypeVal.value)
|
||||
@ -811,20 +819,22 @@ watch(
|
||||
total.value = 0
|
||||
tableData.value = []
|
||||
cardType.value = '0'
|
||||
loadBarChartData()
|
||||
console.log('影响点情况=========newVal:', newVal)
|
||||
if (newVal) {
|
||||
filterForm.value.region = newVal.countyName
|
||||
currentPage.value = 1
|
||||
fetchData()
|
||||
} else {
|
||||
filterForm.value = {
|
||||
district: '',
|
||||
type: '',
|
||||
roadConditionType: '',
|
||||
roadType: '',
|
||||
pointType: '',
|
||||
}
|
||||
cardType.value = '0'
|
||||
}
|
||||
fetchData()
|
||||
loadBarChartData()
|
||||
},
|
||||
)
|
||||
// 监听visible变化
|
||||
@ -839,9 +849,9 @@ watch(
|
||||
// }
|
||||
// tableData.value = []
|
||||
// cardType.value = '0'
|
||||
loadBarChartData()
|
||||
// loadBarChartData()
|
||||
// currentPage.value = 1
|
||||
// fetchData()
|
||||
//
|
||||
// }
|
||||
},
|
||||
)
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
@click="handleClick(item.type)"
|
||||
class="stat-card"
|
||||
:style="{
|
||||
backgroundImage: `url(${cardType === item.type ? selectedIcon : unselectedIcon})`,
|
||||
backgroundImage: `url(${cardType == item.type ? selectedIcon : unselectedIcon})`,
|
||||
backgroundSize: '100% 100%',
|
||||
backgroundPosition: 'center',
|
||||
}"
|
||||
@ -415,7 +415,25 @@ const handleFilterChange = () => {
|
||||
watch(
|
||||
() => props.visible,
|
||||
(newVal) => {
|
||||
filterForm.value = {
|
||||
pointType: '',
|
||||
pointLevel: '',
|
||||
region: '',
|
||||
}
|
||||
tableData.value = []
|
||||
cardType.value = '路段'
|
||||
currentPage.value = 1
|
||||
if (newVal) {
|
||||
// fetchData()
|
||||
loadBarChartData()
|
||||
}
|
||||
},
|
||||
)
|
||||
watch(
|
||||
() => cardType.value,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
tableData.value = []
|
||||
currentPage.value = 1
|
||||
fetchData()
|
||||
loadBarChartData()
|
||||
@ -428,7 +446,6 @@ watch(
|
||||
() => props.dispatchDateRange,
|
||||
() => {
|
||||
if (props.visible) {
|
||||
currentPage.value = 1
|
||||
fetchData()
|
||||
}
|
||||
},
|
||||
@ -437,7 +454,7 @@ watch(
|
||||
|
||||
onMounted(() => {
|
||||
// 初始化加载顶部卡片数据
|
||||
loadBarChartData()
|
||||
// loadBarChartData()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ const props = defineProps({
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:visible', 'close', 'impactClick'])
|
||||
const emit = defineEmits(['update:visible', 'close', 'impactClick', 'impactClickItem'])
|
||||
|
||||
// 日期范围器
|
||||
const dateRange = ref([])
|
||||
@ -224,6 +224,7 @@ const fetchWarningData = async () => {
|
||||
endTime: item.endTime || '-',
|
||||
impactCount: item.affectedCount || 0,
|
||||
warningId: item.warningId || '',
|
||||
...item,
|
||||
}))
|
||||
} else {
|
||||
tableData.value = []
|
||||
|
||||
@ -17,10 +17,9 @@
|
||||
:dataList="centerCardDataList"
|
||||
@close="closeCenterCard"
|
||||
@itemClick="handleCenterCardItemClick"
|
||||
@click="handleCenterCardClick"
|
||||
/>
|
||||
|
||||
<hazardPointSituationDialog v-model:visible="hazardPointSituationDialogVisible" :data="{}" @close="closeHazardPointSituationDialog" />
|
||||
<hazardPointSituationDialog :data="{}" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -1738,15 +1737,14 @@ const handleHazardItemClick = async (item, flag) => {
|
||||
const riskLevel = riskLevelMap[item.label] || ''
|
||||
await getRiskPointData(riskLevel, item, flag)
|
||||
}
|
||||
|
||||
const flag = ref(true)
|
||||
// 监听 dateRange 变化,重新加载数据
|
||||
watch(
|
||||
() => props.dateRange,
|
||||
async (newVal, oldVal) => {
|
||||
console.log('dateRange 变化:', newVal, oldVal)
|
||||
// 先重新加载受影响区县数据
|
||||
clearProjectMarkers() // 清除项目标记
|
||||
|
||||
await clearProjectMarkers() // 清除项目标记
|
||||
await getAffectedCountyData()
|
||||
},
|
||||
{ deep: true },
|
||||
@ -1767,7 +1765,7 @@ watch(
|
||||
// 组件挂载时加载地图
|
||||
onMounted(() => {
|
||||
// 获取受影响对象数据
|
||||
getAffectedCountyData()
|
||||
// getAffectedCountyData()
|
||||
|
||||
// 检查 Leaflet 是否已加载
|
||||
if (typeof window.L === 'undefined') {
|
||||
|
||||
@ -172,32 +172,20 @@ export const formatDateTime = (date) => {
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||
}
|
||||
|
||||
// 记录用户操作日志(使用 fetch keepalive 确保页面切换后请求仍能完成)
|
||||
export const logUserOperation = (type, command) => {
|
||||
try {
|
||||
// 记录用户操作日志
|
||||
export const logUserOperation = async (type, command) => {
|
||||
const data = { type, command }
|
||||
|
||||
// 使用 fetch 的 keepalive 选项确保页面卸载后请求仍能完成
|
||||
fetch('/snow-ops-platform/weather-warning/users/logs', {
|
||||
const res = await request({
|
||||
url: '/snow-ops-platform/weather-warning/users/logs',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
keepalive: true, // 关键:确保页面切换后请求仍能完成
|
||||
data: data,
|
||||
})
|
||||
.then((response) => {
|
||||
console.log('日志请求完成:', response.status)
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('日志请求失败:', error)
|
||||
})
|
||||
|
||||
console.log('日志已触发发送:', data)
|
||||
return true
|
||||
} catch (error) {
|
||||
console.error('记录操作日志失败:', error)
|
||||
return false
|
||||
console.log('日志请求完成:', res)
|
||||
if (res.code === '00000') {
|
||||
ElMessage.success('操作日志记录成功')
|
||||
} else {
|
||||
ElMessage.error(res.message || '操作日志记录失败')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -583,15 +583,15 @@ const allCountyData = ref({})
|
||||
const handleDistrictClick = (item) => {
|
||||
console.log('区县点击:', item)
|
||||
allCountyData.value = item
|
||||
// if (item.data.roadType == 'national') {
|
||||
// // 国省道
|
||||
// openDialog('tongnanTeam')
|
||||
// } else if (item.data.roadType == 'rural') {
|
||||
// openDialog('responseSituation')
|
||||
// } else if (item.data.type == 'project' && item.data.roadType == '-') {
|
||||
// // 驻地
|
||||
// openDialog('tongnanResponsible')
|
||||
// }
|
||||
if (item.data.roadType == 'national') {
|
||||
// 国省道
|
||||
openDialog('tongnanTeam')
|
||||
} else if (item.data.roadType == 'rural') {
|
||||
openDialog('responseSituation')
|
||||
} else if (item.data.type == 'project' && item.data.roadType == '-') {
|
||||
// 驻地
|
||||
openDialog('tongnanResponsible')
|
||||
}
|
||||
}
|
||||
|
||||
// 处理中心卡片点击
|
||||
@ -604,6 +604,7 @@ const handleCenterCardClick = (item) => {
|
||||
title: getCardTitleByType(item.type),
|
||||
dataList: item.data,
|
||||
}
|
||||
if (item.type == 'second') return
|
||||
chongqingMapRef.value.openCenterCard(cardData)
|
||||
|
||||
// 如果数据中包含区县信息,定位到第一个区县
|
||||
@ -681,6 +682,16 @@ const mapBase = useMapBase(mapStore)
|
||||
* 组件挂载后初始化地图
|
||||
*/
|
||||
onMounted(() => {
|
||||
// 首先尝试从 URL 获取 token
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
const urlToken = urlParams.get('token')
|
||||
console.log('从 URL 获取的 token:', urlToken)
|
||||
if (urlToken) {
|
||||
// 更新本地存储
|
||||
localStorage.setItem('token', urlToken)
|
||||
sessionStorage.setItem('token', urlToken)
|
||||
console.log('从 URL 获取并更新 token 成功')
|
||||
}
|
||||
// 加载地图业务底图 并 聚焦中心点
|
||||
mapBase.loadBaseData()
|
||||
fetchRoadConditionOptions() // 获取路况类型选项
|
||||
|
||||
@ -148,24 +148,26 @@ const setRefreshLeftData = inject('setRefreshLeftData')
|
||||
// 注入日期范围
|
||||
const getdateRange = inject('getdateRange', ref([]))
|
||||
|
||||
const flag = ref(true)
|
||||
// 监听日期范围变化,当获取到数据时重新加载
|
||||
watch(
|
||||
() => getdateRange.value,
|
||||
(newVal) => {
|
||||
console.log('left.vue 日期范围变化:', newVal)
|
||||
dateRange.value = JSON.parse(JSON.stringify(newVal))
|
||||
dateRange.value = newVal
|
||||
// dispatchLoadLoad() // 加载调度清单
|
||||
// scheduleStatisticsByCountyLoad() // 加载调度统计
|
||||
init()
|
||||
},
|
||||
{ deep: true },
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
|
||||
// init()
|
||||
// 注册刷新函数给父组件
|
||||
if (setRefreshLeftData) {
|
||||
setRefreshLeftData(init)
|
||||
}
|
||||
// if (setRefreshLeftData) {
|
||||
// setRefreshLeftData(init)
|
||||
// }
|
||||
})
|
||||
const init = () => {
|
||||
roadTypeLoad() // 加载路段类型
|
||||
@ -338,6 +340,7 @@ watch(
|
||||
(newVal) => {
|
||||
console.log('left.vue 调度响应变化:', newVal)
|
||||
dispatchLoadLoad()
|
||||
scheduleStatisticsByCountyLoad() // 加载调度统计
|
||||
},
|
||||
{ deep: true },
|
||||
)
|
||||
@ -683,37 +686,37 @@ const districtData = ref([])
|
||||
const responseStats = ref([
|
||||
{
|
||||
label: '叫应总数',
|
||||
value: '15',
|
||||
value: '0',
|
||||
iconClass: 'icon-call',
|
||||
img: imgCall,
|
||||
},
|
||||
{
|
||||
label: '已回应数',
|
||||
value: '9',
|
||||
value: '0',
|
||||
iconClass: 'icon-reply',
|
||||
img: imgReply,
|
||||
},
|
||||
{
|
||||
label: '回应率',
|
||||
value: '100%',
|
||||
value: '0%',
|
||||
iconClass: 'icon-rate',
|
||||
img: imgRate,
|
||||
},
|
||||
{
|
||||
label: '调度区县数',
|
||||
value: '21',
|
||||
value: '0',
|
||||
iconClass: 'icon-district',
|
||||
img: imgDistrict,
|
||||
},
|
||||
{
|
||||
label: '线下帮扶数',
|
||||
value: '12',
|
||||
value: '0',
|
||||
iconClass: 'icon-help',
|
||||
img: imgHelp,
|
||||
},
|
||||
{
|
||||
label: '抽查人次',
|
||||
value: '23',
|
||||
value: '0',
|
||||
iconClass: 'icon-check',
|
||||
img: imgCheck,
|
||||
},
|
||||
|
||||
@ -745,18 +745,22 @@ const init = () => {
|
||||
|
||||
// 组件挂载时获取数据并注册刷新函数
|
||||
onMounted(() => {
|
||||
init()
|
||||
// init()
|
||||
// 注册刷新函数到父组件
|
||||
if (setRefreshRightData) {
|
||||
setRefreshRightData(init)
|
||||
}
|
||||
// if (setRefreshRightData) {
|
||||
// setRefreshRightData(init)
|
||||
// }
|
||||
})
|
||||
|
||||
const flag = ref(true)
|
||||
watch(
|
||||
() => getdateRange.value,
|
||||
(newVal) => {
|
||||
(newVal, oldVal) => {
|
||||
if (flag.value) {
|
||||
flag.value = false
|
||||
return
|
||||
}
|
||||
dateRange.value = JSON.parse(JSON.stringify(newVal))
|
||||
console.log('right.vue 日期范围变化:', newVal)
|
||||
dateRange.value = newVal
|
||||
init()
|
||||
},
|
||||
{ deep: true, immediate: true },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user