Pārlūkot izejas kodu

轨迹信息展示

zhangjie 1 gadu atpakaļ
vecāks
revīzija
11e0bc330d

+ 34 - 2
src/features/examwork/StudentManagement/StudentTrackRecord.vue

@@ -68,8 +68,28 @@
                       >[ip变动]</b
                     >
                   </div>
-                  <p v-if="log.desc">{{ log.desc }}</p>
-                  <p>
+                  <template v-if="log.desc">
+                    <div
+                      v-if="log.type === 'MESSAGE' && log.msgType === 'AUDIO'"
+                    >
+                      <audio
+                        class="qm-audio"
+                        :src="log.content"
+                        controls
+                      ></audio>
+                    </div>
+                    <template
+                      v-else-if="
+                        log.type === 'MESSAGE' && log.msgType === 'MEDIA'
+                      "
+                    >
+                      <p v-for="(cont, index) in log.desc" :key="index">
+                        {{ cont }}
+                      </p>
+                    </template>
+                    <p v-else>{{ log.desc }}</p>
+                  </template>
+                  <p v-if="log.endTime">
                     时间段:
                     <span v-if="log.startTime">{{ log.startTime }} ~ </span>
                     <span>{{ log.endTime }}</span>
@@ -306,6 +326,18 @@ export default {
         let info = { ...item };
         info.endTime = formatDate(dateTimeFormat, new Date(info.createTime));
         info.viewType = statusTypeMap[info.type] || "common";
+        // 文字消息提示
+        if (info.msgType) {
+          info.type = "MESSAGE";
+          info.title = info.msgTypeStr;
+          if (info.msgType === "MEDIA") {
+            info.endTime = null;
+            info.desc = info.content.split("\r\n");
+          } else {
+            info.desc = info.content;
+          }
+          return info;
+        }
         const content = info.info.split(/【|】/);
         if (content.length === 3) {
           info.title = content[1];

+ 34 - 2
src/features/invigilation/OnlinePatrol/PatrolWarningDetail.vue

@@ -162,8 +162,28 @@
                       >[ip变动]</b
                     >
                   </div>
-                  <p v-if="log.desc">{{ log.desc }}</p>
-                  <p>
+                  <template v-if="log.desc">
+                    <div
+                      v-if="log.type === 'MESSAGE' && log.msgType === 'AUDIO'"
+                    >
+                      <audio
+                        class="qm-audio"
+                        :src="log.content"
+                        controls
+                      ></audio>
+                    </div>
+                    <template
+                      v-else-if="
+                        log.type === 'MESSAGE' && log.msgType === 'MEDIA'
+                      "
+                    >
+                      <p v-for="(cont, index) in log.desc" :key="index">
+                        {{ cont }}
+                      </p>
+                    </template>
+                    <p v-else>{{ log.desc }}</p>
+                  </template>
+                  <p v-if="log.endTime">
                     时间段:
                     <span v-if="log.startTime">{{ log.startTime }} ~ </span>
                     <span>{{ log.endTime }}</span>
@@ -353,6 +373,18 @@ export default {
         let info = { ...item };
         info.endTime = formatDate(dateTimeFormat, new Date(info.createTime));
         info.viewType = statusTypeMap[info.type] || "common";
+        // 文字消息提示
+        if (info.msgType) {
+          info.type = "MESSAGE";
+          info.title = info.msgTypeStr;
+          if (info.msgType === "MEDIA") {
+            info.endTime = null;
+            info.desc = info.content.split("\r\n");
+          } else {
+            info.desc = info.content;
+          }
+          return info;
+        }
         const content = info.info.split(/【|】/);
         if (content.length === 3) {
           info.title = content[1];

+ 34 - 2
src/features/invigilation/RealtimeMonitoring/WarningDetail.vue

@@ -247,8 +247,28 @@
                       >[ip变动]</b
                     >
                   </div>
-                  <p v-if="log.desc">{{ log.desc }}</p>
-                  <p>
+                  <template v-if="log.desc">
+                    <div
+                      v-if="log.type === 'MESSAGE' && log.msgType === 'AUDIO'"
+                    >
+                      <audio
+                        class="qm-audio"
+                        :src="log.content"
+                        controls
+                      ></audio>
+                    </div>
+                    <template
+                      v-else-if="
+                        log.type === 'MESSAGE' && log.msgType === 'MEDIA'
+                      "
+                    >
+                      <p v-for="(cont, index) in log.desc" :key="index">
+                        {{ cont }}
+                      </p>
+                    </template>
+                    <p v-else>{{ log.desc }}</p>
+                  </template>
+                  <p v-if="log.endTime">
                     时间段:
                     <span v-if="log.startTime">{{ log.startTime }} ~ </span>
                     <span>{{ log.endTime }}</span>
@@ -585,6 +605,18 @@ export default {
         let info = { ...item };
         info.endTime = formatDate(dateTimeFormat, new Date(info.createTime));
         info.viewType = statusTypeMap[info.type] || "common";
+        // 文字消息提示
+        if (info.msgType) {
+          info.type = "MESSAGE";
+          info.title = info.msgTypeStr;
+          if (info.msgType === "MEDIA") {
+            info.endTime = null;
+            info.desc = info.content.split("\r\n");
+          } else {
+            info.desc = info.content;
+          }
+          return info;
+        }
         const content = info.info.split(/【|】/);
         if (content.length === 3) {
           info.title = content[1];

+ 5 - 0
src/styles/global.css

@@ -112,3 +112,8 @@ body {
 input[type="file"] {
   overflow: hidden;
 }
+.qm-audio {
+  height: 20px;
+  display: inline-block;
+  vertical-align: top;
+}