Commit 28db8b03cd5c9b34858b27ec4cab973334ce5d71
Merge branch 'ww' into 'main'
perf: data component visualization configuration setting default selected first item See merge request huang/yun-teng-iot-front!317
Showing
2 changed files
with
11 additions
and
4 deletions
| ... | ... | @@ -110,6 +110,8 @@ | 
| 110 | 110 | |
| 111 | 111 | watch(() => props.layout.componentType, updateChartType); | 
| 112 | 112 | |
| 113 | + // watch(() => props.value.gradientInfo, updateChartType); | |
| 114 | + | |
| 113 | 115 | let timeout: Nullable<number> = null; | 
| 114 | 116 | |
| 115 | 117 | function handleRandomValue() { | 
| ... | ... | @@ -139,7 +141,10 @@ | 
| 139 | 141 | <div class="flex flex-col w-full h-full min-w-3 min-h-3"> | 
| 140 | 142 | <div :id="getControlsWidgetId()" class="widget-charts w-full h-full flex-auto"></div> | 
| 141 | 143 | <div> | 
| 142 | - <div class="text-center" :style="{ fontSize: fontSize({ radio: getRadio, basic: 16 }) }"> | |
| 144 | + <div | |
| 145 | + class="text-center" | |
| 146 | + :style="{ fontSize: fontSize({ radio: getRadio, basic: 16, max: 18 }), color: '#666' }" | |
| 147 | + > | |
| 143 | 148 | {{ props.value.name }} | 
| 144 | 149 | </div> | 
| 145 | 150 | <Tooltip | ... | ... | 
| ... | ... | @@ -12,6 +12,7 @@ | 
| 12 | 12 | import { decode } from '../../config/config'; | 
| 13 | 13 | import { ComponentInfo } from '/@/api/dataBoard/model'; | 
| 14 | 14 | import { useCalcGridLayout } from '../../hook/useCalcGridLayout'; | 
| 15 | + import { FrontComponent } from '../config/help'; | |
| 15 | 16 | |
| 16 | 17 | interface DataComponentRouteParams extends RouteParams { | 
| 17 | 18 | id: string; | 
| ... | ... | @@ -31,7 +32,7 @@ | 
| 31 | 32 | return decode((ROUTE.params as DataComponentRouteParams).boardId as string); | 
| 32 | 33 | }); | 
| 33 | 34 | |
| 34 | - const frontId = ref(''); | |
| 35 | + const frontId = ref(FrontComponent.TEXT_COMPONENT_1); | |
| 35 | 36 | |
| 36 | 37 | const isEdit = ref(false); | 
| 37 | 38 | |
| ... | ... | @@ -42,7 +43,8 @@ | 
| 42 | 43 | const [register, { closeModal, changeOkLoading }] = useModalInner( | 
| 43 | 44 | (data: { isEdit: boolean; record?: DataBoardLayoutInfo }) => { | 
| 44 | 45 | componentRecord.value = data.record || ({} as unknown as DataBoardLayoutInfo); | 
| 45 | - frontId.value = data.record?.record?.frontId || ''; | |
| 46 | + frontId.value = | |
| 47 | + (data.record?.record?.frontId as FrontComponent) || FrontComponent.TEXT_COMPONENT_1; | |
| 46 | 48 | isEdit.value = data.isEdit || false; | 
| 47 | 49 | } | 
| 48 | 50 | ); | 
| ... | ... | @@ -54,7 +56,7 @@ | 
| 54 | 56 | |
| 55 | 57 | const resetForm = () => { | 
| 56 | 58 | isEdit.value = false; | 
| 57 | - frontId.value = ''; | |
| 59 | + frontId.value = FrontComponent.TEXT_COMPONENT_1; | |
| 58 | 60 | componentRecord.value = {} as unknown as DataBoardLayoutInfo; | 
| 59 | 61 | componentDefaultConfig.value = {}; | 
| 60 | 62 | }; | ... | ... |