Эх сурвалжийг харах

feat(device): add online and offline status

Casper Dai 3 жил өмнө
parent
commit
9b07161433

+ 3 - 4
src/views/device/index.vue

@@ -114,7 +114,7 @@
           <el-tag
             v-if="scope.row.activate === 0"
             class="o-tag u-pointer"
-            type="danger"
+            type="warning"
             size="medium"
             @click.stop="toggleActivate(scope.row)"
           >
@@ -123,7 +123,6 @@
           <el-tag
             v-if="scope.row.activate === 1"
             class="o-tag u-pointer"
-            type="warning"
             size="medium"
             @click.stop="toggleActivate(scope.row)"
           >
@@ -132,11 +131,11 @@
           <el-tag
             v-if="scope.row.activate === 2"
             class="o-tag u-pointer"
-            type="success"
+            :type="scope.row.onlineStatus === 1 ? 'success' : 'danger'"
             size="medium"
             @click.stop="toggleActivate(scope.row)"
           >
-            已初始化
+            {{ scope.row.onlineStatus === 1 ? '在线' : '离线' }}
           </el-tag>
         </template>
       </el-table-column>