update
1.优化
This commit is contained in:
@@ -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
@@ -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;
|
||||
|
||||
@@ -354,6 +354,8 @@
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
if (qhInterval.value) clearInterval(qhInterval.value);
|
||||
if (cInterval.value) clearInterval(cInterval.value);
|
||||
// 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
|
||||
window.onbeforeunload = function () {
|
||||
closeSocket();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -78,14 +78,17 @@
|
||||
condition: chooseType.value,
|
||||
centerId: props.centerId,
|
||||
};
|
||||
statisticsNewApi(params).then((res) => {
|
||||
console.log(res);
|
||||
if (res.code != 200 || !res.result) {
|
||||
return;
|
||||
}
|
||||
setSession(LEFT_KEY1, JSON.stringify(res.result));
|
||||
setValue(res.result);
|
||||
});
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
function setValue(result) {
|
||||
|
||||
@@ -96,12 +96,15 @@
|
||||
twoLApi({
|
||||
sex: chooseType.value,
|
||||
depart: selectValue.value,
|
||||
}).then((res) => {
|
||||
console.log(res, 'resessss');
|
||||
if (res.code == 200) {
|
||||
initChart(res.result);
|
||||
}
|
||||
});
|
||||
})
|
||||
.then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
initChart(res.result);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
function initChart(value) {
|
||||
|
||||
@@ -147,13 +147,17 @@
|
||||
});
|
||||
|
||||
function getList() {
|
||||
twoRApi({}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
localStorage.removeItem('twoRList');
|
||||
twoRList.value = res.result;
|
||||
localStorage.setItem('twoRList', JSON.stringify(res.result));
|
||||
}
|
||||
});
|
||||
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) {
|
||||
emit('handleClick', { type, date, normal });
|
||||
|
||||
Reference in New Issue
Block a user