소스 검색

Ensures selection state resets before updating current page

yz 2 주 전
부모
커밋
94358215f8
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      src/views/order/factory/index.vue

+ 8 - 2
src/views/order/factory/index.vue

@@ -324,11 +324,17 @@ export default {
 
       // 委托给选择管理器处理
       if (selectionManager && this.lifecycleManager) {
+        // 1. 先移除当前页面的所有选择
+        const currentPageIds = this.data.map(item => item.id);
+        currentPageIds.forEach(id => {
+          selectionManager.removeSelection(id);
+        });
+
+        // 2. 然后重新添加当前页的选择
         selectionManager.mergeWithCurrentPage(list);
         this.updateSelectionUI();
 
-
-      // 【新增保护】当当前页选择为空时,确保avue-crud状态同步
+        // 当当前页选择为空时,确保avue-crud状态同步
         if (list.length === 0) {
           this.$nextTick(() => {
             // 延迟检查,确保选择管理器已处理完成