| | |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { ref, reactive } from 'vue'; |
| | | import { ref, reactive,onMounted } from 'vue'; |
| | | import { Splitpanes, Pane } from 'splitpanes'; |
| | | import 'splitpanes/dist/splitpanes.css'; |
| | | import { Vue2 } from 'vue-demi'; |
| | | import { listWcsAlarmInfo, resetWcsAlarmInfo } from '/@/api/wcs/wcsAlarmInfo'; |
| | | import { signalR } from './signalR'; |
| | | |
| | | //连接signalR 监听变更 |
| | | onMounted(async () => { |
| | | signalR.off('PublicAlarm'); |
| | | signalR.on('PublicAlarm', (data: any) => { |
| | | console.log(data) |
| | | var listAlarm = tableData.value.filter(t => t.id == data.id); |
| | | if (listAlarm.length == 0) { |
| | | tableData.value.unshift(data) |
| | | tableParams.value.total = tableData.value.length; |
| | | } |
| | | else { |
| | | //如果已经存在就更新数据 |
| | | const index = tableData.value.findIndex(t => t.id == data.id); |
| | | tableData.value.splice(index, 1, data); |
| | | } |
| | | }); |
| | | }); |
| | | //堆垛机数据 |
| | | const cellsDataLine = [ |
| | | { Id: 1, Code: '001', LineCode: '', EndLocat: '', IsShow: 1, IsUse: 0, BoxHeight: 10 }, |