From 169de64f21311711ba7a2595b193b1a3ee055724 Mon Sep 17 00:00:00 2001 From: sheng <905537351@qq.com> Date: Thu, 25 Jun 2026 15:20:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=B5=E6=B1=A0=E5=B7=A5?= =?UTF-8?q?=E5=BA=8F=E9=AA=8C=E8=AF=81=E6=95=B0=E6=8D=AE=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../process-execution/index.vue | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/views/planning-production/production-monitoring/process-execution/index.vue b/src/views/planning-production/production-monitoring/process-execution/index.vue index 6b275f59..40b664cf 100644 --- a/src/views/planning-production/production-monitoring/process-execution/index.vue +++ b/src/views/planning-production/production-monitoring/process-execution/index.vue @@ -168,15 +168,32 @@ export default { syncProcessOptions () { this.form.processOptions = this.processOptions }, + normalizeProcessPayload (res) { + const payload = res && res.code !== undefined && res.data !== undefined ? res.data : res + if ( + payload && + !Array.isArray(payload) && + payload.data && + !Array.isArray(payload.data) && + (payload.data.flow_process || payload.data.data) + ) { + return payload.data + } + return payload || {} + }, + normalizeProcessRows (payload) { + if (Array.isArray(payload)) return payload + return Array.isArray(payload.data) ? payload.data : [] + }, verifyData () { if (!this.ensureBatteryInput()) return this.loading = true verifyBatteryProcessInfo(this.form) .then(res => { - const data = res && res.data ? res.data : res + const data = this.normalizeProcessPayload(res) this.processOptions = data.flow_process || [] this.form.processOptions = this.processOptions - this.tableData = data.data || [] + this.tableData = this.normalizeProcessRows(data) this.showProcess = true }) .finally(() => { @@ -192,8 +209,8 @@ export default { this.loading = true changeBatteryProcess(this.form) .then(res => { - const data = res && res.data ? res.data : res - this.tableData = Array.isArray(data) ? data : (data.data || []) + const data = this.normalizeProcessPayload(res) + this.tableData = this.normalizeProcessRows(data) }) .finally(() => { this.loading = false