Commit e2719255 authored by 张烨's avatar 张烨
parents f8dd3d06 ded44389
...@@ -31,7 +31,7 @@ import ListCardItem from '../orgnazation/listCardItem'; ...@@ -31,7 +31,7 @@ import ListCardItem from '../orgnazation/listCardItem';
import styles from './AppMenu.less'; import styles from './AppMenu.less';
import PicturesWall from '@/components/Upload/index'; import PicturesWall from '@/components/Upload/index';
const SevenParams = () => { const AppMenu = () => {
const [treeLoading, setTreeLoading] = useState(true); const [treeLoading, setTreeLoading] = useState(true);
const [treeData, setTreeData] = useState([]); // 菜单树 const [treeData, setTreeData] = useState([]); // 菜单树
...@@ -47,6 +47,7 @@ const SevenParams = () => { ...@@ -47,6 +47,7 @@ const SevenParams = () => {
const [addMenuVisible, setAddMenuVisible] = useState(false); const [addMenuVisible, setAddMenuVisible] = useState(false);
const [addMenuGroupVisible, setAddMenuGroupVisible] = useState(false); const [addMenuGroupVisible, setAddMenuGroupVisible] = useState(false);
const [tipVisible, setTipVisible] = useState(false); const [tipVisible, setTipVisible] = useState(false);
const [deleteMenuVisible, setDeleteMenuVisible] = useState(false); const [deleteMenuVisible, setDeleteMenuVisible] = useState(false);
const [addMenuForm] = Form.useForm(); const [addMenuForm] = Form.useForm();
...@@ -534,8 +535,148 @@ const SevenParams = () => { ...@@ -534,8 +535,148 @@ const SevenParams = () => {
</div> </div>
<div className={styles.previewContainer}>界面预览</div> <div className={styles.previewContainer}>界面预览</div>
{/* 必填项提示 */} {/* 必填项提示 */}
<Modal
title="提示"
visible={tipVisible}
onCancel={() => setTipVisible(false)}
width="300px"
styles={{ zIndex: 999999 }}
centered
footer={[
<Button
key="back"
type="primary"
onClick={() => setTipVisible(false)}
>
关闭
</Button>,
]}
>
<p>
标记<span className={styles.redText}>*</span>的为必填
</p>
</Modal>
{/* 添加菜单 */}
<Modal
title={menuTitle}
visible={addMenuVisible}
onOk={submitAddMenu}
onCancel={() => setAddMenuVisible(false)}
okText="确认"
cancelText="取消"
centered
>
<Form form={addMenuForm} labelCol={{ span: 4 }}>
<Form.Item
name="menuName"
label="菜单名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入菜单名称" />
</Form.Item>
<Form.Item
name="shortName"
label="菜单别名"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入菜单别名" />
</Form.Item>
<Form.Item
name="imageUrl"
label="菜单图标"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入菜单图标" />
</Form.Item>
<Form.Item
name="pageUrl"
label="功能路径"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入菜单图标" />
</Form.Item>
<Form.Item label="图标预览">
<PicturesWall maxLen={3} />
</Form.Item>
<Form.Item name="funParam" label="功能参数">
<Input placeholder="请输入功能参数" />
</Form.Item>
</Form>
<ListCardItem
itemid="1"
key="1"
userList={rolelist}
OUName="关联角色"
getValueCallback={getRoleValueCallback}
/>
</Modal>
{/* 添加菜单组 */}
<Modal
title={menuTitle}
visible={addMenuGroupVisible}
onOk={submitAddMenuGroup}
onCancel={() => setAddMenuGroupVisible(false)}
okText="确认"
cancelText="取消"
centered
>
<Form form={addMenuGroupForm} labelCol={{ span: 4 }}>
<Form.Item
name="menuName"
label="分组名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入分组名称" />
</Form.Item>
<Form.Item
name="shortName"
label="分组别名"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入分组别名" />
</Form.Item>
<Form.Item
name="imageUrl"
label={menuLabel}
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入菜单图标" />
</Form.Item>
<Form.Item label="图标预览">
<PicturesWall maxLen={3} />
</Form.Item>
{/* 添加菜单组,label名称为在线图标才有离线图标 */}
{menuLabel === '在线图标' && (
<Form.Item
name="offlineImgUrl"
label="离线图标"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入离线图标" />
</Form.Item>
)}
<Form.Item label="图标预览">
<PicturesWall maxLen={3} />
</Form.Item>
<Form.Item name="funParam" label="功能参数">
<Input placeholder="请输入功能参数" />
</Form.Item>
</Form>
</Modal>
{/* 删除菜单 */}
<Modal
title={menuTitle}
visible={deleteMenuVisible}
onOk={submitDeleteMenu}
onCancel={() => setDeleteMenuVisible(false)}
okText="确认"
cancelText="取消"
centered
>
<span>确定删除?</span>
</Modal>
</div> </div>
); );
}; };
export default SevenParams; export default AppMenu;
...@@ -208,7 +208,7 @@ const SevenParams = () => { ...@@ -208,7 +208,7 @@ const SevenParams = () => {
form={sevenForm} form={sevenForm}
labelCol={{ span: 2, offset: 2 }} labelCol={{ span: 2, offset: 2 }}
wrapperCol={{ span: 16, offset: 1 }} wrapperCol={{ span: 16, offset: 1 }}
style={{ height: 'calc(100vh - 300px)' }} style={{ height: 'calc(100vh - 300px)', overflow: 'auto' }}
onFinish={submitSevenParams} onFinish={submitSevenParams}
initialValues={{ ellipseType: '1', transType: '1' }} initialValues={{ ellipseType: '1', transType: '1' }}
> >
......
.contentContainer{ .contentContainer{
// min-height: calc(100vh - 194px); max-height: calc(100vh - 300px);
overflow-x: auto;
display: flex; display: flex;
.menuContainer{ .menuContainer{
min-width: 300px; min-width: 300px;
border:1px solid #abaeb1; border:1px solid #abaeb1;
min-height:calc(100vh - 300px); // min-height:calc(100vh - 300px);
overflow-y:auto; overflow-y:auto;
.ant-tree-list{ .ant-tree-list{
padding: 10px; padding: 10px;
height:calc(100vh - 300px); height:calc(100vh - 330px);
.ant-tree-switcher{ .ant-tree-switcher{
line-height: 1; line-height: 1;
color:#1890FF; color:#1890FF;
...@@ -19,11 +20,23 @@ ...@@ -19,11 +20,23 @@
} }
} }
} }
.previewContainer{ .editContainer{
margin-left: 12px; margin-left: 12px;
flex: 1; flex: 1;
padding: 16px;
float: left; float: left;
// background: white; min-width: 500px;
border:1px solid #abaeb1;
.ant-table-pagination-right{
padding-right: 12px;
}
}
.previewContainer{
margin-left: 12px;
// flex: 1;
float: left;
min-width: 400px;
border:1px solid #abaeb1;
.ant-table-pagination-right{ .ant-table-pagination-right{
padding-right: 12px; padding-right: 12px;
} }
...@@ -54,15 +67,3 @@ ...@@ -54,15 +67,3 @@
color: red; color: red;
cursor: pointer; cursor: pointer;
} }
\ No newline at end of file
// .ant-modal-root{
// .ant-tree-switcher{
// line-height: 1;
// color:#1890FF;
// }
// }
// .menuContainer{
// width: 300px;
// padding: 10px;
// background: #1890FF;
// }
\ No newline at end of file
...@@ -7,12 +7,8 @@ const MenuConfig = props => { ...@@ -7,12 +7,8 @@ const MenuConfig = props => {
const [flag, setFlag] = useState(1); const [flag, setFlag] = useState(1);
return ( return (
<ProCard split="vertical"> <ProCard split="vertical">
<ProCard colSpan="400px">
<LeftPart /> <LeftPart />
</ProCard> {/* <ProCard><AddForm /></ProCard> */}
<ProCard>
<AddForm />
</ProCard>
</ProCard> </ProCard>
); );
}; };
......
...@@ -78,7 +78,7 @@ const UserManage = () => { ...@@ -78,7 +78,7 @@ const UserManage = () => {
const [deleteUserVisible, setDeleteUserVisible] = useState(false); const [deleteUserVisible, setDeleteUserVisible] = useState(false);
const [orgTitle, setOrgTitle] = useState('机构'); const [orgTitle, setOrgTitle] = useState('机构');
const [tableTitle, setTableTitle] = useState('机构'); const [tableTitle, setTableTitle] = useState('0');
const [orgID, setOrgID] = useState(); const [orgID, setOrgID] = useState();
const [newOrgID, setNewOrgID] = useState(); const [newOrgID, setNewOrgID] = useState();
const [currentUser, setCurrentUser] = useState({}); const [currentUser, setCurrentUser] = useState({});
...@@ -303,6 +303,12 @@ const UserManage = () => { ...@@ -303,6 +303,12 @@ const UserManage = () => {
onSelect([res[0].id]); onSelect([res[0].id]);
setTreeState(false); setTreeState(false);
} }
} else {
setTreeLoading(false);
notification.error({
message: '获取失败',
description: res.message,
});
} }
}) })
.catch(err => { .catch(err => {
...@@ -328,9 +334,9 @@ const UserManage = () => { ...@@ -328,9 +334,9 @@ const UserManage = () => {
setOrgID(props[0] || currentSelectOrg); setOrgID(props[0] || currentSelectOrg);
getOneOUUserListNew(props[0] || currentSelectOrg) getOneOUUserListNew(props[0] || currentSelectOrg)
.then(res => { .then(res => {
if (res.IsSuccess) { if (res.code === 0) {
setTableLoading(false); setTableLoading(false);
const temp = flatten(getUsers(res.Data)); const temp = flatten(getUsers(res.data));
console.log(temp); console.log(temp);
setTableTitle(temp.length); setTableTitle(temp.length);
const table = temp.map((item, index) => { const table = temp.map((item, index) => {
...@@ -341,6 +347,12 @@ const UserManage = () => { ...@@ -341,6 +347,12 @@ const UserManage = () => {
return item; return item;
}); });
setTableData(table); setTableData(table);
} else {
setTreeLoading(false);
notification.error({
message: '获取失败',
description: res.message,
});
} }
}) })
.catch(err => { .catch(err => {
......
...@@ -67,11 +67,13 @@ const SiteManage = () => { ...@@ -67,11 +67,13 @@ const SiteManage = () => {
// }); // });
// }, [flag]); // }, [flag]);
useEffect(() => { useEffect(() => {
setSpinLoading(true);
getUserRelationList({ getUserRelationList({
userID: 82, userID: 82,
_version: 9999, _version: 9999,
_dc: Date.now(), _dc: Date.now(),
}).then(res => { }).then(res => {
setSpinLoading(false);
let arr = res.roleList; let arr = res.roleList;
let arr2 = transTree2(arr); let arr2 = transTree2(arr);
console.log(arr2, 'arr2'); console.log(arr2, 'arr2');
...@@ -229,6 +231,8 @@ const SiteManage = () => { ...@@ -229,6 +231,8 @@ const SiteManage = () => {
onSelect={e => handleTreeSelect(e)} onSelect={e => handleTreeSelect(e)}
treeData={treeData} treeData={treeData}
blockNode blockNode
autoExpandParent
defaultExpandAll
/> />
</Spin> </Spin>
<AddModal <AddModal
...@@ -250,8 +254,8 @@ const SiteManage = () => { ...@@ -250,8 +254,8 @@ const SiteManage = () => {
/> />
</Card> </Card>
</Col> </Col>
<Col lg={18} md={24}> <Col lg={18}>
<Card className={styles.cardBox}> <Card style={{ marginBottom: '10px' }}>
<Row align="middle"> <Row align="middle">
<Col span={1}>搜索</Col> <Col span={1}>搜索</Col>
<Col span={8}> <Col span={8}>
...@@ -264,6 +268,8 @@ const SiteManage = () => { ...@@ -264,6 +268,8 @@ const SiteManage = () => {
/> />
</Col> </Col>
</Row> </Row>
</Card>
<Card className={styles.cardBoxR}>
{ouid && ( {ouid && (
<ListCard <ListCard
ouid={ouid} ouid={ouid}
......
.cardBox{ .cardBox{
min-height: calc(100vh - 200px); min-height: calc(100vh - 200px);
max-height: calc(100vh - 200px);
overflow-y: scroll;
} }
.ant-tree-node-content-wrapper-open{ .ant-tree-node-content-wrapper-open{
display: flex; display: flex;
...@@ -23,3 +25,8 @@ ...@@ -23,3 +25,8 @@
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
} }
.cardBoxR{
min-height: calc(100vh - 292px);
max-height: calc(100vh - 292px);
overflow-y: scroll;
}
\ No newline at end of file
...@@ -207,7 +207,7 @@ const SiteManage = () => { ...@@ -207,7 +207,7 @@ const SiteManage = () => {
<PageContainer> <PageContainer>
<GridContent> <GridContent>
<Row gutter={12}> <Row gutter={12}>
<Col lg={6} sm={6}> <Col lg={6}>
<Card className={styles.cardBox}> <Card className={styles.cardBox}>
<Spin <Spin
tip="loading...." tip="loading...."
...@@ -235,7 +235,7 @@ const SiteManage = () => { ...@@ -235,7 +235,7 @@ const SiteManage = () => {
/> />
</Card> </Card>
</Col> </Col>
<Col lg={18} sm={18}> <Col lg={18}>
<Card style={{ marginBottom: '10px' }}> <Card style={{ marginBottom: '10px' }}>
<Row align="middle"> <Row align="middle">
<Col span={1}>搜索</Col> <Col span={1}>搜索</Col>
......
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