From 66f385354163db7a2d7dc9d6168a2ce8f8c38c40 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 20 一月 2026 13:42:05 +0800
Subject: [PATCH] fix: 指标维护、指标绑定样式修正

---
 src/components/PIMTable/PIMTable.vue                    |    4 
 src/views/qualityManagement/metricMaintenance/index.vue |   81 +++++++++++++++++++++++++-
 src/views/qualityManagement/metricBinding/index.vue     |   36 +++++++++++-
 3 files changed, 112 insertions(+), 9 deletions(-)

diff --git a/src/components/PIMTable/PIMTable.vue b/src/components/PIMTable/PIMTable.vue
index 1480893..dfbc231 100644
--- a/src/components/PIMTable/PIMTable.vue
+++ b/src/components/PIMTable/PIMTable.vue
@@ -130,7 +130,7 @@
         </div>
 
         <!-- 鎸夐挳 -->
-        <div v-else-if="item.dataType == 'action'">
+        <div v-else-if="item.dataType == 'action'" @click.stop>
           <template v-for="(o, key) in item.operation" :key="key">
             <el-button
               v-show="o.type != 'upload'"
@@ -145,7 +145,7 @@
                     : o.color,
               }"
               link
-              @click="o.clickFun(scope.row)"
+              @click.stop="o.clickFun(scope.row)"
               :key="key"
             >
               {{ o.name }}
diff --git a/src/views/qualityManagement/metricBinding/index.vue b/src/views/qualityManagement/metricBinding/index.vue
index d32a5df..ac67474 100644
--- a/src/views/qualityManagement/metricBinding/index.vue
+++ b/src/views/qualityManagement/metricBinding/index.vue
@@ -10,6 +10,7 @@
         :isSelection="false"
         :rowClassName="rowClassNameCenter"
         :tableLoading="tableLoading"
+        :rowClick="handleTableRowClick"
         @pagination="handlePagination"
         :total="page.total"
       >
