Commit 02b6e9cc6ad7f2947fd8dbd402e933d789a6dc1b
Merge branch 'fix/DEFECT-1301' into 'main_dev'
fix: 数据看板流量计组件单位样式调整 See merge request yunteng/thingskit-front!629
Showing
3 changed files
with
18 additions
and
5 deletions
@@ -104,7 +104,7 @@ | @@ -104,7 +104,7 @@ | ||
104 | </svg> | 104 | </svg> |
105 | 105 | ||
106 | <div | 106 | <div |
107 | - class="absolute w-full h-full top-0 left-0 text-center text-lg flex items-center justify-center flex-col" | 107 | + class="absolute w-full h-full top-0 left-0 text-center text-lg flex items-center justify-center" |
108 | :style="{ color: getDesign.fontColor }" | 108 | :style="{ color: getDesign.fontColor }" |
109 | > | 109 | > |
110 | <div>{{ currentValue }}</div> | 110 | <div>{{ currentValue }}</div> |
@@ -97,7 +97,7 @@ | @@ -97,7 +97,7 @@ | ||
97 | /> | 97 | /> |
98 | </svg> | 98 | </svg> |
99 | <div | 99 | <div |
100 | - class="absolute w-full h-full top-0 left-0 text-center text-lg flex items-center justify-center flex-col" | 100 | + class="absolute w-full h-full top-0 left-0 text-center text-lg flex items-center justify-center" |
101 | :style="{ color: getDesign.fontColor }" | 101 | :style="{ color: getDesign.fontColor }" |
102 | > | 102 | > |
103 | <div>{{ currentValue }}</div> | 103 | <div>{{ currentValue }}</div> |
@@ -30,6 +30,16 @@ | @@ -30,6 +30,16 @@ | ||
30 | : transformValue; | 30 | : transformValue; |
31 | }); | 31 | }); |
32 | 32 | ||
33 | + const getDesign = computed(() => { | ||
34 | + const { persetOption, option } = props.config; | ||
35 | + const { fontColor: presetFontColor } = persetOption || {}; | ||
36 | + const { componentInfo } = option || {}; | ||
37 | + const { fontColor } = componentInfo || {}; | ||
38 | + return { | ||
39 | + fontColor: fontColor ?? presetFontColor, | ||
40 | + }; | ||
41 | + }); | ||
42 | + | ||
33 | const updateFn: DataFetchUpdateFn = (message, attribute) => { | 43 | const updateFn: DataFetchUpdateFn = (message, attribute) => { |
34 | const { data = {} } = message; | 44 | const { data = {} } = message; |
35 | const [latest] = data[attribute] || []; | 45 | const [latest] = data[attribute] || []; |
@@ -226,12 +236,15 @@ | @@ -226,12 +236,15 @@ | ||
226 | </g> | 236 | </g> |
227 | </g> | 237 | </g> |
228 | </svg> | 238 | </svg> |
229 | - <!-- <div class="absolute w-full h-full flex justify-center items-center bg-transparent"> | ||
230 | - <div class="transform translate-x-full text-lg text-gray-500"> | 239 | + <div class="absolute w-full h-full flex justify-center items-center bg-transparent"> |
240 | + <div | ||
241 | + class="transform translate-x-full text-lg text-gray-500" | ||
242 | + :style="{ color: getDesign.fontColor }" | ||
243 | + > | ||
231 | <span>{{ currentValue }}</span> | 244 | <span>{{ currentValue }}</span> |
232 | <span>{{ '℃' }}</span> | 245 | <span>{{ '℃' }}</span> |
233 | </div> | 246 | </div> |
234 | - </div> --> | 247 | + </div> |
235 | </main> | 248 | </main> |
236 | </template> | 249 | </template> |
237 | 250 |