Przeglądaj źródła

feat: 设备列表新增固件版本展示;调整展示列;

liujia 3 tygodni temu
rodzic
commit
e688d2f

+ 2 - 2
src/views/device/detail/index.vue

@@ -18,7 +18,7 @@
         />
         <div class="pointMap">
           <RadarView
-            :angle="detailState.northAngle"
+            :angle="detailState.northAngle || 0"
             :coordinates="[
               detailState.xxStart,
               detailState.xxEnd,
@@ -233,7 +233,7 @@
         :room-id="deviceRoomId"
         :furniture-items="furnitureItems"
         :sub-region-items="subRegionItems"
-        :angle="detailState.northAngle"
+        :angle="detailState.northAngle ?? 0"
         :online="detailState.online"
         @success="saveConfigSuccess"
       ></deviceConfigDrawer>

+ 28 - 15
src/views/device/list/const.ts

@@ -3,31 +3,44 @@ import type { SelectProps } from 'ant-design-vue'
 // 设备列表表头
 export const columns = [
   {
-    title: '设备ID',
-    dataIndex: 'clientId',
-    key: 'clientId',
+    title: '设备ID / 设备名称',
+    dataIndex: 'info',
+    key: 'info',
     align: 'center',
   },
+  // {
+  //   title: '设备ID',
+  //   dataIndex: 'clientId',
+  //   key: 'clientId',
+  //   align: 'center',
+  // },
+  // {
+  //   title: '设备名称',
+  //   dataIndex: 'devName',
+  //   key: 'devName',
+  //   align: 'center',
+  //   width: 300,
+  // },
   {
-    title: '设备名称',
-    dataIndex: 'devName',
-    key: 'devName',
+    title: '固件版本',
+    key: 'hardware',
+    dataIndex: 'hardware',
     align: 'center',
-    width: 300,
+    width: 200,
   },
   {
-    title: '设备状态',
+    title: '设备状态 / 活动状态',
     key: 'online',
     dataIndex: 'online',
     align: 'center',
   },
-  {
-    title: '活动状态',
-    key: 'activeState',
-    dataIndex: 'activeState',
-    align: 'center',
-    width: 200,
-  },
+  // {
+  //   title: '活动状态',
+  //   key: 'activeState',
+  //   dataIndex: 'activeState',
+  //   align: 'center',
+  //   width: 200,
+  // },
   {
     title: '归属租户',
     key: 'tenantName',

+ 20 - 4
src/views/device/list/index.vue

@@ -72,17 +72,33 @@
         :scroll="{ x: 'max-content' }"
       >
         <template #bodyCell="{ column, record }">
+          <template v-if="column.key === 'info'">
+            <div>{{ record.clientId }}</div>
+            <div>{{ record.devName }}</div>
+            <div></div>
+          </template>
           <template v-if="column.key === 'online'">
-            <a-tag v-if="record.online === 9" :bordered="false" color="#ccc">未激活</a-tag>
+            <!-- <a-tag v-if="record.online === 9" :bordered="false" color="#ccc">未激活</a-tag>
             <a-tag v-if="record.online === 0" :bordered="false" color="red">离线</a-tag>
-            <a-tag v-if="record.online === 1" :bordered="false" color="green">在线</a-tag>
+            <a-tag v-if="record.online === 1" :bordered="false" color="green">在线</a-tag> -->
+
+            <a-space direction="vertical">
+              <a-tag v-if="record.online === 9" :bordered="false" color="#ccc">未激活</a-tag>
+              <a-tag v-if="record.online === 0" :bordered="false" color="red">离线</a-tag>
+              <a-tag v-if="record.online === 1" :bordered="false" color="green">在线</a-tag>
+
+              <a-tag v-if="isToday(record.presenceChangeTime)" :bordered="false" color="green"
+                >有</a-tag
+              >
+              <a-tag v-else :bordered="false" color="#ccc">无</a-tag>
+            </a-space>
           </template>
-          <template v-if="column.key === 'activeState'">
+          <!-- <template v-if="column.key === 'activeState'">
             <a-tag v-if="isToday(record.presenceChangeTime)" :bordered="false" color="green"
               >有</a-tag
             >
             <a-tag v-else :bordered="false" color="#ccc">无</a-tag>
-          </template>
+          </template> -->
           <template v-if="column.key === 'action'">
             <a-button type="link" @click="detailHandler(record.devId, record.clientId)"
               >查看详情</a-button