mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-03 20:49:56 +08:00
feat(权限): 导入权限自动绑定新增和编辑
This commit is contained in:
parent
62e7754bed
commit
bc82f4be72
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user