1.修改部分问题(路线等问题)
2.添加定时器
This commit is contained in:
2025-07-08 17:32:13 +08:00
parent 67a2ea75d1
commit 726bd19ad3
11 changed files with 321 additions and 79 deletions
+55 -16
View File
@@ -20,8 +20,11 @@
</a-form-item>
</a-form>
</div>
<div v-show="showHospitalList || showRestB" class="reset-map" :class="[themeType]" @click="resetMap">
<RedoOutlined title="重置地图" />
</div>
<div v-show="showRoutePanel" v-click-outside="outClick" class="line-container">
<div v-show="routeList.length" class="has-data">
<div v-show="routeList.length > 0" class="has-data">
<div class="line-title"> {{ panelTitle }}</div>
<div class="line-content">
<div class="start">起点</div>
@@ -34,7 +37,7 @@
<div class="end">终点</div>
</div>
</div>
<div v-show="!routeList.length" class="empty-data"> 暂无数据</div>
<div v-show="routeList.length === 0" class="empty-data"> 暂无数据</div>
</div>
<div class="map">
<div style="flex: 1; overflow: hidden">
@@ -61,7 +64,7 @@
</div>
<div class="hospital-list" :class="[themeType]" v-if="showHospitalList">
<div class="hospital-item" v-for="(item, index) in hospitalList" :key="index" @click="showDrivingLine(item)">
<div class="hospital-item" v-for="(item, index) in hospitalList" :key="index" @click.stop="showDrivingLine(item)">
<div>{{ item.name }}</div>
<div>相距{{ item.distance }}</div>
<div>驾车大约{{ item.driveTime }}</div>
@@ -70,7 +73,7 @@
</div>
</template>
<script setup lang="ts">
import { nextTick, onMounted, ref } from 'vue';
import { nextTick, onMounted, ref, watch } from 'vue';
import { infoContent, legendList, tabList } from '/@/views/indexSun/indexSun.ts';
import { message } from 'ant-design-vue';
import { innerLineLight, outerLineOption } from '/@/assets/mapUtils/mapConstant.ts';
@@ -80,6 +83,8 @@
import $bus from '/@/utils/bus.ts';
import { earlyWarning } from '/@/utils/busConstant.ts';
import { useTheme } from '/@/hooks/theme/useTheme.ts';
import { RedoOutlined } from '@ant-design/icons-vue';
const { themeType } = useTheme();
const list = ref(tabList);
const currentIndex = ref(0);
@@ -99,9 +104,11 @@
//是否展示最近的三个医院
showHospitalList: {
type: Boolean,
default: () => {
return false;
},
default: () => false,
},
showRestB: {
type: Boolean,
default: () => false,
},
hospitalList: {
type: Array,
@@ -114,10 +121,18 @@
const showRoutePanel = ref(false);
const panelTitle = ref();
const level = ref(0);
const drivingTitle = ref('');
const routeList = ref([]);
const emits = defineEmits(['clearHospitalList']);
const showDrivingPanel = ref(false);
const emits = defineEmits(['clearHospitalList', 'showRestB']);
watch(
() => props.showHospitalList,
(v) => {
if (v) {
watchInfoChangeTab(list.value[0], 0);
}
}
);
onMounted(() => {
const op = {
el: 'xianmapContainer',
@@ -130,7 +145,6 @@
Map.map && Map.map.on('zoomend', setLevel);
});
$bus.on(earlyWarning, (params) => {
console.log(params, 12323);
drawMarker(params);
});
document.addEventListener('click', (e) => {
@@ -148,7 +162,6 @@
nextTick(() => {
panelTitle.value = '全程' + item.driveTime + item.distance;
routeList.value = item.routeList?.map((item) => item?.instruction);
showDrivingPanel.value = true;
if (item.lon) {
Map.clearNaviLine();
Map.createNaviLine(item.userLocation, [item.lon, item.lat]);
@@ -168,10 +181,14 @@
searchFlag.value = false;
}
function changeTab(item, i: number) {
currentIndex.value = i;
Map.clearActiveHospital();
function changeTab(item: any, i: number) {
closeDrivingElement();
currentIndex.value = i;
tab(item);
}
function tab(item: any) {
Map.clearActiveHospital();
Map.map.off('moveend', logMapinfo);
if (TabType.diFangYiYuan == item.type) {
let { lng, lat } = Map.getMapCenter();
@@ -190,6 +207,11 @@
}
}
function watchInfoChangeTab(item: any) {
currentIndex.value = 0;
tab(item);
}
function searchRoute(callback: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null) {
showRoutePanel.value = false;
panelTitle.value = '';
@@ -280,7 +302,7 @@
Map.clearNavigationElements();
formState.value.start = '';
formState.value.end = '';
showDrivingPanel.value = false;
showRoutePanel.value = false;
emits('clearHospitalList');
}
@@ -320,6 +342,12 @@
}
Map.createMarker({ ...data, realName: data.userName });
}
function resetMap() {
closeDrivingElement();
changeTab(list.value[currentIndex.value], currentIndex.value);
emits('showRestB');
}
</script>
<style lang="less" scoped>
@@ -559,6 +587,7 @@
}
.line-container {
z-index: 99;
position: absolute;
right: 0;
top: 54px;
@@ -641,4 +670,14 @@
}
}
}
.reset-map {
position: absolute;
left: 0;
top: 50px;
z-index: 99;
font-size: 20px;
cursor: pointer;
padding: 0px 6px;
}
</style>
+6 -1
View File
@@ -36,7 +36,8 @@
</div>
</div>
</div>
</template>6+
</template>
6+
<script setup lang="ts">
import { ref, watch } from 'vue';
import { useStatistics } from '/@/components/body-d-left/bodyLeftHooks.ts';
@@ -50,6 +51,10 @@
type: String,
default: () => '',
},
bKey: {
type: Number,
default: () => 0,
},
});
const useDetail = useDetailStore();
+108 -8
View File
@@ -7,14 +7,14 @@
<div class="content">
<div class="content-item">
<template v-if="scrollList.length > 0">
<vue3-seamless-scroll :list="scrollList" class="scroll" :hover="true" :copyNum="3" :limitScrollNum="5" v-bind="{ step: 0.2 }">
<vue3-seamless-scroll :list="scrollList" class="scroll" :hover="true" :copyNum="3" :limitScrollNum="5" v-bind="{ step: step }">
<div class="item-d" v-for="(item, index) in scrollList" :key="index">
<div>{{ item.realName }}</div>
<div style="color: #f6ff00">{{ item.eventType_dictText }}{{ item.dataValue ? `(${item.dataValue})` : '' }}</div>
<div>{{ item.warnTime }}</div>
<div class="item-d-img">
<img :src="pointPng" alt="" />
<img :src="addressPng" alt="" />
<img :src="pointPng" alt="" @click="handlePolice(item)" />
<img :src="addressPng" alt="" @click="sendPosition(item)" />
</div>
</div>
</vue3-seamless-scroll>
@@ -26,22 +26,78 @@
</template>
</div>
</div>
<Dialog :openVis="openInfor" width="30%" title="健康报警员工信息" @close="handlePoliceClose">
<template #container>
<div class="police-con" :class="[themeType]">
<Row style="font-size: 14px; font-weight: bold"> 个人信息 </Row>
<Row>
<Col :span="8">姓名{{ userInfo?.realName || '--' }}</Col>
<Col :span="8">性别{{ userInfo?.sex_dictText || '--' }}</Col>
<Col :span="8">年龄{{ userInfo?.age || '--' }}</Col>
</Row>
<Row>
<Col :span="8">二级单位{{ userInfo?.orgName2 || '--' }}</Col>
<Col :span="8">部门{{ userInfo?.orgName || '--' }}</Col>
<Col :span="8">手机号码{{ userInfo?.phone || '--' }}</Col>
</Row>
<Row style="font-size: 14px; font-weight: bold"> 健康信息 </Row>
<Row> 异常事件{{ userInfo?.eventType_dictText || '--' }} </Row>
<Row>
<Col :span="8">异常值{{ userInfo?.dataValue || '--' }}</Col>
<Col :span="16">发生时间{{ userInfo?.warnTime || '--' }}</Col>
</Row>
<div style="display: flex">
<div>发生地点</div>
<div style="padding-left: 10px; display: flex; overflow-wrap: anywhere" :style="{ color: userInfo?.address || 'red' }">
{{ userInfo?.address || userInfo?.gpsErrorMsg || '--' }}
</div>
</div>
</div>
</template>
</Dialog>
</div>
</template>
<script setup lang="ts">
import { Vue3SeamlessScroll } from 'vue3-seamless-scroll';
import { Empty } from 'ant-design-vue';
import { ref, onMounted } from 'vue';
import { Empty, message } from 'ant-design-vue';
import { ref, onMounted, watch } from 'vue';
import pointPng from '/@/assets/indexSun/point.png';
import addressPng from '/@/assets/indexSun/address.png';
import { oneRApi } from '/@/views/indexSun/indexSun.api.ts';
const loading = ref(true);
const scrollList = ref<any[]>([]);
import { Row, Col } from 'ant-design-vue';
import Dialog from '/@/components/dialog/Dialog.vue';
import { useTheme } from '/@/hooks/theme/useTheme.ts';
import { Map } from '/@/assets/mapUtils/map.ts';
const emit = defineEmits(['handleView']);
const { themeType } = useTheme();
const step = ref(0.2);
const scrollList = ref<any[]>([]);
const openInfor = ref<boolean>(false); //弹窗显示
const userInfo = ref({
realName: '',
orgName1: '',
phone: '',
eventType_dictText: '',
warnTime: '',
address: '',
dataValue: '',
});
const props = defineProps({
bKey: {
type: Number,
default: () => 0,
},
});
const emit = defineEmits(['handleView', 'showReset']);
onMounted(() => {
getList();
});
watch(props, () => {
getList();
});
function getList() {
oneRApi({}).then((res) => {
if (res.code == 200) {
@@ -49,6 +105,26 @@
}
});
}
function handlePolice(item) {
userInfo.value = item;
openInfor.value = true;
step.value = 0;
}
function handlePoliceClose() {
openInfor.value = false;
step.value = 0.2;
}
function sendPosition(item) {
let { lon, lat } = item;
if (lon && lat) {
Map.createMarker(item, () => {
handlePolice(item);
});
emit('showReset');
} else {
message.warn('暂无经纬度信息!');
}
}
function handleView() {
emit('handleView');
}
@@ -104,4 +180,28 @@
}
}
}
.police-con {
padding: 2% 5% 2% 5%;
display: grid;
color: #ffffff;
.con-item {
padding: 1.3% 0;
display: flex;
div:nth-child(1) {
font-weight: bold;
width: 100px;
text-align: right;
}
div:nth-child(2) {
width: calc(100% - 100px);
}
}
}
.ant-row {
margin-bottom: 10px;
}
</style>
+22 -7
View File
@@ -31,20 +31,35 @@
<script setup lang="ts">
import { Vue3SeamlessScroll } from 'vue3-seamless-scroll';
import { Empty } from 'ant-design-vue';
import { onMounted, ref } from 'vue';
import { onMounted, ref, watch } from 'vue';
import hospitalPng from '/@/assets/indexSun/hospital.png';
import { threeLApi } from '/@/views/indexSun/indexSun.api.ts';
const scrollList = ref<any[]>([]);
const props = defineProps({
bKey: {
type: Number,
default: () => 0,
},
});
onMounted(() => {
getList();
});
watch(props, () => {
getList();
});
function getList() {
threeLApi({}).then((res) => {
if (res.code == 200) {
console.log(res.result);
scrollList.value = res.result;
}
});
threeLApi({})
.then((res: any) => {
if (res.code == 200) {
console.log(res.result);
scrollList.value = res.result;
}
})
.catch((err) => {
console.log(err);
});
}
</script>
<style lang="less" scoped>
+28 -9
View File
@@ -42,20 +42,39 @@
</div>
</template>
<script setup lang="ts">
import { Vue3SeamlessScroll } from 'vue3-seamless-scroll';
import { Empty } from 'ant-design-vue';
import { ref, onMounted } from 'vue';
import { ref, onMounted, watch } from 'vue';
import { threeRApi } from '/@/views/indexSun/indexSun.api.ts';
const scrollList = ref();
const emit = defineEmits(['handleClick']);
onMounted(() => {
threeRApi({}).then((res) => {
if (res.code == 200) {
scrollList.value = res.result[0];
}
});
const props = defineProps({
bKey: {
type: Number,
default: () => 0,
},
});
function handleClickNum(type) {
watch(props, () => {
getList();
});
onMounted(() => {
getList();
});
function getList() {
threeRApi({})
.then((res: any) => {
if (res.code == 200) {
scrollList.value = res.result[0];
}
})
.catch((err: any) => {
console.log(err);
});
}
function handleClickNum(type: any) {
emit('handleClick', type);
}
</script>
+15 -5
View File
@@ -7,7 +7,7 @@
<div class="content">
<div class="content-search">
<div>
<a-select v-model:value="selectValue" class="type-select" :options="selectOptions">
<a-select v-model:value="selectValue" class="type-select" :options="selectOptions" @change="getData">
<a-select-option value="全部数据">全部数据</a-select-option>
</a-select>
</div>
@@ -39,14 +39,20 @@
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { ref, onMounted, watch } from 'vue';
import * as echarts from 'echarts';
import { getClassCharts } from '/@/views/indexSun/indexSun.ts';
import { allSecondaryDepartsApi, twoLApi } from '/@/views/indexSun/indexSun.api.ts';
const props = defineProps({
bKey: {
type: Number,
default: () => 0,
},
});
const chooseType = ref('0');
const selectValue = ref('all');
const selectOptions = ref([{ label: '全部数据', value: 'all' }]);
const selectValue = ref('');
const selectOptions = ref([{ label: '全部数据', value: '' }]);
const newChart = ref<HTMLElement>();
function clickChooseType(type) {
if (chooseType.value === type) return;
@@ -59,6 +65,10 @@
getAllDepart();
}
});
watch(props, () => {
selectValue.value = '';
getData();
});
function getAllDepart() {
allSecondaryDepartsApi({})
@@ -85,7 +95,7 @@
function getData() {
twoLApi({
sex: chooseType.value,
depart: '',
depart: selectValue.value,
}).then((res) => {
console.log(res, 'resessss');
if (res.code == 200) {
+13 -1
View File
@@ -126,14 +126,26 @@
import WeightPng from '/@/assets/indexSun/weightClock.png';
import FatPng from '/@/assets/indexSun/fatClock.png';
import BloodPng from '/@/assets/indexSun/bloodClock.png';
import { onMounted, ref } from 'vue';
import { onMounted, ref, watch } from 'vue';
import { twoRApi } from '/@/views/indexSun/indexSun.api.ts';
const twoRList = ref();
const emit = defineEmits(['handleClick']);
const props = defineProps({
bKey: {
type: Number,
default: () => 0,
},
});
onMounted(() => {
getList();
});
watch(props, () => {
getList();
});
function getList() {
twoRApi({}).then((res) => {
if (res.code == 200) {