Commit 1289f7d8 authored by cellee's avatar cellee

二级账户可以编辑下级但不可编辑自身

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 00ff682e
...@@ -29,7 +29,8 @@ const Account = (props: any) => { ...@@ -29,7 +29,8 @@ const Account = (props: any) => {
const [towAccountId, settowAccountId] = useState(null); // 二级账户id const [towAccountId, settowAccountId] = useState(null); // 二级账户id
//提醒次数 //提醒次数
const [frequency, setfrequency] = useState(0); // 权限列表 // const [frequency, setfrequency] = useState(0); // 权限列表
const [TreeDisabled, setTreeDisabled] = useState(true); // 权限是否可编辑
// 表单标识 // 表单标识
const [form] = Form.useForm(); const [form] = Form.useForm();
...@@ -56,6 +57,14 @@ const Account = (props: any) => { ...@@ -56,6 +57,14 @@ const Account = (props: any) => {
settowAccountId(DataSave.userLeader); //上级id settowAccountId(DataSave.userLeader); //上级id
} }
// 二级账户可以编辑下级但不可编辑自身
if (
user.currentUser.userModel.tosUserLevel == 1 ||
(user.currentUser.userModel.tosUserLevel == 2 && DataSave.tosUserLevel == 3)
) {
setTreeDisabled(false);
}
// 发起获取权限请求 // 发起获取权限请求
RA(54, { tosUserName: DataSave.tosUserName }, module, dispatch); // 发起获取权限请求 RA(54, { tosUserName: DataSave.tosUserName }, module, dispatch); // 发起获取权限请求
} else { } else {
...@@ -313,7 +322,7 @@ const Account = (props: any) => { ...@@ -313,7 +322,7 @@ const Account = (props: any) => {
cancelText: 'No', cancelText: 'No',
onOk() { onOk() {
setCheckedKeys(checkedKeys); setCheckedKeys(checkedKeys);
setfrequency(1); // setfrequency(1);
}, },
onCancel() {}, onCancel() {},
}); });
...@@ -451,7 +460,7 @@ const Account = (props: any) => { ...@@ -451,7 +460,7 @@ const Account = (props: any) => {
onSelect={onSelect} onSelect={onSelect}
selectedKeys={selectedKeys} selectedKeys={selectedKeys}
treeData={treeDataList} treeData={treeDataList}
disabled={user && user.currentUser.userModel.tosUserLevel != 1 ? true : false} disabled={TreeDisabled}
/> />
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment