Showing
3 changed files
with
35 additions
and
11 deletions
| @@ -217,7 +217,12 @@ | @@ -217,7 +217,12 @@ | ||
| 217 | > | 217 | > |
| 218 | <Slider | 218 | <Slider |
| 219 | ref="sliderEl" | 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 | class="no-drag" | 226 | class="no-drag" |
| 222 | :value="sliderValue" | 227 | :value="sliderValue" |
| 223 | :min="getDesign.minNumber" | 228 | :min="getDesign.minNumber" |
| @@ -244,6 +249,21 @@ | @@ -244,6 +249,21 @@ | ||
| 244 | <style lang="less" scoped> | 249 | <style lang="less" scoped> |
| 245 | :deep(.ant-slider-track) { | 250 | :deep(.ant-slider-track) { |
| 246 | background: var(--slider-color) !important; | 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 | :deep(.ant-spin-container) { | 269 | :deep(.ant-spin-container) { |
| @@ -119,20 +119,25 @@ | @@ -119,20 +119,25 @@ | ||
| 119 | <div v-for="item in percentList" :key="item.id" class="flex flex-col ml-3 mr-3 items-stretch"> | 119 | <div v-for="item in percentList" :key="item.id" class="flex flex-col ml-3 mr-3 items-stretch"> |
| 120 | <div class="flex justify-between"> | 120 | <div class="flex justify-between"> |
| 121 | <div | 121 | <div |
| 122 | - class="text-gray-500 text-sm" | 122 | + class="text-gray-500 flex w-7/10" |
| 123 | :style="{ | 123 | :style="{ |
| 124 | color: item.fontColor, | 124 | color: item.fontColor, |
| 125 | fontSize: (getRatios ? getRatios * item.fontSize : item.fontSize) + 'px', | 125 | fontSize: (getRatios ? getRatios * item.fontSize : item.fontSize) + 'px', |
| 126 | }" | 126 | }" |
| 127 | > | 127 | > |
| 128 | - {{ | 128 | + <!-- {{ |
| 129 | `${item.deviceName} | 129 | `${item.deviceName} |
| 130 | - | 130 | - |
| 131 | ${item.attributeName || item.attribute || '温度'}` | 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 | </div> | 138 | </div> |
| 134 | <span | 139 | <span |
| 135 | - class="text-lg" | 140 | + class="text-lg max-w-3/10" |
| 136 | :style="{ | 141 | :style="{ |
| 137 | color: item.fontColor, | 142 | color: item.fontColor, |
| 138 | fontSize: (getRatios ? getRatios * item.valueSize : item.valueSize) + 'px', | 143 | fontSize: (getRatios ? getRatios * item.valueSize : item.valueSize) + 'px', |
| @@ -89,7 +89,7 @@ | @@ -89,7 +89,7 @@ | ||
| 89 | }; | 89 | }; |
| 90 | 90 | ||
| 91 | useMultipleDataFetch(props, updateFn); | 91 | useMultipleDataFetch(props, updateFn); |
| 92 | - const { getRatios } = useComponentScale(props); | 92 | + const { getRatio } = useComponentScale(props); |
| 93 | </script> | 93 | </script> |
| 94 | 94 | ||
| 95 | <template> | 95 | <template> |
| @@ -105,22 +105,21 @@ | @@ -105,22 +105,21 @@ | ||
| 105 | <SvgIcon | 105 | <SvgIcon |
| 106 | :name="item.icon!" | 106 | :name="item.icon!" |
| 107 | prefix="iconfont" | 107 | prefix="iconfont" |
| 108 | - :size="getRatios ? 30 * getRatios : 30" | 108 | + :size="getRatio ? 30 * getRatio : 30" |
| 109 | :style="{ color: item.iconColor }" | 109 | :style="{ color: item.iconColor }" |
| 110 | /> | 110 | /> |
| 111 | 111 | ||
| 112 | <div | 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 | >{{ item.deviceName + '-' + item.attributeName || '温度' }}</div | 115 | >{{ item.deviceName + '-' + item.attributeName || '温度' }}</div |
| 116 | > | 116 | > |
| 117 | </div> | 117 | </div> |
| 118 | 118 | ||
| 119 | <span | 119 | <span |
| 120 | - class="text-lg" | ||
| 121 | :style="{ | 120 | :style="{ |
| 122 | color: item.fontColor, | 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 | <span> {{ item.value || 0 }}</span> | 125 | <span> {{ item.value || 0 }}</span> |