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) {
emit("setDates", _time, "right");
}
if (!(props.left && props.right)) {
emit("setDates", _time);
}
emit("ok", info === "h");
};
onMounted(() => {

View File

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

View File

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