From 4330edfe62916213b616d14a34de0ad23bc7db0e Mon Sep 17 00:00:00 2001 From: wuyouming666 <2265557248@qq.com> Date: 星期二, 28 五月 2024 10:21:11 +0800 Subject: [PATCH] 下片卧式缓存推送数据 --- UI-Project/src/views/Caching/cachingun.vue | 62 +++++++++--------------------- 1 files changed, 19 insertions(+), 43 deletions(-) diff --git a/UI-Project/src/views/Caching/cachingun.vue b/UI-Project/src/views/Caching/cachingun.vue index ba1686f..7b7eec1 100644 --- a/UI-Project/src/views/Caching/cachingun.vue +++ b/UI-Project/src/views/Caching/cachingun.vue @@ -1,10 +1,9 @@ <script setup> -import {Search} from "@element-plus/icons-vue"; -import {reactive} from "vue"; -import {useRouter} from "vue-router" -const router = useRouter() -const adda = ref(false) + + +import { initializeWebSocket } from '@/utils/WebSocketService'; + import { WebSocketHost } from '@/utils/constants'; import request from "@/utils/request" import { ref, onMounted } from "vue"; // import { ref } from 'vue' @@ -58,46 +57,23 @@ console.error('鍙戠敓閿欒:', error); } }; -const gridOptions = reactive({ - border: "full",//琛ㄦ牸鍔犺竟妗� - keepSource: true,//淇濇寔婧愭暟鎹� - align: 'center',//鏂囧瓧灞呬腑 - stripe:true,//鏂戦┈绾� - rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒 - id: 'OrderList', - showFooter: true,//鏄剧ず鑴� - printConfig: {}, - importConfig: {}, - exportConfig: {}, - scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔� - showOverflow:true, - columnConfig: { - resizable: true, - useKey: true - }, - filterConfig: { //绛涢�夐厤缃」 - remote: true - }, - customConfig: { - storage: true - }, - editConfig: { - trigger: 'click', - mode: 'row', - showStatus: true - }, - data: [ - { - 'id': '1', - 'long': '5', - 'wide': '1005', - 'thick': '183.6', - } - ] - -}) + +const socketUrl = `ws://${WebSocketHost}:88/api/unLoadGlass/api/talk/unloadglass`; +// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺 +const handleMessage = (data) => { + + // 鏇存柊 tableData 鐨勬暟鎹� + + tableData.splice(0, tableData.length, ...data.params[0]); + // console.log("鏇存柊鍚庢暟鎹�", tableData); + +}; +onMounted(() => { + + initializeWebSocket(socketUrl, handleMessage); +}); </script> -- Gitblit v1.8.0