| | |
| | | /> |
| | | </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" /> |
| | |
| | | </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> |
| | |
| | | }; |
| | | |
| | | 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("任务内容不能为空"); |
| | |
| | | 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, |
| | | }); |
| | | handleCancel(); |
| | | } finally { |
| | |
| | | &:not(:first-child) { |
| | | margin-left: 6px; |
| | | } |
| | | &.cancel { |
| | | background: #bbc6dd; |
| | | } |
| | | |
| | | &.confirm { |
| | | background: #769aff; |
| | | } |
| | | &.cancel { |
| | | background: #bbc6dd; |
| | | } |
| | | &.refresh { |
| | | background: #e6a23c; |
| | | } |