fix(仪表板): PC中设置过滤组规则默认值后隐藏,将组件添加至移动端配置中没有进行过滤
This commit is contained in:
parent
d6beec8eed
commit
689887419f
@ -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}】数值区间最大值必须大于最小值`)
|
||||
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 = () => {
|
||||
@ -601,7 +628,9 @@ const queryData = () => {
|
||||
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}`)
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user