| | |
| | | <!-- |
| | | * @Date: 2024-01-13 20:46:33 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-21 21:46:33 |
| | | * @LastEditTime: 2024-01-21 22:33:42 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/workshop/device.vue |
| | | --> |
| | | <template> |
| | |
| | | <span class="img-status run" v-if="item.status === 'RUN'">运行</span> |
| | | <span class="img-status standby" v-if="item.status === 'IDLE'">待机</span> |
| | | <span class="img-status alerm" v-if="item.status === 'ALARM'">报警</span> |
| | | <img src="./img/machine.png" alt=""> |
| | | <img :src="pic || devicePng" alt=""> |
| | | </div> |
| | | <ul> |
| | | <li> |
| | |
| | | </template> |
| | | <script> |
| | | import { getRequest, getUrl } from '@/api/Api' |
| | | import devicePng from './img/machine.png' |
| | | export default { |
| | | props: { |
| | | id: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | devicePng, |
| | | care: false, |
| | | item: {} |
| | | } |
| | |
| | | if (this.deviceList.length > 0) { |
| | | try { |
| | | machineName = this.deviceList.find(item => item.machineId === this.id).machineName |
| | | } catch (error) { |
| | | } catch (error) { |
| | | // console.info(error) |
| | | } |
| | | } |
| | | if (this.plantDeviceList.length > 0) { |
| | | try { |
| | | machineName = this.plantDeviceList.find(item => item.machineId === this.id).machineName |
| | | } catch (error) { |
| | | } catch (error) { |
| | | // console.info(error) |
| | | } |
| | | } |
| | | |
| | | if (machineName) { |
| | | return machineName |
| | | } |
| | | return '' |
| | | }, |
| | | pic() { |
| | | let pic = '' |
| | | if (this.info.pic) return this.info.pic |
| | | if (this.deviceList.length > 0) { |
| | | try { |
| | | pic = this.deviceList.find(item => item.machineId === this.id).pic |
| | | } catch (error) { |
| | | } |
| | | } |
| | | if (this.plantDeviceList.length > 0) { |
| | | try { |
| | | pic = this.plantDeviceList.find(item => item.machineId === this.id).pic |
| | | } catch (error) { |
| | | } |
| | | } |
| | | if (pic) { |
| | | return pic |
| | | } |
| | | return '' |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | }</style> |
| | | } |
| | | </style> |