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

fix: '角色管理选中系统分组下角色时不展示关联菜单权限'

parent e0ec9b25
Pipeline #45286 skipped with stages
import React, { useEffect, useState, useRef } from 'react';
import SiteModal from '@/components/Modal/SiteModa';
import { Input, Cascader, Button } from 'antd';
import {
gcj_decrypt,
exetent2AmapPoint,
lngLat2WebMercator,
} from '@/utils/transformUtil';
import { gcj_decrypt, exetent2AmapPoint, lngLat2WebMercator } from '@/utils/transformUtil';
import { GetAllConfig, GetMetaData } from '@/services/gis/gis';
const { Search } = Input;
import styles from './index.less';
......@@ -54,10 +50,7 @@ const MapScope = props => {
const layers = res2.layers || [];
const workspace = res2.mapName.split('_')[0];
const subLayers = layers
.filter(
layer =>
layer.subLayerIds && layer.subLayerIds.length === 0,
)
.filter(layer => layer.subLayerIds && layer.subLayerIds.length === 0)
.map(layer => layer.name);
const paramLayers = `${workspace}:${subLayers.join(',')}`;
const params = {
......@@ -68,9 +61,7 @@ const MapScope = props => {
console.log('params', params);
const wmsOption = {
tileSize: 512,
url: `${
location.origin
}/Cityinterface/rest/services/MapServer.svc/${
url: `${location.origin}/Cityinterface/rest/services/MapServer.svc/${
pipenetCofig.servicename
}/GeoServerProxy/wms`,
blend: false,
......@@ -200,17 +191,16 @@ const MapScope = props => {
});
};
const filter = (inputValue, path) => {
return path.some(
option =>
option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1,
);
return path.some(option => option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
};
return (
<SiteModal
{...props}
title={
<span>
<span style={{ marginRight: '20px' }}>{title}的范围选择</span>
<span style={{ marginRight: '20px' }}>
<span style={{ fontWeight: 'blod', color: 'red' }}>{title}</span>的范围选择
</span>
<span style={{ color: 'red' }}>提示:必须框选范围</span>
</span>
}
......@@ -224,10 +214,7 @@ const MapScope = props => {
okText="确认"
onOk={() => onSubmit()}
>
<div
style={{ width: '750px', height: '500px' }}
className={styles.indexContainer}
>
<div style={{ width: '750px', height: '500px' }} className={styles.indexContainer}>
<div style={{ width: '750px', height: '500px', position: 'absolute' }}>
<div id={mapId} style={{ width: '750px', height: '500px' }} />
......
......@@ -79,7 +79,7 @@
padding: 10px 24px 0px 24px;
}
.ant-modal-footer {
padding: 0px 48px 10px 40px;
padding: 10px 48px 10px 40px;
}
.ant-table-pagination.ant-pagination {
margin: 5px 0;
......
......@@ -60,6 +60,7 @@ const SiteManage = () => {
const [saveTreeId, setSaveTreeId] = useState(''); // 保存点击回调的roleid
const [modalVisible, setModalVisible] = useState(false); // 新增弹窗
const [flag, setFlag] = useState(1);
const [flagSearch, setFlagSearch] = useState(0);
const [itemObj, setItemObj] = useState(''); // 选择的角色item
const [delVisible, setDelVisible] = useState(false); // 删除弹窗
const [editVisible, setEditVisible] = useState(false); // 修改弹窗
......@@ -77,21 +78,35 @@ const SiteManage = () => {
const [mulu, setMulu] = useState(true); // 展示目录
const [siteList, setSiteList] = useState([]);
const [disFlag, setDisFlag] = useState(false);
const [chileID, setChildID] = useState([]);
const [descrip, setDescrip] = useState('当前未选中角色');
// const [childData, setChildData] = useState({visibleValue:''})
// 点击树的回调
const handleTreeSelect = (e, treenode) => {
console.log(e);
console.log(treenode);
if (treenode) {
const { node } = treenode;
const { roleID: id } = node;
setItemObj(node);
let aa = chileID.find(i => i.roleID === id);
if (id) {
setSaveTreeId(id);
setRoleID(id);
setValueList([...valueList]);
if (aa) {
setRoleID('');
setDescrip('系统分组下的角色不可配置菜单权限也不能被关联');
setFlagSearch(0);
} else {
setRoleID(id);
setFlagSearch(1);
}
} else {
// setRoleID(saveTreeId);
setRoleID('');
setDescrip('当前未选中角色');
setFlagSearch(0);
}
}
......@@ -147,10 +162,27 @@ const SiteManage = () => {
}
}
});
console.log(res.data.roleList);
const { roleList } = res.data;
let arr = transTree(roleList);
setTreeData(arr);
console.log(arr);
let dataA = [];
arr.map(i => {
console.log(i.child);
dataA.push(i.child.find(j => j.visibleTitle === '系统分组'));
// if (i.child.find(j => j.visibleTitle === '系统分组')) {
// data.push(j);
// }
});
console.log(dataA);
let Arr = [];
dataA.map(i => {
i.children.map(j => {
Arr.push(j);
});
});
console.log(Arr);
setChildID(Arr);
}
});
};
......@@ -795,6 +827,7 @@ const SiteManage = () => {
>
<Row align="middle">
<Col span={8}>
{flagSearch == 1 ? (
<Search
allowClear
placeholder={placeholder}
......@@ -802,6 +835,9 @@ const SiteManage = () => {
onChange={handleChange}
enterButton
/>
) : (
<span />
)}
</Col>
<Col span={3} />
</Row>
......@@ -823,7 +859,7 @@ const SiteManage = () => {
hasData={hasData}
/>
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="当前未选中角色" />
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={descrip} />
)}
</Card>
</div>
......
import React, { useState, useCallback, useEffect } from 'react';
import { Modal, Spin, Tabs, notification, message, Checkbox, Divider } from 'antd';
import {
SetUserRelationList,
setUserRelation,
setUserRelations,
} from '@/services/userManage/api';
import { SetUserRelationList, setUserRelation, setUserRelations } from '@/services/userManage/api';
import ListCardItem from './components/listCardItem';
const CheckboxGroup = Checkbox.Group;
......@@ -45,6 +41,7 @@ const RelateRoleModal = props => {
}, []);
useEffect(() => {
console.log(currentUser);
console.log(multiRoleList);
console.log(multistationList);
}, [visible]);
......@@ -129,7 +126,9 @@ const RelateRoleModal = props => {
);
const title1 = (
<span>
<span>关联角色{currentUser.loginName}</span>
<span>
关联角色<span style={{ fontWeight: 'bold', color: 'red' }}>{currentUser.userName}</span>
</span>
</span>
);
if (mult == 'Yes') {
......
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