huangbin před 4 roky
rodič
revize
acf6cf209c

+ 4 - 1
src/common/setup/table/event.ts

@@ -28,5 +28,8 @@ export function getTableEvent<T>(param: TableEventCB) {
             },
         };
     }
-    return { expandedRowKeys, selectedRow, Rowclick }
+    function btnClick(record: T) {
+        selectedRow.value = record
+    }
+    return { expandedRowKeys, selectedRow, Rowclick, btnClick }
 }

+ 4 - 0
src/views/information/account_info/compoments/managers-permission/index.vue

@@ -18,6 +18,10 @@
              class="dialogTable"
              :data-source="tableList"
              :pagination="false">
+      <!-- 额外的展开行 -->
+      <template #expandedRowRender="{  }">
+        <!-- <BtnList :btnList="forDataBtn" /> -->
+      </template>
     </a-table>
   </a-modal>
 </template>

+ 6 - 3
src/views/information/warehouse-info/list/normal-use/index.vue

@@ -14,8 +14,10 @@
                rowKey="key"
                :data-source="tableList">
         <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
+        <template #expandedRowRender="{ record }">
+          <BtnList :selectedData="record"
+                   :btnList="forDataBtn"
+                   @onClick="btnClick" />
         </template>
         <template #warehousetype="{ text }">
           <span>{{ getWareHouseTypeName(text) }}</span>
@@ -60,7 +62,7 @@ export default defineComponent({
         // 表头数据
         const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<ErmcpWareHouseInfo>({});
+        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<ErmcpWareHouseInfo>({});
         // 表格操作按钮列表
         const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
         // 表格列表数据
@@ -93,6 +95,7 @@ export default defineComponent({
             getWareHouseTypeName,
             gerWareHouseStatusName,
             queryTable,
+            btnClick,
         };
     },
 });