From 8c3f98d5240355920cfcbbe6dc96f2c079764dfc Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期二, 23 七月 2024 18:50:16 +0800
Subject: [PATCH] Merge branch 'phpsMonitor' of http://47.97.1.152:5880/r/private into phpsMonitor
---
Monitor-APP/pages.json | 13 +++++-
Monitor-APP/pages/webSocket.vue | 58 +++++++++++++++++++++++++++++
Monitor-APP/pages/home/home.vue | 6 +-
3 files changed, 72 insertions(+), 5 deletions(-)
diff --git a/Monitor-APP/pages.json b/Monitor-APP/pages.json
index 54a5551..0fe11fd 100644
--- a/Monitor-APP/pages.json
+++ b/Monitor-APP/pages.json
@@ -55,10 +55,19 @@
"titleNView": false
}
}
+ },
+ {
+ "path" : "pages/webSocket",
+ "style" :
+ {
+ "navigationBarTitleText": "webSocket",
+ "enablePullDownRefresh": false
+ }
+
}
-
- ],
+
+ ],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
diff --git a/Monitor-APP/pages/home/home.vue b/Monitor-APP/pages/home/home.vue
index de5d0d0..3b8679d 100644
--- a/Monitor-APP/pages/home/home.vue
+++ b/Monitor-APP/pages/home/home.vue
@@ -233,12 +233,12 @@
<swiper-item class="swiper-item" v-for="(item,i) in swiperList" :key="i">
<view style="width: 30%;">{{i+1}} / {{swiperList.length}}</view>
<!-- <view style="width: 30%;">鏂欏彿: {{item.matnr}}</view> -->
- <view style="width: 40%;">鍚嶇О: {{item.maknx}}</view>
- <view style="width: 30%;">璁㈠崟: {{item.orderNo}}</view>
+ <view style="width: 40%;">鏂欏彿: {{item.matnr}}</view>
+ <view style="width: 30%;">澶囨敞: {{item.orderNo}}</view>
<view style="width: 30%;">鍑哄簱: {{item.count}} / 鎬绘暟: {{item.total}}</view>
- <view style="width: 40%;">瑙勬牸: {{item.specs}}</view>
+ <view style="width: 40%;">鍚嶇О: {{item.maknx}}</view>
<view style="width: 30%;">鎵瑰彿: {{item.batch}}</view>
diff --git a/Monitor-APP/pages/webSocket.vue b/Monitor-APP/pages/webSocket.vue
new file mode 100644
index 0000000..582962c
--- /dev/null
+++ b/Monitor-APP/pages/webSocket.vue
@@ -0,0 +1,58 @@
+<template>
+ <view>
+
+ </view>
+</template>
+
+<script>
+ export default {
+ data() {
+ return {
+ ws: null,
+ }
+ },
+ onShow() {
+ this.init()
+ },
+ methods: {
+ init() {
+ this.ws = new WebSocket("ws://127.0.0.1:9090/pswcs/console/websocket")
+ this.ws.onopen = this.webSocketOnOpen
+ this.ws.onerror = this.webSocketOnError
+ this.ws.onmessage = this.webSocketOnMessage
+ this.ws.onclose = this.webSocketClose
+ // console.log(this.ws)
+
+ },
+ webSocketOnOpen(e) {
+ console.log("open");
+
+ this.sendWs(JSON.stringify({
+ url: 'getTvConfig',
+ data: '1'
+ }))
+ },
+ webSocketOnError(e) {
+ console.log(e);
+ },
+ webSocketOnMessage(e) {
+ const result = JSON.parse(e.data);
+ if (result.url == "getTvConfig") {
+ console.log(result.result)
+ }
+ },
+ webSocketClose(e) {
+ console.log("close");
+ },
+ sendWs(message) {
+ if (this.ws.readyState == WebSocket.OPEN) {
+ this.ws.send(message)
+ }
+ }
+ }
+ }
+</script>
+
+<style>
+
+</style>
--
Gitblit v1.9.1