优化物料编码无需点击
This commit is contained in:
@@ -57,8 +57,9 @@
|
||||
<div class="form-item">
|
||||
<a-form-item label="物料编码">
|
||||
<a-input
|
||||
ref="materialCodeInput"
|
||||
v-model="formData.inputMaterialCode"
|
||||
placeholder="请点击此处确保光标闪烁,并使用扫码枪扫描物料编码"
|
||||
placeholder="请点击此处确保光标闪烁,且输入法为英文状态,使用扫码枪扫描物料编码"
|
||||
@keydown="handleKeyDown"
|
||||
@input="handleMaterialCodeChange"
|
||||
/>
|
||||
@@ -309,6 +310,8 @@ const cameraStatus = ref<'connected' | 'connecting' | 'disconnected' | 'error'>(
|
||||
|
||||
// 视频元素引用
|
||||
const cameraVideo = ref<HTMLVideoElement | null>(null)
|
||||
// 物料编码输入框引用
|
||||
const materialCodeInput = ref<any>(null)
|
||||
|
||||
// FLV播放器实例
|
||||
let player: any = null
|
||||
@@ -552,6 +555,13 @@ onMounted(async () => {
|
||||
// 添加时间戳参数,避免浏览器缓存
|
||||
imgData.imgUrl = `${imgData.baseUrl}?t=${Date.now()}`
|
||||
}, 1000)
|
||||
|
||||
// 页面加载后自动聚焦到物料编码输入框
|
||||
nextTick(() => {
|
||||
if (materialCodeInput.value) {
|
||||
materialCodeInput.value.focus()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 组件卸载时
|
||||
@@ -872,6 +882,13 @@ const handleBackToFirst = () => {
|
||||
|
||||
// 离开称重页面时关闭WebSocket连接
|
||||
closeWebSocket()
|
||||
|
||||
// 回到第一步后自动聚焦到物料编码输入框
|
||||
nextTick(() => {
|
||||
if (materialCodeInput.value) {
|
||||
materialCodeInput.value.focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 计算重量
|
||||
|
||||
Reference in New Issue
Block a user