gaoluyang
6 天以前 4aaae263a6c728eaa2a3f45a1ae36082619b52a0
src/views/index.vue
@@ -712,7 +712,7 @@
    const lines = list
        .map((p) => {
          const colorBox = `<span style="display:inline-block;margin-right:6px;border-radius:2px;width:10px;height:10px;background:${p.color}"></span>`;
          return `${colorBox}${p.seriesName}<b style="float:right;">${Number(p.value || 0).toFixed(2)}</b>`;
          return `${colorBox}${p.seriesName}<b style="float:right;">${Number(p.value || 0).toFixed(4)}</b>`;
        })
        .join("<br/>");
    return `<div style="min-width:140px;"><div style="font-weight:700;margin-bottom:6px;">${name}</div>${lines}</div>`;
@@ -828,7 +828,7 @@
    value: formatNumber(productionOverviewData.value.totalOutput),
    subLabel: "累计报废",
    subValue: formatNumber(productionOverviewData.value.totalScrap),
    trend: `良率 ${Number(productionOverviewData.value.yieldRate || 0).toFixed(2)}%`,
    trend: `良率 ${Number(productionOverviewData.value.yieldRate || 0).toFixed(4)}%`,
    icon: Operation,
    visible: visibleModules.value.production,
  },
@@ -876,7 +876,7 @@
const getCompareText = (value) => {
  const num = Number(value || 0);
  const abs = Math.abs(num).toFixed(2);
  const abs = Math.abs(num).toFixed(4);
  if (num > 0) return `较昨日 ↑ ${abs}%`;
  if (num < 0) return `较昨日 ↓ ${abs}%`;
  return "较昨日 持平";
@@ -894,7 +894,7 @@
      key: "oee",
      label: "设备 OEE",
      percent: clampPercent(oee),
      display: `${oee.toFixed(2)}%`,
      display: `${oee.toFixed(4)}%`,
      delta: getCompareText(oeeCompare),
      trend: getCompareTrend(oeeCompare),
      color: "#2d8cff",
@@ -903,7 +903,7 @@
      key: "order",
      label: "订单达成率",
      percent: clampPercent(orderAchievement),
      display: `${orderAchievement.toFixed(2)}%`,
      display: `${orderAchievement.toFixed(4)}%`,
      delta: getCompareText(orderCompare),
      trend: getCompareTrend(orderCompare),
      color: "#31d2ff",
@@ -912,7 +912,7 @@
      key: "defect",
      label: "不良率",
      percent: clampPercent(defectRate),
      display: `${defectRate.toFixed(2)}%`,
      display: `${defectRate.toFixed(4)}%`,
      delta: getCompareText(defectCompare),
      trend: getCompareTrend(defectCompare),
      color: "#f6a23f",
@@ -1122,7 +1122,7 @@
const trendText = (value) => {
  const num = Number(value || 0);
  const flag = num >= 0 ? "↑" : "↓";
  return `${flag} ${Math.abs(num).toFixed(1)}%`;
  return `${flag} ${Math.abs(num).toFixed(4)}%`;
};
const ratioNumber = (numerator, denominator) => {
@@ -1132,7 +1132,7 @@
  return (n / d) * 100;
};
const ratioText = (numerator, denominator) => `${ratioNumber(numerator, denominator).toFixed(1)}%`;
const ratioText = (numerator, denominator) => `${ratioNumber(numerator, denominator).toFixed(4)}%`;
const clampPercent = (val) => Math.max(0, Math.min(100, Number(val || 0)));