chao há 3 semanas atrás
pai
commit
eaf81eda38

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
docs/FangSong_Regular.json


BIN
docs/assets/cloud-Db585Q37.png


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
docs/assets/index-BT22PddN.css


Diff do ficheiro suprimidas por serem muito extensas
+ 4 - 0
docs/assets/index-BtbW-Rxj.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 4
docs/assets/index-CPqp-Pcg.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
docs/assets/index-DOHW_Xwx.css


+ 14 - 14
docs/index.html

@@ -1,14 +1,14 @@
-<!doctype html>
-<html lang="en">
-  <head>
-    <meta charset="UTF-8" />
-    <link rel="icon" type="image/svg+xml" href="./vite.svg" />
-    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>vue3-dashboard</title>
-    <script type="module" crossorigin src="./assets/index-CPqp-Pcg.js"></script>
-    <link rel="stylesheet" crossorigin href="./assets/index-DOHW_Xwx.css">
-  </head>
-  <body>
-    <div id="app"></div>
-  </body>
-</html>
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <link rel="icon" type="image/svg+xml" href="./vite.svg" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>AI 校园智慧控制中心</title>
+    <script type="module" crossorigin src="./assets/index-BtbW-Rxj.js"></script>
+    <link rel="stylesheet" crossorigin href="./assets/index-BT22PddN.css">
+  </head>
+  <body>
+    <div id="app"></div>

+  </body>
+</html>

+ 45 - 0
package-lock.json

@@ -19,6 +19,7 @@
         "vue-socket.io": "^3.0.10"
         "vue-socket.io": "^3.0.10"
       },
       },
       "devDependencies": {
       "devDependencies": {
+        "@types/markdown-it": "^14.1.2",
         "@types/three": "^0.177.0",
         "@types/three": "^0.177.0",
         "@vitejs/plugin-vue": "^5.0.4",
         "@vitejs/plugin-vue": "^5.0.4",
         "less": "^4.2.0",
         "less": "^4.2.0",
@@ -928,6 +929,12 @@
       "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==",
       "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==",
       "dev": true
       "dev": true
     },
     },
+    "node_modules/@types/linkify-it": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz",
+      "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==",
+      "dev": true
+    },
     "node_modules/@types/lodash": {
     "node_modules/@types/lodash": {
       "version": "4.17.17",
       "version": "4.17.17",
       "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.17.tgz",
       "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.17.tgz",
@@ -941,6 +948,22 @@
         "@types/lodash": "*"
         "@types/lodash": "*"
       }
       }
     },
     },
+    "node_modules/@types/markdown-it": {
+      "version": "14.1.2",
+      "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz",
+      "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==",
+      "dev": true,
+      "dependencies": {
+        "@types/linkify-it": "^5",
+        "@types/mdurl": "^2"
+      }
+    },
+    "node_modules/@types/mdurl": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz",
+      "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==",
+      "dev": true
+    },
     "node_modules/@types/stats.js": {
     "node_modules/@types/stats.js": {
       "version": "0.17.4",
       "version": "0.17.4",
       "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.4.tgz",
       "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.4.tgz",
@@ -2803,6 +2826,12 @@
       "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==",
       "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==",
       "dev": true
       "dev": true
     },
     },
+    "@types/linkify-it": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz",
+      "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==",
+      "dev": true
+    },
     "@types/lodash": {
     "@types/lodash": {
       "version": "4.17.17",
       "version": "4.17.17",
       "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.17.tgz",
       "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.17.tgz",
@@ -2816,6 +2845,22 @@
         "@types/lodash": "*"
         "@types/lodash": "*"
       }
       }
     },
     },
