| | |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { ref, onMounted } from 'vue'; |
| | | import { ref, onMounted } from 'vue'; |
| | | import { listWcsDevice, writeValue } from '/@/api/wcs/wcsDevice'; |
| | | import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils'; |
| | | import { listWcsPlc } from '/@/api/wcs/wcsPlc'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import setting from '/@/views/device/deviceMonitor/component/setting.vue' |
| | | import { signalR } from './signalR'; |
| | | import { signalR,stopConnection } from './signalR'; |
| | | //连接signalR 监听变更 |
| | | onMounted(async () => { |
| | | signalR.off('PublicPlcDevice'); |
| | |
| | | } |
| | | } |
| | | else if (data.type == 1) { |
| | | stations.value.forEach(list => { |
| | | var index = list.findIndex(s => s.id == data.id); |
| | | lineOptions.value.forEach(s => { |
| | | var index = stations.value[s.id].findIndex(s => s.id == data.id); |
| | | if (index !== -1) { |
| | | list.splice(index, 1, data); |
| | | stations.value[s.id].splice(index, 1, data); |
| | | } |
| | | }); |
| | | if (stationValue.value.id == data.id) { |
| | | stationValue.value = data; |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | |
| | | } |
| | | // 查询操作 |
| | | const handleQuery = async () => { |
| | | var listplc = await listWcsPlc({ type: 1 }); |
| | | const listplc = await listWcsPlc({ type: 1 }); |
| | | lineOptions.value = listplc.data.result; |
| | | lineValue.value = listplc.data.result[0].id; |
| | | var res = await listWcsDevice(); |
| | | const res = await listWcsDevice(); |
| | | listStackingMachineData.value = res.data.result.filter(s => s.type == 0); |
| | | const listConveyorLineData = res.data.result.filter(s => s.type == 1); |
| | | listplc.data.result.forEach(s => { |