From be1b1eec0440c4956684fe73756c1e3666cea5e3 Mon Sep 17 00:00:00 2001 From: gaosp <gaosp> Date: 星期二, 16 一月 2024 22:31:30 +0800 Subject: [PATCH] update style --- src/mixins/index.js | 63 ++++++++++++++++++++++++------- 1 files changed, 49 insertions(+), 14 deletions(-) diff --git a/src/mixins/index.js b/src/mixins/index.js index 23de7e4..acbfad1 100644 --- a/src/mixins/index.js +++ b/src/mixins/index.js @@ -1,28 +1,63 @@ /* * @Date: 2024-01-07 22:18:41 * @LastEditors: Sneed - * @LastEditTime: 2024-01-07 22:21:40 + * @LastEditTime: 2024-01-16 01:10:15 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/mixins/index.js */ +import { getUseDpts, getRequest } from '@/api/Api' export default { data () { return { - workshopIds: [], - sectionIds: [], - workshopIds: [] + deviceList: [], //寰呴�夎澶� + deviceId: [], + plantDeviceList: [], + info: { + runRate: '', + cutRate: '', + alarmRate: '', + threeShiftRate: '', + twoShiftRate: '', + run: '', + alarm: '', + stop: '', + idle: '', + }, + } }, - create () { - this.getListinit() + watch: { + id: { + handler (val) { + if(val) { + debugger + getRequest('machineList',{plantId: val}).then(res => { + 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 + } + }) + } + } + } + }, + mounted () { + getRequest('deviceRemainings').then(res => { + this.deviceList = res.data || [] + }) }, methods: { - getListinit () { - this.$http.get('/machine/workshopList').then(res => { - - }) - this.$http.get('/machine/protocolList').then(res => { - - }) - } }, } \ No newline at end of file -- Gitblit v1.9.3