From 035f2a81a59532ac9f892dab9ade44304847b4fb Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 06 四月 2026 11:11:36 +0800
Subject: [PATCH] 重构输送线选择器;添加表格展开功能

---
 Code/WMS/WIDESEA_WMSClient/src/components/basic/VolTable.vue |   43 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSClient/src/components/basic/VolTable.vue b/Code/WMS/WIDESEA_WMSClient/src/components/basic/VolTable.vue
index 0622c7c..7d4f846 100644
--- a/Code/WMS/WIDESEA_WMSClient/src/components/basic/VolTable.vue
+++ b/Code/WMS/WIDESEA_WMSClient/src/components/basic/VolTable.vue
@@ -21,6 +21,7 @@
       @select="userSelect"
       @select-all="userSelect"
       @selection-change="selectionChange"
+      @expand-change="expandChange"
       @row-dblclick="rowDbClick"
       @row-click="rowClick"
       @header-click="headerClick"
@@ -38,6 +39,24 @@
       style="width: 100%"
       :scrollbar-always-on="true"
     >
+      <el-table-column
+        v-if="showExpand"
+        type="expand"
+        :fixed="expand.fixed"
+        :width="expand.width || 55"
+      >
+        <template #default="scope">
+          <div class="expand-cell">
+            <table-render
+              v-if="expand.render && typeof expand.render == 'function'"
+              :row="scope.row"
+              :index="scope.$index"
+              :column="expand"
+              :render="expand.render"
+            ></table-render>
+          </div>
+        </template>
+      </el-table-column>
       <el-table-column
         v-if="ck"
         type="selection"
@@ -489,6 +508,10 @@
 import VolTableRender from "./VolTable/VolTableRender";
 let _errMsg;
 import { defineComponent, defineAsyncComponent } from "vue";
+
+const tableErrorImg = new URL("../../assets/imgs/error.png", import.meta.url)
+  .href;
+
 export default defineComponent({
   //https://github.com/element-plus/element-plus/issues/1483
   //娌℃湁鍘熷厛鐨剆election灞炴�т簡锛岀湅issue涓婁娇鐢╯elect/selectall鑾峰彇
@@ -553,6 +576,12 @@
       type: Function,
       default: function () {
         return 1;
+      },
+    },
+    expand: {
+      type: Object,
+      default: () => {
+        return {};
       },
     },
     pagination: {
@@ -660,7 +689,7 @@
       realMaxHeight: 0,
       enableEdit: false, // 鏄惁鍚〃鏍肩敤缂栬緫鍔熻兘
       empty: this.allowEmpty ? "" : "--",
-      defaultImg: 'this.src="' + require("@/assets/imgs/error.png") + '"',
+      defaultImg: `this.src="${tableErrorImg}"`,
       loading: false,
       footer: {},
       total: 0,
@@ -830,6 +859,9 @@
     this.defaultLoadPage && this.load();
   },
   computed: {
+    showExpand() {
+      return !!(this.expand && typeof this.expand.render === "function");
+    },
     filterColumns() {
       return this.columns.filter((x, index) => {
         if (!x.field) {
@@ -840,6 +872,12 @@
     },
   },
   methods: {
+    expandChange(row, expandedRows) {
+      if (this.expand && typeof this.expand.onChange === "function") {
+        this.expand.onChange(row, expandedRows, this);
+      }
+      this.$emit("expandChange", { row, expandedRows });
+    },
     watchRowSelectChange(newLen, oldLen) {
       if (newLen < oldLen && this.selectRows.length) {
         this.selectRows = [];
@@ -1780,6 +1818,9 @@
   border-bottom: 1px solid;
   padding-bottom: 2px;
 }
+.vol-table .expand-cell {
+  padding: 8px 0;
+}
 .vol-table .empty-tag {
   border: none;
   background: none;

--
Gitblit v1.9.3