From 28f8508d2e63bebc9c3c332c2918ac6b82d69e4a Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期六, 26 七月 2025 13:21:22 +0800
Subject: [PATCH] ID1625-修改文本
---
src/views/mobile/bedsideAuxiliaryScreen/components/ScheduledTask.vue | 101 +++++++++++++++++++-------------------------------
1 files changed, 38 insertions(+), 63 deletions(-)
diff --git a/src/views/mobile/bedsideAuxiliaryScreen/components/ScheduledTask.vue b/src/views/mobile/bedsideAuxiliaryScreen/components/ScheduledTask.vue
index 06c7434..58d72f4 100644
--- a/src/views/mobile/bedsideAuxiliaryScreen/components/ScheduledTask.vue
+++ b/src/views/mobile/bedsideAuxiliaryScreen/components/ScheduledTask.vue
@@ -22,7 +22,7 @@
/>
</div>
</template>
- <div class="scheduled-task-content">
+ <div class="scheduled-task-content" v-loading="loading">
<div class="content-left">
<div class="content-left-date">
<TimePicker v-model="timeValue" />
@@ -64,7 +64,13 @@
</div>
<template #footer>
<div class="my-button cancel" @click="handleCancel">取消</div>
- <div class="my-button confirm" @click="handleConfirm">确认</div>
+ <div
+ class="my-button confirm"
+ :class="loading ? 'cancel' : ''"
+ @click="handleConfirm"
+ >
+ 确认
+ </div>
</template>
</el-dialog>
</div>
@@ -73,8 +79,10 @@
<script lang="ts" setup>
import { computed, ref } from "vue";
import dayjs from "dayjs";
-import { setTimeoutAlert } from "@/utils/httpApi";
+import { setTimeoutAlert, stopTimeoutAlert } from "@/utils/httpApi";
import { useBedsideAuxiliaryScreenStore } from "@/store/bedsideAuxiliaryScreen";
+import { taskOptions } from '@/store/type/task.type';
+import type { TaskItem } from '@/store/type/task.type';
// @ts-ignore
import TimePicker from "./TimePicker.vue";
@@ -89,12 +97,6 @@
import cgbaojing from "@/assets/cg.mp3";
import { ElMessage } from "element-plus";
-interface TaskItem {
- label: string;
- value: string;
- backgroundColor: string;
- promptTone: string;
-}
interface DateItem {
label: string;
@@ -114,44 +116,6 @@
const loading = ref(false);
-const taskOptions = ref<TaskItem[]>([
- {
- label: "测血压",
- value: "测血压",
- backgroundColor: "#E6A23C",
- promptTone: cxybaojing,
- },
- {
- label: "开超滤",
- value: "开超滤",
- backgroundColor: "#E6A23C",
- promptTone: kclbaojing,
- },
- {
- label: "给药",
- value: "给药",
- backgroundColor: "#E6A23C",
- promptTone: gybaojing,
- },
- {
- label: "调电导度",
- value: "调电导度",
- backgroundColor: "#E6A23C",
- promptTone: tdddbaojing,
- },
- {
- label: "调血流量",
- value: "调血流量",
- backgroundColor: "#E6A23C",
- promptTone: tzxllbaojing,
- },
- {
- label: "冲管",
- value: "冲管",
- backgroundColor: "#E6A23C",
- promptTone: cgbaojing,
- },
-]);
const dateOptions = ref<DateItem[]>([
{ label: "15分钟", value: 15 },
@@ -161,7 +125,7 @@
]);
const taskItemCheck = computed(() => {
- return taskOptions.value.find((e) => e.value === taskName.value)?.value || "";
+ return taskOptions.find((e) => e.value === taskName.value)?.value || "";
});
const openDialog = () => {
@@ -207,14 +171,18 @@
};
const handleCancel = () => {
+ if (loading.value) return;
isShow.value = false;
};
const handleConfirm = async () => {
+ if (loading.value) return;
const today = dayjs().format("YYYY-MM-DD");
- const fullDateTime = dayjs(`${today} ${timeValue.value}`).second(0).millisecond(0); // 秒和毫秒都去掉,要不然间隔短了就是0分钟
+ const fullDateTime = dayjs(`${today} ${timeValue.value}`)
+ .second(0)
+ .millisecond(0); // 秒和毫秒都去掉,要不然间隔短了就是0分钟
- const now = dayjs().second(0).millisecond(0);; // 秒和毫秒都去掉
+ const now = dayjs().second(0).millisecond(0); // 秒和毫秒都去掉
if (!fullDateTime.isAfter(now))
return ElMessage.warning("任务提醒时间不能早于或等于当前时间");
if (!taskName.value) return ElMessage.warning("任务内容不能为空");
@@ -225,19 +193,25 @@
deviceCode: bedsideAuxiliaryScreenStore.deviceData.deviceCode,
minutes: diffMinutes,
alertText: taskName.value,
- }
+ };
const recordCode = bedsideAuxiliaryScreenStore.deviceData.recordCode;
const { data, message } = await setTimeoutAlert(params);
if (data !== "OK") return ElMessage.warning(message);
- ElMessage.success('操作成功');
+ ElMessage.success("操作成功");
bedsideAuxiliaryScreenStore.setSyncTask({
- deviceCode: params.deviceCode,
- recordCode: recordCode,
- taskDate: dayjs(fullDateTime).format("YYYY-MM-DD HH:mm"),
- taskName: params.alertText,
- overdue: false
+ deviceCode: params.deviceCode,
+ recordCode: recordCode,
+ taskDate: dayjs(fullDateTime).format("YYYY-MM-DD HH:mm"),
+ taskName: params.alertText,
+ overdue: false,
+ sync: false,
+ countdown: diffMinutes * 60,
});
+ // 这里得先把loading关了
+ loading.value = false;
handleCancel();
+ } catch (error) {
+ console.log(error)
} finally {
loading.value = false;
}
@@ -329,9 +303,9 @@
.date {
margin-left: 0;
padding: 0;
- width: 50px;
- height: 23px;
- line-height: 23px;
+ width: 44px;
+ height: 18px;
+ line-height: 18px;
text-align: center;
font-size: 11px;
background-color: #769aff;
@@ -419,12 +393,13 @@
&:not(:first-child) {
margin-left: 6px;
}
- &.cancel {
- background: #bbc6dd;
- }
+
&.confirm {
background: #769aff;
}
+ &.cancel {
+ background: #bbc6dd;
+ }
&.refresh {
background: #e6a23c;
}
--
Gitblit v1.8.0