Commit f6d0675b authored by 张烨's avatar 张烨
parents f2921cb8 8a2f48fa
...@@ -268,7 +268,7 @@ const ManagementDataBase = () => { ...@@ -268,7 +268,7 @@ const ManagementDataBase = () => {
</Spin> </Spin>
</Card> </Card>
<Card className={styles.mgTop20}> <Card className={styles.mgTop20}>
<div className={styles.tableTitle}>数据库升级记录</div> <div className={styles.tableTitle}>数据库版本记录</div>
<Table <Table
className={styles.mgTop20} className={styles.mgTop20}
columns={logColumns} columns={logColumns}
...@@ -280,7 +280,7 @@ const ManagementDataBase = () => { ...@@ -280,7 +280,7 @@ const ManagementDataBase = () => {
</Card> </Card>
<Card className={styles.mgTop20}> <Card className={styles.mgTop20}>
<div className={styles.tableTitle}> <div className={styles.tableTitle}>
表字段手动修复 手动修复
(字段长度不统一,请手动修改差异,数据可能会截断,请谨慎操作) (字段长度不统一,请手动修改差异,数据可能会截断,请谨慎操作)
</div> </div>
<Table <Table
......
...@@ -28,8 +28,12 @@ const MobileConfigPage = props => { ...@@ -28,8 +28,12 @@ const MobileConfigPage = props => {
console.log(res, 'res'); console.log(res, 'res');
if (res.code === 0) { if (res.code === 0) {
const { data } = res; const { data } = res;
if (data[0].children.length > 0) { let obj =
const title = data[0].children[0].text || '熊猫掌天下小程序'; data[0].children.length > 0 &&
data[0].children.find(item => item.id.includes('miniapp'));
console.log(obj, 'obj');
if (data[0].children.length > 0 && obj) {
const title = obj.text || '';
setShowConfig(true); setShowConfig(true);
setMiniTitle(title); setMiniTitle(title);
setPosition(['right']); setPosition(['right']);
......
...@@ -91,7 +91,8 @@ const MiniMenu = props => { ...@@ -91,7 +91,8 @@ const MiniMenu = props => {
if (res.code === 0) { if (res.code === 0) {
const { data } = res; const { data } = res;
setLoading(false); setLoading(false);
const result = data[0].children[0].children[1].children; let obj = data[0].children.find(item => item.id.includes('miniapp'));
const result = obj.children[1].children;
setTreeData(result); setTreeData(result);
console.log(result); console.log(result);
...@@ -515,7 +516,10 @@ const MiniMenu = props => { ...@@ -515,7 +516,10 @@ const MiniMenu = props => {
submitCallback={editSubmitCallback} submitCallback={editSubmitCallback}
/> />
) : ( ) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> <Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="当前未选中菜单"
/>
)} )}
</div> </div>
<div <div
......
...@@ -9,8 +9,7 @@ import { ...@@ -9,8 +9,7 @@ import {
Input, Input,
notification, notification,
Tooltip, Tooltip,
Row, Card,
Col,
Tabs, Tabs,
Button, Button,
Spin, Spin,
...@@ -1110,21 +1109,21 @@ const UserManage = () => { ...@@ -1110,21 +1109,21 @@ const UserManage = () => {
<div className={styles.contentContainer}> <div className={styles.contentContainer}>
{/* 左侧机构树 */} {/* 左侧机构树 */}
<Spin spinning={treeLoading} tip="loading..."> <Spin spinning={treeLoading} tip="loading...">
<div <Card
className={classnames({ className={classnames({
[styles.orgContainer]: true, [styles.orgContainer]: true,
[styles.orgContainerHide]: !treeVisible, [styles.orgContainerHide]: !treeVisible,
})} })}
> >
<div> <div>
<span style={{ margin: '10px' }}>机构列表</span> <span style={{ margin: '0 106px 0 10px' }}>机构列表</span>
<Tooltip title="添加顶级机构"> <Tooltip title="添加顶级机构">
<UsergroupAddOutlined <UsergroupAddOutlined
onClick={() => addOrg()} onClick={() => addOrg()}
style={{ style={{
float: 'right',
color: '#1890FF', color: '#1890FF',
fontSize: '18px', fontSize: '18px',
verticalAlign: '0.04em',
}} }}
/> />
</Tooltip> </Tooltip>
...@@ -1132,8 +1131,8 @@ const UserManage = () => { ...@@ -1132,8 +1131,8 @@ const UserManage = () => {
<Tree <Tree
showIcon="true" showIcon="true"
showLine={{ showLeafIcon: false }} showLine={{ showLeafIcon: false }}
// blockNode="true" blockNode
autoExpandParent="true" autoExpandParent
expandedKeys={[currentSelectOrg]} expandedKeys={[currentSelectOrg]}
selectedKeys={[currentSelectOrg]} selectedKeys={[currentSelectOrg]}
onSelect={onSelect} onSelect={onSelect}
...@@ -1153,7 +1152,7 @@ const UserManage = () => { ...@@ -1153,7 +1152,7 @@ const UserManage = () => {
</Tooltip> </Tooltip>
)} )}
</div> </div>
</div> </Card>
</Spin> </Spin>
{/* 右侧用户表 */} {/* 右侧用户表 */}
......
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
background: #aed8fa !important; background: #aed8fa !important;
} }
} }
.ant-modal-close-x {
line-height: 40px;
}
} }
.redText{ .redText{
color: red; color: red;
...@@ -87,18 +90,19 @@ ...@@ -87,18 +90,19 @@
} }
.contentContainer{ .contentContainer{
display: flex; display: flex;
width: 100%;
position: relative;
.orgContainer{ .orgContainer{
height: calc(100vh - 74px); height: calc(100vh - 74px);
float: left;
padding: 10px;
padding-right: 22px;
width: 240px; width: 240px;
background: white; left: 0;
overflow: auto; top: 0;
margin-right:10px; overflow-x: hidden;
margin-left:0px; margin-right: 10px;
transform: translateX(1px); position: relative;
transition: transform 0.5s; transition-property:width,left;
transition-duration: 0.5s;
white-space: nowrap;
.ant-tree{ .ant-tree{
padding-top: 6px; padding-top: 6px;
.ant-tree-switcher{ .ant-tree-switcher{
...@@ -110,27 +114,31 @@ ...@@ -110,27 +114,31 @@
} }
} }
.switcher{ .switcher{
color: #1890FF; display: block;
font-size: 18px;
position: absolute; position: absolute;
left: 220px; font-size: 18px;
top: 46%; color: #1890FF!important;
top: 45%;
right: 2px;
transform: translate(0%,-50%);
z-index: 1;
} }
} }
.orgContainerHide{ .orgContainerHide{
transform: translateX(-230px); // transform: translateX(-230px);
} left: 0px;
.userContainerHide{ top: 0;
transform: translateX(-230px); width: 20px;
margin-right: -230px;
} }
.userContainer{ .userContainer{
height: calc(100vh - 74px) !important; height: calc(100vh - 74px) !important;
flex: 1; z-index: 999;
min-width: 800px; min-width: 800px;
background: white; background: white;
transition: transform 0.5s; width: 100%;
position: relative;
transition: width 0.5s;
.ant-table-pagination{ .ant-table-pagination{
padding-right: 12px; padding-right: 12px;
background: white; background: white;
...@@ -150,7 +158,6 @@ ...@@ -150,7 +158,6 @@
.ant-table-thead tr th{ .ant-table-thead tr th{
font-weight: 600; font-weight: 600;
color:rgba(0,0,0,0.85); color:rgba(0,0,0,0.85);
// background-color: #c9e1f5;
} }
.ant-table-cell{ .ant-table-cell{
text-align:center; text-align:center;
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Form, Input, notification, Select } from 'antd'; import { Form, Input, notification, Select } from 'antd';
import SiteModal from '@/components/Modal/SiteModa'; import SiteModal from '@/components/Modal/SiteModa';
import { addRole, getRoleGroup } from '@/services/userCenter/roleManage/api'; import {
addRole,
getRoleGroup,
getWebConfigTypes,
} from '@/services/userCenter/roleManage/api';
const { Item } = Form; const { Item } = Form;
const { Option } = Select; const { Option } = Select;
const AddModal = props => { const AddModal = props => {
...@@ -9,40 +13,66 @@ const AddModal = props => { ...@@ -9,40 +13,66 @@ const AddModal = props => {
const [formLayout, setFormLayout] = useState('horizontal'); const [formLayout, setFormLayout] = useState('horizontal');
const [groupList, setGroupList] = useState([]); const [groupList, setGroupList] = useState([]);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { confirmModal, itemObj } = props; const { confirmModal, itemObj, siteList } = props;
const [typeList, setTypeList] = useState([]); // 应用类别
useEffect(() => { useEffect(() => {
itemObj.groupflag && itemObj.groupflag &&
form.setFieldsValue({ form.setFieldsValue({
group: itemObj.groupflag, group: itemObj.groupflag,
}); });
itemObj &&
form.setFieldsValue({
subSystemValue: itemObj.visibleValue,
});
return () => { return () => {
form.resetFields(); form.resetFields();
}; };
}, [itemObj]); }, [itemObj]);
useEffect(() => {
getWebConfigTypes({}).then(res => {
if (res.code === 0) {
const { data } = res;
const arr = Object.entries(data);
const list = [];
arr.map((item, index) => {
let obj = {
key: index,
value: item[0],
label: item[1],
};
list.push(obj);
});
setTypeList(list);
console.log(list);
}
console.log(res, 'resss');
});
}, [itemObj]);
const onSubmit = () => { const onSubmit = () => {
form form
.validateFields() .validateFields()
.then(res => { .then(res => {
console.log(form.getFieldsValue());
setLoading(true); setLoading(true);
addRole({ addRole({
roleName: res.roleName, roleName: res.roleName,
description: res.description, description: res.description,
group: res.group, group: res.group,
subSystemValue: itemObj.subSystemValue || itemObj.visibleValue || '', subSystemValue: res.subSystemValue || '',
_version: 9999, _version: 9999,
_dc: new Date().getTime(), _dc: new Date().getTime(),
}) })
.then(res => { .then(res => {
setLoading(false); setLoading(false);
if (res.success) { if (res.success) {
let id = res.roleID;
form.resetFields(); form.resetFields();
notification.success({ notification.success({
message: '提示', message: '提示',
duration: 3, duration: 3,
description: '新增成功', description: '新增成功',
}); });
confirmModal(); confirmModal(id);
} else { } else {
notification.error({ notification.error({
message: '提示', message: '提示',
...@@ -74,11 +104,14 @@ const AddModal = props => { ...@@ -74,11 +104,14 @@ const AddModal = props => {
// 获取分组列表 // 获取分组列表
const selectFocus = e => { const selectFocus = e => {
setGroupList([]); setGroupList([]);
console.log(form.getFieldsValue().subSystemValue);
getRoleGroup({ getRoleGroup({
_version: 9999, _version: 9999,
_dc: Date.now(), _dc: Date.now(),
subSystemValue: itemObj.subSystemValue || itemObj.visibleValue || '', // subSystemValue: itemObj.subSystemValue || itemObj.visibleValue || '',
subSystemName: itemObj.subSystemValue || itemObj.visibleValue || '', // subSystemName: itemObj.subSystemValue || itemObj.visibleValue || '',
subSystemValue: form.getFieldsValue().subSystemValue || '',
subSystemName: form.getFieldsValue().subSystemValue || '',
}) })
.then(res => { .then(res => {
if (res) { if (res) {
...@@ -96,6 +129,29 @@ const AddModal = props => { ...@@ -96,6 +129,29 @@ const AddModal = props => {
console.error(err); console.error(err);
}); });
}; };
const handleSelect = () => {
// getWebConfigTypes({}).then(res => {
// if (res.code === 0) {
// const { data } = res;
// const arr = Object.entries(data);
// const list = [];
// arr.map((item, index) => {
// let obj = {
// key: index,
// value: item[0],
// label: item[1],
// };
// list.push(obj);
// });
// setTypeList(list);
// console.log(list);
// }
// console.log(res, 'resss');
// });
};
const handleChange = e => {
console.log(e);
};
const onFinish = value => {}; const onFinish = value => {};
return ( return (
...@@ -116,6 +172,9 @@ const AddModal = props => { ...@@ -116,6 +172,9 @@ const AddModal = props => {
layout={formLayout} layout={formLayout}
onFinish={onFinish} onFinish={onFinish}
labelCol={{ span: 4 }} labelCol={{ span: 4 }}
// initialValues={{
// subSystemValue: itemObj.subSystemValue || itemObj.visibleValue,
// }}
> >
<Item <Item
label="角色名称" label="角色名称"
...@@ -129,8 +188,32 @@ const AddModal = props => { ...@@ -129,8 +188,32 @@ const AddModal = props => {
> >
<Input placeholder="请输入角色名称" /> <Input placeholder="请输入角色名称" />
</Item> </Item>
<Item label="角色类别" name="subSystemValue"> <Item
{itemObj.subSystemValue || itemObj.visibleValue} label="角色类别"
name="subSystemValue"
rules={[
{
required: true,
message: '请选择角色类别',
},
]}
>
{/* {itemObj.subSystemValue || itemObj.visibleValue} */}
<Select
placeholder="请选择角色类别"
onFocus={() => {
handleSelect();
}}
onChange={e => {
handleChange(e);
}}
>
{typeList.map(item => (
<Option value={item.value} key={item.key}>
{item.label}
</Option>
))}
</Select>
</Item> </Item>
<Item label="角色分组" name="group"> <Item label="角色分组" name="group">
<Select <Select
......
...@@ -10,6 +10,7 @@ import { ...@@ -10,6 +10,7 @@ import {
Button, Button,
Tooltip, Tooltip,
Space, Space,
Empty,
} from 'antd'; } from 'antd';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
import { import {
...@@ -22,6 +23,7 @@ import { ...@@ -22,6 +23,7 @@ import {
setMenuToRole, setMenuToRole,
getRoleGroupList, getRoleGroupList,
getMenuByRoleWithLevel, getMenuByRoleWithLevel,
getWebConfigTypes,
} from '@/services/userCenter/roleManage/api'; } from '@/services/userCenter/roleManage/api';
import ListCard, { import ListCard, {
checkChildrenByCondition, checkChildrenByCondition,
...@@ -62,6 +64,8 @@ const SiteManage = () => { ...@@ -62,6 +64,8 @@ const SiteManage = () => {
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [btnLoading, setBtnLoading] = useState(false); const [btnLoading, setBtnLoading] = useState(false);
const [mulu, setMulu] = useState(true); const [mulu, setMulu] = useState(true);
const [siteList, setSiteList] = useState([]);
const [disFlag, setDisFlag] = useState(false);
// 点击树的回调 // 点击树的回调
const handleTreeSelect = (e, treenode) => { const handleTreeSelect = (e, treenode) => {
...@@ -250,6 +254,7 @@ const SiteManage = () => { ...@@ -250,6 +254,7 @@ const SiteManage = () => {
}; };
// 确认回调 // 确认回调
const confirmModal = e => { const confirmModal = e => {
console.log(e, 'e');
setModalVisible(false); setModalVisible(false);
setFlag(flag + 1); setFlag(flag + 1);
setItemObj(''); setItemObj('');
...@@ -317,8 +322,6 @@ const SiteManage = () => { ...@@ -317,8 +322,6 @@ const SiteManage = () => {
}; };
return ( return (
<PageContainer> <PageContainer>
{/* <Row gutter={0}>
<Col span={mulu ? 4 : 0}> */}
<div <div
className={classnames({ className={classnames({
[styles.content]: true, [styles.content]: true,
...@@ -356,6 +359,7 @@ const SiteManage = () => { ...@@ -356,6 +359,7 @@ const SiteManage = () => {
onCancel={() => setModalVisible(false)} onCancel={() => setModalVisible(false)}
itemObj={itemObj} itemObj={itemObj}
confirmModal={confirmModal} confirmModal={confirmModal}
siteList={siteList}
/> />
<DelModal <DelModal
visible={delVisible} visible={delVisible}
...@@ -388,27 +392,6 @@ const SiteManage = () => { ...@@ -388,27 +392,6 @@ const SiteManage = () => {
)} )}
</div> </div>
</Card> </Card>
{/* <div>
{mulu && (
<Tooltip title="隐藏角色栏" className={styles.hide}>
<DoubleLeftOutlined onClick={() => handleHide()} />
</Tooltip>
)}
</div> */}
{/* </Col> */}
{/* <Col span={mulu ? 0 : 1}>
{mulu && (
<Tooltip title="隐藏角色栏" className={styles.hide}>
<DoubleLeftOutlined onClick={() => handleHide()} />
</Tooltip>
)}
{!mulu && (
<Tooltip title="显示角色栏" className={styles.hide}>
<DoubleRightOutlined onClick={() => handleHide()} />
</Tooltip>
)}
</Col> */}
{/* <Col span={mulu ? 20 : 23}> */}
<div <div
className={classnames({ className={classnames({
[styles.boxR]: true, [styles.boxR]: true,
...@@ -440,9 +423,19 @@ const SiteManage = () => { ...@@ -440,9 +423,19 @@ const SiteManage = () => {
onClick={() => { onClick={() => {
handleAdd(); handleAdd();
}} }}
disabled={itemObj.roleID}
> >
新增角色 新增角色
</Button> </Button>
<Button
type="primary"
onClick={() => {
groupEdit();
}}
disabled={!itemObj.groupflag}
>
编辑分组
</Button>
<Button <Button
type="primary" type="primary"
disabled={!itemObj.roleID} disabled={!itemObj.roleID}
...@@ -462,15 +455,6 @@ const SiteManage = () => { ...@@ -462,15 +455,6 @@ const SiteManage = () => {
> >
删除角色 删除角色
</Button> </Button>
<Button
type="primary"
onClick={() => {
groupEdit();
}}
disabled={!itemObj.groupflag}
>
编辑分组
</Button>
</Space> </Space>
</Col> </Col>
</Row> </Row>
...@@ -481,7 +465,7 @@ const SiteManage = () => { ...@@ -481,7 +465,7 @@ const SiteManage = () => {
[styles.cardBoxR]: true, [styles.cardBoxR]: true,
})} })}
> >
{roleID && ( {roleID ? (
<ListCard <ListCard
loading={loading} loading={loading}
checkList={valueList} checkList={valueList}
...@@ -491,11 +475,14 @@ const SiteManage = () => { ...@@ -491,11 +475,14 @@ const SiteManage = () => {
btnLoading={btnLoading} btnLoading={btnLoading}
hasData={hasData} hasData={hasData}
/> />
) : (
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="当前未选中角色"
/>
)} )}
</Card> </Card>
</div> </div>
{/* </Col>
</Row> */}
</div> </div>
</PageContainer> </PageContainer>
); );
......
...@@ -57,3 +57,7 @@ export const setRoleGroupName = params => ...@@ -57,3 +57,7 @@ export const setRoleGroupName = params =>
// 保存选择的功能 // 保存选择的功能
export const getMenuByRoleWithLevel = params => export const getMenuByRoleWithLevel = params =>
get('/Cityinterface/rest/services/OMS.svc/W4_GetMenuByRoleWithLevel', params); get('/Cityinterface/rest/services/OMS.svc/W4_GetMenuByRoleWithLevel', params);
// 获取角色类别
export const getWebConfigTypes = params =>
get(`${PUBLISH_SERVICE}/PlatformCenter/GetWebConfigTypes`, params);
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