feat(权限): 导入权限自动绑定新增和编辑

This commit is contained in:
baiqi 2024-08-08 17:37:11 +08:00 committed by 刘瑞斌
parent 62e7754bed
commit bc82f4be72
1 changed files with 9 additions and 0 deletions

View File

@ -366,12 +366,21 @@
record.perChecked.push(currentValue);
const preStr = currentValue.split(':')[0];
const postStr = currentValue.split(':')[1];
const lastEditStr = currentValue.split('+')[1]; // +
const existRead = record.perChecked.some(
(item: string) => item.split(':')[0] === preStr && item.split(':')[1] === 'READ'
);
const existCreate = record.perChecked.some(
(item: string) => item.split(':')[0] === preStr && item.split(':')[1] === 'ADD'
);
if (!existRead && postStr !== 'READ') {
record.perChecked.push(`${preStr}:READ`);
}
if (!existCreate && lastEditStr === 'IMPORT') {
//
record.perChecked.push(`${preStr}:ADD`);
record.perChecked.push(`${preStr}:READ+UPDATE`);
}
} else {
//
const preStr = currentValue.split(':')[0];