修改定时预案逻辑,解决定时预案设置时间错误的BUG

This commit is contained in:
fangxiang 2022-03-19 12:12:43 +08:00
parent 1c76f64e93
commit d7376ca2fb
5 changed files with 56 additions and 4 deletions

View File

@ -127,6 +127,7 @@ export default class Initializer {
let windows = (await global_data.getCurrentClient()?.getWindows())?.windows;
let $store = options.$store;
if (windows && $store) {
$store.commit("clearWindows");
$store.commit("setWindows", windows);
}
}

View File

@ -252,7 +252,41 @@
$t("time") + ":"
}}</q-item-section>
<q-item-section>
<q-input v-model="time_" :loading="loading" type="time" />
<q-input
v-if="false"
v-model="time_"
:loading="loading"
type="time"
/>
<q-input
v-else
filled
v-model="time_"
:loading="loading"
mask="fulltime"
:rules="['fulltime']"
>
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy
cover
transition-show="scale"
transition-hide="scale"
>
<q-time v-model="time_" with-seconds format24h now-btn>
<div class="row items-center justify-end">
<q-btn
v-close-popup
:label="$t('close')"
color="primary"
flat
/>
</div>
</q-time>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
</q-item-section>
</q-item>
<q-item v-if="timing_cycle != $t('disable')">
@ -351,7 +385,7 @@
import { defineComponent, ref, Ref, watch, computed } from "vue";
import { useStore } from "src/store";
import GlobalData from "src/common/GlobalData";
import { useQuasar } from "quasar";
import { useQuasar, date as $date } from "quasar";
import { useI18n } from "vue-i18n";
import { StringKeyValueEntity } from "src/entities/StringKeyValueEntity";
import { PlanEntity } from "src/entities/PlanEntity";
@ -632,6 +666,20 @@ export default defineComponent({
});
}
datas.value = temp;
// format time
{
let _times = time_.value.split(":");
if (Array.isArray(_times)) {
while (_times.length < 3) {
_times.push("00");
}
_times = _times.slice(0, 3);
time_.value = _times.join(":");
} else {
time_.value = "09:00:00";
}
}
}
for (let i = 1; i < datas.value.length; i += 2) {

View File

@ -1840,6 +1840,9 @@ export namespace Protocol {
minor_version = 0;
patch_version = 0;
tweak_version = 0;
kernel_version: string = "";
rootfs_version: string = "";
constructor() {
super();
this.command = Protocol.Commands.kRpcGetBuildInfo;

View File

@ -235,7 +235,7 @@ export default {
thursday: "星期四",
friday: "星期五",
saturday: "星期六",
sunday: "星期",
sunday: "星期",
"timing cycle": "定时执行",
time: "时间",
loop: "循环",

View File

@ -2,7 +2,7 @@
<q-layout view="hHh lpR fFf">
<q-page-container>
<q-page class="row items-center justify-evenly">
<q-card :style="{ width: (landspace ? 36 : 70) + 'vw' }">
<q-card :style="{ width: (landspace ? 34 : 70) + 'vw' }">
<q-card-section class="text-center text-h6">
{{ $t("login") }}
</q-card-section>