From ba8aa925e7901381ceb394adb53eca8723d1c4c5 Mon Sep 17 00:00:00 2001
From: leiqunqing <zhengqifeng@hnkhzn.com>
Date: 星期一, 19 一月 2026 11:05:49 +0800
Subject: [PATCH] 完善工位界面

---
 代码管理/WIDESEAWCS_Client/src/components/basic/VolTable.vue |  139 ++++++++++++++++++++++++++++++++++------------
 1 files changed, 102 insertions(+), 37 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Client/src/components/basic/VolTable.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Client/src/components/basic/VolTable.vue"
index af51360..096a1ea 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Client/src/components/basic/VolTable.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Client/src/components/basic/VolTable.vue"
@@ -642,6 +642,7 @@
       default: 500,
     },
     selectable: {
+
       type: Function,
       default: (row, index) => {
         return true;
@@ -884,47 +885,110 @@
     rowDbClick(row, column, event) {
       //2021.05.23澧炲姞鍙屽嚮琛屼簨浠�
       this.$emit("rowDbClick", { row, column, event });
-    },
-    rowClick(row, column, event) {
-      //2022.02.20澧炲姞鐐瑰嚮鏃惰〃鏍煎弬鏁板垽鏂�
-      if (!column) {
-        return;
-      }
-      //姝e湪缂栬緫鏃讹紝绂佹鍑哄彂rowClick浜嬩欢
-      if (this.edit.rowIndex == -1) {
-        this.$emit("rowClick", { row, column, event });
-      }
-      // 鐐瑰嚮琛屼簨浠�(2020.11.07)
+    },rowClick(row, column, event) {
+  // 2022.02.20澧炲姞鐐瑰嚮鏃惰〃鏍煎弬鏁板垽鏂�
+  if (!column) {
+    return;
+  }
 
-      if (!this.doubleEdit) {
-        return;
-      }
-      // 鐐瑰嚮鍏朵粬琛屾椂锛屽鏋滅偣鍑荤殑琛屼笌姝e湪缂栬緫鐨勮鐩稿悓锛屼繚鎸佺紪杈戠姸鎬�
-      if (this.clickEdit && this.edit.rowIndex != -1) {
-        if (row.elementIndex == this.edit.rowIndex) {
-          // 鐐瑰嚮鐨勫崟鍏冩牸濡傛灉涓嶅彲浠ョ紪杈戯紝鐩存帴缁撴潫缂栬緫
-          // 2020.10.12淇缁撴潫缂栬緫鏃讹紝element table楂樼増鏈睘鎬ц幏鍙栦笉鍒扮殑闂
-          let _col = this.columns.find((x) => {
-            return x.field == ((event && event.property) || column.property);
-          });
-          if (_col && (!_col.edit || _col.readonly)) {
-            if (this.rowEndEdit(row, event)) {
-              this.edit.rowIndex = -1;
-            }
-          }
-          return;
-        }
-        if (this.rowEndEdit(row, event && event.property ? event : column)) {
+  // ===== 浼樺寲锛氶殧绂诲閫夋鐐瑰嚮浜嬩欢锛岄伩鍏嶅啋娉″共鎵� 寮�濮� =====
+  // 鍒ゆ柇鐐瑰嚮鐩爣鏄惁鏄閫夋锛堟垨澶嶉�夋鎵�鍦ㄧ殑鍗曞厓鏍�/鍥炬爣锛�
+  const targetEl = event.target;
+  const isCheckbox = targetEl.classList.contains('el-checkbox__input') || 
+                      targetEl.closest('.el-checkbox__input') ||
+                      targetEl.closest('.el-table-column--selection');
+  // 濡傛灉鐐瑰嚮鐨勬槸澶嶉�夋鍖哄煙锛岀洿鎺ヨ繑鍥烇紝涓嶆墽琛岃閫変腑閫昏緫
+  if (isCheckbox) {
+    return;
+  }
+  // ===== 浼樺寲锛氶殧绂诲閫夋鐐瑰嚮浜嬩欢 缁撴潫 =====
+
+  // ===== 浼樺寲锛氱偣鍑昏閫変腑/鍒囨崲澶嶉�夋 寮�濮� =====
+  // 1. 鍒ゆ柇鏄惁鏄剧ず澶嶉�夋锛坈k涓簍rue锛夛紝涓嶆樉绀哄垯鏃犻渶澶勭悊
+  // 2. 缂栬緫鐘舵�佷笅涓嶈Е鍙戯紙閬垮厤骞叉壈缂栬緫鍔熻兘锛�
+  if (this.ck && this.edit.rowIndex === -1) {
+    // 3. 鍗曢�夊満鏅紙single涓簍rue锛夛細鍏堟竻绌烘墍鏈夐�変腑椤癸紝鍐嶅己鍒堕�変腑褰撳墠琛岋紙淇濇寔鍗曢�夐�昏緫锛�
+    if (this.single) {
+      this.$refs.table.clearSelection(); // 娓呯┖鎵�鏈夐�変腑
+      this.$refs.table.toggleRowSelection(row, true); // 鍗曢�夊満鏅己鍒堕�変腑褰撳墠琛�
+    } 
+    // 4. 澶氶�夊満鏅紙single涓篺alse锛夛細涓嶄紶绗簩涓弬鏁帮紝瀹炵幇鍒囨崲閫変腑/鍙栨秷鐘舵��
+    else {
+      this.$refs.table.toggleRowSelection(row); // 鍒囨崲鐘舵�侊紝鏀寔鍙栨秷閫変腑
+    }
+  }
+  // ===== 浼樺寲锛氱偣鍑昏閫変腑/鍒囨崲澶嶉�夋 缁撴潫 =====
+
+  // 姝e湪缂栬緫鏃讹紝绂佹瑙﹀彂rowClick浜嬩欢
+  if (this.edit.rowIndex == -1) {
+    this.$emit("rowClick", { row, column, event });
+  }
+  // 鐐瑰嚮琛屼簨浠�(2020.11.07)
+  if (!this.doubleEdit) {
+    return;
+  }
+  // 鐐瑰嚮鍏朵粬琛屾椂锛屽鏋滅偣鍑荤殑琛屼笌姝e湪缂栬緫鐨勮鐩稿悓锛屼繚鎸佺紪杈戠姸鎬�
+  if (this.clickEdit && this.edit.rowIndex != -1) {
+    if (row.elementIndex == this.edit.rowIndex) {
+      // 鐐瑰嚮鐨勫崟鍏冩牸濡傛灉涓嶅彲浠ョ紪杈戯紝鐩存帴缁撴潫缂栬緫
+      // 2020.10.12淇缁撴潫缂栬緫鏃讹紝element table楂樼増鏈睘鎬ц幏鍙栦笉鍒扮殑闂
+      let _col = this.columns.find((x) => {
+        return x.field == ((event && event.property) || column.property);
+      });
+      if (_col && (!_col.edit || _col.readonly)) {
+        if (this.rowEndEdit(row, event)) {
           this.edit.rowIndex = -1;
         }
-        //褰撴鍦ㄧ紪杈戯紝涓旂偣鍑诲埌鍏朵粬琛屾椂锛屽湪鍘熺紪杈戠殑琛岀粨鏉熺紪杈戝悗锛岃Е鍙戞柊琛岀殑rowClick浜嬩欢
-        //姝e湪缂栬緫鏃讹紝绂佹鍑哄彂rowClick浜嬩欢
-        if (this.edit.rowIndex == -1) {
-          this.$emit("rowClick", { row, column, event });
-        }
       }
-      this.rowBeginEdit(row, column);
-    },
+      return;
+    }
+    if (this.rowEndEdit(row, event && event.property ? event : column)) {
+      this.edit.rowIndex = -1;
+    }
+    //褰撴鍦ㄧ紪杈戯紝涓旂偣鍑诲埌鍏朵粬琛屾椂锛屽湪鍘熺紪杈戠殑琛岀粨鏉熺紪杈戝悗锛岃Е鍙戞柊琛岀殑rowClick浜嬩欢
+    //姝e湪缂栬緫鏃讹紝绂佹瑙﹀彂rowClick浜嬩欢
+    if (this.edit.rowIndex == -1) {
+      this.$emit("rowClick", { row, column, event });
+    }
+  }
+  this.rowBeginEdit(row, column);
+},
+
+    //   //姝e湪缂栬緫鏃讹紝绂佹鍑哄彂rowClick浜嬩欢
+    //   if (this.edit.rowIndex == -1) {
+    //     this.$emit("rowClick", { row, column, event });
+    //   }
+    //   // 鐐瑰嚮琛屼簨浠�(2020.11.07)
+
+    //   if (!this.doubleEdit) {
+    //     return;
+    //   }
+    //   // 鐐瑰嚮鍏朵粬琛屾椂锛屽鏋滅偣鍑荤殑琛屼笌姝e湪缂栬緫鐨勮鐩稿悓锛屼繚鎸佺紪杈戠姸鎬�
+    //   if (this.clickEdit && this.edit.rowIndex != -1) {
+    //     if (row.elementIndex == this.edit.rowIndex) {
+    //       // 鐐瑰嚮鐨勫崟鍏冩牸濡傛灉涓嶅彲浠ョ紪杈戯紝鐩存帴缁撴潫缂栬緫
+    //       // 2020.10.12淇缁撴潫缂栬緫鏃讹紝element table楂樼増鏈睘鎬ц幏鍙栦笉鍒扮殑闂
+    //       let _col = this.columns.find((x) => {
+    //         return x.field == ((event && event.property) || column.property);
+    //       });
+    //       if (_col && (!_col.edit || _col.readonly)) {
+    //         if (this.rowEndEdit(row, event)) {
+    //           this.edit.rowIndex = -1;
+    //         }
+    //       }
+    //       return;
+    //     }
+    //     if (this.rowEndEdit(row, event && event.property ? event : column)) {
+    //       this.edit.rowIndex = -1;
+    //     }
+    //     //褰撴鍦ㄧ紪杈戯紝涓旂偣鍑诲埌鍏朵粬琛屾椂锛屽湪鍘熺紪杈戠殑琛岀粨鏉熺紪杈戝悗锛岃Е鍙戞柊琛岀殑rowClick浜嬩欢
+    //     //姝e湪缂栬緫鏃讹紝绂佹鍑哄彂rowClick浜嬩欢
+    //     if (this.edit.rowIndex == -1) {
+    //       this.$emit("rowClick", { row, column, event });
+    //     }
+    //   }
+    //   this.rowBeginEdit(row, column);
+    // },
     dowloadFile(file) {
       this.base.dowloadFile(
         file.path,
@@ -1654,6 +1718,7 @@
       return column.edit.type == "date" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss";
     },
     userSelect(selection, row) {
+      console.log("userSelect", selection, row);
       this.selectRows = selection;
       if (!this.single) {
         this.$emit("rowChange", { row, selection });

--
Gitblit v1.9.3