Parcourir la source

学校设备管理锁定

gzb
wangzhonglu il y a 8 mois
Parent
révision
20aee3c86c

BIN
src/assets/img/locking.png Voir le fichier


+ 3
- 3
src/views/schoolSection/applicationStrategy/appStrategyManage.vue Voir le fichier

@@ -377,8 +377,8 @@ export default {
377 377
     background-color: #fff;
378 378
     overflow: auto;
379 379
     .main_left_title {
380
-      margin: 10px;
381
-      padding: 20px 0;
380
+      margin: 0 10px 10px;
381
+      padding: 20px 0 14px;
382 382
       line-height: 20px;
383 383
       font-size: 16px;
384 384
       text-align: center;
@@ -386,7 +386,7 @@ export default {
386 386
       border-bottom: 1px solid #e9f0f9;
387 387
     }
388 388
     .class_list {
389
-      max-height: calc(100% - 82px);
389
+      max-height: calc(100% - 67px);
390 390
       font-size: 14px;
391 391
       line-height: 32px;
392 392
       text-align: center;

+ 47
- 41
src/views/schoolSection/deviceManage/deviceManage.vue Voir le fichier

@@ -85,6 +85,16 @@
85 85
           :data="searchForm.list"
86 86
           @on-selection-change="selectionChange"
87 87
         >
88
+          <template slot-scope="{ row }" slot="loginnameSlot">
89
+            <!-- lockState锁定状态0未锁定1已锁定 -->
90
+            <div class="lock_img_box">
91
+              {{ row.loginname
92
+              }}<img
93
+                v-if="row.lockState === 1"
94
+                src="@/assets/img/locking.png"
95
+              />
96
+            </div>
97
+          </template>
88 98
           <template slot-scope="{ row }" slot="onlineSlot">
89 99
             <!-- 1在线2离线 -->
90 100
             <div class="action_list">
@@ -661,7 +671,7 @@ export default {
661 671
         },
662 672
         {
663 673
           title: "登录账号",
664
-          key: "loginname",
674
+          slot: "loginnameSlot",
665 675
           align: "center"
666 676
         },
667 677
         {
@@ -874,6 +884,7 @@ export default {
874 884
   },
875 885
   methods: {
876 886
     initMemoryDetailEcharts() {
887
+      let getMemoryInfo = this.getMemoryInfo;
877 888
       let _totalMemory = this.deviceDetailInfo.detail.totalMemory;
878 889
       let _usedMemory = this.deviceDetailInfo.detail.usedMemory;
879 890
       let _residueMemory = _totalMemory - _usedMemory;
@@ -881,24 +892,8 @@ export default {
881 892
         tooltip: {
882 893
           trigger: "item",
883 894
           formatter: (params) => {
884
-            let memoryInfo = {
885
-              value: params.value,
886
-              unit: "B"
887
-            };
888
-            if (memoryInfo.value / 1000 < 1000) {
889
-              memoryInfo.value =
890
-                Math.floor((memoryInfo.value / 1000) * 100) / 100;
891
-              memoryInfo.unit = "KB";
892
-            } else if (memoryInfo.value / 1000 / 1000 < 1000) {
893
-              memoryInfo.value =
894
-                Math.floor((memoryInfo.value / 1000 / 1000) * 100) / 100;
895
-              memoryInfo.unit = "MB";
896
-            } else {
897
-              memoryInfo.value =
898
-                Math.floor((memoryInfo.value / 1000 / 1000 / 1000) * 100) / 100;
899
-              memoryInfo.unit = "GB";
900
-            }
901
-            return `${params.name}:${memoryInfo.value}${memoryInfo.unit}`;
895
+            let memoryInfo = getMemoryInfo(params.value);
896
+            return `${params.name}:${memoryInfo.size}${memoryInfo.unit}`;
902 897
           }
903 898
         },
904 899
         legend: {
@@ -923,25 +918,8 @@ export default {
923 918
             center: ["50%", "45%"],
924 919
             label: {
925 920
               formatter: (params) => {
926
-                let memoryInfo = {
927
-                  value: params.value,
928
-                  unit: "B"
929
-                };
930
-                if (memoryInfo.value / 1000 < 1000) {
931
-                  memoryInfo.value =
932
-                    Math.floor((memoryInfo.value / 1000) * 100) / 100;
933
-                  memoryInfo.unit = "KB";
934
-                } else if (memoryInfo.value / 1000 / 1000 < 1000) {
935
-                  memoryInfo.value =
936
-                    Math.floor((memoryInfo.value / 1000 / 1000) * 100) / 100;
937
-                  memoryInfo.unit = "MB";
938
-                } else {
939
-                  memoryInfo.value =
940
-                    Math.floor((memoryInfo.value / 1000 / 1000 / 1000) * 100) /
941
-                    100;
942
-                  memoryInfo.unit = "GB";
943
-                }
944
-                return `${params.name}\n${memoryInfo.value}${memoryInfo.unit}`;
921
+                let memoryInfo = getMemoryInfo(params.value);
922
+                return `${params.name}\n${memoryInfo.size}${memoryInfo.unit}`;
945 923
               },
946 924
               borderWidth: 1,
947 925
               borderRadius: 4,
@@ -962,6 +940,25 @@ export default {
962 940
       memoryEcharts.clear();
963 941
       memoryEcharts.setOption(options);
964 942
     },
943
+    getMemoryInfo(memorySize) {
944
+      let memoryInfo = {
945
+        size: memorySize,
946
+        unit: "B"
947
+      };
948
+      if (memoryInfo.size / 1000 < 1000) {
949
+        memoryInfo.size = Math.floor((memoryInfo.size / 1000) * 100) / 100;
950
+        memoryInfo.unit = "KB";
951
+      } else if (memoryInfo.size / 1000 / 1000 < 1000) {
952
+        memoryInfo.size =
953
+          Math.floor((memoryInfo.size / 1000 / 1000) * 100) / 100;
954
+        memoryInfo.unit = "MB";
955
+      } else {
956
+        memoryInfo.size =
957
+          Math.floor((memoryInfo.size / 1000 / 1000 / 1000) * 100) / 100;
958
+        memoryInfo.unit = "GB";
959
+      }
960
+      return memoryInfo;
961
+    },
965 962
     initMonitorWS() {
966 963
       controlWs.setWs();
967 964
       this.getWSEventInfo();
@@ -1662,8 +1659,8 @@ export default {
1662 1659
     background-color: #fff;
1663 1660
     overflow: auto;
1664 1661
     .main_left_title {
1665
-      margin: 10px;
1666
-      padding: 20px 0;
1662
+      margin: 0 10px 10px;
1663
+      padding: 20px 0 14px;
1667 1664
       line-height: 20px;
1668 1665
       font-size: 16px;
1669 1666
       text-align: center;
@@ -1671,7 +1668,7 @@ export default {
1671 1668
       border-bottom: 1px solid #e9f0f9;
1672 1669
     }
1673 1670
     .class_list {
1674
-      max-height: calc(100% - 82px);
1671
+      max-height: calc(100% - 67px);
1675 1672
       font-size: 14px;
1676 1673
       line-height: 32px;
1677 1674
       text-align: center;
@@ -2049,4 +2046,13 @@ export default {
2049 2046
     }
2050 2047
   }
2051 2048
 }
2049
+.lock_img_box {
2050
+  display: flex;
2051
+  justify-content: center;
2052
+  align-items: center;
2053
+  img {
2054
+    margin-left: 4px;
2055
+    width: 18px;
2056
+  }
2057
+}
2052 2058
 </style>

Chargement…
Annuler
Enregistrer