From 35b1ce8f65b78fcdfdd56481b29ed8d74a8a6621 Mon Sep 17 00:00:00 2001 From: songshankun <songshankun@foxmail.com> Date: 星期五, 03 十一月 2023 17:57:45 +0800 Subject: [PATCH] feat: 进度条背景色,对接设备切换组件接口数据 --- src/views/dashboard/components/DeviceNumberInfo.vue | 43 ++++++++++++++++++++++--------------------- 1 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/views/dashboard/components/DeviceNumberInfo.vue b/src/views/dashboard/components/DeviceNumberInfo.vue index 989f9f2..839a73c 100644 --- a/src/views/dashboard/components/DeviceNumberInfo.vue +++ b/src/views/dashboard/components/DeviceNumberInfo.vue @@ -4,31 +4,28 @@ <div class="device-t">鏈満璁惧缂栫爜</div> <div class="device-b"> <div class="device-info"> - {{ deviceCurrent }} + {{ deviceInfo?.systemDeviceID }} </div> </div> </div> <div class="device-r"> - <div class="device-t">浜戠璁惧缂栫爜</div> - <div class="device-b"> - <div v-for="(item, index) in deviceList" :key="index" class="device-info"> - {{ item.value }} + <el-scrollbar always class="scroller"> + <div class="device-t">浜戠璁惧缂栫爜</div> + <div class="device-b"> + <div v-for="(item, index) in deviceInfo?.deviceIDList" :key="index" class="device-info"> + {{ item }} + </div> </div> - </div> + </el-scrollbar> </div> </div> </template> <script setup lang="ts"> -import { toRefs } from 'vue' -const deviceList = [ - { - value: '123454' - }, - { - value: '54321' - } -] -const deviceCurrent = '456789' +import { useDevicesStore } from '@/stores/devices' +import { storeToRefs } from 'pinia' + +const deviceStore = useDevicesStore() +const { deviceInfo } = storeToRefs(deviceStore) </script> <style scoped lang="scss"> @@ -51,13 +48,17 @@ border: 1px solid $status-border; box-sizing: border-box; border-radius: 4px; - padding: 5px 20px; + padding: 5px 5px 5px 20px; .device-l { - width: 120px; + width: 100px; + height: 100%; float: left; + padding-right: 10px; + border-right: 1px solid $status-border; } .device-r { - width: calc(100% - 130px); + width: calc(100% - 120px); + height: 100%; float: right; } .device-t { @@ -71,8 +72,8 @@ overflow: hidden; } .device-info { - padding: 0px 6px; - font-size: 12px; + padding: 2px 10px; + font-size: 14px; line-height: 20px; background: $status-ready; color: #fff; -- Gitblit v1.8.0