|
|
@@ -326,6 +326,26 @@ export default {
|
|
|
if (selectionManager && this.lifecycleManager) {
|
|
|
selectionManager.mergeWithCurrentPage(list);
|
|
|
this.updateSelectionUI();
|
|
|
+
|
|
|
+
|
|
|
+ // 【新增保护】当当前页选择为空时,确保avue-crud状态同步
|
|
|
+ if (list.length === 0) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 延迟检查,确保选择管理器已处理完成
|
|
|
+ const actualCount = selectionManager.getSelectionCount();
|
|
|
+
|
|
|
+ // 如果选择管理器仍有数据(异常情况),强制清空
|
|
|
+ if (actualCount > 0) {
|
|
|
+ console.warn('FactoryOrder: 检测到选择状态不一致,强制同步');
|
|
|
+ // 双重确保清空
|
|
|
+ if (this.$refs.crud) {
|
|
|
+ this.$refs.crud.clearSelection();
|
|
|
+ }
|
|
|
+ // 强制同步UI
|
|
|
+ this.updateSelectionUI();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
/** 页码变化:保持搜索条件不丢失并重新加载 */
|