1
This commit is contained in:
parent
50ed889135
commit
cfdceb7799
2
.env
2
.env
@ -2,4 +2,4 @@
|
||||
# 页面标题
|
||||
VITE_APP_TITLE = 'PBL亮灯拣货系统'
|
||||
# 登录信息界面
|
||||
VITE_APP_LOGINFO="沈阳华翔汽车零部件有限公司"
|
||||
VITE_APP_LOGINFO="天津胜维德赫华翔汽车镜有限公司"
|
||||
|
||||
@ -49,9 +49,15 @@ import Dialog from '@/components/Dialog'
|
||||
// 自定义table
|
||||
import MyTable from '@/components/MyTable'
|
||||
|
||||
// 创建 Vue 应用实例
|
||||
const app = createApp(App)
|
||||
|
||||
// 初始化 SignalR 服务,使用环境变量中的 Socket API 地址
|
||||
signalR.init(import.meta.env.VITE_APP_SOCKET_API)
|
||||
|
||||
// 在应用的全局属性中添加 signalR 实例,以便在应用中的任何地方都可以访问
|
||||
app.config.globalProperties.signalr = signalR
|
||||
|
||||
// 全局方法挂载
|
||||
app.config.globalProperties.getConfigKey = getConfigKey
|
||||
app.config.globalProperties.getDicts = getDicts
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<!-- 备料大屏 -->
|
||||
<!-- 叫料大屏 -->
|
||||
<div class="screen">
|
||||
<div class="background"></div>
|
||||
<div class="back" @click="$router.go(-1)">
|
||||
@ -58,6 +58,7 @@
|
||||
<audio ref="audio" :src="audioSrc" preload="none"></audio>
|
||||
<BoardTable></BoardTable>
|
||||
</div>
|
||||
<div>{{ PBL_bom_except_Message }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
@ -74,10 +75,42 @@ import kbTime from './components/kbTime.vue'
|
||||
import BoardTable from './components/BoardTable.vue'
|
||||
/// ================================================
|
||||
|
||||
/// ======================== SignalR ==============================
|
||||
const { proxy } = getCurrentInstance()
|
||||
const PBL_bom_except_Message = ref('')
|
||||
// 定义 SignalR 监听器和清理函数
|
||||
function initSignalR() {
|
||||
const handler = (data) => {
|
||||
console.log('PBL_bom_except', data)
|
||||
if (typeof data === 'string') {
|
||||
PBL_bom_except_Message.value = data
|
||||
} else {
|
||||
console.error('接收到的数据格式无效:', data)
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
proxy.signalr.SR.on('PBL_bom_except', handler)
|
||||
} catch (error) {
|
||||
console.error('初始化 SignalR 连接失败:', error)
|
||||
}
|
||||
|
||||
// 返回一个函数来清理事件监听器
|
||||
return () => {
|
||||
proxy.signalr.SR.off('PBL_bom_except', handler)
|
||||
}
|
||||
}
|
||||
// 在组件挂载时初始化 SignalR 并注册清理函数
|
||||
onMounted(() => {
|
||||
const cleanup = initSignalR()
|
||||
onUnmounted(cleanup)
|
||||
})
|
||||
/// ============================================================
|
||||
|
||||
/// ========================= 仓库信息 =============================
|
||||
import { ref } from 'vue'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const title = ref('叫料看板')
|
||||
|
||||
const title = ref('亮灯拣货看板')
|
||||
import { listStoragelocation } from '@/api/PBL/storagelocation.js'
|
||||
import { SearchShelfLightInfomation } from '@/api/PBL/bigscreen.js'
|
||||
const loading = ref(false)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<!-- 备料大屏 -->
|
||||
<!-- 补料大屏 -->
|
||||
<div class="screen">
|
||||
<div class="background"></div>
|
||||
<div class="back" @click="$router.go(-1)">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user