mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 13:32:18 +08:00
fix(仪表板): 删除过滤规则没有对数据进行更新
This commit is contained in:
@@ -920,9 +920,11 @@ function removeItemComponent(item) {
|
||||
})
|
||||
}
|
||||
if (!!checkedFields.length) {
|
||||
Array.from(new Set(checkedFields)).forEach(ele => {
|
||||
emitter.emit(`query-data-${ele}`)
|
||||
})
|
||||
setTimeout(() => {
|
||||
Array.from(new Set(checkedFields)).forEach(ele => {
|
||||
emitter.emit(`query-data-${ele}`)
|
||||
})
|
||||
}, 300)
|
||||
}
|
||||
snapshotStore.recordSnapshotCache('removeItem')
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
reactive,
|
||||
ref,
|
||||
toRefs,
|
||||
unref,
|
||||
watch,
|
||||
computed,
|
||||
onMounted,
|
||||
@@ -593,10 +594,27 @@ const addCriteriaConfigOut = () => {
|
||||
queryConfig.value.setConditionOut()
|
||||
}
|
||||
|
||||
const reRenderAll = (oldArr, newArr) => {
|
||||
const newArrIds = newArr.map(ele => ele.id)
|
||||
const emitterList = (oldArr || []).reduce((pre, next) => {
|
||||
if (newArrIds.includes(next.id)) return pre
|
||||
const keyList = getKeyList(next)
|
||||
pre = [...new Set([...keyList, ...pre])]
|
||||
return pre
|
||||
}, [])
|
||||
if (!emitterList.length) return
|
||||
emitterList.forEach(ele => {
|
||||
console.log('`query-data-${ele}`', `query-data-${ele}`)
|
||||
emitter.emit(`query-data-${ele}`)
|
||||
})
|
||||
}
|
||||
|
||||
const delQueryConfig = index => {
|
||||
const com = cloneDeep(unref(list))
|
||||
list.value.splice(index, 1)
|
||||
element.value.propValue = [...list.value]
|
||||
snapshotStore.recordSnapshotCache('delQueryConfig')
|
||||
reRenderAll(com, cloneDeep(unref(list)))
|
||||
}
|
||||
|
||||
const resetData = () => {
|
||||
@@ -939,6 +957,7 @@ const autoStyle = computed(() => {
|
||||
:query-element="element"
|
||||
@queryData="queryData"
|
||||
ref="queryConfig"
|
||||
@reRenderAll="reRenderAll"
|
||||
></QueryConditionConfiguration>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
@@ -1441,6 +1441,17 @@ const validate = () => {
|
||||
}
|
||||
}
|
||||
|
||||
if (ele.displayType === '2') {
|
||||
if (!ele.defaultValueCheck) return false
|
||||
if (
|
||||
(Array.isArray(ele.defaultValue) && !ele.defaultValue.length) ||
|
||||
(!Array.isArray(ele.defaultValue) && isNaN(ele.defaultValue))
|
||||
) {
|
||||
ElMessage.error(t('v_query.cannot_be_empty_de'))
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if (+ele.displayType === 7) {
|
||||
if (!ele.defaultValueCheck) return false
|
||||
if (ele.timeType === 'fixed') {
|
||||
@@ -1544,7 +1555,7 @@ const handleBeforeClose = () => {
|
||||
relationshipChartIndex.value = 0
|
||||
dialogVisible.value = false
|
||||
}
|
||||
const emits = defineEmits(['queryData'])
|
||||
const emits = defineEmits(['queryData', 'reRenderAll'])
|
||||
const confirmClick = () => {
|
||||
if (validate()) return
|
||||
defaultConfigurationRef.value?.mult()
|
||||
@@ -1559,6 +1570,7 @@ const confirmClick = () => {
|
||||
: curComponent.value.multiple
|
||||
)
|
||||
})
|
||||
const oldArr = cloneDeep(unref(queryElement.value.propValue))
|
||||
queryElement.value.propValue = []
|
||||
nextTick(() => {
|
||||
conditions.value.forEach(itx => {
|
||||
@@ -1579,6 +1591,7 @@ const confirmClick = () => {
|
||||
curComponent.value.id = ''
|
||||
relationshipChartIndex.value = 0
|
||||
nextTick(() => {
|
||||
emits('reRenderAll', oldArr, cloneDeep(unref(conditions)))
|
||||
emits('queryData')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user