1.优化
This commit is contained in:
2025-07-08 17:50:37 +08:00
parent 7565056a7e
commit f6e5bb78da
8 changed files with 39 additions and 28 deletions
@@ -3,7 +3,7 @@
<public-title title="睡眠" :theme-type="themeType" />
<div class="inner">
<div class="title">
<span class="lightSleep">平均睡眠 {{ nums.avg }} 深睡 {{ nums.avgLong }} 浅睡 {{ nums.avgShort }}</span>
<span class="lightSleep">平均睡眠 {{ nums.avg || 0 }} 深睡 {{ nums.avgLong || 0 }} 浅睡 {{ nums.avgShort || 0 }}</span>
</div>
<div class="sleepChart" ref="sleepChart"></div>
</div>
@@ -26,7 +26,7 @@
</a-table>
</div>
<!--预警查看详情-->
<EarlyWarningDialog ref="earlyWarningRef"></EarlyWarningDialog>
<EarlyWarningDialog ref="earlyWarningRef" />
</div>
</template>
<script lang="ts" setup>
+4 -2
View File
@@ -50,6 +50,10 @@ const router: Router = createRouter({
});
router.beforeEach((to, from, next) => {
debugger;
if (to.path !== '/login') {
setCurrentPath(to.path);
}
if (to.path == '/login') {
next();
} else {
@@ -61,7 +65,5 @@ router.beforeEach((to, from, next) => {
next();
}
}
next();
});
export default router;
+2
View File
@@ -354,6 +354,8 @@
}
onUnmounted(() => {
if (qhInterval.value) clearInterval(qhInterval.value);
if (cInterval.value) clearInterval(cInterval.value);
// 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
window.onbeforeunload = function () {
closeSocket();
-3
View File
@@ -247,7 +247,6 @@
...formRecord.value,
...result,
};
console.log(formRecord.value);
}
function handleClicksearch() {
formState.value = {
@@ -264,7 +263,6 @@
orgCode2.value = '';
orgCode1.value = '';
formState.value = {};
console.log(formState.value, formRecord.value, 'asjshj');
formRecord.value = {};
closeDialog();
}
@@ -277,7 +275,6 @@
...formRecord.value,
salvageUserDepart: '',
};
console.log(formState.value, formRecord.value);
}
defineExpose({
openDialog,
+5 -2
View File
@@ -78,13 +78,16 @@
condition: chooseType.value,
centerId: props.centerId,
};
statisticsNewApi(params).then((res) => {
console.log(res);
statisticsNewApi(params)
.then((res) => {
if (res.code != 200 || !res.result) {
return;
}
setSession(LEFT_KEY1, JSON.stringify(res.result));
setValue(res.result);
})
.catch((e) => {
console.log(e);
});
}
+5 -2
View File
@@ -96,11 +96,14 @@
twoLApi({
sex: chooseType.value,
depart: selectValue.value,
}).then((res) => {
console.log(res, 'resessss');
})
.then((res: any) => {
if (res.code == 200) {
initChart(res.result);
}
})
.catch((err) => {
console.log(err);
});
}
+5 -1
View File
@@ -147,12 +147,16 @@
});
function getList() {
twoRApi({}).then((res) => {
twoRApi({})
.then((res: any) => {
if (res.code == 200) {
localStorage.removeItem('twoRList');
twoRList.value = res.result;
localStorage.setItem('twoRList', JSON.stringify(res.result));
}
})
.catch((err) => {
console.log(err);
});
}
function handleClickNum1(type, date, normal) {