1.修改大屏问题及添加新需求
This commit is contained in:
2025-09-26 18:57:17 +08:00
parent f024615260
commit 7154314e93
21 changed files with 766 additions and 271 deletions
+192 -72
View File
@@ -7,6 +7,7 @@
</div>
<div class="sun-title-center">{{ getCenterInfo.screenTitle || '健康服务中心' }}</div>
<div class="sun-title-right">
<a-button class="top-right-button" @click="toZ">咨询服务平台</a-button>
<a-button class="top-right-button" @click="toOther">健康监测大屏</a-button>
</div>
</div>
@@ -34,6 +35,7 @@
:hospitalList="hospitalList"
@clear-hospital-list="clearHospitalList"
:show-rest-b="showRestB"
:user-data="userData"
@handle-detail="handleCenterMapClick"
:show-map-bottom="showMapBottom"
@show-rest-b="
@@ -47,7 +49,7 @@
</div>
<div class="sun-body-right">
<div class="sun-body-right-one">
<one-right-new :user-data="userData" @handle-view="handleOneRightView" @handle-archives="handleArchives" />
<one-right-new :user-data="userData" @handle-view="handleOneRightView" @handle-emer="handleEmer" />
</div>
<div class="sun-body-right-two">
<oneR
@@ -68,7 +70,7 @@
</div>
<PhoneDialog ref="phoneDialogRef" :title="phoneDialogTitle" :useForm="true" :setting="setting" :phoneType="phoneType" />
<!-- 健康监测弹窗 -->
<EmployeeDialog ref="employeeDialogRef" :record="socketData" />
<EmployeeDialog ref="employeeDialogRef" :record="socketData" @confirm-help="confirmHelp" />
<!-- 应急、120弹窗 -->
<EmergencyDialog ref="emergencyDialogRef" :record="socketData1" @confirm-help="confirmHelp" />
<IndexModal
@@ -83,13 +85,22 @@
:twoROnly="twoROnly"
>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'd'">
<template v-if="record?.latitude && record?.longitude">
<environment-outlined style="height: auto !important; color: #178ef2 !important" @click="forHelp(record)" />
</template>
<template v-else>
<span style="color: red">未获取到位置信息</span>
</template>
</template>
<template v-if="column.dataIndex === 'cz'">
<a-button type="link" @click="forHelp(record)">助信息</a-button>
<a-button type="link" @click="forHelp(record)">助信息</a-button>
</template>
</template>
</IndexModal>
</template>
<script setup lang="ts">
import { EnvironmentOutlined } from '@ant-design/icons-vue';
import OneL from '/@/views/indexSun/oneL.vue';
import twoL from '/@/views/indexSun/twoL.vue';
import oneR from '/@/views/indexSun/oneR.vue';
@@ -99,8 +110,10 @@
centerMapColumns,
centerMapFromList,
columns,
contactListColumns,
fromLists,
infoContentSpecial,
monitorColumns,
oneRNewColumns,
threeRModalColumns,
threeRModalFromList,
@@ -125,9 +138,11 @@
const { getCenterInfo, setCount } = useUserStore();
import {
healthArchivesApi,
careUserApi,
contactListApi,
nearResourcesApi,
oneLApi,
oneRApi,
roomDetailApi,
threeRModalApi,
todayEmergencyListApi,
@@ -201,6 +216,8 @@
indexModalRef.value.closeDialog();
record['lat'] = record?.latitude;
record['lon'] = record?.longitude;
Map.driving && Map.driving.clear();
Map.walking && Map.walking.clear();
if (record['lat']) {
let list: any = [];
const res: any = await nearResourcesApi({ longitude: record?.lon, latitude: record?.lat });
@@ -217,12 +234,19 @@
showRestB.value = false;
userData.value = record;
}
confirmHelp(record);
await confirmHelp(record);
}
function toOther() {
window.open('http://aygc.jy.pc.iosp.ydpt.tech/envShow/envFullscreen', '_blank');
}
function toZ() {
return;
const routeUrl = router.resolve({
path: '/home2',
}).href;
window.open(routeUrl, '_blank');
}
function handleOneLeftClick(item: any) {
const { name, key } = item;
@@ -259,8 +283,17 @@
}
function handleOneRClick() {
router.push({
path: '/indexSon',
// router.push({
// path: '/indexSon',
// });
indexModalTitle.value = '健康终端报警';
indexColumn.value = monitorColumns;
firstFormOne.value = [];
twoROnly.value = '';
modalApi.value = oneRApi;
needDept.value = true;
nextTick(() => {
indexModalRef.value.openDialog();
});
}
@@ -269,7 +302,7 @@
const { socketData, setSocketData, closeSocket } = useSocket(socketUrl);
const employeeDialogRef = ref();
function employeeDialogOpen() {
function openEmergencyOpen() {
setSocketData1({
userId: '1942871719583739905',
phone: '15129287781',
@@ -294,6 +327,60 @@
});
emergencyDialogRef.value.openDialog();
}
function employeeDialogOpen() {
setSocketData({
watchNo: 'A5GTQ24920002519',
eventType: 'a_key_alarm',
eventType_dictText: '一键告警',
bindUserId: '1942871719583739905',
bindDate: '2025-07-23',
createBy: 'apiusername',
createDate: '2025-09-25 15:01:11',
dataValue: '',
address: null,
lon: 0,
lat: 0,
dataDate: '2025-09-25',
warnTime: '2025-09-25 15:00:03',
gpsErrorMsg: '定位超时',
lonGd: null,
latGd: null,
addressGd: null,
sendFlag: '0',
largeScreenFlag: '0',
orgCode: 'A01A01A02',
orgName: '硬件部',
realName: '连龙刚',
phone: '15129287781',
hospitalList: [
{
name: '跃满油田作业区',
lon: 82.9955,
lat: 40.787056,
},
{
name: '跃满油田作业区',
lon: 82.9955,
lat: 40.787056,
},
{
name: '采油一厂稠油小屋',
lon: 84.881775,
lat: 44.987652,
},
],
centerId: '1940693902422519809',
popType: 3,
keyUser: '0',
avatar: null,
sex: 2,
age: 37,
workNo: '2025001',
deptName: '软硬件开发部',
audioUrl: null,
});
employeeDialogRef.value.openDialog();
}
setTimeout(() => {
// employeeDialogOpen();
@@ -327,73 +414,101 @@
const showHospitalList = ref(false);
async function confirmHelp(data: any) {
if (!data.lon) return (showMapBottom.value = true);
Map.driveLine && Map.driveLine.clear();
const res = await careUserApi({ userId: data?.userId });
data['careLiaisonName'] = res?.result?.careLiaisonName;
data['careLiaisonPhone'] = res?.result?.careLiaisonPhone;
data['lifeguardName'] = res?.result?.lifeguardName;
data['lifeguardPhone'] = res?.result?.lifeguardPhone;
userData.value = data;
if (!data.lon || !data.lat) {
centerMapRef.value.newResetMap();
showMapBottom.value = true;
return;
}
Map.removeOverlayGroup();
hospitalList.value = data.hospitalList;
// showHospitalList.value = true;
//用户的坐标信息
let point = [data.lon, data.lat];
// if (data.hospitalList && data.hospitalList.length > 0) {
// try {
const a = ((await getHospitalList(data.hospitalList, point)) as any) || [];
hospitalList.value = a.sort((a: any, b: any) => a.distance - b.distance);
// showHospitalList.value = true;
// } catch (error) {
// console.log('获取医院列表时出错:', error);
// }
// } else {
// console.log('没有医院list');
// }
// showMapBottom.value = true;
const arr = await Map.createOverlay1(
[...hospitalList.value, { latitude: data.lat, longitude: data.lon }],
{
content: (val) => {
return `<div style="
try {
hospitalList.value = data.hospitalList;
// showHospitalList.value = true;
//用户的坐标信息
let point = [data.lon, data.lat];
centerMapRef.value.setStartPosition(data);
// if (data.hospitalList && data.hospitalList.length > 0) {
// try {
const a = ((await getHospitalList(data.hospitalList, point)) as any) || [];
hospitalList.value = a.sort((a: any, b: any) => a.distance - b.distance);
// showHospitalList.value = true;
// } catch (error) {
// console.log('获取医院列表时出错:', error);
// }
// } else {
// console.log('没有医院list');
// }
// showMapBottom.value = true;
const arr = await Map.createOverlay1(
[...hospitalList.value, { latitude: data.lat, longitude: data.lon }],
{
content: (val: any) => {
return `<div style="
width: 21px;
height: 44px;
position: absolute;
left: -20px;
top: -20px;" title="${val?.name}">
</div>`;
},
},
},
async (val) => {
if (val.type == '3') {
Map.createInfoModal({ option: val, content: infoContentSpecial(val) });
} else if (val.type == '4') {
Map.createInfoModal({ option: val, content: infoContentSpecial(val) });
} else {
Map.createInfoModal({ option: val, content: infoContentSpecial(val) });
}
Map.clearNaviLine();
Map.createNaviLine([val.lon, val.lat], [data.lon, data.lat]);
// const viewBtn = document.getElementById(val.id);
// viewBtn.onclick = () => {
// handleClcikDetail(val);
// };
('');
},
true,
'1'
);
async (val) => {
if (val.type == '3') {
Map.createInfoModal({ option: val, content: infoContentSpecial(val) }, false);
} else if (val.type == '4') {
Map.createInfoModal({ option: val, content: infoContentSpecial(val) }, false);
} else {
Map.createInfoModal({ option: val, content: infoContentSpecial(val) }, false);
}
const end = await Map.getAddressByPoint([val.lon, val.lat]);
console.log(res);
if (!data?.address) {
data['address'] = await Map.getAddressByPoint([data.lon, data.lat]);
}
// Map.clearNaviLine();
// Map.createNaviLine([data.lon, data.lat], [val.lon, val.lat]);
centerMapRef.value.getSearch({
startPosition: [data.lon, data.lat],
endPosition: [val.lon, val.lat],
start: data['address'],
end,
});
// const viewBtn = document.getElementById(val.id);
// viewBtn.onclick = () => {
// handleClcikDetail(val);
// };
('');
},
true,
'1'
);
Map.getAddressByPoint(point)
.then((res) => {
const option = {
lon: data.lon,
lat: data.lat,
position: point,
name: data.realName,
address: res,
sex: data.sex,
};
Map.createEmergencyMarker(option);
Map.map.setFitView([...arr, Map.emergencyMarker], false, [180, 180, 180, 180]);
})
.catch((err) => {});
userData.value = data;
Map.getAddressByPoint(point)
.then((res) => {
const option = {
lon: data.lon,
lat: data.lat,
position: point,
name: data.realName,
address: res,
sex: data.sex,
};
Map.createEmergencyMarker(option);
Map.map.setFitView([...arr, Map.emergencyMarker], false, [180, 180, 180, 180]);
})
.catch((err: any) => {
console.log(err);
});
} catch (e: any) {
console.log(e);
}
}
async function getHospitalList(hospitalList, userLocation) {
@@ -553,7 +668,7 @@
const params = {
centerId: centerId.value,
startDate: '2000-01-01',
endDate: '2025-09-25',
endDate: '2030-12-31',
};
indexModalTitle.value = '今日应急';
modalApi.value = todayEmergencyListApi;
@@ -562,14 +677,14 @@
indexModalRef.value.openDialog();
});
}
function handleArchives(userId: string) {
indexColumn.value = oneRNewColumns;
function handleEmer(userId: string) {
indexColumn.value = contactListColumns;
firstFormOne.value = [];
const params = {
userId: userId,
userId,
};
indexModalTitle.value = '今日应急';
modalApi.value = healthArchivesApi;
indexModalTitle.value = '紧急联系人';
modalApi.value = contactListApi;
apiParams.value = params;
nextTick(() => {
indexModalRef.value.openDialog();
@@ -617,6 +732,11 @@
text-align: right;
line-height: 50px;
padding-right: 30px;
> button {
&:nth-child(1) {
margin-right: 10px;
}
}
}
.sun-title-center {