fix: update time picker

This commit is contained in:
Qiuxia Fan 2022-03-02 16:33:38 +08:00
parent fdb8b76eb5
commit 58a70a8e2e
3 changed files with 9 additions and 4 deletions

View File

@ -553,6 +553,9 @@ const ok = (info: any) => {
if (props.right && _time.getTime() / 100000 > start.value) { if (props.right && _time.getTime() / 100000 > start.value) {
emit("setDates", _time, "right"); emit("setDates", _time, "right");
} }
if (!(props.left && props.right)) {
emit("setDates", _time);
}
emit("ok", info === "h"); emit("ok", info === "h");
}; };
onMounted(() => { onMounted(() => {

View File

@ -276,11 +276,11 @@ const ok = (leaveOpened: boolean) => {
}, 1); }, 1);
}; };
const setDates = (d: Date, pos: string) => { const setDates = (d: Date, pos: string) => {
if (pos === "left") { if (pos === "right") {
dates.value[0] = d; dates.value[1] = d;
return; return;
} }
dates.value[1] = d; dates.value[0] = d;
}; };
const dc = (e: any) => { const dc = (e: any) => {
show.value = (datepicker.value as any).contains(e.target) && !props.disabled; show.value = (datepicker.value as any).contains(e.target) && !props.disabled;

View File

@ -118,10 +118,12 @@ function changeMaxSamplingCount(opt: any[]) {
async function createTask() { async function createTask() {
emits("close"); emits("close");
const date =
monitorTime.value === "0" ? appStore.durationRow.start : time.value;
const params = { const params = {
serviceId: selectorStore.currentService.id, serviceId: selectorStore.currentService.id,
endpointName: endpointName.value, endpointName: endpointName.value,
startTime: time.value.getTime(), startTime: date.getTime(),
duration: Number(monitorDuration.value), duration: Number(monitorDuration.value),
minDurationThreshold: Number(minThreshold.value), minDurationThreshold: Number(minThreshold.value),
dumpPeriod: Number(dumpPeriod.value), dumpPeriod: Number(dumpPeriod.value),