forked from github/dataease
Merge pull request #13143 from dataease/pr@dev-v2_st
fix(查询组件): 过滤组件动态默认值自定义开始和结束时间出现图表
This commit is contained in:
commit
520bc1b406
@ -537,6 +537,7 @@ const boxWidth = computed(() => {
|
|||||||
|
|
||||||
const queryData = () => {
|
const queryData = () => {
|
||||||
let requiredName = ''
|
let requiredName = ''
|
||||||
|
let numName = ''
|
||||||
const emitterList = (element.value.propValue || []).reduce((pre, next) => {
|
const emitterList = (element.value.propValue || []).reduce((pre, next) => {
|
||||||
if (next.required) {
|
if (next.required) {
|
||||||
if (!next.defaultValueCheck) {
|
if (!next.defaultValueCheck) {
|
||||||
@ -569,6 +570,13 @@ const queryData = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (next.displayType === '22') {
|
if (next.displayType === '22') {
|
||||||
|
if (
|
||||||
|
!isNaN(next.numValueEnd) &&
|
||||||
|
!isNaN(next.numValueStart) &&
|
||||||
|
next.numValueEnd < next.numValueStart
|
||||||
|
) {
|
||||||
|
numName = next.name
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
[next.numValueEnd, next.numValueStart].filter(itx => ![null, undefined, ''].includes(itx))
|
[next.numValueEnd, next.numValueStart].filter(itx => ![null, undefined, ''].includes(itx))
|
||||||
.length === 1
|
.length === 1
|
||||||
@ -587,6 +595,11 @@ const queryData = () => {
|
|||||||
ElMessage.error(`【${requiredName}】${t('v_query.before_querying')}`)
|
ElMessage.error(`【${requiredName}】${t('v_query.before_querying')}`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!!numName) {
|
||||||
|
ElMessage.error(`【${numName}】数值区间最大值必须大于最小值`)
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!emitterList.length) return
|
if (!emitterList.length) return
|
||||||
dvMainStore.setFirstLoadMap([...new Set([...emitterList, ...firstLoadMap.value])])
|
dvMainStore.setFirstLoadMap([...new Set([...emitterList, ...firstLoadMap.value])])
|
||||||
emitterList.forEach(ele => {
|
emitterList.forEach(ele => {
|
||||||
|
@ -69,7 +69,7 @@ const relativeToCurrentTypeList = computed(() => {
|
|||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: t('chart.chart'),
|
label: t('dynamic_time.year'),
|
||||||
value: 'year'
|
value: 'year'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
import { toRefs, onBeforeMount, type PropType, type Ref, inject, computed, nextTick } from 'vue'
|
import { toRefs, onBeforeMount, type PropType, type Ref, inject, computed, nextTick } from 'vue'
|
||||||
interface SelectConfig {
|
interface SelectConfig {
|
||||||
id: string
|
id: string
|
||||||
|
defaultValueCheck: boolean
|
||||||
defaultNumValueEnd: number
|
defaultNumValueEnd: number
|
||||||
numValueEnd: number
|
numValueEnd: number
|
||||||
numValueStart: number
|
numValueStart: number
|
||||||
@ -26,7 +27,8 @@ const props = defineProps({
|
|||||||
defaultNumValueEnd: '',
|
defaultNumValueEnd: '',
|
||||||
defaultNumValueStart: '',
|
defaultNumValueStart: '',
|
||||||
numValueEnd: '',
|
numValueEnd: '',
|
||||||
numValueStart: ''
|
numValueStart: '',
|
||||||
|
defaultValueCheck: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -38,6 +40,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { config } = toRefs(props)
|
const { config } = toRefs(props)
|
||||||
const setParams = () => {
|
const setParams = () => {
|
||||||
|
if (!config.value.defaultValueCheck) return
|
||||||
const { defaultNumValueEnd, defaultNumValueStart } = config.value
|
const { defaultNumValueEnd, defaultNumValueStart } = config.value
|
||||||
config.value.numValueEnd = defaultNumValueEnd
|
config.value.numValueEnd = defaultNumValueEnd
|
||||||
config.value.numValueStart = defaultNumValueStart
|
config.value.numValueStart = defaultNumValueStart
|
||||||
|
@ -1153,6 +1153,24 @@ const validate = () => {
|
|||||||
ElMessage.error(t('v_query.be_linked_first'))
|
ElMessage.error(t('v_query.be_linked_first'))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ele.displayType === '22' && ele.defaultValueCheck) {
|
||||||
|
if (
|
||||||
|
(ele.defaultNumValueEnd !== 0 && !ele.defaultNumValueEnd) ||
|
||||||
|
(ele.defaultNumValueStart !== 0 && !ele.defaultNumValueStart)
|
||||||
|
) {
|
||||||
|
ElMessage.error(t('v_query.cannot_be_empty_de'))
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
!isNaN(ele.defaultNumValueEnd) &&
|
||||||
|
!isNaN(ele.defaultNumValueStart) &&
|
||||||
|
ele.defaultNumValueEnd < ele.defaultNumValueStart
|
||||||
|
) {
|
||||||
|
ElMessage.error('数值区间最大值必须大于最小值')
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
let displayTypeField = null
|
let displayTypeField = null
|
||||||
let errorTips = t('v_query.cannot_be_performed')
|
let errorTips = t('v_query.cannot_be_performed')
|
||||||
let hasParameterTimeArrType = 0
|
let hasParameterTimeArrType = 0
|
||||||
@ -2983,7 +3001,7 @@ defineExpose({
|
|||||||
<el-radio-group class="larger-radio" v-model="curComponent.conditionType">
|
<el-radio-group class="larger-radio" v-model="curComponent.conditionType">
|
||||||
<el-radio :label="0">{{ t('v_query.single_condition') }}</el-radio>
|
<el-radio :label="0">{{ t('v_query.single_condition') }}</el-radio>
|
||||||
<el-radio :label="1" :disabled="!!curComponent.parameters.length">{{
|
<el-radio :label="1" :disabled="!!curComponent.parameters.length">{{
|
||||||
t('v_query.single_condition')
|
t('v_query.with_condition')
|
||||||
}}</el-radio>
|
}}</el-radio>
|
||||||
<el-radio :label="2" :disabled="!!curComponent.parameters.length">{{
|
<el-radio :label="2" :disabled="!!curComponent.parameters.length">{{
|
||||||
t('v_query.or_condition')
|
t('v_query.or_condition')
|
||||||
|
Loading…
Reference in New Issue
Block a user