Browse Source

学校设备管理锁定

gzb
wangzhonglu 8 months ago
parent
commit
20aee3c86c

BIN
src/assets/img/locking.png View File


+ 3
- 3
src/views/schoolSection/applicationStrategy/appStrategyManage.vue View File

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

+ 47
- 41
src/views/schoolSection/deviceManage/deviceManage.vue View File

85
           :data="searchForm.list"
85
           :data="searchForm.list"
86
           @on-selection-change="selectionChange"
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
           <template slot-scope="{ row }" slot="onlineSlot">
98
           <template slot-scope="{ row }" slot="onlineSlot">
89
             <!-- 1在线2离线 -->
99
             <!-- 1在线2离线 -->
90
             <div class="action_list">
100
             <div class="action_list">
661
         },
671
         },
662
         {
672
         {
663
           title: "登录账号",
673
           title: "登录账号",
664
-          key: "loginname",
674
+          slot: "loginnameSlot",
665
           align: "center"
675
           align: "center"
666
         },
676
         },
667
         {
677
         {
874
   },
884
   },
875
   methods: {
885
   methods: {
876
     initMemoryDetailEcharts() {
886
     initMemoryDetailEcharts() {
887
+      let getMemoryInfo = this.getMemoryInfo;
877
       let _totalMemory = this.deviceDetailInfo.detail.totalMemory;
888
       let _totalMemory = this.deviceDetailInfo.detail.totalMemory;
878
       let _usedMemory = this.deviceDetailInfo.detail.usedMemory;
889
       let _usedMemory = this.deviceDetailInfo.detail.usedMemory;
879
       let _residueMemory = _totalMemory - _usedMemory;
890
       let _residueMemory = _totalMemory - _usedMemory;
881
         tooltip: {
892
         tooltip: {
882
           trigger: "item",
893
           trigger: "item",
883
           formatter: (params) => {
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
         legend: {
899
         legend: {
923
             center: ["50%", "45%"],
918
             center: ["50%", "45%"],
924
             label: {
919
             label: {
925
               formatter: (params) => {
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
               borderWidth: 1,
924
               borderWidth: 1,
947
               borderRadius: 4,
925
               borderRadius: 4,
962
       memoryEcharts.clear();
940
       memoryEcharts.clear();
963
       memoryEcharts.setOption(options);
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
     initMonitorWS() {
962
     initMonitorWS() {
966
       controlWs.setWs();
963
       controlWs.setWs();
967
       this.getWSEventInfo();
964
       this.getWSEventInfo();
1662
     background-color: #fff;
1659
     background-color: #fff;
1663
     overflow: auto;
1660
     overflow: auto;
1664
     .main_left_title {
1661
     .main_left_title {
1665
-      margin: 10px;
1666
-      padding: 20px 0;
1662
+      margin: 0 10px 10px;
1663
+      padding: 20px 0 14px;
1667
       line-height: 20px;
1664
       line-height: 20px;
1668
       font-size: 16px;
1665
       font-size: 16px;
1669
       text-align: center;
1666
       text-align: center;
1671
       border-bottom: 1px solid #e9f0f9;
1668
       border-bottom: 1px solid #e9f0f9;
1672
     }
1669
     }
1673
     .class_list {
1670
     .class_list {
1674
-      max-height: calc(100% - 82px);
1671
+      max-height: calc(100% - 67px);
1675
       font-size: 14px;
1672
       font-size: 14px;
1676
       line-height: 32px;
1673
       line-height: 32px;
1677
       text-align: center;
1674
       text-align: center;
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
 </style>
2058
 </style>

Loading…
Cancel
Save