| | |
| | | <el-table-column prop="alarmName" label="描述" align="center"></el-table-column> |
| | | <el-table-column prop="stationNum" label="位置" align="center"></el-table-column> |
| | | <el-table-column prop="alarmTime" label="时间" align="center"></el-table-column> |
| | | <!-- <el-table-column label="操作" width="80" align="center" fixed="right" show-overflow-tooltip=""> |
| | | <template #default="scope"> |
| | | <el-button icon="ele-Check" size="small" text="" type="primary" |
| | | @click="topUpAlarm(scope.row)">恢复</el-button> |
| | | </template> |
| | | </el-table-column> --> |
| | | </el-table> |
| | | <el-pagination v-model:currentPage="tableParams.page" v-model:page-size="tableParams.pageSize" |
| | | :total="tableParams.total" :page-sizes="[10, 20, 50, 100, 200, 500]" size="small" background="" |
| | |
| | | import { ref, reactive, onMounted, computed } from 'vue'; |
| | | import 'splitpanes/dist/splitpanes.css'; |
| | | import { listWcsAlarmInfo, resetWcsAlarmInfo } from '/@/api/wcs/wcsAlarmInfo'; |
| | | import { WriteInfo } from '/@/api/wcs/wcsDevice'; |
| | | import { signalR } from './signalR'; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import { cellsDataLine, cellsDataOne, cellsDataTwo, cellsDataThree } from './data'; |
| | | import { auth } from '/@/utils/authFunction'; |
| | | import Index from '../deviceInfo/index.vue'; |
| | | |
| | | //连接signalR 监听变更 |
| | | onMounted(async () => { |
| | | signalR.off('PublicAlarm'); |
| | | signalR.on('PublicAlarm', (dataArray: any) => { |
| | | dataArray.forEach(data => { |
| | | console.log(data); |
| | | // 更新 tableData |
| | | const index = tableData.value.findIndex(t => t.id == data.id); |
| | | |
| | | if (index === -1 && data.status == 1) { |
| | | // 如果不存在,添加新数据 |
| | | tableData.value.unshift(data); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 更新输送线数据 |
| | | updateCellData(cellsDataOne.value, data); |
| | | updateCellData(cellsDataTwo.value, data); |
| | |
| | | function updateCellData(cellsData: any[], data: any) { |
| | | const foundCell = cellsData.find(cell => cell.Code === data.stationNum); |
| | | if (foundCell) { |
| | | //一个点位有一个信息报警就触发报警,取消报警需要确认这个点位没有任何报警信息 |
| | | if (data.status == 1) { |
| | | foundCell.IsUse = 4; |
| | | } |
| | | else { |
| | | else if (tableData.value.findIndex(c => c.stationNum == foundCell.Code) == -1) { |
| | | foundCell.IsUse = 0; |
| | | } |
| | | } |
| | |
| | | cellsData.value = cellsDataThree.value; |
| | | } |
| | | } |
| | | |
| | | // const write = async (type: string,row: any) => { |
| | | // if (floorStates.value.isPlain1 == false) { |
| | | // row.Layer = 1; |
| | | // }else if(floorStates.value.isPlain2 == false){ |
| | | // row.Layer = 2; |
| | | // } |
| | | // else if(floorStates.value.isPlain3 == false){ |
| | | // row.Layer = 3; |
| | | // } |
| | | // row.TypeName = type; |
| | | |
| | | // console.log(row); |
| | | // var res = await WriteInfo(row); |
| | | // console.log(res.data.result); |
| | | // ElMessage.success(res.data.result); |
| | | // } |
| | | //报警恢复 |
| | | const topUpAlarm = async (row: any) => { |
| | | ElMessageBox.confirm(`确定要报警恢复任务吗?`, "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(async () => { |
| | | var param = Object.assign(row); |
| | | console.log("row.stationNum:"+row.stationNum); |
| | | console.log("layer.value:"+layer.value); |
| | | var data = { |
| | | LocatNo: row.stationNum,//工位 |
| | | Layer: layer.value,//楼层 |
| | | } |
| | | |
| | | var res = await WriteInfo(data); |
| | | console.log("res.data.result:"+res.data.result); |
| | | // await topUpWcsTask(param); |
| | | // handleQuery(); |
| | | // handleQuery2(); |
| | | // ElMessage.success("报警恢复失败:" + res.data.result); |
| | | }) |
| | | .catch(() => { }); |
| | | |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style scoped> |