Showing
3 changed files
with
35 additions
and
11 deletions
| ... | ... | @@ -217,7 +217,12 @@ |
| 217 | 217 | > |
| 218 | 218 | <Slider |
| 219 | 219 | ref="sliderEl" |
| 220 | - :style="{ '--slider-color': getDesign.controlBarColor }" | |
| 220 | + :style="{ | |
| 221 | + '--slider-color': getDesign.controlBarColor, | |
| 222 | + '--slider-handle': (getRatio ? getRatio * 14 : 14) + 'px', | |
| 223 | + '--slider-height': (getRatio ? getRatio * 4 : 4) + 'px', | |
| 224 | + '--slider-top': -(getRatio ? getRatio * 5 : 5) + 'px', | |
| 225 | + }" | |
| 221 | 226 | class="no-drag" |
| 222 | 227 | :value="sliderValue" |
| 223 | 228 | :min="getDesign.minNumber" |
| ... | ... | @@ -244,6 +249,21 @@ |
| 244 | 249 | <style lang="less" scoped> |
| 245 | 250 | :deep(.ant-slider-track) { |
| 246 | 251 | background: var(--slider-color) !important; |
| 252 | + height: var(--slider-height) !important; | |
| 253 | + } | |
| 254 | + | |
| 255 | + :deep(.ant-slider-handle) { | |
| 256 | + height: var(--slider-handle) !important; | |
| 257 | + width: var(--slider-handle) !important; | |
| 258 | + margin-top: var(--slider-top) !important; | |
| 259 | + } | |
| 260 | + | |
| 261 | + :deep(.ant-slider-step) { | |
| 262 | + height: var(--slider-height) !important; | |
| 263 | + } | |
| 264 | + | |
| 265 | + :deep(.ant-slider-rail) { | |
| 266 | + height: var(--slider-height) !important; | |
| 247 | 267 | } |
| 248 | 268 | |
| 249 | 269 | :deep(.ant-spin-container) { | ... | ... |
| ... | ... | @@ -119,20 +119,25 @@ |
| 119 | 119 | <div v-for="item in percentList" :key="item.id" class="flex flex-col ml-3 mr-3 items-stretch"> |
| 120 | 120 | <div class="flex justify-between"> |
| 121 | 121 | <div |
| 122 | - class="text-gray-500 text-sm" | |
| 122 | + class="text-gray-500 flex w-7/10" | |
| 123 | 123 | :style="{ |
| 124 | 124 | color: item.fontColor, |
| 125 | 125 | fontSize: (getRatios ? getRatios * item.fontSize : item.fontSize) + 'px', |
| 126 | 126 | }" |
| 127 | 127 | > |
| 128 | - {{ | |
| 128 | + <!-- {{ | |
| 129 | 129 | `${item.deviceName} |
| 130 | 130 | - |
| 131 | 131 | ${item.attributeName || item.attribute || '温度'}` |
| 132 | - }} | |
| 132 | + }} --> | |
| 133 | + <div class="max-w-4/6 overflow-ellipsis overflow-hidden whitespace-nowrap">{{ | |
| 134 | + item.deviceName | |
| 135 | + }}</div> | |
| 136 | + <span>-</span> | |
| 137 | + <div>{{ item.attributeName || item.attribute || '温度' }}</div> | |
| 133 | 138 | </div> |
| 134 | 139 | <span |
| 135 | - class="text-lg" | |
| 140 | + class="text-lg max-w-3/10" | |
| 136 | 141 | :style="{ |
| 137 | 142 | color: item.fontColor, |
| 138 | 143 | fontSize: (getRatios ? getRatios * item.valueSize : item.valueSize) + 'px', | ... | ... |
| ... | ... | @@ -89,7 +89,7 @@ |
| 89 | 89 | }; |
| 90 | 90 | |
| 91 | 91 | useMultipleDataFetch(props, updateFn); |
| 92 | - const { getRatios } = useComponentScale(props); | |
| 92 | + const { getRatio } = useComponentScale(props); | |
| 93 | 93 | </script> |
| 94 | 94 | |
| 95 | 95 | <template> |
| ... | ... | @@ -105,22 +105,21 @@ |
| 105 | 105 | <SvgIcon |
| 106 | 106 | :name="item.icon!" |
| 107 | 107 | prefix="iconfont" |
| 108 | - :size="getRatios ? 30 * getRatios : 30" | |
| 108 | + :size="getRatio ? 30 * getRatio : 30" | |
| 109 | 109 | :style="{ color: item.iconColor }" |
| 110 | 110 | /> |
| 111 | 111 | |
| 112 | 112 | <div |
| 113 | - class="text-gray-500 text-sm ml-6" | |
| 114 | - :style="{ fontSize: (getRatios ? getRatios * item.fontSize : item.fontSize) + 'px' }" | |
| 113 | + class="text-gray-500 ml-6" | |
| 114 | + :style="{ fontSize: (getRatio ? getRatio * item.fontSize : item.fontSize) + 'px' }" | |
| 115 | 115 | >{{ item.deviceName + '-' + item.attributeName || '温度' }}</div |
| 116 | 116 | > |
| 117 | 117 | </div> |
| 118 | 118 | |
| 119 | 119 | <span |
| 120 | - class="text-lg" | |
| 121 | 120 | :style="{ |
| 122 | 121 | color: item.fontColor, |
| 123 | - fontSize: (getRatios ? getRatios * item.valueSize : item.valueSize) + 'px', | |
| 122 | + fontSize: (getRatio ? getRatio * item.valueSize : item.valueSize) + 'px', | |
| 124 | 123 | }" |
| 125 | 124 | > |
| 126 | 125 | <span> {{ item.value || 0 }}</span> | ... | ... |