Browse Source

Merge commit 'bb50e8eef43f62421726c3dc9177d21f68a7c5c7' into gzb

gzb
guozhongbo 8 months ago
parent
commit
57ef75cb23

+ 36
- 5
src/views/schoolSection/deviceManage/breakRuleDevice.vue View File

@@ -113,8 +113,19 @@
113 113
       v-model="logDetailInfo.show"
114 114
       title="违规详情"
115 115
     >
116
-      <div class="table_wrap">
117
-        <Table :columns="detailColumns" :data="logDetailInfo.list">
116
+      <div class="user_info">
117
+        <div>
118
+          当前设备绑定用户:<span>{{ logDetailInfo.user.username }}</span>
119
+        </div>
120
+        <div>
121
+          绑定时间: <span>{{ logDetailInfo.user.createtime }}</span>
122
+        </div>
123
+        <div>
124
+          所属班级:<span>{{ logDetailInfo.user.classname }}</span>
125
+        </div>
126
+      </div>
127
+      <div class="table_wrap_modal">
128
+        <Table :columns="detailColumns" :data="logDetailInfo.events">
118 129
           <template slot-scope="{ row }" slot="doEventSlot">
119 130
             <div>{{ doEventInfo[row.doEvent] }}</div>
120 131
           </template>
@@ -160,7 +171,8 @@ export default {
160 171
       },
161 172
       logDetailInfo: {
162 173
         show: false,
163
-        list: []
174
+        user: {},
175
+        events: []
164 176
       },
165 177
       tableSelection: [],
166 178
       controlMessageInfo: {
@@ -237,7 +249,7 @@ export default {
237 249
         // },
238 250
         {
239 251
           title: "更新时间",
240
-          key: "updatetime",
252
+          key: "createtime",
241 253
           width: 190,
242 254
           align: "center"
243 255
         },
@@ -382,7 +394,8 @@ export default {
382 394
         if (data.code === 0) {
383 395
           this.logDetailInfo = {
384 396
             show: true,
385
-            list: data.obj
397
+            user: data.obj.user || {},
398
+            events: data.obj.events || []
386 399
           };
387 400
         } else {
388 401
           this.$Message.error(data.msg);
@@ -773,4 +786,22 @@ export default {
773 786
     }
774 787
   }
775 788
 }
789
+.table_wrap_modal {
790
+  border: 1px solid #e8eaec;
791
+  border-bottom: none;
792
+}
793
+.user_info {
794
+  display: flex;
795
+  justify-content: flex-start;
796
+  align-items: center;
797
+  margin-bottom: 16px;
798
+  font-size: 16px;
799
+  color: #7c8db5;
800
+  > div {
801
+    margin-right: 20px;
802
+    span {
803
+      color: #2e4276;
804
+    }
805
+  }
806
+}
776 807
 </style>

+ 28
- 16
src/views/schoolSection/deviceManage/deviceManage.vue View File

@@ -313,7 +313,12 @@
313 313
                 <Checkbox
314 314
                   :disabled="true"
315 315
                   class="checked"
316
-                  v-model="row.checked"
316
+                  :value="
317
+                    Boolean(
318
+                      strategyInfo.padViolatesInfo &&
319
+                        strategyInfo.padViolatesInfo[row.violateType]
320
+                    )
321
+                  "
317 322
                 ></Checkbox>
318 323
                 <span
319 324
                   style="display: inline-block; width: 120px; text-align: left"
@@ -321,19 +326,28 @@
321 326
                 >
322 327
               </template>
323 328
               <template slot-scope="{ row }" slot="noticed">
324
-                <Checkbox :disabled="true" class="checked" v-model="row.noticed"
329
+                <Checkbox
330
+                  :disabled="true"
331
+                  class="checked"
332
+                  :value="
333
+                    strategyInfo.padViolatesInfo &&
334
+                    strategyInfo.padViolatesInfo[row.violateType] &&
335
+                    strategyInfo.padViolatesInfo[row.violateType].noticed === 1
336
+                  "
325 337
                   >通知管理员</Checkbox
326 338
                 >
327 339
               </template>
328 340
               <template slot-scope="{ row }" slot="violationHandling">
329
-                <RadioGroup v-model="row.handleMethod">
330
-                  <Radio
331
-                    style="margin-right: 20px"
332
-                    :disabled="true"
333
-                    label="锁定"
334
-                  ></Radio>
335
-                  <Radio :disabled="true" label="恢复出厂设置"></Radio>
336
-                </RadioGroup>
341
+                <CheckboxGroup
342
+                  :value="
343
+                    strategyInfo.padViolatesInfo &&
344
+                    strategyInfo.padViolatesInfo[row.violateType] &&
345
+                    strategyInfo.padViolatesInfo[row.violateType].handleMethod
346
+                  "
347
+                >
348
+                  <Checkbox :disabled="true" label="锁定"></Checkbox>
349
+                  <Checkbox :disabled="true" label="恢复出厂设置"></Checkbox>
350
+                </CheckboxGroup>
337 351
               </template>
338 352
             </Table>
339 353
           </div>
@@ -1209,15 +1223,13 @@ export default {
1209 1223
             this.strategyInfo.pdtypeInfo = pdtypeInfo;
1210 1224
           }
1211 1225
           if (this.strategyInfo.hasviolate) {
1226
+            let padViolatesInfo = {};
1212 1227
             this.strategyInfo.padViolates = res.obj.padViolates;
1213 1228
             this.strategyInfo.padViolates.forEach((item) => {
1214
-              let arr = res.obj.padViolates.filter((v) => {
1215
-                return v.violateType === item.violateType;
1216
-              });
1217
-              item.checked = arr.length > 0 ? true : false;
1218
-              item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
1219
-              item.handleMethod = arr.length > 0 ? arr[0].handleMethod : "";
1229
+              item.handleMethod = item.handleMethod.split(";");
1230
+              padViolatesInfo[item.violateType] = item;
1220 1231
             });
1232
+            this.strategyInfo.padViolatesInfo = padViolatesInfo;
1221 1233
           }
1222 1234
           this.strategyInfo.show = true;
1223 1235
         } else {

Loading…
Cancel
Save