haoxuan
2023-11-07 11fd2edc8643a9b5923d05ff21d18b7d845d4f76
Merge branch 'dev' of http://192.168.5.5:10010/r/web/bulletin-board-style1 into dev
4个文件已修改
46 ■■■■■ 已修改文件
src/api/device.ts 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dashboard/components/DashboardTitle.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dashboard/components/DeviceCheckList.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dashboard/components/DeviceNumberInfo.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/device.ts
@@ -1,3 +1,8 @@
export interface DeviceMap {
  deviceID: string
  deviceName: string
}
export interface Devices {
  /** 本机设备编码 */
  systemDeviceID: string
@@ -7,5 +12,5 @@
  clusterStatus: 'master' | 'slave' | ''
  clusterNodeQuantity: number
  systemDeviceRunSince: number
  deviceIDList: string[]
  deviceList: DeviceMap[]
}
src/views/dashboard/components/DashboardTitle.vue
@@ -2,14 +2,9 @@
  <div class="dashboard-title">
    <div class="title-text">
      智能工作台 —
      <el-popover
        placement="bottom"
        :width="200"
        trigger="click"
        :content="deviceStore?.deviceInfo?.currentDeviceID ?? ''"
      >
      <el-popover placement="bottom" :width="200" trigger="click" :content="currentDeviceName">
        <template #reference>
          <el-text truncated class="device-name">{{ deviceStore?.deviceInfo?.currentDeviceID ?? '' }}</el-text>
          <el-text truncated class="device-name">{{ currentDeviceName }}</el-text>
        </template>
      </el-popover>
      <el-icon size="32" color="#0db7f5" style="margin-left: 20px; cursor: pointer" @click="openDevicesModal">
@@ -73,6 +68,12 @@
// 获取当前设备名
const deviceStore = useDevicesStore()
const currentDeviceName = computed(() => {
  return (
    deviceStore?.deviceInfo?.deviceList?.find((ele) => ele?.deviceID === deviceStore?.deviceInfo?.currentDeviceID)
      ?.deviceName ?? ''
  )
})
// 问题诊断列表
const problemList = computed(() => {
src/views/dashboard/components/DeviceCheckList.vue
@@ -4,18 +4,18 @@
      <template #title>设备选择</template>
      <div class="device-box">
        <el-scrollbar always class="scroller">
          <template v-if="deviceInfo?.deviceIDList?.length">
          <template v-if="deviceInfo?.deviceList?.length">
            <div
              v-for="(item, index) in deviceInfo?.deviceIDList"
              :key="index"
              :class="selectedDevice === item ? 'device-item check-item' : 'device-item'"
              @click="deviceClick(item)"
              v-for="item in deviceInfo?.deviceList"
              :key="item.deviceID"
              :class="selectedDevice === item.deviceID ? 'device-item check-item' : 'device-item'"
              @click="deviceClick(item.deviceID)"
            >
              <div class="item-l">
                <span>{{ item }}</span>
                <!--  {{ item }}-->
                <span>{{ item.deviceID }}</span>
                {{ item.deviceName }}
              </div>
              <div v-if="selectedDevice === item" class="item-r">
              <div v-if="selectedDevice === item.deviceID" class="item-r">
                <el-icon class="item-icon" size="22" color="#00ff00"><CircleCheckFilled /></el-icon>
              </div>
            </div>
src/views/dashboard/components/DeviceNumberInfo.vue
@@ -12,8 +12,12 @@
      <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 v-for="item in deviceInfo?.deviceList" :key="item.deviceID" class="device-info">
            <el-popover placement="top" :width="200" trigger="click" :content="item.deviceID">
              <template #reference>
                <el-text truncated style="color: #fff; max-width: 100px">{{ item.deviceID }}</el-text>
              </template>
            </el-popover>
          </div>
        </div>
      </el-scrollbar>