| | |
| | | <div class="workstation-transfer-config"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="扫码间隔(ms)"> |
| | | <el-form-item label="缓冲判定时间(秒)"> |
| | | <el-input-number |
| | | v-model="config.scanIntervalMs" |
| | | :min="1000" |
| | | :max="60000" |
| | | :step="1000" |
| | | v-model="transferDelaySeconds" |
| | | :min="5" |
| | | :max="120" |
| | | :step="1" |
| | | style="width: 100%;" |
| | | /> |
| | | <span class="form-tip">定时查询最近扫码玻璃的时间间隔,默认10000ms(10秒)</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="缓冲判定时间(ms)"> |
| | | <el-input-number |
| | | v-model="config.transferDelayMs" |
| | | :min="5000" |
| | | :max="120000" |
| | | :step="1000" |
| | | style="width: 100%;" |
| | | /> |
| | | <span class="form-tip">30秒内无新玻璃扫码则判定为最后一片,默认30000ms(30秒)</span> |
| | | <span class="form-tip">30秒内无新玻璃扫码则判定为最后一片,默认30秒</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监控间隔(ms)"> |
| | | <el-form-item label="玻璃间隙(mm)"> |
| | | <el-input-number |
| | | v-model="config.monitorIntervalMs" |
| | | :min="1000" |
| | | :max="60000" |
| | | :step="1000" |
| | | v-model="config.glassGap" |
| | | :min="0" |
| | | :max="1000" |
| | | :step="10" |
| | | style="width: 100%;" |
| | | /> |
| | | <span class="form-tip">批次处理监控间隔,默认使用scanIntervalMs</span> |
| | | <span class="form-tip">多块玻璃之间的物理间隔空隙,默认200mm</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监控间隔(秒)"> |
| | | <el-input-number |
| | | v-model="monitorIntervalSeconds" |
| | | :min="1" |
| | | :max="60" |
| | | :step="1" |
| | | style="width: 100%;" |
| | | /> |
| | | <span class="form-tip">批次处理监控间隔,默认使用扫码间隔</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="位置值(格)"> |
| | | <el-form-item label="卧转立编号"> |
| | | <el-input-number |
| | | v-model="config.inPosition" |
| | | :min="0" |
| | |
| | | :step="1" |
| | | style="width: 100%;" |
| | | /> |
| | | <span class="form-tip">写入PLC的inPosition值(格子)</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="自动确认"> |
| | | <el-switch v-model="config.autoAck" /> |
| | | <span class="form-tip">是否自动确认MES发送的玻璃信息</span> |
| | | <span class="form-tip">写入PLC的inPosition字段,表示卧转立编号</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | |
| | | // 配置数据 |
| | | const config = ref({ |
| | | scanIntervalMs: 10000, |
| | | transferDelayMs: 30000, |
| | | vehicleCapacity: 6000, |
| | | glassGap: 200, |
| | | monitorIntervalMs: 10000, |
| | | workLine: null, |
| | | inPosition: null, |
| | | autoAck: true |
| | | inPosition: null |
| | | }) |
| | | |
| | | // 时间字段(秒)- 用于前端显示和输入 |
| | | const transferDelaySeconds = ref(30) |
| | | const monitorIntervalSeconds = ref(10) |
| | | |
| | | // 监听props变化 |
| | | watch(() => props.modelValue, (newVal) => { |
| | | if (newVal && Object.keys(newVal).length > 0) { |
| | | config.value = { |
| | | scanIntervalMs: newVal.scanIntervalMs ?? 10000, |
| | | transferDelayMs: newVal.transferDelayMs ?? 30000, |
| | | vehicleCapacity: newVal.vehicleCapacity ?? 6000, |
| | | monitorIntervalMs: newVal.monitorIntervalMs ?? newVal.scanIntervalMs ?? 10000, |
| | | glassGap: newVal.glassGap ?? 200, |
| | | monitorIntervalMs: newVal.monitorIntervalMs ?? 10000, |
| | | workLine: newVal.workLine ?? null, |
| | | inPosition: newVal.inPosition ?? null, |
| | | autoAck: newVal.autoAck ?? true |
| | | inPosition: newVal.inPosition ?? null |
| | | } |
| | | // 将毫秒转换为秒用于显示 |
| | | transferDelaySeconds.value = (config.value.transferDelayMs ?? 30000) / 1000 |
| | | monitorIntervalSeconds.value = (config.value.monitorIntervalMs ?? 10000) / 1000 |
| | | } |
| | | }, { immediate: true, deep: true }) |
| | | |
| | | // 监听config变化,同步到父组件 |
| | | watch(config, (newVal) => { |
| | | emit('update:modelValue', { ...newVal }) |
| | | // 监听秒字段变化,转换为毫秒并更新config |
| | | watch(transferDelaySeconds, (val) => { |
| | | config.value.transferDelayMs = Math.round(val * 1000) |
| | | emit('update:modelValue', { ...config.value }) |
| | | }) |
| | | |
| | | watch(monitorIntervalSeconds, (val) => { |
| | | config.value.monitorIntervalMs = Math.round(val * 1000) |
| | | emit('update:modelValue', { ...config.value }) |
| | | }) |
| | | |
| | | // 监听config其他字段变化,同步到父组件 |
| | | watch(() => [ |
| | | config.value.vehicleCapacity, |
| | | config.value.glassGap, |
| | | config.value.workLine, |
| | | config.value.inPosition |
| | | ], () => { |
| | | emit('update:modelValue', { ...config.value }) |
| | | }, { deep: true }) |
| | | </script> |
| | | |