新增传动、炉火写入页面新增修改开关
This commit is contained in:
@@ -166,7 +166,7 @@ export default {
|
||||
this.lastSuccess = lastRes && lastRes.code === 200 ? lastRes.data : null
|
||||
|
||||
// plans / 获取计划
|
||||
const planRes = await listPlan({ status: 'NEW,READY' })
|
||||
const planRes = await listPlan({ status: 'NEW,READY,ONLINE,PRODUCING' })
|
||||
const planList = planRes.rows || []
|
||||
|
||||
const tasks = planList.map(async (p) => {
|
||||
|
||||
@@ -121,30 +121,22 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 不 await:避免阻塞页面渲染;异常会在 Promise 链上抛出到控制台/全局拦截
|
||||
this.reload()
|
||||
},
|
||||
methods: {
|
||||
async reload() {
|
||||
this.loading = true
|
||||
try {
|
||||
const [templateRes, lastRes] = await Promise.all([
|
||||
getSendTemplate('FURNACE_DEFAULT'),
|
||||
getLastSuccess('FURNACE')
|
||||
])
|
||||
const [templateRes, lastRes] = await Promise.all([
|
||||
getSendTemplate('FURNACE_DEFAULT'),
|
||||
getLastSuccess('FURNACE')
|
||||
])
|
||||
|
||||
this.template = templateRes && templateRes.code === 200 ? templateRes.data : null
|
||||
this.lastSuccess = lastRes && lastRes.code === 200 ? lastRes.data : null
|
||||
this.template = templateRes && templateRes.code === 200 ? templateRes.data : null
|
||||
this.lastSuccess = lastRes && lastRes.code === 200 ? lastRes.data : null
|
||||
|
||||
this.initializeForm()
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
this.$message.error('Load data failed')
|
||||
this.template = null
|
||||
this.lastSuccess = null
|
||||
this.form = {}
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
this.initializeForm()
|
||||
this.loading = false
|
||||
},
|
||||
|
||||
initializeForm() {
|
||||
|
||||
Reference in New Issue
Block a user