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