This commit is contained in:
2026-01-05 16:47:31 +08:00
parent 1c908284e6
commit 49597a4dd2
7 changed files with 100 additions and 14 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ export enum Api {
getWatchDataByOrgCodeNew = '/health-watch/watch/watchData/getWatchDataByOrgCode/v2', getWatchDataByOrgCodeNew = '/health-watch/watch/watchData/getWatchDataByOrgCode/v2',
getMonitorList = '/health-watch/watch/watchMonitorData/getMonitorList', getMonitorList = '/health-watch/watch/watchMonitorData/getMonitorList',
sleepApi = '/health-watch/watch/watchData/getSleep', sleepApi = '/health-watch/watch/watchData/getSleep/v2',
stepApi = '/health-watch/watch/watchData/getSdc', stepApi = '/health-watch/watch/watchData/getSdc',
stepNewApi = '/health-watch/watch/watchData/getSdc/v2', stepNewApi = '/health-watch/watch/watchData/getSdc/v2',
listCustom = 'health-watch/watch/watchMonitorData/listCustom', listCustom = 'health-watch/watch/watchMonitorData/listCustom',
@@ -17,9 +17,9 @@ export enum Api {
export const allSecondaryDeparts = () => get(Api.depart); export const allSecondaryDeparts = () => get(Api.depart);
//左側 //左側
export const getWatchDataByOrgCode = (params) => post(Api.getWatchDataByOrgCode, params); export const getWatchDataByOrgCode = (params: any) => post(Api.getWatchDataByOrgCode, params);
export const getWatchDataByOrgCodeNew = (params) => post(Api.getWatchDataByOrgCodeNew, params); export const getWatchDataByOrgCodeNew = (params: any) => post(Api.getWatchDataByOrgCodeNew, params);
//右-健康终端报警 //右-健康终端报警
export const getMonitorList = (params: any) => get(Api.getMonitorList, params); export const getMonitorList = (params: any) => get(Api.getMonitorList, params);
+28
View File
@@ -0,0 +1,28 @@
import { defineStore } from 'pinia';
import { getAuthCache, setAuthCache } from '/@/utils/auth.ts';
export const useMonitorStore = defineStore({
id: 'monitor',
state: () => ({
oneTips: '',
fourTips: '',
}),
getters: {
getOneTips(): any {
return this.oneTips || getAuthCache('oneTips');
},
getFourTips(): any {
return this.fourTips || getAuthCache('fourTips');
},
},
actions: {
setOneTips(info: any) {
this.oneTips = info;
setAuthCache('oneTips', info);
},
setFourTips(info: any) {
this.fourTips = info;
setAuthCache('fourTips', info);
},
},
});
+45 -4
View File
@@ -1,10 +1,9 @@
<template> <template>
<transition name="video-fade"> <transition name="video-fade">
<div v-if="isVisible" id="videoComponent"> <div class="video-component" v-if="isVisible" id="videoComponent">
<video <video
@click=" @click="
() => { () => {
console.log('aa');
videoRef!.muted = false; videoRef!.muted = false;
} }
" "
@@ -18,6 +17,22 @@
@ended="handleEnded" @ended="handleEnded"
@error="handleError" @error="handleError"
></video> ></video>
<div
v-if="!showImg"
class="go-home"
@click="
() => {
videoRef!.pause();
videoRef!.src = '';
videoRef!.load();
isVisible = false;
showImg = false;
}
"
>
</div>
<div class="go-to-home" v-else @click="() => (showImg = false)"> 点击进入 </div>
</div> </div>
</transition> </transition>
</template> </template>
@@ -36,10 +51,11 @@
const videoRef = ref<HTMLVideoElement | null>(null); const videoRef = ref<HTMLVideoElement | null>(null);
const isVisible = ref<boolean>(true); const isVisible = ref<boolean>(true);
const showImg = ref<boolean>(false);
// 视频结束处理 // 视频结束处理
const handleEnded = (): void => { const handleEnded = (): void => {
isVisible.value = false; showImg.value = true;
// 延迟发射完成事件,等待淡出动画结束(800ms) // 延迟发射完成事件,等待淡出动画结束(800ms)
setTimeout(() => { setTimeout(() => {
emit('complete'); emit('complete');
@@ -69,6 +85,7 @@
console.warn('再次自动播放尝试失败,直接关闭遮罩:', error); console.warn('再次自动播放尝试失败,直接关闭遮罩:', error);
// 如果依然无法播放,直接销毁遮罩 // 如果依然无法播放,直接销毁遮罩
isVisible.value = false; isVisible.value = false;
showImg.value = true;
}); });
}); });
} }
@@ -86,7 +103,7 @@
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
#videoComponent { .video-component {
position: fixed; position: fixed;
left: 0; left: 0;
right: 0; right: 0;
@@ -114,5 +131,29 @@
.video-fade-leave-to { .video-fade-leave-to {
opacity: 0; opacity: 0;
} }
.go-to-home {
position: absolute;
bottom: 100px;
left: 50%;
transform: translateX(-50%);
user-select: none;
color: #ffffff;
font-size: 30px;
padding: 15px 30px;
cursor: pointer;
}
.go-home {
position: absolute;
top: 50px;
right: 50px;
color: #000000;
font-size: 20px;
cursor: pointer;
background: rgba(255, 255, 255, 0.6);
padding: 10px 15px;
border-radius: 10px;
}
} }
</style> </style>
+1 -1
View File
@@ -522,7 +522,7 @@
const currentCityCode = ref(''); const currentCityCode = ref('');
function logMapinfo() { function logMapinfo() {
Map.map.getCity(function (info) { Map.map.getCity(function (info: any) {
const { citycode } = info; const { citycode } = info;
if (currentCityCode.value != citycode) { if (currentCityCode.value != citycode) {
Map.createActiveHospital(citycode); Map.createActiveHospital(citycode);
+8 -2
View File
@@ -29,7 +29,7 @@
<div class="item-title" style="width: 99%"> <div class="item-title" style="width: 99%">
<div class="title chart-title" style="display: flex; font-weight: normal !important"> <div class="title chart-title" style="display: flex; font-weight: normal !important">
<div> <img :src="imgList[chooseType]" alt="" />{{ tabList[chooseType].label }}</div> <div> <img :src="imgList[chooseType]" alt="" />{{ tabList[chooseType].label }}</div>
<div v-if="[0].includes(chooseType)"> {{ tabList[chooseType].tips }} </div> <div v-if="[0].includes(chooseType)"> {{ monitorStore.getOneTips }} </div>
<div v-if="[1].includes(chooseType)"> 参考范围: {{ tabList[chooseType].tips }} </div> <div v-if="[1].includes(chooseType)"> 参考范围: {{ tabList[chooseType].tips }} </div>
<div v-if="[2].includes(chooseType)" style="line-height: normal; font-size: 10px"> <div v-if="[2].includes(chooseType)" style="line-height: normal; font-size: 10px">
<div style="display: flex"> <div style="display: flex">
@@ -60,6 +60,8 @@
<div style="display: flex; align-items: center"> <div class="dot1" style="background: #3b72ad"></div> >38 </div> <div style="display: flex; align-items: center"> <div class="dot1" style="background: #3b72ad"></div> >38 </div>
</div> </div>
</div> </div>
<div v-if="[4].includes(chooseType)"> 总人数 {{ monitorStore.getFourTips }}</div>
</div> </div>
<div style="height: 210px; display: flex; align-items: center; justify-content: center; width: 100%; padding-left: 10px"> <div style="height: 210px; display: flex; align-items: center; justify-content: center; width: 100%; padding-left: 10px">
<div style="height: 100%" class="content-chart"> <div style="height: 100%" class="content-chart">
@@ -106,7 +108,9 @@
import item5Png from '/@/assets/images/threeLeftNew/item5.png'; import item5Png from '/@/assets/images/threeLeftNew/item5.png';
import item6Png from '/@/assets/images/threeLeftNew/item6.png'; import item6Png from '/@/assets/images/threeLeftNew/item6.png';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { useMonitorStore } from '/@/store/modules/monitor.ts';
const monitorStore = useMonitorStore();
const props = defineProps({ const props = defineProps({
bKey: { bKey: {
type: String, type: String,
@@ -137,12 +141,14 @@
{ {
label: '睡眠', label: '睡眠',
value: 4, value: 4,
tips: localStorage.getItem('sleepSum') || 0,
}, },
{ {
label: '步数', label: '步数',
value: 5, value: 5,
}, },
]); ]);
const chooseType = ref(0); const chooseType = ref(0);
const selectValue = ref<string>(''); const selectValue = ref<string>('');
const timer = ref<any>(null); const timer = ref<any>(null);
@@ -178,7 +184,7 @@
if (selectOptions.value.length === 1) { if (selectOptions.value.length === 1) {
getAllDepart(); getAllDepart();
} }
setTimer(); // setTimer();
}); });
// watch(props, () => { // watch(props, () => {
// selectValue.value = ''; // selectValue.value = '';
@@ -14,6 +14,7 @@
import { formatStr, sleepCharts } from '/@/components/secondaryScreen/screen-right/screenRightHooks'; import { formatStr, sleepCharts } from '/@/components/secondaryScreen/screen-right/screenRightHooks';
import { getSleep } from '/@/components/secondaryScreen/commonApi.ts'; import { getSleep } from '/@/components/secondaryScreen/commonApi.ts';
import { useSession, caching } from '/@/hooks/autoRefresh/caching.ts'; import { useSession, caching } from '/@/hooks/autoRefresh/caching.ts';
import { useMonitorStore } from '/@/store/modules/monitor.ts';
const { setSession, getSession } = useSession(); const { setSession, getSession } = useSession();
const { PAGE2_RIGHT1 } = caching; const { PAGE2_RIGHT1 } = caching;
@@ -40,6 +41,8 @@
avg: '', avg: '',
}); });
const monitorStore = useMonitorStore();
async function init() { async function init() {
try { try {
const params = { const params = {
@@ -47,13 +50,17 @@
type: props.type, type: props.type,
}; };
const { code, result } = await getSleep(params); const { code, result } = await getSleep(params);
if (code == 200 && result.length > 0) { if (code == 200) {
setSession(PAGE2_RIGHT1, JSON.stringify(result)); if (result?.sleepInfo && result?.sleepInfo.length > 0) {
setValue(result); setSession(PAGE2_RIGHT1, JSON.stringify(result));
setValue(result?.sleepInfo || []);
}
monitorStore.setFourTips(result?.peopleSum || 0);
} }
} catch { } catch {
const result = JSON.parse(getSession(PAGE2_RIGHT1) || '{}'); const result = JSON.parse(getSession(PAGE2_RIGHT1) || '{}');
setValue(result); setValue(result?.sleepInfo || []);
monitorStore.setFourTips(result?.peopleSum || 0);
} }
} }
@@ -18,8 +18,10 @@
import { getWatchDataByOrgCodeNew } from '/@/components/secondaryScreen/commonApi.ts'; import { getWatchDataByOrgCodeNew } from '/@/components/secondaryScreen/commonApi.ts';
import { useSpin } from '/@/components/body-d-left/bodyLeftHooks.ts'; import { useSpin } from '/@/components/body-d-left/bodyLeftHooks.ts';
import ItemD from '/src/views/indexSun/threeLeftNewItem/item-d.vue'; import ItemD from '/src/views/indexSun/threeLeftNewItem/item-d.vue';
import { useMonitorStore } from '/@/store/modules/monitor.ts';
const { spinning, setSpin } = useSpin(); const { spinning, setSpin } = useSpin();
const monitorStore = useMonitorStore();
const dataList = ref([ const dataList = ref([
{ {
title: '心率', title: '心率',
@@ -133,6 +135,7 @@
async function initByLocal() { async function initByLocal() {
if (localStorage.getItem('monitorDataOne')) { if (localStorage.getItem('monitorDataOne')) {
dataList.value = JSON.parse(localStorage.getItem('monitorDataOne') || '{}'); dataList.value = JSON.parse(localStorage.getItem('monitorDataOne') || '{}');
monitorStore.setOneTips(dataList.value ? dataList.value[0]?.tips : '');
} else { } else {
await init(); await init();
} }
@@ -168,6 +171,7 @@
if (item.type === '1') { if (item.type === '1') {
item.tips = item.tips =
resData?.minData === null || resData?.maxData === null ? '' : `最小值-最大值:${resData?.minData}~${resData?.maxData}次/分钟`; resData?.minData === null || resData?.maxData === null ? '' : `最小值-最大值:${resData?.minData}~${resData?.maxData}次/分钟`;
monitorStore.setOneTips(item.tips);
} }
item.data = item.data.map((val: any) => { item.data = item.data.map((val: any) => {
val.value = resData[val.key]; val.value = resData[val.key];