fix cancel fail for date edit
This commit is contained in:
@@ -38,13 +38,13 @@
|
|||||||
title="开始时间"
|
title="开始时间"
|
||||||
:note="dateRange[0] || '-'"
|
:note="dateRange[0] || '-'"
|
||||||
arrow
|
arrow
|
||||||
@click="startVisible = true"
|
@click="openStartTime"
|
||||||
/>
|
/>
|
||||||
<t-cell
|
<t-cell
|
||||||
title="结束时间"
|
title="结束时间"
|
||||||
:note="dateRange[1] || '-'"
|
:note="dateRange[1] || '-'"
|
||||||
arrow
|
arrow
|
||||||
@click="endVisible = true"
|
@click="openEndTime"
|
||||||
/>
|
/>
|
||||||
<t-cell title="事件" :note="eventFilterLabel" />
|
<t-cell title="事件" :note="eventFilterLabel" />
|
||||||
<t-cell title="数据量" :note="summaryTotalText" />
|
<t-cell title="数据量" :note="summaryTotalText" />
|
||||||
@@ -101,21 +101,25 @@
|
|||||||
<nav-bar-action-menu v-if="canShowActionMenu" :actions="actionList" />
|
<nav-bar-action-menu v-if="canShowActionMenu" :actions="actionList" />
|
||||||
<t-popup v-model="startVisible" placement="bottom">
|
<t-popup v-model="startVisible" placement="bottom">
|
||||||
<t-date-time-picker
|
<t-date-time-picker
|
||||||
:default-value="dateRange[0]"
|
v-if="startVisible"
|
||||||
|
v-model="startDraft"
|
||||||
format="YYYY-MM-DD HH:mm"
|
format="YYYY-MM-DD HH:mm"
|
||||||
:mode="['date', 'minute']"
|
:mode="['date', 'minute']"
|
||||||
title="开始时间"
|
title="开始时间"
|
||||||
v-model="dateRange[0]"
|
:default-value="dateRange[0]"
|
||||||
|
@cancel="cancelStartTime"
|
||||||
@confirm="confirmStartTime"
|
@confirm="confirmStartTime"
|
||||||
/>
|
/>
|
||||||
</t-popup>
|
</t-popup>
|
||||||
<t-popup v-model="endVisible" placement="bottom">
|
<t-popup v-model="endVisible" placement="bottom">
|
||||||
<t-date-time-picker
|
<t-date-time-picker
|
||||||
:default-value="dateRange[1]"
|
v-if="endVisible"
|
||||||
|
v-model="endDraft"
|
||||||
:mode="['date', 'minute']"
|
:mode="['date', 'minute']"
|
||||||
format="YYYY-MM-DD HH:mm"
|
format="YYYY-MM-DD HH:mm"
|
||||||
title="结束时间"
|
title="结束时间"
|
||||||
v-model="dateRange[1]"
|
:default-value="dateRange[1]"
|
||||||
|
@cancel="cancelEndTime"
|
||||||
@confirm="confirmEndTime"
|
@confirm="confirmEndTime"
|
||||||
/>
|
/>
|
||||||
</t-popup>
|
</t-popup>
|
||||||
@@ -162,6 +166,8 @@ const keyword = ref(getInitialKeyword());
|
|||||||
const customerId = ref(getQueryText("customerId"));
|
const customerId = ref(getQueryText("customerId"));
|
||||||
const dateFilterType = ref<DateFilterType>(parseDateFilterType(route.query.dateType));
|
const dateFilterType = ref<DateFilterType>(parseDateFilterType(route.query.dateType));
|
||||||
const dateRange = ref(parseDateRange(dateFilterType.value));
|
const dateRange = ref(parseDateRange(dateFilterType.value));
|
||||||
|
const startDraft = ref("");
|
||||||
|
const endDraft = ref("");
|
||||||
const actionFilter = ref<string[]>([]);
|
const actionFilter = ref<string[]>([]);
|
||||||
const eventList = ref<EventItem[]>([]);
|
const eventList = ref<EventItem[]>([]);
|
||||||
const startVisible = ref(false);
|
const startVisible = ref(false);
|
||||||
@@ -353,13 +359,35 @@ async function selectDateFilter(type: DropdownValue): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function confirmStartTime(): Promise<void> {
|
function openStartTime(): void {
|
||||||
|
startDraft.value = dateRange.value[0];
|
||||||
|
startVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function openEndTime(): void {
|
||||||
|
endDraft.value = dateRange.value[1];
|
||||||
|
endVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancelStartTime(): void {
|
||||||
startVisible.value = false;
|
startVisible.value = false;
|
||||||
|
startDraft.value = dateRange.value[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancelEndTime(): void {
|
||||||
|
endVisible.value = false;
|
||||||
|
endDraft.value = dateRange.value[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
async function confirmStartTime(value?: string | number): Promise<void> {
|
||||||
|
startVisible.value = false;
|
||||||
|
dateRange.value = [String(value || startDraft.value), dateRange.value[1]];
|
||||||
await confirmCustomRange();
|
await confirmCustomRange();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function confirmEndTime(): Promise<void> {
|
async function confirmEndTime(value?: string | number): Promise<void> {
|
||||||
endVisible.value = false;
|
endVisible.value = false;
|
||||||
|
dateRange.value = [dateRange.value[0], String(value || endDraft.value)];
|
||||||
await confirmCustomRange();
|
await confirmCustomRange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user