Commit 790b67d1 authored by 皮倩雯's avatar 皮倩雯

fix: 'web配置关联角色增加多选,角色管理新增默认分组'

parent c1facb6f
Pipeline #44182 skipped with stages
...@@ -85,8 +85,10 @@ const RoalChoose = props => { ...@@ -85,8 +85,10 @@ const RoalChoose = props => {
}; };
// 复选框监听事件 // 复选框监听事件
const selectChange = (e, index, value) => { const selectChange = (e, index, value) => {
console.log(plainOptions);
let list = JSON.parse(JSON.stringify(plainOptions)); let list = JSON.parse(JSON.stringify(plainOptions));
list[index].isChecked = e.target.checked; list[index].isChecked = e.target.checked;
console.log(list);
// 存储勾选角色或站点信息 // 存储勾选角色或站点信息
if (e.target.checked) { if (e.target.checked) {
// 存储已选角色或站点的默认承办人 // 存储已选角色或站点的默认承办人
...@@ -106,6 +108,9 @@ const RoalChoose = props => { ...@@ -106,6 +108,9 @@ const RoalChoose = props => {
delArr.set(value.id, selected.get(value.id)); delArr.set(value.id, selected.get(value.id));
selected.delete(value.id); selected.delete(value.id);
} }
console.log(list);
console.log(selected);
console.log(list);
setDelArr(delArr); setDelArr(delArr);
setSelected(selected); setSelected(selected);
setPlainOptions(list); setPlainOptions(list);
......
...@@ -42,7 +42,7 @@ const VectorData = props => { ...@@ -42,7 +42,7 @@ const VectorData = props => {
return ( return (
<> <>
<Spin tip="loading..." spinning={treeLoading}> <Spin tip="loading..." spinning={treeLoading}>
<div style={{ height: '780px', overflow: 'scroll' }}> <div>
<div className={styles.tileBtn}> <div className={styles.tileBtn}>
<Button <Button
type="primary" type="primary"
...@@ -53,22 +53,24 @@ const VectorData = props => { ...@@ -53,22 +53,24 @@ const VectorData = props => {
新增 新增
</Button> </Button>
</div> </div>
<div className={styles.cardsList}> <div style={{ height: '700px', overflow: 'scroll' }}>
{tileData && tileData.length <div className={styles.cardsList}>
? tileData.map((item, index) => { {tileData && tileData.length
return ( ? tileData.map((item, index) => {
<div return (
className={styles.cardItem} <div
key={index} className={styles.cardItem}
span={5} key={index}
offset={2} span={5}
style={{ marginBottom: '1rem' }} offset={2}
> style={{ marginBottom: '1rem' }}
<Cards item={item} deletebaseMaps={onDeletebaseMap} /> >
</div> <Cards item={item} deletebaseMaps={onDeletebaseMap} />
); </div>
}) );
: ''} })
: ''}
</div>
</div> </div>
<AddModal <AddModal
visible={visible} visible={visible}
......
...@@ -17,11 +17,11 @@ import AddModal from './AddModal'; ...@@ -17,11 +17,11 @@ import AddModal from './AddModal';
const VectorData = props => { const VectorData = props => {
const [treeLoading, setTreeLoading] = useState(false); // 弹窗显示 const [treeLoading, setTreeLoading] = useState(false); // 弹窗显示
const [schemename, setSchemename] = useState([]); const [schemename, setSchemename] = useState([]);
const [record, setRecord] = useState({}); //选中关联角色的方案名 const [record, setRecord] = useState({}); // 选中关联角色的方案名
const [webCurrent, setWebCurrent] = useState(0); // web列表下标 const [webCurrent, setWebCurrent] = useState(0); // web列表下标
const [handCurrent, setHandCurrent] = useState(0); // hand列表下标 const [handCurrent, setHandCurrent] = useState(0); // hand列表下标
const [webData, setWebData] = useState([]); // web数据 const [webData, setWebData] = useState([]); // web数据
const [handData, setHandData] = useState([]); //手持数据 const [handData, setHandData] = useState([]); // 手持数据
const [visible, setVisible] = useState(false); // 弹窗 const [visible, setVisible] = useState(false); // 弹窗
const [flag, setFlag] = useState(0); // 更新list const [flag, setFlag] = useState(0); // 更新list
const [handStatus, setHandStatus] = useState([]); // 更新状态 const [handStatus, setHandStatus] = useState([]); // 更新状态
...@@ -416,6 +416,7 @@ const VectorData = props => { ...@@ -416,6 +416,7 @@ const VectorData = props => {
columns={columns} columns={columns}
dataSource={webData} dataSource={webData}
bordered bordered
style={{ height: 'calc(100vh - 230px)' }}
pagination={{ pagination={{
showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`, showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`,
defaultPageSize: 8, defaultPageSize: 8,
...@@ -424,7 +425,7 @@ const VectorData = props => { ...@@ -424,7 +425,7 @@ const VectorData = props => {
}, },
}} }}
rowKey={(record, index) => record.scheme.schemename} rowKey={(record, index) => record.scheme.schemename}
scroll={{ y: 600 }} scroll={{ y: 300 }}
/> />
</div> </div>
{/* <Divider orientation="left"><div className={styles.divider}>手持 <PlusOutlined {/* <Divider orientation="left"><div className={styles.divider}>手持 <PlusOutlined
......
...@@ -46,7 +46,7 @@ const VectorData = props => { ...@@ -46,7 +46,7 @@ const VectorData = props => {
return ( return (
<> <>
<Spin tip="loading..." spinning={treeLoading}> <Spin tip="loading..." spinning={treeLoading}>
<div> <div style={{ height: '780px', overflow: 'scroll' }}>
<div className={styles.tileBtn}> <div className={styles.tileBtn}>
<Button <Button
type="primary" type="primary"
......
...@@ -250,7 +250,7 @@ const ProjectManage = props => { ...@@ -250,7 +250,7 @@ const ProjectManage = props => {
}; };
const onTypeChange = value => { const onTypeChange = value => {
if (value == '全部') { if (value == '全部') {
setCurrentType(''); setCurrentType('全部');
GetMessageList({ pageIndex, pageSize: 10 }); GetMessageList({ pageIndex, pageSize: 10 });
} else { } else {
GetMessageList({ GetMessageList({
...@@ -264,7 +264,7 @@ const ProjectManage = props => { ...@@ -264,7 +264,7 @@ const ProjectManage = props => {
}; };
const onNameChange = value => { const onNameChange = value => {
if (value == '全部') { if (value == '全部') {
setCurrentName(''); setCurrentName('全部');
GetMessageList({ pageIndex, pageSize: 10 }); GetMessageList({ pageIndex, pageSize: 10 });
} else { } else {
GetMessageList({ GetMessageList({
......
...@@ -253,7 +253,11 @@ const TemplateManage = () => { ...@@ -253,7 +253,11 @@ const TemplateManage = () => {
const placeholder = '请输入模板名称'; const placeholder = '请输入模板名称';
const handleSearch = value => { const handleSearch = value => {
setValue(value); setValue(value);
getTemplateList({ queryInfo: value }); if (currentType == '全部') {
getTemplateList({ queryInfo: value });
} else {
getTemplateList({ queryInfo: value, tempType: currentType });
}
setShowSearchStyle(true); setShowSearchStyle(true);
}; };
const handleReset = () => { const handleReset = () => {
...@@ -267,7 +271,7 @@ const TemplateManage = () => { ...@@ -267,7 +271,7 @@ const TemplateManage = () => {
}; };
const handleSelectType = value => { const handleSelectType = value => {
if (value === '全部') { if (value === '全部') {
setCurrentType(''); setCurrentType('全部');
getTemplateList(); getTemplateList();
} else { } else {
getTemplateList({ tempType: value }); getTemplateList({ tempType: value });
......
.formStyle{ .formStyle {
margin-bottom: 40px; margin-bottom: 40px;
padding-bottom: 30px; padding-bottom: 30px;
} }
.rolebox{ .rolebox {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: nowrap; flex-wrap: nowrap;
} }
\ No newline at end of file .cardItemData {
display: flex;
justify-content: space-around;
width: 100%;
padding: 1rem;
border: 1px solid #b5b8c8;
margin-bottom: 1rem;
overflow-x: scroll;
}
.divBox {
// display: flex;
width: 100%;
flex-wrap: wrap;
border: 1px solid #c2cdfd;
border-radius: 5px;
margin-top: 20px;
min-height: 50px;
padding: 0 10px 10px 20px;
.ant-checkbox-wrapper {
background-color: #fff;
}
.topCheckbox {
height: 20px;
margin: -10px 0 0 0px;
line-height: 20px;
}
.topCheckbox > label :hover {
font-weight: 600;
}
.checkdiv {
display: flex;
flex-wrap: wrap;
// margin-left: 20px;
// justify-content: space-between;
}
}
.boe {
border: 1px solid #d9d9d9;
width: 93%;
margin-left: 3%;
}
...@@ -35,6 +35,7 @@ const MiniMenu = props => { ...@@ -35,6 +35,7 @@ const MiniMenu = props => {
const [menuID, setMenuID] = useState(''); // 选中的树ID const [menuID, setMenuID] = useState(''); // 选中的树ID
const [nodeType, setNodeType] = useState(''); // 选中的节点类型 const [nodeType, setNodeType] = useState(''); // 选中的节点类型
const [info, setInfo] = useState({}); const [info, setInfo] = useState({});
const [infoAll, setInfoAll] = useState({});
const [importOrExportVisible, setImportOrExportVisible] = useState(false); // 导入导出弹窗 const [importOrExportVisible, setImportOrExportVisible] = useState(false); // 导入导出弹窗
const [addVisible, setAddVisible] = useState(false); // 新增弹窗 const [addVisible, setAddVisible] = useState(false); // 新增弹窗
const [addTwoVisible, setAddTwoVisible] = useState(false); // 编辑弹窗 const [addTwoVisible, setAddTwoVisible] = useState(false); // 编辑弹窗
...@@ -46,6 +47,8 @@ const MiniMenu = props => { ...@@ -46,6 +47,8 @@ const MiniMenu = props => {
const [modalLoading, setModalLoading] = useState(false); const [modalLoading, setModalLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const [newTreeList, setNewTreeList] = useState([]); const [newTreeList, setNewTreeList] = useState([]);
const [checkList, setCheckList] = useState([]);
const [flagg, setFlagg] = useState(0);
const [menuList, setMenuList] = useState([]); // 菜单树 const [menuList, setMenuList] = useState([]); // 菜单树
...@@ -141,7 +144,26 @@ const MiniMenu = props => { ...@@ -141,7 +144,26 @@ const MiniMenu = props => {
.then(res => { .then(res => {
setLoading(false); setLoading(false);
if (res.code === 0) { if (res.code === 0) {
setInfo({ ...res.data }); let infoList = res.data.relatedRoleList.map(item => ({
groupName: item.groupName,
isChecked: item.isChecked,
list: item.list,
checkedList: new Set([]),
}));
setInfo(infoList);
setInfoAll({ ...res.data });
let data = new Set();
infoList.map(item => {
if (item.isChecked == true) {
data.add(item.groupName);
}
item.list.map(i => {
if (i.related) {
item.checkedList.add(i.relatedRoleCode);
}
});
});
setCheckList(data);
} else { } else {
notification.error({ notification.error({
message: '提示', message: '提示',
...@@ -285,8 +307,9 @@ const MiniMenu = props => { ...@@ -285,8 +307,9 @@ const MiniMenu = props => {
setLoading(true); setLoading(true);
let baseUrl = handleGeturl(prop.imageUrl); let baseUrl = handleGeturl(prop.imageUrl);
let obj = { ...prop, baseUrl }; let obj = { ...prop, baseUrl };
console.log(obj);
if (nodeType === 1) { if (nodeType === 1) {
obj.relatedRoleList = String(roleList) || ''; // obj.relatedRoleList = roleList || '';
editWebMenu({ editWebMenu({
_dc: Date.now(), _dc: Date.now(),
menuID: Number(menuID), menuID: Number(menuID),
...@@ -295,7 +318,6 @@ const MiniMenu = props => { ...@@ -295,7 +318,6 @@ const MiniMenu = props => {
}) })
.then(res => { .then(res => {
setLoading(false); setLoading(false);
if (res.code === 0) { if (res.code === 0) {
// setFlag(flag + 1); // setFlag(flag + 1);
getTree(); getTree();
...@@ -331,7 +353,6 @@ const MiniMenu = props => { ...@@ -331,7 +353,6 @@ const MiniMenu = props => {
}) })
.then(res => { .then(res => {
setLoading(false); setLoading(false);
if (res.code === 0) { if (res.code === 0) {
// setFlag(flag + 1); // setFlag(flag + 1);
getTree(); getTree();
...@@ -357,14 +378,15 @@ const MiniMenu = props => { ...@@ -357,14 +378,15 @@ const MiniMenu = props => {
} }
}; };
const valueCallback = val => { const valueCallback = val => {
let arr = [...val]; console.log(val);
let arr2 = []; // let arr = [...val];
arr.map(item => { // let arr2 = [];
if (item.related) { // arr.map(item => {
arr2.push(item.relatedRoleCode); // if (item.related) {
} // arr2.push(item.relatedRoleCode);
}); // }
setRoleList(arr2); // });
setRoleList(val.toString());
}; };
// 返回拖拽完毕后的信息 // 返回拖拽完毕后的信息
const loop = (data, key, parentID, callback) => { const loop = (data, key, parentID, callback) => {
...@@ -612,6 +634,8 @@ const MiniMenu = props => { ...@@ -612,6 +634,8 @@ const MiniMenu = props => {
<EditForm <EditForm
nodeType={nodeType} nodeType={nodeType}
info={info} info={info}
infoAll={infoAll}
checkList={checkList}
configFiles={configFiles} configFiles={configFiles}
productList={productList} productList={productList}
submitCallback={editSubmitCallback} submitCallback={editSubmitCallback}
......
...@@ -65,6 +65,7 @@ const SiteManage = () => { ...@@ -65,6 +65,7 @@ const SiteManage = () => {
const [mulu, setMulu] = useState(true); // 展示目录 const [mulu, setMulu] = useState(true); // 展示目录
const [siteList, setSiteList] = useState([]); const [siteList, setSiteList] = useState([]);
const [disFlag, setDisFlag] = useState(false); const [disFlag, setDisFlag] = useState(false);
// const [childData, setChildData] = useState({visibleValue:''})
// 点击树的回调 // 点击树的回调
const handleTreeSelect = (e, treenode) => { const handleTreeSelect = (e, treenode) => {
...@@ -114,10 +115,34 @@ const SiteManage = () => { ...@@ -114,10 +115,34 @@ const SiteManage = () => {
getRoleGroupList({ userID: '1' }).then(res => { getRoleGroupList({ userID: '1' }).then(res => {
setSpinLoading(false); setSpinLoading(false);
if (res.code === 0) { if (res.code === 0) {
console.log(res.data.roleList);
res.data.roleList.map((i, j) => {
console.log(i);
if (i.child.length == 0) {
let childData = { visibleTitle: '默认分组', roleList: [] };
childData.visibleValue = i.visibleValue;
i.child.push(childData);
} else {
let arr = [];
i.child.map(k => {
arr.push(k.visibleTitle);
// if (k.visibleTitle != '默认分组') {
// console.log(11);
// let childData = { visibleTitle: '默认分组', roleList: [] };
// childData.visibleValue = i.visibleValue;
// i.child.push(childData);
// }
});
if (arr.indexOf('默认分组') == -1) {
let childData = { visibleTitle: '默认分组', roleList: [] };
childData.visibleValue = i.visibleValue;
i.child.push(childData);
}
}
});
console.log(res.data.roleList);
const { roleList } = res.data; const { roleList } = res.data;
let arr = transTree(roleList); let arr = transTree(roleList);
console.log(roleList);
console.log(arr);
setTreeData(arr); setTreeData(arr);
} }
}); });
...@@ -198,6 +223,7 @@ const SiteManage = () => { ...@@ -198,6 +223,7 @@ const SiteManage = () => {
// 树形数据转换; // 树形数据转换;
const transTree = val => { const transTree = val => {
let arr = val; let arr = val;
console.log(arr);
let newArr = []; let newArr = [];
// 提取child里面的数组 // 提取child里面的数组
let arr2 = arr.filter(item => { let arr2 = arr.filter(item => {
...@@ -273,7 +299,7 @@ const SiteManage = () => { ...@@ -273,7 +299,7 @@ const SiteManage = () => {
/> />
</Tooltip> </Tooltip>
)} )}
{i.groupflag && ( {i.groupflag && i.groupflag != '默认分组' && (
<Tooltip title="编辑分组" className={styles.fs}> <Tooltip title="编辑分组" className={styles.fs}>
<EditOutlined <EditOutlined
style={{ fontSize: '16px', color: '#1890FF' }} style={{ fontSize: '16px', color: '#1890FF' }}
...@@ -338,7 +364,7 @@ const SiteManage = () => { ...@@ -338,7 +364,7 @@ const SiteManage = () => {
/> />
</Tooltip> </Tooltip>
)} )}
{itemRole.groupflag && ( {itemRole.groupflag && itemRole.groupflag != '默认分组' && (
<Tooltip title="编辑分组" className={styles.fs}> <Tooltip title="编辑分组" className={styles.fs}>
<EditOutlined <EditOutlined
style={{ fontSize: '16px', color: '#1890FF' }} style={{ fontSize: '16px', color: '#1890FF' }}
...@@ -387,7 +413,7 @@ const SiteManage = () => { ...@@ -387,7 +413,7 @@ const SiteManage = () => {
/> />
</Tooltip> </Tooltip>
)} )}
{item.groupflag && ( {item.groupflag && item.groupflag != '默认分组' && (
<Tooltip title="编辑分组" className={styles.fs}> <Tooltip title="编辑分组" className={styles.fs}>
<EditOutlined <EditOutlined
style={{ fontSize: '16px', color: '#1890FF' }} style={{ fontSize: '16px', color: '#1890FF' }}
......
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