| | |
| | | <!-- |
| | | * @Date: 2024-01-05 23:47:53 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-16 00:19:18 |
| | | * @LastEditTime: 2024-01-16 01:03:35 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/Map/Map.vue |
| | | --> |
| | | <template> |
| | |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | :title="添加设备" |
| | | title="添加设备" |
| | | :close-on-click-modal="false" |
| | | width="20%" |
| | | :visible.sync="addStatus"> |
| | |
| | | id (val) { |
| | | if (!val) { |
| | | this.map = [] |
| | | }else { |
| | | // getRequest('machineList',{plantId: val}).then(res => { |
| | | // this.plantDeviceList = res.list.map(item => { |
| | | // return { |
| | | // machineId: item.id, |
| | | // machineName: item.machineName |
| | | // } |
| | | // }) || [] |
| | | // }) |
| | | } |
| | | }, |
| | | currentMap: { |
| | |
| | | contextmenu(e) { |
| | | console.log(e) |
| | | if(this.status ===2) return |
| | | if (!this.range.x) return |
| | | if (this.range.x === undefined) return |
| | | // if (this.range.x !=='') return |
| | | e.preventDefault() |
| | | e.stopPropagation() |
| | |
| | | addDevice (e,v) { |
| | | e.stopPropagation() |
| | | this.addStatus = true |
| | | this.deviceId = '' |
| | | this.currentAdd = v |
| | | }, |
| | | del () { |
| | |
| | | <!-- |
| | | * @Date: 2024-01-10 22:28:38 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-14 15:04:42 |
| | | * @LastEditTime: 2024-01-16 00:45:48 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/Map/addMachine.vue |
| | | --> |
| | | <template> |
| | | <div class="map-add"> |
| | | <div class="map-add-item"> |
| | | <span>机床名称</span> |
| | | <el-input class="value" v-model="addInfo.name"></el-input> |
| | | <el-input class="value" v-model="addInfo.machineName"></el-input> |
| | | </div> |
| | | <div class="map-add-item"> |
| | | <span>机床</span> |
| | |
| | | workshopList: [], |
| | | accountList: [], |
| | | addInfo: { |
| | | name: '', |
| | | machineName: '', |
| | | id: '', |
| | | ip: '', |
| | | port: '', |
| | |
| | | <!-- |
| | | * @Date: 2024-01-13 20:46:33 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-16 00:32:38 |
| | | * @LastEditTime: 2024-01-16 01:08:39 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/workshop/device.vue |
| | | --> |
| | | <template> |
| | | <div class="device-item"> |
| | | <el-checkbox class="care" v-model="care" @change="change"></el-checkbox> |
| | | <p>{{ name }}</p> |
| | | <p>{{ machineName }}</p> |
| | | <div class="device-item-box"> |
| | | <div class="img"> |
| | | <span class="img-status" v-if="item.status === 'STOP'">停机</span> |
| | |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | name () { |
| | | let name = '' |
| | | let arr = [...this.deviceList,...this.plantDeviceList] |
| | | arr.find(item => { |
| | | if(item.machineId=== this.id) { |
| | | name = item.machineName |
| | | } |
| | | }) |
| | | return machineName |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | care: false, |
| | |
| | | }, |
| | | cycleCount () { |
| | | return this.info.cycleCount || 0 |
| | | }, |
| | | machineName () { |
| | | try { |
| | | let arr = [...this.deviceList,...this.plantDeviceList] |
| | | return arr.find(item => item.machineId=== this.id).machineName |
| | | } catch (error) { |
| | | return this.id |
| | | } |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | /* |
| | | * @Date: 2024-01-07 22:18:41 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-16 00:36:21 |
| | | * @LastEditTime: 2024-01-16 01:02:46 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/mixins/index.js |
| | | */ |
| | | import { getUseDpts, getRequest } from '@/api/Api' |
| | |
| | | id: { |
| | | handler (val) { |
| | | if(val) { |
| | | debugger |
| | | getRequest('machineList',{plantId: val}).then(res => { |
| | | this.plantDeviceList = res.list.map(item => { |
| | | this.plantDeviceList = res.data.list.map(item => { |
| | | return { |
| | | machineId: item.id, |
| | | machineName: item.name |
| | | machineName: item.machineName |
| | | } |
| | | }) || [] |
| | | }) |