1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
| /*
| * @Date: 2024-01-07 22:18:41
| * @LastEditors: Sneed
| * @LastEditTime: 2024-01-16 22:46:42
| * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/mixins/index.js
| */
| import { getUseDpts, getRequest } from '@/api/Api'
| export default {
| data () {
| return {
| deviceList: [], //待选设备
| deviceId: [],
| plantDeviceList: [],
| info: {
| runRate: '',
| cutRate: '',
| alarmRate: '',
| threeShiftRate: '',
| twoShiftRate: '',
| run: '',
| alarm: '',
| stop: '',
| idle: '',
| },
|
| }
| },
| watch: {
| id: {
| handler (val) {
| if(val) {
| getRequest('machineList',{plantId: val}).then(res => {
| debugger
| this.plantDeviceList = res.data.list.map(item => {
| return {
| machineId: item.id,
| machineName: item.machineName
| }
| }) || []
| this.info = {
| runRate: res.data.runRate,
| cutRate: res.data.cutRate,
| alarmRate: res.data.alarmRate,
| threeShiftRate: res.data.threeShiftRate,
| twoShiftRate: res.data.twoShiftRate,
| run: res.data.run,
| alarm: res.data.alarm,
| stop: res.data.stop,
| idle: res.data.idle
| }
| })
| }
| },
| immediate:true
| }
| },
| mounted () {
| getRequest('deviceRemainings').then(res => {
| this.deviceList = res.data || []
| })
| },
| methods: {
| },
| }
|
|