From 00af9af8bb4d049aff3ff06fd9f32ab454b3ec37 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 18 Nov 2024 14:39:31 +0200 Subject: [PATCH] fix role table, timeout --- client/src/views/role/record/table.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/views/role/record/table.js b/client/src/views/role/record/table.js index 8177abb36c..2f2bc53c76 100644 --- a/client/src/views/role/record/table.js +++ b/client/src/views/role/record/table.js @@ -865,7 +865,7 @@ class RoleRecordTableView extends View { .filter(item => this.levelList.indexOf(item) >= this.levelList.indexOf(limitValue)); if (!dontChange) { - this.formModel.set(attribute, value); + setTimeout(() => this.formModel.set(attribute, value), 0); } this.formRecordHelper.setFieldOptionList(attribute, options); @@ -1127,6 +1127,8 @@ class RoleRecordTableView extends View { this.showScopeActions(scope); + const attributes = {}; + this.actionList.forEach(action => { const memoryData = this.scopeLevelMemory[scope] || {}; const levelInMemory = memoryData[action]; @@ -1141,8 +1143,11 @@ class RoleRecordTableView extends View { level = [...this.getLevelList(scope, action)].pop(); } - this.formModel.set(`${scope}-${action}`, level); + attributes[`${scope}-${action}`] = level; }); + + // Need a timeout as it's processed within a change callback. + setTimeout(() => this.formModel.set(attributes), 0); } /**