diff --git a/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue b/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue index 056f788416..d16c6cacb9 100644 --- a/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue @@ -126,6 +126,10 @@ const relativeToCurrentList = computed(() => { label: t('dynamic_time.firstOfMonth'), value: 'monthBeginning' }, + { + label: t('dynamic_time.endOfMonth'), + value: 'monthEnd' + }, { label: t('dynamic_time.firstOfYear'), value: 'yearBeginning' @@ -146,6 +150,10 @@ const relativeToCurrentList = computed(() => { label: t('dynamic_time.firstOfMonth'), value: 'monthBeginning' }, + { + label: t('dynamic_time.endOfMonth'), + value: 'monthEnd' + }, { label: t('dynamic_time.firstOfYear'), value: 'yearBeginning' diff --git a/core/core-frontend/src/custom-component/v-query/DynamicTime.vue b/core/core-frontend/src/custom-component/v-query/DynamicTime.vue index cece87245b..98607b4190 100644 --- a/core/core-frontend/src/custom-component/v-query/DynamicTime.vue +++ b/core/core-frontend/src/custom-component/v-query/DynamicTime.vue @@ -10,6 +10,7 @@ import { getToday, getYesterday, getMonthBeginning, + getMonthEnd, getYearBeginning, getCustomTime } from './time-format' @@ -141,6 +142,9 @@ const init = () => { case 'monthBeginning': selectValue.value = getMonthBeginning() break + case 'monthEnd': + selectValue.value = getMonthEnd() + break case 'yearBeginning': selectValue.value = getYearBeginning() break diff --git a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue index 1e483e5e18..97b5edae15 100644 --- a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue @@ -1873,6 +1873,10 @@ const relativeToCurrentList = computed(() => { label: t('dynamic_time.firstOfMonth'), value: 'monthBeginning' }, + { + label: t('dynamic_time.endOfMonth'), + value: 'monthEnd' + }, { label: t('dynamic_time.firstOfYear'), value: 'yearBeginning' @@ -1893,6 +1897,10 @@ const relativeToCurrentList = computed(() => { label: t('dynamic_time.firstOfMonth'), value: 'monthBeginning' }, + { + label: t('dynamic_time.endOfMonth'), + value: 'monthEnd' + }, { label: t('dynamic_time.firstOfYear'), value: 'yearBeginning' diff --git a/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue b/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue index f0ce1313ee..ebe8d02201 100644 --- a/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue +++ b/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue @@ -138,6 +138,10 @@ const relativeToCurrentList = computed(() => { label: t('dynamic_time.firstOfMonth'), value: 'monthBeginning' }, + { + label: t('dynamic_time.endOfMonth'), + value: 'monthEnd' + }, { label: t('dynamic_time.firstOfYear'), value: 'yearBeginning' @@ -158,6 +162,10 @@ const relativeToCurrentList = computed(() => { label: t('dynamic_time.firstOfMonth'), value: 'monthBeginning' }, + { + label: t('dynamic_time.endOfMonth'), + value: 'monthEnd' + }, { label: t('dynamic_time.firstOfYear'), value: 'yearBeginning' diff --git a/core/core-frontend/src/custom-component/v-query/time-format.ts b/core/core-frontend/src/custom-component/v-query/time-format.ts index de6f7eecaa..78aec5b255 100644 --- a/core/core-frontend/src/custom-component/v-query/time-format.ts +++ b/core/core-frontend/src/custom-component/v-query/time-format.ts @@ -1,4 +1,5 @@ import type { ManipulateType } from 'dayjs' +import dayjs from 'dayjs' function getThisYear() { return new Date(`${new Date().getFullYear()}/1`) } @@ -41,6 +42,10 @@ function getMonthBeginning() { return new Date(`${date.getFullYear()}/${date.getMonth() + 1}/1`) } +function getMonthEnd() { + return new Date(dayjs().endOf('month').format('YYYY/MM/DD HH:mm:ss')) +} + function getYearBeginning() { const date = new Date() return new Date(`${date.getFullYear()}/1/1`) @@ -211,6 +216,12 @@ function getDynamicRange({ isDateTime ? monthBeginningVal : monthBeginningVal + 24 * 3600 * 1000 - 1000 ] break + case 'monthEnd': + const monthEndVal = getMonthEnd().getTime() + selectValue = isDateTime + ? [monthEndVal, monthEndVal] + : [monthEndVal - 24 * 3600 * 1000 + 1000, monthEndVal] + break case 'yearBeginning': const yearBeginningVal = getYearBeginning().getTime() selectValue = [ @@ -251,6 +262,7 @@ export { getToday, getYesterday, getMonthBeginning, + getMonthEnd, getYearBeginning, getCustomTime, getDynamicRange diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index fd44bb988f..40dfd83619 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -407,6 +407,7 @@ export default { today: '今天', yesterday: '昨天', firstOfMonth: '月初', + endOfMonth: '月底', firstOfYear: '年初', custom: '自定义', date: '日', diff --git a/core/core-frontend/src/style/index.less b/core/core-frontend/src/style/index.less index 2689efb35c..3289a8bc9c 100644 --- a/core/core-frontend/src/style/index.less +++ b/core/core-frontend/src/style/index.less @@ -605,5 +605,5 @@ strong { } .ed-message .ed-message__closeBtn:hover { - background: #ebebebe6; + background: #ebebebe6 !important; }