@@ -197,12 +198,13 @@
 }
 
 const standardColumns = ref([
-  { label: '鏍囧噯缂栧彿', prop: 'standardNo', dataType: 'slot', slot: 'standardNoCell', minWidth: 160, headerSlot: 'standardNoHeader' },
-  { label: '鏍囧噯鍚嶇О', prop: 'standardName', minWidth: 180, headerSlot: 'standardNameHeader' },
+  { label: '鏍囧噯缂栧彿', prop: 'standardNo', dataType: 'slot', slot: 'standardNoCell', minWidth: 160, align: 'center', headerSlot: 'standardNoHeader' },
+  { label: '鏍囧噯鍚嶇О', prop: 'standardName', minWidth: 180, align: 'center', headerSlot: 'standardNameHeader' },
   {
     label: '绫诲埆',
     prop: 'inspectType',
     headerSlot: 'inspectTypeHeader',
+    align: 'center',
     dataType: 'tag',
     formatData: (val) => {
       const map = { 0: '鍘熸潗鏂欐楠�', 1: '杩囩▼妫�楠�', 2: '鍑哄巶妫�楠�' }
@@ -212,6 +214,7 @@
   {
     label: '宸ュ簭',
     prop: 'processId',
+    align: 'center',
     dataType: 'tag',
     formatData: (val) => {
       const target = processOptions.value.find(
@@ -223,7 +226,8 @@
   {
     label: '澶囨敞',
     prop: 'remark',
-    minWidth: 160
+    minWidth: 160,
+    align: 'center'
   }
   // {
   //   label: '鐘舵��',
@@ -304,6 +308,13 @@
     })
 }
 
+// 琛ㄦ牸琛岀偣鍑伙紝鍔犺浇鍙充晶缁戝畾鍒楄〃
+const handleTableRowClick = (row) => {
+  currentStandard.value = row
+  loadBindingList()
+}
+
+// 宸︿晶琛岀偣鍑伙紝鍔犺浇鍙充晶缁戝畾鍒楄〃锛堜繚鐣欑敤浜庢爣鍑嗙紪鍙峰垪鐨勭偣鍑伙級
 const handleStandardRowClick = (row) => {
   currentStandard.value = row
   loadBindingList()
@@ -471,4 +482,23 @@
 :deep(.center-table .el-table__body-wrapper td .cell) {
   text-align: center !important;
 }
+
+/* PIMTable 琛ㄥご灞呬腑 */
+:deep(.lims-table .pim-table-header-cell) {
+  text-align: center;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+:deep(.lims-table .pim-table-header-title) {
+  text-align: center;
+  width: 100%;
+}
+
+:deep(.lims-table .pim-table-header-extra) {
+  width: 100%;
+  margin-top: 4px;
+}
 </style>
diff --git a/src/views/qualityManagement/metricMaintenance/index.vue b/src/views/qualityManagement/metricMaintenance/index.vue
index 506feb6..44d3fae 100644
--- a/src/views/qualityManagement/metricMaintenance/index.vue
+++ b/src/views/qualityManagement/metricMaintenance/index.vue
@@ -19,6 +19,7 @@
         :isSelection="true"
         :tableLoading="tableLoading"
         :rowClassName="rowClassNameCenter"
+        :rowClick="handleTableRowClick"
         @selection-change="handleSelectionChange"
         @pagination="handlePagination"
         :total="page.total"
@@ -277,18 +278,21 @@
     dataType: 'slot',
     slot: 'standardNoCell',
     minWidth: 160,
+    align: 'center',
     headerSlot: 'standardNoHeader'
   },
   {
     label: '鏍囧噯鍚嶇О',
     prop: 'standardName',
     minWidth: 180,
+    align: 'center',
     headerSlot: 'standardNameHeader'
   },
   {
     label: '绫诲埆',
     prop: 'inspectType',
     headerSlot: 'inspectTypeHeader',
+    align: 'center',
     dataType: 'tag',
     formatData: (val) => {
       const map = {
@@ -302,6 +306,7 @@
   {
     label: '宸ュ簭',
     prop: 'processId',
+    align: 'center',
     dataType: 'tag',
     formatData: (val) => {
       const target = processOptions.value.find(
@@ -314,6 +319,7 @@
     label: '鐘舵��',
     prop: 'state',
     headerSlot: 'stateHeader',
+    align: 'center',
     dataType: 'tag',
     formatData: (val) => {
       const map = {
@@ -332,7 +338,8 @@
   {
     label: '澶囨敞',
     prop: 'remark',
-    minWidth: 160
+    minWidth: 160,
+    align: 'center'
   },
   {
     dataType: 'action',
@@ -447,7 +454,13 @@
   getStandardList()
 }
 
-// 宸︿晶琛岀偣鍑伙紝鍔犺浇鍙充晶鍙傛暟
+// 琛ㄦ牸琛岀偣鍑伙紝鍔犺浇鍙充晶鍙傛暟
+const handleTableRowClick = (row) => {
+  currentStandard.value = row
+  loadDetail(row.id)
+}
+
+// 宸︿晶琛岀偣鍑伙紝鍔犺浇鍙充晶鍙傛暟锛堜繚鐣欑敤浜庢爣鍑嗙紪鍙峰垪鐨勭偣鍑伙級
 const handleStandardRowClick = (row) => {
   currentStandard.value = row
   loadDetail(row.id)
@@ -567,14 +580,23 @@
       processId: ''
     })
   } else if (type === 'edit' && row) {
-    Object.assign(standardForm.value, row)
+    Object.assign(standardForm.value, {
+      ...row,
+      // 纭繚 inspectType 鍜� state 杞崲涓哄瓧绗︿覆锛屼互鍖归厤 el-select 鐨� value 绫诲瀷
+      inspectType: row.inspectType !== null && row.inspectType !== undefined ? String(row.inspectType) : '',
+      state: row.state !== null && row.state !== undefined ? String(row.state) : '0',
+      // 纭繚 processId 杞崲涓哄瓧绗︿覆鎴栨暟瀛楋紙鏍规嵁瀹為檯闇�瑕侊級
+      processId: row.processId !== null && row.processId !== undefined ? row.processId : ''
+    })
   } else if (type === 'copy' && row) {
     const { id, ...rest } = row
     Object.assign(standardForm.value, {
       ...rest,
       id: undefined,
       standardNo: '',
-      state: '0'
+      state: '0',
+      // 纭繚 inspectType 杞崲涓哄瓧绗︿覆
+      inspectType: rest.inspectType !== null && rest.inspectType !== undefined ? String(rest.inspectType) : ''
     })
   }
   standardDialogVisible.value = true
@@ -673,14 +695,41 @@
 .metric-maintenance {
   display: flex;
   gap: 16px;
+  min-width: 0; /* 鍏佽 flex 瀛愬厓绱犳敹缂� */
 }
 
 .left-panel,
 .right-panel {
   flex: 1;
+  min-width: 0; /* 鍏佽 flex 瀛愬厓绱犳敹缂� */
   background: #ffffff;
   padding: 16px;
   box-sizing: border-box;
+  overflow: hidden; /* 闃叉鍐呭婧㈠嚭 */
+}
+
+/* 浣庡垎杈ㄧ巼閫傞厤 */
+@media (max-width: 1400px) {
+  .metric-maintenance {
+    flex-direction: column;
+  }
+  
+  .left-panel,
+  .right-panel {
+    width: 100%;
+    min-width: 0;
+  }
+}
+
+@media (max-width: 768px) {
+  .metric-maintenance {
+    gap: 12px;
+  }
+  
+  .left-panel,
+  .right-panel {
+    padding: 12px;
+  }
 }
 
 .toolbar {
@@ -688,6 +737,8 @@
   justify-content: space-between;
   align-items: center;
   margin-bottom: 12px;
+  flex-wrap: wrap;
+  gap: 8px;
 }
 
 .toolbar-left {
@@ -699,6 +750,9 @@
 
 .toolbar-right {
   flex-shrink: 0;
+  display: flex;
+  flex-wrap: wrap;
+  gap: 8px;
 }
 
 .search-label {
@@ -758,4 +812,23 @@
 :deep(.center-table .el-table__body-wrapper td .cell) {
   text-align: center !important;
 }
+
+/* PIMTable 琛ㄥご灞呬腑 */
+:deep(.lims-table .pim-table-header-cell) {
+  text-align: center;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+:deep(.lims-table .pim-table-header-title) {
+  text-align: center;
+  width: 100%;
+}
+
+:deep(.lims-table .pim-table-header-extra) {
+  width: 100%;
+  margin-top: 4px;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3