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/packer/index.vue |  429 ++++++++++++++++++++++++++--------------------------
 1 files changed, 214 insertions(+), 215 deletions(-)

diff --git a/ruoyi-plus-soybean/src/views/analy/packer/index.vue b/ruoyi-plus-soybean/src/views/analy/packer/index.vue
index b030ded..0f27005 100755
--- a/ruoyi-plus-soybean/src/views/analy/packer/index.vue
+++ b/ruoyi-plus-soybean/src/views/analy/packer/index.vue
@@ -15,7 +15,6 @@
   name: 'PackerDataList'
 });
 
-
 const appStore = useAppStore();
 const { download } = useDownload();
 const { hasAuth } = useAuth();
@@ -50,229 +49,229 @@
   params: {
     beginTime: `${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, '0')}-${String(new Date().getDate()).padStart(2, '0')} 00:00:00`,
     endTime: `${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, '0')}-${String(new Date().getDate()).padStart(2, '0')} 23:59:59`
-  },
+  }
 });
 
 const { columns, columnChecks, data, getData, getDataByPage, loading, mobilePagination, scrollX } =
   useNaivePaginatedTable({
-  api: () => fetchGetPackerDataList(searchParams.value),
-  transform: response => defaultTransform(response),
-  onPaginationParamsChange: params => {
-    searchParams.value.pageNum = params.page;
-    searchParams.value.pageSize = params.pageSize;
-  },
-  columns: () => [
-    {
-      type: 'selection',
-      align: 'center',
-      width: 48
+    api: () => fetchGetPackerDataList(searchParams.value),
+    transform: response => defaultTransform(response),
+    onPaginationParamsChange: params => {
+      searchParams.value.pageNum = params.page;
+      searchParams.value.pageSize = params.pageSize;
     },
-    {
-      key: 'index',
-      title: $t('common.index'),
-      align: 'center',
-      width: 64,
-      render: (_, index) => index + 1
-    },
-    {
-      key: 'time',
-      title: '鏃堕棿',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'key',
-      title: 'key',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'online',
-      title: '缃戠粶鐘舵��(0寮傚父锛�1姝e父)',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'qty',
-      title: '浜ч噺',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'badQty',
-      title: '鍓旈櫎浜ч噺',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'xiaohemoVal',
-      title: '灏忕洅鑶滄秷鑰�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'tiaohemoVal',
-      title: '鏉$洅鑶滄秷鑰�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'xiaohezhiVal',
-      title: '灏忕洅绾告秷鑰�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'tiaohezhiVal',
-      title: '鏉$洅绾告秷鑰�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'neichenzhiVal',
-      title: '鍐呰‖绾告秷鑰�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'runTime',
-      title: '杩愯鏃堕棿',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'stopTime',
-      title: '鍋滄満鏃堕棿',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'stopTimes',
-      title: '鍋滄満娆℃暟',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'speed',
-      title: '杞﹂��',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'runStatus',
-      title: '杩愯鐘舵��(-1 鏂綉 0鍋滄 1浣庨�熻繍琛� 2姝e父杩愯)',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'tsQty',
-      title: '鎻愬崌鏈轰骇閲�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'mainQty',
-      title: '涓绘満浜ч噺锛堝皬鍖呮満锛�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'mainBadQty',
-      title: '涓绘満鍓旈櫎閲�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'tbjQty',
-      title: '閫忓寘鏈轰骇閲�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'tbjGdQty',
-      title: '閫忓寘鏈哄墧闄ゅソ鍖�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'tbjBadQty',
-      title: '閫忓寘鏈哄墧闄ゅ潖鍖�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'pbjQty',
-      title: '鎺掑寘鏈轰骇閲�',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'shift',
-      title: '鐝',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'equNo',
-      title: '璁惧',
-      align: 'center',
-      minWidth: 120
-    },
-    {
-      key: 'operate',
-      title: $t('common.operate'),
-      align: 'center',
-      width: 130,
-      render: row => {
-        const divider = () => {
-          if (!hasAuth('qa:packerData:edit') || !hasAuth('qa:packerData:remove')) {
-            return null;
-          }
-          return <NDivider vertical />;
-        };
+    columns: () => [
+      {
+        type: 'selection',
+        align: 'center',
+        width: 48
+      },
+      {
+        key: 'index',
+        title: $t('common.index'),
+        align: 'center',
+        width: 64,
+        render: (_, index) => index + 1
+      },
+      {
+        key: 'time',
+        title: '鏃堕棿',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'key',
+        title: 'key',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'online',
+        title: '缃戠粶鐘舵��(0寮傚父锛�1姝e父)',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'qty',
+        title: '浜ч噺',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'badQty',
+        title: '鍓旈櫎浜ч噺',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'xiaohemoVal',
+        title: '灏忕洅鑶滄秷鑰�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'tiaohemoVal',
+        title: '鏉$洅鑶滄秷鑰�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'xiaohezhiVal',
+        title: '灏忕洅绾告秷鑰�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'tiaohezhiVal',
+        title: '鏉$洅绾告秷鑰�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'neichenzhiVal',
+        title: '鍐呰‖绾告秷鑰�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'runTime',
+        title: '杩愯鏃堕棿',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'stopTime',
+        title: '鍋滄満鏃堕棿',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'stopTimes',
+        title: '鍋滄満娆℃暟',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'speed',
+        title: '杞﹂��',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'runStatus',
+        title: '杩愯鐘舵��(-1 鏂綉 0鍋滄 1浣庨�熻繍琛� 2姝e父杩愯)',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'tsQty',
+        title: '鎻愬崌鏈轰骇閲�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'mainQty',
+        title: '涓绘満浜ч噺锛堝皬鍖呮満锛�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'mainBadQty',
+        title: '涓绘満鍓旈櫎閲�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'tbjQty',
+        title: '閫忓寘鏈轰骇閲�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'tbjGdQty',
+        title: '閫忓寘鏈哄墧闄ゅソ鍖�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'tbjBadQty',
+        title: '閫忓寘鏈哄墧闄ゅ潖鍖�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'pbjQty',
+        title: '鎺掑寘鏈轰骇閲�',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'shift',
+        title: '鐝',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'equNo',
+        title: '璁惧',
+        align: 'center',
+        minWidth: 120
+      },
+      {
+        key: 'operate',
+        title: $t('common.operate'),
+        align: 'center',
+        width: 130,
+        render: row => {
+          const divider = () => {
+            if (!hasAuth('qa:packerData:edit') || !hasAuth('qa:packerData:remove')) {
+              return null;
+            }
+            return <NDivider vertical />;
+          };
 
-        const editBtn = () => {
-          if (!hasAuth('qa:packerData:edit')) {
-            return null;
-          }
+          const editBtn = () => {
+            if (!hasAuth('qa:packerData:edit')) {
+              return null;
+            }
+            return (
+              <ButtonIcon
+                text
+                type="primary"
+                icon="material-symbols:drive-file-rename-outline-outline"
+                tooltipContent={$t('common.edit')}
+                onClick={() => edit(row.time)}
+              />
+            );
+          };
+
+          const deleteBtn = () => {
+            if (!hasAuth('qa:packerData:remove')) {
+              return null;
+            }
+            return (
+              <ButtonIcon
+                text
+                type="error"
+                icon="material-symbols:delete-outline"
+                tooltipContent={$t('common.delete')}
+                popconfirmContent={$t('common.confirmDelete')}
+                onPositiveClick={() => handleDelete(row.time)}
+              />
+            );
+          };
+
           return (
-            <ButtonIcon
-              text
-              type="primary"
-              icon="material-symbols:drive-file-rename-outline-outline"
-              tooltipContent={$t('common.edit')}
-              onClick={() => edit(row.time)}
-            />
+            <div class="flex-center gap-8px">
+              {editBtn()}
+              {divider()}
+              {deleteBtn()}
+            </div>
           );
-        };
-
-        const deleteBtn = () => {
-          if (!hasAuth('qa:packerData:remove')) {
-            return null;
-          }
-          return (
-            <ButtonIcon
-              text
-              type="error"
-              icon="material-symbols:delete-outline"
-              tooltipContent={$t('common.delete')}
-              popconfirmContent={$t('common.confirmDelete')}
-              onPositiveClick={() => handleDelete(row.time)}
-            />
-          );
-        };
-
-        return (
-          <div class="flex-center gap-8px">
-            {editBtn()}
-            {divider()}
-            {deleteBtn()}
-          </div>
-        );
+        }
       }
-    }
-  ]
-});
+    ]
+  });
 
 const { drawerVisible, operateType, editingData, handleAdd, handleEdit, checkedRowKeys, onBatchDeleted, onDeleted } =
   useTableOperate(data, 'time', getData);

--
Gitblit v1.9.3