diff --git a/src/dashboard-front/src/views/components-access/manage/components/sync-history.vue b/src/dashboard-front/src/views/components-access/manage/components/sync-history.vue index d23dff51c..ef49d921a 100644 --- a/src/dashboard-front/src/views/components-access/manage/components/sync-history.vue +++ b/src/dashboard-front/src/views/components-access/manage/components/sync-history.vue @@ -80,6 +80,7 @@ import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; import { getSyncHistory } from '@/http'; import TableEmpty from '@/components/table-empty.vue'; +import { Message } from 'bkui-vue'; const router = useRouter(); const { t, locale } = useI18n(); @@ -270,10 +271,16 @@ const handleTimeClear = () => { }; const handleTimeChange = () => { - pagination.current = 1; - nextTick(() => { - getComponents(); - }); + const internalValue = topDatePicker.value?.internalValue; + if (internalValue) { + dateTimeRange.value = internalValue; + pagination.current = 1; + nextTick(() => { + getComponents(); + }); + } else { + Message({ theme: 'warning', message: t('输入的时间错误'), delay: 2000, dismissable: false }); + } }; const init = () => { diff --git a/src/dashboard-front/src/views/monitor/alarm-history/index.vue b/src/dashboard-front/src/views/monitor/alarm-history/index.vue index e444e2d08..dda757dbc 100644 --- a/src/dashboard-front/src/views/monitor/alarm-history/index.vue +++ b/src/dashboard-front/src/views/monitor/alarm-history/index.vue @@ -4,6 +4,7 @@ (false); const initDateTimeRange = ref([]); const alarmStrategies = ref([]); const curStrategyCount = ref(0); +const datePickerRef = ref(null); const initParams = reactive({ limit: 10, offset: 0, @@ -225,17 +228,23 @@ const handleShortcutChange = (value: any, index: any) => { }; // 日期快捷方式改变触发 const handleTimeChange = () => { - nextTick(async () => { - const startStr: any = (+new Date(`${initDateTimeRange.value[0]}`)) / 1000; - const endStr: any = (+new Date(`${initDateTimeRange.value[1]}`)) / 1000; - // eslint-disable-next-line radix - const satrt: any = parseInt(startStr); - // eslint-disable-next-line radix - const end: any = parseInt(endStr); - filterData.value.time_start = satrt; - filterData.value.time_end = end; - await fetchRefreshTable(); - }); + const internalValue = datePickerRef.value?.internalValue; + if (internalValue) { + initDateTimeRange.value = internalValue; + nextTick(async () => { + const startStr: any = (+new Date(`${initDateTimeRange.value[0]}`)) / 1000; + const endStr: any = (+new Date(`${initDateTimeRange.value[1]}`)) / 1000; + // eslint-disable-next-line radix + const satrt: any = parseInt(startStr); + // eslint-disable-next-line radix + const end: any = parseInt(endStr); + filterData.value.time_start = satrt; + filterData.value.time_end = end; + await fetchRefreshTable(); + }); + } else { + Message({ theme: 'warning', message: t('输入的时间错误'), delay: 2000, dismissable: false }); + } }; // 获取状态name diff --git a/src/dashboard-front/src/views/online-debug/components/request-record.vue b/src/dashboard-front/src/views/online-debug/components/request-record.vue index 27790f7b7..3163451bf 100644 --- a/src/dashboard-front/src/views/online-debug/components/request-record.vue +++ b/src/dashboard-front/src/views/online-debug/components/request-record.vue @@ -97,6 +97,7 @@ import { useI18n } from 'vue-i18n'; import { useAccessLog, useCommon } from '@/store'; import editorMonaco from '@/components/ag-editor.vue'; import { getTestHistories, getTestHistoriesDetails } from '@/http'; +import { Message } from 'bkui-vue'; const { t } = useI18n(); const common = useCommon(); @@ -109,6 +110,7 @@ const filterData = ref({ }); const dateTimeRange = ref([]); const dateKey = ref('dateKey'); +const topDatePicker = ref(null); const AccessLogStore = useAccessLog(); const shortcutSelectedIndex = shallowRef(-1); const tableRef = ref(null); @@ -153,7 +155,13 @@ const setSearchTimeRange = () => { }; const handleTimeChange = () => { - setSearchTimeRange(); + const internalValue = topDatePicker.value?.internalValue; + if (internalValue) { + dateTimeRange.value = internalValue; + setSearchTimeRange(); + } else { + Message({ theme: 'warning', message: t('输入的时间错误'), delay: 2000, dismissable: false }); + } }; const handleTimeClear = () => { diff --git a/src/dashboard-front/src/views/permission/record/index.vue b/src/dashboard-front/src/views/permission/record/index.vue index 4fd722b19..839d5f5f5 100644 --- a/src/dashboard-front/src/views/permission/record/index.vue +++ b/src/dashboard-front/src/views/permission/record/index.vue @@ -4,6 +4,7 @@ (-1); const dateKey = ref('dateKey'); +const datePickerRef = ref(null); const curRecord = ref({ bk_app_code: '', applied_by: '', @@ -386,16 +389,22 @@ const handleShortcutChange = (value: any, index: any) => { }; // 日期快捷方式改变触发 const handleTimeChange = () => { - nextTick(() => { - const startStr: any = (+new Date(`${initDateTimeRange.value[0]}`)) / 1000; - const endStr: any = (+new Date(`${initDateTimeRange.value[1]}`)) / 1000; - // eslint-disable-next-line radix - const satrt: any = parseInt(startStr); - // eslint-disable-next-line radix - const end: any = parseInt(endStr); - filterData.value.time_start = satrt; - filterData.value.time_end = end; - }); + const internalValue = datePickerRef.value?.internalValue; + if (internalValue) { + initDateTimeRange.value = internalValue; + nextTick(() => { + const startStr: any = (+new Date(`${initDateTimeRange.value[0]}`)) / 1000; + const endStr: any = (+new Date(`${initDateTimeRange.value[1]}`)) / 1000; + // eslint-disable-next-line radix + const satrt: any = parseInt(startStr); + // eslint-disable-next-line radix + const end: any = parseInt(endStr); + filterData.value.time_start = satrt; + filterData.value.time_end = end; + }); + } else { + Message({ theme: 'warning', message: t('输入的时间错误'), delay: 2000, dismissable: false }); + } }; // 展示详情 const handleShowRecord = (e: Event, data: any) => { diff --git a/src/dashboard-front/src/views/stage/published/index.vue b/src/dashboard-front/src/views/stage/published/index.vue index 8abd1cbb7..b1adaaf1d 100644 --- a/src/dashboard-front/src/views/stage/published/index.vue +++ b/src/dashboard-front/src/views/stage/published/index.vue @@ -15,7 +15,7 @@ :key="dateKey" @change="handleChange" @clear="handleClear" - @pick-success="handleComfirm"> + @pick-success="handlePickSuccess">
@@ -113,6 +113,7 @@ import { getReleaseHistories, } from '@/http'; import TableEmpty from '@/components/table-empty.vue'; +import { Message } from 'bkui-vue'; const router = useRouter(); @@ -221,6 +222,16 @@ const getTextFromEnum = (e: Enums, key?: unknown) => { return t(e[key as keyof Enums]); }; +const handlePickSuccess = () => { + const internalValue = datePickerRef.value?.internalValue; + if (internalValue) { + dateValue.value = internalValue; + handleComfirm(); + } else { + Message({ theme: 'warning', message: t('输入的时间错误'), delay: 2000, dismissable: false }); + } +}; + watch(() => filterData.value, () => { updateTableEmptyConfig(); }, {