From 63b4909ac5d0b7355be211cc7080673b41cdb3cc Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei>
Date: 星期三, 04 三月 2026 14:46:02 +0800
Subject: [PATCH] refactor(module(qa)): 代码重构
---
ruoyi-plus-soybean/src/views/analy/output-analy/index.vue | 260 +++++++++++++++++++++++++--------------------------
1 files changed, 126 insertions(+), 134 deletions(-)
diff --git a/ruoyi-plus-soybean/src/views/analy/output-analy/index.vue b/ruoyi-plus-soybean/src/views/analy/output-analy/index.vue
index 7d5d986..6a0d891 100755
--- a/ruoyi-plus-soybean/src/views/analy/output-analy/index.vue
+++ b/ruoyi-plus-soybean/src/views/analy/output-analy/index.vue
@@ -76,123 +76,124 @@
const { columns, columnChecks, data, getData, loading, scrollX } = useNaiveTable({
api: () => fetchGetRollerSampleDataList(searchParams.value),
transform: (response: any) => response.data || [],
- columns: () => ([
- {
- key: 'index',
- title: '搴忓彿',
- align: 'center',
- width: 64,
- render: (_: Api.Qa.RollerData, index: number) => index + 1
- },
- {
- key: 'time',
- title: '鏃堕棿',
- align: 'center',
- minWidth: 160
- },
- {
- key: 'equNo',
- title: '璁惧',
- align: 'center',
- minWidth: 120,
- render: (row: Api.Qa.RollerData) => equNoMap[row.equNo] || row.equNo
- },
- {
- key: 'shift',
- title: '鐝',
- align: 'center',
- minWidth: 80,
- render: (row: Api.Qa.RollerData) => <NTag type="info">{shiftMap[row.shift] || row.shift}</NTag>
- },
- {
- key: 'qty',
- title: '鍗锋帴鏈轰骇閲�(鍗冩敮)',
- align: 'center',
- minWidth: 100,
- render: (row: Api.Qa.RollerData) => Number(row.qty ?? 0).toFixed(1)
- },
- {
- key: 'qtyBox',
- title: '鍗锋帴鏈轰骇閲�(绠�)',
- align: 'center',
- minWidth: 120,
- render: (row: Api.Qa.RollerData) => {
- const v = Number(row.qty ?? 0) / 50;
- return v.toFixed(1);
+ columns: () =>
+ [
+ {
+ key: 'index',
+ title: '搴忓彿',
+ align: 'center',
+ width: 64,
+ render: (_: Api.Qa.RollerData, index: number) => index + 1
+ },
+ {
+ key: 'time',
+ title: '鏃堕棿',
+ align: 'center',
+ minWidth: 160
+ },
+ {
+ key: 'equNo',
+ title: '璁惧',
+ align: 'center',
+ minWidth: 120,
+ render: (row: Api.Qa.RollerData) => equNoMap[row.equNo] || row.equNo
+ },
+ {
+ key: 'shift',
+ title: '鐝',
+ align: 'center',
+ minWidth: 80,
+ render: (row: Api.Qa.RollerData) => <NTag type="info">{shiftMap[row.shift] || row.shift}</NTag>
+ },
+ {
+ key: 'qty',
+ title: '鍗锋帴鏈轰骇閲�(鍗冩敮)',
+ align: 'center',
+ minWidth: 100,
+ render: (row: Api.Qa.RollerData) => Number(row.qty ?? 0).toFixed(1)
+ },
+ {
+ key: 'qtyBox',
+ title: '鍗锋帴鏈轰骇閲�(绠�)',
+ align: 'center',
+ minWidth: 120,
+ render: (row: Api.Qa.RollerData) => {
+ const v = Number(row.qty ?? 0) / 50;
+ return v.toFixed(1);
+ }
+ },
+ {
+ key: 'tsQtyTiao',
+ title: '鎻愬崌鏈轰骇閲�(鏉�)',
+ align: 'center',
+ minWidth: 120,
+ render: (row: Api.Qa.RollerData) => {
+ if (row.tsQty === null || row.tsQty === undefined) return '-';
+ return Number(row.tsQty).toFixed(1);
+ }
+ },
+ {
+ key: 'tsQtyBox',
+ title: '鎻愬崌鏈轰骇閲�(绠�)',
+ align: 'center',
+ minWidth: 120,
+ render: (row: Api.Qa.RollerData) => {
+ if (row.tsQty === null || row.tsQty === undefined) return '-';
+ const v = Number(row.tsQty) / 250;
+ return v.toFixed(1);
+ }
+ },
+ {
+ key: 'packerQty',
+ title: '鍖呰鏈轰骇閲�(灏忓寘)',
+ align: 'center',
+ minWidth: 140,
+ render: (row: Api.Qa.RollerData) => {
+ if (row.packerQty === null || row.packerQty === undefined) return '-';
+ return Number(row.packerQty).toFixed(1);
+ }
+ },
+ {
+ key: 'packerQtyBox',
+ title: '鍖呰鏈轰骇閲�(绠�)',
+ align: 'center',
+ minWidth: 120,
+ render: (row: Api.Qa.RollerData) => {
+ if (row.packerQty === null || row.packerQty === undefined) return '-';
+ const v = Number(row.packerQty) / 10 / 250;
+ return v.toFixed(1);
+ }
+ },
+ {
+ key: 'lvbangVal',
+ title: '婊ゆ娑堣��(鏀�)',
+ align: 'center',
+ minWidth: 140,
+ render: (row: Api.Qa.RollerData) => Number(row.lvbangVal ?? 0).toFixed(1)
+ },
+ {
+ key: 'lvbangWan',
+ title: '婊ゆ娑堣��(涓囨敮)',
+ align: 'center',
+ minWidth: 140,
+ render: (row: Api.Qa.RollerData) => {
+ const v = Number(row.lvbangVal ?? 0) / 10000;
+ return v.toFixed(1);
+ }
+ },
+ {
+ key: 'danhao',
+ title: '婊ゆ鍗曡��(涓囨敮/绠�)',
+ align: 'center',
+ minWidth: 180,
+ render: (row: Api.Qa.RollerData) => {
+ const qtyBox = Number(row.qty ?? 0) / 50;
+ if (!qtyBox) return '-';
+ const v = Number(row.lvbangVal ?? 0) / 10000 / qtyBox;
+ return v.toFixed(1);
+ }
}
- },
- {
- key: 'tsQtyTiao',
- title: '鎻愬崌鏈轰骇閲�(鏉�)',
- align: 'center',
- minWidth: 120,
- render: (row: Api.Qa.RollerData) => {
- if (row.tsQty === null || row.tsQty === undefined) return '-';
- return Number(row.tsQty).toFixed(1);
- }
- },
- {
- key: 'tsQtyBox',
- title: '鎻愬崌鏈轰骇閲�(绠�)',
- align: 'center',
- minWidth: 120,
- render: (row: Api.Qa.RollerData) => {
- if (row.tsQty === null || row.tsQty === undefined) return '-';
- const v = Number(row.tsQty) / 250;
- return v.toFixed(1);
- }
- },
- {
- key: 'packerQty',
- title: '鍖呰鏈轰骇閲�(灏忓寘)',
- align: 'center',
- minWidth: 140,
- render: (row: Api.Qa.RollerData) => {
- if (row.packerQty === null || row.packerQty === undefined) return '-';
- return Number(row.packerQty).toFixed(1);
- }
- },
- {
- key: 'packerQtyBox',
- title: '鍖呰鏈轰骇閲�(绠�)',
- align: 'center',
- minWidth: 120,
- render: (row: Api.Qa.RollerData) => {
- if (row.packerQty === null || row.packerQty === undefined) return '-';
- const v = Number(row.packerQty) / 10 / 250;
- return v.toFixed(1);
- }
- },
- {
- key: 'lvbangVal',
- title: '婊ゆ娑堣��(鏀�)',
- align: 'center',
- minWidth: 140,
- render: (row: Api.Qa.RollerData) => Number(row.lvbangVal ?? 0).toFixed(1)
- },
- {
- key: 'lvbangWan',
- title: '婊ゆ娑堣��(涓囨敮)',
- align: 'center',
- minWidth: 140,
- render: (row: Api.Qa.RollerData) => {
- const v = Number(row.lvbangVal ?? 0) / 10000;
- return v.toFixed(1);
- }
- },
- {
- key: 'danhao',
- title: '婊ゆ鍗曡��(涓囨敮/绠�)',
- align: 'center',
- minWidth: 180,
- render: (row: Api.Qa.RollerData) => {
- const qtyBox = Number(row.qty ?? 0) / 50;
- if (!qtyBox) return '-';
- const v = (Number(row.lvbangVal ?? 0) / 10000) / qtyBox;
- return v.toFixed(1);
- }
- }
- ] as any)
+ ] as any
});
async function handleExport() {
@@ -202,18 +203,15 @@
<template>
<div class="h-full min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
- <RollerDataSearch
- v-model:model="searchParams"
- @search="getData"
- />
+ <RollerDataSearch v-model:model="searchParams" @search="getData" />
<NCard
- v-if="!showTable"
- title="鍗锋帴鏈哄垎鏋愯秼鍔垮浘"
- :bordered="false"
- size="small"
- class="sm:flex-1-hidden card-wrapper flex flex-col"
- content-style="flex: 1; min-height: 0; overflow: hidden;"
- >
+ v-if="!showTable"
+ title="鍗锋帴鏈哄垎鏋愯秼鍔垮浘"
+ :bordered="false"
+ size="small"
+ class="flex flex-col card-wrapper sm:flex-1-hidden"
+ content-style="flex: 1; min-height: 0; overflow: hidden;"
+ >
<template #header-extra>
<NButton size="small" @click="showTable = true">
<template #icon>
@@ -224,13 +222,7 @@
</template>
<RollerDataLineChart :data="(data as any)" class="h-full" />
</NCard>
- <NCard
- v-else
- title="鏁版嵁璇︽儏"
- :bordered="false"
- size="small"
- class="sm:flex-1-hidden card-wrapper"
- >
+ <NCard v-else title="鏁版嵁璇︽儏" :bordered="false" size="small" class="card-wrapper sm:flex-1-hidden">
<template #header-extra>
<TableHeaderOperation
v-model:columns="columnChecks"
--
Gitblit v1.9.3