+    "@types/markdown-it": {
+      "version": "14.1.2",
+      "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz",
+      "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==",
+      "dev": true,
+      "requires": {
+        "@types/linkify-it": "^5",
+        "@types/mdurl": "^2"
+      }
+    },
+    "@types/mdurl": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz",
+      "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==",
+      "dev": true
+    },
     "@types/stats.js": {
     "@types/stats.js": {
       "version": "0.17.4",
       "version": "0.17.4",
       "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.4.tgz",
       "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.4.tgz",

+ 1 - 0
package.json

@@ -20,6 +20,7 @@
     "vue-socket.io": "^3.0.10"
     "vue-socket.io": "^3.0.10"
   },
   },
   "devDependencies": {
   "devDependencies": {
+    "@types/markdown-it": "^14.1.2",
     "@types/three": "^0.177.0",
     "@types/three": "^0.177.0",
     "@vitejs/plugin-vue": "^5.0.4",
     "@vitejs/plugin-vue": "^5.0.4",
     "less": "^4.2.0",
     "less": "^4.2.0",

+ 1 - 1
src/components/BuildingInfoPanel.vue

@@ -21,7 +21,7 @@ type BuildingInfo = {
 
 
 const info = ref<Partial<BuildingInfo>>({});
 const info = ref<Partial<BuildingInfo>>({});
 
 
-const show = (buildingInfo) => {
+const show = (buildingInfo:any) => {
   info.value = buildingInfo;
   info.value = buildingInfo;
   visible.value = true;
   visible.value = true;
 };
 };

+ 58 - 64
src/pages/Entry/components/MapChart/index.vue

@@ -12,7 +12,6 @@ const mouse = new THREE.Vector2();
 const fontLoader = new FontLoader();
 const fontLoader = new FontLoader();
 const container = ref<HTMLDivElement | null>(null);
 const container = ref<HTMLDivElement | null>(null);
 const width = 600;
 const width = 600;
-const height = 400;
 const clickableBuildings: any = []; // 存储所有可点击建筑物
 const clickableBuildings: any = []; // 存储所有可点击建筑物
 
 
 // 场景变量
 // 场景变量
@@ -23,7 +22,7 @@ let controls: any = null;
 let animateId: any = null;
 let animateId: any = null;
 
 
 // 初始化场景
 // 初始化场景
-const initScene = (width: number, height: number) => {
+const initScene = (width: number) => {
   // 设置渲染器
   // 设置渲染器
   renderer.setSize(width, width * 2 / 3);
   renderer.setSize(width, width * 2 / 3);
   renderer.setClearColor(0x87ceeb); // 天空蓝色背景
   renderer.setClearColor(0x87ceeb); // 天空蓝色背景
@@ -535,24 +534,24 @@ const createEnvironment = () => {
 };
 };
 
 
 // 创建树木
 // 创建树木
-const createTree = (x: any, y: any, z: any) => {
-  // 树干
-  const trunkGeometry = new THREE.CylinderGeometry(0.3, 0.5, 2, 8);
-  const trunkMaterial = new THREE.MeshStandardMaterial({ color: 0x8B4513 });
-  const trunk = new THREE.Mesh(trunkGeometry, trunkMaterial);
-  trunk.position.set(x, y + 1, z);
-  trunk.castShadow = true;
-
-  // 树冠
-  const leavesGeometry = new THREE.SphereGeometry(2, 8, 8);
-  const leavesMaterial = new THREE.MeshStandardMaterial({ color: 0x228B22 });
-  const leaves = new THREE.Mesh(leavesGeometry, leavesMaterial);
-  leaves.position.set(x, y + 3, z);
-  leaves.castShadow = true;
-
-  scene.add(trunk);
-  scene.add(leaves);
-};
+// const createTree = (x: any, y: any, z: any) => {
+//   // 树干
+//   const trunkGeometry = new THREE.CylinderGeometry(0.3, 0.5, 2, 8);
+//   const trunkMaterial = new THREE.MeshStandardMaterial({ color: 0x8B4513 });
+//   const trunk = new THREE.Mesh(trunkGeometry, trunkMaterial);
+//   trunk.position.set(x, y + 1, z);
+//   trunk.castShadow = true;
+
+//   // 树冠
+//   const leavesGeometry = new THREE.SphereGeometry(2, 8, 8);
+//   const leavesMaterial = new THREE.MeshStandardMaterial({ color: 0x228B22 });
+//   const leaves = new THREE.Mesh(leavesGeometry, leavesMaterial);
+//   leaves.position.set(x, y + 3, z);
+//   leaves.castShadow = true;
+
+//   scene.add(trunk);
+//   scene.add(leaves);
+// };
 // 创建椭圆操场
 // 创建椭圆操场
 const createEllipticalPlayground = (x: any, y: any, z: any) => {
 const createEllipticalPlayground = (x: any, y: any, z: any) => {
 
 
@@ -597,7 +596,7 @@ const createEllipticalPlayground = (x: any, y: any, z: any) => {
   const innerTrackPoints = innerTrackGeometry.getPoints(100);
   const innerTrackPoints = innerTrackGeometry.getPoints(100);
 
 
   // 合并点集形成跑道形状
   // 合并点集形成跑道形状
-  const allPoints = trackPoints.concat(innerTrackPoints.reverse());
+  // const allPoints = trackPoints.concat(innerTrackPoints.reverse());
 
 
   // 创建跑道形状
   // 创建跑道形状
   const trackShape = new THREE.Shape();
   const trackShape = new THREE.Shape();
@@ -674,7 +673,6 @@ const createBasketballCourt = (x: any, y: any, z: any, rotationY = 0) => {
   // 篮球场尺寸 (调整为20x10)
   // 篮球场尺寸 (调整为20x10)
   const courtLength = 20;
   const courtLength = 20;
   const courtWidth = 10;
   const courtWidth = 10;
-  const lineWidth = 0.2;
 
 
   // 创建篮球场地板
   // 创建篮球场地板
   const courtGeometry = new THREE.PlaneGeometry(courtLength, courtWidth);
   const courtGeometry = new THREE.PlaneGeometry(courtLength, courtWidth);
@@ -838,70 +836,66 @@ const onWindowResize = () => {
   camera.updateProjectionMatrix();
   camera.updateProjectionMatrix();
 
 
   let containerWidth = width;
   let containerWidth = width;
-  let containerHeight = height;
   if (container.value) {
   if (container.value) {
     containerWidth = container.value.clientWidth || width;
     containerWidth = container.value.clientWidth || width;
-    containerHeight = container.value.clientHeight || height;
   }
   }
   renderer.setSize(containerWidth, containerWidth * (2 / 3));
   renderer.setSize(containerWidth, containerWidth * (2 / 3));
 };
 };
 // 添加鼠标移动事件处理
 // 添加鼠标移动事件处理
-const onDocumentMouseMove = (event: any) => {
-  mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
-  mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
-
-  raycaster.setFromCamera(mouse, camera);
-  const intersects = raycaster.intersectObjects(scene.children, true);
-
-  // 重置所有建筑物的悬停状态
-  scene.traverse((obj: any) => {
-    if (obj.userData.isBuilding && obj.userData.originalColor) {
-      obj.material.color.setHex(obj.userData.originalColor);
-    }
-  });
-
-  if (intersects.length > 0) {
-    const hoveredObject = intersects[0].object;
-    if (hoveredObject.userData.isBuilding) {
-      // 存储原始颜色
-      if (!hoveredObject.userData.originalColor) {
-        hoveredObject.userData.originalColor = hoveredObject.material.color.getHex();
-      }
-      // 设置悬停颜色
-      hoveredObject.material.color.setHex(0xaaaaaa);
-
-      // 更改鼠标指针
-      if (container.value) {
-        container.value.style.cursor = 'pointer';
-      }
-      return;
-    }
-  }
-  if (container.value) {
-    container.value.style.cursor = 'default';
-  }
-};
+// const onDocumentMouseMove = (event: any) => {
+//   mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
+//   mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
+
+//   raycaster.setFromCamera(mouse, camera);
+//   const intersects = raycaster.intersectObjects(scene.children, true);
+
+//   // 重置所有建筑物的悬停状态
+//   scene.traverse((obj: any) => {
+//     if (obj.userData.isBuilding && obj.userData.originalColor) {
+//       obj.material.color.setHex(obj.userData.originalColor);
+//     }
+//   });
+
+//   if (intersects.length > 0) {
+//     const hoveredObject = intersects[0].object;
+//     if (hoveredObject.userData.isBuilding) {
+//       // 存储原始颜色
+//       if (!hoveredObject.userData.originalColor) {
+//         hoveredObject.userData.originalColor = hoveredObject.material.color.getHex();
+//       }
+//       // 设置悬停颜色
+//       hoveredObject.material.color.setHex(0xaaaaaa);
+
+//       // 更改鼠标指针
+//       if (container.value) {
+//         container.value.style.cursor = 'pointer';
+//       }
+//       return;
+//     }
+//   }
+//   if (container.value) {
+//     container.value.style.cursor = 'default';
+//   }
+// };
 
 
 onMounted(() => {
 onMounted(() => {
 
 
   // 获取容器宽高
   // 获取容器宽高
   let containerWidth = width;
   let containerWidth = width;
-  let containerHeight = height;
   if (container.value) {
   if (container.value) {
     containerWidth = container.value.clientWidth || width;
     containerWidth = container.value.clientWidth || width;
-    containerHeight = container.value.clientHeight || height;
-    initScene(containerWidth, containerHeight);
+    initScene(containerWidth);
     animate();
     animate();
   }
   }
 
 
   window.addEventListener('resize', onWindowResize);
   window.addEventListener('resize', onWindowResize);
   window.addEventListener('click', handleClick, false);
   window.addEventListener('click', handleClick, false);
-  window.addEventListener('mousemove', onDocumentMouseMove, false);
+  // window.addEventListener('mousemove', onDocumentMouseMove, false);
 });
 });
 
 
 onBeforeUnmount(() => {
 onBeforeUnmount(() => {
   window.removeEventListener('resize', onWindowResize);
   window.removeEventListener('resize', onWindowResize);
-  window.removeEventListener('mousemove', onDocumentMouseMove, false);
+  // window.removeEventListener('mousemove', onDocumentMouseMove, false);
   window.removeEventListener('click', handleClick, false);
   window.removeEventListener('click', handleClick, false);
   cancelAnimationFrame(animateId);
   cancelAnimationFrame(animateId);
   if (container.value && container.value.contains(renderer.domElement)) {
   if (container.value && container.value.contains(renderer.domElement)) {

+ 2 - 21
src/pages/Entry/components/RealtimeData/index.vue

@@ -5,7 +5,7 @@ import useMultipleWebSockets from "../../../../service/socket/socket.ts"
 import useSockets from "../../../../hooks/useSockets.ts";
 import useSockets from "../../../../hooks/useSockets.ts";
 
 
 
 
-const { sockets, connectionStatus, connected } = useSockets();
+const { sockets, connected } = useSockets();
 declare global {
 declare global {
   interface Window {
   interface Window {
     tableData?: any;
     tableData?: any;
@@ -19,7 +19,6 @@ const editCocoPiVisible = ref(false);
 const CocoPiData = ref<any>({});
 const CocoPiData = ref<any>({});
 const socketUrl = ref<string[]>([])
 const socketUrl = ref<string[]>([])
 const problem = ref("")
 const problem = ref("")
-const codeRef = ref<any>(null)
 
 
 onMounted(async () => {
 onMounted(async () => {
   getData()
   getData()
@@ -64,7 +63,7 @@ const onSubmit = async () => {
     return;
     return;
   }
   }
 
 
-  const { sockets, send, sendData, status } = await useMultipleWebSockets([`wss://${CocoPiData.value.ip}:5678`])
+  const { send, sendData, status } = await useMultipleWebSockets([`wss://${CocoPiData.value.ip}:5678`])
   setTimeout(() => {
   setTimeout(() => {
     if (status[`wss://${CocoPiData.value.ip}:5678`] === "connected") {
     if (status[`wss://${CocoPiData.value.ip}:5678`] === "connected") {
       let obj = {
       let obj = {
@@ -105,24 +104,6 @@ const handleDelete = (data: any) => {
 }
 }
 
 
 
 
-function insert_operating_record(rawData: string) {
-  // 事件流数据通常以 "data: " 开头,以 "\n\n" 分隔事件
-  const events = rawData.split('\n\n').filter(Boolean);
-
-  events.forEach(event => {
-    // 移除 "data: " 前缀并解析JSON(如果是JSON数据)
-    if (event.startsWith('data: ')) {
-      const data = event.substring(6).trim();
-      try {
-        const parsedData = JSON.parse(data);
-        console.log('Parsed event:', parsedData);
-        // 在这里处理解析后的数据
-      } catch (e) {
-        console.log('Raw event data:', data);
-      }
-    }
-  });
-}
 
 
 const copyCode = () => {
 const copyCode = () => {
   // sockets.value['wss://192.168.232.46:5678'].send(`echo close > /root/socket.txt`)
   // sockets.value['wss://192.168.232.46:5678'].send(`echo close > /root/socket.txt`)

+ 5 - 6
src/pages/Entry/components/homeRight/right.vue

@@ -81,11 +81,8 @@ import { ref, onMounted, watch } from 'vue';
 import { v4 as uuidv4 } from "uuid";
 import { v4 as uuidv4 } from "uuid";
 import { fetchEventSource } from '@microsoft/fetch-event-source';
 import { fetchEventSource } from '@microsoft/fetch-event-source';
 import MarkdownIt from 'markdown-it';
 import MarkdownIt from 'markdown-it';
-import useSockets from "../../../../hooks/useSockets.ts";
-import sendBtnImg from '../../../../assets/images/send_btn.svg'
 
 
 
 
-const { sockets, connectionStatus, connected } = useSockets();
 const problem = ref('')
 const problem = ref('')
 const codeData = ref('')
 const codeData = ref('')
 const generatedUuid = ref('')
 const generatedUuid = ref('')
@@ -95,11 +92,11 @@ const userId = ref('')
 
 
 onMounted(() => {
 onMounted(() => {
     userId.value = localStorage.getItem('userId') || uuidv4()
     userId.value = localStorage.getItem('userId') || uuidv4()
-    getAiAgentChat(userId.value)
+    getAiAgentChat()
 
 
 })
 })
 
 
-const getAiAgentChat = async (userId: any) => {
+const getAiAgentChat = async () => {
     fetch('https://gpt4.cocorobo.cn/get_agent_chat', {
     fetch('https://gpt4.cocorobo.cn/get_agent_chat', {
         method: 'POST',
         method: 'POST',
         headers: {
         headers: {
@@ -223,7 +220,7 @@ const insert_operating_record = async (data: any) => {
 }
 }
 
 
 
 
-watch(() => datas.value, (newValue, oldValue) => {
+watch(() => datas.value, (newValue) => {
     if (newValue) {
     if (newValue) {
         setTimeout(() => {
         setTimeout(() => {
             console.log(document.getElementsByClassName("assistant-chat")[0].scrollHeight);
             console.log(document.getElementsByClassName("assistant-chat")[0].scrollHeight);
@@ -401,6 +398,8 @@ watch(() => datas.value, (newValue, oldValue) => {
     font-size: 16px !important;
     font-size: 16px !important;
     outline: none;
     outline: none;
     line-height: 24px;
     line-height: 24px;
+    color: #fff;
+    font-weight: bold;
 }
 }
 
 
 .chat-input button {
 .chat-input button {

+ 1 - 2
src/pages/Entry/index.vue

@@ -1,10 +1,9 @@
 <script setup lang="ts">
 <script setup lang="ts">
-import { onMounted, ref } from "vue";
+import { ref } from "vue";
 // import { $get } from "@src/service/request";
 // import { $get } from "@src/service/request";
 // import cityCodeMap from "@assets/JSON/cityCode.json";
 // import cityCodeMap from "@assets/JSON/cityCode.json";
 import MapChart from "./components/MapChart/index.vue";
 import MapChart from "./components/MapChart/index.vue";
 import RealtimeData from "./components/RealtimeData/index.vue";
 import RealtimeData from "./components/RealtimeData/index.vue";
-import TimerCount from "./components/TimerCount/index.vue";
 import Right from "./components/homeRight/right.vue"
 import Right from "./components/homeRight/right.vue"
 
 
 // interface WeatherData {
 // interface WeatherData {

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff