Commit c386d214 authored by 皮倩雯's avatar 皮倩雯

fix: '角色管理限制内置角色权限'

parent 87b9cd2f
Pipeline #78042 passed with stages
......@@ -31,6 +31,7 @@ import {
UserAddOutlined,
WindowsOutlined,
IeOutlined,
InfoCircleOutlined,
} from '@ant-design/icons';
import {
setMenuToRole,
......@@ -101,19 +102,18 @@ const SiteManage = () => {
const { node } = treenode;
const { roleID: id } = node;
console.log(node);
debugger;
setItemObj(node);
if (node.BuiltInRole) {
setKeyValue('0');
}
setUserNewVisible(true);
console.log(id);
if (id) {
setSaveTreeId(id);
if (node.BuiltInRole === true && keyValue == 1) {
setRoleID('');
setDescrip('内置角色不可配置菜单权限');
setFlagSearch(0);
} else {
setRoleID(id);
setFlagSearch(1);
}
setRoleID(id);
setFlagSearch(1);
setValueList([...valueList]);
console.log([...valueList]);
} else {
......@@ -284,7 +284,7 @@ const SiteManage = () => {
{afterStr}
</div>
) : (
<div className={styles.titleTop}>{i.title}</div>
<div className={styles.titleTop}>{i.title}12</div>
)}
<div className={styles.tip}>
{i.roleID && (
......@@ -295,12 +295,15 @@ const SiteManage = () => {
onClick={e => editorUser(e, i)}
/>
</Tooltip>
<Tooltip title="删除角色" className={styles.fs}>
<DeleteOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
onClick={e => deletesUser(e, i)}
/>
</Tooltip>
{!i.BuiltInRole && (
<Tooltip title="删除角色" className={styles.fs}>
<DeleteOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
onClick={e => deletesUser(e, i)}
/>
</Tooltip>
)}
{/* <Tooltip title="关联用户" className={styles.fs}>
<UserAddOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
......@@ -369,7 +372,16 @@ const SiteManage = () => {
{afterStr}
</div>
) : (
<div className={styles.titleTop}>{itemRole.title}</div>
<div className={styles.titleTop}>
{itemRole.title}
{itemRole.description && (
<Tooltip title={itemRole.description}>
<InfoCircleOutlined
style={{ color: 'rgb(24, 144, 255)', marginLeft: '5px', marginTop: '3px' }}
/>
</Tooltip>
)}
</div>
)}
<div className={styles.tip}>
{itemRole.roleID && (
......@@ -380,12 +392,15 @@ const SiteManage = () => {
onClick={e => editorUser(e, itemRole)}
/>
</Tooltip>
<Tooltip title="删除角色" className={styles.fs}>
<DeleteOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
onClick={e => deletesUser(e, itemRole)}
/>
</Tooltip>
{!itemRole.BuiltInRole && (
<Tooltip title="删除角色" className={styles.fs}>
<DeleteOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
onClick={e => deletesUser(e, itemRole)}
/>
</Tooltip>
)}
{/* <Tooltip title="关联用户" className={styles.fs}>
<UserAddOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
......@@ -429,12 +444,15 @@ const SiteManage = () => {
onClick={e => editorUser(e, item)}
/>
</Tooltip>
<Tooltip title="删除角色" className={styles.fs}>
<DeleteOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
onClick={e => deletesUser(e, item)}
/>
</Tooltip>
{!item.BuiltInRole && (
<Tooltip title="删除角色" className={styles.fs}>
<DeleteOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
onClick={e => deletesUser(e, item)}
/>
</Tooltip>
)}
{/* <Tooltip title="关联用户" className={styles.fs}>
<UserAddOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
......@@ -528,14 +546,8 @@ const SiteManage = () => {
setItemObj(aa);
if (itemObj.roleID === currentSelectId[0]) {
if (prop == true) {
if (keyValue == 0) {
setRoleID(currentSelectId);
setFlagSearch(1);
} else {
setRoleID('');
setDescrip('内置角色不可配置菜单权限');
setFlagSearch(0);
}
setRoleID(currentSelectId);
setFlagSearch(1);
} else {
setRoleID(currentSelectId);
setFlagSearch(1);
......@@ -752,14 +764,8 @@ const SiteManage = () => {
setKeyValue(key);
const { roleID: id } = itemObj;
if (id) {
if (itemObj.BuiltInRole === true && key == 1) {
setRoleID('');
setDescrip('内置角色不可配置菜单权限');
setFlagSearch(0);
} else {
setRoleID(id);
setFlagSearch(1);
}
setRoleID(id);
setFlagSearch(1);
} else {
setRoleID('');
setDescrip('当前未选中角色');
......@@ -954,39 +960,51 @@ const SiteManage = () => {
</div>
)}
</TabPane>
<TabPane tab="菜单权限" key="1">
{flagSearch == 1 ? (
<Search
style={{ width: 260 }}
allowClear
value={searchWord}
placeholder={placeholder}
// onSearch={handleSearch}
onChange={handleChange}
enterButton
/>
) : (
<span />
)}
{roleID ? (
<div className={styles.cardBoxR}>
<ListCard
roleID={roleID}
loading={loading}
checkList={valueList}
dataList={dataList}
searchWord={searchWord}
onCommit={handleCommit}
btnLoading={btnLoading}
hasData={hasData}
{!itemObj.BuiltInRole && (
<TabPane tab="菜单权限" key="1">
{flagSearch == 1 ? (
<Search
style={{ width: 260 }}
allowClear
value={searchWord}
placeholder={placeholder}
// onSearch={handleSearch}
onChange={handleChange}
enterButton
/>
</div>
) : (
<span />
)}
{roleID ? (
<div className={styles.cardBoxR}>
<ListCard
roleID={roleID}
loading={loading}
checkList={valueList}
dataList={dataList}
searchWord={searchWord}
onCommit={handleCommit}
btnLoading={btnLoading}
hasData={hasData}
/>
</div>
) : (
<div className={styles.cardBoxH}>
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={descrip} />
</div>
)}
</TabPane>
)}
{/* <TabPane tab="菜单权限优化" key="2">
{roleID ? (
<div className={styles.cardBoxR} />
) : (
<div className={styles.cardBoxH}>
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={descrip} />
</div>
)}
</TabPane>
</TabPane> */}
</Tabs>
</Card>
</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