diff --git a/src/components/secondaryScreen/commonApi.ts b/src/components/secondaryScreen/commonApi.ts index 9f58174..53f9043 100644 --- a/src/components/secondaryScreen/commonApi.ts +++ b/src/components/secondaryScreen/commonApi.ts @@ -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); diff --git a/src/store/modules/monitor.ts b/src/store/modules/monitor.ts new file mode 100644 index 0000000..5ef81ea --- /dev/null +++ b/src/store/modules/monitor.ts @@ -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); + }, + }, +}); diff --git a/src/views/components/videoComponent.vue b/src/views/components/videoComponent.vue index cac2ba9..e7f584d 100644 --- a/src/views/components/videoComponent.vue +++ b/src/views/components/videoComponent.vue @@ -1,10 +1,9 @@ @@ -36,10 +51,11 @@ const videoRef = ref(null); const isVisible = ref(true); + const showImg = ref(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 @@ diff --git a/src/views/indexSun/centerMap.vue b/src/views/indexSun/centerMap.vue index a955a2c..7f795c5 100644 --- a/src/views/indexSun/centerMap.vue +++ b/src/views/indexSun/centerMap.vue @@ -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); diff --git a/src/views/indexSun/threeLeftNew.vue b/src/views/indexSun/threeLeftNew.vue index dbee4c5..fffd53b 100644 --- a/src/views/indexSun/threeLeftNew.vue +++ b/src/views/indexSun/threeLeftNew.vue @@ -29,7 +29,7 @@
{{ tabList[chooseType].label }}
-
{{ tabList[chooseType].tips }}
+
{{ monitorStore.getOneTips }}
参考范围: {{ tabList[chooseType].tips }}
@@ -60,6 +60,8 @@
>38
+ +
总人数: {{ monitorStore.getFourTips }}
@@ -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(''); const timer = ref(null); @@ -178,7 +184,7 @@ if (selectOptions.value.length === 1) { getAllDepart(); } - setTimer(); + // setTimer(); }); // watch(props, () => { // selectValue.value = ''; diff --git a/src/views/indexSun/threeLeftNewItem/sleepItem.vue b/src/views/indexSun/threeLeftNewItem/sleepItem.vue index e86e3c8..703eb3d 100644 --- a/src/views/indexSun/threeLeftNewItem/sleepItem.vue +++ b/src/views/indexSun/threeLeftNewItem/sleepItem.vue @@ -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); } } diff --git a/src/views/indexSun/threeLeftNewItem/threeLeftNewItem.vue b/src/views/indexSun/threeLeftNewItem/threeLeftNewItem.vue index 9582444..4ff40bc 100644 --- a/src/views/indexSun/threeLeftNewItem/threeLeftNewItem.vue +++ b/src/views/indexSun/threeLeftNewItem/threeLeftNewItem.vue @@ -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];