mirror of
https://github.com/dataease/dataease.git
synced 2026-05-14 12:22:10 +08:00
fix: 修复图片组默认值靠前排列导致后置条件为生效问题,图片未进行空值校验问题 (#17824)
This commit is contained in:
@@ -33,6 +33,7 @@ import { mappingColor } from '@/views/chart/components/js/panel/common/common_ta
|
||||
import { storeToRefs } from 'pinia'
|
||||
import ChartEmptyInfo from '@/views/chart/components/views/components/ChartEmptyInfo.vue'
|
||||
import ChartError from '@/views/chart/components/views/components/ChartError.vue'
|
||||
import { deepCopy } from '@/utils/utils'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { canvasViewInfo, mobileInPc, fullscreenFlag } = storeToRefs(dvMainStore)
|
||||
const state = reactive({
|
||||
@@ -198,8 +199,16 @@ const conditionAdaptor = (chart: Chart) => {
|
||||
const conditions = threshold.tableThreshold ?? []
|
||||
if (conditions?.length > 0) {
|
||||
for (let i = 0; i < conditions.length; i++) {
|
||||
const field = conditions[i]
|
||||
const field = deepCopy(conditions[i])
|
||||
let defaultValueColor = null
|
||||
field.conditions.sort((a, b) => {
|
||||
const aIsDefault = a.term === 'default'
|
||||
const bIsDefault = b.term === 'default'
|
||||
|
||||
if (aIsDefault && !bIsDefault) return 1
|
||||
if (!aIsDefault && bIsDefault) return -1
|
||||
return 0
|
||||
})
|
||||
const checkResult = mappingColor(
|
||||
dataRowNameSelect.value[field.field.name],
|
||||
defaultValueColor,
|
||||
|
||||
@@ -2947,6 +2947,7 @@ export default {
|
||||
column_name: 'Field name'
|
||||
},
|
||||
visualization: {
|
||||
img_can_not_null: 'Image cannot be empty',
|
||||
outer_params_type_tips1:
|
||||
"When the type is 'filter', it only applies to text dropdown, text tree, and number dropdown. For text tree filtering format, separate multiple levels with '-de-'",
|
||||
outer_params_type_tips2:
|
||||
|
||||
@@ -2866,6 +2866,7 @@ export default {
|
||||
column_name: '欄位名稱'
|
||||
},
|
||||
visualization: {
|
||||
img_can_not_null: '圖片不能為空',
|
||||
outer_params_type_tips1:
|
||||
"類型為過濾時僅對文字下拉、文字樹、數字下拉有效。文字樹的過濾格式中,多級之間使用 '-de-' 分隔",
|
||||
outer_params_type_tips2:
|
||||
|
||||
@@ -2872,6 +2872,7 @@ export default {
|
||||
column_name: '字段名称'
|
||||
},
|
||||
visualization: {
|
||||
img_can_not_null: '图片不能为空',
|
||||
outer_params_type_tips1:
|
||||
"类型为过滤时仅对文本下拉、文本树、数字下拉,文本树的过滤格式多级之间使用'-de-' 隔离",
|
||||
outer_params_type_tips2:
|
||||
|
||||
@@ -193,6 +193,10 @@ const changeTableThreshold = () => {
|
||||
}
|
||||
for (let j = 0; j < field.conditions.length; j++) {
|
||||
const ele = field.conditions[j]
|
||||
if (props.chart.type === 'picture-group' && !ele.url) {
|
||||
ElMessage.error(t('visualization.img_can_not_null'))
|
||||
return
|
||||
}
|
||||
if (!ele.term || ele.term === '') {
|
||||
ElMessage.error(t('chart.exp_can_not_empty'))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user