feat(查询组件): 文本下拉组件,选项值设置为多选时,也可以设置首选默认值 #17088 时间范围在年月的时候增加年初至本月 #17101 查询条件【选项值数量】的【默认】加个提示 #17091

This commit is contained in:
dataeaseShu
2025-10-09 15:14:39 +08:00
committed by dataeaseShu
parent 7a55e8b379
commit 4594b78f9e
9 changed files with 60 additions and 10 deletions

View File

@@ -225,6 +225,10 @@ const relativeToCurrentListRange = computed(() => {
{
label: t('v_query.last_12_months'),
value: 'LastTwelveMonths'
},
{
label: t('common.to_this_month'),
value: 'YearToThisMonth'
}
]
break
@@ -272,8 +276,8 @@ const relativeToCurrentListRange = computed(() => {
})
const defaultValueFirstItemShow = computed(() => {
const { displayType, optionValueSource, multiple } = curComponent.value
return +displayType === 0 && optionValueSource === 1 && !multiple
const { displayType, optionValueSource } = curComponent.value
return +displayType === 0 && optionValueSource === 1
})
const aroundList = [

View File

@@ -213,6 +213,10 @@ const relativeToCurrentListRange = computed(() => {
{
label: t('v_query.last_12_months'),
value: 'LastTwelveMonths'
},
{
label: t('common.to_this_month'),
value: 'YearToThisMonth'
}
]
break

View File

@@ -2165,6 +2165,10 @@ const relativeToCurrentListRange = computed(() => {
{
label: t('v_query.last_12_months'),
value: 'LastTwelveMonths'
},
{
label: t('common.to_this_month'),
value: 'YearToThisMonth'
}
]
break
@@ -2957,8 +2961,17 @@ defineExpose({
{{ t('v_query.of_option_values') }}
</div>
<div class="value">
<el-radio-group class="larger-radio" v-model="curComponent.resultMode">
<el-radio :label="0">{{ t('login.default_login') }}</el-radio>
<el-radio-group class="larger-radio icon-info" v-model="curComponent.resultMode">
<el-radio :label="0"
>{{ t('login.default_login') }}
<el-tooltip effect="dark" :content="t('common.up_to_options')" placement="top">
<el-icon style="margin-left: 4px; color: #646a73">
<icon name="icon_info_outlined"
><icon_info_outlined class="svg-icon"
/></icon>
</el-icon> </el-tooltip
></el-radio>
<el-radio :label="1">{{ t('chart.result_mode_all') }}</el-radio>
</el-radio-group>
</div>
@@ -3422,8 +3435,16 @@ defineExpose({
{{ t('v_query.of_option_values') }}
</div>
<div class="value" style="margin-top: 10.5px">
<el-radio-group class="larger-radio" v-model="curComponent.resultMode">
<el-radio :label="0">{{ t('chart.default') }}</el-radio>
<el-radio-group class="larger-radio icon-info" v-model="curComponent.resultMode">
<el-radio :label="0"
>{{ t('chart.default') }}
<el-tooltip effect="dark" :content="t('common.up_to_options')" placement="top">
<el-icon style="margin-left: 4px; color: #646a73">
<icon name="icon_info_outlined"
><icon_info_outlined class="svg-icon"
/></icon>
</el-icon> </el-tooltip
></el-radio>
<el-radio :label="1">{{ t('data_set.all') }}</el-radio>
</el-radio-group>
</div>
@@ -4189,6 +4210,12 @@ defineExpose({
}
}
.larger-radio {
&.icon-info {
.ed-radio__label {
display: flex;
align-items: center;
}
}
.ed-radio__inner {
width: 16px;
height: 16px;

View File

@@ -224,6 +224,10 @@ const relativeToCurrentListRange = computed(() => {
{
label: t('v_query.last_12_months'),
value: 'LastTwelveMonths'
},
{
label: t('common.to_this_month'),
value: 'YearToThisMonth'
}
]
break

View File

@@ -107,8 +107,8 @@ const cascade = computed(() => {
})
let time
const disabledFirstItem = computed(() => {
const { defaultValueFirstItem, optionValueSource, multiple } = props.config
return defaultValueFirstItem && optionValueSource === 1 && !multiple
const { defaultValueFirstItem, optionValueSource } = props.config
return defaultValueFirstItem && optionValueSource === 1
})
const setDefaultMapValue = arr => {
const { displayId, field } = config.value
@@ -402,7 +402,7 @@ watch(
const setDefaultValueFirstItem = () => {
if (!options.value.length) return
selectValue.value = options.value[0].value
selectValue.value = config.value.multiple ? [options.value[0].value] : options.value[0].value
const value = Array.isArray(selectValue.value) ? [...selectValue.value] : selectValue.value
if (!props.isConfig) {
config.value.selectValue = Array.isArray(selectValue.value)
@@ -497,13 +497,15 @@ watch(
if (!props.isConfig) return
if (val) {
selectValue.value = []
setDefaultValueFirstItem()
}
nextTick(() => {
multiple.value = val
config.value.defaultValueFirstItem = false
if (!val) {
nextTick(() => {
selectValue.value = undefined
if (!config.value.defaultValueFirstItem) return
setDefaultValueFirstItem()
})
}
})
@@ -762,6 +764,7 @@ defineExpose({
show-checked
:tagColor="tagColor"
scrollbar-always-on
:disabled="disabledFirstItem && props.isConfig"
clearable
:style="selectStyle"
collapse-tags

View File

@@ -68,6 +68,8 @@ function getCustomRange(relativeToCurrentRange: string): [Date, Date] {
new Date(dayjs().subtract(12, 'month').startOf('month').format('YYYY/MM/DD HH:mm:ss')),
getThisEnd('day')
]
case 'YearToThisMonth':
return [new Date(dayjs().startOf('year').format('YYYY/MM/DD HH:mm:ss')), getThisEnd('month')]
case 'today':
return [getThisStart('day'), getThisEnd('day')]
case 'yesterday':

View File

@@ -1,5 +1,7 @@
export default {
common: {
to_this_month: 'From the beginning of the year to this month',
up_to_options: 'Display up to 1000 options',
next_week: 'Next week',
next_month: 'Next month',
next_quarter: 'Next quarter',

View File

@@ -1,5 +1,7 @@
export default {
common: {
to_this_month: '年初至本月',
up_to_options: '最多展示1000個選項',
next_week: '下週',
next_month: '下個月',
next_quarter: '下季',

View File

@@ -1,5 +1,7 @@
export default {
common: {
to_this_month: '年初至本月',
up_to_options: '最多展示1000个选项',
next_week: '下周',
next_month: '下月',
next_quarter: '下季',