fix(数据大屏): 图标颜色不对

This commit is contained in:
dataeaseShu 2024-09-19 17:00:34 +08:00
parent 8866de1158
commit 1d4a21161a
4 changed files with 17 additions and 15 deletions

View File

@ -35,6 +35,14 @@ const filterTypeCom = computed(() => {
: Select : Select
}) })
const emits = defineEmits(['handleTimeTypeChange'])
const handleTimeTypeChange = val => {
if (val === 'dynamic') {
emits('handleTimeTypeChange')
}
}
const props = defineProps({ const props = defineProps({
curComponent: { curComponent: {
type: Object, type: Object,
@ -436,7 +444,7 @@ defineExpose({
v-if="curComponent.defaultValueCheck && ['1', '7'].includes(curComponent.displayType)" v-if="curComponent.defaultValueCheck && ['1', '7'].includes(curComponent.displayType)"
> >
<div class="setting"> <div class="setting">
<el-radio-group v-model="curComponent.timeType"> <el-radio-group @change="handleTimeTypeChange" v-model="curComponent.timeType">
<el-radio label="fixed">固定时间</el-radio> <el-radio label="fixed">固定时间</el-radio>
<el-radio label="dynamic">动态时间</el-radio> <el-radio label="dynamic">动态时间</el-radio>
</el-radio-group> </el-radio-group>

View File

@ -1332,6 +1332,11 @@ const timeGranularityChange = (val: string) => {
} }
} }
const handleTimeTypeChange = () => {
timeGranularityChange(curComponent.value.timeGranularity)
timeGranularityMultipleChange(curComponent.value.timeGranularityMultiple)
}
const timeGranularityMultipleChange = (val: string) => { const timeGranularityMultipleChange = (val: string) => {
handleDialogClick() handleDialogClick()
curComponent.value.relativeToCurrentType = ['daterange', 'datetimerange'].includes(val) curComponent.value.relativeToCurrentType = ['daterange', 'datetimerange'].includes(val)
@ -2121,6 +2126,7 @@ defineExpose({
</div> </div>
<condition-default-configuration <condition-default-configuration
ref="defaultConfigurationRef" ref="defaultConfigurationRef"
@handleTimeTypeChange="handleTimeTypeChange"
:cur-component="curComponent" :cur-component="curComponent"
></condition-default-configuration> ></condition-default-configuration>
</div> </div>

View File

@ -100,16 +100,6 @@ export const selectKey = ['textAlign', 'borderStyle', 'verticalAlign']
export const horizontalPosition = ['headHorizontalPosition'] export const horizontalPosition = ['headHorizontalPosition']
export const fieldType = ['text', 'time', 'value', 'value', 'value', 'location', 'binary', 'url'] export const fieldType = ['text', 'time', 'value', 'value', 'value', 'location', 'binary', 'url']
export const fieldTypeCalculated = [
'icon_text_calculated_outlined',
'icon_calendar_calculated_outlined',
'icon_number_calculated_outlined',
'icon_number_calculated_outlined',
'icon_number_calculated_outlined',
'icon_local_calculated_outlined',
'binary',
'icon_link_calculated_outlined'
]
export const fieldTypeText = [ export const fieldTypeText = [
'文本', '文本',
'时间', '时间',

View File

@ -18,9 +18,7 @@ import {
nextTick, nextTick,
onBeforeMount, onBeforeMount,
provide, provide,
h,
unref, unref,
getCurrentInstance,
onMounted onMounted
} from 'vue' } from 'vue'
import Icon from '@/components/icon-custom/src/Icon.vue' import Icon from '@/components/icon-custom/src/Icon.vue'
@ -32,7 +30,7 @@ import { useEmitt } from '@/hooks/web/useEmitt'
import { ElMessage, ElTreeSelect } from 'element-plus-secondary' import { ElMessage, ElTreeSelect } from 'element-plus-secondary'
import draggable from 'vuedraggable' import draggable from 'vuedraggable'
import DimensionItem from './drag-item/DimensionItem.vue' import DimensionItem from './drag-item/DimensionItem.vue'
import { fieldType, fieldTypeCalculated } from '@/utils/attr' import { fieldType } from '@/utils/attr'
import QuotaItem from '@/views/chart/components/editor/drag-item/QuotaItem.vue' import QuotaItem from '@/views/chart/components/editor/drag-item/QuotaItem.vue'
import DragPlaceholder from '@/views/chart/components/editor/drag-item/DragPlaceholder.vue' import DragPlaceholder from '@/views/chart/components/editor/drag-item/DragPlaceholder.vue'
import FilterTree from './filter/FilterTree.vue' import FilterTree from './filter/FilterTree.vue'
@ -1454,7 +1452,7 @@ const confirmEditCalc = () => {
const getIconName = (deType, extField, dimension = false) => { const getIconName = (deType, extField, dimension = false) => {
if (extField === 2) { if (extField === 2) {
const iconFieldCalculated = dimension ? iconFieldCalculatedMap : iconFieldCalculatedQMap const iconFieldCalculated = dimension ? iconFieldCalculatedMap : iconFieldCalculatedQMap
return iconFieldCalculated[fieldTypeCalculated[deType]] return iconFieldCalculated[deType]
} }
return iconFieldMap[fieldType[deType]] return iconFieldMap[fieldType[deType]]
} }