diff --git a/core/core-frontend/src/custom-component/v-query/NumberInput.vue b/core/core-frontend/src/custom-component/v-query/NumberInput.vue index 164dd0cdf3..58b79a3a66 100644 --- a/core/core-frontend/src/custom-component/v-query/NumberInput.vue +++ b/core/core-frontend/src/custom-component/v-query/NumberInput.vue @@ -5,6 +5,7 @@ interface SelectConfig { defaultValueCheck: boolean defaultNumValueEnd: number numValueEnd: number + queryConditionWidth: number numValueStart: number defaultNumValueStart: number placeholder: string @@ -24,6 +25,7 @@ const props = defineProps({ default: () => { return { id: '', + queryConditionWidth: 0, defaultNumValueEnd: '', defaultNumValueStart: '', numValueEnd: '', @@ -55,8 +57,18 @@ onBeforeMount(() => { const queryConditionWidth = inject('com-width', Function, true) const customStyle = inject<{ background: string }>('$custom-style-filter') const isConfirmSearch = inject('is-confirm-search', Function, true) + +const getCustomWidth = () => { + if (placeholder?.value?.placeholderShow) { + if (props.config.queryConditionWidth === undefined) { + return queryConditionWidth() + } + return props.config.queryConditionWidth + } + return 227 +} const selectStyle = computed(() => { - return { width: queryConditionWidth() + 'px' } + return { width: getCustomWidth() + 'px' } }) const handleValueChange = () => { if (!props.isConfig) { diff --git a/core/core-frontend/src/custom-component/v-query/Select.vue b/core/core-frontend/src/custom-component/v-query/Select.vue index 0e474a85b4..a9fcb863fe 100644 --- a/core/core-frontend/src/custom-component/v-query/Select.vue +++ b/core/core-frontend/src/custom-component/v-query/Select.vue @@ -26,6 +26,7 @@ interface SelectConfig { displayType: string showEmpty: boolean id: string + queryConditionWidth: number placeholder: string resultMode: number displayId: string @@ -55,6 +56,7 @@ const props = defineProps({ default: () => { return { selectValue: '', + queryConditionWidth: 0, resultMode: 0, defaultValue: '', displayType: '', @@ -561,8 +563,18 @@ const init = () => { debounceOptions(optionValueSource) } +const getCustomWidth = () => { + if (placeholder?.value?.placeholderShow) { + if (props.config.queryConditionWidth === undefined) { + return queryConditionWidth() + } + return props.config.queryConditionWidth + } + return 227 +} + const selectStyle = computed(() => { - return props.isConfig ? {} : { width: queryConditionWidth() + 'px' } + return props.isConfig ? {} : { width: getCustomWidth() + 'px' } }) const mult = ref() @@ -640,6 +652,9 @@ defineExpose({