邓洁 : 修改大屏样式

This commit is contained in:
邓洁
2023-12-08 22:12:37 +08:00
parent 28ff50193c
commit a0b12dcbdc
7 changed files with 114 additions and 77 deletions

View File

@@ -7,6 +7,7 @@
</div>
<el-button type="primary" @click="initWebSocket">确认连接</el-button>
<el-button type="primary" @click="closeSocket">关闭连接</el-button>
<el-button type="primary" @click="handleClear" style="float: right">清除</el-button>
<div class="socket-box">
<div v-for="item in data" ref="child">
<div v-if="item.type == 3">
@@ -20,7 +21,10 @@
</div>
</div>
</div>
<el-button type="primary" @click="handleClear" style="float: right">清除</el-button>
<div style="display: flex">
<el-input v-model="number" placeholder="请输入" clearable></el-input>
<el-button type="primary" @click="handleSend" style="float: right">发送</el-button>
</div>
</div>
<div class="logout">
<el-button @click="handleLogout">退出登录</el-button>
@@ -35,6 +39,7 @@ import {useAuthStore} from '@/store/userstore.js'
const router = useRouter()
const authStore = useAuthStore()
const serialNumber = ref('')
const number = ref('')
let send = {
type: "ping"
}
@@ -54,8 +59,16 @@ watch(
}
);
let socket = reactive('')
const handleSend=()=>{
console.log('JSON.stringify(number.value))',JSON.stringify(number.value))
let data = {
type: 1,
cmd : number.value
}
socket.send(JSON.stringify(data))
}
const initWebSocket = () => {
// let wsUrl = `ws://192.168.31.175:8000/wstunnel/debug/${token}/${serialNumber.value}`
// let wsUrl = `ws://192.168.31.175:9000/debug/${token}/${serialNumber.value}`
let wsUrl = `ws://web-tunnel.feashow.com/api/wstunnel/debug/${token}/${serialNumber.value}`
console.log(wsUrl)
socket = new WebSocket(wsUrl)