This commit is contained in:
赵正易 2025-01-14 16:27:13 +08:00
parent 50ed889135
commit cfdceb7799
4 changed files with 44 additions and 5 deletions

2
.env
View File

@ -2,4 +2,4 @@
# 页面标题
VITE_APP_TITLE = 'PBL亮灯拣货系统'
# 登录信息界面
VITE_APP_LOGINFO="沈阳华翔汽车零部件有限公司"
VITE_APP_LOGINFO="天津胜维德赫华翔汽车镜有限公司"

View File

@ -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

View File

@ -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)

View File

@ -1,5 +1,5 @@
<template>
<!-- 料大屏 -->
<!-- 料大屏 -->
<div class="screen">
<div class="background"></div>
<div class="back" @click="$router.go(-1)">