修复采购和集成酸轧细节

This commit is contained in:
2026-06-29 10:18:26 +08:00
parent 59dad19296
commit 8c7cce90ba
18 changed files with 326 additions and 482 deletions

View File

@@ -96,11 +96,6 @@
<!-- 成品厚度偏差 -->
<template v-if="hasGauge">
<div class="chart-title">
成品厚度偏差
<span class="chart-subtitle">产出厚度 - {{ rv('EXIT_THICK') }} [mm]</span>
</div>
<div ref="chartThick1" class="rpt-chart" />
<div class="chart-title">末架出口厚度 [mm]</div>
<div ref="chartThick4" class="rpt-chart" />
</template>
@@ -186,15 +181,24 @@ function calcYRange(vals) {
return { min: parseFloat((min - pad).toFixed(4)), max: parseFloat((max + pad).toFixed(4)) }
}
function lineOpt(title, xData, series, yName) {
const allVals = series.flatMap(s => s.data)
const range = calcYRange(allVals)
function lineOpt(title, xData, series, yName, decimals, xStep) {
const isValueX = xStep != null
const yVals = isValueX
? series.flatMap(s => s.data.map(d => Array.isArray(d) ? d[1] : d))
: series.flatMap(s => s.data)
const range = calcYRange(yVals)
const tooltipExtra = decimals != null
? { valueFormatter: v => v == null ? '—' : Number(v).toFixed(decimals) }
: {}
const xAxisCfg = isValueX
? { type: 'value', name: '带钢长度[m]', min: 0, interval: xStep, nameTextStyle: { fontSize: 9 }, axisLabel: { fontSize: 9 } }
: { type: 'category', data: xData, name: '带钢长度[m]', nameTextStyle: { fontSize: 9 }, axisLabel: { fontSize: 9, interval: 'auto' } }
return {
title: { text: title, textStyle: { fontSize: 12, fontWeight: 'normal', color: '#1a365d' }, top: 4, left: 8 },
legend: { top: 4, right: 6, textStyle: { fontSize: 9 }, itemWidth: 12, itemHeight: 8 },
tooltip: { trigger: 'axis', confine: true },
tooltip: { trigger: 'axis', confine: true, ...tooltipExtra },
grid: { top: 38, bottom: 28, left: 10, right: 10, containLabel: true },
xAxis: { type: 'category', data: xData, name: '带钢长度[m]', nameTextStyle: { fontSize: 9 }, axisLabel: { fontSize: 9, interval: 'auto' } },
xAxis: xAxisCfg,
yAxis: { type: 'value', name: yName, nameTextStyle: { fontSize: 9 }, axisLabel: { fontSize: 9 }, min: range.min, max: range.max },
series: series.map((s, i) => ({
name: s.name, type: 'line', smooth: false, symbol: 'none',
@@ -386,39 +390,21 @@ export default {
const posLim = parseFloat(getV(this.row, 'EXIT_POS_DEV')) || 0.03
const negLim = Math.abs(parseFloat(getV(this.row, 'EXIT_NEG_DEV'))) || 0.03
// THICK1 偏差图 (1架出口 vs 目标)
const t1 = colData(rows, 'THICK1')
const t1Ref = colData(rows, 'THICK1REF')
if (t1.some(v => v != null)) {
const c = this.initChart('chartThick1', 180)
if (c) {
const series = [{ name: '1架出口厚度', data: t1, color: PALETTE[0] }]
if (t1Ref.some(v => v != null)) series.push({ name: '目标', data: t1Ref, color: '#909399', dash: true })
if (target) {
const up = rows.map(() => parseFloat((target + posLim).toFixed(4)))
const lo = rows.map(() => parseFloat((target - negLim).toFixed(4)))
series.push({ name: '上限', data: up, color: '#F56C6C', dash: true })
series.push({ name: '下限', data: lo, color: '#67C23A', dash: true })
}
c.setOption(lineOpt('1架出口厚度 [mm]', x, series, 'mm'))
}
}
// THICK5 末架出口
// THICK5 末架出口value 轴,横坐标步长 500
const xNum = rows.map(r => { const v = getRowVal(r, 'XLOCATION'); return v == null ? null : parseFloat(v) })
const t4 = colData(rows, 'THICK5')
const t4Ref = colData(rows, 'THICK5REF')
const t4Pairs = t4.map((y, i) => [xNum[i], y])
if (t4.some(v => v != null)) {
const c = this.initChart('chartThick4', 180)
if (c) {
const series = [{ name: '末架出口厚度', data: t4, color: PALETTE[0] }]
if (t4Ref.some(v => v != null)) series.push({ name: '目标', data: t4Ref, color: '#909399', dash: true })
const series = [{ name: '末架出口厚度', data: t4Pairs, color: PALETTE[0] }]
if (target) {
const up = rows.map(() => parseFloat((target + posLim).toFixed(4)))
const lo = rows.map(() => parseFloat((target - negLim).toFixed(4)))
series.push({ name: '上限', data: up, color: '#F56C6C', dash: true })
series.push({ name: '下限', data: lo, color: '#67C23A', dash: true })
const upPairs = t4Pairs.map(([xi]) => [xi, parseFloat((target + posLim).toFixed(4))])
const loPairs = t4Pairs.map(([xi]) => [xi, parseFloat((target - negLim).toFixed(4))])
series.push({ name: '上限', data: upPairs, color: '#F56C6C', dash: true })
series.push({ name: '下限', data: loPairs, color: '#67C23A', dash: true })
}
c.setOption(lineOpt('末架出口厚度 [mm]', x, series, 'mm'))
c.setOption(lineOpt('末架出口厚度 [mm]', null, series, 'mm', 3, 500))
}
}
},