From 48afd71b25a91320c1855aace0303bb490ded161 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期四, 22 五月 2025 15:27:38 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/watch/watch.html |   90 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/src/main/webapp/views/watch/watch.html b/src/main/webapp/views/watch/watch.html
new file mode 100644
index 0000000..9fe40a2
--- /dev/null
+++ b/src/main/webapp/views/watch/watch.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html lang="en">
+
+	<head>
+		<meta charset="UTF-8">
+		<title>绯荤粺鐩戣</title>
+		<link rel="stylesheet" href="../../static/wcs/css/element.css">
+		<script type="text/javascript" src="../../static/wcs/js/jquery/jquery-3.3.1.min.js"></script>
+		<script type="text/javascript" src="../../static/wcs/js/common.js"></script>
+		<script type="text/javascript" src="../../static/wcs/js/vue.min.js"></script>
+		<script type="text/javascript" src="../../static/wcs/js/element.js"></script>
+		<style>
+			.container {
+				display: flex;
+				flex-wrap: wrap;
+				justify-content: space-around;
+			}
+
+			.box-card {
+				width: 480px;
+				margin: 10px;
+			}
+		</style>
+	</head>
+
+	<body>
+		<div id="app">
+			<div class="container" v-if="watchData != undefined && watchData != null && watchData.length > 0">
+				<el-card class="box-card" v-for="item in watchData" :key="item">
+					<div>
+						{{ item.key }}
+					</div>
+					<div>
+						{{ item.msg }}
+					</div>
+				</el-card>
+			</div>
+			<div v-else>
+				<el-empty description="鏃犲紓甯�"></el-empty>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				el: '#app',
+				data: {
+					watchData: [],
+				},
+				created() {
+					this.init()
+				},
+				methods: {
+					init() {
+						let that = this;
+						this.getWatchData()
+
+						setInterval(() => {
+							that.getWatchData()
+						}, 1000);
+					},
+					getWatchData() {
+						let that = this;
+						$.ajax({
+							url: baseUrl + "/watch/findAll",
+							headers: {
+								'token': localStorage.getItem('token')
+							},
+							data: {},
+							dataType: 'json',
+							contentType: 'application/json;charset=UTF-8',
+							method: 'GET',
+							success: function(res) {
+								if (res.code == 200) {
+									that.watchData = res.data;
+								} else if (res.code === 403) {
+									top.location.href = baseUrl + "/";
+								} else {
+									that.$message({
+										message: res.msg,
+										type: 'error'
+									});
+								}
+							}
+						});
+					},
+				}
+			})
+		</script>
+	</body>
+
+</html>

--
Gitblit v1.9.1