update
This commit is contained in:
@@ -6,7 +6,7 @@ export enum Api {
|
||||
|
||||
getWatchDataByOrgCodeNew = '/health-watch/watch/watchData/getWatchDataByOrgCode/v2',
|
||||
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',
|
||||
stepNewApi = '/health-watch/watch/watchData/getSdc/v2',
|
||||
listCustom = 'health-watch/watch/watchMonitorData/listCustom',
|
||||
@@ -17,9 +17,9 @@ export enum Api {
|
||||
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);
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -1,10 +1,9 @@
|
||||
<template>
|
||||
<transition name="video-fade">
|
||||
<div v-if="isVisible" id="videoComponent">
|
||||
<div class="video-component" v-if="isVisible" id="videoComponent">
|
||||
<video
|
||||
@click="
|
||||
() => {
|
||||
console.log('aa');
|
||||
videoRef!.muted = false;
|
||||
}
|
||||
"
|
||||
@@ -18,6 +17,22 @@
|
||||
@ended="handleEnded"
|
||||
@error="handleError"
|
||||
></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>
|
||||
</transition>
|
||||
</template>
|
||||
@@ -36,10 +51,11 @@
|
||||
|
||||
const videoRef = ref<HTMLVideoElement | null>(null);
|
||||
const isVisible = ref<boolean>(true);
|
||||
const showImg = ref<boolean>(false);
|
||||
|
||||
// 视频结束处理
|
||||
const handleEnded = (): void => {
|
||||
isVisible.value = false;
|
||||
showImg.value = true;
|
||||
// 延迟发射完成事件,等待淡出动画结束(800ms)
|
||||
setTimeout(() => {
|
||||
emit('complete');
|
||||
@@ -69,6 +85,7 @@
|
||||
console.warn('再次自动播放尝试失败,直接关闭遮罩:', error);
|
||||
// 如果依然无法播放,直接销毁遮罩
|
||||
isVisible.value = false;
|
||||
showImg.value = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -86,7 +103,7 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
#videoComponent {
|
||||
.video-component {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
@@ -114,5 +131,29 @@
|
||||
.video-fade-leave-to {
|
||||
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>
|
||||
|
||||
@@ -522,7 +522,7 @@
|
||||
const currentCityCode = ref('');
|
||||
|
||||
function logMapinfo() {
|
||||
Map.map.getCity(function (info) {
|
||||
Map.map.getCity(function (info: any) {
|
||||
const { citycode } = info;
|
||||
if (currentCityCode.value != citycode) {
|
||||
Map.createActiveHospital(citycode);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="item-title" style="width: 99%">
|
||||
<div class="title chart-title" style="display: flex; font-weight: normal !important">
|
||||
<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="[2].includes(chooseType)" style="line-height: normal; font-size: 10px">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div v-if="[4].includes(chooseType)"> 总人数: {{ monitorStore.getFourTips }}</div>
|
||||
</div>
|
||||
<div style="height: 210px; display: flex; align-items: center; justify-content: center; width: 100%; padding-left: 10px">
|
||||
<div style="height: 100%" class="content-chart">
|
||||
@@ -106,7 +108,9 @@
|
||||
import item5Png from '/@/assets/images/threeLeftNew/item5.png';
|
||||
import item6Png from '/@/assets/images/threeLeftNew/item6.png';
|
||||
import dayjs from 'dayjs';
|
||||
import { useMonitorStore } from '/@/store/modules/monitor.ts';
|
||||
|
||||
const monitorStore = useMonitorStore();
|
||||
const props = defineProps({
|
||||
bKey: {
|
||||
type: String,
|
||||
@@ -137,12 +141,14 @@
|
||||
{
|
||||
label: '睡眠',
|
||||
value: 4,
|
||||
tips: localStorage.getItem('sleepSum') || 0,
|
||||
},
|
||||
{
|
||||
label: '步数',
|
||||
value: 5,
|
||||
},
|
||||
]);
|
||||
|
||||
const chooseType = ref(0);
|
||||
const selectValue = ref<string>('');
|
||||
const timer = ref<any>(null);
|
||||
@@ -178,7 +184,7 @@
|
||||
if (selectOptions.value.length === 1) {
|
||||
getAllDepart();
|
||||
}
|
||||
setTimer();
|
||||
// setTimer();
|
||||
});
|
||||
// watch(props, () => {
|
||||
// selectValue.value = '';
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
import { formatStr, sleepCharts } from '/@/components/secondaryScreen/screen-right/screenRightHooks';
|
||||
import { getSleep } from '/@/components/secondaryScreen/commonApi.ts';
|
||||
import { useSession, caching } from '/@/hooks/autoRefresh/caching.ts';
|
||||
import { useMonitorStore } from '/@/store/modules/monitor.ts';
|
||||
|
||||
const { setSession, getSession } = useSession();
|
||||
const { PAGE2_RIGHT1 } = caching;
|
||||
@@ -40,6 +41,8 @@
|
||||
avg: '',
|
||||
});
|
||||
|
||||
const monitorStore = useMonitorStore();
|
||||
|
||||
async function init() {
|
||||
try {
|
||||
const params = {
|
||||
@@ -47,13 +50,17 @@
|
||||
type: props.type,
|
||||
};
|
||||
const { code, result } = await getSleep(params);
|
||||
if (code == 200 && result.length > 0) {
|
||||
setSession(PAGE2_RIGHT1, JSON.stringify(result));
|
||||
setValue(result);
|
||||
if (code == 200) {
|
||||
if (result?.sleepInfo && result?.sleepInfo.length > 0) {
|
||||
setSession(PAGE2_RIGHT1, JSON.stringify(result));
|
||||
setValue(result?.sleepInfo || []);
|
||||
}
|
||||
monitorStore.setFourTips(result?.peopleSum || 0);
|
||||
}
|
||||
} catch {
|
||||
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 { useSpin } from '/@/components/body-d-left/bodyLeftHooks.ts';
|
||||
import ItemD from '/src/views/indexSun/threeLeftNewItem/item-d.vue';
|
||||
import { useMonitorStore } from '/@/store/modules/monitor.ts';
|
||||
|
||||
const { spinning, setSpin } = useSpin();
|
||||
const monitorStore = useMonitorStore();
|
||||
const dataList = ref([
|
||||
{
|
||||
title: '心率',
|
||||
@@ -133,6 +135,7 @@
|
||||
async function initByLocal() {
|
||||
if (localStorage.getItem('monitorDataOne')) {
|
||||
dataList.value = JSON.parse(localStorage.getItem('monitorDataOne') || '{}');
|
||||
monitorStore.setOneTips(dataList.value ? dataList.value[0]?.tips : '');
|
||||
} else {
|
||||
await init();
|
||||
}
|
||||
@@ -168,6 +171,7 @@
|
||||
if (item.type === '1') {
|
||||
item.tips =
|
||||
resData?.minData === null || resData?.maxData === null ? '' : `最小值-最大值:${resData?.minData}~${resData?.maxData}次/分钟`;
|
||||
monitorStore.setOneTips(item.tips);
|
||||
}
|
||||
item.data = item.data.map((val: any) => {
|
||||
val.value = resData[val.key];
|
||||
|
||||
Reference in New Issue
Block a user