Merge remote-tracking branch 'origin/dev-v3' into dev-v3

This commit is contained in:
wangjiahao
2026-05-19 15:37:02 +08:00
9 changed files with 70 additions and 6 deletions

View File

@@ -229,6 +229,10 @@ const relativeToCurrentListRange = computed(() => {
{
label: t('common.to_this_month'),
value: 'YearToThisMonth'
},
{
label: t('v_query.year_to_last_month_end'),
value: 'YearToLastMonthEnd'
}
]
break
@@ -263,6 +267,10 @@ const relativeToCurrentListRange = computed(() => {
label: t('v_query.year_to_date'),
value: 'yearBeginning'
},
{
label: t('v_query.year_to_last_month_end'),
value: 'YearToLastMonthEnd'
},
{
label: t('common.month_to_yesterday'),
value: 'monthToYesterday'

View File

@@ -217,6 +217,10 @@ const relativeToCurrentListRange = computed(() => {
{
label: t('common.to_this_month'),
value: 'YearToThisMonth'
},
{
label: t('v_query.year_to_last_month_end'),
value: 'YearToLastMonthEnd'
}
]
break
@@ -243,6 +247,10 @@ const relativeToCurrentListRange = computed(() => {
label: t('v_query.year_to_date'),
value: 'yearBeginning'
},
{
label: t('v_query.year_to_last_month_end'),
value: 'YearToLastMonthEnd'
},
{
label: t('common.month_to_yesterday'),
value: 'monthToYesterday'

View File

@@ -2184,6 +2184,10 @@ const relativeToCurrentListRange = computed(() => {
{
label: t('common.to_this_month'),
value: 'YearToThisMonth'
},
{
label: t('v_query.year_to_last_month_end'),
value: 'YearToLastMonthEnd'
}
]
break
@@ -2210,6 +2214,10 @@ const relativeToCurrentListRange = computed(() => {
label: t('v_query.year_to_date'),
value: 'yearBeginning'
},
{
label: t('v_query.year_to_last_month_end'),
value: 'YearToLastMonthEnd'
},
{
label: t('common.month_to_yesterday'),
value: 'monthToYesterday'

View File

@@ -228,6 +228,10 @@ const relativeToCurrentListRange = computed(() => {
{
label: t('common.to_this_month'),
value: 'YearToThisMonth'
},
{
label: t('v_query.year_to_last_month_end'),
value: 'YearToLastMonthEnd'
}
]
break
@@ -254,6 +258,10 @@ const relativeToCurrentListRange = computed(() => {
label: t('v_query.year_to_date'),
value: 'yearBeginning'
},
{
label: t('v_query.year_to_last_month_end'),
value: 'YearToLastMonthEnd'
},
{
label: t('common.month_to_yesterday'),
value: 'monthToYesterday'

View File

@@ -1,11 +1,23 @@
import dayjs from 'dayjs'
import type { ManipulateType } from 'dayjs'
function getThisStart(val = 'month' as ManipulateType | 'quarter') {
return new Date(dayjs().startOf(val).format('YYYY/MM/DD HH:mm:ss'))
import type { ManipulateType, QUnitType } from 'dayjs'
import quarterOfYear from 'dayjs/plugin/quarterOfYear'
type ManipulateTypeWithQuarter = ManipulateType | 'quarter'
dayjs.extend(quarterOfYear)
function getThisStart(val = 'month' as ManipulateTypeWithQuarter) {
return new Date(
dayjs()
.startOf(val as QUnitType)
.format('YYYY/MM/DD HH:mm:ss')
)
}
function getThisEnd(val = 'month' as ManipulateType | 'quarter') {
return new Date(dayjs().endOf(val).format('YYYY/MM/DD HH:mm:ss'))
function getThisEnd(val = 'month' as ManipulateTypeWithQuarter) {
return new Date(
dayjs()
.endOf(val as QUnitType)
.format('YYYY/MM/DD HH:mm:ss')
)
}
function getLastStart(val = 'month' as ManipulateType) {
@@ -16,6 +28,15 @@ function getLastEnd(val = 'month' as ManipulateType) {
return new Date(dayjs().subtract(1, val).endOf(val).format('YYYY/MM/DD HH:mm:ss'))
}
function getYearToLastMonthEnd(): [Date, Date] {
const start = getThisStart('year')
const end = getLastEnd('month')
if (+start > +end) {
return [start, getThisEnd('day')]
}
return [start, end]
}
function getAround(val = 'month' as ManipulateType, type = 'add', num = 0) {
if (val === 'week') {
return new Date(dayjs().endOf('week').add(1, 'day').endOf('day').format('YYYY/MM/DD HH:mm:ss'))
@@ -70,6 +91,8 @@ function getCustomRange(relativeToCurrentRange: string): [Date, Date] {
]
case 'YearToThisMonth':
return [new Date(dayjs().startOf('year').format('YYYY/MM/DD HH:mm:ss')), getThisEnd('month')]
case 'YearToLastMonthEnd':
return getYearToLastMonthEnd()
case 'monthToYesterday':
const sm = new Date(dayjs().startOf('month').format('YYYY/MM/DD HH:mm:ss'))
const ld = getLastEnd('day')
@@ -99,6 +122,7 @@ export {
getThisEnd,
getLastStart,
getLastEnd,
getYearToLastMonthEnd,
getAround,
getCustomRange,
getAroundStart

View File

@@ -2862,6 +2862,7 @@ export default {
last_3_days: 'Last 3 days',
month_to_date: 'Month to date',
year_to_date: 'Year to date',
year_to_last_month_end: 'Year to end of last month',
exact_match: 'Exact',
fuzzy_match: 'Fuzzy',
option_type: 'Option type',

View File

@@ -2792,6 +2792,7 @@ export default {
last_3_days: '最近3 天',
month_to_date: '月初至今',
year_to_date: '年初至今',
year_to_last_month_end: '年初至上月底',
exact_match: '精確匹配',
fuzzy_match: '模糊匹配',
option_type: '選項類型',

View File

@@ -2798,6 +2798,7 @@ export default {
last_3_days: '最近 3 天',
month_to_date: '月初至今',
year_to_date: '年初至今',
year_to_last_month_end: '年初至上月末',
exact_match: '精确匹配',
fuzzy_match: '模糊匹配',
option_type: '选项类型',

View File

@@ -27,6 +27,10 @@ const Dataset = defineAsyncComponent(() => import('@/views/visualized/data/datas
const Datasource = defineAsyncComponent(
() => import('@/views/visualized/data/datasource/index.vue')
)
const ExportExcel = defineAsyncComponent(
() => import('@/views/visualized/data/dataset/ExportExcel.vue')
)
const ScreenPanel = defineAsyncComponent(() => import('@/views/data-visualization/PreviewShow.vue'))
const DashboardPanel = defineAsyncComponent(
() => import('@/views/dashboard/DashboardPreviewShow.vue')
@@ -45,7 +49,8 @@ const componentMap = {
Datasource,
ScreenPanel,
DashboardPanel,
TemplateManage
TemplateManage,
ExportExcel
}
const iframeStyle = ref(null)
const setStyle = debounce(() => {