mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-23 20:44:58 +08:00
远程控制定时器离开页面后卸载,个人信息按钮修改
This commit is contained in:
parent
4c4561b35d
commit
05fbbddd77
|
@ -87,7 +87,7 @@
|
|||
<el-button class="f18" type="primary" @click="saveData">确认</el-button>
|
||||
</div>
|
||||
<div v-else-if="type === 'edit'" style="text-align: right;">
|
||||
<el-button class="f18" @click="saveData">修改</el-button>
|
||||
<el-button class="f18" @click="close">取消</el-button>
|
||||
<el-button class="f18" type="primary" @click="saveData">更新</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, reactive } from 'vue';
|
||||
import { onMounted, ref, reactive, onBeforeUnmount } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { useRemoteStore } from '@/stores/remote-info-store'
|
||||
|
@ -210,6 +210,13 @@ onMounted(() => {
|
|||
initScale();
|
||||
|
||||
});
|
||||
// 页面卸载前清除定时器
|
||||
onBeforeUnmount(() => {
|
||||
clearInterval(featureTimer)
|
||||
clearInterval(ecgTimer)
|
||||
clearInterval(aiFlagTimer)
|
||||
clearInterval(medicineTimer)
|
||||
})
|
||||
|
||||
function initData() {
|
||||
lungAlarm.value = false;
|
||||
|
@ -273,7 +280,7 @@ function setTableData(res: any) {
|
|||
function getMedicine() {
|
||||
let isRunTimer = true;
|
||||
clearInterval(medicineTimer);
|
||||
setInterval(() => {
|
||||
medicineTimer = setInterval(() => {
|
||||
if (isRunTimer && JSON.stringify(tableDataStore) === JSON.stringify(tableData) && isAIDose.value) {
|
||||
isRunTimer = false;
|
||||
const url = isAIDose.value ? '/getaimedicine' : '/getdoctormedicine';
|
||||
|
@ -291,12 +298,12 @@ function getChartData() {
|
|||
let isRunTimer = true;
|
||||
clearInterval(featureTimer);
|
||||
clearInterval(ecgTimer);
|
||||
setInterval(() => {
|
||||
featureTimer = setInterval(() => {
|
||||
if (isRunTimer) {
|
||||
getData()
|
||||
}
|
||||
}, 2000);
|
||||
setInterval(() => {
|
||||
ecgTimer = setInterval(() => {
|
||||
try {
|
||||
chartDom4.value.updateChart(0, new Date());
|
||||
} catch (error) { }
|
||||
|
|
Loading…
Reference in New Issue
Block a user