Merge pull request #13197 from dataease/pr@dev-v2_st
fix(仪表板): PC中设置过滤组规则默认值后隐藏,将组件添加至移动端配置中没有进行过滤
This commit is contained in:
commit
d89dd893f0
@ -2,6 +2,7 @@
|
||||
import icon_edit_outlined from '@/assets/svg/icon_edit_outlined.svg'
|
||||
import icon_deleteTrash_outlined from '@/assets/svg/icon_delete-trash_outlined.svg'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { isMobile } from '@/utils/utils'
|
||||
import { ElMessage } from 'element-plus-secondary'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import QueryConditionConfiguration from './QueryConditionConfiguration.vue'
|
||||
@ -256,6 +257,7 @@ const releaseSelect = id => {
|
||||
|
||||
const queryDataForId = id => {
|
||||
let requiredName = ''
|
||||
let numName = ''
|
||||
const emitterList = (element.value.propValue || [])
|
||||
.filter(ele => ele.id === id)
|
||||
.reduce((pre, next) => {
|
||||
@ -288,6 +290,22 @@ const queryDataForId = id => {
|
||||
requiredName = next.name
|
||||
}
|
||||
}
|
||||
|
||||
if (next.displayType === '22') {
|
||||
if (
|
||||
!isNaN(next.numValueEnd) &&
|
||||
!isNaN(next.numValueStart) &&
|
||||
next.numValueEnd < next.numValueStart
|
||||
) {
|
||||
numName = next.name
|
||||
}
|
||||
if (
|
||||
[next.numValueEnd, next.numValueStart].filter(itx => ![null, undefined, ''].includes(itx))
|
||||
.length === 1
|
||||
) {
|
||||
requiredName = next.name
|
||||
}
|
||||
}
|
||||
const keyList = Object.entries(next.checkedFieldsMap)
|
||||
.filter(ele => next.checkedFields.includes(ele[0]))
|
||||
.filter(ele => !!ele[1])
|
||||
@ -299,6 +317,10 @@ const queryDataForId = id => {
|
||||
ElMessage.error(`【${requiredName}】${t('v_query.before_querying')}`)
|
||||
return
|
||||
}
|
||||
if (!!numName) {
|
||||
ElMessage.error(`【${numName}】${t('v_query.the_minimum_value')}`)
|
||||
return
|
||||
}
|
||||
if (!emitterList.length) return
|
||||
emitterList.forEach(ele => {
|
||||
emitter.emit(`query-data-${ele}`)
|
||||
@ -339,6 +361,7 @@ onBeforeUnmount(() => {
|
||||
})
|
||||
|
||||
const updateQueryCriteria = () => {
|
||||
if (dvMainStore.mobileInPc && !isMobile()) return
|
||||
Array.isArray(element.value.propValue) &&
|
||||
element.value.propValue.forEach(ele => {
|
||||
if (ele.auto) {
|
||||
@ -380,6 +403,10 @@ onMounted(() => {
|
||||
emitter.on(`editQueryCriteria${element.value.id}`, editQueryCriteria)
|
||||
emitter.on(`updateQueryCriteria${element.value.id}`, updateQueryCriteria)
|
||||
updateQueryCriteria()
|
||||
|
||||
if (dvMainStore.mobileInPc && !isMobile()) {
|
||||
queryData()
|
||||
}
|
||||
})
|
||||
|
||||
const dragover = () => {
|
||||
@ -597,11 +624,13 @@ const queryData = () => {
|
||||
}
|
||||
|
||||
if (!!numName) {
|
||||
ElMessage.error(`【${numName}】数值区间最大值必须大于最小值`)
|
||||
ElMessage.error(`【${numName}】${t('v_query.the_minimum_value')}`)
|
||||
return
|
||||
}
|
||||
if (!emitterList.length) return
|
||||
dvMainStore.setFirstLoadMap([...new Set([...emitterList, ...firstLoadMap.value])])
|
||||
if (!(dvMainStore.mobileInPc && !isMobile())) {
|
||||
dvMainStore.setFirstLoadMap([...new Set([...emitterList, ...firstLoadMap.value])])
|
||||
}
|
||||
emitterList.forEach(ele => {
|
||||
emitter.emit(`query-data-${ele}`)
|
||||
})
|
||||
|
||||
@ -1167,7 +1167,7 @@ const validate = () => {
|
||||
!isNaN(ele.defaultNumValueStart) &&
|
||||
ele.defaultNumValueEnd < ele.defaultNumValueStart
|
||||
) {
|
||||
ElMessage.error('数值区间最大值必须大于最小值')
|
||||
ElMessage.error(t('v_query.the_minimum_value'))
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@ -2554,6 +2554,7 @@ export default {
|
||||
variable_mgm: '参数设置'
|
||||
},
|
||||
v_query: {
|
||||
the_minimum_value: '数值区间最大值必须大于最小值',
|
||||
before_querying: '查询条件是必填项,请设置选项值后,再进行查询!',
|
||||
here_or_click: '将右侧的字段拖拽到这里 或 点击',
|
||||
add_query_condition: '添加查询条件',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user