| <template> | 
|     <div class="wcsAlarmInfo-container"> | 
|         <el-dialog v-model="isShowDialog" :width="800" draggable="" :close-on-click-modal="false"> | 
|             <template #header> | 
|                 <div class="dialog-header"> | 
|                     <span>{{ props.title }}</span> | 
|                 </div> | 
|             </template> | 
|   | 
|             <el-card class="box-card" shadow="hover"> | 
|                 <template #header> | 
|                     <div class="card-header"> | 
|   | 
|                         <div> | 
|                             <span>工位号:</span> | 
|                             <el-select v-model="stationValue" placeholder="请选择" filterable value-key="stationNum" | 
|                                 style="width: 200px;"> | 
|                                 <el-option v-for="item in listStationsData" :key="item.id" :label="item.stationNum" | 
|                                     :value="item"> | 
|                                 </el-option> | 
|                             </el-select> | 
|                             <!-- <el-button style="margin-left: 10px;">自动</el-button> --> | 
|                         </div> | 
|                         <div> | 
|                             <div :class="['lineStatus', stationValue.status ? 'device-status-0' : 'device-status-1']"> | 
|                             </div> | 
|                         </div> | 
|                     </div> | 
|                 </template> | 
|                 <div> | 
|                     <el-form label-position="left" label-width="80px"> | 
|                         <el-row :gutter="25"> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="任务号"> | 
|                                     <el-input v-model="stationValue.taskNo"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="任务类型"> | 
|                                     <el-select clearable="" v-model="stationValue.taskType" placeholder="请选择状态"> | 
|                                         <el-option v-for="(item, index) in dl('TaskTypeEnum')" :key="index" | 
|                                             :value="Number(item.value)" :label="`${item.name} [${item.value}] `" /> | 
|                                     </el-select> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="起始工位"> | 
|                                     <el-input v-model="stationValue.startLocatNo"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="目的工位"> | 
|                                     <el-input v-model="stationValue.endLocatNo"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="PLC"> | 
|                                     <el-input v-model="stationValue.plc"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="WCS"> | 
|                                     <el-input v-model="stationValue.wcs"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|   | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="取货排"> | 
|                                     <el-input v-model="stationValue.pickRow"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="放货排"> | 
|                                     <el-input v-model="stationValue.releaseRow"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="取货列"> | 
|                                     <el-input v-model="stationValue.pickCol"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="放货列"> | 
|                                     <el-input v-model="stationValue.releaseCol"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="取货层"> | 
|                                     <el-input v-model="stationValue.pickStorey"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="放货层"> | 
|                                     <el-input v-model="stationValue.releaseStorey"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="托盘码"> | 
|                                     <el-input v-model="stationValue.palletNo"></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                             <el-col :span="12"> | 
|                                 <el-form-item label="状态"> | 
|                                     <el-input :value="stationValue.status ? '在线' : '离线'" readonly></el-input> | 
|                                 </el-form-item> | 
|                             </el-col> | 
|                         </el-row> | 
|                     </el-form> | 
|                     <div style="text-align: center;margin: 10px;"> | 
|                         <el-button class="button" size="large" @click="write(stationValue)">写入数据</el-button> | 
|                     </div> | 
|                 </div> | 
|                 <!-- <template #footer> | 
|                     <div class="card-footer"> | 
|                         <el-button class="button" size="large">正    转</el-button> | 
|                         <el-button class="button" size="large">反    转</el-button> | 
|                         <el-button class="button" size="large">移栽上升</el-button> | 
|                         <el-button class="button" size="large">移栽下降</el-button> | 
|                     </div> | 
|                 </template> --> | 
|             </el-card> | 
|   | 
|             <!-- <template #footer> | 
|                 <span class="dialog-footer"> | 
|                     <el-button @click="closeDialog" type="primary">关 闭</el-button> | 
|                 </span> | 
|             </template> --> | 
|         </el-dialog> | 
|     </div> | 
| </template> | 
|   | 
| <script lang="ts" setup> | 
| import { ref, defineModel } from 'vue'; | 
| import { writeValue } from '/@/api/wcs/wcsDevice'; | 
| import { ElMessageBox, ElMessage } from 'element-plus'; | 
| import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils'; | 
| const listStationsData = defineModel<any>("listStationsData") | 
| const stationValue = defineModel<any>("stationValue") | 
|   | 
| const props = defineProps({ | 
|     title: { | 
|         type: String, | 
|         default: '', | 
|     } | 
| }); | 
| // const emit = defineEmits<{ (e: "update:listStationsData", value: Array<any>): void, (e: "update:stationValue", value): void }>() | 
|   | 
| // const handlestationChange = () => { | 
| //     emit('update:listStationsData', listStationsData.value); | 
| //     emit('update:stationValue', stationValue); | 
| // }; | 
| const write = async (row: any) => { | 
|     await writeValue(row); | 
|     ElMessage.success('写入成功!'); | 
| } | 
| const isShowDialog = ref(false); | 
|   | 
| const openDialog = async (row: any) => { | 
|     console.log(listStationsData.value); | 
|     debugger; | 
|     isShowDialog.value = true; | 
| }; | 
|   | 
| const closeDialog = () => { | 
|     isShowDialog.value = false; | 
| }; | 
|   | 
| defineExpose({ openDialog }); | 
| </script> | 
|   | 
| <style> | 
| .el-col { | 
|     margin-bottom: 15px; | 
| } | 
|   | 
| .card-header { | 
|     display: flex; | 
|     justify-content: space-between; | 
|     align-items: center; | 
|     color: #fff; | 
|     padding: 10px; | 
|     border-radius: 10px 10px 0 0; | 
| } | 
|   | 
| .card-footer { | 
|     display: flex; | 
|     justify-content: space-between; | 
|     align-items: center; | 
| } | 
|   | 
| .text { | 
|     font-size: 14px; | 
|     color: #fff; | 
| } | 
|   | 
| .item { | 
|     margin-bottom: 18px; | 
| } | 
|   | 
| .box-card { | 
|     width: 100%; | 
|     background: linear-gradient(135deg, #66ccff, #3399ff); | 
|     border-radius: 10px; | 
|     color: #fff; | 
| } | 
|   | 
| .dialog-footer { | 
|     display: flex; | 
|     justify-content: flex-end; | 
|     padding: 10px; | 
| } | 
|   | 
| .lineStatus { | 
|     right: 0; | 
|     height: 20px; | 
|     width: 20px; | 
|     border-radius: 50%; | 
|     background-color: #67C23A; | 
| } | 
|   | 
| .device-status-0 { | 
|     background-color: #67C23A; | 
| } | 
|   | 
| .device-status-1 { | 
|     background-color: red; | 
| } | 
| </style> |